From 589cd24a314f5d7fff0de0d609df04aaddefccb2 Mon Sep 17 00:00:00 2001 From: kilo Date: Tue, 7 Nov 2023 22:35:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B8=E6=9C=BA=E5=A2=9E=E5=8A=A0warehouse?= =?UTF-8?q?=5Fid=E5=AD=97=E6=AE=B5=E3=80=81=E5=A2=9E=E5=80=BC=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/BasicdataDriverArteryEntity.java | 12 ++ .../IDistributionDeliveryListClient.java | 11 ++ .../feign/IDistributionReservationClient.java | 10 ++ .../vo/DistributionAddvaluePackageVO.java | 41 +++++ .../WarehouseRetentionRecordEntity.java | 20 +++ .../BasicdataDriverArteryController.java | 1 - .../BasicdataWarehouseController.java | 3 - .../BasicdataDriverArteryServiceImpl.java | 6 +- .../DistributionSignforAppController.java | 2 +- .../DistributionSignforController.java | 17 ++ .../dto/DistributionAddvalueDTO.java | 2 + .../dto/DistributionAddvaluePackageDTO.java | 2 + .../feign/DistributionDeliveryListClient.java | 6 + .../feign/DistributionReservationClient.java | 6 + .../mapper/DistributionAddvalueMapper.java | 42 +++++ .../mapper/DistributionAddvalueMapper.xml | 145 ++++++++++++++++++ .../mapper/DistributionDeliveryListMapper.xml | 3 +- .../IDistributionDeliveryListService.java | 6 + .../IDistributionReservationService.java | 7 + .../service/IDistributionSignforService.java | 2 + .../impl/DistributionAddvalueServiceImpl.java | 7 +- .../DistributionDeliveryListServiceImpl.java | 111 ++++++++------ .../DistributionReservationServiceImpl.java | 120 ++++++++++++++- .../impl/DistributionSignforServiceImpl.java | 127 ++++++++++++--- .../api/WarehouseRetentionApiController.java | 4 +- .../IWarehouseRetentionRecordService.java | 8 + .../IWarehouseRetentionScanService.java | 2 +- .../WarehouseRetentionRecordServiceImpl.java | 42 +++++ .../WarehouseRetentionScanServiceImpl.java | 67 +++++--- 29 files changed, 715 insertions(+), 117 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java index d1e414941..4bdea19eb 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java @@ -209,4 +209,16 @@ public class BasicdataDriverArteryEntity extends TenantEntity { @ApiModelProperty(value = "预留5") private String reserve5; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String warehouseId; + + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String warehouseName; + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java index 5ec37bca8..84d88d181 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java @@ -20,10 +20,12 @@ import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity; import com.logpm.distribution.entity.DistributionDeliveryListEntity; import com.logpm.distribution.vo.DistributionDeliveryListVO; import com.logpm.distribution.vo.DistributionDeliverySelfVO; +import com.logpm.distribution.vo.DistributionRetentionScanVo; import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -61,4 +63,13 @@ public interface IDistributionDeliveryListClient { @GetMapping(TOP+"/getDeliveryDriverInfo") DistributionDeliveryListVO getDeliveryDriverInfo(@RequestParam("current") Long deliveryId); + +// /** +// * 根据配送任务ID查询配送司机信息 +// * @param distributionRetentionScanVo +// * @return +// */ +// @GetMapping(TOP+"/retentionCancelDeliveryPack") +// void retentionCancelDeliveryPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo); + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java index 0f52814c7..0df84a729 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java @@ -17,10 +17,12 @@ package com.logpm.distribution.feign; import com.logpm.distribution.entity.DistributionReservationEntity; +import com.logpm.distribution.vo.DistributionRetentionScanVo; import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -47,4 +49,12 @@ public interface IDistributionReservationClient { @GetMapping(TOP) BladePage reservationTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + /** + * 根据配送任务ID查询配送司机信息 + * @param distributionRetentionScanVo + * @return + */ + @GetMapping(TOP+"/retentionCancelReservationPack") + boolean retentionCancelReservationPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo); + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvaluePackageVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvaluePackageVO.java index f05b5a9ee..ef7d239ff 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvaluePackageVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvaluePackageVO.java @@ -42,4 +42,45 @@ public class DistributionAddvaluePackageVO extends DistributionAddvaluePackageEn */ private Integer planQuantity; + /** + * 总数量 + */ + private Integer totalQuantity; + + /** + * 总数量 + */ + private String firsts; + + /** + * 总数量 + */ + private String second; + + /** + * 总数量 + */ + private String thirdProduct; + + + /** + * 总数量 + */ + private Long reservationId; + + /** + * 总数量 + */ + private String packageType; + + /** + * 总数量 + */ + private String materialNumber; + + /** + * 总数量 + */ + private String sku; + } diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionRecordEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionRecordEntity.java index 0dfae3096..a065a9403 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionRecordEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionRecordEntity.java @@ -150,4 +150,24 @@ public class WarehouseRetentionRecordEntity extends TenantEntity { @ApiModelProperty(value = "滞留数量") private Integer retentionQuantity; + /** + * 滞留任务创建人 + */ + @ApiModelProperty(value = "滞留任务创建人") + private Long retentionCreateUserId; + + /** + * 滞留任务创建人 + */ + @ApiModelProperty(value = "滞留任务创建人") + private String retentionCreateUserName; + + /** + * 滞留备注 + */ + @ApiModelProperty(value = "滞留备注") + private String retentionRemarks; + + + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java index b4647e291..b8975fa25 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java @@ -144,7 +144,6 @@ public class BasicdataDriverArteryController extends BladeController { if(list.size() > 0){ return R.fail("绑定的用户已存在!不要重复绑定!!!"); } - String phone = basicdataDriverArtery.getPhone(); R userR = userClient .userInfoByPhone(AuthUtil.getUser().getTenantId(), phone); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java index dfa8f2ad6..c20d741df 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java @@ -289,15 +289,12 @@ public class BasicdataWarehouseController extends BladeController { @GetMapping("/getMyWarehouseList") @ApiOperationSupport(order = 3) public R> getMyWarehouseList() { - BladeUser user = AuthUtil.getUser(); List basicdataGoodsShelfVOList = CacheUtil.get(CacheObjNames.basic_data_warehourse_list.getCacheName(), CacheObjNames.basic_data_warehourse_list.getKeyPrefix(), user.getUserId(),List.class); - if(ObjectUtils.isNull(basicdataGoodsShelfVOList)){ basicdataGoodsShelfVOList = warehouseService.getMyWarehouseList(); CacheUtil.put(CacheObjNames.basic_data_warehourse_list.getCacheName(), CacheObjNames.basic_data_warehourse_list.getKeyPrefix(),user.getUserId(),basicdataGoodsShelfVOList); } - return R.data(basicdataGoodsShelfVOList); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java index 4f6686d6f..275ca9a3c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java @@ -46,6 +46,7 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * 司机信息表 服务实现类 @@ -118,8 +119,9 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl basicdataDriverArteryVOS = new ArrayList<>(); List list = this.list(); - if (Func.isNotEmpty(list)){ - list.forEach(l->{ + Stream basicdataDriverArteryEntityStream = list.stream().filter(l -> l.getWarehouseId().contains(myCurrentWarehouse.getId().toString())); + if (Func.isNotEmpty(basicdataDriverArteryEntityStream)){ + basicdataDriverArteryEntityStream.forEach(l->{ BasicdataDriverArteryVO driverArteryVO = Func.copy(l, BasicdataDriverArteryVO.class); List vehicleIds = basicdataDrivermiddleService.list(Wrappers.query().lambda() .eq(BasicdataDrivermiddleEntity::getDriverId, l.getId())).stream().filter(f -> Func.isNotEmpty(f.getBrandId())).map(BasicdataDrivermiddleEntity::getBrandId).collect(Collectors.toList()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java index 78ac5f949..19982e1cf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java @@ -162,7 +162,7 @@ public class DistributionSignforAppController { @PostMapping("/positioning") @ApiOperationSupport(order = 2) public Resp positioning(@Valid @RequestBody DistributionSignforEntity distributionSignfor) { - Resp msg = distributionSignforService.positioning(distributionSignfor); + Resp msg = distributionSignforService.positioning(distributionSignfor); return msg; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java index 7c47ba584..66542245c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java @@ -317,6 +317,23 @@ public class DistributionSignforController extends BladeController { } + + /** + * 签收管理进行增值服务操作 + */ + @GetMapping("/checkAddValuePackageList") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "PC查看增值服务列表", notes = "传入ids") + public IPage checkAddValuePackageList(@RequestParam Map addValueDTO, Query query) { + return distributionSignforService.checkAddValuePackageList(Condition.getPage(query),addValueDTO); + } + + + + + + + // /** // * 签收管理 修改签收照片信息 // */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvalueDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvalueDTO.java index bd7fb5f92..f2da040e6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvalueDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvalueDTO.java @@ -36,4 +36,6 @@ public class DistributionAddvalueDTO extends DistributionAddvalueEntity { */ private Long signforId; + private Long reservationId; + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvaluePackageDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvaluePackageDTO.java index f5cd58897..83065d154 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvaluePackageDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionAddvaluePackageDTO.java @@ -33,4 +33,6 @@ public class DistributionAddvaluePackageDTO extends DistributionAddvaluePackageE private Integer zeroQuantity; + private Integer maxQuantity; + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java index 7271c787b..179dad553 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java @@ -21,6 +21,7 @@ import com.logpm.distribution.entity.DistributionDeliveryListEntity; import com.logpm.distribution.service.IDistributionDeliveryListService; import com.logpm.distribution.vo.DistributionDeliveryListVO; import com.logpm.distribution.vo.DistributionDeliverySelfVO; +import com.logpm.distribution.vo.DistributionRetentionScanVo; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; @@ -59,4 +60,9 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList return distributionDeliveryListService.getDeliveryList(deliveryId); } +// @Override +// public void retentionCancelDeliveryPack(DistributionRetentionScanVo distributionRetentionScanVo) { +// distributionDeliveryListService.retentionCancelDeliveryPack(distributionRetentionScanVo); +// } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java index b238dac66..1cab1eac1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java @@ -19,6 +19,7 @@ package com.logpm.distribution.feign; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.service.IDistributionReservationService; +import com.logpm.distribution.vo.DistributionRetentionScanVo; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; @@ -50,4 +51,9 @@ public class DistributionReservationClient implements IDistributionReservationCl return BladePage.of(page); } + @Override + public boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo) { + return reservationService.retentionCancelReservationPack(distributionRetentionScanVo); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.java index 5aaaab958..e83506748 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.java @@ -23,9 +23,11 @@ import com.logpm.distribution.dto.DistributionAddvalueDTO; import com.logpm.distribution.entity.DistributionAddvalueEntity; import com.logpm.distribution.entity.DistributionAddvaluePackageEntity; import com.logpm.distribution.excel.DistributionAddvalueExcel; +import com.logpm.distribution.vo.DistributionAddvaluePackageVO; import com.logpm.distribution.vo.DistributionAddvalueVO; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 配送增值服务表 Mapper 接口 @@ -81,6 +83,46 @@ public interface DistributionAddvalueMapper extends BaseMapper selectAddvaluePackageVO(@Param("reservationId") Long reservationId, @Param("stockArticleId") Long stockArticleId,@Param("obj") Map addValueDTO); + + + List selectAddvalueZeroPackageVO(@Param("reservationId")Long reservationId,@Param("stockArticleId")Long stockArticleId,@Param("obj")Map addValueDTO); + + List selectAddvalueInventoryPackageVO(@Param("reservationId")Long reservationId,@Param("stockListId")Long stockListId,@Param("obj")Map addValueDTO); + // /** // * 删除增值服务 // * @param reservationId diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml index c651c45dc..564584c35 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml @@ -92,5 +92,150 @@ GROUP BY lda.id + + + + + + 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 b2a1e5d05..e9071803c 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 @@ -1603,6 +1603,7 @@ ldsld.num AS reservationQuantity, ldsl.cargo_number AS materialNumber, ldsl.description_goods AS materialName, + 2 AS conditions, ldsl.incoming_batch AS 入库批次 FROM logpm_distribution_delivery_list AS lddl @@ -1648,7 +1649,7 @@ ldrs.reservation_num AS maxRetention, ldrzp.parcel_list_id AS orderPackageId, ldpl.firsts AS materialName, - 2 AS conditions + 3 AS conditions FROM logpm_distribution_delivery_list AS lddl LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id 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 25b838b5e..812a44f97 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 @@ -316,4 +316,10 @@ public interface IDistributionDeliveryListService extends BaseService getDriverInfo(Long deliveryId); + +// /** +// * 滞留取消配送 +// * @param distributionRetentionScanVo +// */ +// void retentionCancelDeliveryPack(DistributionRetentionScanVo distributionRetentionScanVo); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 2f6fa8af9..646fd5975 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -225,4 +225,11 @@ public interface IDistributionReservationService extends BaseService page); + + /** + * 滞留扫描取消包件 + * @param distributionRetentionScanVo + * @return + */ + boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java index bd0b2f3b0..78559b20d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java @@ -203,4 +203,6 @@ public interface IDistributionSignforService extends BaseService checkAddValuePackageList(IPage page, Map addValueDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java index 515cd470b..e46fe2dee 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java @@ -242,7 +242,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl addvaluePackageEntities = new ArrayList<>(); - packageEntityList.stream().forEach(p->{p.setAddvalueDetailId(distributionAddvalueDetailEntity.getId());p.setQuantity(p.getZeroQuantity());addvaluePackageEntities.add(Func.copy(p,DistributionAddvaluePackageEntity.class));}); + packageDTOList.stream().forEach(p->{ + p.setAddvalueDetailId(distributionAddvalueDetailEntity.getId()); + addvaluePackageEntities.add(Func.copy(p,DistributionAddvaluePackageEntity.class)); + }); distributionAddvaluePackageService.saveBatch(addvaluePackageEntities); return Resp.scanSuccess("添加成功","添加成功"); } 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 bb7fd3a13..21586b874 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 @@ -88,6 +88,8 @@ import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.system.cache.DictBizCache; import org.springblade.system.feign.IDictBizClient; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.data.redis.connection.ReactiveListCommands; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; @@ -153,8 +155,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { List parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), ord.getStockArticleId()); for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { - DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); - BladeUser user = AuthUtil.getUser(); - loadscanEntity.setScanUser(user.getUserName()); - loadscanEntity.setDriverName(finalDistributionDeliverySelfEntity.getDriverName()); - loadscanEntity.setVehicleName(finalDistributionDeliverySelfEntity.getVehicleNub()); - loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); - loadscanEntity.setOneClick(2); - loadscanEntity.setScanUser(user.getUserName()); - loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId()); - loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); - loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); - loadscanEntity.setLoadedNub(parcelListEntity.getQuantity()); - loadscanEntity.setScanTime(new Date()); - if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getDriverPhone())) { - loadscanEntity.setDriverPhone(finalDistributionDeliverySelfEntity.getDriverPhone()); - } - if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getVehicleId())) { - loadscanEntity.setVehicleId(finalDistributionDeliverySelfEntity.getVehicleId()); - } - if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getDriverId())) { - loadscanEntity.setDriverId(finalDistributionDeliverySelfEntity.getDriverId()); - } - if (Func.isNotEmpty(finalDistributionDeliverySelfEntity.getId())) { - loadscanEntity.setLoadingId(finalDistributionDeliverySelfEntity.getId().toString()); - } - if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getDriverId())) { - loadscanEntity.setDriverId(finalDistributionDeliverySelfEntity.getDriverId()); - } - if (Func.isNotEmpty(parcelListEntity.getOrderPackageCode())) { - loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); - } - if (Func.isNotEmpty(parcelListEntity.getId())) { - loadscanEntity.setPackageId(parcelListEntity.getId()); - } - if (Func.isNotEmpty(parcelListEntity.getId())) { - loadscanEntity.setPackageId(parcelListEntity.getId()); - } - if (Func.isNotEmpty(parcelListEntity.getStockArticleId())) { - loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); - } - if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) { - loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); - } + DistributionLoadscanEntity packageLoadingScan = distributionLoadscanService.getOne(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) + .eq(DistributionLoadscanEntity::getOrderId, ord.getStockArticleId()) + .eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + if (Func.isEmpty(packageLoadingScan)){ + DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); + BladeUser user = AuthUtil.getUser(); + loadscanEntity.setScanUser(user.getUserName()); + loadscanEntity.setDriverName(finalDistributionDeliverySelfEntity.getDriverName()); + loadscanEntity.setVehicleName(finalDistributionDeliverySelfEntity.getVehicleNub()); + loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); + loadscanEntity.setOneClick(2); + loadscanEntity.setScanUser(user.getUserName()); + loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId()); + loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); + loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); + loadscanEntity.setLoadedNub(parcelListEntity.getQuantity()); + loadscanEntity.setScanTime(new Date()); + if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getDriverPhone())) { + loadscanEntity.setDriverPhone(finalDistributionDeliverySelfEntity.getDriverPhone()); + } + if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getVehicleId())) { + loadscanEntity.setVehicleId(finalDistributionDeliverySelfEntity.getVehicleId()); + } + if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getDriverId())) { + loadscanEntity.setDriverId(finalDistributionDeliverySelfEntity.getDriverId()); + } + if (Func.isNotEmpty(finalDistributionDeliverySelfEntity.getId())) { + loadscanEntity.setLoadingId(finalDistributionDeliverySelfEntity.getId().toString()); + } + if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getDriverId())) { + loadscanEntity.setDriverId(finalDistributionDeliverySelfEntity.getDriverId()); + } + if (Func.isNotEmpty(parcelListEntity.getOrderPackageCode())) { + loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); + } + if (Func.isNotEmpty(parcelListEntity.getId())) { + loadscanEntity.setPackageId(parcelListEntity.getId()); + } + if (Func.isNotEmpty(parcelListEntity.getId())) { + loadscanEntity.setPackageId(parcelListEntity.getId()); + } + if (Func.isNotEmpty(parcelListEntity.getStockArticleId())) { + loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); + } + if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) { + loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); + } // parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); // distributionParcelListService.updateById(parcelListEntity); - distributionLoadscanService.save(loadscanEntity); - Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); + distributionLoadscanService.save(loadscanEntity); + Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); - Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); - warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); + Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); + warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); + } //异步修改包件状态 // distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId()); } @@ -5279,6 +5291,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl getDriverCar(String kind, Long deliveryListEntityId) { Map map = new HashMap<>(); String dirverName = null; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 15241fd34..24bfa4051 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -34,6 +34,7 @@ import com.logpm.distribution.vo.*; import com.logpm.distribution.wrapper.*; import com.logpm.oldproject.entity.WayBillEntity; import com.logpm.oldproject.feign.IWayBillClient; +import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; @@ -185,6 +186,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImplquery().lambda() + .eq(DistributionReservationPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId()) + .eq(DistributionReservationPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) + .eq(DistributionReservationPackageEntity::getParceListId, distributionRetentionScanVo.getOrderPackageId()) + .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())); + reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue()); + distributionReservationPackageMapper.updateById(reservationPackageEntity); + DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.query().lambda() + .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId()) + .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) + .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue()) + .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); + Integer reservationNum = reservationStockarticleEntity.getReservationNum(); + Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity(); + if ((reservationNum - retentionQuantity) == 0){ + reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); + } + reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity); + distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity); + reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity); + this.updateById(reservationEntity); + } + break; + case 2: + if (reservationEntity.getReservationStockListNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationNum() == 0){ + this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class)); + }else { + DisStockListDetailEntity disStockListDetailEntity = disStockListDetailMapper.selectOne(Wrappers.query().lambda() + .eq(DisStockListDetailEntity::getReservationId, distributionRetentionScanVo.getReservationId()) + .eq(DisStockListDetailEntity::getStockListId, distributionRetentionScanVo.getInventoryId()) + .eq(DisStockListDetailEntity::getId, distributionRetentionScanVo.getOrderPackageId()) + ); + disStockListDetailEntity.setStockPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); + disStockListDetailMapper.updateById(disStockListDetailEntity); + DistributionReservationStocklistEntity reservationStocklistEntity = distributionReservationStocklistMapper.selectOne(Wrappers.query().lambda() + .eq(DistributionReservationStocklistEntity::getReservationId, distributionRetentionScanVo.getReservationId()) + .eq(DistributionReservationStocklistEntity::getStocklistId, distributionRetentionScanVo.getInventoryId()) + .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue()) + ); + Integer reservationNum = reservationStocklistEntity.getReservationNum(); + + } + + + + break; + case 3: + if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){ + //该预约订单只存在该包件并且没有库存品 + this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class)); + }else { + DistributionReservationZeroPackageEntity reservationZeroPackageEntity = distributionReservationZeroPackageMapper.selectOne(Wrappers.query().lambda() + .eq(DistributionReservationZeroPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId()) + .eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) + .eq(DistributionReservationZeroPackageEntity::getParcelListId, distributionRetentionScanVo.getOrderPackageId()) + .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); + if (reservationZeroPackageEntity.getQuantity() == distributionRetentionScanVo.getRetentionQuantity()){ + reservationZeroPackageEntity.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); + } + reservationZeroPackageEntity.setQuantity(reservationZeroPackageEntity.getQuantity() -distributionRetentionScanVo.getRetentionQuantity()); + distributionReservationZeroPackageMapper.updateById(reservationZeroPackageEntity); + DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.query().lambda() + .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId()) + .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) + .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue()) + .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); + Integer reservationNum = reservationStockarticleEntity.getReservationNum(); + Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity(); + if ((reservationNum - retentionQuantity) == 0){ + reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); + } + reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity); + distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity); + reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity); + this.updateById(reservationEntity); + } + break; + + } + return false; + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index b5fb4b4db..af29032b1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -157,7 +158,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl exportDistributionSignfor(Map distributionSignfor) { Object o = distributionSignfor.get("ids"); - if(ObjectUtils.isNotNull(o)){ + if (ObjectUtils.isNotNull(o)) { distributionSignfor.remove("ids"); } // BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); @@ -468,21 +469,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl reservationStockarticleEntityList = distributionReservationStockarticleService.list(Wrappers.query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, signforEntity.getReservationId()).ne( DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); - if (Func.isEmpty(reservationStockarticleEntityList)){ - log.error("#####################预约查询无订单信息,reservationId:{}",signforEntity.getReservationId()); + if (Func.isEmpty(reservationStockarticleEntityList)) { + log.error("#####################预约查询无订单信息,reservationId:{}", signforEntity.getReservationId()); return null; } List orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); List stockArticleEntities = distributionStockArticleService.listByIds(orderIds); - List printEntities = baseMapper.selectSignImgsUrl(distributionSignforVO.getReservationId()); + List printEntities = baseMapper.selectSignImgsUrl(distributionSignforVO.getReservationId()); distributionSignforVO.setPrintVOList(printEntities); - if (Func.isNotEmpty(stockArticleEntities)){ + if (Func.isNotEmpty(stockArticleEntities)) { distributionSignforVO.setOrderInfo(DistributionStockArticleWrapper.build().listVO(stockArticleEntities)); } // List stockArticleEntityList = baseMapper.selectOrderList(id); @@ -564,7 +565,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl inventoryScanList = distributionLoadscaninvnService.list(Wrappers.query().lambda() .eq(DistributionLoadscaninvnEntity::getReservationId, distributionAppReservationVO.getId()) .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); - if (Func.isNotEmpty(packageScanList)){ + if (Func.isNotEmpty(packageScanList)) { loadingNum.getAndAdd(packageScanList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum()); } - if (Func.isNotEmpty(inventoryScanList)){ + if (Func.isNotEmpty(inventoryScanList)) { loadingNum.getAndAdd(inventoryScanList.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum()); } distributionAppReservationVO.setLoadedNumber(loadingNum.get()); @@ -1179,7 +1180,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl parcelListVOS = new ArrayList<>(); - if (Func.isNotEmpty(reservationStockarticleEntityList)){ - reservationStockarticleEntityList.forEach(rs->{ - if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())){ + if (Func.isNotEmpty(reservationStockarticleEntityList)) { + reservationStockarticleEntityList.forEach(rs -> { + if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) { List parcelListEntityList = distributionReservationMapper.selectPackageByReservationAndStockArticle(rs.getReservationId(), rs.getStockArticleId()); List parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList); parcelListVOList.forEach(p -> { @@ -1976,9 +1977,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(rs.getReservationId()); - distributionParcelNumberDTOS.forEach(zp->{ + distributionParcelNumberDTOS.forEach(zp -> { DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(zp.getParcelListId()); DistributionParcelListVO parcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity); // DistributionParcelListVO parcelListVO = Func.copy(parcelListEntity, DistributionParcelListVO.class); @@ -1988,7 +1989,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionLoadscanEntity::getPackageId, zp.getParcelListId()) - .eq(DistributionLoadscanEntity::getReservationId,rs.getReservationId())); + .eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId())); if (Func.isNotEmpty(distributionLoadscanEntity)) { //该包件存在扫描记录 String scanStatus = distributionLoadscanEntity.getScanStatus(); @@ -2078,7 +2079,34 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl addvaluePackageVOS = new ArrayList<>(); - distributionAddvaluePackageEntities.forEach(p->{addvaluePackageVOS.add(Func.copy(p,DistributionAddvaluePackageVO.class));}); + distributionAddvaluePackageEntities.forEach(p -> { + Integer conditions = p.getConditions(); +// DistributionAddvaluePackageVO addvaluePackageVO = Func.copy(p, DistributionAddvaluePackageVO.class); + switch (conditions) { + case 1: + //订制品 + DistributionAddvaluePackageVO addvaluePackageVO = distributionAddvalueMapper.selectAddvaluePackageDetail(p.getPackageId(),distributionAddvalueDTO.getAddvalueId(),distributionAddvalueDTO.getReservationId()); + if (Func.isNotEmpty(addvaluePackageVO)){ + addvaluePackageVOS.add(addvaluePackageVO); + } + break; + case 2: + DistributionAddvaluePackageVO addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageDetail(p.getPackageId(),distributionAddvalueDTO.getAddvalueId(),distributionAddvalueDTO.getReservationId()); + //库存品 + if (Func.isNotEmpty(addvalueinventoryPackageVO)){ + addvaluePackageVOS.add(addvalueinventoryPackageVO); + } + break; + case 3: + DistributionAddvaluePackageVO addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageDetail(p.getPackageId(),distributionAddvalueDTO.getAddvalueId(),distributionAddvalueDTO.getReservationId()); + //库存品 + if (Func.isNotEmpty(addvalueZeroPackageVO)){ + addvaluePackageVOS.add(addvalueZeroPackageVO); + } + break; + } + + }); addvalueBySignfor.setPackageEntityList(addvaluePackageVOS); } } @@ -2367,7 +2395,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl 0) { str.append("已签收" + signingTotalNum.get() + "件"); } - return Resp.scanSuccess("", str.toString()); + return Resp.scanSuccess(str.toString(), str.toString()); } @Override @@ -2576,4 +2604,57 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl checkAddValuePackageList(IPage page,Map addValueDTO) { + String reservationId = (String) addValueDTO.get("reservationId"); + if (Func.isEmpty(reservationId)){ + log.error("##################无reservationId"); + return null; + } + List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(Long.parseLong(reservationId)); + List addvaluePackageVOS = new ArrayList<>(); + if (Func.isNotEmpty(reservationStockarticleEntityList)){ + List orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); + LambdaQueryWrapper orderQW = Wrappers.query().lambda().in(DistributionStockArticleEntity::getId, orderIds); + if (Func.isNotEmpty(addValueDTO.get("orderCode"))){ + orderQW.like(DistributionStockArticleEntity::getOrderCode, addValueDTO.get("orderCode")); + } + List orderList = distributionStockArticleService.list(orderQW); + orderList.forEach(rs->{ + if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())){ + List addvaluepackageVO = distributionAddvalueMapper.selectAddvaluePackageVO(Long.parseLong(reservationId),rs.getId(),addValueDTO); + if (Func.isNotEmpty(addvaluepackageVO)){ + addvaluePackageVOS.addAll(addvaluepackageVO); + } + }else { + List addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageVO(Long.parseLong(reservationId),rs.getId(),addValueDTO); + if (Func.isNotEmpty(addvalueZeroPackageVO)){ + addvaluePackageVOS.addAll(addvalueZeroPackageVO); + } + } + }); + } + List distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(Long.parseLong(reservationId)); + + if (Func.isNotEmpty(distributionReservationStocklistEntities)){ + List inventoryIds = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList()); + LambdaQueryWrapper inventoryQW = Wrappers.query().lambda().in(DistributionStockListEntity::getId, inventoryIds); + if (Func.isNotEmpty(addValueDTO.get("materialName"))){ + inventoryQW.like(DistributionStockListEntity::getDescriptionGoods,(String)addValueDTO.get("materialName")); + } + if (Func.isNotEmpty(addValueDTO.get("materialCode"))){ + inventoryQW.like(DistributionStockListEntity::getCargoNumber,(String)addValueDTO.get("materialCode")); + } + List stockListEntityList = distributionStockListService.list(inventoryQW); + stockListEntityList.forEach(inven->{ + List addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageVO(Long.parseLong(reservationId),inven.getId(),addValueDTO); + if (Func.isNotEmpty(addvalueinventoryPackageVO)){ + addvaluePackageVOS.addAll(addvalueinventoryPackageVO); + } + }); + } + + return page.setRecords(addvaluePackageVOS); + } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java index e917464d8..b1bc1b387 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java @@ -79,8 +79,8 @@ public class WarehouseRetentionApiController { @ApiOperationSupport(order = 1) @ApiOperation(value = "保存滞留扫描列表", notes = "传入trayTypeDTO") public R saveRetentionList(@RequestBody WarehouseRetentionRecordDTO warehouseRetentionScanDTOS) { -// R r = warehouseRetentionRecordService.saveRetentionList(warehouseRetentionScanDTOS); - R r = warehouseRetentionScanService.saveRetentionList(warehouseRetentionScanDTOS); +// R r = warehouseRetentionScanService.saveRetentionList(warehouseRetentionScanDTOS); + R r = warehouseRetentionRecordService.saveRetentionList(warehouseRetentionScanDTOS); return r; } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java index 9e2b006ce..44b325dc6 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java @@ -19,6 +19,7 @@ package com.logpm.warehouse.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.warehouse.dto.RetentionDTO; +import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO; import com.logpm.warehouse.dto.WarehouseRetentionScanDTO; import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity; import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel; @@ -71,4 +72,11 @@ public interface IWarehouseRetentionRecordService extends BaseService exportWarehouseRetentionRecord(Wrapper queryWrapper); - R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordEntity); +// R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordEntity); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java index 2fa38976e..8f854ec29 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java @@ -29,6 +29,7 @@ import com.logpm.distribution.entity.DistributionParcelNumberEntity; import com.logpm.distribution.feign.IDistributionDeliveryListClient; import com.logpm.distribution.feign.IDistributionLoadscanClient; import com.logpm.distribution.feign.IDistributionParcelListClient; +import com.logpm.distribution.feign.IDistributionReservationClient; import com.logpm.distribution.vo.DistributionDeliveryListVO; import com.logpm.distribution.vo.DistributionDeliverySelfVO; import com.logpm.oldproject.feign.IWarehouseClient; @@ -49,10 +50,13 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.retention.RetentionTypeConstant; import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; @@ -74,6 +78,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionRecordVO warehouseRetentionRecord) { @@ -159,4 +164,41 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl warehouseRetentionScanDTOS = warehouseRetentionRecordDTO.getWarehouseRetentionScanDTOS(); + if (Func.isEmpty(warehouseRetentionScanDTOS)){ + log.error("############用户提交空滞留列表"); + return Resp.scanFail("操作失败","无滞留包件信息"); + } + BladeUser user = AuthUtil.getUser(); + //TODO 保存车次数据还需要处理 + WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = new WarehouseRetentionRecordEntity(); + warehouseRetentionRecordEntity.setTaskId(warehouseRetentionRecordDTO.getDeliveryId()); + warehouseRetentionRecordEntity.setRemark(warehouseRetentionRecordDTO.getRemark()); + warehouseRetentionRecordEntity.setRetentionCarNo(warehouseRetentionRecordDTO.getTrainNumber()); + warehouseRetentionRecordEntity.setRetentionCarId(warehouseRetentionRecordDTO.getLoadingId()); + warehouseRetentionRecordEntity.setRetentionWarehouseId(myCurrentWarehouse.getId()); + warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName()); + warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName()); + warehouseRetentionRecordEntity.setRetentionCreateUserId(user.getUserId()); + warehouseRetentionRecordEntity.setRetentionCreateUserName(user.getUserName()); + this.save(warehouseRetentionRecordEntity); + warehouseRetentionScanDTOS.forEach(r->{ + r.setRetentionScanTime(new Date()); + r.setRetentionScanUserId(user.getUserId()); + r.setRetentionScanUsername(user.getUserName()); + r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId()); + r.setRefId(warehouseRetentionRecordEntity.getId()); + warehouseRetentionScanService.save(Func.copy(r,WarehouseRetentionScanEntity.class)); + //进行滞留操作的包件需要和原来订单 预约进行绑定解除 + //TODO 需要一个取消配送包件的方法 + }); + return Resp.scanSuccess("操作成功","操作成功"); + } + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java index 25ca4f822..85be65a06 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java @@ -25,16 +25,22 @@ import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity; import com.logpm.warehouse.entity.WarehouseRetentionScanEntity; import com.logpm.warehouse.excel.WarehouseRetentionScanExcel; import com.logpm.warehouse.mapper.WarehouseRetentionScanMapper; +import com.logpm.warehouse.service.IWarehouseRetentionRecordService; import com.logpm.warehouse.service.IWarehouseRetentionScanService; import com.logpm.warehouse.vo.WarehouseRetentionRecordVO; import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel; import com.logpm.warehouse.vo.WarehouseRetentionScanVO; +import lombok.AllArgsConstructor; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.Date; import java.util.List; /** @@ -44,11 +50,14 @@ import java.util.List; * @since 2023-11-03 */ @Service +@AllArgsConstructor public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl implements IWarehouseRetentionScanService { private IBasicdataWarehouseClient warehouseClient; +// private IWarehouseRetentionRecordService retentionRecordService; + @Override public IPage selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionScanVO warehouseRetentionScanVO) { return page.setRecords(baseMapper.selectWarehouseRetentionRecordPage(page, warehouseRetentionScanVO)); @@ -64,28 +73,38 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl warehouseRetentionScanDTOS = warehouseRetentionRecordDTO.getWarehouseRetentionScanDTOS(); - if (Func.isEmpty(warehouseRetentionScanDTOS)){ - log.error("############用户提交空滞留列表"); - return Resp.scanFail("操作失败","无滞留包件信息"); - } - //TODO 保存车次数据还需要处理 - WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = new WarehouseRetentionRecordEntity(); - warehouseRetentionRecordEntity.setTaskId(warehouseRetentionRecordDTO.getDeliveryId()); - warehouseRetentionRecordEntity.setRemark(warehouseRetentionRecordDTO.getRemark()); - warehouseRetentionRecordEntity.setRetentionCarNo(warehouseRetentionRecordDTO.getTrainNumber()); - warehouseRetentionRecordEntity.setRetentionCarId(warehouseRetentionRecordDTO.getLoadingId()); - warehouseRetentionRecordEntity.setRetentionWarehouseId(myCurrentWarehouse.getId()); - warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName()); - warehouseRetentionScanDTOS.forEach(r->{ - this.save(Func.copy(r,WarehouseRetentionScanEntity.class)); - }); - return Resp.scanSuccess("操作成功","操作成功"); - } +// @Override +// public R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordDTO) { +// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); +// if (Func.isEmpty(myCurrentWarehouse)){ +// return null; +// } +// List warehouseRetentionScanDTOS = warehouseRetentionRecordDTO.getWarehouseRetentionScanDTOS(); +// if (Func.isEmpty(warehouseRetentionScanDTOS)){ +// log.error("############用户提交空滞留列表"); +// return Resp.scanFail("操作失败","无滞留包件信息"); +// } +// BladeUser user = AuthUtil.getUser(); +// //TODO 保存车次数据还需要处理 +// WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = new WarehouseRetentionRecordEntity(); +// warehouseRetentionRecordEntity.setTaskId(warehouseRetentionRecordDTO.getDeliveryId()); +// warehouseRetentionRecordEntity.setRemark(warehouseRetentionRecordDTO.getRemark()); +// warehouseRetentionRecordEntity.setRetentionCarNo(warehouseRetentionRecordDTO.getTrainNumber()); +// warehouseRetentionRecordEntity.setRetentionCarId(warehouseRetentionRecordDTO.getLoadingId()); +// warehouseRetentionRecordEntity.setRetentionWarehouseId(myCurrentWarehouse.getId()); +// warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName()); +// warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName()); +// warehouseRetentionRecordEntity.setRetentionCreatedUserId(user.getUserId()); +// warehouseRetentionRecordEntity.setRetentionCreatedUserName(user.getUserName()); +// retentionRecordService.save(warehouseRetentionRecordEntity); +// warehouseRetentionScanDTOS.forEach(r->{ +// r.setRetentionScanTime(new Date()); +// r.setRetentionScanUserId(user.getUserId()); +// r.setRetentionScanUsername(user.getUserName()); +// r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId()); +// r.setRefId(warehouseRetentionRecordEntity.getId()); +// this.save(Func.copy(r,WarehouseRetentionScanEntity.class)); +// }); +// return Resp.scanSuccess("操作成功","操作成功"); +// } }