|
@@ -8,12 +8,15 @@ import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
|
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
|
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
|
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
|
|
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
|
|
|
|
|
+import kd.bos.exception.KDBizException;
|
|
|
import kd.bos.logging.Log;
|
|
import kd.bos.logging.Log;
|
|
|
import kd.bos.logging.LogFactory;
|
|
import kd.bos.logging.LogFactory;
|
|
|
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
|
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
import kd.sdk.plugin.Plugin;
|
|
|
import nckd.jxccl.sit.hcsi.business.coordination.SinsurCoordSplitService;
|
|
import nckd.jxccl.sit.hcsi.business.coordination.SinsurCoordSplitService;
|
|
|
|
|
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 单据操作插件
|
|
* 单据操作插件
|
|
|
*/
|
|
*/
|
|
@@ -30,6 +33,16 @@ public class SinsurEmpCoordSplitOp extends AbstractOperationServicePlugIn implem
|
|
|
@Override
|
|
@Override
|
|
|
public void beginOperationTransaction(BeginOperationTransactionArgs e) {
|
|
public void beginOperationTransaction(BeginOperationTransactionArgs e) {
|
|
|
super.beginOperationTransaction(e);
|
|
super.beginOperationTransaction(e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void endOperationTransaction(EndOperationTransactionArgs e) {
|
|
|
|
|
+ super.endOperationTransaction(e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
|
|
|
+ super.afterExecuteOperationTransaction(e);
|
|
|
DynamicObject[] bills = e.getDataEntities();
|
|
DynamicObject[] bills = e.getDataEntities();
|
|
|
for(DynamicObject bill : bills) {
|
|
for(DynamicObject bill : bills) {
|
|
|
SinsurCoordSplitService service = new SinsurCoordSplitService(bill.getLong("id"), bill);
|
|
SinsurCoordSplitService service = new SinsurCoordSplitService(bill.getLong("id"), bill);
|
|
@@ -40,18 +53,14 @@ public class SinsurEmpCoordSplitOp extends AbstractOperationServicePlugIn implem
|
|
|
OperateOption option = OperateOption.create();
|
|
OperateOption option = OperateOption.create();
|
|
|
OperationResult result = OperationServiceHelper.executeOperate("confirmeffect", "hpdi_empcoordverifbill3", new DynamicObject[]{bill}, option);
|
|
OperationResult result = OperationServiceHelper.executeOperate("confirmeffect", "hpdi_empcoordverifbill3", new DynamicObject[]{bill}, option);
|
|
|
logger.info("标品提交生效结果:" + result.isSuccess());
|
|
logger.info("标品提交生效结果:" + result.isSuccess());
|
|
|
-
|
|
|
|
|
|
|
+ if (!result.isSuccess()) {
|
|
|
|
|
+ String errorMessage = result.getAllErrorInfo().stream()
|
|
|
|
|
+ .map(dyx -> dyx.getMessage())
|
|
|
|
|
+ .collect(Collectors.joining(", "));
|
|
|
|
|
+ logger.info("标品提交生效错误:" + errorMessage);
|
|
|
|
|
+ throw new KDBizException(errorMessage);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void endOperationTransaction(EndOperationTransactionArgs e) {
|
|
|
|
|
- super.endOperationTransaction(e);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
|
|
|
- super.afterExecuteOperationTransaction(e);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|