Browse Source

feat(all): 配送明细报表

1 整体优化配送明细报表广播消息
fix-sign
zhaoqiaobo 4 months ago
parent
commit
59a9cc5016
  1. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml
  2. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  3. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml

@ -312,6 +312,7 @@
lbv.with_gps withGps,
lbv.gps_service_provider gpsServiceProvider,
lbv.gps_model gpsModel,
lbv.vehicle_model_id vehicleModelId,
(
SELECT
group_concat( lbvp.photo_url )

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -260,7 +260,6 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.MonthDay;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
@ -1369,12 +1368,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
for (DistributionLoadscanEntity distributionParcelListEntity : pushNodeList) {
PackageData packageData = new PackageData();
DistributionParcelListEntity byId = distributionParcelListService.getById(distributionParcelListEntity.getPackageId());
if(distributionParcelListEntity.getIsZero().equals(1)){
if(byId.getConditions().equals(3)){
//标识零担
packageData.setNumber(distributionParcelListEntity.getPackageNub());
DistributionParcelListEntity byId = distributionParcelListService.getById(distributionParcelListEntity.getPackageId());
if(Func.isNotEmpty(byId)){
packageData.setOrderCode(byId.getOrderCode());
if(Func.isEmpty(byId.getBrandName())){
@ -1393,7 +1392,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
packageData.setPackageType(PackageTypeEnums.LTL);
packageData.setNumber(1);
}else if(distributionParcelListEntity.getIsZero().equals(0)){
}else if(byId.getConditions().equals(1)){
// 包件
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
packageData.setPackageType(PackageTypeEnums.CMP);
@ -1445,7 +1444,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return jsonArray;
}
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionReservationEntity reservationEntity, List<DistributionLoadscaninvnEntity> ts) {
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscaninvnEntity> ts) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
@ -1730,6 +1729,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionParcelListEntity> updatePackageList = new ArrayList<>();
List<JSONObject> logList = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
List<DistributionLoadscaninvnEntity> kucuns = new ArrayList<>();
List<DistributionLoadscanEntity> dingzhis= new ArrayList<>();
List<DistributionLoadscanEntity> lingdans = new ArrayList<>();
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) {
switch (reservationStockarticleEntity.getIsZero()) {
case "0":
@ -1792,6 +1797,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) {
loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
}
dingzhis.add(loadscanEntity);
distributionLoadscanService.save(loadscanEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
@ -1873,6 +1879,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadscanService.save(loadscanEntity);
//更新装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
BigDecimal handQuantity = new BigDecimal(parcelNumberVO.getHandQuantity());
@ -1889,6 +1896,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelNumberVO.getStockArticleId());
stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() + loadscanEntity.getPackageNub() - parcelNumberVO.getReservationNum());
distributionStockArticleService.updateById(stockArticleEntity);
lingdans.add(loadscanEntity);
} else {
//装车数量比计划数量少,这里才会进行一键装车数据修改
if (loadscanServiceOne.getPackageNub() <= parcelNumberVO.getReservationNum()) {
@ -1912,6 +1920,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanServiceOne.setLoadedNub(parcelNumberVO.getReservationNum());
}
distributionLoadscanService.updateById(loadscanServiceOne);
lingdans.add(loadscanServiceOne);
distributionParcelNumberService.updateById(parcelNumberEntity);
//维护零担订单在库 以及维护状态
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelNumberVO.getStockArticleId());
@ -1927,6 +1936,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber());
signforEntity.setLoadedNumber(loadedNumber.subtract(packageLoadingNub).add(reservationNum).intValue());
distributionSignforService.updateById(signforEntity);
lingdans.add(loadscanServiceOne);
}
}
}
@ -1987,6 +1997,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscaninvnEntity.setLoadedNub(disStockListDetailEntity.getNum());
}
distributionLoadscaninvnService.save(loadscaninvnEntity);
kucuns.add(loadscaninvnEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新库存品装车数量
@ -2022,6 +2033,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!logList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
}
DistributionDeliveryListVO deliveryList = distributionDeliveryListService.getDeliveryList(distrilbutionloadingscanDTO.getDeliveryId());
// 发送 订制品
if(Func.isNotEmpty(dingzhis)){
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackage(deliveryList, dingzhis);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
if(Func.isNotEmpty(kucuns)){
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryList, kucuns);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
if(Func.isNotEmpty(lingdans)){
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByZeroOrder(deliveryList, lingdans);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
return Resp.scanSuccess("操作成功", "装车成功");
}
@ -2239,8 +2269,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distrilbutionloadingscanDTO.getReservationId());
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(distributionDeliveryListEntity, reservationEntity, ts);
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(distributionDeliveryListEntity, ts);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
String msg = getLoadingMsg(distrilbutionloadingscanDTO);
return Resp.scanSuccess("扫描成功", msg);
@ -9394,7 +9423,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
inventoryJsonObject.put("remark", "装车下架");
jsonObjects.add(inventoryJsonObject);
if (CollUtil.isNotEmpty(ts)) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity, reservationEntity2, ts);
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity, ts);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
break;

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
@ -3071,11 +3072,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionLoadscaninvnEntity distributionLoadscanEntity = pushList.get(0);
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setDriverId(distributionLoadscanEntity.getDriverId());
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setVehicleId(distributionLoadscanEntity.getVehicleId());
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getSigningUserId()));
if (StringUtil.isNotBlank(distributionLoadscanEntity.getVehicleName())) {
// 获取车辆类型
BasicCarModelEntity nc = iBasicCarModelClient.getCarModelByCarNumber(distributionLoadscanEntity.getVehicleName());
@ -3144,11 +3146,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setDriverId(distributionLoadscanEntity.getDriverId());
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getSigningUserId()));
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setVehicleId(distributionLoadscanEntity.getVehicleId());
if (StringUtil.isNotBlank(distributionLoadscanEntity.getVehicleName())) {
// 获取车辆类型
BasicCarModelEntity nc = iBasicCarModelClient.getCarModelByCarNumber(distributionLoadscanEntity.getVehicleName());
@ -3169,7 +3169,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
for (DistributionLoadscanEntity distributionParcelListEntity : pushList) {
PackageData packageData = new PackageData();
DistributionParcelListEntity distributionParcelListEntity1 = distributionParcelListService.getById(distributionParcelListEntity.getPackageId());
if(distributionParcelListEntity.getIsZero().equals(0)){
if(distributionParcelListEntity1.getConditions().equals(1)){
// 包件
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setNumber(1);
@ -3180,7 +3180,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
data.add(packageData);
}
}else if(distributionParcelListEntity.getIsZero().equals(1)){
}else if(distributionParcelListEntity1.getConditions().equals(3)){
// 零担
packageData.setPackageType(PackageTypeEnums.LTL);
packageData.setNumber(distributionLoadscanEntity.getReceivedQuantity());
@ -7046,9 +7046,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionLoadscanEntity distributionLoadscanEntity = pushList.get(0);
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setDriverId(distributionLoadscanEntity.getDriverId());
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setVehicleId(distributionLoadscanEntity.getVehicleId());
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getSigningUserId()));
distributionLoadVO.setOperatMode(operatMode);
DistributionReservationEntity byId = distributionReservationService.getById(distributionLoadscanEntity.getReservationId());
if (!Func.isEmpty(byId)) {
@ -7972,6 +7972,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
distributionLoadscanEntity = updateSignDistributionLoadscanEntity(loadscanEntity, user, parcelListEntity);
distributionLoadscanService.updateById(distributionLoadscanEntity);
//缺少一个异步维护包件签收的方法
distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
@ -8051,9 +8052,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
String singleTime = simpleDateFormat.format(new Date());
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, singleTime, myCurrentWarehouse);
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, reservationEntity, pushList, OperatModeConstant.BATCH);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
break;
case 2:
//零担
@ -9205,8 +9203,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setOneClick(1);
distributionLoadscanEntity.setOneQclick(1);
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setPackageId(loadscanEntity.getPackageId());
distributionLoadscanEntity.setVehicleId(loadscanEntity.getVehicleId());
distributionLoadscanEntity.setSigningUserId(loadscanEntity.getSigningUserId());
distributionLoadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
distributionLoadscanEntity.setSigningUser(user.getNickName());
distributionLoadscanEntity.setVehicleName(loadscanEntity.getVehicleName());
distributionLoadscanEntity.setSigningUserId(user.getUserId());
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue());
distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.weiqianshou.getValue());

Loading…
Cancel
Save