From 1dc84aeb7698f37a86047c8ffbb0bf8f516b47ce Mon Sep 17 00:00:00 2001 From: 18110972313 <780768673@qq.com> Date: Thu, 24 Apr 2025 15:59:13 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=BE=85=E6=96=99=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=EF=BC=8C=E8=BF=81=E7=A7=BB=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=A4=87=E8=B4=A7=E3=80=81=E5=8F=96=E6=B6=88=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=A4=87=E8=B4=A7=E3=80=81=E5=87=BA=E5=BA=93=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cim/idm/controller/SaleOutController.java | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/zi-wms-pda/src/main/java/com/cim/idm/controller/SaleOutController.java b/zi-wms-pda/src/main/java/com/cim/idm/controller/SaleOutController.java index 3e4add3..838b0a7 100644 --- a/zi-wms-pda/src/main/java/com/cim/idm/controller/SaleOutController.java +++ b/zi-wms-pda/src/main/java/com/cim/idm/controller/SaleOutController.java @@ -1,15 +1,19 @@ package com.cim.idm.controller; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cim.idm.framework.IDMFrameServiceProxy; +import com.cim.idm.framework.data.EventInfo; import com.cim.idm.model.MaterialPacking; import com.cim.idm.model.MaterialshipRequest; import com.cim.idm.model.SalePreOrderDto; import com.cim.idm.model.StockOutDto; +import com.cim.idm.service.IMaterialShipService; import com.cim.idm.service.Impl.InvoiceServiceImpl; import com.cim.idm.service.Impl.SaleOutServiceImpl; import com.cim.idm.utils.AjaxResult; +import com.cim.idm.utils.EventInfoUtil; import com.cim.idm.wmsextend.generic.errorHandler.CustomException; import com.cim.idm.wmspackage.materialpacking.MaterialPackingServiceProxy; import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingKey; @@ -36,6 +40,9 @@ public class SaleOutController { @Autowired private SaleOutServiceImpl SaleOut; + + @Autowired + private IMaterialShipService materialShipService; @RequestMapping(value = "/getBhCondition", method = RequestMethod.POST) public AjaxResult getBhCondition(@RequestBody JSONObject in ){ @@ -972,4 +979,86 @@ public class SaleOutController { IDMFrameServiceProxy.getSqlTemplate().update(dhSql, bindMap); return AjaxResult.me().setSuccess(true).setMessage("更新备货成功"); } + + /** + * 确认备货 + * @param in + * @return + * @throws Exception + */ + @RequestMapping(value = "/auxiliaryAssign", method = RequestMethod.POST) + public AjaxResult AuxiliaryAssign(@RequestBody JSONObject in ) throws Exception{ + String siteName = (String)in.get("SITENAME"); + String user = (String)in.get("USER"); + String shipRequestName = (String)in.get("SHIPREQUESTNAME"); + JSONArray boxListArray = in.getJSONArray("BOXLIST"); + List> boxList = new ArrayList>(); + if(null == boxListArray || boxListArray.size() <= 0) { + return AjaxResult.me().setSuccess(true).setMessage("未获取到:" + shipRequestName + "的发货单据信息").setErrorCode(400); + } + // 遍历 JSONArray 并转换为 LinkedHashMap + for (int i = 0; i < boxListArray.size(); i++) { + JSONObject jsonObject = boxListArray.getJSONObject(i); + LinkedHashMap linkedHashMap = new LinkedHashMap<>(); + // 将每个字段添加到 LinkedHashMap 中 + for (String key : jsonObject.keySet()) { + linkedHashMap.put(key, jsonObject.getString(key)); + } + // 添加到列表中 + boxList.add(linkedHashMap); + } + EventInfo eventInfo = new EventInfoUtil().makeEventInfo("auxiliaryAssign", user, "auxiliaryAssign", "", ""); + return materialShipService.MaterialShipRequestAuxiliaryConfirmStocking(eventInfo,siteName,shipRequestName,user,boxList); + } + + /** + * 辅材出库 + * @param in + * @return + * @throws Exception + */ + @RequestMapping(value = "/auxiliaryStockOut", method = RequestMethod.POST) + public AjaxResult AuxiliaryStockOut(@RequestBody JSONObject in ) throws Exception{ + String siteName = (String)in.get("SITENAME"); + String user = (String)in.get("USER"); + String shipRequestName = (String)in.get("SHIPREQUESTNAME"); + String commitDate = (String)in.get("commitDate"); + JSONArray boxListArray = in.getJSONArray("BOXLIST"); + List> boxList = new ArrayList>(); + if(null == boxListArray || boxListArray.size() <= 0) { + return AjaxResult.me().setSuccess(true).setMessage("未获取到:" + shipRequestName + "的发货单据信息").setErrorCode(400); + } + // 遍历 JSONArray 并转换为 LinkedHashMap + for (int i = 0; i < boxListArray.size(); i++) { + JSONObject jsonObject = boxListArray.getJSONObject(i); + LinkedHashMap linkedHashMap = new LinkedHashMap<>(); + // 将每个字段添加到 LinkedHashMap 中 + for (String key : jsonObject.keySet()) { + linkedHashMap.put(key, jsonObject.getString(key)); + } + // 添加到列表中 + boxList.add(linkedHashMap); + } + + EventInfo eventInfo = new EventInfoUtil().makeEventInfo("auxiliaryStockOut", user, "auxiliaryStockOut", "", ""); + return materialShipService.MaterialShipRequestAuxiliaryStockOut(eventInfo,siteName,shipRequestName,user,boxList,commitDate); + } + + /** + * 取消确认备货 + * @param in + * @return + * @throws Exception + */ + @RequestMapping(value = "/auxiliaryDessign", method = RequestMethod.POST) + public AjaxResult AuxiliaryDessign(@RequestBody JSONObject in ) throws Exception{ + String siteName = (String)in.get("SITENAME"); + String user = (String)in.get("USER"); + String shipRequestName = (String)in.get("SHIPREQUESTNAME"); + if(StringUtils.isEmpty(shipRequestName)) { + return AjaxResult.me().setSuccess(true).setMessage("单号不能为空").setErrorCode(400); + } + EventInfo eventInfo = new EventInfoUtil().makeEventInfo("auxiliaryDessign", user, "auxiliaryDessign", "", ""); + return materialShipService.MaterialShipRequestAuxiliaryCancelConfirmStocking(eventInfo,siteName,shipRequestName,user); + } }