From 25523a8c17bb74100b7b53ca8ab283b1425ba5b2 Mon Sep 17 00:00:00 2001 From: shenzhouyu Date: Sun, 30 Nov 2025 22:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerIssueController.java | 4 ++-- .../customer/service/CustomerIssueService.java | 2 +- .../service/impl/CustomerIssueServiceImpl.java | 16 ++++++++++++---- .../service/impl/ProductionIssueServiceImpl.java | 4 ++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gaotao/modules/customer/controller/CustomerIssueController.java b/src/main/java/com/gaotao/modules/customer/controller/CustomerIssueController.java index 70c070a..c171f4d 100644 --- a/src/main/java/com/gaotao/modules/customer/controller/CustomerIssueController.java +++ b/src/main/java/com/gaotao/modules/customer/controller/CustomerIssueController.java @@ -93,8 +93,8 @@ public class CustomerIssueController { @PostMapping("/customerIssueConfirm") @ResponseBody public R customerIssueConfirm(@RequestBody CustomerIssueDto dto) throws Exception { - customerIssueService.customerIssueConfirm(dto); - return R.ok(); + List ids = customerIssueService.customerIssueConfirm(dto); + return R.ok().put("unitIds",ids); } /** diff --git a/src/main/java/com/gaotao/modules/customer/service/CustomerIssueService.java b/src/main/java/com/gaotao/modules/customer/service/CustomerIssueService.java index ad561af..815a07a 100644 --- a/src/main/java/com/gaotao/modules/customer/service/CustomerIssueService.java +++ b/src/main/java/com/gaotao/modules/customer/service/CustomerIssueService.java @@ -35,7 +35,7 @@ public interface CustomerIssueService { /** * 客户发料确认 */ - void customerIssueConfirm(CustomerIssueDto dto)throws Exception ; + List customerIssueConfirm(CustomerIssueDto dto)throws Exception ; /** * 获取库存物料信息 diff --git a/src/main/java/com/gaotao/modules/customer/service/impl/CustomerIssueServiceImpl.java b/src/main/java/com/gaotao/modules/customer/service/impl/CustomerIssueServiceImpl.java index 2e22830..213719f 100644 --- a/src/main/java/com/gaotao/modules/customer/service/impl/CustomerIssueServiceImpl.java +++ b/src/main/java/com/gaotao/modules/customer/service/impl/CustomerIssueServiceImpl.java @@ -129,7 +129,7 @@ public class CustomerIssueServiceImpl implements CustomerIssueService { @Override @Transactional - public void customerIssueConfirm(CustomerIssueDto customerIssueDto) throws Exception { + public List customerIssueConfirm(CustomerIssueDto customerIssueDto) throws Exception { // 验证工单状态 if(customerIssueDto.getSelectedMaterials() != null && customerIssueDto.getSelectedMaterials().size()>0){ boolean b = validateHandingUnitQty(customerIssueDto.getSelectedMaterials()); @@ -166,7 +166,7 @@ public class CustomerIssueServiceImpl implements CustomerIssueService { subList.add(subDto); } - changeAndAddHandlingUnit(customerIssueDto); + List ids = changeAndAddHandlingUnit(customerIssueDto); transCommonRequestDto.setSubList(subList); List out = transHeaderService.genTransAndChangeInventoryStock(transCommonRequestDto, "OUT"); @@ -202,6 +202,8 @@ public class CustomerIssueServiceImpl implements CustomerIssueService { } if(BigDecimal.ZERO.compareTo(hu.getQty()) !=0){ hu.setInStockFlag("Y"); + }else{ + hu.setInStockFlag("N"); } handlingUnits.add(hu); if (material.getIssueQty() != null) { @@ -211,13 +213,15 @@ public class CustomerIssueServiceImpl implements CustomerIssueService { productionIssueMapper.updateHandingUnit(handlingUnits); //返回出库中间表 customerIssueMapper.updateCustomerStatus(customerIssueDto.getWorkOrderNo(),customerIssueDto.getSite()); - + //调用ifs接口 ShipmentCreateDto createDto = new ShipmentCreateDto(); createDto.setIfsSiteID(customerIssueDto.getSite()); createDto.setIfsShipmentID(customerIssueDto.getWorkOrderNo()); createDto.setIfsShipmentType(customerIssueDto.getShipmentType()); createDto.setIfsLocationNo(customerIssueDto.getLocationNo()); ifsApiIssueAndReturnService.addShipmentCreatePickList(createDto); + + return ids; } @Override @@ -470,7 +474,8 @@ public class CustomerIssueServiceImpl implements CustomerIssueService { } @Transactional - public void changeAndAddHandlingUnit(CustomerIssueDto customerIssueDto){ + public List changeAndAddHandlingUnit(CustomerIssueDto customerIssueDto){ + List ids = new ArrayList<>(); for(WorkOrderMaterialDto material : customerIssueDto.getSelectedMaterials()){ // 修改现有处理单元的数量 HandlingUnit handlingUnit = customerIssueMapper.selectHandlingUtil(customerIssueDto.getSite(), material.getLabelCode()); @@ -554,8 +559,11 @@ public class CustomerIssueServiceImpl implements CustomerIssueService { remainderQty.doubleValue(), "SYSTEM", "Y", "保存成功" ); + + ids.add(unitId); } } + return ids; } } diff --git a/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java b/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java index c32a214..6231290 100644 --- a/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java +++ b/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java @@ -244,6 +244,8 @@ public class ProductionIssueServiceImpl implements ProductionIssueService { } if(BigDecimal.ZERO.compareTo(hu.getQty()) !=0){ hu.setInStockFlag("Y"); + }else{ + hu.setInStockFlag("N"); } handlingUnits.add(hu); if (material.getIssueQty() != null) { @@ -612,6 +614,8 @@ public class ProductionIssueServiceImpl implements ProductionIssueService { } if(BigDecimal.ZERO.compareTo(hu.getQty()) !=0){ hu.setInStockFlag("Y"); + }else{ + hu.setInStockFlag("N"); } handlingUnits.add(hu); }