From 79247211b0e907383620d1a0a9354ddec22ac0aa Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 31 May 2024 12:25:39 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/dto/FindParamterDTO.java | 19 ++++++++++++++++ .../feign/IDistributionParcelListClient.java | 7 +++--- .../IDistributionStockArticleClient.java | 4 ++-- .../feign/DistributionParcelListClient.java | 22 +++++++++++-------- .../feign/DistributionStockArticleClient.java | 8 +++---- .../impl/TrunklineAdvanceServiceImpl.java | 11 ++++++++-- .../impl/WarehouseTrayTypeServiceImpl.java | 6 ++++- .../impl/WarehouseUpdownTypeServiceImpl.java | 18 ++++++++++++--- 8 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/dto/FindParamterDTO.java diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/dto/FindParamterDTO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/dto/FindParamterDTO.java new file mode 100644 index 000000000..3723bb5b2 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/dto/FindParamterDTO.java @@ -0,0 +1,19 @@ +package com.logpm.distribution.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Set; + +@Data +public class FindParamterDTO implements Serializable { + + private Set orderCodeSet; + + private Long warehouseId; + + private List orderPackageCodeList; + private List orderCodeList; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index 224c02070..47f8b030e 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.feign; +import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.dto.OrderPackageDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.vo.DistributionParcelListVO; @@ -190,11 +191,11 @@ public interface IDistributionParcelListClient { void saveorUpdateBatchByOP(@RequestBody List parcelListEntityList); @PostMapping(API_PREFIX + "/findListByOrderCodesAndWarehouseId") - List findListByOrderCodesAndWarehouseId(@RequestParam Set orderCodeSet, @RequestParam Long warehouseId); + List findListByOrderCodesAndWarehouseId(@RequestBody FindParamterDTO findParamterDTO); @PostMapping(API_PREFIX + "/findListByOrderPackageCodeList") - List findListByOrderPackageCodeList(@RequestParam List orderPackageCodeList, @RequestParam Long warehouseId); + List findListByOrderPackageCodeList(@RequestBody FindParamterDTO findParamterDTO); @PostMapping(API_PREFIX + "/findALLNoUpShelfPackageByOrderCodeList") - List findALLNoUpShelfPackageByOrderCodeList(@RequestParam List orderCodeList, @RequestParam Long warehouseId); + List findALLNoUpShelfPackageByOrderCodeList(@RequestBody FindParamterDTO findParamterDTO); } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java index d96503cb1..fd7ec1c6f 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java @@ -18,6 +18,7 @@ package com.logpm.distribution.feign; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.dto.OrderPackageDTO; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.vo.UpDownStockupAreaVO; @@ -32,7 +33,6 @@ import org.springframework.web.bind.annotation.RequestParam; import java.util.List; import java.util.Map; -import java.util.Set; /** * 配送在库订单 Feign接口类 @@ -178,7 +178,7 @@ public interface IDistributionStockArticleClient { void updateCustomerAllByOrderCode(@RequestBody String data); @PostMapping(value = API_PREFIX + "/findListByOrderCodesAndWarehouseId",consumes = MediaType.APPLICATION_JSON_VALUE) - List findListByOrderCodesAndWarehouseId(@RequestParam Set orderCodeSet, @RequestParam Long warehouseId); + List findListByOrderCodesAndWarehouseId(@RequestBody FindParamterDTO findParamterDTO); @PostMapping(value = API_PREFIX + "/addReturnList",consumes = MediaType.APPLICATION_JSON_VALUE) List addReturnList(@RequestBody List addStockArticleEntities); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index 1c50b868f..e6d5eace7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.dto.OrderPackageDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; @@ -36,7 +37,10 @@ import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; import java.util.*; @@ -423,25 +427,25 @@ public class DistributionParcelListClient implements IDistributionParcelListClie } @Override - public List findListByOrderCodesAndWarehouseId(Set orderCodeSet, Long warehouseId) { + public List findListByOrderCodesAndWarehouseId(FindParamterDTO findParamterDTO) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("order_code", orderCodeSet) - .eq("warehouse_id", warehouseId); + queryWrapper.in("order_code", findParamterDTO.getOrderCodeSet()) + .eq("warehouse_id", findParamterDTO.getWarehouseId()); return distributionParcelListService.list(queryWrapper); } @Override - public List findListByOrderPackageCodeList(List orderPackageCodeList, Long warehouseId) { + public List findListByOrderPackageCodeList(FindParamterDTO findParamterDTO) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("order_package_code", orderPackageCodeList) - .eq("warehouse_id", warehouseId); + queryWrapper.in("order_package_code", findParamterDTO.getOrderPackageCodeList()) + .eq("warehouse_id", findParamterDTO.getWarehouseId()); return distributionParcelListService.list(queryWrapper); } @Override - public List findALLNoUpShelfPackageByOrderCodeList(List orderCodeList, Long warehouseId) { - return distributionParcelListService.findALLNoUpShelfPackageByOrderCodeList(orderCodeList,warehouseId); + public List findALLNoUpShelfPackageByOrderCodeList(FindParamterDTO findParamterDTO) { + return distributionParcelListService.findALLNoUpShelfPackageByOrderCodeList(findParamterDTO.getOrderCodeList(),findParamterDTO.getWarehouseId()); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java index 9e46f526b..9a8347a70 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java @@ -21,6 +21,7 @@ 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.distribution.dto.FindParamterDTO; import com.logpm.distribution.dto.OrderPackageDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; @@ -41,7 +42,6 @@ import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; /** * 配送在库订单 Feign实现类 @@ -336,10 +336,10 @@ public class DistributionStockArticleClient implements IDistributionStockArticle } @Override - public List findListByOrderCodesAndWarehouseId(Set orderCodeSet, Long warehouseId) { + public List findListByOrderCodesAndWarehouseId(FindParamterDTO findParamterDTO) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("order_code",orderCodeSet) - .eq("warehouse_id",warehouseId); + queryWrapper.in("order_code",findParamterDTO.getOrderCodeSet()) + .eq("warehouse_id",findParamterDTO.getWarehouseId()); return distributionStockArticleService.list(queryWrapper); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java index bd2e12cbf..fc1211090 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java @@ -14,6 +14,7 @@ import com.logpm.basicdata.feign.IBasicdataClientClient; import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient; import com.logpm.basicdata.feign.IBasicdataTripartiteMallClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; +import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.feign.IDistributionParcelListClient; @@ -731,13 +732,19 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl stockArticleEntities = stockArticleClient.findListByOrderCodesAndWarehouseId(orderCodeSet,warehouseId); + FindParamterDTO findParamterDTO = new FindParamterDTO(); + findParamterDTO.setOrderCodeSet(orderCodeSet); + findParamterDTO.setWarehouseId(warehouseId); + List stockArticleEntities = stockArticleClient.findListByOrderCodesAndWarehouseId(findParamterDTO); Map stockArticleMap = new HashMap<>(); if(!stockArticleEntities.isEmpty()){ stockArticleMap = stockArticleEntities.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getOrderCode, Function.identity())); } - List parcelListEntities = parcelListClient.findListByOrderCodesAndWarehouseId(orderCodeSet,warehouseId); + FindParamterDTO findParamterD = new FindParamterDTO(); + findParamterD.setOrderCodeSet(orderCodeSet); + findParamterD.setWarehouseId(warehouseId); + List parcelListEntities = parcelListClient.findListByOrderCodesAndWarehouseId(findParamterD); Map parcelListMap = new HashMap<>(); if(!parcelListEntities.isEmpty()){ parcelListMap = parcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity())); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java index 02ec1f2ac..908314712 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java @@ -9,6 +9,7 @@ import com.logpm.basic.entity.BasicMaterialEntity; import com.logpm.basic.feign.IBasicMaterialClient; import com.logpm.basicdata.entity.*; import com.logpm.basicdata.feign.*; +import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.entity.DistributionStockListEntity; @@ -709,7 +710,10 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl> map = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getOrderCode)); - List stockArticleEntityList = distributionStockArticleClient.findListByOrderCodesAndWarehouseId(map.keySet(), warehouseId); + FindParamterDTO findParamterDTO = new FindParamterDTO(); + findParamterDTO.setOrderCodeSet(map.keySet()); + findParamterDTO.setWarehouseId(warehouseId); + List stockArticleEntityList = distributionStockArticleClient.findListByOrderCodesAndWarehouseId(findParamterDTO); //把stockArticleEntityList转化成orderCode为key的Map Map stockArticleEntityMap = stockArticleEntityList.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getOrderCode, Function.identity())); 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 1c0f73355..cea2de88b 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 @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.basicdata.entity.*; import com.logpm.basicdata.feign.*; +import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.dto.OrderPackageDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; @@ -879,7 +880,11 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl orderCodeList = upShelfOrderList.stream().map(UpShelfOrderDTO::getOrderCode).collect(Collectors.toList()); - List parcelListList = distributionParcelListClient.findALLNoUpShelfPackageByOrderCodeList(orderCodeList, warehouseId); + + FindParamterDTO findParamterDTO = new FindParamterDTO(); + findParamterDTO.setOrderCodeList(orderCodeList); + findParamterDTO.setWarehouseId(warehouseId); + List parcelListList = distributionParcelListClient.findALLNoUpShelfPackageByOrderCodeList(findParamterDTO); List upShelfPackageList = new ArrayList<>(); @@ -969,7 +974,11 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl orderPackageCodes = trayGoodsEntityList.stream().map(WarehouseTrayGoodsEntity::getAssociationValue).collect(Collectors.toList()); warehouseTrayTypeService.downPackageByOrderPackageCodeList(orderPackageCodes,"同步处理:包件解托",warehouseId); } - List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(orderPackageCodeList, warehouseId); + + FindParamterDTO findParamterDTO = new FindParamterDTO(); + findParamterDTO.setOrderPackageCodeList(orderPackageCodeList); + findParamterDTO.setWarehouseId(warehouseId); + List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); //排除parcelListEntityList中元素orderPackageStatus 不等于20的 parcelListEntityList = parcelListEntityList.stream().filter(parcelListEntity -> "20".equals(parcelListEntity.getOrderPackageStatus())).collect(Collectors.toList()); @@ -1427,7 +1436,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl associationValueList = updownGoodsEntities.stream().map(WarehouseUpdownGoodsEntity::getAssociationValue).collect(Collectors.toList()); - List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(associationValueList, warehouseId); + FindParamterDTO findParamterDTO = new FindParamterDTO(); + findParamterDTO.setOrderPackageCodeList(associationValueList); + findParamterDTO.setWarehouseId(warehouseId); + List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); //把parcelListEntityList转化成orderPackageCode为key的Map Map parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity()));