diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWaybillVO.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWaybillVO.java index 1210874b5..b1cde7216 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWaybillVO.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWaybillVO.java @@ -37,5 +37,6 @@ public class WarehouseWaybillVO extends WarehouseWaybillEntity { List detailList = new ArrayList<>(); + private Integer handleNum; } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java index db00be6ce..9e6dd9fd9 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java @@ -208,10 +208,12 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s)); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java index fc8cbb6c6..b1d4f0039 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java @@ -94,19 +94,16 @@ public class WarehouseWaybillController extends BladeController { @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入warehouseWaybill") public R> list(@ApiIgnore @RequestParam Map warehouseWaybill, Query query) { -// QueryWrapper queryWrapper = Condition.getQueryWrapper(warehouseWaybill, WarehouseWaybillEntity.class); -// //获取当前登录人仓库 -// List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); -// List collect = myWatchWarehouse.stream() -// .map(BasicdataWarehouseEntity::getId) -// .collect(Collectors.toList()); -// queryWrapper.lambda() -// .in(collect.size() > 0, WarehouseWaybillEntity::getDepartureWarehouseId, collect) -// .or() -// .in(collect.size() > 0, WarehouseWaybillEntity::getDestinationWarehouseId, collect); - - IPage pages = warehouseWaybillService.pageInfo(Condition.getPage(query), warehouseWaybill); - return R.data(WarehouseWaybillWrapper.build().pageVO(pages)); + + BasicdataWarehouseEntity basicdataWarehouseEntity = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(basicdataWarehouseEntity)){ + log.warn("################pageInfo: 请选择仓库"); + throw new CustomerException(405,"请选择仓库"); + } + warehouseWaybill.put("warehouseId",basicdataWarehouseEntity.getId()); + + IPage pages = warehouseWaybillService.pageInfo(Condition.getPage(query), warehouseWaybill); + return R.data(pages); } /** diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java index bc37c7968..e2ea97d0c 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java @@ -47,7 +47,7 @@ public interface WarehouseWaybillMapper extends BaseMapper exportWarehouseWarehousingDetail(@Param("ew") QueryWrapper queryWrapper); - IPage pageInfo(IPage page,@Param("param") WarehouseWaybillDTO warehouseWaybillDTO); + IPage pageInfo(IPage page,@Param("param") WarehouseWaybillDTO warehouseWaybillDTO); IPage pageList(IPage page, @Param("param") WarehouseWaybillDTO waybillDTO); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java index f5d0343ad..35e629fd0 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java @@ -47,7 +47,7 @@ public interface IWarehouseWaybillService extends BaseService exportWarehouseWarehousingDetail(Map warehouseWaybillEntity); - IPage pageInfo(IPage page, Map warehouseWaybill); + IPage pageInfo(IPage page, Map warehouseWaybill); IPage pageList(WarehouseWaybillDTO waybillDTO); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java index a9b667cb6..a9b29c915 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java @@ -2412,11 +2412,11 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl details = warehouseWayBillDetailService.findByWaybillId(waybillId); @@ -694,23 +695,39 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl pageInfo(IPage page, Map warehouseWaybill) { + public IPage pageInfo(IPage page, Map warehouseWaybill) { WarehouseWaybillDTO warehouseWaybillDTO = JSON.parseObject(JSONObject.toJSONString(warehouseWaybill), WarehouseWaybillDTO.class); -// QueryWrapper queryWrapper = Condition.getQueryWrapper(warehouseWaybill, WarehouseWaybillEntity.class); - //获取当前登录人仓库 - List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); - List collect = myWatchWarehouse.stream() - .map(BasicdataWarehouseEntity::getId) - .collect(Collectors.toList()); -// queryWrapper.lambda() -// .in(collect.size() > 0, WarehouseWaybillEntity::getDepartureWarehouseId, collect) -// .or() -// .in(collect.size() > 0, WarehouseWaybillEntity::getDestinationWarehouseId, collect); - if(!collect.isEmpty()){ - warehouseWaybillDTO.setDepartureWarehouseIds(collect); - warehouseWaybillDTO.setDestinationWarehouseIds(collect); + + Long warehouseId = warehouseWaybillDTO.getWarehouseId(); + + IPage warehouseWaybillVOIPage = baseMapper.pageInfo(page, warehouseWaybillDTO); + + List records = warehouseWaybillVOIPage.getRecords(); + + for (WarehouseWaybillVO record : records) { + String deliveryMethodStr = DictBizCache.getValue(DictBizConstant.DELIVERY_METHOD, record.getDeliveryMethod()); + record.setDeliveryMethodStr(deliveryMethodStr); + String urgencyStr = DictBizCache.getValue(DictBizConstant.URGENCY, record.getUrgency()); + record.setUrgencyStr(urgencyStr); + String statsStr = DictBizCache.getValue(DictBizConstant.WAY_BILL_STATUS, record.getStats()); + record.setStatsStr(statsStr); + String typeStr = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, record.getServiceType()); + record.setServiceTypeStr(typeStr); + String freezeStatusStr = DictBizCache.getValue(DictBizConstant.FREEZE_STATUS, record.getFreezeStatus()); + record.setFreezeStatusStr(freezeStatusStr); + + Integer waybillType = record.getWaybillType(); + if(waybillType.equals(2)){ + String orderCode = record.getWaybillNo(); + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); + if(!Objects.isNull(stockArticleEntity)){ + record.setHandleNum(stockArticleEntity.getHandQuantity()); + } + } } - return baseMapper.pageInfo(page,warehouseWaybillDTO); + warehouseWaybillVOIPage.setRecords(records); + + return warehouseWaybillVOIPage; } @Override @@ -719,9 +736,17 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl pageList = baseMapper.pageList(page,waybillDTO); List records = pageList.getRecords(); for (WarehouseWaybillVO record : records) { +// Integer waybillType = record.getWaybillType(); +// if(waybillType.equals(2)){ +// String orderCode = record.getWaybillNo(); +// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); +// record.setHandleNum(stockArticleEntity.getHandQuantity()); +// } Long waybillId = record.getId(); List wayBillDetailList = warehouseWayBillDetailService.findByWaybillId(waybillId); record.setDetailList(wayBillDetailList);