From c3a6399d4ab090f99a70c46463da8f4ae090fcdc Mon Sep 17 00:00:00 2001 From: "0.0" <1092404103.qq.com> Date: Fri, 15 Sep 2023 18:56:27 +0800 Subject: [PATCH 01/30] =?UTF-8?q?1.=E6=89=98=E7=9B=98=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IWarehouseGoodsAllocationClient.java | 5 ++ .../controller/BasicdataTrayController.java | 2 +- .../basicdata/mapper/BasicdataTrayMapper.xml | 25 ++++--- .../WarehouseGoodsAllocationController.java | 35 ++++++---- .../feign/WarehouseGoodsAllocationClient.java | 6 ++ .../IWarehouseGoodsAllocationService.java | 5 ++ .../WarehouseGoodsAllocationServiceImpl.java | 68 ++++++++++++++----- 7 files changed, 106 insertions(+), 40 deletions(-) diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java index d92f1726f..5b09bdacb 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java @@ -46,5 +46,10 @@ public interface IWarehouseGoodsAllocationClient { */ @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + /** + * 跟新货位缓存 + */ + @GetMapping(TOP+ "/updateAllocationCache") + Boolean updateAllocationCache(@RequestParam("ids") String ids); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java index f553ce560..190654f06 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java @@ -108,7 +108,7 @@ public class BasicdataTrayController extends BladeController { @ApiOperation(value = "库存品列表", notes = "传入BasicdataTray") public R> inventoryList(BasicdataTrayDTO BasicdataTray, Query query) { IPage list = trayService.getinventoryList(Condition.getPage(query), BasicdataTray); - return R.data(list); + return R.data(WarehouseStockListWrapper.build().pageVO(list)); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml index 56a96951a..64d9784ef 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml @@ -107,7 +107,9 @@ ldpl.order_package_reservation_status orderPackageReservationStatus, ldpl.order_package_loading_status orderPackageLoadingStatus, lwga.column_num columnNum, - lwga.layer_num layerNum + lwga.layer_num layerNum, + lwtg.create_time operateTime, + lwtg.create_user operateUser FROM logpm_warehouse_tray_goods lwtg JOIN logpm_distribution_parcel_list ldpl ON lwtg.association_id = ldpl.id @@ -168,15 +170,18 @@ ldsl.cargo_number cargoNumber, ldsl.cargo_unit cargoUnit, ldsl.cargo_norms cargoNorms, - ldsl.shopping_mall shoppingMall, + ldsl.market_name marketName, ldsl.warehouse_name warehouseName, lwug.position_code positionCode, lwga.column_num columnNum, - lwga.layer_num layerNum + lwga.layer_num layerNum, + lwtg.create_time operateTime, + lwtg.num num, + lwtg.create_user operateUser FROM logpm_warehouse_tray_goods lwtg - JOIN logpm_distribution_stock_list ldsl ON lwtg.association_id = ldsl.id - left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.id + JOIN logpm_distribution_stock_list ldsl ON lwtg.association_id = ldsl.material_id + left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.material_id ldsl.is_deleted = 0 and lwtg.is_deleted = 0 and lwtg.association_type = 4 and lwtg.tray_id = #{param.id} @@ -208,7 +213,9 @@ ldsa.consignee_address consigneeAddress, lwug.position_code positionCode, lwga.column_num columnNum, - lwga.layer_num layerNum + lwga.layer_num layerNum, + lwtg.create_time operateTime, + lwtg.create_user operateUser FROM logpm_warehouse_tray_goods lwtg JOIN logpm_distribution_stock_article ldsa ON lwtg.association_id = ldsa.id @@ -309,7 +316,7 @@ ldsl.cargo_number cargoNumber, ldsl.cargo_unit cargoUnit, ldsl.cargo_norms cargoNorms, - ldsl.shopping_mall shoppingMall, + ldsl.market_name marketName, ldsl.warehouse_name warehouseName, lwug.position_code positionCode, lwga.column_num columnNum, @@ -324,8 +331,8 @@ lwtgl.num num FROM logpm_warehouse_tray_goods_log lwtgl - JOIN logpm_distribution_stock_list ldsl ON lwtgl.association_id = ldsl.id - left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.id + JOIN logpm_distribution_stock_list ldsl ON lwtgl.association_id = ldsl.material_id + left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.material_id ldsl.is_deleted = 0 and lwtgl.is_deleted = 0 and lwtgl.association_type = 4 and lwtgl.tray_id = #{param.id} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java index 45cbfbdfd..68bfe59bc 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java @@ -213,8 +213,7 @@ public class WarehouseGoodsAllocationController extends BladeController { R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -247,8 +246,7 @@ public class WarehouseGoodsAllocationController extends BladeController { } R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -273,8 +271,7 @@ public class WarehouseGoodsAllocationController extends BladeController { R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -298,8 +295,7 @@ public class WarehouseGoodsAllocationController extends BladeController { //上架托盘 R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -324,8 +320,7 @@ public class WarehouseGoodsAllocationController extends BladeController { //查询该库位的货物信息 R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; @@ -351,8 +346,7 @@ public class WarehouseGoodsAllocationController extends BladeController { //查询该库位的货物信息 R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -370,7 +364,7 @@ public class WarehouseGoodsAllocationController extends BladeController { return R.data(bladeRedis.get(Url + "/" + warehouseGoodsAllocation.getGoodsShelfId())); } List pages = warehouseGoodsAllocationService.selectVisualization(warehouseGoodsAllocation); - bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocation.getGoodsShelfId(), pages, 300L); + bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocation.getGoodsShelfId(), pages, 600L); return R.data(pages); } @@ -402,7 +396,7 @@ public class WarehouseGoodsAllocationController extends BladeController { return R.data(bladeRedis.get(Url + "_cargoNub")); } List list = warehouseGoodsAllocationService.selectcargoNub(); - bladeRedis.setEx(Url + "_cargoNub", list, 360L); + bladeRedis.setEx(Url + "_cargoNub", list, 600L); return R.data(list); } @@ -637,6 +631,19 @@ public class WarehouseGoodsAllocationController extends BladeController { } + /** + * 货位 更新货位缓存 + */ + @GetMapping("/updateAllocationCache") + @ApiOperationSupport(order = 32) + @ApiOperation(value = "更新货位缓存", notes = "传入货位ids") + public R updateAllocationCache(String ids) { + log.info("更新货位缓存>>>>>>{}",ids); + Boolean b = warehouseGoodsAllocationService.updateAllocationCache(ids); + return R.status(b); + } + + /** * 导出数据 */ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java index 419f7441c..e65dcfad7 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java @@ -50,4 +50,10 @@ public class WarehouseGoodsAllocationClient implements IWarehouseGoodsAllocation return BladePage.of(page); } + @Override + @GetMapping(TOP+ "/updateAllocationCache") + public Boolean updateAllocationCache(String ids) { + return warehouseGoodsAllocationService.updateAllocationCache(ids); + } + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java index 62f7ab32a..1796d5760 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java @@ -23,6 +23,7 @@ import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity; import com.logpm.warehouse.excel.WarehouseGoodsAllocationExcel; import com.logpm.warehouse.vo.*; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.tool.api.R; import java.util.List; @@ -110,4 +111,8 @@ public interface IWarehouseGoodsAllocationService extends BaseService selectcargoNub(); + /** + * 更新货位 缓存 + */ + Boolean updateAllocationCache(String ids); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java index 1bdb598ed..0f529aa04 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java @@ -38,6 +38,8 @@ import com.logpm.warehouse.vo.*; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.redis.cache.BladeRedis; +import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; @@ -56,12 +58,16 @@ import java.util.stream.Collectors; @AllArgsConstructor public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl implements IWarehouseGoodsAllocationService { - private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService; private final IBasicdataWarehouseClient basicdataWarehouseClient; + private final IWarehouseTrayGoodsService warehouseTrayGoodsService; + private final BladeRedis bladeRedis; + + private static String Url = "warehouseGoodsAllocation"; + @Override public IPage selectWarehouseGoodsAllocationPage(IPage page, WarehouseGoodsAllocationVO warehouseGoodsAllocation) { @@ -100,21 +106,8 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl()); // } - WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = new WarehouseGoodsAllocationVO(); - Func.copy(warehouseGoodsAllocationEntity,warehouseGoodsAllocationVO); - //查询数量 - WarehouseGoodsAllocationVO warehouseGoodsAllocationVOData = baseMapper.selectnum(warehouseGoodsAllocationEntity.getId()); - warehouseGoodsAllocationVO.setOrderNum(warehouseGoodsAllocationVOData.getOrderNum()); - warehouseGoodsAllocationVO.setInventoryNum(warehouseGoodsAllocationVOData.getInventoryNum()); - warehouseGoodsAllocationVO.setLessNum(warehouseGoodsAllocationVOData.getLessNum()); - warehouseGoodsAllocationVO.setPackageNum(warehouseGoodsAllocationVOData.getPackageNum()); - //查询包条信息 - List list = baseMapper.selectServe(warehouseGoodsAllocationVO.getId()); - warehouseGoodsAllocationVO.setServeNub(list); - //查询库存品 - ListlistCopyVOS =baseMapper.selectStockList(warehouseGoodsAllocationVO.getId()); - warehouseGoodsAllocationVO.setInventoryName(listCopyVOS); - // map.get(layerNum).add(warehouseGoodsAllocationVO); + WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity); + // map.get(layerNum).add(warehouseGoodsAllocationVO); warehouseGoodsAllocationVOS.add(warehouseGoodsAllocationVO); } // ArrayList> arrayListTwo = new ArrayList<>(map.values()); @@ -357,6 +350,31 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl warehouseGoodsAllocationEntities = baseMapper.selectList(new QueryWrapper().lambda() + .eq(WarehouseGoodsAllocationEntity::getIsDeleted,0) + .in(WarehouseGoodsAllocationEntity::getId,ids) + ); + for (WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity : warehouseGoodsAllocationEntities) { + if (null != bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId())) { + //转换当前货位的信息 + WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity); + List warehouseGoodsAllocationVOList = bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId()); + //替换货位 + warehouseGoodsAllocationVOList = warehouseGoodsAllocationVOList.stream() + .map(obj -> obj.getId().equals(warehouseGoodsAllocationVO.getId()) ? warehouseGoodsAllocationVO : obj) + .collect(Collectors.toList()); + //重新存入缓存 + bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocationEntity.getGoodsShelfId(), warehouseGoodsAllocationVOList, 600L); + log.info("货位缓存更新成功"); + } + } + return true; + } + public List getMyWatchWarehouseIds(){ //获取当前登录人仓库 List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); @@ -366,4 +384,22 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl list = baseMapper.selectServe(warehouseGoodsAllocationVO.getId()); + warehouseGoodsAllocationVO.setServeNub(list); + //查询库存品 + ListlistCopyVOS =baseMapper.selectStockList(warehouseGoodsAllocationVO.getId()); + warehouseGoodsAllocationVO.setInventoryName(listCopyVOS); + return warehouseGoodsAllocationVO; + } + } From cd7b2b268437cabdb1bd3098e66c7fb9b89e2c2d Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Fri, 15 Sep 2023 19:51:23 +0800 Subject: [PATCH 02/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E8=B4=A7=20?= =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=BA=93=E4=BD=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/DistributionStockupOrderListVO.java | 2 + .../DistributionStockupAppController.java | 4 +- .../mapper/DistributionParcelListMapper.java | 3 +- .../mapper/DistributionParcelListMapper.xml | 4 +- .../mapper/DistributionReservationMapper.xml | 17 +- .../mapper/DistributionSignforMapper.xml | 10 +- .../mapper/DistrilbutionBillStockMapper.java | 5 +- .../mapper/DistrilbutionBillStockMapper.xml | 42 ++++- .../IDistributionParcelListService.java | 10 +- .../IDistrilbutionBillStockService.java | 10 +- .../DistributionParcelListServiceImpl.java | 12 +- .../impl/DistributionStockupServiceImpl.java | 145 +++++++++++++----- .../DistrilbutionBillStockServiceImpl.java | 15 +- 13 files changed, 196 insertions(+), 83 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java index 77eb9328d..dde1899af 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java @@ -34,6 +34,8 @@ public class DistributionStockupOrderListVO implements Serializable { private Long areaId; //货区id private Long trayId; //托盘id private Long shelfId; //货架id + private Long parcelListId; //包件id + private Long stockId; //备货id private Long allocationId; //货位id } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index adfc722dc..eb6c5d157 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -247,9 +247,6 @@ public class DistributionStockupAppController extends BladeController { @ApiOperation(value = "客户订单列表", notes = "传入stockupDTO") public R orderInfo(@RequestBody StockupDTO stockupDTO) { log.info("##############orderInfo: {}", stockupDTO); -// Long reservationId = 1694647731085103105L;//预约单id -// Long stockArticleId = 1686560469463760898L;//订单id -// Long stockupId = 1694647730430791682L;//备货任务Id Long reservationId = stockupDTO.getReservationId();//预约单id Long stockArticleId = stockupDTO.getStockArticleId();//订单id Long stockupId = stockupDTO.getStockupId();//备货任务Id @@ -465,6 +462,7 @@ public class DistributionStockupAppController extends BladeController { String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); //查询是否货位数据是否该下架 + distributionAsyncService.stockupSelfOffShelf(stockupDTO); return Resp.scanSuccess("扫描成功!", audioValue); case 2: diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index a3f9cdbfc..3afb48544 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -20,6 +20,7 @@ import com.logpm.distribution.dto.DistributionParcelListDTO; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.vo.DistributionParcelListBaseVO; @@ -88,7 +89,7 @@ public interface DistributionParcelListMapper extends BaseMapper selectOrderInfoSelfList(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId, @Param("stockArticleId")Long stockArticleId); + List selectOrderInfoSelfList(@Param("param") StockupDTO stockupDTO); List findALLNoUpShelfPackageByOrderCode(@Param("orderCode") String orderCode,@Param("orderCode") Long warehouseId); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index a7d0b1ea4..95090fa27 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -145,8 +145,10 @@ ) positionCode from logpm_distribution_parcel_list ldpl LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id + LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id - ldpl.stock_article_id = #{stockArticleId} + ldpl.stock_article_id = #{param.stockArticleId} + and lwug.allocation_id = #{param.allocationId} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 298775e06..c7e943d81 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -216,12 +216,21 @@ where ldrs.reservation_id = ldrp.reservation_id and ldrs.stock_article_id = ldpl.stock_article_id and wug.allocation_id = lwug.allocation_id ) END planNum, + CASE WHEN lwug.allocation_id is null THEN ( + select COUNT(ldplw.id) - COUNT(lwu.id) + from logpm_distribution_parcel_list ldplw + LEFT JOIN logpm_warehouse_updown_goods lwu on ldplw.id = lwu.association_id and lwu.association_type = '3' + LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = lwu.association_id + + where ldplw.stock_article_id = ldpl.stock_article_id + ) ELSE ( select COUNT(lds.id) - from logpm_distribution_reservation_package drp - LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = drp.parce_list_id - where drp.reservation_id = ldrp.reservation_id and drp.packet_bar_status in (1,3) and drp.stock_article_id = ldpl.stock_article_id - ) scanNum + from logpm_distribution_parcel_list ldplw + LEFT JOIN logpm_warehouse_updown_goods lwu on ldplw.id = lwu.association_id and lwu.association_type = '3' + LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = lwu.association_id + where ldplw.stock_article_id = ldpl.stock_article_id and lwu.allocation_id = lwug.allocation_id + ) END scanNum from logpm_distribution_reservation_package ldrp LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id LEFT JOIN logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 3ae58665e..3751c6496 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -659,11 +659,17 @@ lddl.id = ldl.delivery_id and ldl.signfor_state =2) ) signNubSr, ( select GROUP_CONCAT(ldr.consignee) from logpm_distribution_reservation ldr where ldr.id in (select lds.reservation_id from logpm_distribution_signfor lds where lds.delivery_id = lddl.id ) - ) consignee + ) consignee, + ( + select sum(reservation_num ) + from logpm_distribution_reservation_stocklist + where reservation_id = ldsf.reservation_id + ) inventoryNub FROM logpm_distribution_delivery_list lddl left join logpm_distribution_delivery_self ldds on lddl.id =ldds.delivery_id - left join logpm_distribution_reservation ldr on ldr.id = lddl.reservation_id + left join logpm_distribution_signfor ldsf on ldsf.delivery_id = lddl.id + lddl.is_deleted =0 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java index a13ca7c26..556856e99 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java @@ -19,6 +19,7 @@ package com.logpm.distribution.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistrilbutionBillStockEntity; import com.logpm.distribution.excel.DistrilbutionBillStockExcel; import com.logpm.distribution.vo.*; @@ -58,7 +59,9 @@ public interface DistrilbutionBillStockMapper extends BaseMapper selectDistrilbutionBillSelf(@Param("reservationId")Long reservationId); - DistributionStockupSelfVO selectDistrilbutionBillPackSelf(@Param("reservationId")Long reservationId,@Param("stockupId") Long stockupId,@Param("allocationId") Long allocationId); + DistributionStockupSelfVO selectDistrilbutionBillPackSelf(@Param("param") StockupDTO stockupDTO); DistributionStockupSelfVO selectDistrilbutionBillPackWuSelf(@Param("reservationId")Long reservationId,@Param("stockupId") Long stockupId); + + DistributionStockupSelfVO selectDistrilbutionBillOverPackWuSelf(@Param("param")StockupDTO stockupDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml index 2154ba222..1cea2bb45 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml @@ -17,7 +17,7 @@ FROM logpm_distribution_parcel_list lpl LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = lpl.id where - lpl.stock_article_id = ldbs.stock_article_id and lwug.allocation_id = #{allocationId} + lpl.stock_article_id = ldbs.stock_article_id and lwug.allocation_id = #{param.allocationId} ) planNum ,( SELECT COUNT(lt.id) FROM logpm_distribution_stock lt @@ -38,17 +38,38 @@ SELECT GROUP_CONCAT( DISTINCT lwug.allocation_title SEPARATOR ',') FROM logpm_distribution_parcel_list lp LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = lp.id and lwug.association_type = 3 - where lp.stock_article_id = ldbs.stock_article_id + where lp.stock_article_id = ldbs.stock_article_id and lwug.allocation_id = #{param.allocationId} ) warehouseArea from logpm_distribution_stockup_info ldsi LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id - - ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId} + ldsi.stockup_id = #{param.stockupId} and ldsi.reservation_id = #{param.reservationId} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index e33128cfa..b84d74d3d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -18,6 +18,7 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.vo.DistributionParcelListBaseVO; @@ -91,13 +92,10 @@ public interface IDistributionParcelListService extends BaseService selectOrderInfoSelfList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId); + List selectOrderInfoSelfList(StockupDTO stockupDTO); List findALLNoUpShelfPackageByOrderCode(String orderCode,Long warehouseId); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java index 4d11c6702..4754c6672 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java @@ -18,6 +18,7 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistrilbutionBillStockEntity; import com.logpm.distribution.excel.DistrilbutionBillStockExcel; import com.logpm.distribution.vo.*; @@ -67,12 +68,11 @@ public interface IDistrilbutionBillStockService extends BaseService selectOrderInfoSelfList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId) { - return baseMapper.selectOrderInfoSelfList(reservationId,stockupId,stockArticleId); + public List selectOrderInfoSelfList(StockupDTO stockupDTO) { + return baseMapper.selectOrderInfoSelfList(stockupDTO); } @Override diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 107c2f4bd..d5964ea47 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -39,12 +39,10 @@ import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsLogEntity; import com.logpm.warehouse.feign.IWarehouseTaryAllocationClient; import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient; -import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient; import lombok.AllArgsConstructor; import org.springblade.common.constant.CodeDesEnum; import org.springblade.common.constant.DictBizConstant; -import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; import org.springblade.common.constant.stocklist.StockLockingStatusConstant; import org.springblade.common.constant.stocklist.StockSignfoStatusConstant; @@ -64,9 +62,13 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.xml.ws.BindingType; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; /** * 备货信息表 服务实现类 @@ -479,6 +481,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl Predicate distinctByKey(Function keyExtractor){ + Map map=new ConcurrentHashMap<>(); + return t -> map.putIfAbsent(keyExtractor.apply(t),Boolean.TRUE)==null; + } @Override public List selectStockupOrderList(StockupDTO stockupDTO) { @@ -486,40 +492,91 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distrilbutionBillStockService.selectDistrilbutionBillSelf(reservationId); - //查询包件的库位的 - if(!list.isEmpty()){ - list.forEach( i ->{ - if(ObjectUtils.isNull(i.getAllocationId())){ - //查询包件信息 - List list1 = distributionParcelListService.list(Wrappers.query().lambda() - .eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId()) - ); - if(!list1.isEmpty()){ - list1.forEach( a ->{ - WarehouseUpdownGoodsLogEntity updownGoodsLog = new WarehouseUpdownGoodsLogEntity(); - updownGoodsLog.setAssociationType("3"); - updownGoodsLog.setAssociationId(a.getId()); - updownGoodsLog.setBindingType("2"); //下架 - BasicdataWarehouseEntity my = basicdataWarehouseClient.getMyCurrentWarehouse(); - updownGoodsLog.setWarehouseId(my.getId()); - WarehouseUpdownGoodsLogEntity updownGoods = warehouseUpdownGoodsLogClient.getUpdownGoods(updownGoodsLog); - if(ObjectUtils.isNotNull(updownGoods)){ - i.setAllocation(updownGoods.getPositionCode()); - i.setAllocationId(updownGoods.getAllocationId()); - i.setCompleteStact(true); + //获取有货位的数据 + List collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); + Set listYou = new HashSet<>(); + collect11.forEach( i -> { + if(listYou.size() > 0){ + boolean b = listYou.stream().anyMatch(o -> o.getAllocationId().equals(i.getAllocationId())); + if(b){ + listYou.forEach( y -> { + if(y.getAllocationId().equals(i.getAllocationId())){ + //相同 + y.setPlanNum(y.getPlanNum()+1); + if(ObjectUtils.isNotNull(i.getStockId())){ + y.setScanNum(y.getScanNum()+1); } - }); - + //t托盘信息 + if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(i.getTrayId())){ + y.setPallet(y.getPallet()+","+i.getPallet()); + } + } + } ); + }else{ + i.setPlanNum(1); + if(ObjectUtils.isNotNull(i.getStockId())){ + i.setScanNum(1); + }else{ + i.setScanNum(0); } + listYou.add(i); + } + }else{ + i.setPlanNum(1); + if(ObjectUtils.isNotNull(i.getStockId())){ + i.setScanNum(1); + }else{ + i.setScanNum(0); + } + listYou.add(i); + } + } ); + //获取没有货位的数据 + List collect22 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); + if(!collect22.isEmpty()){ + collect22.forEach( i -> { + boolean b = listYou.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getAllocationId())); + if(b){ + listYou.forEach( wu -> { + if(ObjectUtils.isNull(wu.getAllocationId())){ + //相同 + wu.setPlanNum(wu.getPlanNum()+1); + if(ObjectUtils.isNotNull(i.getStockId())){ + wu.setScanNum(wu.getScanNum()+1); + } + //托盘信息 + if(ObjectUtils.isNotNull(wu.getTrayId()) && wu.getTrayId().equals(i.getTrayId())){ + wu.setPallet(wu.getPallet()+","+i.getPallet()); + } + if(wu.getPlanNum().equals(wu.getScanNum())){ + wu.setCompleteStact(true); + } + } + }); + }else{ + i.setPlanNum(1); + if(ObjectUtils.isNotNull(i.getStockId())){ + i.setScanNum(1); + }else{ + i.setScanNum(0); + } + listYou.add(i); } }); } - return list; +// List collect = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());//不为空 +// List collect2 = collect.stream().filter(distinctByKey(person -> person.getAllocationId())).collect(Collectors.toList()); //去重 +// List collect1 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());//为空 + //查询包件的库位的 + return new ArrayList<>(listYou); } else { //商 市 //1.根据预约单id 查询到对应的数据 List list = distributionReservationService.selectStockupOrderList(reservationId); +// list.forEach( p ->{ +// +// }); return list; } @@ -649,7 +706,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.list(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getStockArticleId, stockupDTO.getStockArticleId()) ); @@ -658,20 +718,23 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl{ WarehouseUpdownGoodsLogEntity updownGoodsLogEntity = new WarehouseUpdownGoodsLogEntity(); updownGoodsLogEntity.setAssociationType("3"); - updownGoodsLogEntity.setAssociationId(stockupDTO.getAllocationId()); + updownGoodsLogEntity.setAssociationId(i.getId()); + updownGoodsLogEntity.setAllocationId(stockupDTO.getAllocationId()); updownGoodsLogEntity.setBindingType("2"); updownGoodsLogEntity.setWarehouseId(myCurrentWarehouse.getId()); - updownGoodsLogEntity.setAllocationId(i.getId()); +// updownGoodsLogEntity.setAllocationId(i.getId()); WarehouseUpdownGoodsLogEntity updownGoods = warehouseUpdownGoodsLogClient.getUpdownGoods(updownGoodsLogEntity); - PackageStockupVO packageStockupVO = new PackageStockupVO(); - packageStockupVO.setOrderCode(i.getOrderCode()); - packageStockupVO.setPackageBarCode(i.getOrderPackageCode()); - packageStockupVO.setGoodsType(1); - packageStockupVO.setGoodsTypeStr("定制品"); - packageStockupVO.setMaterialName(i.getMaterialName()); - packageStockupVO.setIsScanStr("已备货"); - packageStockupVO.setIsScan(2); - listPack.add(packageStockupVO); + if(ObjectUtils.isNotNull(updownGoods)){ + PackageStockupVO packageStockupVO = new PackageStockupVO(); + packageStockupVO.setOrderCode(i.getOrderCode()); + packageStockupVO.setPackageBarCode(i.getOrderPackageCode()); + packageStockupVO.setGoodsType(1); + packageStockupVO.setGoodsTypeStr("定制品"); + packageStockupVO.setMaterialName(i.getMaterialName()); + packageStockupVO.setIsScanStr("已备货"); + packageStockupVO.setIsScan(2); + listPack.add(packageStockupVO); + } }); DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO(); vo.setReservationId(stockupDTO.getReservationId()); //预约id @@ -690,13 +753,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId()); + List list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO); Iterator iterator = list.iterator(); if(Objects.isNull(stockupDTO.getAllocationId())){ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java index 5fe91f481..9fc353d58 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java @@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistrilbutionBillStockEntity; import com.logpm.distribution.excel.DistrilbutionBillStockExcel; import com.logpm.distribution.mapper.DistrilbutionBillStockMapper; @@ -88,14 +89,11 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl Date: Fri, 15 Sep 2023 20:30:29 +0800 Subject: [PATCH 03/30] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/DistributionDeliveryInfoVO.java | 43 +++++ .../DistributionReservationStocklistVO.java | 5 + blade-service/logpm-distribution/pom.xml | 1 + .../DistributionStockArticleController.java | 3 - .../mapper/DistributionDeliveryInfoMapper.xml | 18 +++ .../mapper/DistributionParcelListMapper.xml | 2 +- .../mapper/DistributionReservationMapper.java | 9 +- .../mapper/DistributionReservationMapper.xml | 46 ++++++ .../DistributionDeliveryListServiceImpl.java | 148 ++++++++++-------- .../DistributionReservationServiceImpl.java | 82 ++++++---- .../impl/DistributionSignforServiceImpl.java | 60 +++---- 11 files changed, 285 insertions(+), 132 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java index c542c3222..97353ad13 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java @@ -280,6 +280,49 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { */ @ApiModelProperty(value = "预约签收状态") private String reservationSigningStatus; + + /** + * 预约备货状态 + */ + @ApiModelProperty(value = "预约备货状态") + private String assignStatus; + + /** + * 预约备货区 + */ + @ApiModelProperty(value = "预约签收状态") + private String stockupArea; + + + /** + * 备货时间 + */ + @ApiModelProperty(value = "预约签收状态") + private Date stockupDate; + + /** + * 出库时间 + */ + @ApiModelProperty(value = "预约签收状态") + private Date outboundDate; + + /** + * 备货人 + */ + @ApiModelProperty(value = "预约签收状态") + private String forkliftName; + + /** + * 备货状态 + */ + @ApiModelProperty(value = "备货状态") + private String stockupStatusName; + + /** + * 指派状态 + */ + @ApiModelProperty(value = "指派状态") + private String assignStatusName; // /** // * 配送方式 // */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java index e913898f2..f0ba31fe4 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java @@ -46,6 +46,11 @@ public class DistributionReservationStocklistVO extends DistributionReservationS */ @ApiModelProperty(value = "货物名称") private String descriptionGoods; + /** + * 物料编号 + */ + @ApiModelProperty(value = "物料编号") + private String cargoNumber; /** /** diff --git a/blade-service/logpm-distribution/pom.xml b/blade-service/logpm-distribution/pom.xml index 2bae384d8..4ac90fb83 100644 --- a/blade-service/logpm-distribution/pom.xml +++ b/blade-service/logpm-distribution/pom.xml @@ -100,6 +100,7 @@ + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index fb3ec8182..5c3bb3773 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -124,9 +124,6 @@ public class DistributionStockArticleController extends BladeController { @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入distributionStockArticle") public R> selectStockArticleInfoList(@ApiIgnore @RequestParam Map distributionStockArticle, Query query) { - - - R r = distributionStockArticleService.selectStockArticleInfoList(distributionStockArticle,query); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index f7a5f00b5..813743307 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -88,6 +88,22 @@ lds.loadedin_number inventoryNub, lds.reservation_id reservationId, lds.received_quantity receivedQuantity, + ldss.assign_status assignStatus, + ldss.stockup_area stockupArea, + ldss.stockup_date stockupDate, + ldss.outbound_date outboundDate, + ldss.forklift_name forkliftName, + ldss.stockup_status stockupStatus, + CASE + WHEN ldss.stockup_status ='10' THEN '待分配' + WHEN ldss.stockup_status ='20' THEN '待备货' + WHEN ldss.stockup_status ='30' THEN '备货中' + WHEN ldss.stockup_status ='40' THEN '已完成' + END stockupStatusName, + CASE + WHEN ldss.assign_status ='10' THEN '未指派' + WHEN ldss.assign_status ='20' THEN '已指派' + END assignStatusName, CASE WHEN ldr.is_urgent ='1' THEN '否' else '是' @@ -103,6 +119,8 @@ FROM logpm_distribution_signfor lds JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id + JOIN logpm_distribution_stockup_info AS ldsi ON ldr.id = ldsi.reservation_id + JOIN logpm_distribution_stockup AS ldss ON ldsi.stockup_id = ldss.id lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 95090fa27..fed18126c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -443,7 +443,7 @@ LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3 LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3 WHERE - ldpl.stock_article_id = #{stockArticleId} and ldpl.order_package_reservation_status in ('10','20') + ldpl.stock_article_id = #{stockArticleId} and ldpl.order_package_reservation_status in ('10','20') and ldpl.order_package_reservation_status = '10' diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java index aca07f51d..3fad5ccc7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java @@ -197,10 +197,17 @@ public interface DistributionReservationMapper extends BaseMapper selectStockupList(@Param("reservationIds")List ids); + /** * 根基配送ID 查询预约单信息 * @param id * @return */ - List findByDeliveryId(@Param("id")Long id); + List findByDeliveryId(@Param("id")Long id); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index c7e943d81..be33d7d96 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -885,6 +885,52 @@ WHERE ldsi.reservation_id = #{reservationId} + @@ -329,9 +329,18 @@ select ldsl.* from logpm_distribution_stock_list ldsl where ldsl.is_deleted = 0 - and ldsl.description_goods = #{materialName} + and ldsl.description_goods like concat('%',#{materialName},'%') and ldsl.market_id = #{marketId} and ldsl.warehouse_id = #{warehouseId} + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java index de1503028..d4226fef0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java @@ -130,6 +130,9 @@ public interface IDistributionStockListService extends BaseService getListByMarketIdAndMaterialName(Long marketId, String materialName, Long warehouseId); + + // /** // * 查询库存品详情 // * @param params 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 2ca99814a..108bab274 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 @@ -781,7 +781,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_code",orderCode) + queryWrapper.like("order_code",orderCode) .eq("warehouse_id",warehouseId) .eq("is_zero",1) .eq("is_deleted",0); @@ -791,7 +791,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl findListByWaybillNumberAndWarehouseId(String waybillNumber, Long warehouseId) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("waybill_number",waybillNumber) + queryWrapper.like("waybill_number",waybillNumber) .eq("warehouse_id",warehouseId) .eq("is_zero",1) .eq("is_deleted",0); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index 84f27d9b9..b89dfeb48 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -383,6 +383,11 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl getListByMarketIdAndMaterialName(Long marketId, String materialName, Long warehouseId) { + return baseMapper.getListByMarketIdAndMaterialName(marketId,materialName,warehouseId); + } + // @Override // public R selectInventoryDetail(Map params, IPage page) { // String reservationId = (String) params.get("reservationId"); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java index 2ba459f8a..1825d8017 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java @@ -793,6 +793,42 @@ public class WarehouseTrayTypeApiController { } } + @ResponseBody + @PostMapping("/selectStockByMaterialNameAndMarketId") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查询库存品", notes = "传入trayTypeDTO") + public R selectStockByMaterialNameAndMarketId(@RequestBody TrayTypeDTO trayTypeDTO) { + String method = "###########selectStockByMaterialNameAndMarketId: "; + log.info(method + "查询库存品 trayTypeDTO={}", trayTypeDTO); + Long marketId = trayTypeDTO.getMarketId(); +// String materialCode = trayTypeDTO.getMaterialCode(); + String materialName = trayTypeDTO.getMaterialName(); + try{ + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息不能为空"); + return R.fail(403,"仓库信息不能为空"); + } + + + if(Objects.isNull(marketId)){ + log.warn(method+"商场id不能为空 marketId={}",marketId); + return R.fail(403,"商场id不能为空"); + } + if(!StringUtil.hasLength(materialName)){ + log.warn(method+"物料名称不能为空 materialCode={}",materialName); + return R.fail(403,"物料名称不能为空"); + } + return warehouseTrayTypeService.selectStockByMaterialNameAndMarketId(marketId,materialName,myCurrentWarehouse.getId()); + }catch (CustomerException e){ + log.warn(e.message); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常,联系管理员",e); + return R.fail(500,"系统异常,联系管理员"); + } + } + @ResponseBody @PostMapping("/enterStockNoDataMaterialCode") @@ -834,6 +870,10 @@ public class WarehouseTrayTypeApiController { log.warn(method+"商场id不能为空 marketId={}",marketId); return R.fail(403,"商场id不能为空"); } + if(Objects.isNull(num)||num == 0){ + log.warn(method+"数量不正确 num={}",num); + return R.fail(403,"数量不正确"); + } return warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,materialCode,marketId,num,incomingBatch,myCurrentWarehouse.getId()); }catch (CustomerException e){ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java index 6c7b85cd6..15da3f385 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java @@ -304,6 +304,14 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + for (UpShelfZeroOrderDTO dto:upShelfZeroOrderList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + if(Objects.isNull(allocationId)){ log.warn(method+"库位信息不能为空 allocationId={}",allocationId); return R.fail(403,"库位信息不能为空"); @@ -384,6 +392,15 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + + for (UpShelfStockDTO dto:upShelfStockList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + if(Objects.isNull(allocationId)){ log.warn(method+"库位信息不能为空 allocationId={}",allocationId); return R.fail(403,"库位信息不能为空"); @@ -511,6 +528,14 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + for (UpShelfZeroOrderDTO dto:upShelfZeroOrderList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + //查询该库位的货物信息 return warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList); }catch (CustomerException e){ @@ -577,6 +602,15 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + + for (UpShelfStockDTO dto:upShelfStockList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + //查询该库位的货物信息 return warehouseUpdownTypeService.downStock(upShelfStockList); }catch (CustomerException e){ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java index bcad31b09..f431b3ed5 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java @@ -44,6 +44,7 @@ public class TrayTypeDTO implements Serializable { private String warehouseCode;//仓库编码 private String materialCode;//物料编码 + private String materialName;//物料名称 private Long marketId;//商场id private String incomingBatch;//批次号 diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml index 0103f6792..2c7d0e9e9 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml @@ -235,7 +235,7 @@ select lwug.* from logpm_warehouse_updown_goods lwug left join logpm_distribution_stock_list ldsl on ldsl.market_id = lwug.market_id and ldsl.incoming_batch = lwug.incoming_batch and ldsl.material_id = lwug.association_id and lwug.is_deleted = 0 - where ldsl.description_goods = #{materialName} + where ldsl.description_goods like concat('%',#{materialName},'%') and ldsl.market_id = #{marketId} @@ -244,7 +244,7 @@ ldsa.waybill_number waybillNumber from logpm_warehouse_updown_goods lwug left join logpm_distribution_stock_article ldsa on ldsa.order_code = lwug.association_value and ldsa.is_deleted = 0 - where lwug.association_value = #{orderCode} + where lwug.association_value like concat('%',#{orderCode},'%') and ldsa.warehouse_id = #{warehouseId} @@ -253,7 +253,7 @@ ldsa.waybill_number waybillNumber from logpm_warehouse_updown_goods lwug left join logpm_distribution_stock_article ldsa on ldsa.order_code = lwug.association_value and ldsa.is_deleted = 0 - where ldsa.waybill_number = #{waybillNumber} + where ldsa.waybill_number like concat('%',#{waybillNumber},'%') and ldsa.warehouse_id = #{warehouseId} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml index d77e49548..a051f1bf8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml @@ -32,10 +32,10 @@ - DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId} + DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId} - DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} + DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} + + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index 683050b89..23c790824 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -226,4 +226,6 @@ public interface IDistributionDeliveryListService extends BaseService printBatch(String ids,Integer type) throws Exception; + + void testData(String s) throws Exception; } 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 e3a1c2263..da02acd8c 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 @@ -17,6 +17,8 @@ package com.logpm.distribution.service.impl; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -24,12 +26,13 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.feign.IBasicPrintTemplateClient; import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataCarrierClient; import com.logpm.basicdata.feign.IBasicdataDriverArteryClient; +import com.logpm.basicdata.feign.IBasicdataVehicleClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.bean.Resp; import com.logpm.distribution.dto.*; @@ -88,6 +91,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -141,6 +145,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListDTO distributionDeliveryList) { @@ -3196,17 +3202,168 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl handleShangPeiData(Long templateId, String[] idArray,String html) throws Exception { + List result = new ArrayList<>(); + List> test = new ArrayList<>(); + for (String id : idArray) { + + //查询对应配送单 + DistributionDeliveryListEntity deliveryListEntity = baseMapper.selectById(id);//配送单 + if(Objects.isNull(deliveryListEntity)){ + log.warn("#########handleShangPeiData: 配送单信息不存在 deliveryListEntityId={}",id); + throw new CustomerException(403,"配送单信息不存在"); + } + Long deliveryListEntityId = deliveryListEntity.getId(); + String taskTime = deliveryListEntity.getTaskTime();//配送时间 + String kind = deliveryListEntity.getKind(); + String dirverName = ""; + String dirverPhone = ""; + String carNumber = ""; + + if("1".equals(kind)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("delivery_id",deliveryListEntityId); + DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliverySelfService.getOne(queryWrapper); + dirverName = deliverySelfEntity.getDriverName(); + dirverPhone = deliverySelfEntity.getDriverPhone(); + carNumber = deliverySelfEntity.getVehicleNub(); + }else if("2".equals(kind)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("delivery_id",deliveryListEntityId); + DistributionDeliveryTripartiteEntity deliveryTripartiteEntity = distributionDeliveryTripartiteService.getOne(queryWrapper); + dirverName = deliveryTripartiteEntity.getDriverName(); + dirverPhone = deliveryTripartiteEntity.getDriverPhone(); + carNumber = deliveryTripartiteEntity.getVehicleNum(); + } + + List distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(deliveryListEntityId); + //循环查询出来的预约单 + for (DistributionReservationEntity reservationEntity:distributionReservationEntityList){ + Map map = new HashMap<>(); + map.put("配送单号", reservationEntity.getReservationCode()); + String fileTypeName = QRCodeUtil.createCodeToFile(reservationEntity.getReservationCode()); + map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName)); + map.put("收货单单位",reservationEntity.getReceivingUnit());//收货单单位 + map.put("商场名称",reservationEntity.getStoreName());//商场名称 + map.put("收货人",reservationEntity.getConsignee());//收货人 + map.put("收货人电话",reservationEntity.getDeliveryPhone());//收货人电话 + map.put("收货人地址",reservationEntity.getDeliveryAddress());//收货人地址 + map.put("配送时间",taskTime);//配送时间 + map.put("承运商",deliveryListEntity.getDistributionCompany()); + map.put("配送仓库",deliveryListEntity.getWarehouseName()); + map.put("出库时间",deliveryListEntity.getWarehouseName()); + map.put("送货司机",dirverName+"/"+dirverPhone); + map.put("车牌号",carNumber); + + Long reservationId = reservationEntity.getId();//预约id + //通过预约id查询所有包件并按三级品类分组 + List> categoryList = distributionReservationMapper.findAllCategoryNum(reservationId); + //计算一个总计 + Map total = new HashMap<>(); + Integer totalNum = 0; + for (Map m:categoryList){ + Set set = m.keySet(); + String categoryName = ""; + Long num = 0L; + for (String s:set){ + if("num".equals(s)){ + num = (Long)m.get(s); + totalNum = totalNum + num.intValue(); + }else{ + categoryName = (String)m.get(s); + } + } + total.put(categoryName,num); + } + total.put("合计件数",totalNum); + + + + //先查询预约单对应有哪些订单 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("reservation_id",reservationId); + List reservationStockarticleList = distributionReservationStockarticleService.list(queryWrapper); + List> ls = new ArrayList<>(); + BigDecimal totalPrice = BigDecimal.ZERO; + for (int i = 0; i < reservationStockarticleList.size(); i++) { + DistributionReservationStockarticleEntity reservationStockarticleEntity = reservationStockarticleList.get(i); + Long stockArticleId = reservationStockarticleEntity.getStockArticleId();//订单id + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(stockArticleId); + if(Objects.isNull(stockArticleEntity)){ + log.warn("#########handleShangPeiData: 订单信息不存在 stockArticleId={}",stockArticleId); + throw new CustomerException(403,"订单信息不存在"); + } + Map orderMap = new HashMap<>(); + orderMap.put("序号",i+1); + orderMap.put("运单号",stockArticleEntity.getWaybillNumber()); + orderMap.put("合同号",stockArticleEntity.getOrderCode()); + + //通过订单id和预约id查询对应包件的库位信息 + List allocationStrList = distributionReservationMapper.getAllocationByStockArticleIdAndReservationId(stockArticleId,reservationId); + String allocationStr = StringUtils.join(allocationStrList, ","); + orderMap.put("货位",allocationStr); + //通过订单id和预约id查询对应包件的备货区信息 + List stockupAreaStrList = distributionReservationMapper.getStockupAreaByStockArticleIdAndReservationId(stockArticleId,reservationId); + String stockupAreaStr = StringUtils.join(stockupAreaStrList, ","); + orderMap.put("备货区",stockupAreaStr); + + //查询当前订单的品类数量 + List> mapList = distributionReservationMapper.getCategoryByStockArticleIdAndReservationId(stockArticleId,reservationId); + Map numObj = new HashMap<>(); + Integer tn = 0; + Set set = total.keySet(); + for (String key:set){ + if(!"合计件数".equals(key)){ + numObj.put(key,0); + for (Map m:mapList){ + String thirdProduct = (String)m.get("thirdProduct"); + Long num = (Long)m.get("num"); + if(thirdProduct.equals(key)){ + numObj.put(key,num); + tn = tn + num.intValue(); + } + } + } + } + numObj.put("合计数量",tn); + orderMap.put("产品明细",numObj); + + //通过订单id和预约id查询对应包件的物料信息 + List materialNameStrList = distributionReservationMapper.getMaterialNameByStockArticleIdAndReservationId(stockArticleId,reservationId); + String materialNameStr = StringUtils.join(materialNameStrList, ","); + orderMap.put("物料名称",materialNameStr); + orderMap.put("到付运费",0);//todo 需要累加到totalPrice上 + ls.add(orderMap); + } + total.put("到付费用",totalPrice); + map.put("明细",ls); + map.put("合计",total); + test.add(map); + String popHtml =TemplateUtil.popTemplate("商配配配送单",map,html); + PrintPreviewVO printPreviewVO = new PrintPreviewVO(); + printPreviewVO.setTemplateId(templateId); + printPreviewVO.setTemplateHtml(popHtml); + result.add(printPreviewVO); + } + } + log.info("#############test: test={}",test); + String s = JSON.toJSONString(test); + JSONArray array= JSONArray.parseArray(JSON.toJSONString(test)); + return result; } /** @@ -3225,8 +3382,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl map = new HashMap<>(); - DistributionDeliveryListEntity byId = this.getById(id); if (ObjectUtils.isNull(byId)) { @@ -3240,7 +3395,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl map = new HashMap<>(); log.debug(">>>> distributionReservationEntity {}",distributionReservationEntity); map.put("配送单号", distributionReservationEntity.getReservationCode()); String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode()); @@ -3264,21 +3419,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl params = new HashMap<>(); - params.put("ids","1686560469635727362"); - try { - OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params); - System.out.println(orderPackgeCodeDataVO); - } catch (Exception e) { - e.printStackTrace(); - } +// Map params = new HashMap<>(); +// params.put("ids","1686560469635727362"); +// try { +// OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params); +// System.out.println(orderPackgeCodeDataVO); +// } catch (Exception e) { +// e.printStackTrace(); +// } + List printPreviewVOS = distributionDeliveryListService.printBatch(ids,type); + } } diff --git a/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java new file mode 100644 index 000000000..d750cd869 --- /dev/null +++ b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java @@ -0,0 +1,30 @@ +package com.logpm.distribution; + +import com.logpm.distribution.service.IDistributionDeliveryListService; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springblade.core.test.BladeBootTest; +import org.springblade.core.test.BladeSpringExtension; +import org.springframework.beans.factory.annotation.Autowired; + +@ExtendWith(BladeSpringExtension.class) +@BladeBootTest(appName = "logpm-distribution", enableLoader = true) +public class TestService { + + @Autowired + private IDistributionDeliveryListService distributionDeliveryListService; + + @Test + public void test2() throws Exception { + +// List printPreviewVOS = distributionDeliveryListService.printBatch("1703958397055135745", 1); + + + distributionDeliveryListService.testData("1703958397055135745"); + + System.out.println(111111); + + } + +} + From 45178547f6ff56ccd2f6c165e35c5675891bdf44 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Tue, 19 Sep 2023 16:10:53 +0800 Subject: [PATCH 25/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E8=B4=A7=20?= =?UTF-8?q?=E5=95=86=20=E5=B8=82=E5=BA=93=E4=BD=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/RabbitConstant.java | 7 + .../vo/DistributionStockAllocationVO.java | 10 + .../vo/DistributionStockupOrderListVO.java | 2 +- .../vo/DistributionStockupSelfVO.java | 1 + .../distribution/vo/PackageStockupVO.java | 2 + .../DistributionStockupAppController.java | 432 ++++++++++-------- .../config/RabbitMqConfiguration.java | 18 + .../distribution/dto/app/StockupDTO.java | 5 +- .../mapper/DistributionParcelListMapper.java | 4 +- .../mapper/DistributionParcelListMapper.xml | 40 +- .../mapper/DistributionStockMapper.java | 3 + .../mapper/DistributionStockMapper.xml | 8 + .../mapper/DistributionStockupMapper.xml | 15 +- .../receiver/StockupStateUpdateHandler.java | 48 ++ .../service/IDistributionAsyncService.java | 4 +- .../IDistributionParcelListService.java | 7 + .../service/IDistributionStockService.java | 10 + .../impl/DistributionAsyncServiceImpl.java | 74 ++- .../DistributionParcelListServiceImpl.java | 10 + .../impl/DistributionStockServiceImpl.java | 6 + .../impl/DistributionStockupServiceImpl.java | 107 ++++- 21 files changed, 583 insertions(+), 230 deletions(-) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java index ecb45b6f5..554222324 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java @@ -70,6 +70,13 @@ public interface RabbitConstant { String STOCKUP_SCAN_EXCHANGE = "stockup_scan_exchange"; String STOCKUP_SCAN_ROUTING = "stockup_scan_routing"; + /** + * 备货判断是否下架 + */ + String STOCKUP_STATE_UPDATE_QUEUE = "stockup_state_update_queue"; + String STOCKUP_STATE_UPDATE_EXCHANGE = "stockup_state_update_exchange"; + String STOCKUP_STATE_UPDATE_ROUTING = "stockup_state_update_routing"; + /****************test队列******************/ String TEST_RECEIVE_INFO_QUEUE = "test_receive_info_queue"; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java new file mode 100644 index 000000000..01525af34 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java @@ -0,0 +1,10 @@ +package com.logpm.distribution.vo; + + +import lombok.Data; + +@Data +public class DistributionStockAllocationVO { + private String positionCode;//完整货位 + private Long allocationId;//货位id +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java index dde1899af..3c41f3cf5 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java @@ -17,7 +17,7 @@ public class DistributionStockupOrderListVO implements Serializable { @ApiModelProperty(value = "订单编号") private String orderCode;//订单编号 @ApiModelProperty(value = "订单ID") - private Long stockArticleId;//订单ID + private String stockArticleId;//订单ID @ApiModelProperty(value = "托盘") private String pallet;//托盘 @ApiModelProperty(value = "整托状态") diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java index f7f0da386..f4f5372d2 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java @@ -20,6 +20,7 @@ public class DistributionStockupSelfVO { private String orderPackageCode; // 包件码 private Long lwugId; // 货位ID private Long ldsId; // 扫码ID + private Long allocationId; // 货位ID } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java index e9fbfa4c5..ab5ad4865 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java @@ -15,6 +15,8 @@ public class PackageStockupVO implements Serializable { private String packageBarCode;//包条码 private Long parceListId;//包条Id + private Long stockId;//备货扫描Id + private Long stockupId;//备货IDId private Integer goodsType;//货物类型 private String goodsTypeStr;//货物类型 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index d38f14801..df2403323 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -48,6 +48,11 @@ import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.cache.DictBizCache; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.transaction.TransactionDefinition; +import org.springframework.transaction.TransactionException; +import org.springframework.transaction.TransactionStatus; import org.springframework.web.bind.annotation.*; import java.lang.reflect.Field; @@ -84,6 +89,9 @@ public class DistributionStockupAppController extends BladeController { private final BladeRedis bladeRedis; private final IDistributionStockListService iDistributionStockListService; + private DataSourceTransactionManager dataSourceTransactionManager; + private TransactionDefinition transactionDefinition; + /** * 备货信息表 任务客户 分页列表 */ @@ -162,7 +170,7 @@ public class DistributionStockupAppController extends BladeController { @ResponseBody @PostMapping("/orderList") @ApiOperationSupport(order = 1) - @ApiOperation(value = "客户订单列表", notes = "传入stockupDTO") + @ApiOperation(value = "客户下库位订单列表", notes = "传入stockupDTO") public R> orderList(@RequestBody StockupDTO stockupDTO) throws IllegalAccessException { if (ObjectUtils.isNull(stockupDTO.getOrderStatus())) { log.warn("++++缺少状态类型"); @@ -176,6 +184,10 @@ public class DistributionStockupAppController extends BladeController { log.warn("++++缺少预约类型"); return R.fail(3005, "参数缺少!!"); } + if (ObjectUtils.isNull(stockupDTO.getStockupId())) { + log.warn("++++缺少备货任务ID类型"); + return R.fail(3005, "参数缺少!!"); + } Integer orderStatus = stockupDTO.getOrderStatus(); Map map = new HashMap<>(); @@ -244,11 +256,11 @@ public class DistributionStockupAppController extends BladeController { @ResponseBody @PostMapping("/orderInfo") @ApiOperationSupport(order = 1) - @ApiOperation(value = "客户订单列表", notes = "传入stockupDTO") + @ApiOperation(value = "客户订单包件列表", notes = "传入stockupDTO") public R orderInfo(@RequestBody StockupDTO stockupDTO) { log.info("##############orderInfo: {}", stockupDTO); Long reservationId = stockupDTO.getReservationId();//预约单id - Long stockArticleId = stockupDTO.getStockArticleId();//订单id + String stockArticleId = stockupDTO.getStockArticleId();//订单id Long stockupId = stockupDTO.getStockupId();//备货任务Id Integer orderStatus = stockupDTO.getOrderStatus();//1 客户订单 2库存品 @@ -266,7 +278,7 @@ public class DistributionStockupAppController extends BladeController { } //查询自提还是商 市 DistributionStockupEntity byId = distributionStockupService.getById(stockupId); - + //订单 if (orderStatus == 1) { //查询客户订单详情 if (Objects.isNull(reservationId)) { @@ -287,7 +299,7 @@ public class DistributionStockupAppController extends BladeController { } - } else if (orderStatus == 2) { + } else if (orderStatus == 2) { //库存品 Long stockListId = stockupDTO.getStockListId();//库存品id if (Objects.isNull(stockListId)) { @@ -398,152 +410,169 @@ public class DistributionStockupAppController extends BladeController { @ApiOperation(value = "备货扫描", notes = "传入stockupDTO") public R stockupScan(@RequestBody StockupDTO stockupDTO) { Integer scanType = stockupDTO.getScanType();//扫码类型 +//手动 +// TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); +// try{ + if (scanType == 1) { + //包件扫描 + String orderCode = stockupDTO.getOrderCode();//订单自编号 + String packetBarCode = stockupDTO.getPacketBarCode();//包件码 + Long stockupId = stockupDTO.getStockupId();//备货任务ID + Long reservationId = stockupDTO.getReservationId();//预约单id + if (StringUtil.isBlank(orderCode)) { + log.warn("##################stockupScan: 包件扫码,订单自编号为空"); + return R.fail("包件扫码:订单自编号不能为空"); + } + if (StringUtil.isBlank(packetBarCode)) { + log.warn("##################stockupScan: 包件扫码,包件码为空"); + return R.fail("包件扫码:包件码不能为空"); + } + if (ObjectUtils.isNull(stockupId)) { + log.warn("##################stockupId: 包件扫码,备货区为空"); + return R.fail("包件扫码:备货任务ID不能为空"); + } + if (Objects.isNull(reservationId)) { + log.warn("##################stockupScan: 包件扫码,预约单id为空"); + return R.fail("包件扫码:预约单id不能为空"); + } - if (scanType == 1) { - //包件扫描 - String orderCode = stockupDTO.getOrderCode();//订单自编号 - String packetBarCode = stockupDTO.getPacketBarCode();//包件码 - Long stockupId = stockupDTO.getStockupId();//备货任务ID - Long reservationId = stockupDTO.getReservationId();//预约单id - if (StringUtil.isBlank(orderCode)) { - log.warn("##################stockupScan: 包件扫码,订单自编号为空"); - return R.fail("包件扫码:订单自编号不能为空"); - } - if (StringUtil.isBlank(packetBarCode)) { - log.warn("##################stockupScan: 包件扫码,包件码为空"); - return R.fail("包件扫码:包件码不能为空"); - } - if (ObjectUtils.isNull(stockupId)) { - log.warn("##################stockupId: 包件扫码,备货区为空"); - return R.fail("包件扫码:备货任务ID不能为空"); - } - if (Objects.isNull(reservationId)) { - log.warn("##################stockupScan: 包件扫码,预约单id为空"); - return R.fail("包件扫码:预约单id不能为空"); - } - Integer integer = distributionStockupService.selectPackage(stockupDTO); - switch (integer) { - case 1: - DistributionStockupEntity distributionStockupEntity = distributionStockupService.getById(stockupDTO.getStockupId()); - //正常 - //先保存扫码包件信息,后续由队列来出来余下补充信息 - DistributionStockEntity entity = new DistributionStockEntity(); - entity.setOrderSelfNumbering(orderCode); - entity.setCoding(packetBarCode); -// entity.setStockupArea(stockupArea); - entity.setStockupId(stockupId); - if (distributionStockupEntity.getTypeService().equals("3")) { - entity.setBillLadingId(reservationId); + Integer integer = distributionStockupService.selectPackage(stockupDTO); + switch (integer) { + case 1: + DistributionStockupEntity distributionStockupEntity = distributionStockupService.getById(stockupDTO.getStockupId()); + //正常 + //先保存扫码包件信息,后续由队列来出来余下补充信息 + DistributionStockEntity entity = new DistributionStockEntity(); DistributionParcelListEntity one = distributionParcelListService.getOne(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) - .eq(DistributionParcelListEntity::getOrderCode, stockupDTO.getOrderCode()) ); - entity.setParcelListId(one.getId()); - //修改包件备货状态 - one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue()); - //todo 待下架操作 + entity.setOrderSelfNumbering(one.getOrderCode()); + entity.setCoding(packetBarCode); +// entity.setStockupArea(stockupArea); + entity.setStockupId(stockupId); + if (distributionStockupEntity.getTypeService().equals("3")) { + entity.setBillLadingId(reservationId); + + entity.setParcelListId(one.getId()); + //修改包件备货状态 + one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue()); + //todo 待下架操作 // warehouseUpdownTypeClient.downPackage(stockupDTO.getPacketBarCode()); - distributionParcelListService.updateById(one); - }else{ - entity.setReservationId(reservationId); - } - entity.setConditions("0"); - entity.setType(2); - distributionStockService.save(entity); - - Map map = new HashMap<>(); - map.put("messageId", CommonUtil.getUUID()); - map.put("scanType", scanType); - map.put("stockupId", stockupDTO.getStockupId()); - map.put("logId", entity.getId()); - map.put("messageData", entity); - map.put("createTime", new Date().getTime()); - //将消息携带绑定键值 - rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); - - String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); - - //查询是否货位数据是否该下架 - distributionAsyncService.stockupSelfOffShelf(stockupDTO); - return Resp.scanSuccess("扫描成功!", audioValue); - case 2: - //重复扫描 - String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); - return Resp.scanFail("重复扫描!", audioValue2); - case 3: - //包件不存在 - String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3"); - return Resp.scanFail("包件不存在!", audioValue3); - - case 4: - //操作失败 - String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4"); - return Resp.scanFail("操作失败!", audioValue4); - case 5: - //窜货 - String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5"); - return Resp.scanFail("窜货!", audioValue5); - default: - log.warn("###备货扫描:未知错误"); - return Resp.scanFail("未知错误!", "未知错误"); - } + distributionParcelListService.updateById(one); + }else{ + entity.setReservationId(reservationId); + } + entity.setConditions("0"); + entity.setType(2); + distributionStockService.save(entity); +// dataSourceTransactionManager.commit(transactionStatus);//提交 + + Map map = new HashMap<>(); + map.put("messageId", CommonUtil.getUUID()); + map.put("scanType", scanType); + map.put("stockupId", stockupDTO.getStockupId()); + map.put("logId", entity.getId()); + map.put("messageData", entity); + map.put("createTime", new Date().getTime()); + //将消息携带绑定键值 + rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); + + //查询是否货位数据是否该下架 + Map mapState = new HashMap<>(); + mapState.put("messageId", CommonUtil.getUUID()); + mapState.put("scanType", scanType); + mapState.put("stockupId", stockupDTO.getStockupId()); + mapState.put("typeService", stockupDTO.getTypeService()); + mapState.put("reservationId", stockupDTO.getReservationId()); + mapState.put("logId", entity.getId()); + mapState.put("messageData", entity); + mapState.put("createTime", new Date().getTime()); + //将消息携带绑定键值 + rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState); + + String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); + + //查询是否货位数据是否该下架 +// distributionAsyncService.stockupSelfOffShelf(stockupDTO); + return Resp.scanSuccess("扫描成功!", audioValue); + case 2: + //重复扫描 + String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); + return Resp.scanFail("重复扫描!", audioValue2); + case 3: + //包件不存在 + String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3"); + return Resp.scanFail("包件不存在!", audioValue3); + + case 4: + //操作失败 + String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4"); + return Resp.scanFail("操作失败!", audioValue4); + case 5: + //窜货 + String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5"); + return Resp.scanFail("窜货!", audioValue5); + default: + log.warn("###备货扫描:未知错误"); + return Resp.scanFail("未知错误!", "未知错误"); + } - } else if (scanType == 2) { - //库存品扫描 - Long reservationId = stockupDTO.getReservationId(); - Long stockListId = stockupDTO.getStockListId(); - String packetBarCode = stockupDTO.getPacketBarCode(); + } else if (scanType == 2) { + //库存品扫描 + Long reservationId = stockupDTO.getReservationId(); + Long stockListId = stockupDTO.getStockListId(); + String packetBarCode = stockupDTO.getPacketBarCode(); // String stockupArea = stockupDTO.getStockupArea();//备货区 - Long stockupId = stockupDTO.getStockupId();//备货区 - Integer stockPrint = stockupDTO.getStockPrint(); // 库存 + Long stockupId = stockupDTO.getStockupId();//备货区 + Integer stockPrint = stockupDTO.getStockPrint(); // 库存 - if (StringUtil.isBlank(packetBarCode)) { - log.warn("##################stockupScan: 库存品扫码,包件码为空"); - return R.fail("库存品扫码:包件码不能为空"); - } - if (ObjectUtils.isNull(stockupId)) { - log.warn("##################stockupScan: 库存品扫码,备货区为空"); - return R.fail("库存品扫码:备货任务ID不能为空"); - } - if (Objects.isNull(stockListId)) { - log.warn("##################stockupScan: 库存品扫码,库存品id为空"); - return R.fail("库存品扫码:库存品id不能为空"); - } - if (Objects.isNull(reservationId)) { - log.warn("##################stockupScan: 库存品扫码,预约单id为空"); - return R.fail("库存品扫码:预约单id不能为空"); - } - if (Objects.isNull(stockPrint)) { - log.warn("##################stockupScan: 库存品扫码,类型为空"); - return R.fail("库存品扫码:类型不能为空"); - } + if (StringUtil.isBlank(packetBarCode)) { + log.warn("##################stockupScan: 库存品扫码,包件码为空"); + return R.fail("库存品扫码:包件码不能为空"); + } + if (ObjectUtils.isNull(stockupId)) { + log.warn("##################stockupScan: 库存品扫码,备货区为空"); + return R.fail("库存品扫码:备货任务ID不能为空"); + } + if (Objects.isNull(stockListId)) { + log.warn("##################stockupScan: 库存品扫码,库存品id为空"); + return R.fail("库存品扫码:库存品id不能为空"); + } + if (Objects.isNull(reservationId)) { + log.warn("##################stockupScan: 库存品扫码,预约单id为空"); + return R.fail("库存品扫码:预约单id不能为空"); + } + if (Objects.isNull(stockPrint)) { + log.warn("##################stockupScan: 库存品扫码,类型为空"); + return R.fail("库存品扫码:类型不能为空"); + } - Integer i = distributionStockupService.selectPackagePrint(stockupDTO); - switch (i) { - case 1: - //绑定 - Integer integer = distributionStockupService.selectPackage(stockupDTO); - switch (integer) { - case 1: - DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupDTO.getStockupId()); - //先保存扫码包件信息,后续由队列来出来余下补充信息 - DistributionStockEntity entity = new DistributionStockEntity(); - entity.setCoding(packetBarCode); + Integer i = distributionStockupService.selectPackagePrint(stockupDTO); + switch (i) { + case 1: + //绑定 + Integer integer = distributionStockupService.selectPackage(stockupDTO); + switch (integer) { + case 1: + DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupDTO.getStockupId()); + //先保存扫码包件信息,后续由队列来出来余下补充信息 + DistributionStockEntity entity = new DistributionStockEntity(); + entity.setCoding(packetBarCode); // entity.setStockupArea(stockupArea); - entity.setStockupId(stockupId); - if(stockupEntity.getTypeService().equals("3")){ - entity.setBillLadingId(reservationId); - }else{ - entity.setReservationId(reservationId); - } + entity.setStockupId(stockupId); + if(stockupEntity.getTypeService().equals("3")){ + entity.setBillLadingId(reservationId); + }else{ entity.setReservationId(reservationId); - entity.setStockListId(stockListId); - //添加物料信息 - DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId); - if(ObjectUtils.isNotNull(byId.getMarketId())){ - entity.setMarketId(byId.getMarketId()); - entity.setMaterialId(byId.getMaterialId()); - //查询库位id + } + entity.setReservationId(reservationId); + entity.setStockListId(stockListId); + //添加物料信息 + DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId); + if(ObjectUtils.isNotNull(byId.getMarketId())){ + entity.setMarketId(byId.getMarketId()); + entity.setMaterialId(byId.getMaterialId()); + //查询库位id // WarehouseUpdownGoodsEntity updownGoods = new WarehouseUpdownGoodsEntity(); // updownGoods.setAssociationId(byId.getId()); // updownGoods.setMarketId(byId.getMarketId()); @@ -561,66 +590,73 @@ public class DistributionStockupAppController extends BladeController { // list.add(jsonObject); // warehouseUpdownTypeClient.downStock(list); // } - } - entity.setConditions("0"); - entity.setType(2); - distributionStockService.save(entity); - - Map map = new HashMap<>(); - map.put("messageId", CommonUtil.getUUID()); - map.put("scanType", scanType); - map.put("logId", entity.getId()); - map.put("messageData", entity); - map.put("createTime", new Date().getTime()); - //将消息携带绑定键值 - rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); - String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); - return Resp.scanSuccess("扫描成功!",audioValue); - case 2: - //扫码失败 - String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); - return Resp.scanFail("重复扫描!",audioValue2); - case 3: - //重复扫码 - String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3"); - return Resp.scanFail("包件不存在!",audioValue3); - - case 4: - //重复扫码 - String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4"); - return Resp.scanFail("操作失败!", audioValue4); - case 5: - //重复扫码 - String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5"); - return Resp.scanFail("窜货!", audioValue5); - case 6: - //重复扫码 - String audioValue6 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "6"); - return Resp.scanFail("已完成!", audioValue6); - case 7: - //重复扫码 - String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7"); - return Resp.scanFail("包条码不存在!", audioValue7); - default: - log.warn("###备货扫描:未知错误"); - return Resp.scanFail("未知错误!", "未知错误"); - } - case 7: - //重复扫码 - String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7"); - return Resp.scanFail("包条码不存在!", audioValue7); - case 8: - //重复扫码 - String audioValue8 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "8"); - return Resp.scanFail("条码已使用!", audioValue8); - case 9: - //重复扫码 - String audioValue9 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "9"); - return Resp.scanFail("没有待绑定的库存品信息!", audioValue9); - } + } + entity.setConditions("0"); + entity.setType(2); + distributionStockService.save(entity); +// dataSourceTransactionManager.commit(transactionStatus);//提交 + + Map map = new HashMap<>(); + map.put("messageId", CommonUtil.getUUID()); + map.put("scanType", scanType); + map.put("logId", entity.getId()); + map.put("messageData", entity); + map.put("createTime", new Date().getTime()); + //将消息携带绑定键值 + rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); + String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); + return Resp.scanSuccess("扫描成功!",audioValue); + case 2: + //扫码失败 + String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); + return Resp.scanFail("重复扫描!",audioValue2); + case 3: + //重复扫码 + String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3"); + return Resp.scanFail("包件不存在!",audioValue3); + + case 4: + //重复扫码 + String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4"); + return Resp.scanFail("操作失败!", audioValue4); + case 5: + //重复扫码 + String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5"); + return Resp.scanFail("窜货!", audioValue5); + case 6: + //重复扫码 + String audioValue6 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "6"); + return Resp.scanFail("已完成!", audioValue6); + case 7: + //重复扫码 + String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7"); + return Resp.scanFail("包条码不存在!", audioValue7); + default: + log.warn("###备货扫描:未知错误"); + return Resp.scanFail("未知错误!", "未知错误"); + } + case 7: + //重复扫码 + String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7"); + return Resp.scanFail("包条码不存在!", audioValue7); + case 8: + //重复扫码 + String audioValue8 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "8"); + return Resp.scanFail("条码已使用!", audioValue8); + case 9: + //重复扫码 + String audioValue9 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "9"); + return Resp.scanFail("没有待绑定的库存品信息!", audioValue9); + } - } + } +// }catch (TransactionException e){ +// e.printStackTrace(); +// log.error("######:备货扫描",e.getMessage()); +// dataSourceTransactionManager.rollback(transactionStatus); +// } + log.warn("###################stockupScan: 未知的扫码类型 scanType={}", scanType); return R.fail("未知的扫码类型"); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java index be57d052d..fb173650f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java @@ -92,6 +92,24 @@ public class RabbitMqConfiguration { return BindingBuilder.bind(stockupScanQueue).to(stockupScanExchange).with(RabbitConstant.STOCKUP_SCAN_ROUTING).noargs(); } + /** + * 备货判断是否下架任务队列 + */ + @Bean + public Queue stockupStateUpdateQueue() { + return new Queue(RabbitConstant.STOCKUP_STATE_UPDATE_QUEUE, true); + } + @Bean + public CustomExchange stockupStateUpdateExchange() { + Map args = Maps.newHashMap(); + args.put("x-delayed-type", "direct"); + return new CustomExchange(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, "x-delayed-message", true, false, args); + } + @Bean + public Binding stockupStateUpdateBinding(Queue stockupStateUpdateQueue, CustomExchange stockupStateUpdateExchange) { + return BindingBuilder.bind(stockupStateUpdateQueue).to(stockupStateUpdateExchange).with(RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING).noargs(); + } + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java index eb2d4541c..a77b79855 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.List; @Data public class StockupDTO implements Serializable { @@ -24,7 +25,9 @@ public class StockupDTO implements Serializable { private Long warehouseId;//仓库id private String orderCode;//订单编码 - private Long stockArticleId;//订单id + private String[] orderCodeList;//订单编码 + private String stockArticleId;//订单id + private String[] stockArticleIdList;//订单id private String descriptionGoods;//物料名称 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index 2073dc3c5..d1044914d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -58,7 +58,7 @@ public interface DistributionParcelListMapper extends BaseMapper selectOrderInfoList(StockupDTO stockupDTO); + List selectOrderInfoList(@Param("param") StockupDTO stockupDTO); List selectWarehouseAreaByReservationId(@Param("reservationId") Long reservationId); @@ -91,6 +91,8 @@ public interface DistributionParcelListMapper extends BaseMapper selectOrderInfoSelfList(@Param("param") StockupDTO stockupDTO); + List selectOrderInfoAllocationList(@Param("param") StockupDTO stockupDTO); + List findALLNoUpShelfPackageByOrderCode(@Param("orderCode") String orderCode,@Param("orderCode") Long warehouseId); IPage pageOweList(IPage page,@Param("param") DistributionParcelListDTO parcelListEntity); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index b47f08571..c0fd555d5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -136,13 +136,35 @@ from logpm_distribution_parcel_list where stock_article_id = #{id} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java index b954df92d..94c9e1f47 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.entity.DistributionStockEntity; import com.logpm.distribution.excel.DistributionStockExcel; +import com.logpm.distribution.vo.DistributionStockAllocationVO; import com.logpm.distribution.vo.DistributionStockVO; import org.apache.ibatis.annotations.Param; @@ -76,4 +77,6 @@ public interface DistributionStockMapper extends BaseMapper + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index 08529ab80..8285df34a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -44,12 +44,21 @@ LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id ldsi.reservation_id = #{param.reservationId} and ldsi.stockup_id = #{param.stockupId} - and ldpl.order_package_code = #{param.packetBarCode} and ldpl.order_code =#{param.orderCode} + and ldpl.order_package_code = #{param.packetBarCode} + + and ldpl.order_code = #{param.orderCode} + + + and ldpl.order_code in + + #{a} + + @@ -162,6 +170,13 @@ and lds.forklift_name like concat('%', #{param.forkliftName},'%') and lds.loader_name like concat('%', #{param.loaderName},'%') and lds.type_service = #{param.typeService} + and lds.warehouse_id = #{param.warehouseId} + + and lds.warehouse_id in + + #{a} + + GROUP BY lds.id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 1ea89c162..4ffb8ebca 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -226,11 +226,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl pageList(IPage page, Map distributionStockup) { DistributionStockupEntity distributionStockupEntity = JSON.parseObject(JSON.toJSONString(distributionStockup), DistributionStockupEntity.class); -// //获取当前登录人仓库 -// List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); -// //取出id -// List collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); - + //获取当前登录人仓库 + List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); + //取出id + List collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + distributionStockupEntity.setWarehouseIdList(collect); distributionStockupEntity.setTenantId(AuthUtil.getTenantId()); if (distributionStockupEntity.getTypeService().equals("3")) { return baseMapper.pageOweList(page, distributionStockupEntity); From c8a99fe0a42106bd787f8543aa42099a2cff06e5 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Tue, 19 Sep 2023 16:51:05 +0800 Subject: [PATCH 28/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E8=B4=A7?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionStockupServiceImpl.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 4ffb8ebca..95775b236 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -226,11 +226,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl pageList(IPage page, Map distributionStockup) { DistributionStockupEntity distributionStockupEntity = JSON.parseObject(JSON.toJSONString(distributionStockup), DistributionStockupEntity.class); - //获取当前登录人仓库 - List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); - //取出id - List collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); - distributionStockupEntity.setWarehouseIdList(collect); + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if(ObjectUtils.isNotNull(myCurrentWarehouse)){ + //获取当前登录人仓库 + distributionStockupEntity.setWarehouseId(myCurrentWarehouse.getId()); + }else{ + //获取当前登录人仓库 + List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); + //取出id + List collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + distributionStockupEntity.setWarehouseIdList(collect); + } + distributionStockupEntity.setTenantId(AuthUtil.getTenantId()); if (distributionStockupEntity.getTypeService().equals("3")) { return baseMapper.pageOweList(page, distributionStockupEntity); From c12b57bc12e88379e6ac7cb8c04b25a7c3a03ae1 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 19 Sep 2023 17:02:22 +0800 Subject: [PATCH 29/30] =?UTF-8?q?1.=E4=BB=A3=E7=A0=81=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java index 546b5426b..f0c418717 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java @@ -46,6 +46,4 @@ public interface IBasicdataCarrierClient { */ @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); - @GetMapping(API_PREFIX + "/getCarrierById") - BasicdataCarrierEntity getCarrierById(@RequestParam("current") Long carrierId); } From e9e46d3aa4113f026be35f1cd449c7b98b7b6077 Mon Sep 17 00:00:00 2001 From: kilo Date: Tue, 19 Sep 2023 17:55:14 +0800 Subject: [PATCH 30/30] =?UTF-8?q?=E5=95=86=E9=85=8D=E9=85=8D=E9=80=81?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E8=B0=83=E6=95=B4=E7=BB=B4=E5=BA=A6=E4=B8=BA?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=94=B6=E8=B4=A7=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionAddvalueAppController.java | 5 +- .../DistributionDeliveryListMapper.java | 8 +++ .../mapper/DistributionDeliveryListMapper.xml | 60 +++++++++++++++++++ .../mapper/DistributionReservationMapper.java | 4 +- .../mapper/DistributionReservationMapper.xml | 13 ++-- .../impl/DistributionAddvalueServiceImpl.java | 7 ++- .../impl/DistributionAsyncServiceImpl.java | 10 +++- .../DistributionDeliveryInfoServiceImpl.java | 1 + .../DistributionDeliveryListServiceImpl.java | 10 ++-- .../DistributionReservationServiceImpl.java | 4 +- .../impl/DistributionSignforServiceImpl.java | 17 ++++-- 11 files changed, 113 insertions(+), 26 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java index b7992e159..524dd03bc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java @@ -78,9 +78,10 @@ public class DistributionAddvalueAppController { @PostMapping("/getAllPackageList") @ApiOperationSupport(order = 3) @ApiOperation(value = "查询该客户下的所有配送包件信息", notes = "DistributionAppDeliveryListDTO") - public List getAllPackageList(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) { + public R getAllPackageList(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) { List allPackageList = distributionAddvalueService.getAllPackageList(distributionAppAddvalueDTO); - return allPackageList; + + return R.data(200,allPackageList,"成功"); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java index 9fdc8d3a9..69f826328 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java @@ -369,4 +369,12 @@ public interface DistributionDeliveryListMapper extends BaseMapper getInventoryByDeliveryId(IPage page,@Param("deliveryListId") Long deliveryId); + + /** + * 查询该配送计划下指定收货单位的预约信息 + * @param deliveryListEntityId + * @param k + * @return + */ + DistributionReservationEntity selectReservationByDeliveryListIdAndCustomerUnit(@Param("deliveryListId")Long deliveryListEntityId,@Param("receivingUnit") String k); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 2e1b9c011..5b0108ab2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1347,5 +1347,65 @@ + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java index 5ec47eef3..460a435e6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java @@ -173,14 +173,14 @@ public interface DistributionReservationMapper extends BaseMapper selectAppInventoryListByReservation(@Param("reservationId") Long reservationId,List packageListIds); + List selectAppInventoryListByReservation(@Param("reservationId") Long reservationId); /** * 查询客户下的包件信息 * @param reservationId * @return */ - List selectAppPackageListByReservationId(@Param("reservationId")Long reservationId,List packageListIds); + List selectAppPackageListByReservationId(@Param("reservationId")Long reservationId); /** * 查询出客户下的库存品订单维度信息 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 77e843735..f779ca5cd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -322,6 +322,7 @@ ldr.is_urgent, ldr.reservation_stock_list_num, ldr.waybill_no, + ldr.receiving_unit, ldr.waybill_id FROM logpm_distribution_delivery_list AS lddl @@ -722,10 +723,7 @@ INNER JOIN logpm_dis_stock_list_detail AS ldsld ON ldr.id = ldsld.reservation_id INNER JOIN logpm_distribution_stock_list AS ldsl ON ldsl.id = ldsld.stock_list_id WHERE - ldr.id = #{reservationId} and ldsld.stock_package_status in ('1','3') and ldsld.id not in - - #{id} - + ldr.id = #{reservationId} and ldsld.stock_package_status in ('1','3')