|
|
|
@ -4794,6 +4794,36 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private boolean judgeIsStart(DistributionDeliveryListEntity distributionDeliveryList, BasicdataWarehouseEntity warehouseEntity) { |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectPackageListByDeliveryListId(distributionDeliveryList.getId()); |
|
|
|
|
List<DistributionLoadscanAbnormalEntity> abnormalEntityList = new ArrayList<>(); |
|
|
|
|
if (!distributionParcelListEntities.isEmpty()) { |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
if (OrderPackageLoadingStatusConstant.weizhuancghe.getValue().equals(distributionParcelListEntity.getOrderPackageLoadingStatus())) { |
|
|
|
|
DistributionLoadscanAbnormalEntity packageLoadscanAbnormalEntity = createdPakcageAbnormal(distributionDeliveryList, distributionParcelListEntity, warehouseEntity); |
|
|
|
|
abnormalEntityList.add(packageLoadscanAbnormalEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distributionDeliveryList.getId()); |
|
|
|
|
if (!disStockListDetailEntities.isEmpty()) { |
|
|
|
|
for (DisStockListDetailEntity disStockListDetailEntity : disStockListDetailEntities) { |
|
|
|
|
if (InventoryLoadingStatusConstant.weizhuangche.getValue().equals(disStockListDetailEntity.getStockLockingStatus())) { |
|
|
|
|
DistributionLoadscanAbnormalEntity inventoryLoadscanAbnormalEntity = createdInventoryPakcageAbnormal(distributionDeliveryList, disStockListDetailEntity, warehouseEntity); |
|
|
|
|
abnormalEntityList.add(inventoryLoadscanAbnormalEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//零担
|
|
|
|
|
List<DistributionLoadscanAbnormalEntity> zeroLoadscanAbnormalList = baseMapper.selectZeroListByDeliveryId(distributionDeliveryList.getId()); |
|
|
|
|
if (!zeroLoadscanAbnormalList.isEmpty()) { |
|
|
|
|
abnormalEntityList.addAll(zeroLoadscanAbnormalList); |
|
|
|
|
} |
|
|
|
|
if (!abnormalEntityList.isEmpty()) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private DistributionLoadscanAbnormalEntity createdPakcageAbnormal(DistributionDeliveryListEntity distributionDeliveryList, DistributionParcelListEntity distributionParcelListEntity, BasicdataWarehouseEntity warehouseEntity) { |
|
|
|
|
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity(); |
|
|
|
@ -9570,6 +9600,35 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R isStart(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { |
|
|
|
|
String method = "#########################DistributionStockArticleController.loadingStart"; |
|
|
|
|
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())) { |
|
|
|
|
log.error(method + "参数缺失DeliveryId()"); |
|
|
|
|
return Resp.fail("参数缺失,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
return R.fail(403, "未授权!!!"); |
|
|
|
|
} |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
//获取当前用户司机
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
if (DeliveryStatusConstant.yiwancheng.getValue().equals(distributionDeliveryListEntity.getDeliveryStatus())) { |
|
|
|
|
return Resp.scanFail("该任务已完结!", "该任务已完结!"); |
|
|
|
|
} |
|
|
|
|
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == distributionDeliveryListEntity.getIsStart()) { |
|
|
|
|
return Resp.scanFail("该车次已发车!", "该车次已发车!"); |
|
|
|
|
} |
|
|
|
|
Boolean isDriverFlag = judgeIsDriver(user); |
|
|
|
|
if (!isDriverFlag) { |
|
|
|
|
return Resp.scanFail("当前操作人必须是司机!", "当前操作人必须是司机!"); |
|
|
|
|
} |
|
|
|
|
boolean flag = judgeIsStart(distributionDeliveryListEntity, myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
return Resp.status(flag); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private DistributionRetentionScanEntity buildZeroRetentionEntity(DistributionLoadscanEntity loadscanEntity) { |
|
|
|
|
DistributionRetentionScanEntity packageRetentionScanEntity = new DistributionRetentionScanEntity(); |
|
|
|
|
|
|
|
|
|