diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index 5eb58bbaa..84d742f4e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -190,7 +190,7 @@ public interface DistributionStockArticleMapper extends BaseMapper pageSignforListOwe(IPage page,@Param("param") DistributionStockArticleOweDTO stockArticleEntity); + IPage pageSignforListOwe(IPage page,@Param("param") DistributionStockArticleOweDTO stockArticleEntity,@Param("collect") List warehouseIdList); void updateAllOrderTotalNum(@Param("orderCode") String orderCode, @Param("total") Integer total); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index b50ad67b0..85779b244 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -1245,6 +1245,17 @@ ldl.signfor_state = 2 and ldsa.order_status in ('70','80') + + + and ldsa.warehouse_id in + + #{item} + + and ldl.warehouse_id in + + #{item} + + AND ldsa.waybill_number like concat(#{param.waybillNumber},"%") diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java index f4bfcd04c..4a80b32dd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java @@ -65,7 +65,7 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper exportDistrilbutionBillLading(@Param("ew") Wrapper queryWrapper); - IPage pageList(IPage page, @Param("param") DistrilbutionBillLadingDTO distrilbutionBillLadingDTO); + IPage pageList(IPage page, @Param("param") DistrilbutionBillLadingDTO distrilbutionBillLadingDTO,@Param("collect") List collect); IPage pageListApp(IPage page, @Param("param") BillLadingAppDTO billLadingAppDTO); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index e55301719..ed8390845 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -71,6 +71,16 @@ LEFT JOIN logpm_distrilbution_bill_package dbp2 ON dbp2.bill_lading_id = dbl2.id AND dbp2.packet_bar_status IN ( 1, 3 ) LEFT JOIN logpm_distribution_parcel_list ldpl2 ON dbp2.parce_list_id = ldpl2.id + + 1=1 + + and dbl2.warehouse_id in + + #{item} + + + + GROUP BY dbl2.pickup_batch, ldpl2.SECOND @@ -120,6 +130,12 @@ LEFT JOIN logpm_distribution_stock_article dsa ON lds.stock_article_id = dsa.id WHERE lds.order_status != 2 + + and aaa.warehouse_id in + + #{item} + + GROUP BY aaa.id ) AS k @@ -141,6 +157,12 @@ LEFT JOIN logpm_basicdata_client lbc ON ldsl.market_id = lbc.id WHERE lddd.inventory_status != 2 + + and bbb.warehouse_id in + + #{item} + + GROUP BY bbb.id ) AS m ON m.id = k.id @@ -150,9 +172,9 @@ and dbl.pickup_batch like concat('%',#{param.pickupBatch},'%') - + and dbl.warehouse_id in - + #{item} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 8725dcb46..836956fff 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -2542,18 +2542,15 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl myWarehouseList = warehouseClient.getMyWarehouseList(); BasicdataWarehouseEntity currentWarehouse = warehouseClient.getMyCurrentWarehouse(); - List collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + List collect = null; - if (collect.size() > 1) { - stockArticleEntity.setWarehouseIdList(collect); - } else if (collect.size() == 1) { - stockArticleEntity.setWarehouseId(collect.get(0)); - } - if (Func.isNotEmpty(currentWarehouse)) { - stockArticleEntity.setWarehouseIdList(null); - stockArticleEntity.setWarehouseId(currentWarehouse.getId()); + if(ObjectUtils.isNotNull(myWarehouseList)){ + collect = new ArrayList<>(); + collect.add(currentWarehouse.getId()); + }else{ + collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); } - IPage distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity); + IPage distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity,collect); //处理创建人 distributionStockArticleEntityIPage.getRecords().forEach(a -> { if (Func.isNotEmpty(a.getCreateUser())) { @@ -2617,18 +2614,25 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl myWarehouseList = warehouseClient.getMyWarehouseList(); BasicdataWarehouseEntity currentWarehouse = warehouseClient.getMyCurrentWarehouse(); - List collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + List warehouseIdList = null; - if (collect.size() > 1) { - stockArticleEntity.setWarehouseIdList(collect); - } else if (collect.size() == 1) { - stockArticleEntity.setWarehouseId(collect.get(0)); - } - if (Func.isNotEmpty(currentWarehouse)) { - stockArticleEntity.setWarehouseIdList(null); - stockArticleEntity.setWarehouseId(currentWarehouse.getId()); + if (ObjectUtils.isNotNull(currentWarehouse)){ + warehouseIdList = new ArrayList<>(); + warehouseIdList.add(currentWarehouse.getId()); + }else{ + warehouseIdList=myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); } - IPage distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity); + +// if (collect.size() > 1) { +// stockArticleEntity.setWarehouseIdList(collect); +// } else if (collect.size() == 1) { +// stockArticleEntity.setWarehouseId(collect.get(0)); +// } +// if (Func.isNotEmpty(currentWarehouse)) { +// stockArticleEntity.setWarehouseIdList(null); +// stockArticleEntity.setWarehouseId(currentWarehouse.getId()); +// } + IPage distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity,warehouseIdList); //处理创建人 List signForStockArticleExcels = new ArrayList<>(); distributionStockArticleEntityIPage.getRecords().forEach(a -> { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index a464cc1b0..9b6d24aea 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -329,7 +329,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl logs = new ArrayList<>(); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ + if (Func.isEmpty(myCurrentWarehouse)) { log.error("自提操作未进行仓库选择"); return false; } @@ -344,7 +344,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl jsonObjects = updateBillPackeg(distrilbutionBillLading, myCurrentWarehouse,billLadingEntity.getPickupBatch()); + List jsonObjects = updateBillPackeg(distrilbutionBillLading, myCurrentWarehouse, billLadingEntity.getPickupBatch()); if (!jsonObjects.isEmpty()) { logs.addAll(jsonObjects); } @@ -375,7 +375,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl jsonObjects = handleOrder(distrilbutionBillLading,billLadingEntity.getPickupBatch()); + List jsonObjects = handleOrder(distrilbutionBillLading, billLadingEntity.getPickupBatch()); if (!jsonObjects.isEmpty()) { logs.addAll(jsonObjects); } @@ -634,7 +634,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = Func.toLongList(string); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ - log.error("自提推送工厂为进行仓库选择?>>>>>>>>>>>>>>>>>>>>warehouse:{}",myCurrentWarehouse); + if (Func.isEmpty(myCurrentWarehouse)) { + log.error("自提推送工厂为进行仓库选择?>>>>>>>>>>>>>>>>>>>>warehouse:{}", myCurrentWarehouse); } if (!list.isEmpty()) { for (Long l : list) { - distributionAsyncService.sendFactorySignforInfo(l+"",myCurrentWarehouse,AuthUtil.getUser()); + distributionAsyncService.sendFactorySignforInfo(l + "", myCurrentWarehouse, AuthUtil.getUser()); } } @@ -1526,7 +1526,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl updateBillPackeg(DistrilbutionBillLadingDTO distrilbutionBillLading,BasicdataWarehouseEntity warehouse,String pickupBatch) { + public List updateBillPackeg(DistrilbutionBillLadingDTO distrilbutionBillLading, BasicdataWarehouseEntity warehouse, String pickupBatch) { List packageIds = new ArrayList<>(); List finalPackageIds = packageIds; List aaa = new ArrayList<>(); @@ -1567,7 +1567,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionParcelListService.listByIds(collect); for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { - String content = "包件在"+warehouse.getName()+"由"+AuthUtil.getNickName()+"取消计划自提,操作方式:订单取消勾选包件,自提批次号:"+pickupBatch; + String content = "包件在" + warehouse.getName() + "由" + AuthUtil.getNickName() + "取消计划自提,操作方式:订单取消勾选包件,自提批次号:" + pickupBatch; JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), distributionParcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.PLAN_BILLOFLADING.getCode()); aaa.add(js); } @@ -1742,7 +1742,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl handleOrder(DistrilbutionBillLadingDTO distrilbutionBillLading,String pickupBatch) { + private List handleOrder(DistrilbutionBillLadingDTO distrilbutionBillLading, String pickupBatch) { BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); if (Func.isEmpty(myCurrentWarehouse)) { throw new RuntimeException("未授权!!!"); @@ -1807,7 +1807,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageIds = list.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList()); distributionParcelListService.update(Wrappers.update().lambda() - .in(DistributionParcelListEntity::getId,packageIds) - .set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.daiyuyue.getValue()) + .in(DistributionParcelListEntity::getId, packageIds) + .set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) ); } } @@ -1866,7 +1866,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl zeroPackageEntities = new ArrayList<>(); @@ -1923,7 +1923,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl { //查询包件 @@ -2140,16 +2140,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl warehouseList = basicdataWarehouseClient.getMyWarehouseList(); - List collect = warehouseList.stream() - .map(BasicdataWarehouseEntity::getId) - .collect(Collectors.toList()); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); - distrilbutionBillLadingDTO.setWarehouseIdList(collect); + + List collect = null; + + if (Func.isNotEmpty(myCurrentWarehouse)) { - distrilbutionBillLadingDTO.setWarehouseIdList(null); - distrilbutionBillLadingDTO.setWarehouseId(myCurrentWarehouse.getId()); + collect = new ArrayList<>(); + collect.add(myCurrentWarehouse.getId()); + } else { + collect = warehouseList.stream() + .map(BasicdataWarehouseEntity::getId) + .collect(Collectors.toList()); } - IPage distrilbutionBillLadingVOIPage = baseMapper.pageList(page, distrilbutionBillLadingDTO); + + + IPage distrilbutionBillLadingVOIPage = baseMapper.pageList(page, distrilbutionBillLadingDTO,collect); List records = distrilbutionBillLadingVOIPage.getRecords(); // 获取所有的提货单ID @@ -2197,7 +2203,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl "1".equals(ii.getGenre().toString())).count(); int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count(); int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count(); - i.setPrintState(count1 >= 1 && count >= 1 && count2 >= 1); + i.setPrintState(count1 >= 1 && count >= 1 && count2 >= 1); } } else { @@ -2877,7 +2883,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId)); List aaa = new ArrayList<>(); @@ -2926,7 +2932,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl stocklistIds = inventoryAppVO.stream().map(DistrilbutionBillLadingInventoryAppVO::getStockListId).collect(Collectors.toList()); - if(stocklistIds.isEmpty()){ + if (stocklistIds.isEmpty()) { return Resp.scanFail("库存品暂未备货,请联系库管人员!", "库存品暂未备货,请联系库管人员"); } List inventoryPackage = disStockListDetailService.list(Wrappers.query() @@ -2958,7 +2964,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl - List distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.query().lambda() - .in(DistributionStockArticleEntity::getId, ls) - .ne(DistributionStockArticleEntity::getIsZero, "1") - ); + List distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.query().lambda() + .in(DistributionStockArticleEntity::getId, ls) + .ne(DistributionStockArticleEntity::getIsZero, "1") + ); List list1 = distributionParcelListService.list(Wrappers.query().lambda() .in(DistributionParcelListEntity::getStockArticleId, ls) @@ -3148,9 +3154,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl mapState = new HashMap<>(); - mapState.put("coding",coding); - mapState.put("warehouseId",myCurrentWarehouse.getId()); + Map mapState = new HashMap<>(); + mapState.put("coding", coding); + mapState.put("warehouseId", myCurrentWarehouse.getId()); rabbitTemplate.convertAndSend(RabbitConstant.SELF_PICKUP_SCAN_EXCHANGE, RabbitConstant.SELF_PICKUP_SCAN_ROUTING, mapState, message -> { message.getMessageProperties() @@ -3315,9 +3321,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl