From 6625d3699a4e4891ab0c55a397085c68e58f2cec Mon Sep 17 00:00:00 2001 From: ggxl <194689125@qq.com> Date: Fri, 15 Nov 2024 11:21:50 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E8=AF=84?= =?UTF-8?q?=E4=BC=B0=E6=B8=85=E5=8D=95=E9=87=8C=E7=9A=84=E5=90=88=E5=90=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=B9=E6=8D=AE=E8=AF=84=E4=BC=B0=E6=9C=9F?= =?UTF-8?q?=E9=97=B4=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContractListDateFilterPlugin.java | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 main/java/shkd/repc/resm/formplugin/ContractListDateFilterPlugin.java diff --git a/main/java/shkd/repc/resm/formplugin/ContractListDateFilterPlugin.java b/main/java/shkd/repc/resm/formplugin/ContractListDateFilterPlugin.java new file mode 100644 index 0000000..a24289d --- /dev/null +++ b/main/java/shkd/repc/resm/formplugin/ContractListDateFilterPlugin.java @@ -0,0 +1,149 @@ +package shkd.repc.resm.formplugin; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DataEntityBase; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.resource.ResManager; +import kd.bos.dataentity.utils.StringUtils; +import kd.bos.entity.EntityMetadataCache; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.form.container.Tab; +import kd.bos.form.control.Control; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.repc.common.util.resm.eval.EvalUtils; +import kd.sdk.plugin.Plugin; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 单据界面插件 + */ +public class ContractListDateFilterPlugin extends AbstractBillPlugIn implements Plugin { + + /* + * 评估计划-生成的评估清单里的合同增加根据评估期间过滤 + * 合同执行中:合同签约日期 <= 评估结束日期 + * 合同已结算:评估开始日期 <= 合同结算日期 <= 评估结束日期 + * */ + + @Override + public void registerListener(EventObject e) { + this.addClickListeners("btn_contractlist"); + } + + @Override + public void click(EventObject evt) { + super.click(evt); + IDataModel model = this.getModel(); + Date startTime = (Date) model.getValue("interval_starttime");// 评估开始日期 + Date endTime = (Date) model.getValue("interval_endtime");// 评估结束日期 + + DynamicObjectCollection contractEntries = model.getEntryEntity("contract_entry"); + if (contractEntries != null && !contractEntries.isEmpty()) { + if (endTime != null) { + ArrayList deleteEntries = new ArrayList<>(); + for (DynamicObject contractEntry : contractEntries) { + DynamicObject eyContract = contractEntry.getDynamicObject("ey_contract"); + String evalTypeNum = contractEntry.getString("ey_eval_type.number");// 评估类型 + if (eyContract != null) { + DynamicObject contract = BusinessDataServiceHelper.loadSingle(eyContract.getPkValue(), "resm_contract_book", "id,sign_date,contract,ismaincontract,maincontract"); + if ("008".equals(evalTypeNum)) {// 执行中 + Date signDate = contract.getDate("sign_date");// 签约日期 + if (signDate != null) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(signDate); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + signDate = calendar.getTime(); + + if (!signDate.before(endTime)) + deleteEntries.add(contractEntry); + } + } else if ("007".equals(evalTypeNum) && startTime != null) {// 已结算 + DynamicObject contractSettle; + + boolean isMainContract = contract.getBoolean("ismaincontract");// 是否主合同 + DynamicObject mainContract = contract.getDynamicObject("maincontract");// 关联主合同 + if (!isMainContract && mainContract != null) { + mainContract = BusinessDataServiceHelper.loadSingle(mainContract.getPkValue(), "resm_contract_book", "id,sign_date,contract"); + Long contractId = mainContract.getLong("contract"); + QFilter idQF = new QFilter("contractbill", QCP.equals, contractId); + contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算 + } else { + Long contractId = contract.getLong("contract"); + QFilter idQF = new QFilter("contractbill", QCP.equals, contractId); + contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算 + } + + if (contractSettle != null) { + Date bizDate = contractSettle.getDate("bizdate");// 结算日期 + if (bizDate != null) { + if (bizDate.before(startTime) || bizDate.after(endTime)) + deleteEntries.add(contractEntry); + } + } + } + } + } + + if (!deleteEntries.isEmpty()) { + for (DynamicObject deleteEntry : deleteEntries) { + contractEntries.remove(deleteEntry); + } + this.getView().updateView("contract_entry"); + } + } + + if (contractEntries.isEmpty()) { + this.getView().showTipNotification(ResManager.loadKDString("没有符合条件的合同,请检查。", "EvalPlanEdit_13", "repc-resm-formplugin", new Object[0])); + Tab tabap = (Tab)this.getView().getControl("tabap"); + tabap.activeTab("tab_info"); + return; + } + + for (int i = 0; i < contractEntries.size(); i++) { + DynamicObject contractEntry = contractEntries.get(i); + DynamicObject eyContract = contractEntry.getDynamicObject("ey_contract"); + if (eyContract != null) { + DynamicObject contract = BusinessDataServiceHelper.loadSingle(eyContract.getPkValue(), "resm_contract_book", "id,sign_date,contract,ismaincontract,maincontract"); + Date signDate = contract.getDate("sign_date");// 签约日期 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(signDate); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + signDate = calendar.getTime(); + model.setValue("qeug_sign_date", signDate, i); + + String evalTypeNum = contractEntry.getString("ey_eval_type.number");// 评估类型 + if (!"007".equals(evalTypeNum)) continue; + + DynamicObject contractSettle; + boolean isMainContract = contract.getBoolean("ismaincontract"); + DynamicObject mainContract = contract.getDynamicObject("maincontract");// 关联主合同 + if (!isMainContract && mainContract != null) { + mainContract = BusinessDataServiceHelper.loadSingle(mainContract.getPkValue(), "resm_contract_book", "id,sign_date,contract"); + Long contractId = mainContract.getLong("contract"); + QFilter idQF = new QFilter("contractbill", QCP.equals, contractId); + contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算 + } else { + Long contractId = contract.getLong("contract"); + QFilter idQF = new QFilter("contractbill", QCP.equals, contractId); + contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算 + } + if (contractSettle != null) { + Date bizDate = contractSettle.getDate("bizdate");// 结算日期 + model.setValue("qeug_bizdate", bizDate, i); + } + } + } + } + } +} \ No newline at end of file From f0c3740510216a7b41a471c33ce1ce1584ba0f88 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Fri, 15 Nov 2024 17:36:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=A4=96=E7=BD=91=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E6=B3=A8=E5=86=8C=E6=90=BA=E5=B8=A6=E5=88=B0=E6=BD=9C?= =?UTF-8?q?=E5=9C=A8=E4=BE=9B=E5=BA=94=E5=95=86,=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E7=94=BB=E5=83=8F=E5=8A=A8=E6=80=81=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=A1=E6=81=AF?= =?UTF-8?q?,=E4=BC=98=E5=8C=96=E6=89=80=E6=9C=89=E5=85=B3=E4=BA=8E?= =?UTF-8?q?=E5=A4=A9=E7=9C=BC=E6=9F=A5=E9=80=BB=E8=BE=91(=E6=AF=94?= =?UTF-8?q?=E5=AF=B9=E5=AD=97=E6=AE=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resm/formplugin/RegisteredFormPlugin.java | 54 +- .../formplugin/TycQzSupplierFormPlugin.java | 91 ++ .../resm/formplugin/TycSupplieFormPlugin.java | 69 ++ .../opplugin/RegisteredFinishregOPPlugin.java | 47 + .../opplugin/TycQzSupplierSearchOPPlugin.java | 1093 +++-------------- .../opplugin/TycSupplierSearchOPPlugin.java | 119 +- 6 files changed, 428 insertions(+), 1045 deletions(-) create mode 100644 main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java diff --git a/main/java/shkd/repc/resm/formplugin/RegisteredFormPlugin.java b/main/java/shkd/repc/resm/formplugin/RegisteredFormPlugin.java index d839335..22dfdb4 100644 --- a/main/java/shkd/repc/resm/formplugin/RegisteredFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/RegisteredFormPlugin.java @@ -17,32 +17,32 @@ public class RegisteredFormPlugin extends AbstractFormPlugin { public void afterDoOperation(AfterDoOperationEventArgs args) { super.afterDoOperation(args); String operateKey = args.getOperateKey(); - switch (operateKey) { - // 注册完成时将信息携带到潜在供应商 - case "finishregistered": - DynamicObject dataEntity = this.getModel().getDataEntity(); - //注册供应商 - DynamicObject resp_registered = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), "resp_registered"); - if (null != resp_registered) { - DynamicObject regSupplier = resp_registered.getDynamicObject("regsuppplier"); - //潜在供应商 - if (regSupplier != null) { - regSupplier = BusinessDataServiceHelper.loadSingle(regSupplier.getPkValue(), "resm_regsupplier"); - regSupplier.set("qeug_controllingperses",resp_registered.getString("qeug_controllingperses"));//公司实际控制人/权(股份公司) - 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"));//外部联系人 - SaveServiceHelper.save(new DynamicObject[]{regSupplier}); - DobeDWUtils.saveLog("注册供应商", - "注册供应商",null, null, - true,"注册供应商成功带入潜在供应商"); - } - } - break; - default: - break; - } +// switch (operateKey) { +// // 注册完成时将信息携带到潜在供应商 +// case "finishregistered": +// DynamicObject dataEntity = this.getModel().getDataEntity(); +// //注册供应商 +// DynamicObject resp_registered = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), "resp_registered"); +// if (null != resp_registered) { +// DynamicObject regSupplier = resp_registered.getDynamicObject("regsuppplier"); +// //潜在供应商 +// if (regSupplier != null) { +// regSupplier = BusinessDataServiceHelper.loadSingle(regSupplier.getPkValue(), "resm_regsupplier"); +// regSupplier.set("qeug_controllingperses",resp_registered.getString("qeug_controllingperses"));//公司实际控制人/权(股份公司) +// 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"));//外部联系人 +// SaveServiceHelper.save(new DynamicObject[]{regSupplier}); +// DobeDWUtils.saveLog("注册供应商", +// "注册供应商",null, null, +// true,"注册供应商成功带入潜在供应商"); +// } +// } +// break; +// default: +// break; +// } } } diff --git a/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java b/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java index 9579b04..902941c 100644 --- a/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java @@ -5,6 +5,7 @@ import kd.bos.bill.OperationStatus; import kd.bos.dataentity.OperateOption; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.entity.OrmLocaleValue; import kd.bos.dataentity.resource.ResManager; import kd.bos.dataentity.utils.StringUtils; import kd.bos.entity.EntityMetadataCache; @@ -20,6 +21,7 @@ import kd.bos.orm.query.QFilter; import kd.bos.orm.util.CollectionUtils; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.OperationServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.repc.common.enums.PersontypeEnum; import kd.repc.common.enums.resm.RegSupplierStatusEnum; import kd.repc.common.util.PermissionUtils; @@ -28,6 +30,7 @@ import kd.repc.common.util.resm.SupplierStrategyUtil; //import kd.repc.common.util.resm.SupplierStrategyUtil; //import kd.repc.common.util.MultiLangEnumBridge; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -84,10 +87,98 @@ public class TycQzSupplierFormPlugin extends AbstractFormPlugin { this.showPreaudit(args); } } +// if ("query_tyc".equals(operateKey)) { +// this.getView().invokeOperation("save"); +// } } + @Override + public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { + super.afterDoOperation(afterDoOperationEventArgs); + String operateKey = afterDoOperationEventArgs.getOperateKey(); + if ("query_tyc".equals(operateKey) || "preaudit".equals(operateKey)) { + Object pkValue = this.getModel().getDataEntity().getPkValue(); + if (pkValue instanceof Number) { + long pkLongValue = ((Number) pkValue).longValue(); // 转换为 long + if (pkLongValue == 0) { + this.getView().showMessage("请先保存单据"); + return; + } + } + DynamicObject resm_regsupplier = BusinessDataServiceHelper.loadSingle(pkValue, "resm_regsupplier"); + if ("preaudit".equals(operateKey) && resm_regsupplier != null) { + DynamicObjectCollection qeug_infocheckentry = resm_regsupplier.getDynamicObjectCollection("qeug_infocheckentry"); + if (qeug_infocheckentry.size() > 0) { + return; // 如果存在核对项,直接返回 + } + } + + showPreaudit(); + this.getView().invokeOperation("refresh"); + } + } + + private void showPreaudit() { + Object pkValue = this.getModel().getDataEntity().getPkValue(); + DynamicObject resm_regsupplier = BusinessDataServiceHelper.loadSingle(pkValue, "resm_regsupplier"); + + if (resm_regsupplier != null) { + DynamicObjectCollection qeug_infocheckentry = resm_regsupplier.getDynamicObjectCollection("qeug_infocheckentry"); + qeug_infocheckentry.clear(); + + DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck", "number,name,qeug_apifields", null); + + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + + for (int i = 0; i < qeugTycInfochecks.length; i++) { + DynamicObject qeugTycInfocheck = qeugTycInfochecks[i]; + DynamicObject add = qeug_infocheckentry.addNew(); + add.set("seq", i); + add.set("qeug_bsfield", qeugTycInfocheck.getString("number")); // 核对字段标识 + add.set("qeug_bsfieldname", qeugTycInfocheck.getString("name")); // 核对项目名称 + add.set("qeug_bsinput", getBsInput(resm_regsupplier, qeugTycInfocheck.getString("number"), sd)); // 录入内容 + String qeugApifields = qeugTycInfocheck.getString("qeug_apifields"); // 接口字段标识 + add.set("qeug_apifield", qeugApifields); // 接口字段标识 + add.set("qeug_queryresult", getQueryResult(resm_regsupplier, qeugApifields, sd)); // 接口查询结果 + + // 判断是否匹配 + String bsinput = add.getString("qeug_bsinput"); + String queryresult = add.getString("qeug_queryresult"); + add.set("qeug_issame", bsinput.equals(queryresult) ? "1" : "0"); // 0: 不匹配 1: 匹配 + } + + SaveServiceHelper.save(new DynamicObject[]{resm_regsupplier}); + } + } + + // 获取录入内容 + private String getBsInput(DynamicObject resm_regsupplier, String number, SimpleDateFormat sd) { + Object obj = resm_regsupplier.get(number); + return formatFieldValue(obj, sd); + } + + // 获取查询结果 + private String getQueryResult(DynamicObject resm_regsupplier, String qeugApifields, SimpleDateFormat sd) { + Object obj = resm_regsupplier.get(qeugApifields); + return formatFieldValue(obj, sd); + } + + // 格式化字段值 + private String formatFieldValue(Object obj, SimpleDateFormat sd) { + if (obj instanceof Date) { + return sd.format((Date) obj); + } else if (obj instanceof String) { + return (String) obj; + } else if (obj instanceof Long) { + return sd.format(new Date((Long) obj)); + }else if(obj instanceof OrmLocaleValue) { + OrmLocaleValue o = (OrmLocaleValue) obj; + return (String)o.get("zh_CN"); + } + return ""; // 返回空字符串表示无效值 + } protected boolean checkIsCanDo(BeforeDoOperationEventArgs args) { if (!SupplierStrategyUtil.isPreTrial()) { return true; diff --git a/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java b/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java index 1ac6006..dcd41ce 100644 --- a/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java @@ -2,12 +2,16 @@ package shkd.repc.resm.formplugin; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.entity.OrmLocaleValue; +import kd.bos.form.events.AfterDoOperationEventArgs; import kd.bos.form.plugin.AbstractFormPlugin; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.EventObject; /** @@ -390,4 +394,69 @@ public class TycSupplieFormPlugin extends AbstractFormPlugin { } // } } + + @Override + public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { + super.afterDoOperation(afterDoOperationEventArgs); + String operateKey = afterDoOperationEventArgs.getOperateKey(); + if ("query_tyc".equals(operateKey)) { + DynamicObject dynamicObject = this.getModel().getDataEntity(); + Long supplierid = dynamicObject.getLong("supplierid"); + QFilter q1 = new QFilter("id", QCP.equals, supplierid); + DynamicObject supplier_t = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1}); + if (null != supplier_t) { + + /** + * -------------------------------------------基本信息核对------------------------------------------ + */ + + DynamicObjectCollection qeug_infocheckentry = supplier_t.getDynamicObjectCollection("qeug_infocheckentry"); + qeug_infocheckentry.clear(); + DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck", + "number,name,qeug_apifields", null); + for (int i = 0; i < qeugTycInfochecks.length; i++) { + DynamicObject qeugTycInfocheck = qeugTycInfochecks[i]; + DynamicObject add = qeug_infocheckentry.addNew(); + add.set("seq",i); + String number = qeugTycInfocheck.getString("number"); + add.set("qeug_bsfield",number);//核对字段标识 + add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称 + String bsinput = "";//录入内容 + Object obj = supplier_t.get(number); + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + if (obj instanceof Date) { + Date date = (Date) obj; + bsinput = sd.format(date); + } else if(obj instanceof String) { + bsinput =(String) obj; + }else if(obj instanceof OrmLocaleValue) { + OrmLocaleValue o = (OrmLocaleValue) obj; + bsinput = o.get("zh_CN"); + } + add.set("qeug_bsinput",bsinput); + String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识 + add.set("qeug_apifield",qeugApifields);//接口字段标识 + String queryresult = "";//接口查询结果 + Object obj1 = dynamicObject.get(qeugApifields); + if (obj1 instanceof Date) { + Date date = (Date) obj1; + queryresult = sd.format(date); + } else if(obj1 instanceof String) { + queryresult =(String) obj1; + } else if(obj1 instanceof Long) { + Date date = new Date((Long) obj1); + queryresult = sd.format(date); + } + add.set("qeug_queryresult",queryresult); + if (bsinput.equals(queryresult)) { + add.set("qeug_issame","1");//0:不匹配 1:匹配 + }else { + add.set("qeug_issame","0"); + } + } + SaveServiceHelper.save(new DynamicObject[]{supplier_t}); + } + this.getView().invokeOperation("refresh"); + } + } } diff --git a/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java b/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java new file mode 100644 index 0000000..ef9e4fe --- /dev/null +++ b/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java @@ -0,0 +1,47 @@ +package shkd.repc.resm.opplugin; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import shkd.utils.DobeDWUtils; + +/** + * 注册完成时将信息携带到潜在供应商 + * qeug_resp_registered_ext + */ +public class RegisteredFinishregOPPlugin extends AbstractOperationServicePlugIn { + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + + String operationKey = e.getOperationKey(); + if ("finishregistered".equals(operationKey)) { + +// DynamicObject dataEntity = this.getModel().getDataEntity(); + DynamicObject[] dataEntities1 = e.getDataEntities(); + DynamicObject dataEntity = dataEntities1[0]; + //注册供应商 + DynamicObject resp_registered = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), "resp_registered"); + if (null != resp_registered) { + DynamicObject regSupplier = resp_registered.getDynamicObject("regsuppplier"); + //潜在供应商 + if (regSupplier != null) { + regSupplier = BusinessDataServiceHelper.loadSingle(regSupplier.getPkValue(), "resm_regsupplier"); + regSupplier.set("qeug_controllingperses",resp_registered.getString("qeug_controllingperses"));//公司实际控制人/权(股份公司) + 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"));//外部联系人 + SaveServiceHelper.save(new DynamicObject[]{regSupplier}); + DobeDWUtils.saveLog("注册供应商", + "注册供应商",null, null, + true,"注册供应商成功带入潜在供应商"); + } + } + } + } +} diff --git a/main/java/shkd/repc/resm/opplugin/TycQzSupplierSearchOPPlugin.java b/main/java/shkd/repc/resm/opplugin/TycQzSupplierSearchOPPlugin.java index 42ffbad..9c57642 100644 --- a/main/java/shkd/repc/resm/opplugin/TycQzSupplierSearchOPPlugin.java +++ b/main/java/shkd/repc/resm/opplugin/TycQzSupplierSearchOPPlugin.java @@ -16,6 +16,7 @@ import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; +import kd.bos.util.StringUtils; import shkd.utils.DobeDWUtils; import shkd.utils.TycUtils; @@ -38,93 +39,112 @@ public class TycQzSupplierSearchOPPlugin extends AbstractOperationServicePlugIn{ private static final Log logger = LogFactory.getLog(TycSupplierSearchOPPlugin.class); @Override - public void afterExecuteOperationTransaction(AfterOperationArgs e){ - + public void afterExecuteOperationTransaction(AfterOperationArgs e) { super.afterExecuteOperationTransaction(e); String operationKey = e.getOperationKey(); - if("query_tyc".equals(operationKey) || "preaudit".equals(operationKey)){ - DynamicObject[] dataEntities1 = e.getDataEntities(); - DynamicObject dynamicObject1 = dataEntities1[0]; - QFilter q1 = new QFilter("id", QCP.equals, dynamicObject1.getLong("id")); - //潜在供应商 - DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle("resm_regsupplier", new QFilter[]{q1}); - tyc_Test_keyword = dynamicObject1.getString("name");//供应商名称 - if (null != dynamicObject) { - try { + DynamicObject[] dataEntities = e.getDataEntities(); + if (dataEntities.length == 0) { + return; // 如果没有数据实体,直接返回 + } + DynamicObject dynamicObject = dataEntities[0]; + if ("query_tyc".equals(operationKey) || isPreauditQueryNeeded(operationKey, dynamicObject)) { + queryTyc(dynamicObject); + } + } - /** - * 1.企业基本信息(含主要人员)_819 ?keyword=中航重机股份有限公司 - */ - String tyc_Baseinfo = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Baseinfo - + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"企业基本信息(含主要人员)_819"); - JSONObject tyc_Baseinfo_results = JSONObject.parseObject(tyc_Baseinfo); - if (null != tyc_Baseinfo_results) { - JSONObject tyc_Baseinfo_result = (JSONObject)tyc_Baseinfo_results.get("result"); - if (null != tyc_Baseinfo_result) { - //法人 - String legalPersonName = (String) tyc_Baseinfo_result.get("legalPersonName"); - //注册号 - String regNumber = (String) tyc_Baseinfo_result.get("regNumber"); - //组织机构代码 - String orgNumber = (String) tyc_Baseinfo_result.get("orgNumber"); - //营业期限(逻辑待定)--经营开始时间-经营结束时间 - String businessduration = ""; - Long fromTime = (Long)tyc_Baseinfo_result.get("fromTime");//开始时间 - Long toTime =(Long)tyc_Baseinfo_result.get("toTime");//结束时间 - if (null != fromTime && null != toTime) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - businessduration =sdf.format(new Date(fromTime)) + "至" + sdf.format(new Date(toTime));//营业期限 - } - //注册地址 - String regLocation = (String) tyc_Baseinfo_result.get("regLocation"); - //登记机关 - String regInstitute = (String) tyc_Baseinfo_result.get("regInstitute"); - //经营范围(2000 文本) - String businessScope = (String) tyc_Baseinfo_result.get("businessScope"); - //企业状态(经营状态) - String regStatus = (String) tyc_Baseinfo_result.get("regStatus"); - //网址 - String websiteList = (String) tyc_Baseinfo_result.get("websiteList"); - //todo 发照日期 - //统一社会信用代码 - String creditCode = (String) tyc_Baseinfo_result.get("creditCode"); - //行业 - String industry = (String) tyc_Baseinfo_result.get("industry"); - //省份简称 - String base = (String) tyc_Baseinfo_result.get("base"); - String provinceName = getProvinceName(base); - //注册资本 - String regCapital = (String) tyc_Baseinfo_result.get("regCapital"); - //企业联系电话 - //企业联系方式 - String phoneNumber = (String) tyc_Baseinfo_result.get("phoneNumber"); - //企业类型 - String companyOrgType = (String) tyc_Baseinfo_result.get("companyOrgType"); - //成立日期 - String estiblishtime = ""; - Long estiblishTime = (Long) tyc_Baseinfo_result.get("estiblishTime"); - if (null != estiblishTime) { - estiblishtime = convertTimestampToDate(estiblishTime); - } - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //注销日期 - String canceldate = ""; - Long cancelDate = (Long) tyc_Baseinfo_result.get("cancelDate"); - if (null != cancelDate) { - canceldate = convertTimestampToDate(cancelDate); - } + private boolean isPreauditQueryNeeded(String operationKey, DynamicObject dynamicObject) { + if ("preaudit".equals(operationKey)) { + Object pkValue = dynamicObject.getPkValue(); + DynamicObject resm_regsupplier = BusinessDataServiceHelper.loadSingle(pkValue, "resm_regsupplier"); + if (resm_regsupplier != null) { + DynamicObjectCollection qeugInfocheckentry = resm_regsupplier.getDynamicObjectCollection("qeug_infocheckentry"); + return qeugInfocheckentry.isEmpty(); // 如果集合为空,返回true,表示需要查询 + } + } + return false; // 不是预审或不需要查询的情况 + } - //市 - String city = (String) tyc_Baseinfo_result.get("city"); - //曾用名 - String historyNames = (String) tyc_Baseinfo_result.get("historyNames"); - //参保人数 - Integer socialStaffNum = (Integer) tyc_Baseinfo_result.get("socialStaffNum"); - //主要人员列表 - DynamicObjectCollection qeugEntryentity = dynamicObject.getDynamicObjectCollection("qeug_entryentity"); - qeugEntryentity.clear(); - JSONObject staffListS = tyc_Baseinfo_result.getJSONObject("staffList"); + private void queryTyc(DynamicObject dynamicObject1) { + QFilter q1 = new QFilter("id", QCP.equals, dynamicObject1.getLong("id")); + //潜在供应商 + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle("resm_regsupplier", new QFilter[]{q1}); + tyc_Test_keyword = dynamicObject1.getString("name");//供应商名称 + if (null != dynamicObject) { + try { + + /** + * 1.企业基本信息(含主要人员)_819 ?keyword=中航重机股份有限公司 + */ + String tyc_Baseinfo = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Baseinfo + + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"企业基本信息(含主要人员)_819"); + JSONObject tyc_Baseinfo_results = JSONObject.parseObject(tyc_Baseinfo); + if (null != tyc_Baseinfo_results) { + JSONObject tyc_Baseinfo_result = (JSONObject)tyc_Baseinfo_results.get("result"); + if (null != tyc_Baseinfo_result) { + //法人 + String legalPersonName = (String) tyc_Baseinfo_result.get("legalPersonName"); + //注册号 + String regNumber = (String) tyc_Baseinfo_result.get("regNumber"); + //组织机构代码 + String orgNumber = (String) tyc_Baseinfo_result.get("orgNumber"); + //营业期限(逻辑待定)--经营开始时间-经营结束时间 + String businessduration = ""; + Long fromTime = (Long)tyc_Baseinfo_result.get("fromTime");//开始时间 + Long toTime =(Long)tyc_Baseinfo_result.get("toTime");//结束时间 + if (null != fromTime && null != toTime) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + businessduration =sdf.format(new Date(fromTime)) + "至" + sdf.format(new Date(toTime));//营业期限 + } + //注册地址 + String regLocation = (String) tyc_Baseinfo_result.get("regLocation"); + //登记机关 + String regInstitute = (String) tyc_Baseinfo_result.get("regInstitute"); + //经营范围(2000 文本) + String businessScope = (String) tyc_Baseinfo_result.get("businessScope"); + //企业状态(经营状态) + String regStatus = (String) tyc_Baseinfo_result.get("regStatus"); + //网址 + String websiteList = (String) tyc_Baseinfo_result.get("websiteList"); + //todo 发照日期 + //统一社会信用代码 + String creditCode = (String) tyc_Baseinfo_result.get("creditCode"); + //行业 + String industry = (String) tyc_Baseinfo_result.get("industry"); + //省份简称 + String base = (String) tyc_Baseinfo_result.get("base"); + String provinceName = getProvinceName(base); + //注册资本 + String regCapital = (String) tyc_Baseinfo_result.get("regCapital"); + //企业联系电话 + //企业联系方式 + String phoneNumber = (String) tyc_Baseinfo_result.get("phoneNumber"); + //企业类型 + String companyOrgType = (String) tyc_Baseinfo_result.get("companyOrgType"); + //成立日期 + String estiblishtime = ""; + Long estiblishTime = (Long) tyc_Baseinfo_result.get("estiblishTime"); + if (null != estiblishTime) { + estiblishtime = convertTimestampToDate(estiblishTime); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + //注销日期 + String canceldate = ""; + Long cancelDate = (Long) tyc_Baseinfo_result.get("cancelDate"); + if (null != cancelDate) { + canceldate = convertTimestampToDate(cancelDate); + } + //市 + String city = (String) tyc_Baseinfo_result.get("city"); + //曾用名 + String historyNames = (String) tyc_Baseinfo_result.get("historyNames"); + //参保人数 + Integer socialStaffNum = (Integer) tyc_Baseinfo_result.get("socialStaffNum"); + //主要人员列表 + DynamicObjectCollection qeugEntryentity = dynamicObject.getDynamicObjectCollection("qeug_entryentity"); + qeugEntryentity.clear(); + JSONObject staffListS = tyc_Baseinfo_result.getJSONObject("staffList"); + if (null != staffListS) { JSONArray staffLists = staffListS.getJSONArray("result"); if (null != staffLists) { for (int i = 0; i < staffLists.size(); i++) { @@ -148,102 +168,39 @@ public class TycQzSupplierSearchOPPlugin extends AbstractOperationServicePlugIn{ add.set("qeug_position",typeJoin);//主要人员职位 } } - - //设置到潜在供应商中 - dynamicObject.set("qeug_legalpersonn",legalPersonName);//法人代表 - dynamicObject.set("qeug_regnumber",regNumber);//企业注册号 - dynamicObject.set("qeug_orgnumber",orgNumber);//组织机构代码 - dynamicObject.set("qeug_businessduration",businessduration);//营业期限 - dynamicObject.set("qeug_reglocation",regLocation);//公司地址 - dynamicObject.set("qeug_reginstitute",regInstitute);//登记机关 - dynamicObject.set("qeug_regstatus",regStatus);//经营状态 - dynamicObject.set("qeug_websitelist",websiteList);//企业网站 - try { - Date parse = sdf.parse(estiblishtime); - dynamicObject.set("qeug_photodate",parse);//发照日期 - dynamicObject.set("qeug_estiblishtime",parse);//成立日期 - } catch (ParseException ex) { - throw new RuntimeException(ex); - } - dynamicObject.set("qeug_creditcode",creditCode);//统一社会信用代码 - dynamicObject.set("qeug_industry",industry);//所属行业 - dynamicObject.set("qeug_bases",provinceName);//省 - dynamicObject.set("qeug_regcapital",regCapital);//注册资本 - dynamicObject.set("qeug_companyorgtype",companyOrgType);//企业类型 - dynamicObject.set("qeug_canceldate",canceldate);//注销日期 - dynamicObject.set("qeug_city",city);//城市 - dynamicObject.set("qeug_phonenumber",phoneNumber);//联系电话 - dynamicObject.set("qeug_historynames",historyNames);//曾用名 - dynamicObject.set("qeug_socialstaffnum",socialStaffNum);//参保人数 - dynamicObject.set("qeug_businessscopes",businessScope);//经营范围 - SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); - - /** - * -------------------------------------------基本信息核对------------------------------------------ - */ - - DynamicObjectCollection qeug_infocheckentry = dynamicObject.getDynamicObjectCollection("qeug_infocheckentry"); - qeug_infocheckentry.clear(); - DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck", - "number,name,qeug_apifields", null); - for (int i = 0; i < qeugTycInfochecks.length; i++) { - DynamicObject qeugTycInfocheck = qeugTycInfochecks[i]; - DynamicObject add = qeug_infocheckentry.addNew(); - add.set("seq",i); - String number = qeugTycInfocheck.getString("number"); - add.set("qeug_bsfield",number);//核对字段标识 - add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称 - String bsinput = "";//录入内容 - Object obj = dynamicObject.get(number); - SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); - if (obj instanceof Date) { - Date date = (Date) obj; - bsinput = sd.format(date); - } else if(obj instanceof String) { - bsinput =(String) obj; - }else if(obj instanceof OrmLocaleValue) { - OrmLocaleValue o = (OrmLocaleValue) obj; - bsinput = o.get("zh_CN"); - } - add.set("qeug_bsinput",bsinput); - String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识 - add.set("qeug_apifield",qeugApifields);//接口字段标识 - String queryresult = "";//接口查询结果 - Object obj1 = tyc_Baseinfo_result.get(qeugApifields); - if (obj1 instanceof Date) { - Date date = (Date) obj1; - queryresult = sd.format(date); - } else if(obj1 instanceof String) { - queryresult =(String) obj1; - } else if(obj1 instanceof Long) { - Date date = new Date((Long) obj1); - queryresult = sd.format(date); - } - add.set("qeug_queryresult",queryresult); - if (bsinput.equals(queryresult)) { - add.set("qeug_issame","1");//0:不匹配 1:匹配 - }else { - add.set("qeug_issame","0"); - } - } - SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); - } -// else { -// //接口调用失败 -// Integer error_code = (Integer)tyc_Baseinfo_results.get("error_code");//状态码 -// if (error_code.equals(300003)) { -// String reason = (String)tyc_Baseinfo_results.get("reason");//错误信息 -// OperateErrorInfo operateErrorInfo = new OperateErrorInfo(); -// operateErrorInfo.setMessage(reason + ",请联系管理员"); -// operateErrorInfo.setErrorLevel(ErrorLevel.Error.name()); -// operateErrorInfo.setPkValue(dynamicObject.getPkValue()); -// this.operationResult.addErrorInfo(operateErrorInfo); -// logger.error("天眼查接口调用失败,错误码:" + error_code + ",原因:" + reason); -// } -// } - } + //设置到潜在供应商中 + dynamicObject.set("qeug_legalpersonn",legalPersonName);//法人代表 + dynamicObject.set("qeug_regnumber",regNumber);//企业注册号 + dynamicObject.set("qeug_orgnumber",orgNumber);//组织机构代码 + dynamicObject.set("qeug_businessduration",businessduration);//营业期限 + dynamicObject.set("qeug_reglocation",regLocation);//公司地址 + dynamicObject.set("qeug_reginstitute",regInstitute);//登记机关 + dynamicObject.set("qeug_regstatus",regStatus);//经营状态 + dynamicObject.set("qeug_websitelist",websiteList);//企业网站 + try { + Date parse = sdf.parse(estiblishtime); + dynamicObject.set("qeug_photodate",parse);//发照日期 + dynamicObject.set("qeug_estiblishtime",parse);//成立日期 + } catch (ParseException ex) { + throw new RuntimeException(ex); + } + dynamicObject.set("qeug_creditcode",creditCode);//统一社会信用代码 + dynamicObject.set("qeug_industry",industry);//所属行业 + dynamicObject.set("qeug_bases",provinceName);//省 + dynamicObject.set("qeug_regcapital",regCapital);//注册资本 + dynamicObject.set("qeug_companyorgtype",companyOrgType);//企业类型 + dynamicObject.set("qeug_canceldate",canceldate);//注销日期 + dynamicObject.set("qeug_city",city);//城市 + dynamicObject.set("qeug_phonenumber",phoneNumber);//联系电话 + dynamicObject.set("qeug_historynames",historyNames);//曾用名 + dynamicObject.set("qeug_socialstaffnum",socialStaffNum);//参保人数 + dynamicObject.set("qeug_businessscopes",businessScope);//经营范围 + SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + + } + } /** * 20.疑似实际控制人_1123 ?keyword=北京百度网讯科技有限公司 @@ -272,7 +229,6 @@ public class TycQzSupplierSearchOPPlugin extends AbstractOperationServicePlugIn{ } } - /** * todo 2.实际控制权_747 ?pageSize=20&keyword=北京百度网讯科技有限公司&pageNum=1 */ @@ -802,785 +758,14 @@ public class TycQzSupplierSearchOPPlugin extends AbstractOperationServicePlugIn{ } } } - } catch (Exception ex) { - DobeDWUtils.saveLog(tyc_Test_keyword, - "天眼查",tyc_Test_keyword, ex.getMessage()+"\n"+ ex.getStackTrace()[0].getClassName()+"\n"+ - ex.getStackTrace()[0].getMethodName()+"\n"+ ex.getStackTrace()[0].getLineNumber(), - false,"query_tyc"); - } + } + catch (Exception ex) { + DobeDWUtils.saveLog(tyc_Test_keyword, + "天眼查",tyc_Test_keyword, ex.getMessage()+"\n"+ ex.getStackTrace()[0].getClassName()+"\n"+ + ex.getStackTrace()[0].getMethodName()+"\n"+ ex.getStackTrace()[0].getLineNumber(), + false,"query_tyc"); } } - - - } - - @Override - public void beforeExecuteOperationTransaction(BeforeOperationArgs e) { - super.beforeExecuteOperationTransaction(e); - //资质预审之前,查询天眼查数据 - String eok = e.getOperationKey(); -// if("preaudit".equals(eok)) { -// DynamicObject[] dynamicObjects = e.getDataEntities(); -// for (DynamicObject dynamicObject : dynamicObjects) { -// tyc_Test_keyword = dynamicObject.getString("name");//供应商名称 -// try { -// -// /** -// * 1.企业基本信息(含主要人员)_819 ?keyword=中航重机股份有限公司 -// */ -// String tyc_Baseinfo = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Baseinfo -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"企业基本信息(含主要人员)_819"); -// JSONObject tyc_Baseinfo_results = JSONObject.parseObject(tyc_Baseinfo); -// if (null != tyc_Baseinfo_results) { -// JSONObject tyc_Baseinfo_result = (JSONObject)tyc_Baseinfo_results.get("result"); -// if (null != tyc_Baseinfo_result) { -// //法人 -// String legalPersonName = (String) tyc_Baseinfo_result.get("legalPersonName"); -// //注册号 -// String regNumber = (String) tyc_Baseinfo_result.get("regNumber"); -// //组织机构代码 -// String orgNumber = (String) tyc_Baseinfo_result.get("orgNumber"); -// //营业期限(逻辑待定)--经营开始时间-经营结束时间 -// String businessduration = ""; -// Long fromTime = (Long)tyc_Baseinfo_result.get("fromTime");//开始时间 -// Long toTime =(Long)tyc_Baseinfo_result.get("toTime");//结束时间 -// if (null != fromTime && null != toTime) { -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); -// businessduration =sdf.format(new Date(fromTime)) + "至" + sdf.format(new Date(toTime));//营业期限 -// } -// //注册地址 -// String regLocation = (String) tyc_Baseinfo_result.get("regLocation"); -// //登记机关 -// String regInstitute = (String) tyc_Baseinfo_result.get("regInstitute"); -// //经营范围(2000 文本) -// String businessScope = (String) tyc_Baseinfo_result.get("businessScope"); -// //企业状态(经营状态) -// String regStatus = (String) tyc_Baseinfo_result.get("regStatus"); -// //网址 -// String websiteList = (String) tyc_Baseinfo_result.get("websiteList"); -// //todo 发照日期 -// //统一社会信用代码 -// String creditCode = (String) tyc_Baseinfo_result.get("creditCode"); -// //行业 -// String industry = (String) tyc_Baseinfo_result.get("industry"); -// //省份简称 -// String base = (String) tyc_Baseinfo_result.get("base"); -// String provinceName = getProvinceName(base); -// //注册资本 -// String regCapital = (String) tyc_Baseinfo_result.get("regCapital"); -// //企业联系电话 -// //企业联系方式 -// String phoneNumber = (String) tyc_Baseinfo_result.get("phoneNumber"); -// //企业类型 -// String companyOrgType = (String) tyc_Baseinfo_result.get("companyOrgType"); -// //成立日期 -// String estiblishtime = ""; -// Long estiblishTime = (Long) tyc_Baseinfo_result.get("estiblishTime"); -// if (null != estiblishTime) { -// estiblishtime = convertTimestampToDate(estiblishTime); -// } -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// //注销日期 -// String canceldate = ""; -// Long cancelDate = (Long) tyc_Baseinfo_result.get("cancelDate"); -// if (null != cancelDate) { -// canceldate = convertTimestampToDate(cancelDate); -// } -// -// //市 -// String city = (String) tyc_Baseinfo_result.get("city"); -// //曾用名 -// String historyNames = (String) tyc_Baseinfo_result.get("historyNames"); -// //参保人数 -// Integer socialStaffNum = (Integer) tyc_Baseinfo_result.get("socialStaffNum"); -// //主要人员列表 -// DynamicObjectCollection qeugEntryentity = dynamicObject.getDynamicObjectCollection("qeug_entryentity"); -// qeugEntryentity.clear(); -// JSONObject staffListS = tyc_Baseinfo_result.getJSONObject("staffList"); -// JSONArray staffLists = staffListS.getJSONArray("result"); -// if (null != staffLists) { -// for (int i = 0; i < staffLists.size(); i++) { -// DynamicObject add = qeugEntryentity.addNew(); -// JSONObject staffList = (JSONObject)staffLists.get(i); -// String name = staffList.getString("name");//主要人员姓名 -// String typeJoin = "";//主要人员职位 -// JSONArray typeJoins = staffList.getJSONArray("typeJoin"); -// if (null != typeJoins) { -// StringBuilder sb = new StringBuilder(); -// for (int j = 0; j < typeJoins.size(); j++) { -// sb.append((String)typeJoins.get(j)); -// if (j < typeJoins.size() - 1) { -// sb.append(","); -// } -// } -// typeJoin = sb.toString(); -// } -// add.set("seq",i); -// add.set("qeug_personnelname",name);//主要人员姓名 -// add.set("qeug_position",typeJoin);//主要人员职位 -// } -// } -// -// //设置到潜在供应商中 -// dynamicObject.set("qeug_legalpersonn",legalPersonName);//法人代表 -// dynamicObject.set("qeug_regnumber",regNumber);//企业注册号 -// dynamicObject.set("qeug_orgnumber",orgNumber);//组织机构代码 -// dynamicObject.set("qeug_businessduration",businessduration);//营业期限 -// dynamicObject.set("qeug_reglocation",regLocation);//公司地址 -// dynamicObject.set("qeug_reginstitute",regInstitute);//登记机关 -// dynamicObject.set("qeug_regstatus",regStatus);//经营状态 -// dynamicObject.set("qeug_websitelist",websiteList);//企业网站 -// try { -// Date parse = sdf.parse(estiblishtime); -// dynamicObject.set("qeug_photodate",parse);//发照日期 -// dynamicObject.set("qeug_estiblishtime",parse);//成立日期 -// } catch (ParseException ex) { -// throw new RuntimeException(ex); -// } -// dynamicObject.set("qeug_creditcode",creditCode);//统一社会信用代码 -// dynamicObject.set("qeug_industry",industry);//所属行业 -// dynamicObject.set("qeug_bases",provinceName);//省 -// dynamicObject.set("qeug_regcapital",regCapital);//注册资本 -// dynamicObject.set("qeug_companyorgtype",companyOrgType);//企业类型 -// dynamicObject.set("qeug_canceldate",canceldate);//注销日期 -// dynamicObject.set("qeug_city",city);//城市 -// dynamicObject.set("qeug_phonenumber",phoneNumber);//联系电话 -// dynamicObject.set("qeug_historynames",historyNames);//曾用名 -// dynamicObject.set("qeug_socialstaffnum",socialStaffNum);//参保人数 -// dynamicObject.set("qeug_businessscopes",businessScope);//经营范围 -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// -// /** -// * -------------------------------------------基本信息核对------------------------------------------ -// */ -// -// DynamicObjectCollection qeug_infocheckentry = dynamicObject.getDynamicObjectCollection("qeug_infocheckentry"); -// qeug_infocheckentry.clear(); -// DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck", -// "number,name,qeug_apifields", null); -// for (int i = 0; i < qeugTycInfochecks.length; i++) { -// DynamicObject qeugTycInfocheck = qeugTycInfochecks[i]; -// DynamicObject add = qeug_infocheckentry.addNew(); -// add.set("seq",i); -// String number = qeugTycInfocheck.getString("number"); -// add.set("qeug_bsfield",number);//核对字段标识 -// add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称 -// String bsinput = "";//录入内容 -// Object obj = dynamicObject.get(number); -// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); -// if (obj instanceof Date) { -// Date date = (Date) obj; -// bsinput = sd.format(date); -// } else if(obj instanceof String) { -// bsinput =(String) obj; -// }else if(obj instanceof OrmLocaleValue) { -// OrmLocaleValue o = (OrmLocaleValue) obj; -// bsinput = o.get("zh_CN"); -// } -// add.set("qeug_bsinput",bsinput); -// String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识 -// add.set("qeug_apifield",qeugApifields);//接口字段标识 -// String queryresult = "";//接口查询结果 -// Object obj1 = tyc_Baseinfo_result.get(qeugApifields); -// if (obj1 instanceof Date) { -// Date date = (Date) obj1; -// queryresult = sd.format(date); -// } else if(obj1 instanceof String) { -// queryresult =(String) obj1; -// } else if(obj1 instanceof Long) { -// Date date = new Date((Long) obj1); -// queryresult = sd.format(date); -// } -// add.set("qeug_queryresult",queryresult); -// if (bsinput.equals(queryresult)) { -// add.set("qeug_issame","1");//0:不匹配 1:匹配 -// }else { -// add.set("qeug_issame","0"); -// } -// } -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// -// }else { -// //接口调用失败 -// Integer error_code = (Integer)tyc_Baseinfo_results.get("error_code");//状态码 -// if (error_code.equals(300003)) { -// String reason = (String)tyc_Baseinfo_results.get("reason");//错误信息 -// OperateErrorInfo operateErrorInfo = new OperateErrorInfo(); -// operateErrorInfo.setMessage(reason + ",请联系管理员"); -// operateErrorInfo.setErrorLevel(ErrorLevel.Error.name()); -// operateErrorInfo.setPkValue(dynamicObject.getPkValue()); -// this.operationResult.addErrorInfo(operateErrorInfo); -// logger.error("天眼查接口调用失败,错误码:" + error_code + ",原因:" + reason); -// } -// } -// } -// -// -// /** -// * 20.疑似实际控制人_1123 ?keyword=北京百度网讯科技有限公司 -// */ -// String tyc_ActualControl = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_ActualControl -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"疑似实际控制人_1123"); -// JSONObject tyc_ActualControl_results = JSONObject.parseObject(tyc_ActualControl); -// if (null != tyc_ActualControl_results) { -// JSONObject tyc_ActualControl_result = (JSONObject)tyc_ActualControl_results.get("result"); -// if (null != tyc_ActualControl_result) { -// JSONArray actualControllerLists = tyc_ActualControl_result.getJSONArray("actualControllerList"); -// String name = ""; -// if (null != actualControllerLists) { -// StringBuilder sb = new StringBuilder(); -// for (int i = 0; i < actualControllerLists.size(); i++) { -// JSONObject actualControllerList = (JSONObject)actualControllerLists.get(i); -// sb.append((String)actualControllerList.get("name"));//控制人姓名 -// if (i < actualControllerLists.size() - 1) { -// sb.append(","); -// } -// } -// name = sb.toString(); -// } -// dynamicObject.set("qeug_controllingperson",name);//控制人姓名 -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// -// -// /** -// * todo 2.实际控制权_747 ?pageSize=20&keyword=北京百度网讯科技有限公司&pageNum=1 -// */ -// String tyc_Companyholding = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Companyholding -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"实际控制权_747"); -// -// /** -// * 3.总公司_963 ?keyword=139573097 -// */ -// String tyc_ParentCompany = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_ParentCompany -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"总公司_963"); -// JSONObject tyc_ParentCompany_results = JSONObject.parseObject(tyc_ParentCompany); -// if (null != tyc_ParentCompany_results) { -// JSONObject tyc_ParentCompany_result = (JSONObject)tyc_ParentCompany_results.get("result"); -// if (null != tyc_ParentCompany_result) { -// //总公司名 -// String name = (String) tyc_ParentCompany_result.get("name"); -// dynamicObject.set("qeug_headoffice",name);//总公司名 -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// -// -// /** -// * 4.工商信息_1001 ?keyword=9519792 -// */ -// DynamicObjectCollection qeugIcentry = dynamicObject.getDynamicObjectCollection("qeug_icentry"); -// qeugIcentry.clear(); -// String tyc_Ic = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Ic -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"工商信息_1001"); -// JSONObject tyc_Ic_results = JSONObject.parseObject(tyc_Ic); -// if (null != tyc_Ic_results) { -// JSONObject tyc_Ic_result = (JSONObject)tyc_Ic_results.get("result"); -// if (null != tyc_Ic_result) { -// JSONArray branchLists = tyc_Ic_result.getJSONArray("branchList"); -// if (null != branchLists) { -// for (int i = 0; i < branchLists.size(); i++) { -// DynamicObject add = qeugIcentry.addNew(); -// JSONObject branchList = (JSONObject)branchLists.get(i); -// String branchListname = (String)branchList.get("name");//分支机构名称 -// String regStatus = (String)branchList.get("regStatus");//经营状态 -// add.set("seq",i); -// add.set("qeug_branchlistname",branchListname);//分支机构名称 -// add.set("qeug_regstatusic",regStatus);//经营状态 -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// } -// -// -// /** -// * 5.建筑资质-注册人员_1009 ?pageSize=20&keyword=中煤科工集团北京华宇工程有限公司&pageNum=1 -// */ -// DynamicObjectCollection qeugReghumanentry = dynamicObject.getDynamicObjectCollection("qeug_reghumanentry"); -// qeugReghumanentry.clear(); -// String tyc_RegHuman = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_RegHuman -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"建筑资质-注册人员_1009"); -// JSONObject tyc_RegHuman_results = JSONObject.parseObject(tyc_RegHuman); -// if (null != tyc_RegHuman_results) { -// JSONObject tyc_RegHuman_result = (JSONObject)tyc_RegHuman_results.get("result"); -// if (null != tyc_RegHuman_result) { -// JSONArray items = tyc_RegHuman_result.getJSONArray("items"); -// if (null != items) { -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeugReghumanentry.addNew(); -// JSONObject branchList = (JSONObject)items.get(i); -// String humanName = (String) branchList.get("humanName");//注册人员名字 -// String registerType = (String) branchList.get("registerType");//注册类别 -// add.set("seq",i); -// add.set("qeug_humanname",humanName);//注册人员名字 -// add.set("qeug_registertype",registerType);//注册类别 -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// -// } -// } -// } -// } -// -// -// /** -// * 6.建筑资质-工程项目_1011 ?pageSize=20&keyword=中煤科工集团北京华宇工程有限公司&pageNum=1 -// */ -// DynamicObjectCollection qeug_projectentry = dynamicObject.getDynamicObjectCollection("qeug_projectentry"); -// qeug_projectentry.clear(); -// String tyc_Project = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Project -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"建筑资质-工程项目_1011"); -// JSONObject tyc_Project_results = JSONObject.parseObject(tyc_Project); -// if (null != tyc_Project_results) { -// JSONObject tyc_Project_result = (JSONObject)tyc_Project_results.get("result"); -// if (null != tyc_Project_result) { -// JSONArray items = tyc_Project_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeug_projectentry.addNew(); -// JSONObject o = (JSONObject)items.get(i); -// String proName = (String)o.get("proName");//项目名称 -// String base = (String)o.get("base");//项目属地 -// String proType = (String)o.get("proType");//项目类别 -// String buildCompany = (String)o.get("buildCompany");//建设单位 -// add.set("seq",i); -// add.set("qeug_proname",proName);//项目名称 -// add.set("qeug_base",base);//项目属地 -// add.set("qeug_protype",proType);//项目类别 -// add.set("qeug_buildcompanys",buildCompany);//建设单位 -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// -// /** -// * 7.失信被执行人(人员)_1076 ?hid=2187083120&name=北京百乐文化传媒有限公司&humanName=贾跃亭&cid=34630712&pageSize=20&pageNum=1 -// */ -// String tyc_Human_Dishonest = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Human_Dishonest -// + "?name=" + tyc_Test_keyword,tyc_Test_keyword,"被执行人_1077"); -// JSONObject tyc_Human_Dishonest_results = JSONObject.parseObject(tyc_Human_Dishonest); -// if (null != tyc_Human_Dishonest_results) { -// JSONObject tyc_Human_Dishonest_result = (JSONObject)tyc_Human_Dishonest_results.get("result"); -// if (null != tyc_Human_Dishonest_result) { -// JSONArray items = tyc_Human_Dishonest_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// JSONObject o = (JSONObject)items.get(i); -// String courtname = (String)o.get("courtname");//法院 -// String iname = (String)o.get("iname");//失信人名称 -// String disrupttypename = (String)o.get("disrupttypename");//失信被执行人行为具体情形 -// String performance = (String)o.get("performance");//履行情况 -// String gistunit = (String)o.get("gistunit");//做出执行的依据单位 -// String duty = (String)o.get("duty");//生效法律文书确定的义务 -// } -// } -// } -// -// -// /** -// * todo 8.被执行(人员)_1077 ?name=宁夏泰华实业集团有限公司&humanName=禹学峰&cid=185429210&hid=2095668600&pageNum=1&pageSize=20 -// */ -//// String tyc_ZhiXingInfo = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_ZhiXingInfo -//// + "?name=" + tyc_Test_keyword); -// -// /** -// * 9.资质证书_880 ?name=北京百度网讯科技有限公司&certificateName=中国质量认证中心_CCC证书&pageSize=20&id=22822&pageNum=1 -// */ -// DynamicObjectCollection qeugCertificateentry = dynamicObject.getDynamicObjectCollection("qeug_certificateentry"); -// qeugCertificateentry.clear(); -// String tyc_Certificate = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Certificate -// + "?name=" + tyc_Test_keyword,tyc_Test_keyword,"证照_1081"); -// JSONObject tyc_Certificate_results = JSONObject.parseObject(tyc_Certificate); -// if (null != tyc_Certificate_results) { -// JSONObject tyc_Certificate_result = (JSONObject)tyc_Certificate_results.get("result"); -// if (null != tyc_Certificate_result) { -// JSONArray items = tyc_Certificate_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// JSONObject o = (JSONObject)items.get(i); -// DynamicObject add = qeugCertificateentry.addNew(); -// String certNo = (String)o.get("certNo");//证书编号 -// String certificateName = (String)o.get("certificateName");//证书类型 -// String startDate = (String)o.get("startDate");//发证日期 -// String endDate = (String)o.get("endDate");//截止日期 -// add.set("seq",i); -// add.set("qeug_certno",certNo); -// add.set("qeug_certificatename",certificateName); -// add.set("qeug_startdate",startDate); -// add.set("qeug_enddate",endDate); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// /** -// * 10.建筑资质-资质资格_1007 ?pageSize=20&keyword=河南省建筑设计研究院有限公司&pageNum=1 -// */ -// DynamicObjectCollection qeug_qualificationentry = dynamicObject.getDynamicObjectCollection("qeug_qualificationentry"); -// qeug_qualificationentry.clear(); -// String tyc_Qualification = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Qualification -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"建筑资质-资质资格_1007"); -// JSONObject tyc_Qualification_results = JSONObject.parseObject(tyc_Qualification); -// if (null != tyc_Qualification_results) { -// JSONObject tyc_Qualification_result = (JSONObject)tyc_Qualification_results.get("result"); -// if (null != tyc_Qualification_result) { -// JSONArray items = tyc_Qualification_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeug_qualificationentry.addNew(); -// JSONObject o = (JSONObject)items.get(i); -// String certificateNum = (String)o.get("certificateNum");//资质证书号 -// String qualificationName = (String)o.get("qualificationName");//资质名称 -// String issuingCertificateTime = (String)o.get("issuingCertificateTime");//发证日期 -// String effectiveTime = (String)o.get("effectiveTime");//证书有效期 -// String organ = (String)o.get("organ");//发证机关 -// add.set("seq",i); -// add.set("qeug_certificatenum",certificateNum); -// add.set("qeug_qualificationname",qualificationName); -// add.set("qeug_issuingcertificateti",issuingCertificateTime); -// add.set("qeug_effectivetime",effectiveTime); -// add.set("qeug_organ",organ); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// -// } -// } -// } -// -// -// /** -// * 11.变更记录_822 ?keyword=北京百度网讯科技有限公司&pageNum=1&pageSize=20 -// */ -// DynamicObjectCollection qeugChangeinfo = dynamicObject.getDynamicObjectCollection("qeug_changeinfo"); -// qeugChangeinfo.clear(); -// String tyc_Changeinfo = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Changeinfo -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"变更记录_822"); -// JSONObject tyc_Changeinfo_results = JSONObject.parseObject(tyc_Changeinfo); -// if (null != tyc_Changeinfo_results) { -// JSONObject tyc_Changeinfo_result = (JSONObject)tyc_Changeinfo_results.get("result"); -// if (null != tyc_Changeinfo_result) { -// JSONArray items = tyc_Changeinfo_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// JSONObject o = (JSONObject)items.get(i); -// DynamicObject add = qeugChangeinfo.addNew(); -// String changeItem = (String)o.get("changeItem");//变更事项 -// String changeTime = (String)o.get("changeTime");//变更时间 -// String contentBefore = (String)o.get("contentBefore");//变更前 -// String contentAfter = (String)o.get("contentAfter");//变更后 -// add.set("seq",i); -// add.set("qeug_changeitem",changeItem); -// add.set("qeug_changetime",changeTime); -// add.set("qeug_contentbefore",contentBefore); -// add.set("qeug_contentafter",contentAfter); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// /** -// * 12.经营异常_848 ?pageSize=20&keyword=宁夏凯捷建设工程有限公司&pageNum=1 -// */ -// DynamicObjectCollection qeugAbnormal = dynamicObject.getDynamicObjectCollection("qeug_abnormal"); -// qeugAbnormal.clear(); -// String tyc_Abnormal = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Abnormal -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"经营异常_848"); -// JSONObject tyc_Abnormal_results = JSONObject.parseObject(tyc_Abnormal); -// if (null != tyc_Abnormal_results) { -// JSONObject tyc_Abnormal_result = (JSONObject)tyc_Abnormal_results.get("result"); -// if (null != tyc_Abnormal_result) { -// JSONArray items = tyc_Abnormal_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// JSONObject o = (JSONObject)items.get(i); -// DynamicObject add = qeugAbnormal.addNew(); -// String putReason = (String)o.get("putReason");//列入异常名录原因 -// String putDate = (String)o.get("putDate");//列入日期 -// String removeReason = (String)o.get("removeReason");//移除异常名录原因 -// String removeDate = (String)o.get("removeDate");//移出日期 -// add.set("seq",i); -// add.set("qeug_putreason",putReason); -// add.set("qeug_putdate",putDate); -// add.set("qeug_removereason",removeReason); -// add.set("qeug_removedate",removeDate); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// /** -// * 13.企业股东_821 ?pageSize=20&keyword=北京百度网讯科技有限公司&pageNum=1 -// */ -// DynamicObjectCollection qeugShareholderentry = dynamicObject.getDynamicObjectCollection("qeug_shareholderentry"); -// qeugShareholderentry.clear(); -// String tyc_Holder = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Holder -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"企业股东_821"); -// JSONObject tyc_Holder_results = JSONObject.parseObject(tyc_Holder); -// if (null != tyc_Holder_results) { -// JSONObject tyc_Holder_result = (JSONObject)tyc_Holder_results.get("result"); -// if (null != tyc_Holder_result) { -// JSONArray items = tyc_Holder_result.getJSONArray("items"); -// for (Object item : items) { -// DynamicObject add = qeugShareholderentry.addNew(); -// JSONObject o = (JSONObject) item; -// String name = (String) o.get("name");//股东名 -// String typeName = "";//股东类型 -// Integer type = (Integer) o.get("type");//股东类型 1-公司 2-人 3-其它 -// switch (type) { -// case 1: -// typeName = "公司"; -// break; -// case 2: -// typeName = "人"; -// break; -// case 3: -// typeName = "其它"; -// break; -// default: -// break; -// } -// add.set("qeug_name", name);//股东名 -// add.set("qeug_typename", typeName);//股东类型 1-公司 2-人 3-其它 -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// /** -// * 14.建筑资质-不良行为_1030 ?pageSize=20&keyword=湖北正大建设工程有限公司&pageNum=1 -// */ -// DynamicObjectCollection qeug_badconductentry = dynamicObject.getDynamicObjectCollection("qeug_badconductentry"); -// qeug_badconductentry.clear(); -// String tyc_BadConduct = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_BadConduct -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"建筑资质-不良行为_1030"); -// JSONObject tyc_BadConduct_results = JSONObject.parseObject(tyc_BadConduct); -// if (null != tyc_BadConduct_results) { -// JSONObject tyc_BadConduct_result = (JSONObject)tyc_BadConduct_results.get("result"); -// if (null != tyc_BadConduct_result) { -// JSONArray items = tyc_BadConduct_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeug_badconductentry.addNew(); -// JSONObject o = (JSONObject)items.get(i); -// String integritySubject = (String)o.get("integritySubject");//诚信记录主体 -// String creditIcon = (String)o.get("creditIcon");//标签 -// String decisionContent = (String)o.get("decisionContent");//决定内容 -// String decisionContent2 = (String)o.get("decisionContent2");//决定内容2 -// String reasons = (String)o.get("reasons");//查看事由 -// String decisionDate = (String)o.get("decisionDate");//决定日期 -// String publishValidityPeriod = (String)o.get("publishValidityPeriod");//发布有效期 -// add.set("seq",i); -// add.set("qeug_integritysubject",integritySubject); -// add.set("qeug_crediticon",creditIcon); -// add.set("qeug_decisioncontent",decisionContent); -// add.set("qeug_decisioncontent2",decisionContent2); -// add.set("qeug_reasons",reasons); -// add.set("qeug_decisiondate",decisionDate); -// add.set("qeug_publishvalidityperio",publishValidityPeriod); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// /** -// * 15.企业三要素验证_1074 ?code=91110000802100433B&name=北京百度网讯科技有限公司&legalPersonName=梁志祥 -// */ -// String code = dynamicObject.getString("societycreditcode");//统一社会信用代码 -// String name = dynamicObject.getString("name");//供应商名字 -// String legalPersonName =dynamicObject.getString("artificialperson");//法人 -// String tyc_Verify = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Verify -// + "?code="+code+"&name="+name+"&legalPersonName="+legalPersonName,tyc_Test_keyword,"企业三要素验证_1074"); -// JSONObject tyc_Verify_results = JSONObject.parseObject(tyc_Verify); -// if (null != tyc_Verify_results) { -// JSONObject tyc_Verify_result = (JSONObject)tyc_Verify_results.get("result"); -// String result = "";//三要素验证结果 -// if (null != tyc_Verify_result) { -// Integer o = (Integer)tyc_Verify_result.get("result");//验证结果,0-验证失败,1-验证成功,2-输入企业名疑似曾用名,其他两要素一致 -// switch (o){ -// case 0: -// result = "验证失败"; -// break; -// case 1: -// result = "验证成功"; -// break; -// case 2: -// result = "输入企业名疑似曾用名,其他两要素一致"; -// break; -// default: -// break; -// } -// } -// dynamicObject.set("qeug_verify",result); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// -// -// /** -// * 16.行政处罚_1124 ?pageSize=20&keyword=北京百度网讯科技有限公司&pageNum=1 qeug_punishmentinfoentry -// */ -// DynamicObjectCollection qeugPunishmentinfoentry = dynamicObject.getDynamicObjectCollection("qeug_punishmentinfoentry"); -// qeugPunishmentinfoentry.clear(); -// String tyc_PunishmentInfo = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_PunishmentInfo -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"行政处罚_1124"); -// JSONObject tyc_PunishmentInfo_results = JSONObject.parseObject(tyc_PunishmentInfo); -// if (null != tyc_PunishmentInfo_results) { -// JSONObject tyc_PunishmentInfo_result = (JSONObject)tyc_PunishmentInfo_results.get("result"); -// if (null != tyc_PunishmentInfo_result) { -// JSONArray items = tyc_PunishmentInfo_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeugPunishmentinfoentry.addNew(); -// JSONObject o = (JSONObject)items.get(i); -// String decisionDate = (String)o.get("decisionDate");//处罚日期 -// String punishNumber = (String)o.get("punishNumber");//决定文书号 -// String reason = (String)o.get("punishNumber");//处罚事由/违法行为类型 -// String content = (String)o.get("content");//处罚结果/内容 -// String departmentName = (String)o.get("departmentName");//处罚单位 -// String legalPersonName1 = (String)o.get("legalPersonName");//法定代表人 -// String punishStatus = (String)o.get("punishStatus");//处罚状态 -// String punishName = (String)o.get("punishName");//处罚名称 -// add.set("seq",i); -// add.set("qeug_decisiondatepun",decisionDate); -// add.set("qeug_punishnumber",punishNumber); -// add.set("qeug_punishnumberpun",reason); -// add.set("qeug_content",content); -// add.set("qeug_departmentname",departmentName); -// add.set("qeug_legalpersonname",legalPersonName1); -// add.set("qeug_punishstatus",punishStatus); -// add.set("qeug_punishname",punishName); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// -// /** -// * 17.严重违法_846 ?pageSize=20&keyword=武陟县佳翔汽车服务有限公司&pageNum=1 -// */ -// DynamicObjectCollection qeugIllegalinfoentry = dynamicObject.getDynamicObjectCollection("qeug_illegalinfoentry"); -// qeugIllegalinfoentry.clear(); -// String tyc_Illegalinfo = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Illegalinfo -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"严重违法_846"); -// JSONObject tyc_Illegalinfo_results = JSONObject.parseObject(tyc_Illegalinfo); -// if (null != tyc_Illegalinfo_results) { -// JSONObject tyc_Illegalinfo_result = (JSONObject)tyc_Illegalinfo_results.get("result"); -// if (null != tyc_Illegalinfo_result) { -// JSONArray items = tyc_Illegalinfo_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeugIllegalinfoentry.addNew(); -// JSONObject o = (JSONObject) items.get(i); -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); -// String removedate = "";//移除日期 -// Long removeDate = (Long) o.get("removeDate");//移除日期 -// if (null != removeDate) { -// removedate = sdf.format(new Date(removeDate)); -// } -// String putReason = (String) o.get("putReason");//列入原因 -// String putDepartment = (String) o.get("putDepartment");//决定列入部门(作出决定机关) -// String removeDepartment = (String) o.get("removeDepartment");//决定移除部门 -// String removeReason = (String) o.get("removeReason");//移除原因 -// String putDate = (String) o.get("putDate");//列入日期 -// add.set("seq", i); -// add.set("qeug_removedateil", removedate); -// add.set("qeug_putreasonil", putReason); -// add.set("qeug_putdepartment", putDepartment); -// add.set("qeug_removedepartment", removeDepartment); -// add.set("qeug_removereasonil", removeReason); -// add.set("qeug_putdateil", sdf.format(new Date(putDate))); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// /** -// * 18.法律诉讼_1114 ?keyword=北京百度网讯科技有限公司&pageNum=1&pageSize=20 -// */ -// DynamicObjectCollection qeugLawsuitentry = dynamicObject.getDynamicObjectCollection("qeug_lawsuitentry"); -// qeugLawsuitentry.clear(); -// String tyc_LawSuit = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_LawSuit -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"法律诉讼_1114"); -// JSONObject tyc_LawSuit_results = JSONObject.parseObject(tyc_LawSuit); -// if (null != tyc_LawSuit_results) { -// JSONObject tyc_LawSuit_result = (JSONObject)tyc_LawSuit_results.get("result"); -// if (null != tyc_LawSuit_result) { -// JSONArray items = tyc_LawSuit_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeugLawsuitentry.addNew(); -// JSONObject o = (JSONObject) items.get(i); -// String docType = (String) o.get("docType");//文书类型 -// String title = (String) o.get("title");//案件名称 -// String court = (String) o.get("court");//审理法院 -// String judgeTime = (String) o.get("judgeTime");//裁判日期 -// String caseNo = (String) o.get("caseNo");//案号 -// String caseType = (String) o.get("caseType");//案件类型 -// String caseReason = (String) o.get("caseReason");//案由 -// add.set("seq", i); -// add.set("qeug_doctype", docType); -// add.set("qeug_title", title); -// add.set("qeug_court", court); -// add.set("qeug_judgetime", judgeTime); -// add.set("qeug_caseno", caseNo); -// add.set("qeug_casetype", caseType); -// add.set("qeug_casereason", caseReason); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// -// -// /** -// * 19.失信人_843 ?keyword=恩施鑫地源农业开发有限公司&pageNum=1&pageSize=1 -// */ -// DynamicObjectCollection qeugJrDishonestentry = dynamicObject.getDynamicObjectCollection("qeug_jr_dishonestentry"); -// qeugJrDishonestentry.clear(); -// String tyc_Jr_Dishonest = TycUtils.executeGet(TycUtils.tyc_Token, TycUtils.tyc_Jr_Dishonest -// + "?keyword=" + tyc_Test_keyword,tyc_Test_keyword,"失信人_843"); -// JSONObject tyc_Jr_Dishonest_results = JSONObject.parseObject(tyc_Jr_Dishonest); -// if (null != tyc_Jr_Dishonest_results) { -// JSONObject tyc_Jr_Dishonest_result = (JSONObject)tyc_Jr_Dishonest_results.get("result"); -// if (null != tyc_Jr_Dishonest_result) { -// JSONArray items = tyc_Jr_Dishonest_result.getJSONArray("items"); -// for (int i = 0; i < items.size(); i++) { -// DynamicObject add = qeugJrDishonestentry.addNew(); -// JSONObject o = (JSONObject) items.get(i); -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); -// String iname = (String) o.get("iname");//失信人名称 -// String disrupttypename = (String) o.get("disrupttypename");//失信被执行人行为具体情形 -// String casecode = (String) o.get("casecode");//案号 -// String performance = (String) o.get("performance");//履行情况 -// String regDate = "";//立案日期 -// Long regdate = (Long) o.get("regdate");//立案时间 -// if (null != regdate) { -// regDate = sdf.format(new Date(regdate)); -// } -// String publishDate = "";//发布日期 -// Long publishdate = (Long) o.get("publishdate");//发布时间 -// if (null != publishdate) { -// publishDate = sdf.format(new Date(publishdate)); -// } -// String gistunit = (String) o.get("gistunit");//做出执行的依据单位 -// -// add.set("seq", i); -// add.set("qeug_iname", iname); -// add.set("qeug_disrupttypename", disrupttypename); -// add.set("qeug_casecode", casecode); -// add.set("qeug_performance", performance); -// add.set("qeug_regdate", regDate); -// add.set("qeug_publishdate", publishDate); -// add.set("qeug_gistunit", gistunit); -// SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); -// } -// } -// } -// } catch (Exception ex) { -// DobeDWUtils.saveLog(tyc_Test_keyword, -// "天眼查",tyc_Test_keyword, ex.getMessage()+"\n"+ ex.getStackTrace()[0].getClassName()+"\n"+ -// ex.getStackTrace()[0].getMethodName()+"\n"+ ex.getStackTrace()[0].getLineNumber(), -// false,"query_tyc"); -// } -// } -// } } diff --git a/main/java/shkd/repc/resm/opplugin/TycSupplierSearchOPPlugin.java b/main/java/shkd/repc/resm/opplugin/TycSupplierSearchOPPlugin.java index 4a9e71f..9e0d659 100644 --- a/main/java/shkd/repc/resm/opplugin/TycSupplierSearchOPPlugin.java +++ b/main/java/shkd/repc/resm/opplugin/TycSupplierSearchOPPlugin.java @@ -57,7 +57,6 @@ public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn { if (null != supplier_t) { queryTyc(supplier_t); } - } //todo 测试定时任务代码 //正式供应商列表批量查询 @@ -74,12 +73,67 @@ public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn { DynamicObject supplier = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1}); if (null != supplier) { logger.info(name+"3333333正式供应商列表批量查询"); + queryTyc(supplier); + dbTYC(supplier);//比对天眼查数据 } } } } + public void dbTYC(DynamicObject supplier_zs){ + + /** + * -------------------------------------------基本信息核对------------------------------------------ + */ + + DynamicObjectCollection qeug_infocheckentry = supplier_zs.getDynamicObjectCollection("qeug_infocheckentry"); + qeug_infocheckentry.clear(); + DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck", + "number,name,qeug_apifields", null); + for (int i = 0; i < qeugTycInfochecks.length; i++) { + DynamicObject qeugTycInfocheck = qeugTycInfochecks[i]; + DynamicObject add = qeug_infocheckentry.addNew(); + add.set("seq",i); + String number = qeugTycInfocheck.getString("number"); + add.set("qeug_bsfield",number);//核对字段标识 + add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称 + String bsinput = "";//录入内容 + Object obj = supplier_zs.get(number); + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + if (obj instanceof Date) { + Date date = (Date) obj; + bsinput = sd.format(date); + } else if(obj instanceof String) { + bsinput =(String) obj; + }else if(obj instanceof OrmLocaleValue) { + OrmLocaleValue o = (OrmLocaleValue) obj; + bsinput = o.get("zh_CN"); + } + add.set("qeug_bsinput",bsinput); + String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识 + add.set("qeug_apifield",qeugApifields);//接口字段标识 + String queryresult = "";//接口查询结果 + Object obj1 = supplier_zs.get(qeugApifields); + if (obj1 instanceof Date) { + Date date = (Date) obj1; + queryresult = sd.format(date); + } else if(obj1 instanceof String) { + queryresult =(String) obj1; + } else if(obj1 instanceof Long) { + Date date = new Date((Long) obj1); + queryresult = sd.format(date); + } + add.set("qeug_queryresult",queryresult); + if (bsinput.equals(queryresult)) { + add.set("qeug_issame","1");//0:不匹配 1:匹配 + }else { + add.set("qeug_issame","0"); + } + } + SaveServiceHelper.save(new DynamicObject[]{supplier_zs}); + } + public static void queryTyc(DynamicObject supplier_zs) { DynamicObject dynamicObject = supplier_zs;//正式供应商 // DynamicObject supplier_t = supplier_zs;//正式供应商 @@ -211,70 +265,7 @@ public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn { dynamicObject.set("qeug_businessscopes",businessScope);//经营范围 SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); - /** - * -------------------------------------------基本信息核对------------------------------------------ - */ - - DynamicObjectCollection qeug_infocheckentry = dynamicObject.getDynamicObjectCollection("qeug_infocheckentry"); - qeug_infocheckentry.clear(); - DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck", - "number,name,qeug_apifields", null); - for (int i = 0; i < qeugTycInfochecks.length; i++) { - DynamicObject qeugTycInfocheck = qeugTycInfochecks[i]; - DynamicObject add = qeug_infocheckentry.addNew(); - add.set("seq",i); - String number = qeugTycInfocheck.getString("number"); - add.set("qeug_bsfield",number);//核对字段标识 - add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称 - String bsinput = "";//录入内容 - Object obj = dynamicObject.get(number); - SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); - if (obj instanceof Date) { - Date date = (Date) obj; - bsinput = sd.format(date); - } else if(obj instanceof String) { - bsinput =(String) obj; - }else if(obj instanceof OrmLocaleValue) { - OrmLocaleValue o = (OrmLocaleValue) obj; - bsinput = o.get("zh_CN"); - } - add.set("qeug_bsinput",bsinput); - String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识 - add.set("qeug_apifield",qeugApifields);//接口字段标识 - String queryresult = "";//接口查询结果 - Object obj1 = tyc_Baseinfo_result.get(qeugApifields); - if (obj1 instanceof Date) { - Date date = (Date) obj1; - queryresult = sd.format(date); - } else if(obj1 instanceof String) { - queryresult =(String) obj1; - } else if(obj1 instanceof Long) { - Date date = new Date((Long) obj1); - queryresult = sd.format(date); - } - add.set("qeug_queryresult",queryresult); - if (bsinput.equals(queryresult)) { - add.set("qeug_issame","1");//0:不匹配 1:匹配 - }else { - add.set("qeug_issame","0"); - } - } - SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); - } -// else { -// //接口调用失败 -// Integer error_code = (Integer)tyc_Baseinfo_results.get("error_code");//状态码 -// if (error_code.equals(300003)) { -// String reason = (String)tyc_Baseinfo_results.get("reason");//错误信息 -// OperateErrorInfo operateErrorInfo = new OperateErrorInfo(); -// operateErrorInfo.setMessage(reason + ",请联系管理员"); -// operateErrorInfo.setErrorLevel(ErrorLevel.Error.name()); -// operateErrorInfo.setPkValue(dynamicObject.getPkValue()); -// this.operationResult.addErrorInfo(operateErrorInfo); -// logger.error("天眼查接口调用失败,错误码:" + error_code + ",原因:" + reason); -// } -// } } From bfd607f01980dbb434ccd2932070b8a37dbb1431 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Fri, 15 Nov 2024 20:11:12 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BA=A7=E5=80=BC=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96(=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E5=AE=8C=E5=B7=A5=E9=87=8F=E9=9A=94=E7=A6=BB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recon/formplugin/ContractFormPlugin.java | 29 +++++++- .../formplugin/WorkloadcfmbillFormPlugin.java | 74 ++++++++++--------- .../opplugin/IntroduceContractPlugin.java | 23 ++++-- 3 files changed, 79 insertions(+), 47 deletions(-) diff --git a/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java b/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java index c6d2f8b..cea7b7a 100644 --- a/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java @@ -10,6 +10,7 @@ import kd.bos.entity.BasedataEntityType; import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.BeforeDeleteEntryEventArgs; import kd.bos.entity.datamodel.events.IDataModelChangeListener; +import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.entity.property.BasedataProp; import kd.bos.entity.property.EntryProp; import kd.bos.entity.property.MulBasedataProp; @@ -205,6 +206,25 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis this.getView().invokeOperation("refresh"); return result; } + + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + + super.propertyChanged(e); + String name = e.getProperty().getName();//字段名称 + if("qeug_chmentpanel_f".equals(name)){ + Object qeugChmentpanelF = this.getModel().getValue("qeug_chmentpanel_f"); + if (qeugChmentpanelF instanceof Number) { + int pkLongValue = ((Number) qeugChmentpanelF).intValue(); // 转换为 long + if (pkLongValue == 0) { + this.getView().getModel().getEntryEntity("qeug_invoiceentryinfo").clear(); + this.getView().updateView("qeug_invoiceentryinfo"); + } + } + } + } + @Override public void afterDoOperation(AfterDoOperationEventArgs args) { @@ -244,8 +264,9 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis for (Map fileMap : attachments) { Object attPkId = fileMap.get("attPkId"); if (null == attPkId) { - this.getView().showTipNotification("请先保存单据"); - return; +// this.getView().showTipNotification("请先保存单据"); +// return; + this.getView().invokeOperation("save");//调用保存 } List> attachmentes = AttachmentServiceHelper.getAttachments("recon_contractbill", this.getModel().getValue("id"), "qeug_attachmentpanelap"); for (Map attachment : attachmentes) { @@ -307,7 +328,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis case 0: double num = Double.parseDouble(cell.toString()); int result = (int)num; - contractsummarylist.set("qeug_seq",String.valueOf(result));//序号 + contractsummarylist.set("qeug_seqs",result);//序号 break; case 1: contractsummarylist.set("qeug_projectnumber",cell);//项目编码 @@ -392,7 +413,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis } this.getView().updateView("qeug_invoiceentryinfo"); SaveServiceHelper.save(new DynamicObject[]{this.getView().getModel().getDataEntity()}); - this.getView().showSuccessNotification("清单汇总识别成功"); +// this.getView().showSuccessNotification("清单汇总识别成功"); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java b/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java index 310d56c..07077b0 100644 --- a/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java @@ -36,13 +36,16 @@ import java.util.Map; */ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements TabSelectListener { - - - @Override public void beforeDoOperation(BeforeDoOperationEventArgs args) { super.beforeDoOperation(args); + DynamicObject cqcontract = (DynamicObject) this.getModel().getValue("contractbill"); + long id = 0; + if (null != cqcontract) { + id = cqcontract.getLong("id"); + } + FormOperate source = (FormOperate) args.getSource(); String operateKey = source.getOperateKey(); switch (operateKey) { @@ -54,14 +57,35 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab this.getView().showTipNotification("新增行无法查看明细"); return; } - DynamicObject cqcontract = (DynamicObject) this.getModel().getValue("contractbill"); - long id = 0; - if (null != cqcontract) { - id = cqcontract.getLong("id"); - } getListShowParamer(this.getView(), this.getModel(),String.valueOf(id)); break; + case "audit": + //产值确认--清单明细 + DynamicObjectCollection invoiceentryinfos = this.getModel().getDataEntity(true).getDynamicObjectCollection("qeug_invoiceentryinfo"); + //产值确认审核时,将所有明细的完成百分比覆盖掉合同看的清单 + for (DynamicObject invoiceentryinfo : invoiceentryinfos) { + QFilter q3 = new QFilter("qeug_sheetname", QCP.equals, invoiceentryinfo.getString("qeug_summarycontent")); + QFilter q4 = new QFilter("qeug_contractid",QCP.equals, String.valueOf(id)); + QFilter q5 = new QFilter("qeug_workloadcfmid",QCP.equals, String.valueOf(this.getModel().getDataEntity().getPkValue())); + DynamicObject[] recon_contractbills = BusinessDataServiceHelper.load("qeug_contractsummarylist", + "id,qeug_seq,qeug_seqs,qeug_projectnumber,qeug_projectname,qeug_featuredescript,qeug_engincontent," + + "qeug_unit,qeug_decimalqty,qeug_unitprice,qeug_amounttotal,qeug_artificial,qeug_provisional," + + "qeug_remarks,qeug_contractid,qeug_sheetname,qeug_cumulativepreofpro", new QFilter[]{q3,q4,q5}); + if (recon_contractbills.length > 0) { + for (int i = 0; i < recon_contractbills.length; i++) { + DynamicObject contractsummarylist = recon_contractbills[i]; + QFilter q6 = new QFilter("qeug_workloadcfmid",QCP.equals, "");//未作产值确认时的清单 + QFilter q7 = new QFilter("qeug_seqs",QCP.equals, contractsummarylist.getBigDecimal("qeug_seqs"));//项目编码 + DynamicObject add = BusinessDataServiceHelper.loadSingle("qeug_contractsummarylist", new QFilter[]{q3, q4, q6, q7}); + if (null != add) { + add.set("qeug_cumulativepreofpro",contractsummarylist.getBigDecimal("qeug_cumulativepreofpro"));//累计进度百分比(%) + SaveServiceHelper.save(new DynamicObject[]{add}); + } + } + } + } + break; default: break; } @@ -73,32 +97,14 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab * @param model 模型 */ private void getListShowParamer(IFormView formView, IDataModel model,String contentId) { - -// ListShowParameter parameter = ShowFormHelper.createShowListForm("qeug_contractsummarylist", true); -// parameter.getOpenStyle().setShowType(ShowType.MainNewTabPage);//Floating MainNewTabPage NewBrowserPage NewTabPage -// parameter.setBillFormId("qeug_contractsummarylist"); -// parameter.setHasRight(true); -// StyleCss styleCss = new StyleCss(); -// styleCss.setWidth("1500"); -// styleCss.setHeight("800"); -// parameter.getOpenStyle().setInlineStyleCss(styleCss); DynamicObjectCollection dynColl = formView.getModel().getEntryEntity("qeug_invoiceentryinfo"); int index = model.getEntryCurrentRowIndex("qeug_invoiceentryinfo"); DynamicObject dynamicObject = dynColl.get(index); String qeug_summarycontent = dynamicObject.getString("qeug_summarycontent");//汇总内容(sheetName) //// Object pkValue = formView.getModel().getDataEntity().getPkValue();//合同ID -// QFilter q1 = new QFilter("qeug_sheetname", QCP.equals, qeug_summarycontent); QFilter q2 = new QFilter("qeug_contractid",QCP.equals, contentId); QFilter q3 = new QFilter("qeug_workloadcfmid",QCP.equals,String.valueOf(this.getModel().getDataEntity().getPkValue())); -// List listQF = Lists.newArrayList(); -// listQF.add(q1.and(q2)); -// parameter.setListFilterParameter(new ListFilterParameter(listQF, null)); -// parameter.setCustomParam("qeug_sheetname",qeug_summarycontent); -// parameter.setCustomParam("qeug_contractid",contentId); -// parameter.setStatus(OperationStatus.ADDNEW); -// this.getView().showForm(parameter); -// OpenFormUtils.openListPage(); Map map = new HashMap(); map.put("Workloadcfmbill_id", this.getModel().getDataEntity().getPkValue()); OpenFormUtils.openListPage(this.getView(), "qeug_contractsummarylist", ShowType.MainNewTabPage,map, q1.and(q2).and(q3), (CloseCallBack) null); @@ -139,11 +145,6 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab add.set("qeug_isnew", qeug_invoiceentryinfo.get("qeug_isnew")); add.set("qeug_remarks", qeug_invoiceentryinfo.get("qeug_remarks")); add.set("qeug_currencylist", qeug_invoiceentryinfo.get("qeug_currencylist")); -// this.getModel().setValue("qeug_summarycontent", qeug_invoiceentryinfo.get("qeug_summarycontent"), i);//汇总内容 -// this.getModel().setValue("qeug_amount", qeug_invoiceentryinfo.get("qeug_amount"), i);//金额(元) -// this.getModel().setValue("qeug_isnew", qeug_invoiceentryinfo.get("qeug_isnew"), i);//是否新增行 -// this.getModel().setValue("qeug_remarks", qeug_invoiceentryinfo.get("qeug_remarks"), i);//备注 -// this.getModel().setValue("qeug_currencylist", qeug_invoiceentryinfo.get("qeug_currencylist"), i);//清单币别 } //携带工程经理 @@ -162,16 +163,16 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab QFilter q4 = new QFilter("qeug_contractid",QCP.equals, String.valueOf(id)); QFilter q5 = new QFilter("qeug_workloadcfmid",QCP.equals, "");//防止第二次产值确认时,id覆盖确认过的清单产值确认 DynamicObject[] recon_contractbills = BusinessDataServiceHelper.load("qeug_contractsummarylist", - "id,qeug_seq,qeug_projectnumber,qeug_projectname,qeug_featuredescript,qeug_engincontent," + + "id,qeug_seqs,qeug_projectnumber,qeug_projectname,qeug_featuredescript,qeug_engincontent," + "qeug_unit,qeug_decimalqty,qeug_unitprice,qeug_amounttotal,qeug_artificial,qeug_provisional," + - "qeug_remarks,qeug_contractid,qeug_sheetname", new QFilter[]{q3,q4,q5}); + "qeug_remarks,qeug_contractid,qeug_sheetname,qeug_cumulativepreofpro", new QFilter[]{q3,q4,q5}); if (recon_contractbills.length > 0) { for (int i = 0; i < recon_contractbills.length; i++) { DynamicObject contractsummarylist = recon_contractbills[i]; DynamicObject add = BusinessDataServiceHelper.newDynamicObject("qeug_contractsummarylist"); - add.set("qeug_seq", contractsummarylist.getString("qeug_seq")); - add.set("qeug_projectnumber", contractsummarylist.getString("qeug_projectnumber")); - add.set("qeug_projectname", contractsummarylist.getString("qeug_projectname")); + add.set("qeug_seqs", contractsummarylist.getString("qeug_seqs")); + add.set("qeug_projectnumber", contractsummarylist.getString("qeug_projectnumber").trim()); + add.set("qeug_projectname", contractsummarylist.getString("qeug_projectname").trim()); add.set("qeug_featuredescript", contractsummarylist.getString("qeug_featuredescript")); add.set("qeug_engincontent", contractsummarylist.getString("qeug_engincontent")); add.set("qeug_unit", contractsummarylist.getString("qeug_unit")); @@ -183,6 +184,7 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab add.set("qeug_remarks", contractsummarylist.getString("qeug_remarks")); add.set("qeug_contractid", contractsummarylist.getString("qeug_contractid")); add.set("qeug_sheetname", contractsummarylist.getString("qeug_sheetname")); + add.set("qeug_cumulativepreofpro", contractsummarylist.getString("qeug_cumulativepreofpro"));//累计完成百分比 add.set("qeug_workloadcfmid",String.valueOf(this.getModel().getDataEntity().getPkValue())); add.set("enable","1");//使用状态 add.set("status","A");//数据状态 diff --git a/main/java/shkd/repc/recon/opplugin/IntroduceContractPlugin.java b/main/java/shkd/repc/recon/opplugin/IntroduceContractPlugin.java index 63ed8b5..5f43837 100644 --- a/main/java/shkd/repc/recon/opplugin/IntroduceContractPlugin.java +++ b/main/java/shkd/repc/recon/opplugin/IntroduceContractPlugin.java @@ -21,11 +21,9 @@ public class IntroduceContractPlugin extends BatchImportPlugin { while (iterator.hasNext()){ ImportBillData importBillData = iterator.next(); JSONObject data = importBillData.getData(); - String qeug_bcdecimalqtys = (String) data.get("qeug_bcdecimalqtys");//本次完工量 String qeug_decimalqty = (String) data.get("qeug_decimalqty");//工程量 - String qeug_preofpro = (String) data.get("qeug_preofpro");//进度百分比 - String qeug_workloadcfmid = (String) data.get("qeug_workloadcfmid");//产值确认id - BigDecimal bcdecimalqty = null; + String qeug_preofpro = (String) data.get("qeug_preofpro");//当前进度百分比 + String qeug_cumulativepreofpro = (String) data.get("qeug_cumulativepreofpro");//累计进度百分比 BigDecimal decimalqty =null; BigDecimal preofpro =null; if (qeug_decimalqty != null && qeug_preofpro!= null) { @@ -37,11 +35,17 @@ public class IntroduceContractPlugin extends BatchImportPlugin { logger.log(importBillData.getStartIndex(),"工程量数据格式有误").fail(); iterator.remove(); } - // 本次完工量 = 工程量 * 进度百分比 + // 本次完工量 = 工程量 * (当前进度百分比-累计完成百分比) BigDecimal bd1 = new BigDecimal(qeug_decimalqty); BigDecimal bd2 = new BigDecimal(qeug_preofpro); - BigDecimal result = bd1.multiply(bd2).multiply(BigDecimal.valueOf(0.01)); -// result = result.setScale(2, BigDecimal.ROUND_HALF_UP); + BigDecimal bd3; + if (StringUtils.isEmpty(qeug_cumulativepreofpro)) { + bd3 = BigDecimal.ZERO; // 如果 qeug_cumulativepreofpro 为空,则赋值为 0 + } else { + bd3 = new BigDecimal(qeug_cumulativepreofpro); + } + BigDecimal bd4 = bd2.subtract(bd3); + BigDecimal result = bd1.multiply(bd4).multiply(BigDecimal.valueOf(0.01)); data.put("qeug_bcdecimalqtys",result); if (StringUtils.isNotEmpty(qeug_preofpro)) { preofpro = new BigDecimal(qeug_preofpro); @@ -51,6 +55,11 @@ public class IntroduceContractPlugin extends BatchImportPlugin { logger.log(importBillData.getStartIndex(), "进度百分比不能大于100").fail(); iterator.remove(); } + if (bd3.compareTo(bd2) > 0) { + logger.log(importBillData.getStartIndex(), "当前进度百分比不能小于累计完成百分比").fail(); + iterator.remove(); + } + data.put("qeug_cumulativepreofpro",bd2); } } From 30a99ab7ccb8e3a49714633e5956038fa3b69901 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Sat, 16 Nov 2024 11:05:06 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=87=B4=E8=BF=9C=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/todotask/todoZyTaskServiceHandler.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index ab646ce..04f65b6 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -212,21 +212,27 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { public void sendMessage(MessageContext messageContext, MessageInfo message) { super.sendMessage(messageContext, message); //获取单据编码 - String billNo = messageContext.getBillNo(); +// String billNo = messageContext.getBillNo(); + String billNo =message.getNestBillno(); //消息内容 String content = message.getContent(); //消息时间 - Date createDate = messageContext.getCreateDate(); +// Date createDate = messageContext.getCreateDate(); +// Date createDate = new Date(); + Date createDate = message.getSendTime(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String createDateStr = sdf.format(createDate); //获取当前任务ID - Long taskId = messageContext.getTaskId(); +// Long taskId = messageContext.getTaskId(); + Long taskId = message.getId(); + //获取审批人集合 List approvers = new ArrayList<>(); List userIds = message.getUserIds(); // 审批人ID集合 List approversLists = getApprovers(userIds, approvers); - //获取任务创建人 - Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id + //获取任务创建人 // 信息发送人 + Long startUserId = message.getSenderId(); +// Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id DynamicObject startUser = BusinessDataServiceHelper.loadSingle(startUserId, "bos_user"); String startNumber = ""; String startName = ""; From 1d42a46a01ec175417f013d8f39688bdecd27ab5 Mon Sep 17 00:00:00 2001 From: xiaosuonian <913474402@qq.com> Date: Sat, 16 Nov 2024 11:08:02 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/java/shkd/todotask/todoZyTaskServiceHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index 04f65b6..85986ef 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -268,7 +268,7 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { thirdPartyMap.put("billNo",billNo); thirdPartyMap.put("startNumber",startNumber);//发起人 - //推送OA待办新增接口 + //推送OA消息新增接口 thirdpartyMessage(thirdPartyMap); } From 80926589985e23ee81a1eaf597dbc8aa32077de4 Mon Sep 17 00:00:00 2001 From: xiaosuonian <913474402@qq.com> Date: Sat, 16 Nov 2024 12:15:46 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=20--xiefeng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/todotask/todoZyTaskServiceHandler.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index 85986ef..f6ae65f 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -233,14 +233,16 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { //获取任务创建人 // 信息发送人 Long startUserId = message.getSenderId(); // Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id - DynamicObject startUser = BusinessDataServiceHelper.loadSingle(startUserId, "bos_user"); String startNumber = ""; String startName = ""; - if (null != startUser) { - startNumber = startUser.getString("number"); - startName = startUser.getString("name"); - if (!userIds.contains(startUserId)) { - approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口) + if (null != startUserId) { + DynamicObject startUser = BusinessDataServiceHelper.loadSingle(startUserId, "bos_user"); + if (null != startUser) { + startNumber = startUser.getString("number"); + startName = startUser.getString("name"); + if (!userIds.contains(startUserId)) { + approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口) + } } } //获取Url From deee7206846ad7a756f21a643f90d40f96859be6 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Sat, 16 Nov 2024 12:58:01 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=88=90=E7=86=9F=E5=9B=AD=E5=8C=BA=EF=BC=9B?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E7=99=BB=E8=AE=B0=E5=A2=9E=E5=8A=A0=E4=BC=9A?= =?UTF-8?q?=E8=AE=A1=E7=A7=91=E7=9B=AE=E6=8E=A8=E9=80=81bip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recon/opplugin/YongyouBIPOperation.java | 16 +++++++--- .../shkd/repc/task/DobeDWorgRelationTask.java | 11 +++++++ .../shkd/repc/task/DobeDWprojectTask.java | 31 +++++++++++++------ main/java/shkd/utils/DobeDWUtils.java | 10 +++--- 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java index 6960e1c..5895e60 100644 --- a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java +++ b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java @@ -331,13 +331,19 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen items.put("pu_org",companyDept[0]);//业务组织编码 同表头公司编码 // items.put("pu_deptid",companyDept[1]);//业务部门编码 费用承担部门编码,转换成财务组织编码 //外部公司:22020104\应付账款\往来单位\外部单位(工程类) - //内部关联公司:22020105\应付账款\往来单位\内部单位(关联方) - String suptype = getSupplierType(supplierid); - if("DB01".equals(suptype)){ - items.put("pk_subjcode","22020105");//集团内 + //集团内部关联公司:22020105\应付账款\往来单位\内部单位(关联方) + //如果费用登记中用户选择了会计科目,则使用该字段编号,否则还使用集团内外 yxl 20241116 + if(isnotext && payrequestinfo.getDynamicObject("qeug_accountview")!=null){ + items.put("pk_subjcode",payrequestinfo.getDynamicObject("qeug_accountview").getString("number")); }else{ - items.put("pk_subjcode","22020104");//收支项目编码 费用项目,例:660224-管理费用-服务费 会计科目(一个) + String suptype = getSupplierType(supplierid); + if("DB01".equals(suptype)){ + items.put("pk_subjcode","22020105");//集团内 + }else{ + items.put("pk_subjcode","22020104");//收支项目编码 费用项目,例:660224-管理费用-服务费 会计科目(一个) + } } + items.put("ap_payaccount",ap_payaccount);//付款银行账户编码 同表头 items.put("ap_recaccount",ap_recaccount);//收款银行账户编码 items.put("pk_balatype","07");//结算方式编码,传编码例:07-网银 diff --git a/main/java/shkd/repc/task/DobeDWorgRelationTask.java b/main/java/shkd/repc/task/DobeDWorgRelationTask.java index 155e5be..35c81b1 100644 --- a/main/java/shkd/repc/task/DobeDWorgRelationTask.java +++ b/main/java/shkd/repc/task/DobeDWorgRelationTask.java @@ -28,6 +28,7 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin { private static Log log = LogFactory.getLog(DobeDWorgRelationTask.class); private static final String entityName = "qeug_recon_orgrelation";//供应链库 表名 tk_qeug_recon_orgrelation + private static final String orgEntityName = "bos_org";//系统库 表名 t_ORG_ORG private static final String dw_menthod = "mdm_orgcorp"; @Override @@ -91,6 +92,7 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin { String paybank = null; String paynumber = null; String taxno = null; + DynamicObject yworginfo = null; for (int i = 0; i < detailsJson.size(); i++) { json_body = detailsJson.getJSONObject(i); @@ -137,6 +139,15 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin { //保存数据:直接保存入库,不走操作校验 SaveServiceHelper.save(new DynamicObject[]{orginfo}); } + //根据行政组织编号找到星瀚上的业务单元对象 + yworginfo = BusinessDataServiceHelper.loadSingle(orgEntityName,new QFilter[]{new QFilter("number","=",orgNumber)}); + if(yworginfo != null){ + yworginfo.set("ffirmname", companyName);//业务单元-公司名称 + yworginfo.set("depositbank", paybank);//业务单元-开户行 + yworginfo.set("bankaccount", paynumber);//业务单元-银行账户 + yworginfo.set("uniformsocialcreditcode", taxno);//业务单元-统一社会信用代码 + SaveServiceHelper.update(yworginfo); + } } } diff --git a/main/java/shkd/repc/task/DobeDWprojectTask.java b/main/java/shkd/repc/task/DobeDWprojectTask.java index 459954a..eb69a60 100644 --- a/main/java/shkd/repc/task/DobeDWprojectTask.java +++ b/main/java/shkd/repc/task/DobeDWprojectTask.java @@ -83,16 +83,17 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { String fbillno = null;//项目编号 String fbillname = null;//项目名称 - String fprojectstageid = null;//项目阶段 repmd_projectstages t_repmd_projectstage +// String fprojectstageid = null;//项目阶段 repmd_projectstages t_repmd_projectstage 用户自行在界面上选择 // String fversionnum = null;//版本号 // String fisleaf = null;//是否叶子节点 String faddress = null;//项目地址 + String project_stage = null;//项目性质--二开字段,用于工作流发起判断 String forgid = null;//所属组织-行政组织 Date project_getdate = null;//项目获取时间 String fdwid = null;//数仓项目id DynamicObject orginfo = null; DynamicObject projectinfo = null; - DynamicObject projectstageinfo = null; +// DynamicObject projectstageinfo = null; for (int i = 0; i < detailsJson.size(); i++) { json_body = detailsJson.getJSONObject(i); fbillno = json_body.getString("project_code"); @@ -101,7 +102,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { // fisleaf = json_body.getString("fisleaf"); forgid = json_body.getString("org_code"); project_getdate = json_body.getDate("project_getdate"); - fprojectstageid = json_body.getString("project_stage"); + project_stage = json_body.getString("project_stage"); fdwid = json_body.getString("project_id"); if(DobeDWUtils.isEmpty(fbillno) || DobeDWUtils.isEmpty(fbillname) || DobeDWUtils.isEmpty(forgid) || DobeDWUtils.isEmpty(fdwid)){ log.info(String.format("项目接口入参为空异常:%s", json_body.toJSONString())); @@ -110,7 +111,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { //根据数仓id查找项目是否已存在 projectinfo = BusinessDataServiceHelper.loadSingle(entityName,new QFilter[]{new QFilter("qeug_dwid","=",fdwid)}); //项目阶段表名:t_repmd_projectstage - projectstageinfo = QueryServiceHelper.queryOne("repmd_projectstages","id,number",new QFilter[]{new QFilter("number","=",fprojectstageid)}); +// projectstageinfo = QueryServiceHelper.queryOne("repmd_projectstages","id,number",new QFilter[]{new QFilter("number","=",fprojectstageid)}); if(projectinfo != null){ if("C".equals(projectinfo.getString("billstatus"))){ //如果项目已审核,则不进行修改 @@ -119,9 +120,9 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { //已存在,做更新 名称 阶段 版本号等信息;组织、编号、是否叶子节点不能更新;需要前台操作 projectinfo.set("billname", fbillname); projectinfo.set("fullname", fbillname);//项目全称 - if(projectstageinfo != null){ - projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段 - } +// if(projectstageinfo != null){ +// projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段 +// } projectinfo.set("address", faddress); projectinfo.set("acquiredate", project_getdate); // projectinfo.set("billstatus", "A");//单据状态 A保存 B已提交 C已审核 @@ -129,6 +130,11 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { projectinfo.set("enable", 1);//是否启用 projectinfo.set("islatestversion", true);//是否最新版 projectinfo.set("mainprojectid", projectinfo.getLong("id"));//主项目ID + if("新拓园区".equals(project_stage)){ + projectinfo.set("qeug_combofield", "xintuo"); + }else if("成熟园区".equals(project_stage)){ + projectinfo.set("qeug_combofield", "chengshu"); + } // projectinfo.set("billno", fbillno); // projectinfo.set("org", ); // projectinfo.set("isleaf", fisleaf); @@ -147,9 +153,9 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { // } projectinfo.set("bizdate", new Date());//业务日期 projectinfo.set("showflag", true);//是否列表显示 - if(projectstageinfo != null){ - projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段 - } +// if(projectstageinfo != null){ +// projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段 +// } projectinfo.set("address", faddress); projectinfo.set("acquiredate", project_getdate); orginfo = QueryServiceHelper.queryOne("bos_org","id,number,name",new QFilter[]{new QFilter("number","=",forgid)}); @@ -164,6 +170,11 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { projectinfo.set("enable", 1);//是否启用 projectinfo.set("billstatus", "A");//单据状态 A保存 B已提交 C已审核 projectinfo.set("creator", 43007523L);//创建人默认指定为金小蝶 + if("新拓园区".equals(project_stage)){ + projectinfo.set("qeug_combofield", "xintuo"); + }else if("成熟园区".equals(project_stage)){ + projectinfo.set("qeug_combofield", "chengshu"); + } //保存数据:直接保存入库,不走操作校验 SaveServiceHelper.save(new DynamicObject[]{projectinfo}); } diff --git a/main/java/shkd/utils/DobeDWUtils.java b/main/java/shkd/utils/DobeDWUtils.java index e465393..b5f339c 100644 --- a/main/java/shkd/utils/DobeDWUtils.java +++ b/main/java/shkd/utils/DobeDWUtils.java @@ -24,14 +24,14 @@ public class DobeDWUtils { //授权模式,客户端模式为client,密码模式为:password // public static final String granttype = "client_credentials"; - //第三方应用id,对应系统中的app_id + //BIP第三方应用id,对应系统中的app_id public static final String clientid = "ISC"; - // 第三方应用秘钥,对请求加签使用 - public static final String clientsecret = "72135b74ab7046dbab06"; + //BIP 第三方应用秘钥,对请求加签使用 + public static final String clientsecret = "cb729cf706934e97aa84"; //访问的BIP系统的账套code public static final String bizcenter = "01"; - //公钥,加解密使用 - public static final String pubKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtifU2Nm6/lwYybVGNMzmn/UvOmtjqs9tuesdchx0pK6HsiubCRiFKr/TFGLHhBKJ3TXtH4gwJLkGrMJRdTicWHOCAwcU9hmM+XsHCF4FQ4UWcWA73Ha9qR3SC1tSxwDw8n2/uHUKtKzlOGuJQnzL5hBN7DnDU4M7FqEZ+ctG71ufkjytY1TKVoHfThRTAP1ouSNo3gM/pMwjISTkFH5vY7twdu9IW09+S5/uo8C+pw7BahDpOv5z7F1yWDEnw1sdwNdqPFV2DsB1JS3GfLe9P3ZACeR+lcD3KrwBsQky3oZsg3y6NsDqOpzoLk9pToFzmci1GMfCKoc4MzVF9fq7XQIDAQAB"; + //BIP公钥,加解密使用 + public static final String pubKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8cLD7SZ8W15DF+XZ5+WURaxFP6TBvUG6fabTEh5oV2NFdsowuS88fFUx3rh0KqWQ3VtRRCVjHgGBuPIDakEZ8rn+kDq3BV10+ihJunuqqP/LBSr4Y2JYHj6vqwYw6K3raH4li/sAR02rQdoR922OU2bPxc3BlLTA0yLFqjo/3/Bf8DvYIo/yZ+enK1glK6SYVX7+dLv2a8sWb2MtUDm7JXW14rqwuO9dwlTTBTbrZ3AKubvaE7qXXqbJdYDLGTiLSD2mXJa7vwO+6ZTQJDN4sJUCeFchNMeB2xIjzbV3ZpL75xKPbbRnhANpswiaRN5OhtQcUKK3Y0+TRiihfIc3RQIDAQAB"; //用友接口IP地址 public static final String yyip = "106.14.25.83"; //用友接口端口 From 2ed76b5de3cab450008b35dec7d8c5ecf78d7a8f Mon Sep 17 00:00:00 2001 From: xiaosuonian <913474402@qq.com> Date: Sat, 16 Nov 2024 13:29:28 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E8=87=B4=E8=BF=9C=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=BD=93=E5=89=8D=E5=AE=A1=E6=89=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20--xiefeng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/todotask/closeTaskPagePlugin.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/main/java/shkd/todotask/closeTaskPagePlugin.java b/main/java/shkd/todotask/closeTaskPagePlugin.java index d1ccbdb..4135eed 100644 --- a/main/java/shkd/todotask/closeTaskPagePlugin.java +++ b/main/java/shkd/todotask/closeTaskPagePlugin.java @@ -1,10 +1,13 @@ package shkd.todotask; +import kd.bos.form.FormShowParameter; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; +import kd.bos.mvc.form.FormView; import kd.bos.workflow.taskcenter.plugin.validate.IApprovalSubPlugin; import shkd.utils.OAUtils; +import java.util.HashMap; import java.util.Map; /** @@ -15,8 +18,24 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin { @Override public boolean executeClosePageAfterSubmitTask(boolean isPCShow, Map customParams) { logger.info("进入页面关闭方法"); - logger.info("进入页面关闭方法"); - return false; + boolean flag = false; + FormView view = (FormView) customParams.get("formView"); + FormShowParameter parameter = view.getFormShowParameter(); + logger.info("获取view对象成功"); + HashMap map = new HashMap<>(); + if (parameter.getCustomParams().containsKey("apptype")) { + String apptype = parameter.getCustomParam("apptype"); + if ("zhiyuan".equals(apptype)) { + try { + view.close(); + }catch (Exception e) { + logger.info("发送指令时异常" + e.getMessage()); + throw new RuntimeException(e); + } + flag = true; + } + } + return flag; } }