From 9d1fd693b9e120657f1c66c3d10de37f9b8d6af4 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 8 Jan 2025 09:22:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2=EF=BC=8C=E8=BF=99=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=96=B9=E5=BC=8F=E5=AD=98=E5=9C=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E9=9C=80=E8=A6=81=E8=80=83=E8=99=91=E8=B5=B0?= =?UTF-8?q?fengin=E7=9A=84=E6=96=B9=E5=BC=8F=20=E7=9B=B4=E6=8E=A5=E5=B8=A6?= =?UTF-8?q?=E4=B8=8A=E6=95=B0=E6=8D=AE=E5=BA=93=E5=90=8D=E7=A7=B0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=96=B9=E5=BC=8F=E4=B8=8D=E5=A4=AA=E5=8F=AF=E5=8F=96?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/ModuleNameConstant.java | 2 +- .../com/logpm/datasharing/vo/NodeInfoVO.java | 54 +++++++++++++++++++ .../logpm/datasharing/vo/WaybillInfoVO.java | 5 +- .../impl/LogpmDataSearchServiceImpl.java | 28 ++++++++++ 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java index ff9f81986..13dc1795b 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java @@ -9,7 +9,7 @@ public interface ModuleNameConstant { /** * 如果不需要 "" */ - public static final String DEVAUTH =""; + public static final String DEVAUTH ="-pref"; /** * 工厂对接服务名称 diff --git a/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java new file mode 100644 index 000000000..9f3e547de --- /dev/null +++ b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java @@ -0,0 +1,54 @@ +package com.logpm.datasharing.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class NodeInfoVO implements Serializable { + + + private static final long serialVersionUID = 1L; + + /** + * 操作节点 入库-干线发车-干线到达-目的仓配送装车-目的仓配送签收 + */ + @ApiModelProperty(value = "操作节点") + private String operateName; + + /** + * 操作网点 + */ + @ApiModelProperty(value = "操作网点") + private String operateWarehouseName; + + + /** + * 操作时间 + */ + @ApiModelProperty(value = "操作时间") + private Date operateTime; + + + /** + * 操作件数 + */ + @ApiModelProperty(value = "操作件数") + private String operateNumber; + + /** + * 操作车次号 + */ + @ApiModelProperty(value = "操作车次号") + private String operateCarNumber; + + + /** + * 操作计划时间 + */ + @ApiModelProperty(value = "操作计划时间") + private Date operatePlanTime; + +} diff --git a/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java index fe661bb55..85fc8632f 100644 --- a/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java +++ b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java @@ -83,7 +83,7 @@ public class WaybillInfoVO implements Serializable { /** * 在途数量 */ - @ApiModelProperty(value = "总数") + @ApiModelProperty(value = "在途数量") private Integer onWayCount; @@ -131,6 +131,9 @@ public class WaybillInfoVO implements Serializable { @ApiModelProperty(value = "签收数量") private Integer signNum; + @ApiModelProperty(value = "节点信息") + private List nodeInfoVOList; + diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java index 865f170b9..a9f040d4e 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java @@ -1,6 +1,7 @@ package com.logpm.datasharing.service.impl; import com.logpm.datasharing.service.ILogpmDataSearchService; +import com.logpm.datasharing.vo.NodeInfoVO; import com.logpm.datasharing.vo.WarehouseNumberVO; import com.logpm.datasharing.vo.WaybillInfoVO; import com.logpm.distribution.entity.DistributionParcelListEntity; @@ -118,10 +119,37 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { result.setOnWayCount(result.getTotalCount()-temp); + // 增加节点信息 + List nodeInfoVOList = new ArrayList<>();; + + // 入库 + NodeInfoVO nodeInfoVO =buildFristRuKu(groupedByWarehouse,result.getDepartureWarehouseName(),result.getTotalCount()); + nodeInfoVOList.add(nodeInfoVO); + + + + + + + return result; } + private NodeInfoVO buildFristRuKu(Map> groupedByWarehouse, String departureWarehouseName,Integer totalCount) { + + NodeInfoVO nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("入库"); + nodeInfoVO.setOperateWarehouseName(departureWarehouseName); + List distributionParcelListEntities = groupedByWarehouse.get(departureWarehouseName); + // 获取第一个时间 + nodeInfoVO.setOperateTime(distributionParcelListEntities.get(0).getCreateTime()); + nodeInfoVO.setOperateNumber(distributionParcelListEntities.size()+"/"+totalCount); + + return nodeInfoVO; + } + + private String changeStatusName(String waybillStatus) { if(waybillStatus==null){ From 7def35fccdba9751238baf940987b65d6da3715b Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 8 Jan 2025 17:17:43 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=9F=A5=E8=AF=A2=20=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=8E=9F=E5=9E=8B=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/datasharing/vo/NodeInfoVO.java | 6 + .../logpm/datasharing/vo/WaybillInfoVO.java | 51 ++- .../feign/IDistributionParcelListClient.java | 2 + .../feign/IQualityDeliverClient.java | 19 +- .../feign/ITrunklineCarsLoadScanClient.java | 12 + blade-service/logpm-data-sharing/pom.xml | 10 + .../impl/LogpmDataSearchServiceImpl.java | 369 +++++++++++++++--- .../feign/DistributionParcelListClient.java | 5 + .../feign/QualityDeliverClient.java | 17 + .../mapper/DistributionParcelListMapper.java | 1 + .../mapper/DistributionParcelListMapper.xml | 13 +- .../IDistributionParcelListService.java | 2 + .../DistributionParcelListServiceImpl.java | 5 + .../com/logpm/report/ReportApplication.java | 2 +- .../feign/TrunklineCarsLoadScanClient.java | 17 + 15 files changed, 448 insertions(+), 83 deletions(-) diff --git a/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java index 9f3e547de..d3855ad18 100644 --- a/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java +++ b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java @@ -25,6 +25,12 @@ public class NodeInfoVO implements Serializable { private String operateWarehouseName; + /** + * 操作网点电话 + */ + @ApiModelProperty(value = "操作网点电话") + private String operateWarehousePhone; + /** * 操作时间 */ diff --git a/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java index 85fc8632f..29974a036 100644 --- a/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java +++ b/blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java @@ -14,26 +14,29 @@ import java.util.List; public class WaybillInfoVO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "联系电话") + private String contactNumber; + /** * 运单状态 10部分入库 - * + *

* 20入库 - * + *

* 30部分中转 - * + *

* 40 中转 - * + *

* 50 目的仓部分到达 - * + *

* 60 目的仓到达 - * + *

* 70 配送部分装车 - * + *

* 80 配送装车 - * + *

* 90 部分签收 - * + *

* 100 已签收 */ @ApiModelProperty(value = "运单状态") @@ -46,6 +49,13 @@ public class WaybillInfoVO implements Serializable { @ApiModelProperty(value = "运单号") private String waybillNo; + + /** + * 订单号 + */ + @ApiModelProperty(value = "订单号") + private String orderCode; + /** * 目的仓 */ @@ -53,7 +63,6 @@ public class WaybillInfoVO implements Serializable { private String destinationWarehouseName; - /** * 发站仓 */ @@ -76,15 +85,14 @@ public class WaybillInfoVO implements Serializable { /** * 总数 */ - @ApiModelProperty(value = "总数") + @ApiModelProperty(value = "运单总数") private Integer totalCount; - /** - * 在途数量 + * 订单总数 */ - @ApiModelProperty(value = "在途数量") - private Integer onWayCount; + @ApiModelProperty(value = "订单总数") + private Integer orderCount; /** @@ -119,22 +127,9 @@ public class WaybillInfoVO implements Serializable { @ApiModelProperty(value = "目的仓数量信息") private WarehouseNumberVO endWarehouseNumber; - /** - * 配送数量 - */ - @ApiModelProperty(value = "配送数量") - private Integer deliveryNum ; - - /** - * 签收数量 - */ - @ApiModelProperty(value = "签收数量") - private Integer signNum; @ApiModelProperty(value = "节点信息") private List nodeInfoVOList; - - } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index cca230fd8..a89ff380d 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -174,6 +174,8 @@ public interface IDistributionParcelListClient { @GetMapping(API_PREFIX + "/findByWaybillNumber") List findByWaybillNumber(@RequestParam String waybillNumber); + @GetMapping(API_PREFIX + "/findByWaybillNumberAndOrderCode") + List findByWaybillNumberAndOrderCode(@RequestParam String waybillNumber, @RequestParam String orderCode); @GetMapping(API_PREFIX + "/findEntityListByOrderCodeAndStatus") List findEntityListByOrderCodeAndStatus(@RequestParam String orderCode, @RequestParam Long warehouseId, @RequestParam String packageStatus, @RequestParam String waybillNo); diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java index 606f3c382..da0371095 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java @@ -44,12 +44,29 @@ public interface IQualityDeliverClient { /** * 获取通知提货记录列表 * - * @param signTime 签收时间 + * @param signTime 签收时间 * @return BladePage */ @GetMapping(API_PREFIX + "/findSignListByDate") List findSignListByDate(@RequestParam("signTime") String signTime); + + /** + * 更具运单号查询配送信息 + * + * @param waybillNumber + * @return + */ + @GetMapping(API_PREFIX + "/findDeliverByWaybillNumber") + List findSignListByWaybillNumber(@RequestParam("waybillNumber") String waybillNumber); + + @GetMapping(API_PREFIX + "/findSignListByWaybillNumberAndOrderCode") + List findSignListByWaybillNumberAndOrderCode(@RequestParam("waybillNumber") String waybillNumber,@RequestParam("orderCode") String orderCode); + + + + + @PostMapping(API_PREFIX + "/updateWarehouseCost") void updateWarehouseCost(@RequestBody Map packageCostMap); diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java index 31d21c9f1..f4c033784 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java @@ -40,6 +40,18 @@ public interface ITrunklineCarsLoadScanClient { void removeLoadScanByIds(@RequestBody List scanloadIdList); + /** + * 根据运单号查询车辆的装车信息 + * @param waybillNo + * @return + */ + @GetMapping(API_PREFIX+"/findAllListByWaybillNo") + List findAllListByWaybillNo(@RequestParam String waybillNo); + + @GetMapping(API_PREFIX+"/findAllListByWaybillNoAndOrderCode") + List findAllListByWaybillNoAndOrderCode(@RequestParam String waybillNo,@RequestParam String orderCode); + + // @PostMapping(API_PREFIX+"/addAdvanceReturnId") // Long addAdvanceReturnId(@RequestBody TrunklineAdvanceEntity trunklineAdvanceEntity); diff --git a/blade-service/logpm-data-sharing/pom.xml b/blade-service/logpm-data-sharing/pom.xml index 893a94e33..ea2f835d1 100644 --- a/blade-service/logpm-data-sharing/pom.xml +++ b/blade-service/logpm-data-sharing/pom.xml @@ -40,11 +40,21 @@ logpm-warehouse-api 3.2.0.RELEASE + + org.springblade + logpm-trunkline-api + 3.2.0.RELEASE + org.springblade logpm-data-sharing-api 3.2.0.RELEASE + + org.springblade + blade-system-api + 3.2.0.RELEASE + diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java index a9f040d4e..1b30ddc42 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java @@ -1,16 +1,27 @@ package com.logpm.datasharing.service.impl; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.datasharing.service.ILogpmDataSearchService; import com.logpm.datasharing.vo.NodeInfoVO; import com.logpm.datasharing.vo.WarehouseNumberVO; import com.logpm.datasharing.vo.WaybillInfoVO; import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.entity.QualityDeliverEntity; import com.logpm.distribution.feign.IDistributionParcelListClient; +import com.logpm.distribution.feign.IQualityDeliverClient; +import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; +import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity; +import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient; +import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; import org.springblade.common.exception.CustomerException; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.system.entity.Tenant; +import org.springblade.system.feign.ISysClient; import org.springframework.stereotype.Service; import java.util.*; @@ -23,6 +34,11 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { private final IWarehouseWaybillClient warehouseWaybillClient; private final IDistributionParcelListClient distributionParcelListClient; + private final ITrunklineCarsLoadScanClient traceCarsLoadScanClient; + private final IQualityDeliverClient questualityDeliverClient; + private final IBasicdataWarehouseClient basicdataWarehouseClient; + private final ISysClient systemClient; + private final ITrunklineWaybillOrderClient trunklineWaybillOrderClient; @Override public R data(String type, String order) { @@ -33,10 +49,9 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { case "order": // 订单查询 return dataOrder(order); - case "waybill": // 运单查询 - return R.data(dataWEaybill(order)) ; + return R.data(dataWEaybill(order)); default: // 需要没有参数的查询全部的情况 return R.fail("参数错误"); @@ -47,18 +62,177 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { /** * 运单查询 + * + * @param waybillNo + * @return + */ + private WaybillInfoVO dataWEaybillByOrderCode(String waybillNo,String orderCode) { + + WaybillInfoVO result = new WaybillInfoVO(); + // todo 查询运单 + WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillNo); + if (Objects.isNull(byWaybillNo)) { + throw new CustomerException("运单信息不存在~"); + } + + // 获取租户信息 + R tenant = systemClient.getTenant(AuthUtil.getTenantId()); + if (tenant.isSuccess() && !Objects.isNull(tenant.getData())) { + Tenant data = tenant.getData(); + result.setContactNumber(data.getContactNumber()); + + } + result.setOrderCode(orderCode); + // 获取到订单在这个运单的件数 + TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = trunklineWaybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNo, orderCode); + if(entityByWaybillNoAndOrderCode != null){ + result.setOrderCount(entityByWaybillNoAndOrderCode.getTotalNumber()); + } + + + result.setWaybillNo(byWaybillNo.getWaybillNo()); + result.setDestinationWarehouseName(byWaybillNo.getDestinationWarehouseName()); + result.setDepartureWarehouseName(byWaybillNo.getDepartureWarehouseName()); + result.setShipper(byWaybillNo.getShipper()); + result.setShipperName(byWaybillNo.getShipperName()); + result.setConsignee(byWaybillNo.getConsignee()); + result.setConsigneeName(byWaybillNo.getConsigneeName()); + result.setTotalCount(byWaybillNo.getTotalCount()); + + List distributionParcelListEntities = distributionParcelListClient.findByWaybillNumberAndOrderCode(waybillNo,orderCode); + // 按照仓库ID进行分组 + Map> groupedByWarehouse = distributionParcelListEntities.stream() + .collect(Collectors.groupingBy(DistributionParcelListEntity::getWarehouse)); + + // 判断当前map 中的key长度 + Set keys = groupedByWarehouse.keySet(); + List models = null; + for (String key : keys) { + if (models == null) { + models = new ArrayList<>(); + } + WarehouseNumberVO middleWarehouseNumberVO = buildWarehouse(groupedByWarehouse, key); + if(middleWarehouseNumberVO!=null){ + models.add(middleWarehouseNumberVO); + } + } + // 加入中转的数据 + result.setMiddleWarehouseNumber(models); + + // 运单状态 + result.setStatusName(changeStatusName(byWaybillNo.getWaybillStatus())); + + + // 增加节点信息 + List nodeInfoVOList = new ArrayList<>(); + + // 入库 + NodeInfoVO nodeInfoVO = buildFristRuKu(groupedByWarehouse, result.getDepartureWarehouseName(), result.getTotalCount()); + if(nodeInfoVO != null){ + nodeInfoVOList.add(nodeInfoVO); + } + + + // 干线发车 + List allListByWaybillNo = traceCarsLoadScanClient.findAllListByWaybillNoAndOrderCode(waybillNo,orderCode); + + if (allListByWaybillNo != null && !allListByWaybillNo.isEmpty()) { + // 按照 车次号进行分组 + Map> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadCode)); + Set strings = groupedByLoadId.keySet(); + for (String key : strings) { + + List trunklineCarsLoadScanEntities = groupedByLoadId.get(key); + //干线发车 + nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, key); + if (nodeInfoVO != null) { + nodeInfoVOList.add(nodeInfoVO); + } + // 干线到达 + nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, key); + if (nodeInfoVO != null) { + nodeInfoVOList.add(nodeInfoVO); + } + + } + } + + + List signListByWaybillNumber = questualityDeliverClient.findSignListByWaybillNumberAndOrderCode(waybillNo,orderCode); + + if (signListByWaybillNumber != null && !signListByWaybillNumber.isEmpty()) { + + //统计装车数量load_num + int loadNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getLoadNum).sum(); + + // 计划配送数 plan_num + int planNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getPlanNum).sum(); + + // 计算签收数量sign_num + int signNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getSignNum).sum(); + + // 配送装车 + QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.get(0); + if (loadNum != 0) { + nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("配送装车"); + nodeInfoVO.setOperateNumber(loadNum + ""); + nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime()); + // 增加网点电话 + BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); + if (entityWarehouseId != null) { + nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + } + + nodeInfoVOList.add(nodeInfoVO); + } + + if (planNum != 0) { + nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("配送签收"); + nodeInfoVO.setOperateNumber(signNum + "/" + loadNum); + nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime()); + // 增加网点电话 + BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); + if (entityWarehouseId != null) { + nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + } + nodeInfoVOList.add(nodeInfoVO); + } + result.setNodeInfoVOList(nodeInfoVOList); + + } + // 配送签收 + + return result; + } + + + /** + * 运单查询 + * * @param waybillNo * @return */ private WaybillInfoVO dataWEaybill(String waybillNo) { WaybillInfoVO result = new WaybillInfoVO(); - int temp =0; // todo 查询运单 WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillNo); - if(Objects.isNull(byWaybillNo)){ + if (Objects.isNull(byWaybillNo)) { throw new CustomerException("运单信息不存在~"); } + + // 获取租户信息 + R tenant = systemClient.getTenant(AuthUtil.getTenantId()); + if (tenant.isSuccess() && !Objects.isNull(tenant.getData())) { + Tenant data = tenant.getData(); + result.setContactNumber(data.getContactNumber()); + + } + result.setWaybillNo(byWaybillNo.getWaybillNo()); result.setDestinationWarehouseName(byWaybillNo.getDestinationWarehouseName()); result.setDepartureWarehouseName(byWaybillNo.getDepartureWarehouseName()); @@ -68,75 +242,172 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { result.setConsigneeName(byWaybillNo.getConsigneeName()); result.setTotalCount(byWaybillNo.getTotalCount()); - List distributionParcelListEntities = distributionParcelListClient.findByWaybillNumber(waybillNo); + List distributionParcelListEntities = distributionParcelListClient.findByWaybillNumber(waybillNo); // 按照仓库ID进行分组 - Map> groupedByWarehouse= distributionParcelListEntities.stream() + Map> groupedByWarehouse = distributionParcelListEntities.stream() .collect(Collectors.groupingBy(DistributionParcelListEntity::getWarehouse)); // 获取始发仓的入库数据 - WarehouseNumberVO startWarehouseNumber =buildWarehouse(groupedByWarehouse,result.getDepartureWarehouseName()); +// WarehouseNumberVO startWarehouseNumber = buildWarehouse(groupedByWarehouse, result.getDepartureWarehouseName()); // 移除当前的仓库 - groupedByWarehouse.remove(result.getDepartureWarehouseName()); - result.setStartWarehouseNumber(startWarehouseNumber); - temp +=startWarehouseNumber!=null?startWarehouseNumber.getNumber():0; +// groupedByWarehouse.remove(result.getDepartureWarehouseName()); +// result.setStartWarehouseNumber(startWarehouseNumber); /*********************************m目的仓 start********************************/ - String destinationWarehouseName = result.getDestinationWarehouseName(); - WarehouseNumberVO endWarehouseNumber=buildWarehouse(groupedByWarehouse,destinationWarehouseName); - temp +=endWarehouseNumber!=null?endWarehouseNumber.getNumber():0; - // 计算预约数量 - List end = groupedByWarehouse.get(destinationWarehouseName); - - if(end!=null){ - int resNum = end.stream().filter(t->"20".equals(t.getOrderPackageReservationStatus())).mapToInt(DistributionParcelListEntity::getQuantity).sum(); - result.setDeliveryNum(resNum); - } +// String destinationWarehouseName = result.getDestinationWarehouseName(); +// WarehouseNumberVO endWarehouseNumber = buildWarehouse(groupedByWarehouse, destinationWarehouseName); - groupedByWarehouse.remove(result.getDestinationWarehouseName()); - result.setEndWarehouseNumber(endWarehouseNumber); +// groupedByWarehouse.remove(result.getDestinationWarehouseName()); +// result.setEndWarehouseNumber(endWarehouseNumber); /*********************************m目的仓 end********************************/ // 判断当前map 中的key长度 Set keys = groupedByWarehouse.keySet(); List models = null; for (String key : keys) { - if(models==null){ + if (models == null) { models = new ArrayList<>(); } - WarehouseNumberVO middleWarehouseNumberVO = buildWarehouse(groupedByWarehouse,key); - models.add(middleWarehouseNumberVO); - temp +=middleWarehouseNumberVO!=null?middleWarehouseNumberVO.getNumber():0; + WarehouseNumberVO middleWarehouseNumberVO = buildWarehouse(groupedByWarehouse, key); + if(middleWarehouseNumberVO != null){ + models.add(middleWarehouseNumberVO); + } } // 加入中转的数据 result.setMiddleWarehouseNumber(models); - // 查询运单的签收数量 - result.setSignNum(byWaybillNo.getSignNum()); - // 运单状态 - result.setStatusName(changeStatusName(byWaybillNo.getWaybillStatus())); - // 计算在途数量 - result.setOnWayCount(result.getTotalCount()-temp); - // 增加节点信息 - List nodeInfoVOList = new ArrayList<>();; + List nodeInfoVOList = new ArrayList<>(); // 入库 - NodeInfoVO nodeInfoVO =buildFristRuKu(groupedByWarehouse,result.getDepartureWarehouseName(),result.getTotalCount()); - nodeInfoVOList.add(nodeInfoVO); + NodeInfoVO nodeInfoVO = buildFristRuKu(groupedByWarehouse, result.getDepartureWarehouseName(), result.getTotalCount()); + if(nodeInfoVO != null){ + nodeInfoVOList.add(nodeInfoVO); + } + + + // 干线发车 + List allListByWaybillNo = traceCarsLoadScanClient.findAllListByWaybillNo(waybillNo); + + if (allListByWaybillNo != null && !allListByWaybillNo.isEmpty()) { + // 按照 车次号进行分组 + Map> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadCode)); + Set strings = groupedByLoadId.keySet(); + for (String key : strings) { + + List trunklineCarsLoadScanEntities = groupedByLoadId.get(key); + //干线发车 + nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, key); + if (nodeInfoVO != null) { + nodeInfoVOList.add(nodeInfoVO); + } + // 干线到达 + nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, key); + if (nodeInfoVO != null) { + nodeInfoVOList.add(nodeInfoVO); + } + + } + } + + + List signListByWaybillNumber = questualityDeliverClient.findSignListByWaybillNumber(waybillNo); + + if (signListByWaybillNumber != null && !signListByWaybillNumber.isEmpty()) { + + //统计装车数量load_num + int loadNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getLoadNum).sum(); + // 计划配送数 plan_num + int planNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getPlanNum).sum(); + // 计算签收数量sign_num + int signNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getSignNum).sum(); + // 配送装车 + QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.get(0); + if (loadNum != 0) { + nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("配送装车"); + nodeInfoVO.setOperateNumber(loadNum + ""); + nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime()); + // 增加网点电话 + BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); + if (entityWarehouseId != null) { + nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + } + nodeInfoVOList.add(nodeInfoVO); + } + + if (planNum != 0) { + nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("配送签收"); + nodeInfoVO.setOperateNumber(signNum + "/" + loadNum); + nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime()); + // 增加网点电话 + BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); + if (entityWarehouseId != null) { + nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + } + nodeInfoVOList.add(nodeInfoVO); + } + + result.setNodeInfoVOList(nodeInfoVOList); + } + + // 配送签收 return result; } - private NodeInfoVO buildFristRuKu(Map> groupedByWarehouse, String departureWarehouseName,Integer totalCount) { + private NodeInfoVO buildTrunklineByUnLoadCar(List trunklineCarsLoadScanEntities, String key) { + + // 获取卸车集合 + List collect = trunklineCarsLoadScanEntities.stream().filter(t -> t.getScanStatus().equals("2")).collect(Collectors.toList()); + + if (collect.isEmpty()) { + return null; + } + TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = collect.get(0); + NodeInfoVO nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("干线到达"); + nodeInfoVO.setOperateNumber(collect.size() + ""); + nodeInfoVO.setOperateWarehouseName(trunklineCarsLoadScanEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(trunklineCarsLoadScanEntity.getCreateTime()); + return nodeInfoVO; + + } + + private NodeInfoVO buildTrunklineByLoadCar(List trunklineCarsLoadScanEntities, String key) { + + // 判断trunklineCarsLoadScanEntities 中 warehouseId 不是null的集合 + List collect = trunklineCarsLoadScanEntities.stream().filter(t -> t.getWarehouseId() != null).collect(Collectors.toList()); + if (collect.isEmpty()) { + return null; + } + TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = collect.get(0); + NodeInfoVO nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("干线发车"); + nodeInfoVO.setOperateNumber(collect.size() + ""); + nodeInfoVO.setOperateWarehouseName(trunklineCarsLoadScanEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(trunklineCarsLoadScanEntity.getCreateTime()); + return nodeInfoVO; + } + + private NodeInfoVO buildFristRuKu(Map> groupedByWarehouse, String departureWarehouseName, Integer totalCount) { + + + if(groupedByWarehouse.isEmpty()){ + return null; + } NodeInfoVO nodeInfoVO = new NodeInfoVO(); nodeInfoVO.setOperateName("入库"); @@ -144,7 +415,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { List distributionParcelListEntities = groupedByWarehouse.get(departureWarehouseName); // 获取第一个时间 nodeInfoVO.setOperateTime(distributionParcelListEntities.get(0).getCreateTime()); - nodeInfoVO.setOperateNumber(distributionParcelListEntities.size()+"/"+totalCount); + nodeInfoVO.setOperateNumber(distributionParcelListEntities.size() + "/" + totalCount); return nodeInfoVO; } @@ -152,11 +423,11 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { private String changeStatusName(String waybillStatus) { - if(waybillStatus==null){ - waybillStatus=""; + if (waybillStatus == null) { + waybillStatus = ""; } - switch (waybillStatus){ + switch (waybillStatus) { case "20": return "已入库"; @@ -187,22 +458,18 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { } - - - - } - private WarehouseNumberVO buildWarehouse(Map> groupedByWarehouse,String warehouseName){ + private WarehouseNumberVO buildWarehouse(Map> groupedByWarehouse, String warehouseName) { List end = groupedByWarehouse.get(warehouseName); - if(end==null){ + if (end == null) { return null; } // 获取始发仓的在库数量 - int num = end.stream().filter(t->"20".equals(t.getOrderPackageStatus()) && t.getQuantity()!=0).mapToInt(DistributionParcelListEntity::getQuantity).sum(); - if(num != 0) { + int num = end.stream().filter(t -> "20".equals(t.getOrderPackageStatus()) && t.getQuantity() != 0).mapToInt(DistributionParcelListEntity::getQuantity).sum(); + if (num != 0) { WarehouseNumberVO endWarehouseNumber = new WarehouseNumberVO(); endWarehouseNumber.setNumber(num); endWarehouseNumber.setWarehouseName(warehouseName); @@ -215,8 +482,6 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { } - - private R dataOrder(String order) { // 通过订单查询运单号 List waybillVOByOrderCode = warehouseWaybillClient.findWaybillVOByOrderCode(order); @@ -226,7 +491,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { Set keys = groupedByWaybillNo.keySet(); List data = new ArrayList<>(); for (String key : keys) { - WaybillInfoVO waybillInfoVO = dataWEaybill(key); + WaybillInfoVO waybillInfoVO = dataWEaybillByOrderCode(key,order); data.add(waybillInfoVO); } return R.data(data); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index 8b3ec77a6..11052b0b4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -345,6 +345,11 @@ public class DistributionParcelListClient implements IDistributionParcelListClie return distributionParcelListService.findByWaybillNumber(waybillNumber); } + @Override + public List findByWaybillNumberAndOrderCode(String waybillNumber,String orderCode) { + return distributionParcelListService.findByWaybillNumberAndOrderCode(waybillNumber,orderCode); + } + @Override public List findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus, @RequestParam String waybillNo) { return distributionParcelListService.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, packageStatus, waybillNo); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java index 72ad30126..ba7f6c5c0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java @@ -78,4 +78,21 @@ public class QualityDeliverClient implements IQualityDeliverClient { qualityDeliverService.updateBatchById(list); } } + + @Override + public List findSignListByWaybillNumber(String waybillNumber) { + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(QualityDeliverEntity::getWaybillNumber,waybillNumber); + return qualityDeliverService.list(lambdaQueryWrapper); + } + + @Override + public List findSignListByWaybillNumberAndOrderCode(String waybillNumber, String orderCode) { + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(QualityDeliverEntity::getWaybillNumber,waybillNumber); + lambdaQueryWrapper.eq(QualityDeliverEntity::getOrderCode,orderCode); + return qualityDeliverService.list(lambdaQueryWrapper); + } } 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 118f4dcff..030a4b22b 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 @@ -171,6 +171,7 @@ public interface DistributionParcelListMapper extends BaseMapper> selectAllErrorReservationOrder(); List findByWaybillNumber(@Param("waybillNumber") String waybillNumber); + List findByWaybillNumberAndOrderCode(@Param("waybillNumber") String waybillNumber,@Param("orderCode") String orderCode); /** * 还原包件状态 -- 未出库 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 509ccd6b9..619e72775 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 @@ -2303,6 +2303,18 @@ limit 1 + + - diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java index b5e8ffedf..b86bc8e89 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java @@ -30,18 +30,18 @@ public class BillingDataServiceImpl implements IBillingDataService { public BillingDataVO getBillingData() { // 今天的数据 BillingDataInfoVO today = billingDataMapper.getBillingData( - DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"), - DateUtil.format(new Date(), "yyyy-MM-dd 23:59:59") + DateUtil.format(new Date(), "2024-MM-dd 00:00:00"), + DateUtil.format(new Date(), "2024-MM-dd 23:59:59") ); // 当月的数据 BillingDataInfoVO month = billingDataMapper.getBillingData( - DateUtil.format(new Date(), "yyyy-MM-01 00:00:00"), - DateUtil.format(new Date(), "yyyy-MM-31 23:59:59") + DateUtil.format(new Date(), "2024-MM-01 00:00:00"), + DateUtil.format(new Date(), "2024-MM-31 23:59:59") ); // 年的数据 BillingDataInfoVO year = billingDataMapper.getBillingData( - DateUtil.format(new Date(), "yyyy-01-01 00:00:00"), - DateUtil.format(new Date(), "yyyy-12-31 23:59:59") + DateUtil.format(new Date(), "2024-01-01 00:00:00"), + DateUtil.format(new Date(), "2024-12-31 23:59:59") ); BillingDataVO billingDataVO = new BillingDataVO(); @@ -55,9 +55,14 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getWarehouseBillingData() { List warehouselist = mapWarehouseMapper.warehouselist(); +// List warehouseBillingData = billingDataMapper.getWarehouseBillingData( +// DateUtil.format(new Date(), "yyyy-01-01 00:00:00"), +// DateUtil.format(new Date(), "yyyy-12-31 23:59:59") +// ); + List warehouseBillingData = billingDataMapper.getWarehouseBillingData( - DateUtil.format(new Date(), "yyyy-01-01 00:00:00"), - DateUtil.format(new Date(), "yyyy-12-31 23:59:59") + DateUtil.format(new Date(), "2024-01-01 00:00:00"), + DateUtil.format(new Date(), "2024-12-31 23:59:59") ); Map warehouseBillingDataMap = warehouselist.stream().collect(Collectors.toMap(WarehouseInfoVO::getWarehouseId, v -> v)); @@ -80,9 +85,14 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getMonthBillingData() { - return billingDataMapper.getMonthBillingData( - DateUtil.format(new Date(), "yyyy-01-01 00:00:00"), - DateUtil.format(new Date(), "yyyy-12-31 23:59:59") +// return billingDataMapper.getMonthBillingData( +// DateUtil.format(new Date(), "yyyy-01-01 00:00:00"), +// DateUtil.format(new Date(), "yyyy-12-31 23:59:59") +// ); + + return billingDataMapper.getMonthBillingData( + DateUtil.format(new Date(), "2024-01-01 00:00:00"), + DateUtil.format(new Date(), "2024-12-31 23:59:59") ); } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java index cbb347680..4bc32558b 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java @@ -19,10 +19,14 @@ public class BusinessRationServiceImpl implements IBusinessRationService { private final BusinessRatioMapper businessRatioMapper; + @Override public BusinessRatioDataVO getBusinessRatioData() { - String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")); - String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")); +// String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")); +// String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")); + + String startTime = "2024-01-01 00:00:00"; + String endTime = "2024-12-31 23:59:59"; BusinessRatioDataVO businessRatioDataVO = new BusinessRatioDataVO(); businessRatioDataVO.setType(businessRatioMapper.getTypeData(startTime, endTime)); From 359f95817d0a07436bece5721cc567f4084b5bfc Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Thu, 9 Jan 2025 15:16:24 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E6=9B=B4=E5=85=B7ID=E8=B7=9F=E6=96=B0=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=9C=80=E8=A6=81=E5=8F=AA=E8=83=BD=E8=83=BD=E8=A1=8C?= =?UTF-8?q?=E9=82=A3=E5=87=A0=E4=B8=AA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/DistributionStockupAppController.java | 25 ++++++---- .../MerchantStatisticsController.java | 2 +- .../mapper/StatisticsOrderInfoMapper.java | 2 + .../mapper/StatisticsOrderInfoMapper.xml | 17 ++++++- .../service/IStatisticsOrderInfoService.java | 2 + .../impl/StatisticsOrderInfoServiceImpl.java | 37 ++++++++++----- ...TrunklineBillladingPackageServiceImpl.java | 30 ++++++++++-- .../impl/TrunklineBillladingServiceImpl.java | 46 +++++++++++++++++-- ...TrunklineBillladingWaybillServiceImpl.java | 5 +- .../impl/TrunklineCarsLoadLogServiceImpl.java | 10 +++- .../impl/TrunklineCarsLoadServiceImpl.java | 7 ++- 11 files changed, 149 insertions(+), 34 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java index cbfefd589..277852b3c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java @@ -944,9 +944,11 @@ public class DistributionStockupAppController extends BladeController { List reservationStockList = reservationStocklistEntities.stream().filter(drs -> drs.getReservationNum() > 0 && drs.getRealityNum() < drs.getReservationNum()).collect(Collectors.toList()); if (Func.isNotEmpty(reservationStockList)) { DistributionReservationStocklistEntity oldReservationStocklistEntity = reservationStockList.get(0); + DistributionReservationStocklistEntity t0 = new DistributionReservationStocklistEntity(); + t0.setId(oldReservationStocklistEntity.getId()); //扣减计划数量 - oldReservationStocklistEntity.setReservationNum(oldReservationStocklistEntity.getReservationNum() - 1); - distributionReservationStocklistService.updateById(oldReservationStocklistEntity); + t0.setReservationNum(oldReservationStocklistEntity.getReservationNum() - 1); + distributionReservationStocklistService.updateById(t0); //维护对应的库存品包件 List stockListDetailEntities = disStockListDetailService.list(Wrappers.query().lambda() @@ -956,19 +958,26 @@ public class DistributionStockupAppController extends BladeController { ); DistributionStockListEntity oldStockListEntity = distributionStockListService.getById(oldReservationStocklistEntity.getStocklistId()); - oldStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1); - distributionStockListService.updateById(oldStockListEntity); + + DistributionStockListEntity t =new DistributionStockListEntity(); + t.setId(oldStockListEntity.getId()); + t.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1); + distributionStockListService.updateById(t); //对指定库存品包件进行库存品ID修改 DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0); if (Func.isNotEmpty(disStockListDetailEntity)) { - disStockListDetailEntity.setStockListId(stockupDTO.getStockListId()); - disStockListDetailService.updateById(disStockListDetailEntity); + DisStockListDetailEntity t1 = new DisStockListDetailEntity(); + t1.setId(disStockListDetailEntity.getId()); + t1.setStockListId(stockupDTO.getStockListId()); + disStockListDetailService.updateById(t1); } //维护对应库存品的冻结数量 DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId()); - newStockListEntity.setQuantityOccupied(newStockListEntity.getQuantityOccupied() + 1); - distributionStockListService.updateById(newStockListEntity); + DistributionStockListEntity t2 = new DistributionStockListEntity(); + t2.setId(newStockListEntity.getId()); + t2.setQuantityOccupied(newStockListEntity.getQuantityOccupied() + 1); + distributionStockListService.updateById(t2); } // 增加实际扫描的包件对应的库存品信息 增加在预约库存品中间表上 DistributionReservationStocklistEntity reservationStocklistEntity = new DistributionReservationStocklistEntity(); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java index 297015d77..8e95941ff 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java @@ -210,7 +210,7 @@ public class MerchantStatisticsController { return R.fail(405, "请选择正确的对账单"); } - List statisticsOrderInfoVO = statisticsOrderInfoService.findOrderDetail(reconciliationOrderId); + List statisticsOrderInfoVO = statisticsOrderInfoService.getStatisticsOrderInfoVOListByReconciliationOrderId(reconciliationOrderId); return R.data(statisticsOrderInfoVO); } catch (CustomerException e) { diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java index 8a0423f97..09f6c4e17 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java @@ -53,4 +53,6 @@ public interface StatisticsOrderInfoMapper extends BaseMapper pageList2B(IPage page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO); List pageList2BNoPage( @Param("param") MerchantStatisticsDTO merchantStatisticsDTO); + + List findStatisticsOrderInfoVOByReconciliationOrderId(@Param("reconciliationOrderId") Long reconciliationOrderId); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml index 5c22aa35e..3d156f776 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml @@ -2,7 +2,7 @@ - + where 1=1 and lsoi.create_reconciliation_order_status = 0 @@ -1048,6 +1052,17 @@ group by lsoi.id + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java index 3fe94e72f..24cd76f7f 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java @@ -18,6 +18,8 @@ public interface IStatisticsOrderInfoService extends BaseService pageList(MerchantStatisticsDTO merchantStatisticsDTO); + List getStatisticsOrderInfoVOListByReconciliationOrderId(Long reconciliationOrderId); + StatisticsReconciliationOrderInfoVO findChangesRecordList(MerchantStatisticsDTO merchantStatisticsDTO); R addChangesRecord(ChangesRecordDTO changesRecordDTO); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java index 9eae78a2f..bb24aef8d 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java @@ -33,7 +33,6 @@ import com.logpm.statistics.service.*; import com.logpm.statistics.vo.*; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; -import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springblade.common.constant.DictBizConstant; @@ -268,24 +267,26 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl getStatisticsOrderInfoVOIPage2C(MerchantStatisticsDTO merchantStatisticsDTO, IPage page) { - IPage statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); - List records = statisticsOrderInfoVOIPage.getRecords(); - if (CollUtil.isEmpty(records)) { - return statisticsOrderInfoVOIPage; - } + + @Override + public List getStatisticsOrderInfoVOListByReconciliationOrderId(Long reconciliationOrderId){ + List statisticsOrderInfoVOList = baseMapper.findStatisticsOrderInfoVOByReconciliationOrderId(reconciliationOrderId); + buildListForStatisOrderInfoVO(statisticsOrderInfoVOList); + return statisticsOrderInfoVOList; + } + + private void buildListForStatisOrderInfoVO(List statisticsOrderInfoVOList) { //把records中所有的orderInfoId放入一个集合 - List orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); + List orderInfoIdList = statisticsOrderInfoVOList.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); // 得到运单ID集合 - Set waybillIds = records.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet()); + Set waybillIds = statisticsOrderInfoVOList.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet()); // 查询运单明细集合 List waybillDetailByWaybillId = baseMapper.findWaybillDetailByWaybillId(waybillIds); //得到运单号 - Set orderCodeSet = records.stream().map(StatisticsOrderInfoVO::getOrderCode).collect(Collectors.toSet()); + Set orderCodeSet = statisticsOrderInfoVOList.stream().map(StatisticsOrderInfoVO::getOrderCode).collect(Collectors.toSet()); // 通过运单号进行分组 @@ -307,7 +308,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl advanceDetailDTOS = baseMapper.selectAdvinceDetail(waybillIds, orderCodeSet); - records.forEach(statisticsOrderInfoVO -> { + statisticsOrderInfoVOList.forEach(statisticsOrderInfoVO -> { // Long waybillId = statisticsOrderInfoVO.getWaybillId(); @@ -405,6 +406,18 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl getStatisticsOrderInfoVOIPage2C(MerchantStatisticsDTO merchantStatisticsDTO, IPage page) { + IPage statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); + List records = statisticsOrderInfoVOIPage.getRecords(); + if (CollUtil.isEmpty(records)) { + return statisticsOrderInfoVOIPage; + } + + //把records中所有的orderInfoId放入一个集合 + buildListForStatisOrderInfoVO(records); statisticsOrderInfoVOIPage.setRecords(records); return statisticsOrderInfoVOIPage; } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java index 0ccaa76fe..5acdad946 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java @@ -119,7 +119,12 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl warehouseWaybillEntities = new ArrayList<>(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java index deb75f952..2fe057f50 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java @@ -392,6 +392,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl billladingWaybillEntities = billladingWaybillService.findNoFinishWaybillByBillladingId(billladingId); @@ -460,6 +479,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl waybillIdSet = map.keySet(); List waybillEntityList = warehouseWaybillClient.findListByWaybillIds(new ArrayList<>(waybillIdSet)); + + List list =new ArrayList<>(); + waybillEntityList.forEach(waybillEntity -> { Integer integer = map.get(waybillEntity.getId()); if(Objects.isNull(integer)){ @@ -470,8 +492,13 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl Date: Thu, 9 Jan 2025 16:30:45 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E6=9B=B4=E5=85=B7ID=E8=B7=9F=E6=96=B0=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=9C=80=E8=A6=81=E5=8F=AA=E8=83=BD=E8=83=BD=E8=A1=8C?= =?UTF-8?q?=E9=82=A3=E5=87=A0=E4=B8=AA=E5=AD=97=E6=AE=B52?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/DistributionStockArticleClient.java | 7 +- .../service/IDistributionAsyncService.java | 96 +-- .../impl/DistributionAddvalueServiceImpl.java | 2 +- .../impl/DistributionAsyncServiceImpl.java | 739 +----------------- .../DistributionParcelListServiceImpl.java | 21 +- ...stributionUnpackingDetailsServiceImpl.java | 9 +- .../DistrilbutionBillLadingServiceImpl.java | 1 - .../impl/WarehouseTrayGoodsServiceImpl.java | 8 +- 8 files changed, 71 insertions(+), 812 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java index 14d9579b4..6c950d0e8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java @@ -266,7 +266,12 @@ public class DistributionStockArticleClient implements IDistributionStockArticle carsLoadNum = 0; } stockArticleEntity.setCarsLoadNum(carsLoadNum + planNum); - boolean b = distributionStockArticleService.updateById(stockArticleEntity); + + + DistributionStockArticleEntity t = new DistributionStockArticleEntity(); + t.setId(stockArticleEntity.getId()); + t.setCarsLoadNum(stockArticleEntity.getCarsLoadNum()); + boolean b = distributionStockArticleService.updateById(t); if(!b){ log.warn("###############addCarsLoadNum: 更新配载数量失败 orderCode={} warehouseId={}",orderCode,warehouseId); throw new CustomerException(405,"更新配载数量失败"); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java index c4bbec5f2..8a444f18d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java @@ -35,18 +35,7 @@ public interface IDistributionAsyncService { */ Boolean getSelfPickup(Long id); - /** - * 修改订单状态 - * @param id - * @return - */ - Boolean updateOrderSelfPickup(Long id); - /** - * 修改扫码状态 - * @param id - * @return - */ - Boolean getInventorySelfPickup(Long id); + /** * 修改提货订单状态 * @param id @@ -94,27 +83,6 @@ public interface IDistributionAsyncService { void changeOrderSignforStatus(DistributionParcelListEntity parcelListEntity); - /** - * 修改配送任务的装车状态 - * - * @param deliveryId - * @return - */ - void changeDiscussDeliveryListStatus(String barcode,Long deliveryId); - - - /** - * 改变订单的主状态 - * @param barcode - */ - void changeOrderStatus(String barcode, Long deliveryId); - - /** - * 配送任务签收情况状态控制 - * @param deliveryId - * @param parcelListEntity - */ - void changeDeliverySignforListStatus(Long deliveryId, DistributionParcelListEntity parcelListEntity); /** * 异步检查订单的预约状态 @@ -147,43 +115,19 @@ public interface IDistributionAsyncService { void stockupSelfUpdateState(StockupDTO stockupDTO,int num); - /** - * 市配装车扫描接口状态变更 - * @param barcode - * @param deliveryId - */ - void changeMarketDeliveryListStatus(String barcode, Long deliveryId,Long reservationId); /** * 自提签收判断是否完成 */ void getStockUPstate(Long billLadingId); - /** - * 根据保健维护订单的签收状态 - * @param parcelListEntity - */ - void checkStockArticleSignStatus(DistributionParcelListEntity parcelListEntity); - /** - * - * @param detailEntity - */ - void checkStockArticleListSigningStatus(DisStockListDetailEntity detailEntity); - /** - * 维护签收的牵手状态 - * @param barcode - * @param deliveryId - */ - void checkDeliverySignStatus(String barcode, Long deliveryId); - /** - * 检查配送计划签收状态 - * @param deliveryId - */ - void checkDeliverySignStatusByReservation(Long deliveryId); + + + /** * 判断包件是否该下架 @@ -198,17 +142,6 @@ public interface IDistributionAsyncService { */ void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId,Long reservationId); - /** - * 托盘装车 维护装车状态 - * @param deliveryId - */ - void checkLoadingByDelivery(Long deliveryId); - - /** - * 维护包件、订单装车和出库状态 - * @param packageId - */ - void checkOrderLoadingStatus(Long packageId); /** * 维护订单预约、装车状态 @@ -264,11 +197,6 @@ public interface IDistributionAsyncService { */ void checkRetentionZeroPackageReservationAndDeliveryInfo(Long reservationId, Long deliveryId, Long orderPackageId, Long orderId); - /** - * 批量修改包件装车状态 - * @param updatePackageList - */ - void updatepackageListLoadingStatus(List updatePackageList,Long warehouseId); /** * 处理包件一键签收状态 @@ -312,20 +240,18 @@ public interface IDistributionAsyncService { */ void releaseSource(Long reservationId,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber); + /** * 进行干线日志保存 - * @param id + * @param deliveryId + * @param reservationId + * @param user + * @param warehouse + * @param a */ void sendTrunkineLog(Long deliveryId,Long reservationId, BladeUser user, BasicdataWarehouseEntity warehouse,Integer a); - /** - * 自提单未扫描数据进行资源释放 - * @param l - */ - void releaseBillLadingResource(Long l,Long warehouseId); - - DistributionStockArticleEntity findDistributionStockArticleEntityByIdForAsync(String tenantId, Long id); @@ -349,7 +275,7 @@ public interface IDistributionAsyncService { /** * 查询预约信息推送至安装平台 - * @param id + * @param reservationEntity */ void sendInstallToPlatform(DistributionReservationEntity reservationEntity); } 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 13f989ab8..a99b7be94 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 @@ -703,7 +703,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionAddvalueEntity::getRefId, distributionAppAddvalueDTO.getReservationId()) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index 57e1ac775..ec37eecd7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -7,7 +7,6 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -22,61 +21,10 @@ import com.logpm.distribution.dto.PushInstallDTO; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.dto.app.StockupZeroDTO; -import com.logpm.distribution.entity.DisStockListDetailEntity; -import com.logpm.distribution.entity.DistributionBillLadingScanEntity; -import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity; -import com.logpm.distribution.entity.DistributionDeliveryListEntity; -import com.logpm.distribution.entity.DistributionLoadscanEntity; -import com.logpm.distribution.entity.DistributionLoadscaninvnEntity; -import com.logpm.distribution.entity.DistributionParcelListEntity; -import com.logpm.distribution.entity.DistributionParcelNumberEntity; -import com.logpm.distribution.entity.DistributionPrintEntity; -import com.logpm.distribution.entity.DistributionReservationEntity; -import com.logpm.distribution.entity.DistributionReservationPackageEntity; -import com.logpm.distribution.entity.DistributionReservationStockarticleEntity; -import com.logpm.distribution.entity.DistributionReservationStocklistEntity; -import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity; -import com.logpm.distribution.entity.DistributionSignforEntity; -import com.logpm.distribution.entity.DistributionStockArticleEntity; -import com.logpm.distribution.entity.DistributionStockEntity; -import com.logpm.distribution.entity.DistributionStockListEntity; -import com.logpm.distribution.entity.DistributionStockupEntity; -import com.logpm.distribution.entity.DistributionStockupInfoEntity; -import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; -import com.logpm.distribution.entity.DistrilbutionBillPackageEntity; -import com.logpm.distribution.entity.DistrilbutionBillStockEntity; -import com.logpm.distribution.mapper.DistributionBillLadingScanMapper; -import com.logpm.distribution.mapper.DistributionDeliveryDetailsMapper; -import com.logpm.distribution.mapper.DistributionDeliveryListMapper; -import com.logpm.distribution.mapper.DistributionLoadscanMapper; -import com.logpm.distribution.mapper.DistributionLoadscaninvnMapper; -import com.logpm.distribution.mapper.DistributionParcelListMapper; -import com.logpm.distribution.mapper.DistributionReservationMapper; -import com.logpm.distribution.mapper.DistributionReservationPackageMapper; -import com.logpm.distribution.mapper.DistributionReservationStockarticleMapper; -import com.logpm.distribution.mapper.DistributionReservationStocklistMapper; -import com.logpm.distribution.mapper.DistributionSignforMapper; -import com.logpm.distribution.mapper.DistributionStockListMapper; -import com.logpm.distribution.mapper.DistributionStockMapper; -import com.logpm.distribution.mapper.DistributionStockupInfoMapper; -import com.logpm.distribution.mapper.DistributionStockupMapper; -import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper; -import com.logpm.distribution.service.IDisStockListDetailService; -import com.logpm.distribution.service.IDistributionAsyncService; -import com.logpm.distribution.service.IDistributionDeliveryDetailsService; -import com.logpm.distribution.service.IDistributionParcelNumberService; -import com.logpm.distribution.service.IDistributionPrintService; -import com.logpm.distribution.service.IDistributionReservationStockarticleService; -import com.logpm.distribution.service.IDistributionReservationStocklistService; -import com.logpm.distribution.service.IDistributionReservationZeroPackageService; -import com.logpm.distribution.service.IDistributionStockArticleService; -import com.logpm.distribution.service.IDistrilbutionBillPackageService; -import com.logpm.distribution.service.IDistrilbutionBillStockService; -import com.logpm.distribution.vo.DistributionParcelNumberVO; -import com.logpm.distribution.vo.DistributionSignPrintVO; -import com.logpm.distribution.vo.DistributionStockPackageVO; -import com.logpm.distribution.vo.DistributionStockupSelfVO; -import com.logpm.distribution.vo.DistrilbutionBillStockVO; +import com.logpm.distribution.entity.*; +import com.logpm.distribution.mapper.*; +import com.logpm.distribution.service.*; +import com.logpm.distribution.vo.*; import com.logpm.factory.comfac.dto.OrderStatusDTO; import com.logpm.factory.mt.dto.MtReceiveContentDTO; import com.logpm.factory.mt.dto.MtReceiveDTO; @@ -95,11 +43,9 @@ import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; -import org.springblade.common.annotations.ChangeAsync; import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; -import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant; import org.springblade.common.constant.Inventory.InventorySigningStatusConstant; import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.WorkNodeEnums; @@ -114,19 +60,9 @@ import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusCon import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; -import org.springblade.common.constant.reservation.ReservationInventoryLoadingStatusConstant; -import org.springblade.common.constant.reservation.ReservationInventorySigningStatusConstant; -import org.springblade.common.constant.reservation.ReservationInventoryStatusConstant; -import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant; -import org.springblade.common.constant.reservation.ReservationOrderStatusConstant; -import org.springblade.common.constant.reservation.ReservationPackageStatusConstant; -import org.springblade.common.constant.reservation.ReservationSigningStatusConstant; -import org.springblade.common.constant.reservation.ReservationStatusConstant; -import org.springblade.common.constant.reservation.ReservationStockupStatusConstant; -import org.springblade.common.constant.signing.SignforStatusConstant; +import org.springblade.common.constant.reservation.*; import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.constant.stockup.StockupTypeConstant; -import org.springblade.common.exception.CustomerException; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; @@ -138,15 +74,7 @@ import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@ -191,20 +119,16 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { private final IDistrilbutionBillPackageService billPackageService; private final IDistributionReservationZeroPackageService zeroPackageService; - private final ITrunklineWaybillTrackClient trunklineWaybillTrackClient; private final IWarehouseWaybillClient waybillClient; private final FactoryDataMessageSender factoryDataMessageSender; private final RabbitTemplate rabbitTemplate; - - private final ISysClient sysClient; private final ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient; private final IDistributionPrintService distributionPrintService; private final IBasicdataClientClient basicdataClientClient; -// private final @Override @LogpmAsync("asyncExecutor") @@ -233,32 +157,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { return distributionParcelListService.updateById(entity); } - /** - * 修改订单状态 - * - * @param id - * @return - */ - @Override - @LogpmAsync("asyncExecutor") - @Transactional(rollbackFor = Exception.class) - public Boolean updateOrderSelfPickup(Long id) { - DistributionStockArticleEntity entity = new DistributionStockArticleEntity(); - entity.setId(id); - entity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); - return distributionStockArticleService.updateById(entity); - } - - @Override - @LogpmAsync("asyncExecutor") - @Transactional(rollbackFor = Exception.class) - public Boolean getInventorySelfPickup(Long id) { - DistributionStockEntity distributionStock = new DistributionStockEntity(); - distributionStock.setId(id); - distributionStock.setOutboundType("3"); - int i = distributionStockService.updateById(distributionStock); - return i > 0; - } @Override @LogpmAsync("asyncExecutor") @@ -297,7 +195,11 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (byId.getStockupStatus().equals(OrderStockupStatusConstant.daibeihuo.getValue())) { // byId.setStockupStatus(OrderStockupStatusConstant.bufenbeihuo.getValue()); - boolean b = distributionStockArticleService.updateById(byId); + + DistributionStockArticleEntity t = new DistributionStockArticleEntity(); + t.setId(id); + t.setStockupStatus(byId.getStockupStatus()); + boolean b = distributionStockArticleService.updateById(t); log.debug("###执行结果={}", b); } else if ("1".equals(byId.getStockupStatus())) { List distributionParcelListEntities = distributionParcelListMapper.selectList(Wrappers.query().lambda() @@ -306,7 +208,11 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { int sum = distributionParcelListEntities.stream().filter(i -> i.getOrderPackageStockupStatus().equals(OrderPackageStockupStatusConstant.daibeihuo.getValue())).collect(Collectors.toList()).stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); if (sum == 0 && byId.getStockupStatus().equals(OrderStockupStatusConstant.bufenbeihuo.getValue())) { byId.setStockupStatus(OrderStockupStatusConstant.yibeihu.getValue()); - boolean b = distributionStockArticleService.updateById(byId); + + DistributionStockArticleEntity t = new DistributionStockArticleEntity(); + t.setId(id); + t.setStockupStatus(byId.getStockupStatus()); + boolean b = distributionStockArticleService.updateById(t); log.debug("###执行结果={}", b); } } @@ -323,18 +229,19 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { log.debug("####修改包件预约状态"); ids.forEach(i -> { DistributionParcelListEntity distributionParcelListEntity = new DistributionParcelListEntity(); - if ("1".equals(distributionParcelListEntity.getConditions())) { - distributionParcelListEntity.setId(i); + distributionParcelListEntity.setId(i); + if (1==distributionParcelListEntity.getConditions()) { distributionParcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); int i1 = distributionParcelListMapper.updateById(distributionParcelListEntity); log.debug("####修改包件预约数量===={}", i1); - } else if ("3".equals(distributionParcelListEntity.getConditions())) { + } else if (3==distributionParcelListEntity.getConditions()) { DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.query().lambda() .eq(DistributionParcelNumberEntity::getParcelListId, i) ); if (distributionParcelNumberEntity.getQuantity() == (distributionParcelNumberEntity.getDeliveryQuantity() + distributionParcelNumberEntity.getOutboundQuantity())) { log.debug("####修改包件预约数量===={}", i); - distributionParcelListEntity.setId(i); + distributionParcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); + int i1 = distributionParcelListMapper.updateById(distributionParcelListEntity); } } @@ -386,336 +293,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @LogpmAsync("asyncExecutor") - @Override - @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) - public void changeDiscussDeliveryListStatus(String barcode, Long deliveryId) { - //这里需要查询出该包件 - DistributionParcelListEntity parcelListEntity = distributionDeliveryListMapper.getLoadingPackageDetails(barcode, deliveryId); - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); - parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); - //修改包件状态 - distributionParcelListService.updateById(parcelListEntity); - DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); - List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); - boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); - //维护包件、订单扫描装车状态 - if (flag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - } else { - flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (flag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - } - } - distributionStockArticleService.updateById(stockArticleEntity); - //维护包件、预约的扫描状态 - //查询出配送任务下的所有包件 - List deliveryParcelListEntityList = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId); - boolean deliveryLoadingFlag = deliveryParcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (deliveryLoadingFlag) { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); - } else { - deliveryLoadingFlag = deliveryParcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (deliveryLoadingFlag) { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); - } else { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); - } - } - distributionDeliveryListMapper.updateById(deliveryListEntity); - List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); - reservationEntityList.forEach(r -> { - //查询预约下的所有包件信息 - List parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(r.getId()); - boolean reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (reservationLoadingFlag) { - r.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); - } else { - reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (reservationLoadingFlag) { - r.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); - } else { - r.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); - } - } - distributionReservationMapper.updateById(r); - }); - } - - @LogpmAsync("asyncExecutor") - @Override - @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) - public void changeMarketDeliveryListStatus(String barcode, Long deliveryId, Long reservationId) { - - //查询库存品 - DisStockListDetailEntity loadingInventoryDetail = distributionDeliveryListMapper.getLoadingInventoryDetail(barcode, deliveryId); - loadingInventoryDetail.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue()); - disStockListDetailService.updateById(loadingInventoryDetail); -// DistributionStockListEntity stockListEntity = distributionStockListMapper.selectOne(Wrappers.query().lambda().eq(DistributionStockListEntity::getId, loadingInventoryDetail.getStockListId())); -// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadingInventoryDetail.getNum()); -// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadingInventoryDetail.getNum()); -// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadingInventoryDetail.getNum()); -// distributionStockListMapper.updateById(stockListEntity); - //查询出这个库存品的所有需要装车的包件维度库存品 - List list = disStockListDetailService.list(Wrappers.query().lambda() - .eq(DisStockListDetailEntity::getReservationId, loadingInventoryDetail.getReservationId()) - .eq(DisStockListDetailEntity::getStockListId, loadingInventoryDetail.getStockListId()) - .ne(DisStockListDetailEntity::getStockPackageStatus, InventoryPackageStatusConstant.quxiao.getValue())); - boolean inventoryFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())); - List reservationStockarticleEntityList = distributionReservationStocklistMapper.selectList(Wrappers.query().lambda() - .eq(DistributionReservationStocklistEntity::getReservationId, loadingInventoryDetail.getReservationId()) - .eq(DistributionReservationStocklistEntity::getStocklistId, loadingInventoryDetail.getStockListId()) - .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationInventoryStatusConstant.quxiao.getValue())); - if (reservationStockarticleEntityList.size() == 1) { - //修改状态 - DistributionReservationStocklistEntity reservationStockarticleEntity = reservationStockarticleEntityList.get(0); - if (inventoryFlag) { - //查询出库存品进行全部状态的变更 - reservationStockarticleEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.yizhuangche.getValue()); - } else { - inventoryFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())); - if (inventoryFlag) { - reservationStockarticleEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.weizhuangche.getValue()); - } else { - reservationStockarticleEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.bufenzhuangche.getValue()); - } - } - distributionReservationStocklistMapper.updateById(reservationStockarticleEntity); - } else { - log.error("####库存品记录错误+{" + reservationStockarticleEntityList + "}"); - return; - } - checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId); - } - - @LogpmAsync("asyncExecutor") - @Override - @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) - public void checkDeliverySignStatus(String barcode, Long deliveryId) { - //这里需要查询出该包件 - DistributionParcelListEntity parcelListEntity = distributionDeliveryListMapper.getLoadingPackageDetails(barcode, deliveryId); - - if (Func.isNotEmpty(parcelListEntity)) { - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); - parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); - //修改包件状态 - distributionParcelListService.updateById(parcelListEntity); -// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); - List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); - boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - boolean packageSigningFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); - //维护包件、订单扫描装车状态 - if (packageLoadingFlag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - } else { - packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (packageLoadingFlag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - } - } - if (packageSigningFlag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); - } - distributionStockArticleService.updateById(stockArticleEntity); - } else { - //查询库存品 - DisStockListDetailEntity loadingInventoryDetail = distributionDeliveryListMapper.getLoadingInventoryDetail(barcode, deliveryId); - loadingInventoryDetail.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue()); - loadingInventoryDetail.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); - disStockListDetailService.updateById(loadingInventoryDetail); -// DistributionStockListEntity stockListEntity = distributionStockListMapper.selectOne(Wrappers.query().lambda().eq(DistributionStockListEntity::getId, loadingInventoryDetail.getStockListId())); -// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadingInventoryDetail.getNum()); -// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadingInventoryDetail.getNum()); -// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadingInventoryDetail.getNum()); -// distributionStockListMapper.updateById(stockListEntity); - //查询出这个库存品的所有需要装车的包件维度库存品 - List list = disStockListDetailService.list(Wrappers.query().lambda() - .eq(DisStockListDetailEntity::getReservationId, loadingInventoryDetail.getReservationId()) - .eq(DisStockListDetailEntity::getStockListId, loadingInventoryDetail.getStockListId()) - .ne(DisStockListDetailEntity::getStockPackageStatus, InventoryPackageStatusConstant.quxiao.getValue())); - boolean inventoryLoadingFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())); - boolean inventorySigningFlag = list.stream().allMatch(l -> l.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue())); - List reservationStocklistEntityList = distributionReservationStocklistMapper.selectList(Wrappers.query().lambda() - .eq(DistributionReservationStocklistEntity::getReservationId, loadingInventoryDetail.getReservationId()) - .eq(DistributionReservationStocklistEntity::getStocklistId, loadingInventoryDetail.getStockListId()) - .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationInventoryStatusConstant.quxiao.getValue())); - if (reservationStocklistEntityList.size() == 1) { - //修改状态 - DistributionReservationStocklistEntity reservationStocklistEntity = reservationStocklistEntityList.get(0); - if (inventoryLoadingFlag) { - //查询出库存品进行全部状态的变更 - reservationStocklistEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.yizhuangche.getValue()); - } else { - inventoryLoadingFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())); - if (inventoryLoadingFlag) { - reservationStocklistEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.weizhuangche.getValue()); - } else { - reservationStocklistEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.bufenzhuangche.getValue()); - } - } - if (inventorySigningFlag) { - //查询出库存品进行全部状态的变更 - reservationStocklistEntity.setSigningStatus(ReservationInventorySigningStatusConstant.yiqianshou.getValue()); - } else { - inventorySigningFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())); - if (inventorySigningFlag) { - reservationStocklistEntity.setSigningStatus(ReservationInventorySigningStatusConstant.weiqianshou.getValue()); - } else { - reservationStocklistEntity.setSigningStatus(ReservationInventorySigningStatusConstant.bufenqianshou.getValue()); - } - } - distributionReservationStocklistMapper.updateById(reservationStocklistEntity); - } else { - log.error("####库存品记录错误+{" + reservationStocklistEntityList + "}"); - return; - } - } - //查询出这个预约下的包件信息和库存品信息分别进行判断是否都完成装车 - List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); - reservationEntityList.forEach(r -> { - int reservationTotal = r.getReservationNum() + r.getReservationStockListNum(); - //查询此预约的包件装车数和库存品装车数 - Integer loadingNum = 0; - Integer signNum = 0; - List loadscanEntityList = distributionLoadscanMapper.selectList(Wrappers.query().lambda() - .eq(DistributionLoadscanEntity::getReservationId, r.getId()) - .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) - ); - if (Func.isNotEmpty(loadscanEntityList)) { - loadingNum += loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); - signNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); - - } - List loadscaninvnEntityList = distributionLoadscaninvnMapper.selectList(Wrappers.query().lambda() - .eq(DistributionLoadscaninvnEntity::getReservationId, r.getId()) - .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) - ); - if (Func.isNotEmpty(loadscanEntityList)) { - loadingNum += loadscaninvnEntityList.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum(); - signNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); - } - - if (loadingNum == reservationTotal) { - r.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); - } else if (reservationTotal > loadingNum && loadingNum > 0) { - r.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); - } else { - r.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); - } - - if (signNum == reservationTotal) { - r.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); - } else if (reservationTotal > signNum && signNum > 0) { - r.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); - } else { - r.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); - } -// //查询预约下的所有包件信息 -// List parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(r.getId()); -// boolean reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())); -// List distributionReservationStocklistEntities = distributionReservationStocklistMapper.selectList(Wrappers.query().lambda() -// .eq(DistributionReservationStocklistEntity::getReservationId, r.getId()) -// .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationInventoryStatusConstant.quxiao.getValue())); -// boolean inventoryLoadingFlag = distributionReservationStocklistEntities.stream().allMatch(i -> i.getLoadingStatus().equals(ReservationInventoryLoadingStatusConstant.yizhuangche.getValue())); -// if (reservationLoadingFlag && inventoryLoadingFlag) { -// r.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); -// } else { -// reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); -// inventoryLoadingFlag = distributionReservationStocklistEntities.stream().allMatch(i -> i.getLoadingStatus().equals(ReservationInventoryLoadingStatusConstant.weizhuangche.getValue())); -// if (reservationLoadingFlag && inventoryLoadingFlag) { -// r.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); -// } else { -// r.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); -// } -// } -// boolean inventorySigningFlag = distributionReservationStocklistEntities.stream().allMatch(i -> i.getSigningStatus().equals(ReservationInventorySigningStatusConstant.yiqianshou.getValue())); -// boolean reservationSigningFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); -// if (inventorySigningFlag && reservationSigningFlag) { -// r.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); -// } else { -// inventorySigningFlag = distributionReservationStocklistEntities.stream().allMatch(i -> !i.getSigningStatus().equals(ReservationInventorySigningStatusConstant.yiqianshou.getValue())); -// reservationSigningFlag = parcelListEntities.stream().allMatch(p -> !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); -// if (inventorySigningFlag && reservationSigningFlag) { -// r.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); -// -// } else { -// r.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); -// } -// } - - distributionReservationMapper.updateById(r); - }); - - DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); - Integer delivertTotal = deliveryListEntity.getDeliveryNumber(); - Integer deliverySigningNum = 0; - List loadscanEntityList = distributionLoadscanMapper.selectList(Wrappers.query().lambda() - .eq(DistributionLoadscanEntity::getDeliveryId, deliveryListEntity.getId()) - .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) - ); - if (Func.isNotEmpty(loadscanEntityList)) { - deliverySigningNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); - - } - List loadscaninvnEntityList = distributionLoadscaninvnMapper.selectList(Wrappers.query().lambda() - .eq(DistributionLoadscaninvnEntity::getDeliveryId, deliveryListEntity.getId()) - .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) - ); - if (Func.isNotEmpty(loadscanEntityList)) { - deliverySigningNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); - } - - if (deliverySigningNum.equals(delivertTotal)) { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); - } else { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); - } - - distributionDeliveryListMapper.updateById(deliveryListEntity); - } - - @LogpmAsync("asyncExecutor") - @Override - @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) - public void checkDeliverySignStatusByReservation(Long deliveryId) { - DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); - //查询一个配送任务下的所有客户 - List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); - boolean loadingStatusFlag = reservationEntityList.stream().allMatch(r -> r.getLoadingStatus().equals(ReservationLoadingStatusConstant.yizhuangche.getValue())); - if (loadingStatusFlag) { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); - } else { - loadingStatusFlag = reservationEntityList.stream().allMatch(r -> r.getLoadingStatus().equals(ReservationLoadingStatusConstant.daizhuangche.getValue())); - if (loadingStatusFlag) { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); - } else { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); - } - } - boolean signingStatusFlag = reservationEntityList.stream().allMatch(r -> r.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())); - if (signingStatusFlag) { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); - } else { - loadingStatusFlag = reservationEntityList.stream().allMatch(r -> r.getLoadingStatus().equals(ReservationSigningStatusConstant.daiqianshou.getValue())); - if (loadingStatusFlag) { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue()); - } else { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); - } - } - distributionDeliveryListMapper.updateById(deliveryListEntity); - - } - /** * 判断包件是否该下架 * @@ -912,83 +489,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { // } - @Override - public void checkLoadingByDelivery(Long deliveryId) { - DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); - if (Func.isNotEmpty(deliveryListEntity)) { - List deliveryParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId); - boolean deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (deliveryLoadingFlag) { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); - } else { - deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (deliveryLoadingFlag) { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); - } else { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); - } - } - distributionDeliveryListMapper.updateById(deliveryListEntity); - } - List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); - if (Func.isNotEmpty(reservationEntityList) && !reservationEntityList.isEmpty()) { - for (DistributionReservationEntity reservationEntity : reservationEntityList) { - List parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId()); - Map> order = parcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getStockArticleId)); - order.forEach((k, v) -> { - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(k); - List stockArticlePackageList = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, k)); - if (stockArticlePackageList.size() == v.size()) { - boolean orderLoadingFlag = v.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (orderLoadingFlag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - } else { - orderLoadingFlag = v.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (!orderLoadingFlag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - } - } - } else { - boolean orderbufenLoadingFlag = v.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (orderbufenLoadingFlag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - } - } - distributionStockArticleService.updateById(stockArticleEntity); - }); - boolean reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (reservationLoadingFlag) { - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); - } else { - reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (reservationLoadingFlag) { - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); - } else { - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); - } - } - distributionReservationMapper.updateById(reservationEntity); - } - - } - } - - @Override - public void checkOrderLoadingStatus(Long orderId) { - if (Func.isNotEmpty(orderId)) { - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId); - Integer orderLoadingNum = distributionLoadscanMapper.selectOrderLoadingNum(stockArticleEntity.getId()); - if (Func.isNotEmpty(orderLoadingNum) && orderLoadingNum > 0) { - if (stockArticleEntity.getTotalNumber().equals(orderLoadingNum)) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - } - distributionStockArticleService.updateById(stockArticleEntity); - } - } - } - @Override @Transactional public void checkReservationStatusAndLoadingStatusByPackage(Long packageId) { @@ -1447,21 +947,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { maintenanceDeliveryPackageNum(deliveryId); } - @Override - public void updatepackageListLoadingStatus(List updatePackageList, Long warehouseId) { - List packageIds = updatePackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); - - if (Func.isNotEmpty(packageIds)) { - Integer i = distributionParcelListMapper.updatePackageListByIds(packageIds); - } - String collect = updatePackageList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(",")); - - if(StringUtils.isNotBlank(collect)){ - warehouseUpdownTypeClient.downPackageOrDelTray(collect, warehouseId, "装车下架解托"); - } - -// 进行批量下架 - } @Override @Transactional @@ -1966,47 +1451,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - /** - * @param l - */ - @Override - @Transactional - public void releaseBillLadingResource(Long l, Long warehouseId) { - List list = billPackageService.list(Wrappers.query().lambda() - .eq(DistrilbutionBillPackageEntity::getBillLadingId, l) - .ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2) - ); - if (Func.isNotEmpty(list)) { - List ids = list.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList()); - //查询包件 - List distributionParcelListEntities = distributionParcelListService.listByIds(ids); - List packageIds = distributionParcelListEntities.stream().filter(f -> !OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(f.getOrderPackageLoadingStatus()) || !OrderPackageStatusConstant.yiqianshou.getValue().equals(f.getOrderPackageStatus())).map(DistributionParcelListEntity::getId).collect(Collectors.toList()); - if (Func.isNotEmpty(packageIds)) { - distributionParcelListService.update(new UpdateWrapper().lambda() - .set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) - .set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) - .set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue()) - .set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.daibeihuo.getValue()) - .in(DistributionParcelListEntity::getId, packageIds) - ); - billPackageService.update(new UpdateWrapper().lambda() - .set(DistrilbutionBillPackageEntity::getPacketBarStatus, 2) - .eq(DistrilbutionBillPackageEntity::getBillLadingId, l) - .in(DistrilbutionBillPackageEntity::getParceListId, packageIds) - ); - //增加释放日志 - - - - } - String collect = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(",")); - distributionStockArticleService.maintenanceOrderInfo(collect, warehouseId); - //维护自提单订单信息 - distrilbutionBillStockService.maintenanceOrderInfo(l); - } - - } - /** * 定制品 修改备货时间 @@ -2461,140 +1905,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @LogpmAsync("asyncExecutor") - @Override - @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) - public void checkStockArticleSignStatus(DistributionParcelListEntity parcelListEntity) { -// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); -// distributionParcelListService.updateById(parcelListEntity); - List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); - boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); - //通过包件的装车状态来维护订单的出库状态 - if (flag) { - //订单状态为已签收 - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); - } else { - //订单状态为部分签收 - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); - } - distributionStockArticleService.updateById(stockArticleEntity); - } - - @Override - public void checkStockArticleListSigningStatus(DisStockListDetailEntity detailEntity) { - List list = disStockListDetailService.list(Wrappers.query().lambda() - .eq(DisStockListDetailEntity::getReservationId, detailEntity.getReservationId()) - .eq(DisStockListDetailEntity::getStockListId, detailEntity.getStockListId()) - .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationInventoryStatusConstant.quxiao.getValue())); - DistributionReservationStocklistEntity distributionReservationStocklistEntity = distributionReservationStocklistMapper.selectOne(Wrappers.query().lambda() - .eq(DistributionReservationStocklistEntity::getReservationId, detailEntity.getReservationId()) - .eq(DistributionReservationStocklistEntity::getStocklistId, detailEntity.getStockListId()) - .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationInventoryStatusConstant.quxiao.getValue())); - boolean loadingStatusFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())); - if (loadingStatusFlag) { - distributionReservationStocklistEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.yizhuangche.getValue()); - } else { - loadingStatusFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())); - if (loadingStatusFlag) { - distributionReservationStocklistEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.weizhuangche.getValue()); - } else { - distributionReservationStocklistEntity.setLoadingStatus(ReservationInventoryLoadingStatusConstant.yizhuangche.getValue()); - } - } - boolean signingStatusFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())); - if (signingStatusFlag) { - distributionReservationStocklistEntity.setLoadingStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); - } else { - signingStatusFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(ReservationSigningStatusConstant.daiqianshou.getValue())); - if (signingStatusFlag) { - distributionReservationStocklistEntity.setLoadingStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); - } else { - distributionReservationStocklistEntity.setLoadingStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); - } - } - distributionReservationStocklistMapper.updateById(distributionReservationStocklistEntity); - - } - - @LogpmAsync("asyncExecutor") - @Override - @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) - public void changeOrderStatus(String barcode, Long deliveryId) { - //这里需要查询出该包件 - DistributionParcelListEntity parcelListEntity = distributionDeliveryListMapper.getLoadingPackageDetails(barcode, deliveryId); - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); - distributionParcelListService.updateById(parcelListEntity); - List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); - boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); - if (flag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - } - distributionStockArticleService.updateById(stockArticleEntity); - } - - @LogpmAsync("asyncExecutor") - @Override - @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) - public void changeDeliverySignforListStatus(Long deliveryId, DistributionParcelListEntity parcelListEntity) { - //这里需要查询出该包件 - parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); - //修改包件状态 - distributionParcelListService.updateById(parcelListEntity); - DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); - //订单签收状态 - List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); - boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); - //维护包件、订单扫描装车状态 - if (flag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); - } else { - flag = parcelListEntityList.stream().allMatch(p -> !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - if (flag) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); - } - } - distributionStockArticleService.updateById(stockArticleEntity); - //维护包件、预约的扫描状态 - //查询出配送任务下的所有包件 - List deliveryParcelListEntityList = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId); - boolean deliveryLoadingFlag = deliveryParcelListEntityList.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - if (deliveryLoadingFlag) { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); - } else { - deliveryLoadingFlag = deliveryParcelListEntityList.stream().allMatch(p -> !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - if (deliveryLoadingFlag) { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue()); - } else { - deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); - } - } - distributionDeliveryListMapper.updateById(deliveryListEntity); - List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); - reservationEntityList.forEach(r -> { - //查询预约下的所有包件信息 - List parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(r.getId()); - boolean reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - if (reservationLoadingFlag) { - r.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); - } else { - reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); - if (reservationLoadingFlag) { - r.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); - } else { - r.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); - } - } - distributionReservationMapper.updateById(r); - }); - } @Override @Transactional @@ -2982,14 +2293,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @ChangeAsync() - @Override - public DistributionStockArticleEntity findDistributionStockArticleEntityByIdForAsync(String tenantId, Long id) { - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(id); - - return stockArticleEntity; - } - @Override @LogpmAsync("asyncExecutor") diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index c2e4b41ba..4eee25892 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -584,7 +584,13 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl distributionParcelListEntities = baseMapper.selectList(Wrappers.query().lambda() @@ -598,11 +604,20 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl { - DistributionStockListEntity byId = distributionStockListService.getById(i.getId()); DistributionStockListEntity updateWrapper = new DistributionStockListEntity(); updateWrapper.setId(i.getId()); updateWrapper.setQuantityStock(i.getQuantityStock()); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java index 7f4e12f38..14e7e90b9 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java @@ -118,14 +118,18 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl>>>>>>>>>>当前托上数量:{},计划解托数量:{}",trayGoodsEntity.getNum(),num); if (i == 0){ baseMapper.deleteEntityByTrayGoodsId(trayGoodsEntity.getId()); }else { trayGoodsEntity.setNum(i); - baseMapper.updateById(trayGoodsEntity); + + WarehouseTrayGoodsEntity t = new WarehouseTrayGoodsEntity();; + t.setNum(i); + t.setId(trayGoodsEntity.getId()); + + baseMapper.updateById(t); WarehouseTrayGoodsLogEntity copy = Func.copy(trayGoodsEntity, WarehouseTrayGoodsLogEntity.class); copy.setNum(num); copy.setId(null); From af89981d5cae6f11660bd36ae1d2eec3459f47ef Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Fri, 10 Jan 2025 14:51:48 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/springblade/common/constant/ModuleNameConstant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java index 13dc1795b..ff9f81986 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java @@ -9,7 +9,7 @@ public interface ModuleNameConstant { /** * 如果不需要 "" */ - public static final String DEVAUTH ="-pref"; + public static final String DEVAUTH =""; /** * 工厂对接服务名称