diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOutOrderController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOutOrderController.java index 57fd6a91..922636a6 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOutOrderController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOutOrderController.java @@ -137,6 +137,17 @@ public class OdsProcureOutOrderController extends BaseController { List list = odsProcureOutOrderService.selectOdsProcureReturnOrderListZC(odsProcureOutOrder); return getDataTable(list); } + + + /** + * 删除退料单 + */ + + @PostMapping("/removeReturn") + public AjaxResult removeReturn(@RequestBody ListIDs) { + return toAjax(odsProcureOutOrderService.removeReturn(IDs)); + } + @PostMapping("/addreturnderZC") public AjaxResult addreturnderZC(@RequestBody List orderList) { String result = odsProcureOutOrderService.addreturnderZC(orderList); diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java index 2fc6b4f2..99e512c6 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java @@ -179,4 +179,8 @@ public interface OdsProcureOutOrderMapper { void updateWMSOdsProcureOutOrdersapSpecialById(OdsProcureOutOrder order1); void updateWMSOdsProcureOutOrdersapSpecialTWById(OdsProcureOutOrder order1); + + String getWmsOdsProcureOutOrder(OdsProcureOutOrder order); + + int removeReturn(String[] IDs); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOutOrderService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOutOrderService.java index 6e4338c8..ef1f5556 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOutOrderService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOutOrderService.java @@ -88,4 +88,6 @@ public interface IOdsProcureOutOrderService { String addwmsFpStorageNewsTS(List orderList); List selectOdsProcureOutOrderListZCTC(OdsProcureOutOrder odsProcureOutOrder); + + public int removeReturn(List iDs); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java index 613948af..e338f2bb 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java @@ -2879,7 +2879,10 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { order.setCreateBy(createBy); order.setCreateDate(new Date()); order.setSiteCode(factoryCode); - odsProcureOutOrderMapper.insertWmsRawMissionOut(order); + +// odsProcureOutOrderMapper.insertWmsRawMissionOut(order); + + BigDecimal returnNumber= order1.getReturnNumber(); order1.setReturnNumber(returnNumber.add(amount));// if(order1.getPlanNumber().compareTo(order1.getReturnNumber())<=0){ @@ -2891,6 +2894,31 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { OdsProcureOrder order2 =new OdsProcureOrder(); order2.setUserDefined6(userDefined6); odsProcureOrderMapper.updateodsProcureOrderCard(order2); + + WmsRawOrderInSn wmsRawOrderInSn = new WmsRawOrderInSn(); + wmsRawOrderInSn.setRawOrderInSnId(IdUtils.fastSimpleUUID()); + wmsRawOrderInSn.setUserDefined1("2");//1是收货,2是入库 + wmsRawOrderInSn.setUserDefined2(order.getUserDefined7());//批次 + wmsRawOrderInSn.setWhCode(odsProcureOutOrder.getWhCode());//厂库编号 + wmsRawOrderInSn.setWaCode(odsProcureOutOrder.getWaCode()); + wmsRawOrderInSn.setWlCode(odsProcureOutOrder.getSn());//库位设置为托盘 + wmsRawOrderInSn.setPoNo(produceCode);//采购单号 + // wmsRawOrderInSn.setPoLine(odsProcureOrder.getPoLine());//行项目 + wmsRawOrderInSn.setMaterialCode(odsProcureOutOrder.getMaterialCode()); + wmsRawOrderInSn.setMaterialDesc(odsProcureOutOrder.getMaterialDesc()); + wmsRawOrderInSn.setAmount(odsProcureOutOrder.getPlanNumber());//实际输入数量 + wmsRawOrderInSn.setFactoryCode(factoryCode); + wmsRawOrderInSn.setCreateBy(odsProcureOutOrder.getCreateBy()); + wmsRawOrderInSn.setGmtCreate(new Date()); + wmsRawOrderInSn.setActiveFlag("1"); + wmsRawOrderInSn.setUserDefined4(order.getUnit());//单位 + wmsRawOrderInSn.setSn(odsProcureOutOrder.getSn());//托盘号 + wmsRawOrderInSn.setFactoryCode(factoryCode); + // wmsRawOrderInSn.setUserDefined3(order.getID()); + wmsRawOrderInSn.setUserDefined5(produceCode); + wmsRawOrderInSn.setUserDefined6(odsProcureOutOrder.getSn());//标识码绑定 + wmsRawOrderInSnMapper.insertWmsRawOrderInSn(wmsRawOrderInSn); + //库存 //收货 WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn = new WmsOdsMateStorageNewsSn(); diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOutOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOutOrderServiceImpl.java index 1dd22b55..482b8fd1 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOutOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOutOrderServiceImpl.java @@ -174,6 +174,11 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService @DS("#header.poolName") public List selectOdsProcureReturnOrderListZC(OdsProcureOutOrder odsProcureOutOrder) { List orderList = odsProcureOutOrderMapper.selectOdsProcureReturnOrderListZC(odsProcureOutOrder); + for (OdsProcureOutOrder order: + orderList ) {//wms_ods_procure_out_order + String NeedDate= odsProcureOutOrderMapper.getWmsOdsProcureOutOrder(order); + order.setNeedDate(NeedDate); + } return orderList; } @@ -450,6 +455,7 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService } @Override + @DS("#header.poolName") public List selectOdsProcureOutOrderListZCTC(OdsProcureOutOrder odsProcureOutOrder) { odsProcureOutOrder.setUserDefined3("X"); List orderList = odsProcureOutOrderMapper.selectOdsProcureOutOrderListZCTW(odsProcureOutOrder); @@ -467,6 +473,15 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService return orderList; } + @Override + @DS("#header.poolName") + public int removeReturn(List stringList) { + // 将列表转换为字符串数组 + String[] iDs = stringList.toArray(new String[0]); + + return odsProcureOutOrderMapper.removeReturn(iDs); + } + public void OutboundPostingzcSAPGYTS(List orderList) { //先根据出库单获取 // -- and wms_ods_procure_out_order.Order_Status='3' diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml index 88ec3b31..19c69276 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml @@ -1477,7 +1477,7 @@ and Enterprise_Code = #{enterpriseCode} and ID = #{ID} - ORDER BY User_Defined4 DESC + ORDER BY Produce_Code DESC + + + delete from wms_ods_procure_return_order where ID in + + #{ID} + +