diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java index 47879e1ec..98d42b4bf 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java @@ -39,6 +39,8 @@ public class UpDownStockupAreaVO { private Integer enterNum; + private Integer isMay; + private String waybillCode; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 7864b53ff..f09a5ab65 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -5444,7 +5444,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda() .eq(WarehouseUpdownStockupAreaEntity::getWarehouseId, myCurrentWarehouse.getId()) .eq(WarehouseUpdownStockupAreaEntity::getAssociationValue, upDownStockupAreaVO.getAssociationValue()) - .eq(WarehouseUpdownStockupAreaEntity::getAllocationId, upDownStockupAreaVO.getAssociationId()) - .eq(WarehouseUpdownStockupAreaEntity::getGoodsType, upDownStockupAreaVO.getGoodsType()) + .eq(WarehouseUpdownStockupAreaEntity::getAssociationId, upDownStockupAreaVO.getAssociationId()) ); if (Func.isNotEmpty(updownStockupAreaEntity)){ //已经在备货库位进行上架了 return Resp.scanFail("该包件已上架","该包件已上架"); } + if (IsOrNoConstant.no.equals(upDownStockupAreaVO.getIsMay())){ + return Resp.scanFail("包件不在库","包件不在库"); + } return R.data(upDownStockupAreaVO); }else { return Resp.scanFail("该包件不存在","该包件不存在"); @@ -149,6 +156,8 @@ public class WarehouseUpdownStockupAreaApiController { } } + + @ResponseBody @GetMapping("/upShelfPackageData") @ApiOperationSupport(order = 1) @@ -189,9 +198,7 @@ public class WarehouseUpdownStockupAreaApiController { Integer stockType = updownTypeDTO.getStockType(); String value = updownTypeDTO.getValue(); Long marketId = updownTypeDTO.getMarketId(); - try{ - BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息不能为空"); @@ -212,7 +219,7 @@ public class WarehouseUpdownStockupAreaApiController { } //查询该库位的货物信息 - return warehouseUpdownStockupAreaService.getStockByParam(stockType,value,marketId,myCurrentWarehouse.getId()); + return R.data(warehouseUpdownStockupAreaService.getStockByParam(stockType,value,marketId,myCurrentWarehouse.getId())) ; }catch (CustomerException e){ log.warn(e.message); return R.fail(e.code,e.message); @@ -358,32 +365,40 @@ public class WarehouseUpdownStockupAreaApiController { @ApiOperation(value = "备货库位上架扫描托盘", notes = "传入trayTypeDTO") public R upShelfScanTray(@RequestBody UpdownTypeDTO updownTypeDTO ) { String method = "###########upShelfScanTray: "; - log.info(method + "上架扫描托盘 updownTypeDTO={}", updownTypeDTO); + log.info(method + "备货库位上架扫描托盘 updownTypeDTO={}", updownTypeDTO); try{ BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息不能为空"); return R.fail(403,"仓库信息不能为空"); } - //查询该库位的货物信息 - UpDownStockupAreaVO upDownStockupAreaVO = warehouseUpdownStockupAreaService.upShelfScanPackage(myCurrentWarehouse.getId(), updownTypeDTO.getOrderPackageCode()); - //此包件是否已经完成上架了 - if (Func.isNotEmpty(upDownStockupAreaVO)){ - //查询是否上架 - WarehouseUpdownStockupAreaEntity updownStockupAreaEntity = warehouseUpdownStockupAreaService.getOne(Wrappers.query().lambda() - .eq(WarehouseUpdownStockupAreaEntity::getWarehouseId, myCurrentWarehouse.getId()) - .eq(WarehouseUpdownStockupAreaEntity::getAssociationValue, upDownStockupAreaVO.getAssociationValue()) - .eq(WarehouseUpdownStockupAreaEntity::getAllocationId, upDownStockupAreaVO.getAssociationId()) - .eq(WarehouseUpdownStockupAreaEntity::getGoodsType, upDownStockupAreaVO.getGoodsType()) - ); - if (Func.isNotEmpty(updownStockupAreaEntity)){ - //已经在备货库位进行上架了 - return Resp.scanFail("该包件已上架","该包件已上架"); - } - return R.data(upDownStockupAreaVO); - }else { - return Resp.scanFail("该包件不存在","该包件不存在"); + //查询托盘货物信息 + return warehouseUpdownStockupAreaService.upShelfScanTray(myCurrentWarehouse.getId(), updownTypeDTO.getTrayCode()); + }catch (CustomerException e){ + log.warn(e.message); + return Resp.scanFail(e.code,e.message,e.message); + }catch (Exception e){ + log.error(method+"系统异常,联系管理员",e); + return R.fail(500,"系统异常,联系管理员"); + } + } + + + @ResponseBody + @PostMapping("/upShelfTray") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "备货库位上架托盘", notes = "传入trayTypeDTO") + public R upShelfTray(@RequestBody UpdownTypeDTO updownTypeDTO ) { + String method = "###########upShelfScanTray: "; + log.info(method + "备货库位上架托盘 updownTypeDTO={}", updownTypeDTO); + try{ + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息不能为空"); + return R.fail(403,"仓库信息不能为空"); } + //查询托盘货物信息 + return warehouseUpdownStockupAreaService.upShelfScanTray(myCurrentWarehouse.getId(), updownTypeDTO.getTrayCode()); }catch (CustomerException e){ log.warn(e.message); return Resp.scanFail(e.code,e.message,e.message); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java index 244efab19..1937bbe3a 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java @@ -84,7 +84,7 @@ public interface IWarehouseUpdownStockupAreaService extends BaseService getStockByParam(Integer stockType, String value, Long marketId, Long id); /** * 库存品上架 @@ -120,4 +120,11 @@ public interface IWarehouseUpdownStockupAreaService extends BaseService upShelfZeroOrderList, Long allocationId, Long id); + /** + * 扫毛 + * @param id + * @param trayCode + * @return + */ + R upShelfScanTray(Long id, String trayCode); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java index f8849bb25..9608541f1 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java @@ -43,19 +43,20 @@ import com.logpm.warehouse.service.*; import com.logpm.warehouse.vo.*; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.common.IsOrNoConstant; +import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.system.cache.DictBizCache; +import org.springblade.system.entity.DictBiz; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; /** @@ -104,6 +105,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl waitSaveWarehouseUpdownStockupAreaLogEntity = new ArrayList<>(); for (UpStockupAreaPackageDTO upStockupAreaPackageDTO : upStockupAreaPackageDTOS) { if ("1".equals(upStockupAreaPackageDTO.getGoodsType())){ - //有数据的包件 + //查询是否存在上架操作 WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(Wrappers.query().lambda() .eq(WarehouseUpdownGoodsEntity::getWarehouseId, warehouseId) - .eq(WarehouseUpdownGoodsEntity::getAssociationValue, warehouseId) - .eq(WarehouseUpdownGoodsEntity::getAssociationType, "3") + .eq(WarehouseUpdownGoodsEntity::getAssociationValue, upStockupAreaPackageDTO.getAssociationValue()) ); if (!Objects.isNull(updownGoodsEntity)){ //进行下架解托操作 @@ -226,7 +231,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl getStockByParam(Integer stockType, String value, Long marketId, Long warehouseId) { List ls = new ArrayList<>(); //1物料编码 2物料名称 if(1==stockType){ @@ -408,7 +417,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl entityList = warehouseTrayGoodsService.list(Wrappers.query().lambda() + .eq(WarehouseTrayGoodsEntity::getTrayCode, trayCode) + .eq(WarehouseTrayGoodsEntity::getWarehouseId, warehouseId) + ); + Map map = new HashMap<>(); + TrayTypeDataVO trayData = warehouseTrayTypeService.getEntityByTrayCode(trayCode,warehouseId); + if(!Objects.isNull(trayData)){ + map.put("trayData",trayData); + } + if (!entityList.isEmpty()){ + //存在托盘,进行托盘货物查询 + Map> collect = entityList.stream().filter(f -> Func.isNotEmpty(f.getAssociationType())).collect(Collectors.groupingBy(WarehouseTrayGoodsEntity::getAssociationType)); + if (!collect.isEmpty()){ + collect.forEach((k,v)->{ + switch (k){ + case "1": + //零担 + List zeroOrder = handelZeroOrder(v,warehouseId); + if (!zeroOrder.isEmpty()){ + map.put("zeroOrder",zeroOrder); + } + break; + case "2": + //运单号 + break; + case "3": + //包件 + //组装包件数据进行上架 + List packageData = handelPackage(v,warehouseId); + if (!packageData.isEmpty()){ + map.put("packageData",packageData); + } + break; + case "4": + //库存品 + List inventoryData =handelInventory(v,warehouseId); + if (!inventoryData.isEmpty()){ + map.put("inventoryData",inventoryData); + } + break; + default: + log.info("##################未知打托方式,k:{}",k); + break; + } + }); + } + } + return R.data(map); + } + + private List handelZeroOrder(List zeroOrderGoods, Long warehouseId) { + List zeroOrderData = new ArrayList<>(); + for (WarehouseTrayGoodsEntity zeroOrderGood : zeroOrderGoods) { + UpDownStockupAreaVO upDownStockupZeroByOrderCodeAndWarehouseId = distributionStockArticleClient.findUpDownStockupZeroByOrderCodeAndWarehouseId(zeroOrderGood.getAssociationValue(), warehouseId); + if (Func.isNotEmpty(upDownStockupZeroByOrderCodeAndWarehouseId)){ + Integer a = warehouseTrayTypeService.getZeroOrderByOrderId(upDownStockupZeroByOrderCodeAndWarehouseId.getOrderId(),warehouseId); + if (a> 0) { + zeroOrderData.add(upDownStockupZeroByOrderCodeAndWarehouseId); + } + } + } + return zeroOrderData; + } + + private List handelInventory(List inventoryGoods, Long warehouseId) { + List inventoryData = new ArrayList<>(); + for (WarehouseTrayGoodsEntity warehouseTrayGoodsEntity : inventoryGoods) { + + List stockByParam = this.getStockByParam(1, warehouseTrayGoodsEntity.getAssociationValue(), warehouseTrayGoodsEntity.getMarketId(), warehouseId); + if (!stockByParam.isEmpty()){ + inventoryData.addAll(stockByParam); + } + } + return inventoryData; + } + + private List handelPackage(List packageGoods,Long warehouseId) { + List packageData = new ArrayList<>(); + for (WarehouseTrayGoodsEntity packageGood : packageGoods) { + UpDownStockupAreaVO upDownStockupAreaVO = this.upShelfScanPackage(warehouseId, packageGood.getAssociationValue()); + if (Func.isNotEmpty(upDownStockupAreaVO)){ + packageData.add(upDownStockupAreaVO); + } + } + return packageData; + } + private WarehouseUpdownStockupAreaEntity createdNewUpShelfInventory(Long allocationId, Long warehouseId, UpShelfStockDTO upShelfStockDTO, WarehouseUpdownStockupAreaEntity updownTypeEntity, Long goodsAreaId, BasicdataGoodsAreaEntity goodsAreaEntity, Long goodsShelfId, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity) { WarehouseUpdownStockupAreaEntity updownStockupAreaEntity = new WarehouseUpdownStockupAreaEntity();