diff --git a/main/java/shkd/repc/recon/opplugin/WorkloadcfSubmitOPPlugin.java b/main/java/shkd/repc/recon/opplugin/WorkloadcfSubmitOPPlugin.java new file mode 100644 index 0000000..2d9b71e --- /dev/null +++ b/main/java/shkd/repc/recon/opplugin/WorkloadcfSubmitOPPlugin.java @@ -0,0 +1,35 @@ +package shkd.repc.recon.opplugin; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.servicehelper.operation.SaveServiceHelper; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +public class WorkloadcfSubmitOPPlugin extends AbstractOperationServicePlugIn { + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + + String operationKey = e.getOperationKey(); + if ("submit".equals(operationKey)){ + DynamicObject[] dataEntities = e.getDataEntities(); + DynamicObject dataEntity = dataEntities[0]; + BigDecimal latestoriprice = dataEntity.getBigDecimal("latestoriprice"); // 合同最新造价 + BigDecimal sumworkloadamt = dataEntity.getBigDecimal("sumworkloadamt"); // 累计已完成产值(含税) + + BigDecimal result = BigDecimal.ZERO; // 初始化结果 + if (latestoriprice != null && latestoriprice.compareTo(BigDecimal.ZERO) != 0) { // 确保价格不为0且不为null + if (sumworkloadamt != null && sumworkloadamt.compareTo(BigDecimal.ZERO) != 0) { // 确保累计已完成产值不为0且不为null + // 计算: (sumworkloadamt / latestoriprice) * 100 + result = sumworkloadamt.divide(latestoriprice, 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); // 四舍五入到10位小数, 乘以100 + } + } + dataEntity.set("qeug_czzb", result); // 累计已完成产值占比 + SaveServiceHelper.save(new DynamicObject[]{dataEntity}); + } + } +} diff --git a/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java b/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java index 6ef3789..9e48be6 100644 --- a/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java +++ b/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java @@ -34,9 +34,10 @@ public class RegisteredFinishregOPPlugin extends AbstractOperationServicePlugIn regSupplier.set("qeug_regnumberes",resp_registered.getString("qeug_regnumberes"));//企业注册号 regSupplier.set("qeug_orgnumberes",resp_registered.getString("qeug_orgnumberes"));//组织机构代码 regSupplier.set("qeug_regstatuses",resp_registered.getString("qeug_regstatuses"));//经营状态 + regSupplier.set("qeug_linkman",resp_registered.getString("qeug_linkman"));//外部联系人 // regSupplier.set("recommender",resp_registered.getDynamicObject("recommender"));//外部联系人 - regSupplier.set("qeug_recommender",resp_registered.getDynamicObject("qeug_recommender"));//内部推荐人 + regSupplier.set("qeug_recommender",resp_registered.getString("qeug_recommender"));//内部推荐人 SaveServiceHelper.save(new DynamicObject[]{regSupplier}); DobeDWUtils.saveLog("注册供应商", "注册供应商",null, null, diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index 0ab03bc..4ffcafc 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -242,7 +242,9 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { List userIds = message.getUserIds(); // 审批人ID集合 List approversLists = getApprovers(userIds, approvers); //获取任务创建人 // 信息发送人 - Long startUserId = message.getSenderId(); +// ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getDecisionType(); + Long startUserId = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getOwnerId(); +// Long startUserId = message.getSenderId(); // Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id String startNumber = ""; String startName = "";