From 2d302f91d3cd1f0ece882f8b63361d23e483d39f Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Wed, 20 Nov 2024 10:20:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BA=A7=E5=80=BC=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E6=94=B9=E5=8F=98=E8=AE=A1=E7=AE=97=E6=AF=94=E4=BE=8B?= =?UTF-8?q?,=E5=BE=85=E5=8A=9E=E6=B6=88=E6=81=AF=E4=BC=98=E5=8C=96,?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=AE=8C=E6=88=90=E6=97=B6=E5=B0=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=90=BA=E5=B8=A6=E5=88=B0=E6=BD=9C=E5=9C=A8=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opplugin/WorkloadcfSubmitOPPlugin.java | 35 +++++++++++++++++++ .../opplugin/RegisteredFinishregOPPlugin.java | 3 +- .../todotask/todoZyTaskServiceHandler.java | 4 ++- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 main/java/shkd/repc/recon/opplugin/WorkloadcfSubmitOPPlugin.java 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 = ""; From d80e5667a3f59ac1650e16e8870329d84807adfd Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Wed, 20 Nov 2024 13:43:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A8=E9=80=81OA?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resm/opplugin/PushOASupplierOPPlugin.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java b/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java index 790517f..2faec44 100644 --- a/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java +++ b/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java @@ -77,7 +77,10 @@ public class PushOASupplierOPPlugin extends AbstractOperationServicePlugIn { String code = official_supplier.getString("qeug_oacode"); String name = official_supplier.getString("name"); - String taxpayerid = official_supplier.getString("tx_register_no"); + String taxpayerid = official_supplier.getString("tx_register_no");//纳税人识别号 + String societycreditcode = official_supplier.getString("societycreditcode");//统一社会信用代码 + String artificialpersoncard = official_supplier.getString("artificialpersoncard");//法人代表身份证号码 + String persontype = official_supplier.getString("persontype");//法人类型 String shortname = official_supplier.getString("simplename"); String legalbody = official_supplier.getString("artificialperson"); Date createTime = official_supplier.getDate("createtime"); @@ -89,7 +92,13 @@ public class PushOASupplierOPPlugin extends AbstractOperationServicePlugIn { customerBody = new JSONObject(); customerBody.put("code", code);//"客户编码:传递OA回执的code,如果没有则为空,OA判断新增后返回code", customerBody.put("name", name);//"客户名称", - customerBody.put("taxpayerid", taxpayerid);//"纳税人登记号/身份证号 唯一值不可变", + //PERSONAL 个人 + if ("PERSONAL".equals(persontype)) { + customerBody.put("taxpayerid", artificialpersoncard);//"纳税人登记号/身份证号 唯一值不可变", + }else { + customerBody.put("taxpayerid", societycreditcode);//"纳税人登记号/身份证号 唯一值不可变", + + } customerBody.put("shortname", shortname);//"客户简称", customerBody.put("custprop", "0");//"客户类型:默认0", customerBody.put("enablestate", "2");//"客户状态:默认2", @@ -118,7 +127,7 @@ public class PushOASupplierOPPlugin extends AbstractOperationServicePlugIn { } custBankaccBody.put("accname", entry_bank.getString("accountname"));//"银行账号名称", custBankaccBody.put("pk_banktype", "");//todo:"银行类别:例如招商银行", - String persontype = entry_bank.getString("persontype");//法人类型 +// String persontype = entry_bank.getString("persontype");//法人类型 //法人企业 LEGALENTERPRISE //非法人企业 UNINCORPORATED //非企业单位 NONENTERPRISE