|
|
@@ -5,7 +5,9 @@ import kd.bos.dataentity.entity.DynamicObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.dataentity.metadata.IDataEntityProperty;
|
|
|
import kd.bos.dataentity.metadata.clr.DataEntityPropertyCollection;
|
|
|
+import kd.bos.dataentity.utils.ObjectUtils;
|
|
|
import kd.bos.entity.MainEntityType;
|
|
|
+import kd.bos.entity.operate.result.IOperateInfo;
|
|
|
import kd.bos.entity.operate.result.OperationResult;
|
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
|
|
@@ -23,6 +25,7 @@ import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.StringJoiner;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -109,18 +112,19 @@ public abstract class AbstractSalaryStdChgOpPlugin extends AbstractOperationServ
|
|
|
OperateOption option = OperateOption.create();
|
|
|
//修改和删除不校验是否是暂存状态(只能修改暂存的数据。只能删除暂存的数据。)
|
|
|
option.setVariableValue("forceNoAudit","true");
|
|
|
-
|
|
|
// 执行保存操作
|
|
|
OperationResult saveResult = SaveServiceHelper.saveOperate(getEntityId(), load, option);
|
|
|
if (saveResult != null && !saveResult.isSuccess()) {
|
|
|
- throw new ValidationException(StrFormatter.format("回写【{}】失败,原因:{}",getEntityName(),saveResult.getMessage()));
|
|
|
- }
|
|
|
-
|
|
|
- // 执行提交操作
|
|
|
- OperationResult submitResult = OperationServiceHelper.executeOperate("submit", getEntityId(), load,OperateOption.create());
|
|
|
- if (submitResult != null && !submitResult.isSuccess()) {
|
|
|
- throw new ValidationException(StrFormatter.format("回写【{}】失败,原因:{}",getEntityName(),submitResult.getMessage()));
|
|
|
+ StringJoiner errorMsg = new StringJoiner(";");
|
|
|
+ for (IOperateInfo error : operationResult.getAllErrorOrValidateInfo()) {
|
|
|
+ errorMsg.add(error.getMessage());
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(operationResult.getMessage())) {
|
|
|
+ errorMsg.add(operationResult.getMessage());
|
|
|
+ }
|
|
|
+ throw new ValidationException(StrFormatter.format("回写【{}】失败,原因:{}",getEntityName(),errorMsg.toString()));
|
|
|
}
|
|
|
+
|
|
|
/*} else {
|
|
|
throw new ValidationException(StrFormatter.format("回写【{}】失败,原因:{}",getEntityName(),unsubmitResult.getMessage()));
|
|
|
}*/
|