opt: 查询是否存在任务正在搬运过来出现异常
This commit is contained in:
@@ -573,30 +573,38 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
// 兜底
|
||||
needQuantity = needTemp > 0 ? needTemp : 1;
|
||||
}
|
||||
// 2.2 查询是否存在任务正在搬运过来。(路上的是另一台机构的轴)
|
||||
List<MdPbPapervehicle> havePapers = papervehicleService.getInfoByTask();
|
||||
if (CollectionUtil.isNotEmpty(havePapers)) {
|
||||
Map<String, BigDecimal> sumByMaterialCode = havePapers.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
MdPbPapervehicle::getMaterial_code,
|
||||
Collectors.mapping(
|
||||
MdPbPapervehicle::getQty,
|
||||
Collectors.reducing(
|
||||
BigDecimal.ZERO,
|
||||
BigDecimal::add
|
||||
)
|
||||
)
|
||||
));
|
||||
int sumQty = sumByMaterialCode.get(tubes.get(0)).intValue();
|
||||
if (sumQty >= needQuantity ) {
|
||||
stepErrorInfo.add("AGV正在搬运管芯...");
|
||||
log.info("AGV正在搬运管芯...");
|
||||
return true;
|
||||
try {
|
||||
// 2.2 查询是否存在任务正在搬运过来。(路上的是另一台机构的轴)
|
||||
List<MdPbPapervehicle> havePapers = papervehicleService.getInfoByTask();
|
||||
if (CollectionUtil.isNotEmpty(havePapers)) {
|
||||
Map<String, BigDecimal> sumByMaterialCode = havePapers.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
MdPbPapervehicle::getMaterial_code,
|
||||
Collectors.mapping(
|
||||
MdPbPapervehicle::getQty,
|
||||
Collectors.reducing(
|
||||
BigDecimal.ZERO,
|
||||
BigDecimal::add
|
||||
)
|
||||
)
|
||||
));
|
||||
BigDecimal qty = sumByMaterialCode.get(tubes.get(0));
|
||||
if (ObjectUtil.isNotEmpty(qty)) {
|
||||
int sumQty = qty.intValue();
|
||||
if (sumQty >= needQuantity ) {
|
||||
stepErrorInfo.add("AGV正在搬运管芯...");
|
||||
log.info("AGV正在搬运管芯...");
|
||||
return true;
|
||||
}
|
||||
// 如果不够,就计算还缺多少个
|
||||
int needTemp = needQuantity - sumQty;
|
||||
// 兜底
|
||||
needQuantity = needTemp > 0 ? needTemp : tubes.size();
|
||||
}
|
||||
}
|
||||
// 如果不够,就计算还缺多少个
|
||||
int needTemp = needQuantity - sumQty;
|
||||
// 兜底
|
||||
needQuantity = needTemp > 0 ? needTemp : tubes.size();
|
||||
} catch (Exception e) {
|
||||
stepErrorInfo.add("查询是否存在任务正在搬运过来出现异常: " + e.getMessage());
|
||||
log.error("查询是否存在任务正在搬运过来出现异常:{}", e);
|
||||
}
|
||||
// 2.3 查找type=0的位置(待命的托盘)中是否存在(需要判断的是单独一个托盘) 校验了不在搬运中
|
||||
List<BhTubePointDto> stockingivtList = stockingivtService.getNeedPaperTubePoint("0", tubes.get(0), location);
|
||||
|
||||
Reference in New Issue
Block a user