|
|
@@ -10,10 +10,14 @@ import kd.bos.entity.EntityMetadataCache;
|
|
|
import kd.bos.entity.MainEntityType;
|
|
|
import kd.bos.entity.constant.StatusEnum;
|
|
|
import kd.bos.entity.operate.result.OperationResult;
|
|
|
+import kd.bos.form.CloseCallBack;
|
|
|
+import kd.bos.form.FormShowParameter;
|
|
|
import kd.bos.form.IFormView;
|
|
|
import kd.bos.form.IPageCache;
|
|
|
import kd.bos.form.MessageBoxOptions;
|
|
|
+import kd.bos.form.ShowType;
|
|
|
import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
+import kd.bos.form.events.ClosedCallBackEvent;
|
|
|
import kd.bos.list.plugin.AbstractListPlugin;
|
|
|
import kd.bos.mvc.SessionManager;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
@@ -25,6 +29,7 @@ import kd.hr.hbp.common.model.AuthorizedOrgResultWithSub;
|
|
|
import kd.sdk.hr.hbp.business.helper.permission.HRPermissionServiceHelper;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
|
+import nckd.jxccl.base.common.utils.ConvertUtil;
|
|
|
import nckd.jxccl.base.common.utils.DateUtil;
|
|
|
import nckd.jxccl.base.common.utils.QueryFieldBuilder;
|
|
|
import nckd.jxccl.base.common.utils.ShowOperExecuteResult;
|
|
|
@@ -55,7 +60,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Plugin {
|
|
|
|
|
|
- @Override
|
|
|
+ /* @Override
|
|
|
public void afterDoOperation(AfterDoOperationEventArgs e) {
|
|
|
String operateKey = e.getOperateKey();
|
|
|
if(e.getOperationResult() != null && e.getOperationResult().isSuccess()){
|
|
|
@@ -64,6 +69,38 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
|
|
|
loadParTyPosition();
|
|
|
}
|
|
|
}
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterDoOperation(AfterDoOperationEventArgs e) {
|
|
|
+ String operateKey = e.getOperateKey();
|
|
|
+ if(e.getOperationResult() != null && e.getOperationResult().isSuccess()){
|
|
|
+ if(MasConstant.LOADPARTYPOSITION_OP.equals(operateKey)){
|
|
|
+ //载入党政职务履历
|
|
|
+ FormShowParameter showParameter = new FormShowParameter();
|
|
|
+ showParameter.setFormId(MasConstant.LOADPPDATEPOPUP_ENTITYID);
|
|
|
+ showParameter.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
+ showParameter.setCaption("载入党政职务履历");
|
|
|
+ showParameter.setSendToClient(true);
|
|
|
+ showParameter.setCloseCallBack(new CloseCallBack(this, MasConstant.LOADPPDATEPOPUP_ENTITYID));
|
|
|
+ this.getView().showForm(showParameter);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void closedCallBack(ClosedCallBackEvent closedCallBackEvent) {
|
|
|
+ String actionId = closedCallBackEvent.getActionId();
|
|
|
+ if(MasConstant.LOADPPDATEPOPUP_ENTITYID.equalsIgnoreCase(actionId)){
|
|
|
+ Object returnData = closedCallBackEvent.getReturnData();
|
|
|
+ if(returnData != null) {
|
|
|
+ Map<String, Object> map = ConvertUtil.toMap(returnData);
|
|
|
+ Date date = ConvertUtil.toDate(map.get("date"));
|
|
|
+ DynamicObjectCollection mulPayUnit = ConvertUtil.toDynamicObjectCollectionOrNull(map.get(MasConstant.NCKD_MULPAYUNIT));
|
|
|
+ loadParTyPosition(date,mulPayUnit);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -72,7 +109,7 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
|
|
|
* @author W.Y.C
|
|
|
* @date: 2025/11/27 18:40
|
|
|
*/
|
|
|
- private void loadParTyPosition(){
|
|
|
+ private void loadParTyPosition(Date date,DynamicObjectCollection payUnitColl){
|
|
|
/*假设今年是2025年,那么符合查询条件的数据应该满足:
|
|
|
开始日期 <= 2025-12-31 且 结束日期 >= 2025-01-01
|
|
|
符合条件的例子:
|
|
|
@@ -88,7 +125,15 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
|
|
|
开始日期: 2020-01-01, 结束日期: 2030-12-31
|
|
|
长期有效,覆盖今年全年
|
|
|
*/
|
|
|
- LocalDateTime now = DateUtil.now();
|
|
|
+ List<Long> payUnitIdList = new ArrayList<>();
|
|
|
+ if(payUnitColl != null && !payUnitColl.isEmpty()){
|
|
|
+ for (DynamicObject item : payUnitColl) {
|
|
|
+ // 获取基础资料的动态对象(包含基础资料的详细信息,如名称、编码等)
|
|
|
+ long id = item.getLong(FormConstant.FBASEDATAID_ID_KEY);
|
|
|
+ payUnitIdList.add(id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LocalDateTime now = ConvertUtil.toLocalDateTime(date);
|
|
|
|
|
|
LocalDateTime beginYear = DateUtil.beginOfYear(now);
|
|
|
LocalDateTime endYear = DateUtil.endOfYear(now);
|
|
|
@@ -129,10 +174,11 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
|
|
|
.add(MasConstant.NCKD_ISDIRCADRE)
|
|
|
.addIdNumberName(MasConstant.NCKD_ORGPOSGRD)
|
|
|
.addIdNumberName(MasConstant.EMPLOYEE_KEY)
|
|
|
- .addIdNumberName(MasConstant.NCKD_ORG)
|
|
|
.orderDesc(MasConstant.STARTDATE, MasConstant.ENDDATE);
|
|
|
QFilter allPartyPoshFilter = new QFilter(MasConstant.EMPLOYEE_KEY, QCP.not_in, employeeIds);
|
|
|
- //TODO 法人岗位层级为高管;
|
|
|
+ if(!payUnitIdList.isEmpty()){
|
|
|
+ allPartyPoshFilter.and(String.join(MasConstant.NCKD_PAYUNIT,FormConstant.ID_KEY), QCP.in, payUnitIdList);
|
|
|
+ }
|
|
|
DynamicObjectCollection allPartyPoshQuery = QueryServiceHelper.query(FormConstant.NCKD_HRPI_PARTYPOSH, partyPoshFieldBuilder.buildSelect(), new QFilter[]{allPartyPoshFilter});
|
|
|
//按员工ID分组
|
|
|
Map<Long, List<DynamicObject>> groupedPartyPoshQuery = allPartyPoshQuery.stream()
|
|
|
@@ -302,7 +348,7 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
|
|
|
employee.set(FormConstant.NAME_KEY, partyPosh.getString(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.NAME_KEY)));
|
|
|
}
|
|
|
//所属二级单位(发薪单位)
|
|
|
- long payOrgId = partyPosh.getLong(String.join(".", FormConstant.NCKD_ORG, FormConstant.ID_KEY));
|
|
|
+ long payOrgId = partyPosh.getLong(String.join(".", MasConstant.NCKD_PAYUNIT, FormConstant.ID_KEY));
|
|
|
DynamicObject payOrg = EntityHelper.newEntity(FormConstant.ADMINORGHR_ENTITYID, payOrgId);
|
|
|
newSubCoHeadService.set(MasConstant.NCKD_PAYUNIT, payOrg);
|
|
|
//职务
|