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 fff8eab1..6d018c52 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 @@ -339,6 +339,14 @@ public class WmsToWCSmissionController { } + /** + * 成品调拨出库--确认接口 + * + */ + @PostMapping("/confirmFinishedProductTransferAndOutbound") + public AjaxResult confirmFinishedProductTransferAndOutbound(@RequestBody WmsAllocationOutEmbryo wmsRuturnPutEmbryo) { + return AjaxResult.success(wmsProductPutService.confirmFinishedProductTransferAndOutbound(wmsRuturnPutEmbryo)); + } /** diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java index c5d6c78b..e65557d9 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java @@ -79,4 +79,8 @@ public interface WmsSellOutEmbryoMapper { public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(@Param("deliveryOrder") String deliveryOrder, @Param("productCode") String productCode); List selectWmsAllocationOutEmbryoList(WmsAllocationOutEmbryo wmsAllocationOutEmbryo); + + WmsAllocationOutEmbryo selectWmsAllocationOutEmbryoById(String id); + + void updateWmsAllocationOutEmbryo(WmsAllocationOutEmbryo wmsAllocationOutEmbryo); } 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 dea2995d..d9161afc 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 @@ -120,4 +120,6 @@ public interface IWmsProductPutService { List selectFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo); + + String confirmFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo 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 102b4112..a217521e 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 @@ -830,7 +830,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsProductPutRecords.setProductName(wmsRuturnPutEmbryo.getProductName()); wmsProductPutRecords.setProductCode(wmsRuturnPutEmbryo.getProductCode()); wmsProductPutRecords.setWhCode(wmsRuturnPutEmbryo.getWhCode());//仓库编码 - + wmsProductPutRecords.setFactoryCode(wmsRuturnPutEmbryo.getFactoryCode()); wmsProductPutRecords.setWlCode(wmsProductPut1.getWlCode());//库位编码 wmsProductPutRecords.setAttr1(wmsProductPut1.getSn());////托盘号编码 wmsProductPutRecords.setAttr2(wmsProductPut1.getNumber());//箱数 @@ -890,4 +890,59 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { List wmsAllocationOutEmbryoList= wmsSellOutEmbryoMapper.selectWmsAllocationOutEmbryoList(wmsAllocationOutEmbryo); return wmsAllocationOutEmbryoList; } + + @Override + public String confirmFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo) { + String result1="出库成功"; + DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode()); + List wmsProductPutTrayCodeList= wmsRuturnPutEmbryo.getWmsProductPutTrayCodeList(); + //成品销售出库--确认接口---修改出库单,--出库库存 + WmsAllocationOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsAllocationOutEmbryoById(wmsRuturnPutEmbryo.getId()); + Integer tem= wmsProductPutTrayCodeList.size(); + BigDecimal OutQuantity= wmsSellOutEmbryo1.getOutQuantity().add(new BigDecimal(tem));//2 + int result = wmsSellOutEmbryo1.getPlanQuantity().compareTo(OutQuantity); + WmsAllocationOutEmbryo wmsAllocationOutEmbryo=new WmsAllocationOutEmbryo(); + if (result == 0){//出库完 + wmsAllocationOutEmbryo.setStatus("1"); + }else { + wmsAllocationOutEmbryo.setStatus("0"); + } + wmsAllocationOutEmbryo.setId(wmsRuturnPutEmbryo.getId()); + wmsAllocationOutEmbryo.setOutQuantity(OutQuantity); + wmsSellOutEmbryoMapper.updateWmsAllocationOutEmbryo(wmsAllocationOutEmbryo); + //订单修改完成 + for(WmsProductPutTrayCode wmsProductPutTrayCode: wmsProductPutTrayCodeList){ + //库存修改 + //解除绑定 + wmsProductPutTrayCode.setRelatStatus("0"); + wmsProductPutTrayCodeMapper.updateWmsProductPutTrayCode(wmsProductPutTrayCode); + //改明细 + WmsFpStorageNewsSn wmsFpStorageNewsSn=new WmsFpStorageNewsSn(); + wmsFpStorageNewsSn.setSn(wmsProductPutTrayCode.getSn()); + wmsFpStorageNewsSn.setWlCode(wmsProductPutTrayCode.getWlCode()); + wmsFpStorageNewsSn.setActiveFlag("1"); + wmsFpStorageNewsSn.setProductCode(wmsSellOutEmbryo1.getProductCode()); + wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSnOut(wmsFpStorageNewsSn); + //判断如果托盘数据被出完,就关闭这个明细 + List wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn); + if (wmsFpStorageNewsSns.size()>0){ + WmsFpStorageNewsSn wmsFpStorageNewsSn1= wmsFpStorageNewsSns.get(0); + + BigDecimal ken= new BigDecimal(wmsFpStorageNewsSn1.getUserDefined2()); + int comparisonResult = ken.compareTo(wmsFpStorageNewsSn1.getAmount()); + if (comparisonResult == 0) { + // ken和amount相等 + wmsFpStorageNewsSn1.setActiveFlag("0"); + wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSn(wmsFpStorageNewsSn1); + } + } + //改主表 + WmsFpStorageNews wmsFpStorageNews=new WmsFpStorageNews(); + wmsFpStorageNews.setActiveFlag("1"); + wmsFpStorageNews.setWlCode(wmsProductPutTrayCode.getWlCode()); + wmsFpStorageNews.setProductCode(wmsSellOutEmbryo1.getProductCode()); + wmsFpStorageNewsMapper.updateWmsFpStorageNewsOut(wmsFpStorageNews); + } + return result1; + } } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml index 563a3eb6..93c536f8 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml @@ -160,14 +160,14 @@ product_name, product_code, product_sort, - specification, + specification, unit_of_measure, plan_quantity, put_quantity, status, - SAP_status, - SAP_proof, - SAP_message, + SAP_status, + SAP_proof, + SAP_message, put_date, attr1, attr2, @@ -195,14 +195,14 @@ #{productName}, #{productCode}, #{productSort}, - #{specification}, + #{speciFication}, #{unitOfMeasure}, #{planQuantity}, #{putQuantity}, #{status}, - #{SAPStatus}, - #{SAPProof}, - #{SAPMessage}, + #{sapStatus}, + #{sapProof}, + #{sapMessage}, #{putDate}, #{attr1}, #{attr2}, diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml index bbf16715..a63ba04c 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml @@ -281,7 +281,7 @@ #{id} - SELECT id, delivery_order, @@ -358,4 +358,91 @@ and attr10 = #{attr10} + + + update wms_allocation_out_embryo + + delivery_order = #{deliveryOrder}, + Item_number = #{itemNumber}, + factory_code = #{factoryCode}, + wh_code = #{whCode}, + wa_code = #{waCode}, + wl_code = #{wlCode}, + delivery_place = #{deliveryPlace}, + product_name = #{productName}, + product_code = #{productCode}, + product_sort = #{productSort}, + specification = #{specification}, + unit_of_measure = #{unitOfMeasure}, + lot_number = #{lotNumber}, + plan_quantity = #{planQuantity}, + out_quantity = #{outQuantity}, + status = #{status}, + SAP_status = #{sapStatus}, + SAP_proof = #{sapProof}, + SAP_message = #{sapMessage}, + out_date = #{outDate}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + attr5 = #{attr5}, + attr6 = #{attr6}, + attr7 = #{attr7}, + attr8 = #{attr8}, + attr9 = #{attr9}, + attr10 = #{attr10}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + +