|
@@ -4,9 +4,11 @@ import kd.bos.context.RequestContext;
|
|
|
import kd.bos.dataentity.OperateOption;
|
|
import kd.bos.dataentity.OperateOption;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
|
|
+import kd.bos.dataentity.utils.ObjectUtils;
|
|
|
import kd.bos.entity.EntityMetadataCache;
|
|
import kd.bos.entity.EntityMetadataCache;
|
|
|
import kd.bos.entity.ExtendedDataEntity;
|
|
import kd.bos.entity.ExtendedDataEntity;
|
|
|
import kd.bos.entity.MainEntityType;
|
|
import kd.bos.entity.MainEntityType;
|
|
|
|
|
+import kd.bos.entity.operate.result.IOperateInfo;
|
|
|
import kd.bos.entity.operate.result.OperationResult;
|
|
import kd.bos.entity.operate.result.OperationResult;
|
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
|
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
|
@@ -20,6 +22,7 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
import kd.sdk.plugin.Plugin;
|
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
|
import nckd.jxccl.base.common.enums.ijp.TalentTypeEnum;
|
|
import nckd.jxccl.base.common.enums.ijp.TalentTypeEnum;
|
|
|
|
|
+import nckd.jxccl.base.common.exception.ValidationException;
|
|
|
import nckd.jxccl.base.common.utils.DateUtil;
|
|
import nckd.jxccl.base.common.utils.DateUtil;
|
|
|
import nckd.jxccl.base.common.utils.QueryFieldBuilder;
|
|
import nckd.jxccl.base.common.utils.QueryFieldBuilder;
|
|
|
import nckd.jxccl.base.common.utils.StrFormatter;
|
|
import nckd.jxccl.base.common.utils.StrFormatter;
|
|
@@ -36,6 +39,7 @@ import java.util.HashSet;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
+import java.util.StringJoiner;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -176,12 +180,33 @@ public class IntJobPostAuditedOpPlugin extends AbstractOperationServicePlugIn im
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(!savedRecords.isEmpty()){
|
|
if(!savedRecords.isEmpty()){
|
|
|
|
|
+ //保存记录
|
|
|
OperationResult operationResult = SaveServiceHelper.saveOperate(IntJobPostConstant.INTJOBPOSTRECORD_ENTITYID, savedRecords.toArray(new DynamicObject[0]), OperateOption.create());
|
|
OperationResult operationResult = SaveServiceHelper.saveOperate(IntJobPostConstant.INTJOBPOSTRECORD_ENTITYID, savedRecords.toArray(new DynamicObject[0]), OperateOption.create());
|
|
|
if(operationResult.isSuccess()){
|
|
if(operationResult.isSuccess()){
|
|
|
//新增实体
|
|
//新增实体
|
|
|
-// OperationResult operationResult = SaveServiceHelper.saveOperate(IntJobPostConstant.INTJOBPOSTLOCUS_ENTITYID, savedRecords.toArray(new DynamicObject[0]), OperateOption.create());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ savedLocus.addAll(savedLocusMap.values());
|
|
|
|
|
+ OperationResult locusOperationResult = SaveServiceHelper.saveOperate(IntJobPostConstant.INTJOBPOSTLOCUS_ENTITYID, savedLocus.toArray(new DynamicObject[0]), OperateOption.create());
|
|
|
|
|
+ if(!locusOperationResult.isSuccess()){
|
|
|
|
|
+ StringJoiner errorMsg = new StringJoiner("\n");
|
|
|
|
|
+ for (IOperateInfo error : locusOperationResult.getAllErrorOrValidateInfo()) {
|
|
|
|
|
+ errorMsg.add(error.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(locusOperationResult.getMessage())) {
|
|
|
|
|
+ errorMsg.add(locusOperationResult.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ throw new ValidationException("保存职位档案失败,原因:" + errorMsg.toString());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ }else{
|
|
|
|
|
+ StringJoiner errorMsg = new StringJoiner("\n");
|
|
|
|
|
+ for (IOperateInfo error : operationResult.getAllErrorOrValidateInfo()) {
|
|
|
|
|
+ errorMsg.add(error.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(operationResult.getMessage())) {
|
|
|
|
|
+ errorMsg.add(operationResult.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ throw new ValidationException("保存职位档案失败,原因:" + errorMsg.toString());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|