From 936b3dac1457fa8cfda284ba88e5ed161ddda24b Mon Sep 17 00:00:00 2001 From: judy <278197488@qq.com> Date: Sat, 31 Aug 2024 09:56:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E6=B5=8B=E8=AF=95=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/shkj/wms/bo/BusinStockInvQueryBo.java | 3 ++ .../business/BusinStockInvController.java | 20 +++++---- .../impl/BusinStockInvServiceImpl.java | 35 +++++++++------ .../mapper/wms/BaseLocationMapper.xml | 3 +- .../mapper/wms/BusinStockInvMapper.xml | 43 +++++++++++-------- 5 files changed, 63 insertions(+), 41 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java b/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java index 4e7ae8f..b399a33 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java +++ b/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java @@ -66,6 +66,9 @@ public class BusinStockInvQueryBo extends BaseEntity { */ private String invStatus; + private List invStatusList; + + /** * 货位ID */ diff --git a/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinStockInvController.java b/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinStockInvController.java index 598c7c2..1722727 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinStockInvController.java +++ b/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinStockInvController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.util.ArrayList; import java.util.List; /** @@ -53,7 +54,10 @@ public class BusinStockInvController extends BaseController { public TableDataInfo list(BusinStockInvQueryBo bo) { startPage(); if (StringUtils.isEmpty(bo.getInvStatus())) { - bo.setInvStatus(InvStatusEnum.init.getValue()); + List invStatusList= new ArrayList(); + invStatusList.add(InvStatusEnum.init.getValue()); + invStatusList.add(InvStatusEnum.exec.getValue()); + bo.setInvStatusList(invStatusList); } List list = iBusinStockInvService.queryList(bo); return getDataTable(list); @@ -74,9 +78,9 @@ public class BusinStockInvController extends BaseController { * 设置为空货位 */ @PostMapping("/setEmptyLocation") - public Result setEmptyLocation(Long locationId) { + public Result setEmptyLocation(Long invId) { startPage(); - Result booleanResult = iBusinStockInvService.setEmptyLocation(locationId); + Result booleanResult = iBusinStockInvService.setEmptyLocation(invId); return booleanResult; } @@ -84,9 +88,9 @@ public class BusinStockInvController extends BaseController { * 设置为空空托 */ @PostMapping("/setEmptyContainer") - public Result setEmptyContainer(Long locationId) { + public Result setEmptyContainer(Long invId) { startPage(); - Result booleanResult = iBusinStockInvService.setEmptyContainer(locationId); + Result booleanResult = iBusinStockInvService.setEmptyContainer(invId); return booleanResult; } @@ -94,9 +98,9 @@ public class BusinStockInvController extends BaseController { * 标记差异 */ @PostMapping("/flagAsDiff") - public Result flagAsDiff(Long locationId) { + public Result flagAsDiff(Long invId) { startPage(); - Result booleanResult = iBusinStockInvService.flagAsDiff(locationId); + Result booleanResult = iBusinStockInvService.flagAsDiff(invId); return booleanResult; } @@ -114,7 +118,7 @@ public class BusinStockInvController extends BaseController { * 盘点完成 */ @PostMapping("/invFinish") - public Result invFinish(Long invId) { + public Result invFinish( Long invId) { startPage(); Result booleanResult = iBusinStockInvService.invFinish(invId); return booleanResult; diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java index 2c0e327..b995858 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java @@ -67,13 +67,11 @@ public class BusinStockInvServiceImpl extends ServiceImpl queryList(BusinStockInvQueryBo bo) { return this.baseMapper.queryList(bo); } @Override - @DataScopeConsignor(consignorAlias = "si") public List queryListByGoodsGroup(BusinStockInvQueryBo bo) { return this.baseMapper.queryListByGoodsGroup(bo); } @@ -139,22 +137,26 @@ public class BusinStockInvServiceImpl extends ServiceImpl setEmptyLocation(Long locationId) { + public Result setEmptyLocation(Long invId) { /** * 1.系统有保险杠或空托时,实际系统货位是空时,可清除 */ try { - List sysStockDetails = sysStockDetailService.queryStrockByLocation(locationId); + BusinStockInv businStockInv = this.getById(invId); + businStockInv.setInvStatus(InvStatusEnum.end.getValue()); + this.updateById(businStockInv); + + List sysStockDetails = sysStockDetailService.queryStrockByLocation(businStockInv.getLocationId()); if (sysStockDetails !=null && sysStockDetails.size()>0){ sysStockDetails.removeAll(sysStockDetails); } - BaseLocation baseLocation = iBaseLocationService.getById(locationId); + BaseLocation baseLocation = iBaseLocationService.getById(businStockInv.getLocationId()); baseLocation.setLocationStatus(LocationStatusEnum.empty.getValue()); iBaseLocationService.updateById(baseLocation); @@ -169,23 +171,27 @@ public class BusinStockInvServiceImpl extends ServiceImpl setEmptyContainer(Long locationId) { + public Result setEmptyContainer(Long invId) { /** * 1.系统有保险杠或空托时,实际系统货位是空时,可清除 */ try { + BusinStockInv businStockInv = this.getById(invId); + businStockInv.setInvStatus(InvStatusEnum.end.getValue()); + this.updateById(businStockInv); + //更新货位状态为:空托 - BaseLocation baseLocation = iBaseLocationService.getById(locationId); + BaseLocation baseLocation = iBaseLocationService.getById(businStockInv.getLocationId()); baseLocation.setLocationStatus(LocationStatusEnum.empty_container.getValue()); iBaseLocationService.updateById(baseLocation); //删除库存明细表中的数据 - List sysStockDetails = sysStockDetailService.queryStrockByLocation(locationId); + List sysStockDetails = sysStockDetailService.queryStrockByLocation(businStockInv.getLocationId()); if (sysStockDetails !=null && sysStockDetails.size()>0){ sysStockDetails.removeAll(sysStockDetails); } @@ -210,16 +216,19 @@ public class BusinStockInvServiceImpl extends ServiceImpl flagAsDiff(Long locationId) { + public Result flagAsDiff(Long invId) { /** * 1.实际是有杠,但是系统无或是颜色车型不一样时,进行标记,标记后指定出库(地图上一键出库) */ - BaseLocation baseLocation = iBaseLocationService.getById(locationId); + BusinStockInv businStockInv = this.getById(invId); + businStockInv.setInvStatus(InvStatusEnum.end.getValue()); + this.updateById(businStockInv); + BaseLocation baseLocation = iBaseLocationService.getById(businStockInv.getLocationId()); baseLocation.setLocationStatus(LocationStatusEnum.flag_diff.getValue()); return iBaseLocationService.updateById(baseLocation)?Result.ok().msg("标记差异成功"):Result.err().msg("标记差异失败"); } diff --git a/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml b/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml index b1999b2..75012a0 100644 --- a/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml @@ -374,8 +374,7 @@ LEFT JOIN base_area ba ON bl.area_id = ba.id LEFT JOIN base_storage bs ON ba.storage_id = bs.id WHERE - bl.is_del = '0' - AND ba.is_del = '0' + ba.is_del = '0' AND bs.is_del = '0' and bl.area_id = #{areaId} diff --git a/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml b/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml index 1c14c01..bc0d046 100644 --- a/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml @@ -45,24 +45,31 @@ JOIN base_location loc ON si.location_id = loc.id left join sys_stock_detail stock on stock.location_id=loc.id left join base_goods_data goods ON stock.goods_no =goods.goods_no - - and si.inv_status = #{invStatus} - - - AND loc.tunnel = #{tunnel} - - - AND loc.location_row = #{locationRow} - - - AND loc.location_column = #{locationColumn} - - - and loc.layer=#{layer} - - - and loc.id=#{locationId} - + where si.inv_status in + + #{invStatus} + + + + and si.inv_status = #{invStatus} + + + + AND loc.tunnel = #{tunnel} + + + AND loc.location_row = #{locationRow} + + + AND loc.location_column = #{locationColumn} + + + and loc.layer=#{layer} + + + and loc.id=#{locationId} + + group by si.id,loc.id,loc.location_code,goods.vehiche_model,goods.color,loc.location_status,inv_order_no ORDER BY loc.route