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 77ffba98..b0742daf 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,14 +342,7 @@ public class WmsToWCSmissionController { return AjaxResult.success(wmsProductPutService.selectFinishedProductSales(wmsSellOutEmbryo)); } - /** - * 成品销售退货--提单查询接口 - * - */ - @PostMapping("/finishedProductSalesReturnTD") - public AjaxResult finishedProductSalesReturnTD(@RequestBody WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { - return AjaxResult.success(wmsProductPutService.finishedProductSalesReturnTD(wmsRuturnPutEmbryo)); - } + /** * 成品销售出库--确认接口 @@ -377,7 +370,14 @@ public class WmsToWCSmissionController { return AjaxResult.success(wmsProductPutService.ScanCodeSingleBox(wmsProductPutTrayCode)); } - + /** + * 成品销售退货--提单查询接口 + * + */ + @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/impl/WmsProductPutServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java index 8b52e18a..eb365e37 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 @@ -908,7 +908,67 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { List wmsSellOutEmbryoList= wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoList(wmsSellOutEmbryo); return wmsSellOutEmbryoList; } - + @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= wmsRuturnPutEmbryoMapper.selectWmsRuturnPutEmbryo(VBELN,MATNR); +// if (wmsSellOutEmbryo2==null){ +// wmsSellOutEmbryoMapper.insertWmsSellOutEmbryo(wmsSellOutEmbryo1); +// }else { +// results="已经存在"; +// } + } + } + return results; + } @Override public List FinishedProductSalesReturn(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode()); @@ -1146,67 +1206,7 @@ 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