diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java index dd41ea63..40699b08 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java @@ -130,7 +130,7 @@ public class WmsProductPutController extends BaseController { List rlist = wmsProductPutService.getReportList(mesReportWork); return rlist; } - +//sap收货 @PostMapping("/addReportListSap") public AjaxResult addReportListSap(@RequestBody List mesReportWork) throws ParseException { String rlist = wmsProductPutService.addReportListSap(mesReportWork); diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java index 2c2fdc0f..77ffba98 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java @@ -342,6 +342,14 @@ public class WmsToWCSmissionController { return AjaxResult.success(wmsProductPutService.selectFinishedProductSales(wmsSellOutEmbryo)); } + /** + * 成品销售退货--提单查询接口 + * + */ + @PostMapping("/finishedProductSalesReturnTD") + public AjaxResult finishedProductSalesReturnTD(@RequestBody WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { + return AjaxResult.success(wmsProductPutService.finishedProductSalesReturnTD(wmsRuturnPutEmbryo)); + } /** * 成品销售出库--确认接口 diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java index 2cf511ed..f9954c3a 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java @@ -128,4 +128,6 @@ public interface IWmsProductPutService { String palletTransferConfirmation(WmsFpStorageNewsSn wmsFpStorageNewsSn); List selectWmsRuturnPutEmbryoList(WmsRuturnPutEmbryo wmsRuturnPutEmbryo); + + String finishedProductSalesReturnTD(WmsRuturnPutEmbryo wmsRuturnPutEmbryo); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java index a982fff0..8b52e18a 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java @@ -286,7 +286,14 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { map.put("LGORT", wmsProductPut3.getWhCode()); map.put("QUANTITY", wmsProductPut3.getPutQuantity()); map.put("ERFME", wmsProductPut3.getUnitOfMeasure()); - map.put("BATCH", wmsProductPut3.getBatchNumber()); + //map.put("BATCH", wmsProductPut3.getBatchNumber()); + if (wmsProductPut3.getBatchNumber().length()>12){ + //String batch = mesReportWork.getBatch().substring(12); + String batch = InterceptionRules(wmsProductPut3.getBatchNumber()); + map.put("BATCH", batch); + }else { + map.put("BATCH", wmsProductPut3.getBatchNumber()); + } map.put("HSDAT", wmsProductPut3.getProductDate()); mapList.add(map); } @@ -1139,6 +1146,67 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { return wmsRuturnPutEmbryoMapper.selectWmsRuturnPutEmbryoList(wmsRuturnPutEmbryo); } + @Override + public String finishedProductSalesReturnTD(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { + String results="提单成功";//退货单 + DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode()); + Map objectMap=new HashMap<>(); + objectMap.put("S_MATNR",wmsRuturnPutEmbryo.getProductCode());//物料号, + objectMap.put("S_TDDAT",wmsRuturnPutEmbryo.getAttr1());//String 计划运输日期 + objectMap.put("S_VBELN",wmsRuturnPutEmbryo.getProductOrder());//成品销售退货单 + objectMap.put("S_AUART","ZRE");//销售退货凭证 + R result = remoteSapService.FPinventory(objectMap); + int code = result.getCode(); + String msg = result.getMsg(); + if(code==200){ + List> mapList= (List>) result.getData(); + for ( Map stringStringMap: mapList){ + String MAKTX=stringStringMap.get("MAKTX");//物料描述 + String MATNR=stringStringMap.get("MATNR");//物料号 + String KUNNR=stringStringMap.get("KUNNR");//送达方 + String VBELN=stringStringMap.get("VBELN");//交货单---一销售单对多交货单 + String VBELN_VA=stringStringMap.get("VBELN_VA");//销售单 + String MENGE=stringStringMap.get("MENGE");//数量 + String MEINS=stringStringMap.get("MEINS");//单位 + String TDDAT=stringStringMap.get("TDDAT");//计划日期 + String KUNNR_NM=stringStringMap.get("KUNNR_NM");//送达方描述 + String LIFNR=stringStringMap.get("LIFNR");//货运代理 + String LIFNR_NM=stringStringMap.get("LIFNR_NM");//货运代理描述 + String ZSAREA=stringStringMap.get("ZSAREA");//销售大区 + String BZTXT1=stringStringMap.get("BZTXT1");//销售大区描述 + WmsSellOutEmbryo wmsSellOutEmbryo1=new WmsSellOutEmbryo(); + wmsSellOutEmbryo1.setId(IdUtils.fastSimpleUUID()); + wmsSellOutEmbryo1.setDeliveryOrder(VBELN);//交货单号 + wmsSellOutEmbryo1.setAttr1(VBELN_VA); + wmsSellOutEmbryo1.setProductCode(MATNR); + wmsSellOutEmbryo1.setProductName(MAKTX); + wmsSellOutEmbryo1.setFactoryCode(wmsRuturnPutEmbryo.getFactoryCode()); + wmsSellOutEmbryo1.setOutQuantity(new BigDecimal("0")); + wmsSellOutEmbryo1.setAttr2(KUNNR); + wmsSellOutEmbryo1.setAttr3(KUNNR_NM); + wmsSellOutEmbryo1.setAttr4(LIFNR); + wmsSellOutEmbryo1.setAttr5(LIFNR_NM); + wmsSellOutEmbryo1.setAttr6(ZSAREA); + wmsSellOutEmbryo1.setAttr7(BZTXT1); + wmsSellOutEmbryo1.setAttr8(TDDAT); + wmsSellOutEmbryo1.setPlanQuantity(new BigDecimal(MENGE)); + wmsSellOutEmbryo1.setUnitOfMeasure(MEINS); + wmsSellOutEmbryo1.setStatus("0"); + wmsSellOutEmbryo1.setSapStatus("0"); + wmsSellOutEmbryo1.setActiveFlag("1"); + wmsSellOutEmbryo1.setCreateBy(wmsRuturnPutEmbryo.getCreateBy()); + wmsSellOutEmbryo1.setCreateTime(new Date()); + //判断有没有这个单子,。如果有的话,就跳过吧 + WmsSellOutEmbryo wmsSellOutEmbryo2= wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(VBELN,MATNR); +// if (wmsSellOutEmbryo2==null){ +// wmsSellOutEmbryoMapper.insertWmsSellOutEmbryo(wmsSellOutEmbryo1); +// }else { +// results="已经存在"; +// } + } + } + return results; + } //去除空格,截取规则,例子:20270106LJ20240107CBCD0J——》240107CBCD