From a397fc0eca0723deaf0820d97b3c74acc9ffab86 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Thu, 14 Dec 2023 16:00:30 +0800 Subject: [PATCH] =?UTF-8?q?PC=E8=AE=A2=E5=88=B6=E5=93=81=E5=8C=85=E4=BB=B6?= =?UTF-8?q?=E5=A4=87=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/ModuleNameConstant.java | 2 +- .../IBasicdataGoodsAllocationClient.java | 8 +++ .../entity/DistributionStockEntity.java | 3 + .../BasicdataGoodsAllocationController.java | 9 ++- .../feign/BasicdataGoodsAllocationClient.java | 5 ++ .../BasicdataGoodsAllocationMapper.java | 12 +++- .../mapper/BasicdataGoodsAllocationMapper.xml | 26 ++++++- .../IBasicdataGoodsAllocationService.java | 9 +++ .../BasicdataGoodsAllocationServiceImpl.java | 67 +++++++++++++++---- .../DistributionStockController.java | 8 +-- .../impl/DistributionStockServiceImpl.java | 42 +++++++++++- 11 files changed, 166 insertions(+), 25 deletions(-) diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java index 153720380..1baf7825b 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java @@ -8,7 +8,7 @@ public interface ModuleNameConstant { /** * 如果不需要 "" */ - public static final String DEVAUTH =""; + public static final String DEVAUTH ="-tjj"; /** * 工厂对接服务名称 diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java index c11f0ee4f..f16dd00cb 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java @@ -82,4 +82,12 @@ public interface IBasicdataGoodsAllocationClient { */ @GetMapping(API_PREFIX+"/scanStockUpAllocationByCode") BasicdataGoodsAllocationEntity scanStockUpAllocationByCode(String stockUpAreaCode); + + /** + * 查询库位的完整名称,按照货区-货架-货位的方式呈现 + * @param goodsStockupAllocationId + * @return + */ + @GetMapping(API_PREFIX+"/getAllocationIntegrityName") + String getAllocationIntegrityName(@RequestParam Long goodsStockupAllocationId); } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java index 69a8fffe2..bf669fa1e 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java @@ -179,4 +179,7 @@ public class DistributionStockEntity extends TenantEntity { @ApiModelProperty(value = "扫码类型 1包件 2库存品") private Integer type; + @ApiModelProperty(value = "备货区库位ID") + private Long goodsStockupAllocationId; //备货区库位ID + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java index 4ac7c91e9..00628467b 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java @@ -199,6 +199,14 @@ public class BasicdataGoodsAllocationController extends BladeController { return R.data(pages); } + @GetMapping("/getStockUpAllocation") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询备货库位信息", notes = "传入BasicdataGoodsAllocation") + public R> getStockUpAllocation() { + List pages = basicdataGoodsAllocationService.getStockUpAllocation(); + return R.data(pages); + } + /** * 货位获取模板信息 @@ -209,7 +217,6 @@ public class BasicdataGoodsAllocationController extends BladeController { public R getPrintTemplate(@ApiIgnore @RequestParam("ids") String ids) { FreightSpaceVO result = basicdataGoodsAllocationService.getPrintTemplate(ids); return R.data(result); - } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java index 756ee2883..0d0726e02 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java @@ -110,4 +110,9 @@ public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocation return basicdataGoodsAllocationService.scanStockUpAllocationByCode(stockUpAreaCode); } + @Override + public String getAllocationIntegrityName(Long goodsStockupAllocationId) { + return basicdataGoodsAllocationService.getAllocationIntegrityName(goodsStockupAllocationId); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.java index 6af8f3cbd..2282bbe68 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.java @@ -55,7 +55,7 @@ public interface BasicdataGoodsAllocationMapper extends BaseMapper exportBasicdataGoodsAllocation(@Param("ew") Wrapper queryWrapper); - List selectSecondNode(@Param("warehouseId")String warehouseId); + List selectSecondNode(@Param("warehouseId")String warehouseId,@Param("areaType") String areaType); List selectThirdNode(@Param("warehouseId")String warehouseId,@Param("areaId") String areaId); @@ -68,4 +68,14 @@ public interface BasicdataGoodsAllocationMapper extends BaseMapper selectFourthNode(@Param("warehouseId") String warehouseId,@Param("areaId") String areaId,@Param("goodsShelfId") String goodsShelfId); + + String getAllocationIntegrityName(@Param("goodsAllocationId") Long goodsStockupAllocationId); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml index 022653660..3aa02e2fa 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml @@ -50,6 +50,9 @@ is_deleted = 0 AND warehouse_id = #{warehouseId} + + and area_type = #{areaType} + - + + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java index 56e9fbd8c..64a71ea45 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java @@ -117,4 +117,13 @@ public interface IBasicdataGoodsAllocationService extends BaseService getStockUpAllocation(); + + /** + * 查询库位的完整名称 货区-货架-货位的方式呈现 + * @param goodsStockupAllocationId + * @return + */ + String getAllocationIntegrityName(Long goodsStockupAllocationId); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java index 8cebb391d..9999da3fc 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java @@ -138,7 +138,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl basicdataWarehouseVOList = goodsAreaMapper.selectFirstNode(collect); //遍历仓库节点查询货区节点信息 for (BasicdataNodeVO basicdataNodeVO : basicdataWarehouseVOList) { - List goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue()); + List goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue(), null); //判断仓库下是否存在货区节点,存在则添加,不存在则设置没有下级节点 if (!Func.isEmpty(goodeAreaNodes)) { basicdataNodeVO.setChildren(goodeAreaNodes); @@ -164,7 +164,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl collect = myWatchWarehouse.stream() .map(BasicdataWarehouseEntity::getId) .collect(Collectors.toList()); - basicdataGoodsAllocation.put("warehouseList",collect); - return goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation); + basicdataGoodsAllocation.put("warehouseList", collect); + return goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation); } @@ -206,7 +206,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl().lambda() .set(BasicdataGoodsAllocationEntity::getEnableStatus, 1) .in(BasicdataGoodsAllocationEntity::getId, Func.toLongList(ids))); - return update?R.success("成功"):R.fail("失败"); + return update ? R.success("成功") : R.fail("失败"); } @Override public R disableGoodsAllocation(String ids) { - log.info("传入参数>>>>>>>>>>{}",ids); + log.info("传入参数>>>>>>>>>>{}", ids); //查询该货位有无货物 // List longs = Func.toLongList(ids); Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(ids); - if (integer>0){ + if (integer > 0) { return R.fail("有货物,无法禁用"); } boolean update = this.update(new UpdateWrapper().lambda() .set(BasicdataGoodsAllocationEntity::getEnableStatus, 2) .in(BasicdataGoodsAllocationEntity::getId, Func.toLongList(ids))); - return update?R.success("成功"):R.fail("失败"); + return update ? R.success("成功") : R.fail("失败"); } @Override public List findListStockUpAllocationByName(String fragment) { BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ + if (Func.isEmpty(myCurrentWarehouse)) { return null; } return this.list(Wrappers.query().lambda() - .like(BasicdataGoodsAllocationEntity::getGoodsAllocationName,fragment) - .eq(BasicdataGoodsAllocationEntity::getWarehouseId,myCurrentWarehouse.getId()) - .eq(BasicdataGoodsAllocationEntity::getEnableStatus,"1") + .like(BasicdataGoodsAllocationEntity::getGoodsAllocationName, fragment) + .eq(BasicdataGoodsAllocationEntity::getWarehouseId, myCurrentWarehouse.getId()) + .eq(BasicdataGoodsAllocationEntity::getEnableStatus, "1") ); } @@ -304,4 +304,43 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl getStockUpAllocation() { + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseService.getMyCurrentWarehouse(); + if (Func.isEmpty(myCurrentWarehouse)) { + return null; + } + List nodeS = new ArrayList<>(); + List goodeAreaNodes = goodsAllocationMapper.selectSecondNode(myCurrentWarehouse.getId().toString(), "1"); + if (Func.isNotEmpty(goodeAreaNodes)) { + for (BasicdataNodeVO goodeAreaNode : goodeAreaNodes) { + List goodsShelfNode = goodsAllocationMapper.selectThirdNode(myCurrentWarehouse.getId().toString(), goodeAreaNode.getValue()); + if (Func.isNotEmpty(goodsShelfNode)) { + goodeAreaNode.setChildren(goodsShelfNode); + goodeAreaNode.setLeaf(false); + for (BasicdataNodeVO basicdataNodeVO : goodsShelfNode) { + List goodsAllocationNode = goodsAllocationMapper.selectFourthNode(myCurrentWarehouse.getId().toString(), goodeAreaNode.getValue(), basicdataNodeVO.getValue()); + if (Func.isNotEmpty(goodsAllocationNode)) { + basicdataNodeVO.setChildren(goodsAllocationNode); + basicdataNodeVO.setLeaf(false); + }else { + basicdataNodeVO.setLeaf(true); + } + } + }else { + goodeAreaNode.setLeaf(true); + } + nodeS.add(goodeAreaNode); + + } + + } + return nodeS; + } + + @Override + public String getAllocationIntegrityName(Long goodsStockupAllocationId) { + return baseMapper.getAllocationIntegrityName(goodsStockupAllocationId); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java index b802748ca..3ab20b3c2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java @@ -110,11 +110,9 @@ public class DistributionStockController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "系统备货新增", notes = "传入distributionStock") public R addStockDetail(@Valid @RequestBody DistributionStockDTO distributionStock) { - if(ObjectUtils.isNull(distributionStock.getGoodsAreaId())){ - return R.fail("注意,注意:备货区未选择!"); - } - - +// if(ObjectUtils.isNull(distributionStock.getGoodsAreaId())){ +// return R.fail("注意,注意:备货区未选择!"); +// } return R.status(distributionStockService.addStockDetail(distributionStock)); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java index da403f85d..fb710b886 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java @@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity; +import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient; import com.logpm.distribution.dto.DistributionStockDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionStockExcel; @@ -37,6 +39,7 @@ import org.springblade.common.constant.order.OrderStockupStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.Func; import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -80,6 +83,8 @@ public class DistributionStockServiceImpl extends BaseServiceImpl selectDistributionStockPage(IPage page, DistributionStockVO distributionStock) { @@ -204,8 +209,13 @@ public class DistributionStockServiceImpl extends BaseServiceImpl ids = distributionStocks.getIds(); List list = new ArrayList<>(); + String allocationIntegrityName = basicdataGoodsAllocationClient.getAllocationIntegrityName(distributionStocks.getGoodsStockupAllocationId()); for (int ii = 0; ii < ids.size(); ii++) { String i = ids.get(ii); DistributionStockEntity stockEntity = new DistributionStockEntity(); @@ -246,10 +256,18 @@ public class DistributionStockServiceImpl extends BaseServiceImpl