|
|
@@ -35,6 +35,7 @@ import nckd.jxccl.hr.psms.common.PositionStructureConstant;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.StringJoiner;
|
|
|
@@ -127,6 +128,22 @@ public class MgrAppointMgmtTransferAfterEffectOp extends AbstractOperationServic
|
|
|
|
|
|
List<DynamicObject> newMgrAppointMgmt = new ArrayList<>();
|
|
|
List<DynamicObject> endMgrAppointMgmt = new ArrayList<>();
|
|
|
+ List<Long> afectPersonIdList = new ArrayList<>();
|
|
|
+ for (DynamicObject dataEntity : e.getDataEntities()) {
|
|
|
+ DynamicObject afterPosition = dataEntity.getDynamicObject(FormConstant.APOSITION);
|
|
|
+ afectPersonIdList.add(afterPosition.getLong(FormConstant.ID_KEY));
|
|
|
+ }
|
|
|
+ Map<Long, DynamicObject> positionMap = new HashMap<>();
|
|
|
+ if(!afectPersonIdList.isEmpty()){
|
|
|
+ MainEntityType positionHrEntityType = EntityMetadataCache.getDataEntityType(FormConstant.HBPM_POSITIONHR);
|
|
|
+ DynamicObject[] positionArray = BusinessDataServiceHelper.load(afectPersonIdList.toArray(new Long[0]), positionHrEntityType);
|
|
|
+ positionMap = java.util.Arrays.stream(positionArray)
|
|
|
+ .collect(Collectors.toMap(
|
|
|
+ obj -> obj.getLong(FormConstant.ID_KEY),
|
|
|
+ obj -> obj,
|
|
|
+ (existing, replacement) -> existing // 如果有重复key,保留现有的值
|
|
|
+ ));
|
|
|
+ }
|
|
|
for (DynamicObject dataEntity : e.getDataEntities()) {
|
|
|
//人员
|
|
|
DynamicObject employee = dataEntity.getDynamicObject(FormConstant.BB_EM_TID);
|
|
|
@@ -137,8 +154,9 @@ public class MgrAppointMgmtTransferAfterEffectOp extends AbstractOperationServic
|
|
|
DynamicObject beforeJobSeq = beforePosition.getDynamicObject(FormConstant.NCKD_JOBSEQ);*/
|
|
|
//调入岗位
|
|
|
DynamicObject afterPosition = dataEntity.getDynamicObject(FormConstant.APOSITION);
|
|
|
+ DynamicObject dbAfterPosition = positionMap.get(afterPosition.getLong(FormConstant.ID_KEY));
|
|
|
//调入岗位
|
|
|
- DynamicObject afterJobSeq = afterPosition.getDynamicObject(FormConstant.NCKD_JOBSEQ);
|
|
|
+ DynamicObject afterJobSeq = dbAfterPosition.getDynamicObject(FormConstant.NCKD_JOBSEQ);
|
|
|
String afterJobSeqNumber = afterJobSeq != null ? afterJobSeq.getString(FormConstant.NUMBER_KEY) : null;
|
|
|
//调动生效日期
|
|
|
Date effectiveDate = dataEntity.getDate(FormConstant.B_EFFECTIVEDATE);
|