|
@@ -20,8 +20,15 @@ import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendC
|
|
|
import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
|
|
|
import org.jeecg.modules.billet.rollClubOne.entity.RollClubOneDetails;
|
|
|
import org.jeecg.modules.billet.rollClubOne.service.IRollClubOneDetailsService;
|
|
|
+import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
|
|
|
+import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeDetailsService;
|
|
|
+import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
|
|
|
+import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoDetailsService;
|
|
|
+import org.jeecg.modules.billet.rollHeight.entity.DestinationStatisticsDetails;
|
|
|
import org.jeecg.modules.billet.rollHeight.entity.RollHeightDetails;
|
|
|
import org.jeecg.modules.billet.rollHeight.service.IRollHeightDetailsService;
|
|
|
+import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
|
|
|
+import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.*;
|
|
|
import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
|
|
|
import org.jeecg.modules.billet.storageBill.vo.OnDutySizeVo;
|
|
@@ -65,6 +72,15 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
@Autowired
|
|
|
private IRollClubOneDetailsService rollClubOneDetailsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IRollClubTwoDetailsService rollClubTwoDetailsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IRollClubThreeDetailsService rollClubThreeDetailsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IRollOutShippDetailsService rollOutShippDetailsService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IRollHeightDetailsService rollHeightDetailsService;
|
|
|
|
|
@@ -518,18 +534,21 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
Page<StorageBill> page = new Page<>(pageNo, pageSize);
|
|
|
IPage<StorageBill> pageList = storageBillService.page(page, queryWrapper);
|
|
|
|
|
|
+ // 统计总数
|
|
|
+ int totalNumsAll = 0;
|
|
|
+
|
|
|
for (StorageBill bill : pageList.getRecords()) {
|
|
|
List<String> storageBillIds = Arrays.stream(bill.getId().split(",")).collect(Collectors.toList());
|
|
|
String totalBlankOutputStr = "";
|
|
|
// 根据装运单ID查询对应的明细,统计总的出坯量
|
|
|
- if ("棒二".equals(bill.getDestination()) && oConvertUtils.listIsNotEmpty(storageBillIds)) {
|
|
|
- LambdaQueryWrapper<RollClubOneDetails> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper1.eq(RollClubOneDetails::getHeatNo, bill.getHeatNo());
|
|
|
- queryWrapper1.in(RollClubOneDetails::getStorageBillId, storageBillIds);
|
|
|
- List<RollClubOneDetails> rollClubOneDetailsList = rollClubOneDetailsService.list(queryWrapper1);
|
|
|
+ if (bill.getDestination().contains("棒二") && oConvertUtils.listIsNotEmpty(storageBillIds)) {
|
|
|
+ LambdaQueryWrapper<RollClubTwoDetails> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollClubTwoDetails::getHeatNo, bill.getHeatNo());
|
|
|
+ queryWrapper1.in(RollClubTwoDetails::getStorageBillId, storageBillIds);
|
|
|
+ List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapper1);
|
|
|
// 使用 Stream API 统计 blankOutput 字段的总和
|
|
|
- OptionalDouble totalBlankOutputOptional = rollClubOneDetailsList != null ?
|
|
|
- OptionalDouble.of(rollClubOneDetailsList.stream()
|
|
|
+ OptionalDouble totalBlankOutputOptional = rollClubTwoDetailsList != null ?
|
|
|
+ OptionalDouble.of(rollClubTwoDetailsList.stream()
|
|
|
.mapToDouble(details -> details.getBlankOutput() != null ? details.getBlankOutput() : 0)
|
|
|
.sum()) : OptionalDouble.empty();
|
|
|
// 将总和转换为字符串,保留两位小时,四舍五入原则
|
|
@@ -543,14 +562,22 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
totalBlankOutputStr = "0";
|
|
|
}
|
|
|
|
|
|
- } else if ("棒三".equals(bill.getDestination()) && oConvertUtils.listIsNotEmpty(storageBillIds)) {
|
|
|
- LambdaQueryWrapper<RollHeightDetails> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper2.eq(RollHeightDetails::getHeatNo, bill.getHeatNo());
|
|
|
- queryWrapper2.in(RollHeightDetails::getStorageBillId, storageBillIds);
|
|
|
- List<RollHeightDetails> rollHeightDetailsList = rollHeightDetailsService.list(queryWrapper2);
|
|
|
+ int totalNums = rollClubTwoDetailsList.stream()
|
|
|
+ .mapToInt(detail -> (detail.getStackAddr() != null && !detail.getStackAddr().isEmpty()) ? 4 : 1)
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ totalNumsAll += totalNums;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ if (bill.getDestination().contains("棒三") && oConvertUtils.listIsNotEmpty(storageBillIds)) {
|
|
|
+ LambdaQueryWrapper<RollClubThreeDetails> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper2.eq(RollClubThreeDetails::getHeatNo, bill.getHeatNo());
|
|
|
+ queryWrapper2.in(RollClubThreeDetails::getStorageBillId, storageBillIds);
|
|
|
+ List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapper2);
|
|
|
// 使用 Stream API 统计 blankOutput 字段的总和
|
|
|
- OptionalDouble totalBlankOutputOptional = rollHeightDetailsList != null ?
|
|
|
- OptionalDouble.of(rollHeightDetailsList.stream()
|
|
|
+ OptionalDouble totalBlankOutputOptional = rollClubThreeDetailsList != null ?
|
|
|
+ OptionalDouble.of(rollClubThreeDetailsList.stream()
|
|
|
.mapToDouble(details -> details.getBlankOutput() != null ? details.getBlankOutput() : 0)
|
|
|
.sum()) : OptionalDouble.empty();
|
|
|
// 将总和转换为字符串,保留两位小时,四舍五入原则
|
|
@@ -563,14 +590,22 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
} else {
|
|
|
totalBlankOutputStr = "0";
|
|
|
}
|
|
|
- } else if ("上若".equals(bill.getDestination()) && oConvertUtils.listIsNotEmpty(storageBillIds)) {
|
|
|
- LambdaQueryWrapper<RollHeightDetails> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper2.eq(RollHeightDetails::getHeatNo, bill.getHeatNo());
|
|
|
- queryWrapper2.in(RollHeightDetails::getStorageBillId, storageBillIds);
|
|
|
- List<RollHeightDetails> rollHeightDetailsList = rollHeightDetailsService.list(queryWrapper2);
|
|
|
+
|
|
|
+ int totalNums = rollClubThreeDetailsList.stream()
|
|
|
+ .mapToInt(detail -> (detail.getStackAddr() != null && !detail.getStackAddr().isEmpty()) ? 4 : 1)
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ totalNumsAll += totalNums;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (bill.getDestination().contains("上若") && oConvertUtils.listIsNotEmpty(storageBillIds)) {
|
|
|
+ LambdaQueryWrapper<RollOutShippDetails> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper2.eq(RollOutShippDetails::getHeatNo, bill.getHeatNo());
|
|
|
+ queryWrapper2.in(RollOutShippDetails::getStorageBillId, storageBillIds);
|
|
|
+ List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapper2);
|
|
|
// 使用 Stream API 统计 blankOutput 字段的总和
|
|
|
- OptionalDouble totalBlankOutputOptional = rollHeightDetailsList != null ?
|
|
|
- OptionalDouble.of(rollHeightDetailsList.stream()
|
|
|
+ OptionalDouble totalBlankOutputOptional = rollOutShippDetailsList != null ?
|
|
|
+ OptionalDouble.of(rollOutShippDetailsList.stream()
|
|
|
.mapToDouble(details -> details.getBlankOutput() != null ? details.getBlankOutput() : 0)
|
|
|
.sum()) : OptionalDouble.empty();
|
|
|
// 将总和转换为字符串,保留两位小时,四舍五入原则
|
|
@@ -583,8 +618,16 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
} else {
|
|
|
totalBlankOutputStr = "0";
|
|
|
}
|
|
|
+
|
|
|
+ int totalNums = rollOutShippDetailsList.stream()
|
|
|
+ .mapToInt(detail -> (detail.getStackAddr() != null && !detail.getStackAddr().isEmpty()) ? 4 : 1)
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ totalNumsAll += totalNums;
|
|
|
+
|
|
|
}
|
|
|
bill.setRemarks(totalBlankOutputStr);
|
|
|
+ bill.setAmountTotal(totalNumsAll);
|
|
|
}
|
|
|
return Result.OK(pageList);
|
|
|
}
|