|
|
@ -108,6 +108,7 @@ public class DistributionStockupInfoServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
public void maintenanceStockUp(Long reservationId, Integer type) { |
|
|
|
public void maintenanceStockUp(Long reservationId, Integer type) { |
|
|
|
String method = "########################DistributionStockupInfoServiceImpl.maintenanceStockUp"; |
|
|
|
String method = "########################DistributionStockupInfoServiceImpl.maintenanceStockUp"; |
|
|
|
DistributionStockupInfoEntity stockupInfoEntity = null; |
|
|
|
DistributionStockupInfoEntity stockupInfoEntity = null; |
|
|
|
|
|
|
|
DistributionStockupInfoEntity distributionStockupInfoEntity = null; |
|
|
|
switch (type){ |
|
|
|
switch (type){ |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
//商配。市配备货任务
|
|
|
|
//商配。市配备货任务
|
|
|
@ -117,37 +118,55 @@ public class DistributionStockupInfoServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
.ne(DistributionStockupInfoEntity::getStockStatus, "4") |
|
|
|
.ne(DistributionStockupInfoEntity::getStockStatus, "4") |
|
|
|
); |
|
|
|
); |
|
|
|
if (entityList.size()==1){ |
|
|
|
if (entityList.size()==1){ |
|
|
|
|
|
|
|
distributionStockupInfoEntity = entityList.get(0); |
|
|
|
|
|
|
|
|
|
|
|
//可进行备货任务的完结标识
|
|
|
|
//可进行备货任务的完结标识
|
|
|
|
DistributionStockupInfoEntity distributionStockupInfoEntity = entityList.get(0); |
|
|
|
|
|
|
|
distributionStockupInfoEntity.setStockStatus("3"); |
|
|
|
distributionStockupInfoEntity.setStockStatus("3"); |
|
|
|
this.updateById(distributionStockupInfoEntity); |
|
|
|
this.updateById(distributionStockupInfoEntity); |
|
|
|
//查询备货任务是否都完成
|
|
|
|
//查询备货任务是否都完成
|
|
|
|
List<DistributionStockupInfoEntity> stockupInfoEntityList = this.list(Wrappers.<DistributionStockupInfoEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionStockupInfoEntity::getStockupId, distributionStockupInfoEntity.getStockupId()) |
|
|
|
|
|
|
|
.ne(DistributionStockupInfoEntity::getStockStatus, "4") |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (Func.isNotEmpty(stockupInfoEntityList)){ |
|
|
|
|
|
|
|
DistributionStockupEntity distributionStockupEntity = new DistributionStockupEntity(); |
|
|
|
|
|
|
|
distributionStockupEntity.setId(distributionStockupInfoEntity.getStockupId()); |
|
|
|
|
|
|
|
boolean flag = stockupInfoEntityList.stream().allMatch(f -> "3".equals(f.getStockStatus())); |
|
|
|
|
|
|
|
if (flag){ |
|
|
|
|
|
|
|
distributionStockupEntity.setStockupStatus(StockupStatusConstant.yibeihuo.getValue()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
//查询是否存在完结
|
|
|
|
|
|
|
|
boolean anyMatch = stockupInfoEntityList.stream().anyMatch(f -> "3".equals(f.getStockStatus())); |
|
|
|
|
|
|
|
if (anyMatch){ |
|
|
|
|
|
|
|
distributionStockupEntity.setStockupStatus(StockupStatusConstant.beihuozhong.getValue()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
distributionStockupEntity.setStockupStatus(StockupStatusConstant.daibeihuo.getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
distributionStockupService.updateById(distributionStockupEntity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
}else { |
|
|
|
//查询备货任务错误的原因
|
|
|
|
//查询备货任务错误的原因
|
|
|
|
log.error(method+"预约单关联备货任务错误reservationId:{}",reservationId); |
|
|
|
log.error(method+"预约单关联备货任务错误reservationId:{}",reservationId); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 2: |
|
|
|
|
|
|
|
List<DistributionStockupInfoEntity> billLadingentityList = this.list(Wrappers.<DistributionStockupInfoEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionStockupInfoEntity::getReservationId, reservationId) |
|
|
|
|
|
|
|
.eq(DistributionStockupInfoEntity::getStockUpType, 3) |
|
|
|
|
|
|
|
.ne(DistributionStockupInfoEntity::getStockStatus, "4") |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (billLadingentityList.size() == 1){ |
|
|
|
|
|
|
|
distributionStockupInfoEntity = billLadingentityList.get(0); |
|
|
|
|
|
|
|
//可进行备货任务的完结标识
|
|
|
|
|
|
|
|
distributionStockupInfoEntity.setStockStatus("3"); |
|
|
|
|
|
|
|
this.updateById(distributionStockupInfoEntity); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
log.error(method+"预约单关联备货任务错误reservationId:{}",reservationId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
List<DistributionStockupInfoEntity> stockupInfoEntityList = this.list(Wrappers.<DistributionStockupInfoEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionStockupInfoEntity::getStockupId, distributionStockupInfoEntity.getStockupId()) |
|
|
|
|
|
|
|
.ne(DistributionStockupInfoEntity::getStockStatus, "4") |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (Func.isNotEmpty(stockupInfoEntityList)){ |
|
|
|
|
|
|
|
DistributionStockupEntity distributionStockupEntity = new DistributionStockupEntity(); |
|
|
|
|
|
|
|
distributionStockupEntity.setId(distributionStockupInfoEntity.getStockupId()); |
|
|
|
|
|
|
|
boolean flag = stockupInfoEntityList.stream().allMatch(f -> "3".equals(f.getStockStatus())); |
|
|
|
|
|
|
|
if (flag){ |
|
|
|
|
|
|
|
distributionStockupEntity.setStockupStatus(StockupStatusConstant.yibeihuo.getValue()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
//查询是否存在完结
|
|
|
|
|
|
|
|
boolean anyMatch = stockupInfoEntityList.stream().anyMatch(f -> "3".equals(f.getStockStatus())); |
|
|
|
|
|
|
|
if (anyMatch){ |
|
|
|
|
|
|
|
distributionStockupEntity.setStockupStatus(StockupStatusConstant.beihuozhong.getValue()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
distributionStockupEntity.setStockupStatus(StockupStatusConstant.daibeihuo.getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
distributionStockupService.updateById(distributionStockupEntity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|