|
@@ -3633,20 +3633,20 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public OnDutyStorageBill queryOnDutyShipmentBoard(String ccmNo) {
|
|
|
+ public List<StorageBill> queryOnDutyShipmentBoard(String ccmNo) {
|
|
|
|
|
|
- OnDutyStorageBill onDutyStorageBill = new OnDutyStorageBill();
|
|
|
+ List<StorageBill> storageBillList = new ArrayList<>();
|
|
|
|
|
|
String shiftGroup = "";
|
|
|
String shift = "";
|
|
|
BilletHotsendChangeShift billetHotsendChangeShift;
|
|
|
|
|
|
// 从 Redis 获取班次信息
|
|
|
- shiftGroup = getShiftInfo(ccmNo, "class:shift:group:%s");
|
|
|
- shift = getShiftInfo(ccmNo, "class:shift:%s");
|
|
|
+ shiftGroup = getShiftInfo("5", "class:shift:group:%s");
|
|
|
+ shift = getShiftInfo("5", "class:shift:%s");
|
|
|
// 根据铸机号、缓存中的当前班次,倒序最新一条,获取交班记录中的创建时间
|
|
|
LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
|
|
|
+ queryWrapper.eq(StringUtils.isNotBlank(ccmNo), BilletHotsendChangeShift::getCcmNo, ccmNo)
|
|
|
.eq(BilletHotsendChangeShift::getShift, shift)
|
|
|
.eq(BilletHotsendChangeShift::getShiftGroup, shiftGroup)
|
|
|
.orderByDesc(BilletHotsendChangeShift::getCreateTime)
|
|
@@ -3654,13 +3654,13 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
|
|
|
if (billetHotsendChangeShift == null){
|
|
|
log.info("{}{}", "查询当班正在装运信息失败,交班记录为空!", ccmNo + "失败时间:" + new Date());
|
|
|
- return onDutyStorageBill;
|
|
|
+ return storageBillList;
|
|
|
}
|
|
|
|
|
|
|
|
|
// 根据铸机号、班组、班别,amountTotal不等于0 ,查询当班装运单信息
|
|
|
LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper2.eq(StorageBill::getCcmNo, ccmNo)
|
|
|
+ queryWrapper2.eq(StringUtils.isNotBlank(ccmNo), StorageBill::getCcmNo, ccmNo)
|
|
|
.eq(StorageBill::getShift, shift)
|
|
|
.eq(StorageBill::getShiftGroup, shiftGroup)
|
|
|
.notIn(StorageBill::getLicensePlate, Arrays.asList("辊道", "堆垛辊道"))
|
|
@@ -3669,70 +3669,12 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
// 时间范围从 createTime 到当前时间
|
|
|
queryWrapper2.between(StorageBill::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
|
|
|
|
|
|
- List<StorageBill> storageBillList = baseMapper.selectList(queryWrapper2);
|
|
|
+ storageBillList = baseMapper.selectList(queryWrapper2);
|
|
|
if (oConvertUtils.listIsEmpty(storageBillList)){
|
|
|
log.info("{}{}", "查询当班装运单信息为空!", ccmNo);
|
|
|
- return onDutyStorageBill;
|
|
|
- }
|
|
|
- List<OnDutyStorageBillInfo> onDutyStorageBillInfos = new ArrayList<>();
|
|
|
- for (StorageBill storageBill : storageBillList) {
|
|
|
- OnDutyStorageBillInfo onDutyStorageBillInfo = new OnDutyStorageBillInfo();
|
|
|
- BeanUtils.copyProperties(storageBill, onDutyStorageBillInfo);
|
|
|
- if ("棒二".equals(storageBill.getDestination())){
|
|
|
- // 根据装运单ID查询棒二明细表,并计算出坯量
|
|
|
- LambdaQueryWrapper<RollClubTwoDetails> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper3.eq(RollClubTwoDetails::getCcmNo, ccmNo).eq(RollClubTwoDetails::getStorageBillId, storageBill.getId());
|
|
|
- List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapper3);
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)) {
|
|
|
- // 统计 blankOutput 总和并保留 4 位小数
|
|
|
- double totalBlankOutput = rollClubTwoDetailsList.stream()
|
|
|
- .mapToDouble(RollClubTwoDetails::getBlankOutput)
|
|
|
- .sum();
|
|
|
-
|
|
|
- BigDecimal bd = new BigDecimal(totalBlankOutput);
|
|
|
- bd = bd.setScale(4, BigDecimal.ROUND_HALF_UP);
|
|
|
- double blankOutputSum = bd.doubleValue();
|
|
|
- onDutyStorageBillInfo.setBlankOutput(blankOutputSum);
|
|
|
- }
|
|
|
- }
|
|
|
- if ("棒三".equals(storageBill.getDestination())){
|
|
|
- // 根据装运单ID查询棒二明细表,并计算出坯量
|
|
|
- LambdaQueryWrapper<RollClubThreeDetails> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper3.eq(RollClubThreeDetails::getCcmNo, ccmNo).eq(RollClubThreeDetails::getStorageBillId, storageBill.getId());
|
|
|
- List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapper3);
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)) {
|
|
|
- // 统计 blankOutput 总和并保留 4 位小数
|
|
|
- double totalBlankOutput = rollClubThreeDetailsList.stream()
|
|
|
- .mapToDouble(RollClubThreeDetails::getBlankOutput)
|
|
|
- .sum();
|
|
|
-
|
|
|
- BigDecimal bd = new BigDecimal(totalBlankOutput);
|
|
|
- bd = bd.setScale(4, BigDecimal.ROUND_HALF_UP);
|
|
|
- double blankOutputSum = bd.doubleValue();
|
|
|
- onDutyStorageBillInfo.setBlankOutput(blankOutputSum);
|
|
|
- }
|
|
|
- }
|
|
|
- if ("上若".equals(storageBill.getDestination())){
|
|
|
- // 根据装运单ID查询棒二明细表,并计算出坯量
|
|
|
- LambdaQueryWrapper<RollOutShippDetails> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper3.eq(RollOutShippDetails::getCcmNo, ccmNo).eq(RollOutShippDetails::getStorageBillId, storageBill.getId());
|
|
|
- List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapper3);
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)) {
|
|
|
- // 统计 blankOutput 总和并保留 4 位小数
|
|
|
- double totalBlankOutput = rollOutShippDetailsList.stream()
|
|
|
- .mapToDouble(RollOutShippDetails::getBlankOutput)
|
|
|
- .sum();
|
|
|
-
|
|
|
- BigDecimal bd = new BigDecimal(totalBlankOutput);
|
|
|
- bd = bd.setScale(4, BigDecimal.ROUND_HALF_UP);
|
|
|
- double blankOutputSum = bd.doubleValue();
|
|
|
- onDutyStorageBillInfo.setBlankOutput(blankOutputSum);
|
|
|
- }
|
|
|
- }
|
|
|
- onDutyStorageBillInfos.add(onDutyStorageBillInfo);
|
|
|
+ return storageBillList;
|
|
|
}
|
|
|
- onDutyStorageBill.setOnDutyStorageBillInfos(onDutyStorageBillInfos);
|
|
|
- return onDutyStorageBill;
|
|
|
+ return storageBillList;
|
|
|
}
|
|
|
|
|
|
@Override
|