|
|
|
@ -37,6 +37,7 @@ import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
|
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataDriverArteryClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
import com.logpm.basicdata.vo.BasicdataWarehouseVO; |
|
|
|
|
import com.logpm.distribution.bean.Resp; |
|
|
|
|
import com.logpm.distribution.dto.*; |
|
|
|
|
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; |
|
|
|
@ -4679,7 +4680,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
log.error(method + "参数缺失DeliveryId()"); |
|
|
|
|
return Resp.fail("参数缺失,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
BasicdataWarehouseVO myCurrentWarehouse = warehouseClient.getMyCurrentWarehouseAndConfig(); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
return R.fail(403, "未授权!!!"); |
|
|
|
|
} |
|
|
|
@ -4841,11 +4842,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//进行异常的标记
|
|
|
|
|
List<Long> reservationIds = abnormalEntityList.stream().map(DistributionLoadscanAbnormalEntity::getReservationId).collect(Collectors.toList()); |
|
|
|
|
distributionSignforService.update(Wrappers.<DistributionSignforEntity>update().lambda() |
|
|
|
|
.in(DistributionSignforEntity::getReservationId,reservationIds) |
|
|
|
|
.set(DistributionSignforEntity::getIsHaveAbnormalPackage,2) |
|
|
|
|
.in(DistributionSignforEntity::getReservationId, reservationIds) |
|
|
|
|
.set(DistributionSignforEntity::getIsHaveAbnormalPackage, 2) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean judgeIsStart(DistributionDeliveryListEntity distributionDeliveryList, BasicdataWarehouseEntity warehouseEntity) { |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectPackageListByDeliveryListId(distributionDeliveryList.getId()); |
|
|
|
|
List<DistributionLoadscanAbnormalEntity> abnormalEntityList = new ArrayList<>(); |
|
|
|
@ -6915,7 +6917,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
aaa.add(js); |
|
|
|
|
//对滞留包件进行签收信息数量减少
|
|
|
|
|
//进行指定包件的相关订单维护
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId()); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), parcelListEntity.getWarehouseId()); |
|
|
|
|
} |
|
|
|
|
if (!aaa.isEmpty()) { |
|
|
|
|
trunklinePackageTrackLogClient.addPackageTrackLog(aaa); |
|
|
|
@ -8717,9 +8719,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
String orderPackageCode = distrilbutionloadingscanDTO.getBarcode(); |
|
|
|
|
//校验当前包件是否存在回库任务
|
|
|
|
|
boolean isHaveRetention = retentionScanClient.judgeIsHaveRetention(orderPackageCode,myCurrentWarehouse.getId()); |
|
|
|
|
if (isHaveRetention){ |
|
|
|
|
return Resp.scanFail("当前包件存在回库任务","当前包件存在回库任务"); |
|
|
|
|
boolean isHaveRetention = retentionScanClient.judgeIsHaveRetention(orderPackageCode, myCurrentWarehouse.getId()); |
|
|
|
|
if (isHaveRetention) { |
|
|
|
|
return Resp.scanFail("当前包件存在回库任务", "当前包件存在回库任务"); |
|
|
|
|
} |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(orderPackageCode, myCurrentWarehouse.getId()); |
|
|
|
|
if (Objects.isNull(parcelListEntity)) { |
|
|
|
@ -8761,7 +8763,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (isAbnormalLoadingFlag) { |
|
|
|
|
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
//已发车无法进行异常装车
|
|
|
|
|
if (DeliveryStartStatusConstant.yifache.equals(deliveryListEntity.getIsStart())){ |
|
|
|
|
if (DeliveryStartStatusConstant.yifache.equals(deliveryListEntity.getIsStart())) { |
|
|
|
|
return Resp.scanFail("已发车无法进行异常装车", "已发车无法进行异常装车"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())) { |
|
|
|
@ -8776,7 +8778,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
DistributionLoadscanEntity loadscanEntity = createdDistributionLoadscanEntity(deliveryListEntity, distributionDeliverySelfEntity, reservationId, parcelListEntity, myCurrentWarehouse, user); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
//这里还需要对异常记录进行关闭和完成
|
|
|
|
|
distributionLoadscanAbnormalService.completeLoadingAbnormal(loadscanEntity.getOrderPackageCode(),loadscanEntity.getWarehouseId(),loadscanEntity.getReservationId(),loadscanEntity.getScanUser()); |
|
|
|
|
distributionLoadscanAbnormalService.completeLoadingAbnormal(loadscanEntity.getOrderPackageCode(), loadscanEntity.getWarehouseId(), loadscanEntity.getReservationId(), loadscanEntity.getScanUser()); |
|
|
|
|
//更新包件装车状态
|
|
|
|
|
packageLockIds.add(parcelListEntity.getId()); |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
@ -8942,9 +8944,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
//校验当前包件是否存在回库任务
|
|
|
|
|
boolean isHaveInventoryRetention = retentionScanClient.judgeIsHaveRetention(distrilbutionloadingscanDTO.getBarcode(),myCurrentWarehouse.getId()); |
|
|
|
|
if (isHaveInventoryRetention){ |
|
|
|
|
return Resp.scanFail("当前包件存在回库任务","当前包件存在回库任务"); |
|
|
|
|
boolean isHaveInventoryRetention = retentionScanClient.judgeIsHaveRetention(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId()); |
|
|
|
|
if (isHaveInventoryRetention) { |
|
|
|
|
return Resp.scanFail("当前包件存在回库任务", "当前包件存在回库任务"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())) { |
|
|
|
|
log.error(method + "参数缺失Barcode"); |
|
|
|
@ -9481,7 +9483,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//进行批量取消异常并且取消计划
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cancelLoadscanAbnormalEntity(abnormalEntities, reservationId, deliveryId,myCurrentWarehouseAndConfig.getId()); |
|
|
|
|
return cancelLoadscanAbnormalEntity(abnormalEntities, reservationId, deliveryId, myCurrentWarehouseAndConfig.getId()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -9641,12 +9643,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
@Transactional |
|
|
|
|
public boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId, Long loadingId) { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
List<Long> ids = new ArrayList<>(); |
|
|
|
|
ids.add(orderId); |
|
|
|
|
distributionReservationZeroPackageService.reduceNum(reservationId,orderId,orderPackageId,retentionQuantity,loadingId); |
|
|
|
|
distributionReservationZeroPackageService.reduceNum(reservationId, orderId, orderPackageId, retentionQuantity, loadingId); |
|
|
|
|
distributionParcelListService.maintenanceZerpPackageInfo(orderPackageId); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfoByIds(ids); |
|
|
|
|
distributionParcelListService.maintenanceZerpPackageInfo(orderPackageId); |
|
|
|
@ -9682,8 +9684,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (!isDriverFlag) { |
|
|
|
|
return Resp.scanFail("当前操作人必须是司机!", "当前操作人必须是司机!"); |
|
|
|
|
} |
|
|
|
|
boolean flag = judgeIsStart(distributionDeliveryListEntity, myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
boolean flag = false; |
|
|
|
|
flag = judgeIsStart(distributionDeliveryListEntity, myCurrentWarehouse); |
|
|
|
|
return Resp.data(flag); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -9716,7 +9718,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return packageRetentionScanEntity; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private R cancelLoadscanAbnormalEntity(List<DistributionLoadscanAbnormalEntity> abnormalEntities, Long reservationId, Long deliveryId,Long warehouseId) { |
|
|
|
|
private R cancelLoadscanAbnormalEntity(List<DistributionLoadscanAbnormalEntity> abnormalEntities, Long reservationId, Long deliveryId, Long warehouseId) { |
|
|
|
|
List<Long> packageIds = new ArrayList<>(); |
|
|
|
|
List<Long> inventoryPackageIds = new ArrayList<>(); |
|
|
|
|
List<DistributionLoadscanAbnormalEntity> cancelZeroData = new ArrayList<>(); |
|
|
|
@ -9760,7 +9762,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionReservationService.cancelReservationPackage(distributionCancelReservationPackageDTO); |
|
|
|
|
} |
|
|
|
|
if (!cancelZeroData.isEmpty()) { |
|
|
|
|
distributionReservationService.cancelReservationZeroPackage(cancelZeroData,warehouseId); |
|
|
|
|
distributionReservationService.cancelReservationZeroPackage(cancelZeroData, warehouseId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!cancelIds.isEmpty()) { |
|
|
|
|