Browse Source

增加发车判断接口

dist.1.3.0
汤建军 7 months ago
parent
commit
eae5b71ac4
  1. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  2. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  3. 59
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java

@ -309,6 +309,17 @@ public class DistributionDeliveryAppController {
return msg;
}
/**
* 配送管理 发车
*/
@PostMapping("/isStart")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "发车", notes = "传入DistrilbutionloadingscanDTO")
public R isStart(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
return distributionDeliveryListService.isStart(distrilbutionloadingscanDTO);
}
/**
* 配送管理 发车
*/

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -568,6 +568,14 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId);
/**
* 是否可以发车
* @param distrilbutionloadingscanDTO
* @return
*/
R isStart(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
// /**
// * 滞留取消配送

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

@ -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();

Loading…
Cancel
Save