|
|
|
@ -1874,7 +1874,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.warn("预约信息不存在!"); |
|
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.yuyuebuzai.getName(), PdaAudioLingoStatus.yuyuebuzai.getName()); |
|
|
|
|
} |
|
|
|
|
if (list.size() < 1) { |
|
|
|
|
if (list.isEmpty()) { |
|
|
|
|
log.warn("包件信息不存在!"); |
|
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName()); |
|
|
|
|
} |
|
|
|
@ -1963,6 +1963,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionStock.setStockQuantity(1); |
|
|
|
|
distributionStock.setCoding(i.getPacketBarCode()); |
|
|
|
|
list1.add(distributionStock); |
|
|
|
|
|
|
|
|
|
// 备货作业节点
|
|
|
|
|
DistributionParcelListEntity distributionParcelListEntitie = distributionParcelListService.getById(i.getParcelListId()); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,distributionStock, distributionParcelListEntitie); |
|
|
|
|
if (ObjectUtils.isNotNull(nodeFanoutMsg)) { |
|
|
|
|
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (!fa.get()) { |
|
|
|
@ -2026,15 +2033,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
if (!list1.isEmpty()) { |
|
|
|
|
|
|
|
|
|
List<Long> collect = list1.stream().map(DistributionStockEntity::getParcelListId).collect(Collectors.toList()); |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(collect); |
|
|
|
|
// List<Long> collect = list1.stream().map(DistributionStockEntity::getParcelListId).collect(Collectors.toList());
|
|
|
|
|
// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(collect);
|
|
|
|
|
|
|
|
|
|
// 查询预约单、
|
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId()); |
|
|
|
|
// 备货作业节点
|
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,reservationEntity, distributionParcelListEntities); |
|
|
|
|
if (ObjectUtils.isNotNull(nodeFanoutMsg)) { |
|
|
|
|
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
|
// DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3884,11 +3888,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
trunklinePackageTrackLogClient.addPackageTrackLog(aaa); |
|
|
|
|
parcelListEntity = distributionParcelListService.getById(entity.getParcelListId()); |
|
|
|
|
List<DistributionParcelListEntity> ls = new ArrayList<>(); |
|
|
|
|
ls.add(parcelListEntity); |
|
|
|
|
// 备货作业节点
|
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId()); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,reservationEntity, ls); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,entity, parcelListEntity); |
|
|
|
|
if (ObjectUtils.isNotNull(nodeFanoutMsg)) { |
|
|
|
|
distributionNodeWorkService.planStock(nodeFanoutMsg, user); |
|
|
|
|
} |
|
|
|
@ -4267,22 +4268,27 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
entity.setTenantId(AuthUtil.getTenantId()); |
|
|
|
|
distributionStockService.save(entity); |
|
|
|
|
//这里尝试修改备货库存品包件的备货状态
|
|
|
|
|
boolean update = distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageCode, entity.getCoding()) |
|
|
|
|
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) |
|
|
|
|
.eq(DistributionParcelListEntity::getConditions, "2") |
|
|
|
|
.eq(DistributionParcelListEntity::getMaterialId, entity.getMaterialId()) |
|
|
|
|
.eq(entity.getStockArticle() != null, DistributionParcelListEntity::getStockArticleId, entity.getStockArticle()) |
|
|
|
|
.set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.yibeihu.getValue()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DistributionStockListEntity distributionStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId()); |
|
|
|
|
if(distributionStockListEntity!=null && "1".equals(distributionStockListEntity.getSourceType())){ |
|
|
|
|
//这里尝试修改备货库存品包件的备货状态
|
|
|
|
|
boolean update = distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageCode, entity.getCoding()) |
|
|
|
|
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) |
|
|
|
|
.eq(DistributionParcelListEntity::getConditions, "2") |
|
|
|
|
.eq(DistributionParcelListEntity::getMaterialId, entity.getMaterialId()) |
|
|
|
|
.eq(entity.getStockArticle() != null, DistributionParcelListEntity::getStockArticleId, entity.getStockArticle()) |
|
|
|
|
.set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.yibeihu.getValue()) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// todo 这里需要完善
|
|
|
|
|
// 备货作业节点
|
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity,reservationEntity, entity); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity, entity); |
|
|
|
|
if (ObjectUtils.isNotNull(nodeFanoutMsg)) { |
|
|
|
|
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
@ -4340,7 +4346,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public NodeFanoutMsg<StockUpVO> buildStockUpNodeData(DistributionStockupEntity distributionStockupEntity, DistributionReservationEntity reservationEntity, List<DistributionParcelListEntity> parcelListEntitys) { |
|
|
|
|
public NodeFanoutMsg<StockUpVO> buildStockUpNodeData(DistributionStockupEntity distributionStockupEntity, DistributionStockEntity entity ,DistributionParcelListEntity parcelListEntitys) { |
|
|
|
|
try { |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = new NodeFanoutMsg<StockUpVO>(); |
|
|
|
@ -4358,11 +4364,23 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
stockUpVO.setStockupDate(distributionStockupEntity.getStockupDate()); |
|
|
|
|
stockUpVO.setStockupCode(distributionStockupEntity.getStockupCode()); |
|
|
|
|
stockUpVO.setStockupArea(distributionStockupEntity.getStockupArea()); |
|
|
|
|
ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity); |
|
|
|
|
// ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity);
|
|
|
|
|
|
|
|
|
|
if("3".equals(entity.getOutboundType())){ |
|
|
|
|
// 自提
|
|
|
|
|
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingService.getById(entity.getBillLadingId()); |
|
|
|
|
if(billLadingEntity!=null){ |
|
|
|
|
stockUpVO.setReferenceCode(billLadingEntity.getPickupBatch()); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(entity.getReservationId()); |
|
|
|
|
if (reservationEntity != null){ |
|
|
|
|
stockUpVO.setReferenceCode(reservationEntity.getReservationCode()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<PackageData> packageDataList = new ArrayList<>(); |
|
|
|
|
parcelListEntitys.forEach(parcelListEntity -> packageDataList.add(getPackageData(parcelListEntity))); |
|
|
|
|
reservationVO.setPackageDataList(packageDataList); |
|
|
|
|
stockUpVO.setReservationVO(reservationVO); |
|
|
|
|
packageDataList.add(getPackageData(parcelListEntitys)); |
|
|
|
|
stockUpVO.setPackageDataList(packageDataList); |
|
|
|
|
nodeFanoutMsg.setMain(stockUpVO); |
|
|
|
|
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId()); |
|
|
|
|
|
|
|
|
@ -4408,7 +4426,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return trunklinePackageTrackLog; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private NodeFanoutMsg<StockUpVO> buildStockUpNodeDataByStock(DistributionStockupEntity stockupEntity,DistributionReservationEntity reservationEntity, DistributionStockEntity stockEntity) { |
|
|
|
|
private NodeFanoutMsg<StockUpVO> buildStockUpNodeDataByStock(DistributionStockupEntity stockupEntity, DistributionStockEntity stockEntity) { |
|
|
|
|
try { |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = new NodeFanoutMsg(); |
|
|
|
@ -4429,14 +4447,24 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
stockUpVO.setTypeService(stockupEntity.getTypeService()); |
|
|
|
|
stockUpVO.setStockupArea(stockupEntity.getStockupArea()); |
|
|
|
|
|
|
|
|
|
if("3".equals(stockEntity.getOutboundType())){ |
|
|
|
|
// 自提
|
|
|
|
|
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingService.getById(stockEntity.getBillLadingId()); |
|
|
|
|
if(billLadingEntity!=null){ |
|
|
|
|
stockUpVO.setReferenceCode(billLadingEntity.getPickupBatch()); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockEntity.getReservationId()); |
|
|
|
|
if (reservationEntity != null){ |
|
|
|
|
stockUpVO.setReferenceCode(reservationEntity.getReservationCode()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity); |
|
|
|
|
List<PackageData> packageDataList = new ArrayList<>(); |
|
|
|
|
PackageData packageData = getPackageDataByStock(stockEntity); |
|
|
|
|
packageDataList.add(packageData); |
|
|
|
|
reservationVO.setPackageDataList(packageDataList); |
|
|
|
|
stockUpVO.setPackageDataList(packageDataList); |
|
|
|
|
|
|
|
|
|
stockUpVO.setReservationVO(reservationVO); |
|
|
|
|
nodeFanoutMsg.setMain(stockUpVO); |
|
|
|
|
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId()); |
|
|
|
|
|
|
|
|
|