From 24b35f19b88d34d3c8e1923404c3130be036350a Mon Sep 17 00:00:00 2001 From: "tanfengling@x-ri.com" <123456> Date: Tue, 11 Nov 2025 13:34:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E9=83=A8=E9=97=A8=E3=80=91?= =?UTF-8?q?=E7=9B=98=E7=82=B9=E6=96=B9=E6=A1=88=E4=BC=A0=E5=80=BC=E7=BB=99?= =?UTF-8?q?=E7=9B=98=E7=82=B9=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/form/im/InvCountBillPLugin.java | 38 ------------------- .../im/InvCountSchemeAuditExpandPlugin.java | 24 ++++++++++++ 2 files changed, 24 insertions(+), 38 deletions(-) delete mode 100644 lc123/cloud/app/plugin/form/im/InvCountBillPLugin.java create mode 100644 lc123/cloud/app/plugin/form/im/InvCountSchemeAuditExpandPlugin.java diff --git a/lc123/cloud/app/plugin/form/im/InvCountBillPLugin.java b/lc123/cloud/app/plugin/form/im/InvCountBillPLugin.java deleted file mode 100644 index 57511b2..0000000 --- a/lc123/cloud/app/plugin/form/im/InvCountBillPLugin.java +++ /dev/null @@ -1,38 +0,0 @@ -package tqq9.lc123.cloud.app.plugin.form.im; - -import kd.bos.bill.AbstractBillPlugIn; -import kd.bos.dataentity.entity.DynamicObject; -import kd.bos.dataentity.entity.DynamicObjectCollection; -import kd.bos.orm.query.QCP; -import kd.bos.orm.query.QFilter; -import kd.bos.servicehelper.BusinessDataServiceHelper; - -import java.util.EventObject; - -/** - * 盘点表表单插件 - */ -public class InvCountBillPLugin extends AbstractBillPlugIn { - - - @Override - public void afterCreateNewData(EventObject e) { - super.afterCreateNewData(e); - //给泛微审批状态设置初始默认值--待提交 - this.getModel().setValue("tqq9_fwstate", "A"); - //设置创建部门 - DynamicObject creator = (DynamicObject) this.getModel().getValue("creator"); - if(creator != null){ - DynamicObject bos_user = BusinessDataServiceHelper.loadSingle("bos_user", new QFilter[]{new QFilter("id", QCP.equals, creator.getLong("id"))}); - DynamicObjectCollection entryentity = bos_user.getDynamicObjectCollection("entryentity"); - DynamicObject dept = null; - for (DynamicObject dynamicObject : entryentity) { - boolean ispartjob = dynamicObject.getBoolean("ispartjob"); - if (!ispartjob) { - dept = dynamicObject.getDynamicObject("dpt"); - } - } - this.getModel().setValue("tqq9_dept", dept); - } - } -} diff --git a/lc123/cloud/app/plugin/form/im/InvCountSchemeAuditExpandPlugin.java b/lc123/cloud/app/plugin/form/im/InvCountSchemeAuditExpandPlugin.java new file mode 100644 index 0000000..a498370 --- /dev/null +++ b/lc123/cloud/app/plugin/form/im/InvCountSchemeAuditExpandPlugin.java @@ -0,0 +1,24 @@ +package tqq9.lc123.cloud.app.plugin.form.im; + +import kd.sdk.scmc.im.extpoint.IInvCountSchemeAuditExpand; + +import java.util.HashMap; +import java.util.Map; + +/** + * 盘点方案传值给盘点表 + * 系统服务云-配置工具-业务扩展-业务扩展场景 + * 名称:库存盘点方案审核处理扩展字段 + */ +public class InvCountSchemeAuditExpandPlugin implements IInvCountSchemeAuditExpand { + + + @Override + public Map getFieldMap() { + Map fieldMap = new HashMap<>(1); + //key:盘点方案单头扩展字段标识 value:盘点表单头扩展字段标识 + fieldMap.put("tqq9_dept","tqq9_dept");//创建部门 + fieldMap.put("tqq9_fwstate","tqq9_fwstate");//泛微审批状态-默认A + return fieldMap; + } +} From ffb6103ea55326bcf419147337a0abc50395a5a4 Mon Sep 17 00:00:00 2001 From: sez Date: Tue, 11 Nov 2025 14:34:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=B6=E8=B4=A7=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=8D=95=E9=83=A8=E5=88=86=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PmReceiptNoticeFormPlugin.java | 33 +++++++++++ .../result/PmReceiptNoticeListPlugin.java | 37 ++++++++++++ .../plugin/utils/BillCloseCancelUtils.java | 59 +++++++++++++++++++ 3 files changed, 129 insertions(+) diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java index 6ae8623..fe874af 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java @@ -86,5 +86,38 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn { } } + else if ("tqq9_partclose".equals(itemKey)) { + String billNo = (String) this.getModel().getValue("billno"); + String message = null; + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", + new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + + String entityType = "pm_receiptnotice"; + String entityName; + String label = "tqq9_ispartclose"; + DynamicObject receiveorg = dataEntity.getDynamicObject("receiveorg");//收货组织 + if (null != receiveorg) { + String number = receiveorg.getString("number"); + if ("SHLC".equals(number)) { + DynamicObjectCollection billentry = dataEntity.getDynamicObjectCollection("billentry"); + String warehouseCode = null; + for (DynamicObject dynamicObject : billentry) { + DynamicObject warehouse = dynamicObject.getDynamicObject("warehouse"); + if (null != warehouse) { + warehouseCode = warehouse.getString("number"); + } + } + String orderType = "CGRK"; + entityName = "WMS-SH-收货通知单部分取消"; + message = BillCloseCancelUtils.wmsPartClose(orderType, warehouseCode, billNo, entityType, entityName, label); + } + if (StringUtils.isNotEmpty(message)) { + this.getView().showMessage(String.valueOf(message)); + + } + + } + + } } } diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java index 432ac2e..16246c9 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java @@ -107,6 +107,43 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { } + } else if ("tqq9_partclose".equals(itemKey)) { + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + for (String billNo : billnoList) { + String message = null; + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", + new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + + String entityType = "pm_receiptnotice"; + String entityName; + String label = "tqq9_ispartclose"; + DynamicObject receiveorg = dataEntity.getDynamicObject("receiveorg");//收货组织 + if (null != receiveorg) { + String number = receiveorg.getString("number"); + if ("SHLC".equals(number)) { + DynamicObjectCollection billentry = dataEntity.getDynamicObjectCollection("billentry"); + String warehouseCode = null; + for (DynamicObject dynamicObject : billentry) { + DynamicObject warehouse = dynamicObject.getDynamicObject("warehouse"); + if (null != warehouse) { + warehouseCode = warehouse.getString("number"); + } + } + String orderType = "CGRK"; + entityName = "WMS-SH-收货通知单部分取消"; + message = BillCloseCancelUtils.wmsPartClose(orderType, warehouseCode, billNo, entityType, entityName, label); + } + if (StringUtils.isNotEmpty(message)) { + this.getView().showMessage(String.valueOf(message)); + + } + + } + + } + } } } diff --git a/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java b/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java index 03d0585..3b6ac57 100644 --- a/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java +++ b/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java @@ -265,4 +265,63 @@ public class BillCloseCancelUtils { } return message; } + + + /** + * 通天晓单据部分关闭 + * + * @param orderType 单据类型 + * @param warehouseCode 仓库编号 + * @param billNo 单据编号 + * @param entityType 单据标识 + * @param entityName 单据名称 + * @param label 推送标识 + * @return 取消结果 + */ + public static String wmsPartClose(String orderType, String warehouseCode, String billNo, String entityType, String entityName, String label) { + String method = "entryorder.close"; + String message = null; + Map request = new HashMap<>(); + request.put("warehouseCode", warehouseCode); + request.put("ownerCode", "LICHI"); + request.put("orderCode", billNo); + request.put("orderId", ""); + request.put("orderType", orderType); + request.put("closeReason", ""); + Map finalMap = new HashMap<>(); + finalMap.put("request", request); + StringBuilder xmlBuilder = new StringBuilder(); + xmlBuilder.append("\n"); + HttpRequestUtils.buildXml(xmlBuilder, finalMap, 0); + String ttx_mainUrl = ConfigUtils.getThirdConfigByNumber("Ttx_MainURL"); + String ttx_customerId = ConfigUtils.getThirdConfigByNumber("Ttx_CustomerId"); + ttx_mainUrl = ttx_mainUrl + "?method=" + method + "&v=2.0&format=xml&customerId=" + ttx_customerId; + Map headMap = new HashMap<>(); + try { + String result = HttpRequestUtils.postXml(ttx_mainUrl, xmlBuilder.toString(), headMap); + if (StringUtils.isNotEmpty(result)) { + JSONObject jsonObject = HttpRequestUtils.xmlToJson(result); + JSONObject response = jsonObject.getJSONObject("response"); + String flag = response.getString("flag"); + String code = response.getString("code"); + message = response.getString("message"); + if ("0".equals(code) || "200".equals(code)) { + message = "部分关闭成功"; + } + LCLogServiceImpl lcLogService = new LCLogServiceImpl(); + lcLogService.savelog(entityName, ttx_mainUrl, true, code.equals("200"), xmlBuilder.toString(), result); + lcLogService.isSuccess(entityType, billNo, "billno", label, code.equals("200")); + } + + } catch ( + IOException e) { + throw new RuntimeException(e); + } + + + return message; + + + } + }