|
@@ -1852,9 +1852,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
|
|
|
// 根据铸机号、班组、班别、时间范围。查询棒二明细表
|
|
|
LambdaQueryWrapper<StackingUpLog> stackingUpLogQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- stackingUpLogQueryWrapper.eq(StackingUpLog::getCcmNo, ccmNo)
|
|
|
- .eq(StackingUpLog::getShift, shift)
|
|
|
- .eq(StackingUpLog::getShiftGroup, shiftGroup);
|
|
|
+ stackingUpLogQueryWrapper.eq(StackingUpLog::getCcmNo, ccmNo);
|
|
|
// 检查 billetHotsendChangeShift 是否为空
|
|
|
if (oConvertUtils.isEmpty(changeShiftId)) {
|
|
|
// 当 changeShiftId 为空时,时间范围从 createTime 到当前时间
|
|
@@ -2415,6 +2413,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
|
|
|
.eq(BilletHotsendChangeShift::getShift, shift)
|
|
|
.eq(BilletHotsendChangeShift::getShiftGroup, shiftGroup)
|
|
|
+ .isNull(BilletHotsendChangeShift::getChangeShiftTime)
|
|
|
.orderByDesc(BilletHotsendChangeShift::getCreateTime)
|
|
|
.last("limit 1");
|
|
|
billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
|
|
@@ -2443,8 +2442,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
// 根据铸机号、班组、班别,amountTotal不等于0 ,查询当班装运单信息
|
|
|
LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper2.eq(StorageBill::getCcmNo, ccmNo)
|
|
|
- .eq(StorageBill::getShift, shift)
|
|
|
- .eq(StorageBill::getShiftGroup, shiftGroup)
|
|
|
.notIn(StorageBill::getLicensePlate, Arrays.asList("辊道", "堆垛辊道"))
|
|
|
.gt(StorageBill::getAmountTotal, 0);
|
|
|
// 检查 billetHotsendChangeShift 是否为空
|
|
@@ -2483,8 +2480,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
for (StorageBill storageBill : storageBillList) {
|
|
|
if ("棒二".equals(storageBill.getDestination())) {
|
|
|
LambdaQueryWrapper<RollClubTwoDetails> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper3.eq(RollClubTwoDetails::getCcmNo, ccmNo).eq(RollClubTwoDetails::getStorageBillId, storageBill.getId())
|
|
|
- .eq(RollClubTwoDetails::getShift, shift).eq(RollClubTwoDetails::getShiftGroup, shiftGroup);
|
|
|
+ queryWrapper3.eq(RollClubTwoDetails::getCcmNo, ccmNo).eq(RollClubTwoDetails::getStorageBillId, storageBill.getId());
|
|
|
List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapper3);
|
|
|
if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)) {
|
|
|
rollClubTwoDetailsListAll.addAll(rollClubTwoDetailsList);
|
|
@@ -2493,8 +2489,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
|
|
|
if ("棒三".equals(storageBill.getDestination())) {
|
|
|
LambdaQueryWrapper<RollClubThreeDetails> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper3.eq(RollClubThreeDetails::getCcmNo, ccmNo).eq(RollClubThreeDetails::getStorageBillId, storageBill.getId())
|
|
|
- .eq(RollClubThreeDetails::getShift, shift).eq(RollClubThreeDetails::getShiftGroup, shiftGroup);
|
|
|
+ queryWrapper3.eq(RollClubThreeDetails::getCcmNo, ccmNo).eq(RollClubThreeDetails::getStorageBillId, storageBill.getId());
|
|
|
List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapper3);
|
|
|
if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)) {
|
|
|
log.info("{}{}", "装运单对应的棒三明细总数:", rollClubThreeDetailsList.size());
|
|
@@ -2504,8 +2499,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
|
|
|
if ("上若".equals(storageBill.getDestination())) {
|
|
|
LambdaQueryWrapper<RollOutShippDetails> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper3.eq(RollOutShippDetails::getCcmNo, ccmNo).eq(RollOutShippDetails::getStorageBillId, storageBill.getId())
|
|
|
- .eq(RollOutShippDetails::getShift, shift).eq(RollOutShippDetails::getShiftGroup, shiftGroup);
|
|
|
+ queryWrapper3.eq(RollOutShippDetails::getCcmNo, ccmNo).eq(RollOutShippDetails::getStorageBillId, storageBill.getId());
|
|
|
List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapper3);
|
|
|
if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)) {
|
|
|
rollOutShippDetailsListAll.addAll(rollOutShippDetailsList);
|
|
@@ -2620,6 +2614,60 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
return storageBillStatistics;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<BilletBasicInfo> queryBilletBasicInfoHandle(String ccmNo, String changeShiftId) {
|
|
|
+ List<BilletBasicInfo> list = new ArrayList<>();
|
|
|
+
|
|
|
+ String shiftGroup = "";
|
|
|
+ String shift = "";
|
|
|
+
|
|
|
+ BilletHotsendChangeShift billetHotsendChangeShift;
|
|
|
+ if(oConvertUtils.isEmpty(changeShiftId)){
|
|
|
+ // 从 Redis 获取班次信息
|
|
|
+ shiftGroup = getShiftInfo(ccmNo, "class:shift:group:%s");
|
|
|
+ shift = getShiftInfo(ccmNo, "class:shift:%s");
|
|
|
+ // 根据铸机号、缓存中的当前班次,倒序最新一条,获取交班记录中的创建时间
|
|
|
+ LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
|
|
|
+ .eq(BilletHotsendChangeShift::getShift, shift)
|
|
|
+ .eq(BilletHotsendChangeShift::getShiftGroup, shiftGroup)
|
|
|
+ .orderByDesc(BilletHotsendChangeShift::getCreateTime)
|
|
|
+ .last("limit 1");
|
|
|
+ billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
|
|
|
+ if (billetHotsendChangeShift == null){
|
|
|
+ log.info("{}{}", "查询当班定尺明细,明细记录为空!", ccmNo + "失败时间:" + new Date());
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ // 根据铸机号、交班记录ID,获取交班记录中的班别、班次、创建时间
|
|
|
+ LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletHotsendChangeShift::getId, changeShiftId).eq(BilletHotsendChangeShift::getCcmNo, ccmNo);
|
|
|
+ billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
|
|
|
+ if (billetHotsendChangeShift == null){
|
|
|
+ log.info("{}{}", "查询历史班次定尺明细,明细记录为空!", ccmNo + "失败时间:" + new Date());
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ shiftGroup = billetHotsendChangeShift.getShiftGroup();
|
|
|
+ shift = billetHotsendChangeShift.getShift();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 根据铸机号、班组、班别、交班的创建时间,查询棒一符合条件的信息
|
|
|
+ LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletBasicInfo::getCcmNo, ccmNo)
|
|
|
+ .eq(BilletBasicInfo::getShift, shift)
|
|
|
+ .eq(BilletBasicInfo::getShiftGroup, shiftGroup);
|
|
|
+ if (oConvertUtils.isEmpty(changeShiftId)) {
|
|
|
+ // 当 changeShiftId 为空时,时间范围从 createTime 到当前时间
|
|
|
+ queryWrapper.between(BilletBasicInfo::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
|
|
|
+ } else {
|
|
|
+ // 当 changeShiftId 不为空时,时间范围从 createTime 到 updateTime
|
|
|
+ queryWrapper.between(BilletBasicInfo::getCreateTime, billetHotsendChangeShift.getCreateTime(), billetHotsendChangeShift.getChangeShiftTime());
|
|
|
+ }
|
|
|
+ list = billetBasicInfoService.list(queryWrapper);
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// 计算整数总和的方法
|
|
|
private int calculateIntSum(List<DestinationStatisticsDetails> list) {
|