|
|
@@ -28,6 +28,7 @@ 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.StrFormatter;
|
|
|
+import nckd.jxccl.base.hrpi.helper.EmpPosOrgRelHelper;
|
|
|
import nckd.jxccl.opmc.pm.common.PerfManagerFormConstant;
|
|
|
import nckd.jxccl.opmc.pm.helper.PerfManagerHelper;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -503,10 +504,13 @@ public class PerfManagerSaveOpPlugin extends AbstractOperationServicePlugIn impl
|
|
|
Boolean isCycleGenerate = ConvertUtil.toBoolean(this.getOption().getVariableValue("cyclegenerate",StringUtils.EMPTY),Boolean.FALSE);
|
|
|
Boolean isUpdate = ConvertUtil.toBoolean(this.getOption().getVariableValue("isUpdate",StringUtils.EMPTY),Boolean.FALSE);
|
|
|
List<DynamicObject> updatePerManager = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
for (DynamicObject dataEntity : e.getDataEntities()) {
|
|
|
long id = dataEntity.getLong(FormConstant.ID_KEY);
|
|
|
DynamicObject person = dataEntity.getDynamicObject(FormConstant.NCKD_PERSON);
|
|
|
- person = person == null ? dataEntity.getDynamicObject(FormConstant.NCKD_EMPPOSORGREL).getDynamicObject(FormConstant.EMPLOYEE_KEY) : person;
|
|
|
+ DynamicObject empPosOrgRel = dataEntity.getDynamicObject(FormConstant.NCKD_EMPPOSORGREL);
|
|
|
+ person = person == null ? empPosOrgRel.getDynamicObject(FormConstant.EMPLOYEE_KEY) : person;
|
|
|
dataEntity.set(FormConstant.NCKD_PERSON, person);
|
|
|
LocalDateTime beginYear = DateUtil.toLocalDateTime(dataEntity.getDate(PerfManagerFormConstant.NCKD_BEGINYEAR));
|
|
|
LocalDateTime endYear = DateUtil.toLocalDateTime(dataEntity.getDate(PerfManagerFormConstant.NCKD_ENDYEAR));
|
|
|
@@ -521,6 +525,24 @@ public class PerfManagerSaveOpPlugin extends AbstractOperationServicePlugIn impl
|
|
|
if(StringUtils.isBlank(name)){
|
|
|
dataEntity.set(FormConstant.NAME_KEY, StrFormatter.format("【{}】{}~{}的考核周期",personName,beginYear.getYear(),endYear.getYear()));
|
|
|
}
|
|
|
+ DynamicObject dep = dataEntity.getDynamicObject(FormConstant.NCKD_DEP);
|
|
|
+ if(dep == null){
|
|
|
+ dataEntity.set(FormConstant.NCKD_DEP, empPosOrgRel.getDynamicObject(FormConstant.ADMINORG));
|
|
|
+ }
|
|
|
+
|
|
|
+ long depId = dataEntity.getLong(String.join(".", FormConstant.NCKD_DEP, FormConstant.ID_KEY));
|
|
|
+ if(depId <= 0){
|
|
|
+ dataEntity.set(FormConstant.NCKD_DEP, empPosOrgRel.getDynamicObject(FormConstant.ADMINORG));
|
|
|
+ }
|
|
|
+ if(dataEntity.containsProperty(FormConstant.CREATEORG_KEY)){
|
|
|
+ dataEntity.set(FormConstant.CREATEORG_KEY, null);
|
|
|
+ }
|
|
|
+ if(dataEntity.containsProperty(FormConstant.USEORG_KEY)){
|
|
|
+ dataEntity.set(FormConstant.USEORG_KEY, null);
|
|
|
+ }
|
|
|
+ if(dataEntity.containsProperty(FormConstant.ORG_KEY)){
|
|
|
+ dataEntity.set(FormConstant.ORG_KEY, null);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/*DynamicObject lastPerfManager = lastPerfManagerMap.get(personId);
|