|
|
|
@ -145,7 +145,6 @@ import java.util.Objects;
|
|
|
|
|
import java.util.Set; |
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
|
import java.util.function.Function; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -1546,6 +1545,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionPlanLogService.save(distributionPlanLogEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleCreatedDistributionLog(DistributionDeliveryListEntity distributionDeliveryListEntity, BasicdataWarehouseEntity myCurrentWarehouse, BladeUser user,String reservationCodes) { |
|
|
|
|
String distributionContent = user.getNickName() + "在" + myCurrentWarehouse.getName() |
|
|
|
|
+ "创建市配配送计划;车次号:" + distributionDeliveryListEntity.getTrainNumber() |
|
|
|
|
+ "预约编号:[" + reservationCodes + "],总件数:" + distributionDeliveryListEntity.getDeliveryNumber(); |
|
|
|
|
DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); |
|
|
|
|
distributionPlanLogEntity.setContent(distributionContent); |
|
|
|
|
distributionPlanLogEntity.setRefId(distributionDeliveryListEntity.getId()); |
|
|
|
|
distributionPlanLogEntity.setRefCode(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
|
distributionPlanLogEntity.setOperator(user.getNickName()); |
|
|
|
|
distributionPlanLogEntity.setType(3); |
|
|
|
|
distributionPlanLogService.save(distributionPlanLogEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -2212,7 +2226,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
* @param user |
|
|
|
|
* @param myCurrentWarehouse |
|
|
|
|
*/ |
|
|
|
|
private void compareReservation(DistributionReservationEntity reservationEntity, DistributionReservationEntity oldReservation, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) { |
|
|
|
|
@Override |
|
|
|
|
public void compareReservation(DistributionReservationEntity reservationEntity, DistributionReservationEntity oldReservation, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) { |
|
|
|
|
Integer newPlanNum = reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum(); |
|
|
|
|
Integer oldPlanNum = oldReservation.getReservationNum() + oldReservation.getReservationStockListNum(); |
|
|
|
|
String planContent = user.getNickName() + "在" + myCurrentWarehouse.getName() |
|
|
|
@ -2301,6 +2316,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//收货单位
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
List<JSONObject> aaa = new ArrayList<>(); |
|
|
|
|
StringBuffer saa = new StringBuffer(); |
|
|
|
|
mallClient.forEach((k, v) -> { |
|
|
|
|
clientTotal.getAndIncrement(); |
|
|
|
|
DistributionReservationDTO reservation = allocationDTO.getReservation(); |
|
|
|
@ -2540,6 +2556,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
reservationStockarticleEntity.setStockArticleCode(s.getStockArticleCode()); |
|
|
|
|
reservationStockarticleEntity.setStockArticleId(s.getId()); |
|
|
|
|
reservationStockarticleEntity.setIsHaveData(s.getIsHaveData()); |
|
|
|
|
//进行日志记录
|
|
|
|
|
distributionReservationStockarticleService.save(reservationStockarticleEntity); |
|
|
|
|
packageTotal.getAndAdd(reservationStockarticleEntity.getReservationNum()); |
|
|
|
|
orderTotal.getAndIncrement(); |
|
|
|
@ -2609,6 +2626,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); |
|
|
|
|
//预约添加订单数量
|
|
|
|
|
reservationEntity.setReservationNum(packageTotal.get()); |
|
|
|
|
reservationEntity.setReservationStockListNum(0); |
|
|
|
|
saa.append(reservationEntity.getReservationCode()).append(","); |
|
|
|
|
handleCreatedReservationPlanLog(reservationEntity,user,myCurrentWarehouse); |
|
|
|
|
this.updateById(reservationEntity); |
|
|
|
|
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum()); |
|
|
|
|
if (Func.isNotEmpty(reservationEntity.getReservationStockListNum())) { |
|
|
|
@ -2718,6 +2738,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.daifache.getValue()); |
|
|
|
|
distributionDeliveryListEntity.setIsAll(allocationDTO.getIsAll()); |
|
|
|
|
distributionDeliveryListService.updateById(distributionDeliveryListEntity); |
|
|
|
|
handleCreatedDistributionLog(distributionDeliveryListEntity, myCurrentWarehouse, user,saa.deleteCharAt(saa.lastIndexOf(",")).toString()); |
|
|
|
|
|
|
|
|
|
//推送信息至运单追中日志
|
|
|
|
|
if (!aaa.isEmpty()) { |
|
|
|
|
trunklinePackageTrackLogClient.addPackageTrackLog(aaa); |
|
|
|
@ -2907,9 +2929,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleCancelReservationPlanLog(reservationEntity,AuthUtil.getUser(),myCurrentWarehouse,reservationDTO.getCancelReason()); |
|
|
|
|
NodeFanoutMsg<ReservationVO> nodeFanoutMsg =buildNodeFanoutMsgByReservationByCancel(reservationEntity); |
|
|
|
|
|
|
|
|
|
distributionNodeWorkService.cancelReservation(nodeFanoutMsg,AuthUtil.getUser()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3673,7 +3694,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
return reservationVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleCreatedReservationPlanLog(DistributionReservationEntity reservationEntity, BladeUser user, BasicdataWarehouseEntity warehouse) { |
|
|
|
|
@Override |
|
|
|
|
public void handleCreatedReservationPlanLog(DistributionReservationEntity reservationEntity, BladeUser user, BasicdataWarehouseEntity warehouse) { |
|
|
|
|
String planContent = user.getNickName() + "在" + warehouse.getName() |
|
|
|
|
+ "创建预约计划;预约计划编号:" + reservationEntity.getReservationCode() |
|
|
|
|
+ ";收货单位:" + reservationEntity.getReceivingUnit() |
|
|
|
@ -3681,7 +3703,29 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
+ ",联系电话:" + reservationEntity.getDeliveryPhone() |
|
|
|
|
+ ",收货地址:" + reservationEntity.getDeliveryAddress() |
|
|
|
|
+ ",计划件数:" + (reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum()) |
|
|
|
|
+ ",配送类型:" + (reservationEntity.getDeliveryWay().equals(DistributionTypeConstant.shangpei.getValue()) ? "商配" : "市配"); |
|
|
|
|
+ ",配送类型:" + (reservationEntity.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()) ? "商配" : "市配"); |
|
|
|
|
DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); |
|
|
|
|
distributionPlanLogEntity.setContent(planContent); |
|
|
|
|
distributionPlanLogEntity.setRefId(reservationEntity.getId()); |
|
|
|
|
distributionPlanLogEntity.setRefCode(reservationEntity.getReservationCode()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseId(warehouse.getId()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseName(warehouse.getName()); |
|
|
|
|
distributionPlanLogEntity.setOperator(user.getNickName()); |
|
|
|
|
distributionPlanLogEntity.setType(1); |
|
|
|
|
distributionPlanLogService.save(distributionPlanLogEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void handleCancelReservationPlanLog(DistributionReservationEntity reservationEntity, BladeUser user, BasicdataWarehouseEntity warehouse, String cancelReason) { |
|
|
|
|
String planContent = user.getNickName() + "在" + warehouse.getName() |
|
|
|
|
+ "取消预约计划;预约计划编号:" + reservationEntity.getReservationCode() |
|
|
|
|
+ ";收货单位:" + reservationEntity.getReceivingUnit() |
|
|
|
|
+ ",收货人:" + reservationEntity.getConsignee() |
|
|
|
|
+ ",联系电话:" + reservationEntity.getDeliveryPhone() |
|
|
|
|
+ ",收货地址:" + reservationEntity.getDeliveryAddress() |
|
|
|
|
+ ",计划件数:" + (reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum()) |
|
|
|
|
+ ",配送类型:" + (reservationEntity.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()) ? "商配" : "市配") |
|
|
|
|
+ ",取消原因:" + cancelReason; |
|
|
|
|
DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); |
|
|
|
|
distributionPlanLogEntity.setContent(planContent); |
|
|
|
|
distributionPlanLogEntity.setRefId(reservationEntity.getId()); |
|
|
|
|