From d390ae99d4cfea418c82ab2b5b481472613663ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E8=B1=86=E8=B1=86?= <13356128+sunandmoon60@user.noreply.gitee.com> Date: Fri, 10 Oct 2025 12:22:01 +0800 Subject: [PATCH] =?UTF-8?q?WMS=E5=8D=95=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/WMSPurInController.java | 26 ++++++++++ .../controller/WMSSaleOutCloseController.java | 27 +++++++++- .../api/controller/WMSSaleOutController.java | 27 ++++++++++ .../operate/pm/PurOrderBillRebatePlugin.java | 50 +++++++++++++++++-- .../plugin/operate/sys/MaterialAuditOp.java | 5 +- 5 files changed, 128 insertions(+), 7 deletions(-) diff --git a/lc123/cloud/app/api/controller/WMSPurInController.java b/lc123/cloud/app/api/controller/WMSPurInController.java index b6a77fe..3b5ce83 100644 --- a/lc123/cloud/app/api/controller/WMSPurInController.java +++ b/lc123/cloud/app/api/controller/WMSPurInController.java @@ -41,6 +41,30 @@ public class WMSPurInController { private static String PM_PURREFUNDAPPLYBILL = "pm_purrefundapplybill";//采购退货申请单 private static String TQQ9_OTHERINAPPLY = "tqq9_otherinapply";//其他入库申请 private static String IM_OTHERINBILL = "im_otherinbill";//其他入库 + private final static HashMap billTypeMap = new HashMap() {{ + put("采购订单", "pm_receiptnotice"); + put("其他入库单", "tqq9_otherinapply"); + put("销售退货单", "sm_returnapply"); + put("调拨入库单", "tqq9_otherinapply"); + put("采购退货单", "pm_purrefundapplybill"); + put("销售订单", "sm_delivernotice"); + put("其他出库单", "tqq9_otheroutapply"); + put("调拨出库单", "tqq9_otheroutapply"); + put("PTCK", "sm_delivernotice"); + put("CGTH", "pm_purrefundapplybill"); + put("DBCK", "tqq9_otheroutapply"); + put("PKCK", "tqq9_otheroutapply"); + put("TZCK", "tqq9_otheroutapply"); + put("YPCK", "tqq9_otheroutapply"); + put("BSCK", "tqq9_otheroutapply"); + put("GQCK", "tqq9_otheroutapply"); + put("CGRK", "pm_receiptnotice"); + put("DBRK", "tqq9_otherinapply"); + put("THRK", "sm_returnapply"); + put("ZPRK", "tqq9_otherinapply"); + put("PYRK", "tqq9_otherinapply"); + put("TZRK", "tqq9_otherinapply"); + }}; @ApiPostMapping(value = "/WMSPushPurIn", desc = "WMS-入库回传") public CustomApiResult WMS_PurInPush @@ -73,6 +97,7 @@ public class WMSPurInController { resultBean.setType(Constants.TYPE_PUSH); //判断回传类型 + VoucherType=billTypeMap.get(VoucherType); String entityType = ""; switch (VoucherType) { case "pm_receiptnotice": @@ -463,6 +488,7 @@ public class WMSPurInController { JSONObject entryOrder = request.getJSONObject("entryOrder"); String billno = entryOrder.getString("entryOrderCode"); String entryOrderType = entryOrder.getString("entryOrderType"); + entryOrderType=billTypeMap.get(entryOrderType); JSONObject orderLines = request.getJSONObject("orderLines"); WMSXmlReturn wmsXmlReturn = new WMSXmlReturn(); WMSXmlReturn.Response response = new WMSXmlReturn.Response(); diff --git a/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java b/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java index 5a039ab..3d9a86d 100644 --- a/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java +++ b/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java @@ -32,7 +32,30 @@ public class WMSSaleOutCloseController { private static String SM_DELIVERNOTICE = "sm_delivernotice";//发货通知单 private static String SM_RETURNAPPLY = "sm_returnapply";//销售退货申请单 private static String TQQ9_OTHEROUTAPPLY = "tqq9_otheroutapply";//其他出库申请 - + private final static HashMap billTypeMap = new HashMap() {{ + put("采购订单", "pm_receiptnotice"); + put("其他入库单", "tqq9_otherinapply"); + put("销售退货单", "sm_returnapply"); + put("调拨入库单", "tqq9_otherinapply"); + put("采购退货单", "pm_purrefundapplybill"); + put("销售订单", "sm_delivernotice"); + put("其他出库单", "tqq9_otheroutapply"); + put("调拨出库单", "tqq9_otheroutapply"); + put("PTCK", "sm_delivernotice"); + put("CGTH", "pm_purrefundapplybill"); + put("DBCK", "tqq9_otheroutapply"); + put("PKCK", "tqq9_otheroutapply"); + put("TZCK", "tqq9_otheroutapply"); + put("YPCK", "tqq9_otheroutapply"); + put("BSCK", "tqq9_otheroutapply"); + put("GQCK", "tqq9_otheroutapply"); + put("CGRK", "pm_receiptnotice"); + put("DBRK", "tqq9_otherinapply"); + put("THRK", "sm_returnapply"); + put("ZPRK", "tqq9_otherinapply"); + put("PYRK", "tqq9_otherinapply"); + put("TZRK", "tqq9_otherinapply"); + }}; @ApiPostMapping(value = "/WMSSaleOutClose", desc = "WMS-出库关闭") public CustomApiResult WMSSaleOutClose ( @@ -63,6 +86,7 @@ public class WMSSaleOutCloseController { //必填项校验 + VoucherType=billTypeMap.get(VoucherType); if (ApiResultExt.validateRequired(VoucherType, "String")) { errormsg = "传入参数 VoucherType 为空"; resultExt = ApiResultExt.errorRetrun(VoucherType, errormsg, error, resultExt); @@ -214,6 +238,7 @@ public class WMSSaleOutCloseController { JSONObject request = data.getJSONObject("request"); String billno = request.getString("orderCode"); String orderType = request.getString("orderType"); + orderType=billTypeMap.get(orderType); WMSXmlReturn wmsXmlReturn = new WMSXmlReturn(); WMSXmlReturn.Response response = new WMSXmlReturn.Response(); wmsXmlReturn.setResponse(response); diff --git a/lc123/cloud/app/api/controller/WMSSaleOutController.java b/lc123/cloud/app/api/controller/WMSSaleOutController.java index 5527319..e1e3531 100644 --- a/lc123/cloud/app/api/controller/WMSSaleOutController.java +++ b/lc123/cloud/app/api/controller/WMSSaleOutController.java @@ -43,6 +43,31 @@ public class WMSSaleOutController { private static String TQQ9_OTHEROUTAPPLY = "tqq9_otheroutapply";//其他出库申请 private static String IM_OTHEROUTBILL = "im_otheroutbill";//其他出库 + private final static HashMap billTypeMap = new HashMap() {{ + put("采购订单", "pm_receiptnotice"); + put("其他入库单", "tqq9_otherinapply"); + put("销售退货单", "sm_returnapply"); + put("调拨入库单", "tqq9_otherinapply"); + put("采购退货单", "pm_purrefundapplybill"); + put("销售订单", "sm_delivernotice"); + put("其他出库单", "tqq9_otheroutapply"); + put("调拨出库单", "tqq9_otheroutapply"); + put("PTCK", "sm_delivernotice"); + put("CGTH", "pm_purrefundapplybill"); + put("DBCK", "tqq9_otheroutapply"); + put("PKCK", "tqq9_otheroutapply"); + put("TZCK", "tqq9_otheroutapply"); + put("YPCK", "tqq9_otheroutapply"); + put("BSCK", "tqq9_otheroutapply"); + put("GQCK", "tqq9_otheroutapply"); + put("CGRK", "pm_receiptnotice"); + put("DBRK", "tqq9_otherinapply"); + put("THRK", "sm_returnapply"); + put("ZPRK", "tqq9_otherinapply"); + put("PYRK", "tqq9_otherinapply"); + put("TZRK", "tqq9_otherinapply"); + }}; + @ApiPostMapping(value = "/WMS_SaleOutnPush", desc = "WMS-出库回传") public CustomApiResult WMS_SaleOutnPush ( @@ -72,6 +97,7 @@ public class WMSSaleOutController { resultBean.setNumber(billno); resultBean.setType(Constants.TYPE_PUSH); //判断回传类型 + VoucherType=billTypeMap.get(VoucherType); String entityType = ""; switch (VoucherType) { case "sm_delivernotice": @@ -462,6 +488,7 @@ public class WMSSaleOutController { JSONObject deliveryOrder = request.getJSONObject("deliveryOrder"); String billno = deliveryOrder.getString("deliveryOrderCode"); String orderType = deliveryOrder.getString("orderType"); + orderType=billTypeMap.get(orderType); JSONObject orderLines = request.getJSONObject("orderLines"); WMSXmlReturn wmsXmlReturn = new WMSXmlReturn(); WMSXmlReturn.Response response = new WMSXmlReturn.Response(); diff --git a/lc123/cloud/app/plugin/operate/pm/PurOrderBillRebatePlugin.java b/lc123/cloud/app/plugin/operate/pm/PurOrderBillRebatePlugin.java index d8329ec..0bcb249 100644 --- a/lc123/cloud/app/plugin/operate/pm/PurOrderBillRebatePlugin.java +++ b/lc123/cloud/app/plugin/operate/pm/PurOrderBillRebatePlugin.java @@ -41,7 +41,6 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp String operationKey = e.getOperationKey(); if (StringUtils.equals("save",operationKey)) { for (DynamicObject dataEntity : e.getDataEntities()) { - DynamicObject supplier = dataEntity.getDynamicObject("supplier");//供应商 DynamicObject org = dataEntity.getDynamicObject("org");//组织 BigDecimal tqq9_hshfsyje = dataEntity.getBigDecimal("tqq9_hshfsyje");//含税货返使用金额 @@ -49,7 +48,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp if(tqq9_hshfsyje.compareTo(BigDecimal.ZERO)>0){ DynamicObject tqq9_hshfsysl = dataEntity.getDynamicObject("tqq9_hshfsysl");//含税货返使用税率 BigDecimal taxrate = tqq9_hshfsysl.getBigDecimal("taxrate"); - BigDecimal taxamount = tqq9_hshfsyje.multiply(taxrate.divide(new BigDecimal(100)));//税额 + BigDecimal taxamount = tqq9_hshfsyje.multiply(taxrate.divide(new BigDecimal(100).add(taxrate)));//税额 HashMap bodyMap =new HashMap<>(); bodyMap.put("supplierId",supplier.getString("number")); bodyMap.put("companyId",org.getString("number")); @@ -66,11 +65,56 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp }else if(tqq9_hsxfsyje.compareTo(BigDecimal.ZERO)>0){ DynamicObject tqq9_hsxfsysl = dataEntity.getDynamicObject("tqq9_hsxfsysl");//含税现返使用税率 BigDecimal taxrate = tqq9_hsxfsysl.getBigDecimal("taxrate"); - BigDecimal taxamount = tqq9_hsxfsyje.multiply(taxrate.divide(new BigDecimal(100)));//税额 + BigDecimal taxamount = tqq9_hsxfsyje.multiply(taxrate.divide(new BigDecimal(100).add(taxrate)));//税额 + HashMap bodyMap =new HashMap<>(); + bodyMap.put("supplierId",supplier.getString("number")); + bodyMap.put("companyId",org.getString("number")); + bodyMap.put("type",1); + bodyMap.put("money",tqq9_hsxfsyje); + bodyMap.put("taxAmount",taxamount); + Gson gson = new Gson(); + try { + String bodyString = HttpRequestUtils.postJson(URL, bodyMap.toString(), tokenMap); + HashMap map = gson.fromJson(bodyString, HashMap.class); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + + } + + }else if(StringUtils.equals("delete",operationKey)){ + for (DynamicObject dataEntity : e.getDataEntities()) { + DynamicObject supplier = dataEntity.getDynamicObject("supplier");//供应商 + DynamicObject org = dataEntity.getDynamicObject("org");//组织 + BigDecimal tqq9_hshfsyje = dataEntity.getBigDecimal("tqq9_hshfsyje");//含税货返使用金额 + BigDecimal tqq9_hsxfsyje = dataEntity.getBigDecimal("tqq9_hsxfsyje");//含税现返使用金额 + if(tqq9_hshfsyje.compareTo(BigDecimal.ZERO)>0){ + DynamicObject tqq9_hshfsysl = dataEntity.getDynamicObject("tqq9_hshfsysl");//含税货返使用税率 + BigDecimal taxrate = tqq9_hshfsysl.getBigDecimal("taxrate"); + BigDecimal taxamount = tqq9_hshfsyje.multiply(taxrate.divide(new BigDecimal(100).add(taxrate)));//税额 HashMap bodyMap =new HashMap<>(); bodyMap.put("supplierId",supplier.getString("number")); bodyMap.put("companyId",org.getString("number")); bodyMap.put("type",0); + bodyMap.put("money",tqq9_hshfsyje); + bodyMap.put("taxAmount",taxamount); + Gson gson = new Gson(); + try { + String bodyString = HttpRequestUtils.postJson(URL, bodyMap.toString(), tokenMap); + HashMap map = gson.fromJson(bodyString, HashMap.class); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + }else if(tqq9_hsxfsyje.compareTo(BigDecimal.ZERO)>0){ + DynamicObject tqq9_hsxfsysl = dataEntity.getDynamicObject("tqq9_hsxfsysl");//含税现返使用税率 + BigDecimal taxrate = tqq9_hsxfsysl.getBigDecimal("taxrate"); + BigDecimal taxamount = tqq9_hsxfsyje.multiply(taxrate.divide(new BigDecimal(100).add(taxrate)));//税额 + HashMap bodyMap =new HashMap<>(); + bodyMap.put("supplierId",supplier.getString("number")); + bodyMap.put("companyId",org.getString("number")); + bodyMap.put("type",1); bodyMap.put("money",tqq9_hsxfsyje); bodyMap.put("taxAmount",taxamount); Gson gson = new Gson(); diff --git a/lc123/cloud/app/plugin/operate/sys/MaterialAuditOp.java b/lc123/cloud/app/plugin/operate/sys/MaterialAuditOp.java index 155ed07..7561326 100644 --- a/lc123/cloud/app/plugin/operate/sys/MaterialAuditOp.java +++ b/lc123/cloud/app/plugin/operate/sys/MaterialAuditOp.java @@ -1,6 +1,5 @@ package tqq9.lc123.cloud.app.plugin.operate.sys; -import com.grapecity.documents.excel.B; import kd.bos.dataentity.OperateOption; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.entity.operate.result.IOperateInfo; @@ -9,7 +8,7 @@ import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.args.AfterOperationArgs; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; -import kd.fi.cas.helper.OperateServiceHelper; +import kd.bos.servicehelper.operation.OperationServiceHelper; import java.math.BigDecimal; import java.util.List; @@ -87,7 +86,7 @@ public class MaterialAuditOp extends AbstractOperationServicePlugIn { goods.set("tqq9_skutype4", material.getString("tqq9_spfliii")); goods.set("tqq9_isauto", true); goods.set("enable", "1"); - OperationResult operationResult1 = OperateServiceHelper.executeOperate("save", "tqq9_goodspackage", new DynamicObject[]{goods}, OperateOption.create()); + OperationResult operationResult1 = OperationServiceHelper.executeOperate("save", "tqq9_goodspackage", new DynamicObject[]{goods}, OperateOption.create()); if(!operationResult1.isSuccess()){ List allErrorOrValidateInfo = operationResult1.getAllErrorOrValidateInfo(); for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {