From 91d2d4d4e3d4bafdcb295e1cde2865afb596071f Mon Sep 17 00:00:00 2001 From: sez Date: Thu, 11 Dec 2025 16:10:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=85=B3=E9=97=AD=EF=BC=8C?= =?UTF-8?q?=E9=94=80=E5=94=AE=E9=80=80=E8=B4=A7=E7=94=B3=E8=AF=B7=E6=8D=A2?= =?UTF-8?q?=E6=88=90=E9=87=87=E8=B4=AD=E9=80=80=E8=B4=A7=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WMSSaleOutCloseController.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java b/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java index 415e9b6..892da85 100644 --- a/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java +++ b/lc123/cloud/app/api/controller/WMSSaleOutCloseController.java @@ -29,6 +29,9 @@ 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 static String PM_PURREFUNDAPPLYBILL = "pm_purrefundapplybill";//采购退货申请 + private final static HashMap billTypeMap = new HashMap() {{ put("采购订单", "pm_receiptnotice"); put("其他入库单", "tqq9_otherinapply"); @@ -100,7 +103,7 @@ public class WMSSaleOutCloseController { ArrayList VoucherTypes = new ArrayList<>(); VoucherTypes.add(SM_DELIVERNOTICE); - VoucherTypes.add(SM_RETURNAPPLY); + VoucherTypes.add(PM_PURREFUNDAPPLYBILL); VoucherTypes.add(TQQ9_OTHEROUTAPPLY); if (!VoucherTypes.contains(VoucherType)) { errormsg = "传入参数 VoucherType 为无效值"; @@ -155,18 +158,18 @@ public class WMSSaleOutCloseController { } }*/ - //销售退货单 - } else if (StringUtils.equals("sm_returnapply", VoucherType)) { + //采购退货申请 + } else if (StringUtils.equals("pm_purrefundapplybill", VoucherType)) { //查询单据在金蝶系统中是否存在 - DynamicObject sm_returnapply = BusinessDataServiceHelper.loadSingle(SM_RETURNAPPLY, new QFilter[]{new QFilter("billno", QCP.equals, billno)}); - if (sm_returnapply == null) { - errormsg = "根据传入编号:" + billno + "未找到对应销售退货单"; + DynamicObject pm_purrefundapplybill = BusinessDataServiceHelper.loadSingle(PM_PURREFUNDAPPLYBILL, new QFilter[]{new QFilter("billno", QCP.equals, billno)}); + if (pm_purrefundapplybill == null) { + errormsg = "根据传入编号:" + billno + "未找到对应采购退货申请"; resultExt = ApiResultExt.errorRetrun(VoucherType, errormsg, error, resultExt); return CustomApiResult.success(resultExt); } - resultBean.setId(sm_returnapply.getString("id")); + resultBean.setId(pm_purrefundapplybill.getString("id")); resultBean.setBillStatus(true); - if (!StringUtils.equals("C", sm_returnapply.getString("billstatus"))) { + if (!StringUtils.equals("C", pm_purrefundapplybill.getString("billstatus"))) { errormsg = "编号:" + billno + "的单据状态非审核,无法关闭"; resultExt = ApiResultExt.errorRetrun(VoucherType, errormsg, error, resultExt); return CustomApiResult.success(resultExt); @@ -178,9 +181,9 @@ public class WMSSaleOutCloseController { }*/ //开始关闭 - String message = cloneOperation(sm_returnapply, "销售退货单", "sm_salorder"); + String message = cloneOperation(pm_purrefundapplybill, "采购退货申请", "pm_purorderbill"); if (message.length() > 0) { - HashMap returnMap = resultExt.addOneErrorToResultBeanByNumber(results, message, SM_RETURNAPPLY); + HashMap returnMap = resultExt.addOneErrorToResultBeanByNumber(results, message, PM_PURREFUNDAPPLYBILL); results = (List) returnMap.get("ResultBeanList"); failCount = 1; successCount = 0; @@ -266,7 +269,7 @@ public class WMSSaleOutCloseController { StringBuilder errormsg = new StringBuilder(); ArrayList entryOrderTypes = new ArrayList<>(); entryOrderTypes.add(SM_DELIVERNOTICE); - entryOrderTypes.add(SM_RETURNAPPLY); + entryOrderTypes.add(PM_PURREFUNDAPPLYBILL); entryOrderTypes.add(TQQ9_OTHEROUTAPPLY); if (!entryOrderTypes.contains(orderType)) { errormsg = errormsg.append(";").append("传入参数 orderType 为无效值"); @@ -336,18 +339,18 @@ public class WMSSaleOutCloseController { response.setFlag("failure"); return CustomApiResult.success(wmsXmlReturn); }*/ - //销售退货单 - } else if (StringUtils.equals("sm_returnapply", orderType)) { + //采购退货申请 + } else if (StringUtils.equals("pm_purrefundapplybill", orderType)) { //查询单据在金蝶系统中是否存在 - DynamicObject sm_returnapply = BusinessDataServiceHelper.loadSingle(SM_RETURNAPPLY, new QFilter[]{new QFilter("billno", QCP.equals, billno)}); - if (sm_returnapply == null) { - errormsg = errormsg.append(";").append("根据传入编号:" + billno + "未找到对应销售退货单"); + DynamicObject pm_purrefundapplybill = BusinessDataServiceHelper.loadSingle(PM_PURREFUNDAPPLYBILL, new QFilter[]{new QFilter("billno", QCP.equals, billno)}); + if (pm_purrefundapplybill == null) { + errormsg = errormsg.append(";").append("根据传入编号:" + billno + "未找到对应采购退货申请"); response.setMessage(errormsg.substring(1)); response.setCode("-1"); response.setFlag("failure"); return CustomApiResult.success(wmsXmlReturn); } - if (!StringUtils.equals("C", sm_returnapply.getString("billstatus"))) { + if (!StringUtils.equals("C", pm_purrefundapplybill.getString("billstatus"))) { errormsg = errormsg.append(";").append("编号:" + billno + "的单据状态非审核,无法关闭"); response.setMessage(errormsg.substring(1)); response.setCode("-1"); @@ -362,7 +365,7 @@ public class WMSSaleOutCloseController { return CustomApiResult.success(wmsXmlReturn); }*/ //开始关闭 - String message = cloneOperation(sm_returnapply, "销售退货单", "sm_salorder"); + String message = cloneOperation(pm_purrefundapplybill, "采购退货申请", "pm_purorderbill"); if (message.length() > 0) { errormsg.append(message); response.setMessage(errormsg.substring(1));