|
@@ -47,6 +47,10 @@ import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
|
|
|
import org.jeecg.modules.billet.rollClubTwo.mapper.RollClubTwoDetailsMapper;
|
|
|
import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoDetailsService;
|
|
|
import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoService;
|
|
|
+import org.jeecg.modules.billet.rollDeputyCross.entity.RollDeputyCross;
|
|
|
+import org.jeecg.modules.billet.rollDeputyCross.entity.RollDeputyCrossDetails;
|
|
|
+import org.jeecg.modules.billet.rollDeputyCross.service.IRollDeputyCrossDetailsService;
|
|
|
+import org.jeecg.modules.billet.rollDeputyCross.service.IRollDeputyCrossService;
|
|
|
import org.jeecg.modules.billet.rollHeight.entity.DestinationStatisticsDetails;
|
|
|
import org.jeecg.modules.billet.rollHeight.entity.RollHeightDetails;
|
|
|
import org.jeecg.modules.billet.rollHeight.mapper.RollHeightDetailsMapper;
|
|
@@ -177,6 +181,12 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
@Autowired
|
|
|
private BilletAutoTmpMapper billetAutoTmpMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IRollDeputyCrossService rollDeputyCrossService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IRollDeputyCrossDetailsService rollDeputyCrossDetailsService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void departHandle(BilletHotsendDetailsVo billetHotsendDetailsVo) {
|
|
@@ -269,29 +279,10 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
processRollHeightDetails(rollHeightDetails);
|
|
|
result.setRollHeightDetails(rollHeightDetails);
|
|
|
|
|
|
- // List<StackingDownLogDetails> stackingDownLogDetailsList = new ArrayList<>();
|
|
|
-// List<StackingDownLog> stackingDownLogList = stackingDownLogService.list(new LambdaQueryWrapper<StackingDownLog>().eq(StackingDownLog::getStorageBillId, storageBill.getId()));
|
|
|
-// if (oConvertUtils.listIsEmpty(stackingDownLogList)){
|
|
|
-// result.setStackingDownLogList(stackingDownLogList);
|
|
|
-// result.setStackingDownLogDetailsList(stackingDownLogDetailsList);
|
|
|
-// return result;
|
|
|
-// }
|
|
|
-// StackingDownLog stackingDownLog = stackingDownLogList.stream().findFirst().orElse(null);
|
|
|
-// List<String> stringList = Arrays.stream(stackingDownLog.getBilletNo().split(","))
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
-// queryWrapper.eq(BilletBasicInfo::getBilletNo, stringList.get(0));
|
|
|
-// BilletBasicInfo billetBasicInfo = billetBasicInfoService.list(queryWrapper).stream().findFirst().orElse(null);
|
|
|
-// stackingDownLogList.forEach(x ->{
|
|
|
-// StackingDownLogDetails stackingDownLogDetails = new StackingDownLogDetails();
|
|
|
-// BeanUtils.copyProperties(x, stackingDownLogDetails);
|
|
|
-// stackingDownLogDetails.setGrade(billetBasicInfo.getGrade());
|
|
|
-// stackingDownLogDetails.setSpec(billetBasicInfo.getSpec());
|
|
|
-// stackingDownLogDetails.setLength(billetBasicInfo.getLength());
|
|
|
-// stackingDownLogDetailsList.add(stackingDownLogDetails);
|
|
|
-// });
|
|
|
-// result.setStackingDownLogList(stackingDownLogList);
|
|
|
-// result.setStackingDownLogDetailsList(stackingDownLogDetailsList);
|
|
|
+// List<RollDeputyCrossDetails> rollDeputyCrossDetailsList = rollDeputyCrossDetailsService.list(new LambdaQueryWrapper<RollDeputyCrossDetails>().in(RollDeputyCrossDetails::getStorageBillId, idList));
|
|
|
+// processRollDeputyCrossDetails(rollDeputyCrossDetailsList);
|
|
|
+// result.setRollDeputyCrossDetailsList(rollDeputyCrossDetailsList);
|
|
|
+//
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -372,39 +363,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
// storageBill.setPositionNum(1);
|
|
|
// }
|
|
|
storageBill.setArrivalTime(new Date());// 到达时间
|
|
|
-// LambdaQueryWrapper<StorageBill> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
-// queryWrapper1.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
|
|
|
-// .eq(StorageBill::getLicensePlate, storageBill.getLicensePlate())
|
|
|
-// .eq(StorageBill::getShiftGroup, shiftGroup)
|
|
|
-// .eq(StorageBill::getShift, shift).between(StorageBill::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
-// long carNum = baseMapper.selectCount(queryWrapper1);
|
|
|
-// storageBill.setCarNum(Math.toIntExact(carNum) + 1);
|
|
|
-
|
|
|
-// LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
-// queryWrapper2.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
|
|
|
-// .eq(StorageBill::getShiftGroup, shiftGroup)
|
|
|
-// .eq(StorageBill::getShift, shift).between(StorageBill::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
-// long carAllNum = baseMapper.selectCount(queryWrapper2);
|
|
|
-// storageBill.setCarAllNum(Math.toIntExact(carAllNum) + 1);
|
|
|
-
|
|
|
- // 通过铸机号、班组、班别去查询交班记录并初始化 车次
|
|
|
-// LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
-// queryWrapper3.eq(BilletHotsendChangeShift::getCcmNo, storageBill.getCcmNo())
|
|
|
-// .eq(BilletHotsendChangeShift::getShiftGroup, shiftGroup)
|
|
|
-// .eq(BilletHotsendChangeShift::getShift, shift).between(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
-// BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper3);
|
|
|
-// if (oConvertUtils.isNotEmpty(billetHotsendChangeShift)){
|
|
|
-// // 通过铸机号、班组、班别查询 当班装运单总数
|
|
|
-// LambdaQueryWrapper<StorageBill> queryWrapper4 = new LambdaQueryWrapper<>();
|
|
|
-// queryWrapper4.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
|
|
|
-// .eq(StorageBill::getShiftGroup, shiftGroup)
|
|
|
-// .eq(StorageBill::getShift, shift)
|
|
|
-// .between(StorageBill::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
-// long amountTotal = baseMapper.selectCount(queryWrapper4);
|
|
|
-// billetHotsendChangeShift.setOutCarNum(Math.toIntExact(amountTotal));
|
|
|
-// billetHotsendChangeShift.setUpdateTime(new Date());
|
|
|
-// billetHotsendChangeShiftService.updateById(billetHotsendChangeShift);
|
|
|
-// }
|
|
|
// 更新交班记录 通过铸机号、班组、班别去查询交班记录并初始化 出车号
|
|
|
updateBilletHotsendChangeShift(storageBill.getCcmNo(), shiftGroup, shift);
|
|
|
|
|
@@ -1008,9 +966,8 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
}
|
|
|
|
|
|
|
|
|
- // 合并三个列表并根据 size 分组统计
|
|
|
- List<DestinationStatisticsDetails> mergedList = Stream.of(statisticsDetailsList1, statisticsDetailsList2, statisticsDetailsList3)
|
|
|
- .flatMap(Collection::stream) // 将所有列表合并成一个流
|
|
|
+ // 合并两个列表并根据 size 分组统计
|
|
|
+ List<DestinationStatisticsDetails> mergedList = Stream.concat(statisticsDetailsList1.stream(), statisticsDetailsList2.stream())
|
|
|
.collect(Collectors.groupingBy(DestinationStatisticsDetails::getSize))
|
|
|
.entrySet().stream()
|
|
|
.map(entry -> {
|
|
@@ -1181,25 +1138,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
- // 合并两个列表并根据 size 分组统计
|
|
|
-/* List<DestinationStatisticsDetails> mergedList = Stream.concat(statisticsDetailsList1.stream(), statisticsDetailsList2.stream())
|
|
|
- .collect(Collectors.groupingBy(DestinationStatisticsDetails::getSize))
|
|
|
- .entrySet().stream()
|
|
|
- .map(entry -> {
|
|
|
- String size = entry.getKey();
|
|
|
- List<DestinationStatisticsDetails> group = entry.getValue();
|
|
|
- int totalNums = group.stream().mapToInt(DestinationStatisticsDetails::getNums).sum();
|
|
|
- double totalBlankOutput = group.stream().mapToDouble(DestinationStatisticsDetails::getBlankOutput).sum();
|
|
|
- BigDecimal bd = BigDecimal.valueOf(totalBlankOutput).setScale(4, BigDecimal.ROUND_HALF_UP);
|
|
|
- double finalBlankOutput = bd.doubleValue();
|
|
|
- String ccmNoForGroup = group.isEmpty() ? null : group.get(0).getCcmNo();
|
|
|
- return new DestinationStatisticsDetails(size, totalNums, finalBlankOutput, ccmNoForGroup);
|
|
|
- }).collect(Collectors.toList());
|
|
|
- log.info("{}{}", "合并后的列表:", JSON.toJSON(mergedList));
|
|
|
- onDutyStatisticsReport.setStatisticsDetailsList(mergedList);*/
|
|
|
-
|
|
|
result.put("data", jsonArray);
|
|
|
|
|
|
return result;
|
|
@@ -1246,6 +1184,12 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
}else {
|
|
|
billetHotsend.setRolloutshippNum(check.getRolloutshippNum() + rollClubCommonList.size());
|
|
|
}
|
|
|
+ }else if ("roll_deputy_cross".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ if (oConvertUtils.isEmpty(check.getRollDeputyCrossNum())){
|
|
|
+ billetHotsend.setRollDeputyCrossNum(rollClubCommonList.size());
|
|
|
+ }else {
|
|
|
+ billetHotsend.setRollDeputyCrossNum(check.getRollDeputyCrossNum() + rollClubCommonList.size());
|
|
|
+ }
|
|
|
}
|
|
|
billetHotsend.setUpdateTime(new Date());
|
|
|
LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
|
|
@@ -1400,6 +1344,56 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
});
|
|
|
rollOutShippDetailsService.saveBatch(rollOutShippDetailsList);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存付跨信息
|
|
|
+ */
|
|
|
+ if ("roll_deputy_cross".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ RollDeputyCross rollDeputyCross = new RollDeputyCross();
|
|
|
+ BeanUtils.copyProperties(billetHotsend, rollDeputyCross);
|
|
|
+
|
|
|
+ rollDeputyCross.setSize(String.valueOf(rollClubCommonList.stream().findFirst().orElse(null).getLength())); //定尺
|
|
|
+ rollDeputyCross.setSteel(String.valueOf(rollClubCommonList.stream().findFirst().orElse(null).getGrade())); //钢种
|
|
|
+ rollDeputyCross.setSpec(String.valueOf(rollClubCommonList.stream().findFirst().orElse(null).getSpec())); //规格
|
|
|
+ rollDeputyCross.setBlankOutput(rollClubCommonList.stream().mapToDouble(RollClubCommon::getBilletWeight).sum());//出坯量总和
|
|
|
+ rollDeputyCross.setStorageBillId(storageBill.getId());
|
|
|
+ LambdaQueryWrapper<RollDeputyCross> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollDeputyCross::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollDeputyCross::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollDeputyCross::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollDeputyCross::getShiftGroup, billetHotsend.getShiftGroup())
|
|
|
+ .eq(RollDeputyCross::getStorageBillId, storageBill.getId());
|
|
|
+ RollDeputyCross rollDeputyCross1 = rollDeputyCrossService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollDeputyCross1)){
|
|
|
+ rollDeputyCross.setCreateDate(new Date());
|
|
|
+ rollDeputyCross.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollDeputyCrossService.save(rollDeputyCross);
|
|
|
+ }else {
|
|
|
+ rollDeputyCross.setId(rollDeputyCross1.getId());
|
|
|
+ rollDeputyCross.setAmountTotal(rollDeputyCross1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollDeputyCross.setBlankOutput(rollDeputyCross1.getBlankOutput() + rollDeputyCross.getBlankOutput());//出坯量
|
|
|
+ rollDeputyCross.setUpdateTime(new Date());
|
|
|
+ rollDeputyCrossService.updateById(rollDeputyCross);
|
|
|
+ }
|
|
|
+ // 保存付跨明细信息
|
|
|
+ List<RollDeputyCrossDetails> rollDeputyCrossDetailsList = new ArrayList<>();
|
|
|
+ rollClubCommonList.forEach(x ->{
|
|
|
+ RollDeputyCrossDetails rollDeputyCrossDetails = new RollDeputyCrossDetails();
|
|
|
+ BeanUtils.copyProperties(x, rollDeputyCrossDetails);
|
|
|
+ rollDeputyCrossDetails.setId(String.valueOf(IdWorker.getId()));
|
|
|
+ rollDeputyCrossDetails.setShift(x.getShift());
|
|
|
+ rollDeputyCrossDetails.setShiftGroup(x.getShiftGroup());
|
|
|
+ rollDeputyCrossDetails.setStorageBillId(storageBill.getId());
|
|
|
+ rollDeputyCrossDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ rollDeputyCrossDetails.setSize(String.valueOf(x.getLength()));
|
|
|
+ rollDeputyCrossDetails.setSteel(x.getGrade());
|
|
|
+ rollDeputyCrossDetails.setCreateTime(new Date(System.currentTimeMillis() + timeOffset.get()));
|
|
|
+ rollDeputyCrossDetails.setBlankOutput(x.getBilletWeight());//出坯量
|
|
|
+ rollDeputyCrossDetailsList.add(rollDeputyCrossDetails);
|
|
|
+ timeOffset.addAndGet(1000); // 这里假设每次增加1秒(1000毫秒)的时间偏移量
|
|
|
+ });
|
|
|
+ rollDeputyCrossDetailsService.saveBatch(rollDeputyCrossDetailsList);
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -1865,7 +1859,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
|
|
|
// 合并三个列表并根据 size 分组统计
|
|
|
List<DestinationStatisticsDetails> mergedList = Stream.concat(
|
|
|
- Stream.concat(statisticsDetailsList1.stream(), statisticsDetailsList2.stream()),
|
|
|
+ Stream.concat(statisticsDetailsList1.stream(), statisticsDetailsList2.stream()),
|
|
|
statisticsDetailsList3.stream()
|
|
|
).collect(Collectors.groupingBy(DestinationStatisticsDetails::getSize))
|
|
|
.entrySet().stream()
|
|
@@ -2452,7 +2446,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
|
|
|
summaryList.addAll(result5);
|
|
|
|
|
|
-
|
|
|
// 对 summaryList 进行二次分组,聚合数据
|
|
|
List<OnDutySizeVo> onDutySizeVoList = summaryList.stream()
|
|
|
.collect(Collectors.groupingBy(SizeSummary::getSize))
|
|
@@ -2865,6 +2858,8 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
x.setBelongTable("roll_club_three");
|
|
|
}else if ("roll_out_shipp".equals(billetHotsendTypeConfig.getBelongTable())){
|
|
|
x.setBelongTable("roll_out_shipp");
|
|
|
+ }else if ("roll_deputy_cross".equals(billetHotsendTypeConfig.getBelongTable())){
|
|
|
+ x.setBelongTable("roll_deputy_cross");
|
|
|
}
|
|
|
x.setBhtcId(billetHotsendTypeConfig.getId());
|
|
|
x.setUpdateTime(new Date());
|
|
@@ -2933,6 +2928,8 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
billetHotsend.setRollclubthreeNum(oConvertUtils.isNotEmpty(idExistBh.getRollclubthreeNum()) ? idExistBh.getRollclubthreeNum() + groupRollClubCommonList.size() * 4 : groupRollClubCommonList.size() * 4 );
|
|
|
}else if ("roll_out_shipp".equals(billetHotsendTypeConfig.getBelongTable())){
|
|
|
billetHotsend.setRolloutshippNum(oConvertUtils.isNotEmpty(idExistBh.getRolloutshippNum()) ? idExistBh.getRolloutshippNum() + groupRollClubCommonList.size() * 4 : groupRollClubCommonList.size() * 4 );
|
|
|
+ }else if ("roll_deputy_cross".equals(billetHotsendTypeConfig.getBelongTable())){
|
|
|
+ billetHotsend.setRollDeputyCrossNum(oConvertUtils.isNotEmpty(idExistBh.getRollDeputyCrossNum()) ? idExistBh.getRollDeputyCrossNum() + groupRollClubCommonList.size() * 4 : groupRollClubCommonList.size() * 4 );
|
|
|
}
|
|
|
billetHotsendBaseMapper.updateById(billetHotsend);
|
|
|
}
|
|
@@ -3989,458 +3986,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
return storageCenterHeatNoVO;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public Page<StorageCenterInvoicingVO> storageCenterInvoicingInfo(StorageCenterQueryDTO queryDTO) {
|
|
|
- int pageNo = Optional.ofNullable(queryDTO.getPageNo()).orElse(1);
|
|
|
- int pageSize = Optional.ofNullable(queryDTO.getPageSize()).orElse(10);
|
|
|
-
|
|
|
- // 分页查询 HeatsActuals
|
|
|
- Page<HeatsActuals> heatsPage = new Page<>(pageNo, pageSize);
|
|
|
- LambdaQueryWrapper<HeatsActuals> billQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getCasterCode, queryDTO.getCcmNo());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getHeatsCode())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getHeatsCode, queryDTO.getHeatsCode());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getShift())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getShift, queryDTO.getShift());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getShiftGroup, queryDTO.getShiftGroup());
|
|
|
- }
|
|
|
- Date beginDate = queryDTO.getStorageTimeBegin();
|
|
|
- Date endDate = queryDTO.getStorageTimeEnd();
|
|
|
- if (beginDate != null) {
|
|
|
- billQueryWrapper.ge(HeatsActuals::getUpdateTime, beginDate);
|
|
|
- }
|
|
|
- if (endDate != null) {
|
|
|
- billQueryWrapper.le(HeatsActuals::getUpdateTime, endDate);
|
|
|
- }
|
|
|
- billQueryWrapper.orderByDesc(HeatsActuals::getUpdateTime);
|
|
|
-
|
|
|
- Page<HeatsActuals> pageResult = heatsActualsService.page(heatsPage, billQueryWrapper);
|
|
|
- List<HeatsActuals> heatsActuals = pageResult.getRecords();
|
|
|
- if (heatsActuals.isEmpty()) {
|
|
|
- return new Page<>(pageNo, pageSize, 0);
|
|
|
- }
|
|
|
-
|
|
|
- // 提取 heatNo 集合
|
|
|
- List<String> heatNoList = heatsActuals.stream()
|
|
|
- .map(HeatsActuals::getHeatsCode)
|
|
|
- .filter(Objects::nonNull)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- // 查询 BilletBasicInfo 数据
|
|
|
- LambdaQueryWrapper<BilletBasicInfo> basicInfoQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- basicInfoQueryWrapper.in(BilletBasicInfo::getHeatNo, heatNoList);
|
|
|
- List<BilletBasicInfo> billetList = billetBasicInfoService.list(basicInfoQueryWrapper);
|
|
|
-
|
|
|
- // heatNo 分组统计
|
|
|
- Map<String, List<BilletBasicInfo>> groupedByHeatNo = billetList.stream()
|
|
|
- .filter(b -> b.getHeatNo() != null)
|
|
|
- .collect(Collectors.groupingBy(BilletBasicInfo::getHeatNo));
|
|
|
-
|
|
|
- List<StorageCenterInvoicingVO> resultList = heatsActuals.stream()
|
|
|
- .map(heat -> {
|
|
|
- String heatNo = heat.getHeatsCode();
|
|
|
- String shift = heat.getShift();
|
|
|
- String shiftGroup = heat.getShiftGroup();
|
|
|
- Date createTime = heat.getCreateTime();
|
|
|
- Date updateTime = heat.getUpdateTime();
|
|
|
- List<BilletBasicInfo> billets = groupedByHeatNo.getOrDefault(heatNo, Collections.emptyList());
|
|
|
-
|
|
|
- Integer ccmNo = Optional.ofNullable(heat.getCasterCode()).map(Integer::valueOf).orElse(0);
|
|
|
-
|
|
|
- StorageCenterInvoicingVO.HeatNoDetail heatNoDetail = new StorageCenterInvoicingVO.HeatNoDetail();
|
|
|
-
|
|
|
- StorageCenterHeatNoInvoicingVO storageCenterHeatNoInvoicingVO = iCarUnitService.storageCenterInvoicingByHeatNo(heatNo,queryDTO);
|
|
|
-
|
|
|
- BigDecimal sumWeight = BigDecimal.ZERO;
|
|
|
- int sumAmount = 0;
|
|
|
-
|
|
|
- Date storageTimeBegin = queryDTO.getStorageTimeBegin();
|
|
|
- Date storageTimeEnd = queryDTO.getStorageTimeEnd();
|
|
|
-
|
|
|
- if (storageCenterHeatNoInvoicingVO != null) {
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubOneDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubOneDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubOneDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubTwoDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubTwoDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubTwoDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubThreeDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubThreeDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubThreeDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollHeightDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollHeightDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollHeightDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollOutShippDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollOutShippDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollOutShippDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
-
|
|
|
- Predicate<StorageCenterHeatNoInvoicingVO.RollChargeDetail> timeFilter = detail -> {
|
|
|
- Date createTime1 = detail.getCreateTime();
|
|
|
- if (createTime1 == null) {
|
|
|
- return false; // 没有 createTime 的记录直接过滤掉
|
|
|
- }
|
|
|
-
|
|
|
- if (storageTimeBegin != null && storageTimeEnd != null) {
|
|
|
- return !createTime1.before(storageTimeBegin) && !createTime1.after(storageTimeEnd);
|
|
|
- } else if (storageTimeBegin != null) {
|
|
|
- return !createTime1.before(storageTimeBegin);
|
|
|
- } else if (storageTimeEnd != null) {
|
|
|
- return !createTime1.after(storageTimeEnd);
|
|
|
- } else {
|
|
|
- return true; // 时间条件都为空,则不过滤
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
-// Predicate<StorageCenterHeatNoInvoicingVO.RollSendDetail> timeFilterOther = detail -> {
|
|
|
-// Date updateTime1 = detail.getUpdateTime();
|
|
|
-// if (updateTime1 == null) {
|
|
|
-// return false; // 没有 updateTime 的记录直接过滤掉
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (storageTimeBegin != null && storageTimeEnd != null) {
|
|
|
-// return !updateTime1.before(storageTimeBegin) && !updateTime1.after(storageTimeEnd);
|
|
|
-// } else if (storageTimeBegin != null) {
|
|
|
-// return !updateTime1.before(storageTimeBegin);
|
|
|
-// } else if (storageTimeEnd != null) {
|
|
|
-// return !updateTime1.after(storageTimeEnd);
|
|
|
-// } else {
|
|
|
-// return true; // 时间条件都为空,则不过滤
|
|
|
-// }
|
|
|
-// };
|
|
|
-
|
|
|
- // 过滤棒一
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubOneDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollSendDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollClubOneDetails()
|
|
|
- .getRollSendDetails()
|
|
|
- .stream()
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollClubOneDetails().setRollSendDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // 过滤高线
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollHeightDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollSendDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollHeightDetails()
|
|
|
- .getRollSendDetails()
|
|
|
- .stream()
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollHeightDetails().setRollSendDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
- // 过滤棒二
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubTwoDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollChargeDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollClubTwoDetails()
|
|
|
- .getRollChargeDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilter)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollClubTwoDetails().setRollChargeDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
- // 过滤棒三
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubThreeDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollChargeDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollClubThreeDetails()
|
|
|
- .getRollChargeDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilter)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollClubThreeDetails().setRollChargeDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
- // 过滤上若
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollOutShippDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollChargeDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollOutShippDetails()
|
|
|
- .getRollChargeDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilter)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollOutShippDetails().setRollChargeDetails(filtered);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 设置热号基础信息
|
|
|
- heatNoDetail.setHeatNo(heatNo);
|
|
|
- heatNoDetail.setCcmNo(ccmNo);
|
|
|
- heatNoDetail.setHeatNoWeight(sumWeight);
|
|
|
- heatNoDetail.setHeatNoAmount(sumAmount);
|
|
|
- //根据修改时间过滤展示
|
|
|
- heatNoDetail.setCreateTime(updateTime);
|
|
|
- heatNoDetail.setShift(shift);
|
|
|
- heatNoDetail.setShiftGroup(shiftGroup);
|
|
|
-
|
|
|
- StorageCenterInvoicingVO vo = new StorageCenterInvoicingVO();
|
|
|
- vo.setHeatNoDetails(Collections.singletonList(heatNoDetail));
|
|
|
- vo.setStorageCenterHeatNoInvoicing(storageCenterHeatNoInvoicingVO);
|
|
|
- return vo;
|
|
|
- })
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- Page<StorageCenterInvoicingVO> resultPage = new Page<>(pageNo, pageSize, pageResult.getTotal());
|
|
|
- resultPage.setRecords(resultList);
|
|
|
-
|
|
|
- return resultPage;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<StorageCenterInvoicingVO> storageCenterInvoicingInfoList(StorageCenterQueryDTO queryDTO) {
|
|
|
-
|
|
|
- BilletHotsendChangeShift billetHotsendChangeShift;
|
|
|
-
|
|
|
- LambdaQueryWrapper<HeatsActuals> billQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getCasterCode, queryDTO.getCcmNo());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getHeatsCode())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getHeatsCode, queryDTO.getHeatsCode());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getShift())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getShift, queryDTO.getShift());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
|
|
|
- billQueryWrapper.eq(HeatsActuals::getShiftGroup, queryDTO.getShiftGroup());
|
|
|
- }
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(queryDTO.getCcmNo()) && StringUtils.isNotBlank(queryDTO.getChangeShiftId())) {
|
|
|
-
|
|
|
- LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if ("0".equals(queryDTO.getChangeShiftId())) {
|
|
|
- queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo())
|
|
|
- .orderByDesc(BilletHotsendChangeShift::getCreateTime)
|
|
|
- .last("limit 1");
|
|
|
- } else {
|
|
|
- queryWrapper.eq(BilletHotsendChangeShift::getId, queryDTO.getChangeShiftId())
|
|
|
- .eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
|
|
|
- }
|
|
|
- billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
|
|
|
-
|
|
|
- if (oConvertUtils.isNotEmpty(billetHotsendChangeShift)){
|
|
|
- String changeShiftGroup = billetHotsendChangeShift.getShiftGroup();
|
|
|
- String changeShiftShift = billetHotsendChangeShift.getShift();
|
|
|
- Date createTime = billetHotsendChangeShift.getCreateTime();
|
|
|
- Date changeShiftTime = billetHotsendChangeShift.getChangeShiftTime();
|
|
|
- billQueryWrapper.eq(HeatsActuals::getShift, changeShiftShift);
|
|
|
- billQueryWrapper.eq(HeatsActuals::getShiftGroup, changeShiftGroup);
|
|
|
- // 添加时间范围限制
|
|
|
- if (createTime != null && changeShiftTime != null) {
|
|
|
- billQueryWrapper.between(HeatsActuals::getUpdateTime, createTime, changeShiftTime);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- Date beginDate = queryDTO.getStorageTimeBegin();
|
|
|
- Date endDate = queryDTO.getStorageTimeEnd();
|
|
|
- if (beginDate != null) {
|
|
|
- Date adjustedBeginDate = DateUtils.addDays(beginDate, -3);
|
|
|
- billQueryWrapper.ge(HeatsActuals::getUpdateTime, adjustedBeginDate);
|
|
|
- }
|
|
|
- if (endDate != null) {
|
|
|
- billQueryWrapper.le(HeatsActuals::getUpdateTime, endDate);
|
|
|
- }
|
|
|
- billQueryWrapper.orderByDesc(HeatsActuals::getCreateTime);
|
|
|
-
|
|
|
-
|
|
|
- List<HeatsActuals> heatsActualsList = heatsActualsService.list(billQueryWrapper);
|
|
|
-
|
|
|
- if (heatsActualsList.isEmpty()) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- // 提取 heatNo 集合
|
|
|
- List<String> heatNoList = heatsActualsList.stream()
|
|
|
- .map(HeatsActuals::getHeatsCode)
|
|
|
- .filter(Objects::nonNull)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- // 查询 BilletBasicInfo 数据
|
|
|
- LambdaQueryWrapper<BilletBasicInfo> basicInfoQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- basicInfoQueryWrapper.in(BilletBasicInfo::getHeatNo, heatNoList);
|
|
|
- List<BilletBasicInfo> billetList = billetBasicInfoService.list(basicInfoQueryWrapper);
|
|
|
-
|
|
|
- // heatNo 分组统计
|
|
|
- Map<String, List<BilletBasicInfo>> groupedByHeatNo = billetList.stream()
|
|
|
- .filter(b -> b.getHeatNo() != null)
|
|
|
- .collect(Collectors.groupingBy(BilletBasicInfo::getHeatNo));
|
|
|
-
|
|
|
- List<StorageCenterInvoicingVO> resultList = heatsActualsList.stream()
|
|
|
- .map(heat -> {
|
|
|
- String heatNo = heat.getHeatsCode();
|
|
|
- String shift = heat.getShift();
|
|
|
- String shiftGroup = heat.getShiftGroup();
|
|
|
- Date createTime = heat.getCreateTime();
|
|
|
- Date updateTime = heat.getUpdateTime();
|
|
|
- List<BilletBasicInfo> billets = groupedByHeatNo.getOrDefault(heatNo, Collections.emptyList());
|
|
|
-
|
|
|
- Integer ccmNo = Optional.ofNullable(heat.getCasterCode()).map(Integer::valueOf).orElse(0);
|
|
|
-
|
|
|
- StorageCenterInvoicingVO.HeatNoDetail heatNoDetail = new StorageCenterInvoicingVO.HeatNoDetail();
|
|
|
-
|
|
|
- StorageCenterQueryDTO storageCenterQueryDTO = new StorageCenterQueryDTO();
|
|
|
- storageCenterQueryDTO.setHeatsCode(heatNo);
|
|
|
- if (queryDTO.getStorageTimeBegin() != null) {
|
|
|
- storageCenterQueryDTO.setStorageTimeBegin(queryDTO.getStorageTimeBegin());
|
|
|
- }
|
|
|
- if (queryDTO.getStorageTimeEnd() != null) {
|
|
|
- storageCenterQueryDTO.setStorageTimeEnd(queryDTO.getStorageTimeEnd());
|
|
|
- }
|
|
|
-
|
|
|
- StorageCenterHeatNoInvoicingVO storageCenterHeatNoInvoicingVO = iCarUnitService.storageCenterInvoicingByQueryDTO(storageCenterQueryDTO);
|
|
|
-
|
|
|
- BigDecimal sumWeight = BigDecimal.ZERO;
|
|
|
- int sumAmount = 0;
|
|
|
-
|
|
|
- Date storageTimeBegin = queryDTO.getStorageTimeBegin();
|
|
|
- Date storageTimeEnd = queryDTO.getStorageTimeEnd();
|
|
|
-
|
|
|
- if (storageCenterHeatNoInvoicingVO != null) {
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubOneDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubOneDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubOneDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubTwoDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubTwoDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubTwoDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubThreeDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubThreeDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubThreeDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollHeightDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollHeightDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollHeightDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollOutShippDetails() != null) {
|
|
|
- sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollOutShippDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
|
- sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollOutShippDetails().getTotalAmount()).orElse(0);
|
|
|
- }
|
|
|
-
|
|
|
- Predicate<StorageCenterHeatNoInvoicingVO.RollChargeDetail> timeFilter = detail -> {
|
|
|
- Date createTime1 = detail.getCreateTime();
|
|
|
- if (createTime1 == null) {
|
|
|
- return false; // 没有 createTime 的记录直接过滤掉
|
|
|
- }
|
|
|
-
|
|
|
- if (storageTimeBegin != null && storageTimeEnd != null) {
|
|
|
- return !createTime1.before(storageTimeBegin) && !createTime1.after(storageTimeEnd);
|
|
|
- } else if (storageTimeBegin != null) {
|
|
|
- return !createTime1.before(storageTimeBegin);
|
|
|
- } else if (storageTimeEnd != null) {
|
|
|
- return !createTime1.after(storageTimeEnd);
|
|
|
- } else {
|
|
|
- return true; // 时间条件都为空,则不过滤
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- Predicate<StorageCenterHeatNoInvoicingVO.RollSendDetail> timeFilterOther = detail -> {
|
|
|
- Date updateTime1 = detail.getUpdateTime();
|
|
|
- if (updateTime1 == null) {
|
|
|
- return false; // 没有 updateTime 的记录直接过滤掉
|
|
|
- }
|
|
|
-
|
|
|
- if (storageTimeBegin != null && storageTimeEnd != null) {
|
|
|
- return !updateTime1.before(storageTimeBegin) && !updateTime1.after(storageTimeEnd);
|
|
|
- } else if (storageTimeBegin != null) {
|
|
|
- return !updateTime1.before(storageTimeBegin);
|
|
|
- } else if (storageTimeEnd != null) {
|
|
|
- return !updateTime1.after(storageTimeEnd);
|
|
|
- } else {
|
|
|
- return true; // 时间条件都为空,则不过滤
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- // 过滤棒一
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubOneDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollSendDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollClubOneDetails()
|
|
|
- .getRollSendDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilterOther)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollClubOneDetails().setRollSendDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // 过滤高线
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollHeightDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollSendDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollHeightDetails()
|
|
|
- .getRollSendDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilterOther)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollHeightDetails().setRollSendDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
- // 过滤棒二
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubTwoDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollChargeDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollClubTwoDetails()
|
|
|
- .getRollChargeDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilter)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollClubTwoDetails().setRollChargeDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
- // 过滤棒三
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollClubThreeDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollChargeDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollClubThreeDetails()
|
|
|
- .getRollChargeDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilter)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollClubThreeDetails().setRollChargeDetails(filtered);
|
|
|
- }
|
|
|
-
|
|
|
- // 过滤上若
|
|
|
- if (storageCenterHeatNoInvoicingVO.getRollOutShippDetails() != null) {
|
|
|
- List<StorageCenterHeatNoInvoicingVO.RollChargeDetail> filtered = storageCenterHeatNoInvoicingVO
|
|
|
- .getRollOutShippDetails()
|
|
|
- .getRollChargeDetails()
|
|
|
- .stream()
|
|
|
- .filter(timeFilter)
|
|
|
- .collect(Collectors.toList());
|
|
|
- storageCenterHeatNoInvoicingVO.getRollOutShippDetails().setRollChargeDetails(filtered);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 设置热号基础信息
|
|
|
- heatNoDetail.setHeatNo(heatNo);
|
|
|
- heatNoDetail.setCcmNo(ccmNo);
|
|
|
- heatNoDetail.setHeatNoWeight(sumWeight);
|
|
|
- heatNoDetail.setHeatNoAmount(sumAmount);
|
|
|
- heatNoDetail.setCreateTime(createTime);
|
|
|
- heatNoDetail.setUpdateTime(updateTime);
|
|
|
- heatNoDetail.setShift(shift);
|
|
|
- heatNoDetail.setShiftGroup(shiftGroup);
|
|
|
- heatNoDetail.setCreateTime(createTime);
|
|
|
-
|
|
|
- StorageCenterInvoicingVO vo = new StorageCenterInvoicingVO();
|
|
|
- vo.setHeatNoDetails(Collections.singletonList(heatNoDetail));
|
|
|
- vo.setStorageCenterHeatNoInvoicing(storageCenterHeatNoInvoicingVO);
|
|
|
- return vo;
|
|
|
- })
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- return resultList;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
public StorageCenterHeatNoDetailVO storageCenterByHeatNo(String heatNo) {
|
|
@@ -5220,10 +4765,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
StorageCenterHeatNoInvoicingVO.RollThreeHeatNo rollThreeHeatNo = new StorageCenterHeatNoInvoicingVO.RollThreeHeatNo();
|
|
|
StorageCenterHeatNoInvoicingVO.RollHeightHeatNo rollHeightHeatNo = new StorageCenterHeatNoInvoicingVO.RollHeightHeatNo();
|
|
|
StorageCenterHeatNoInvoicingVO.RollOutHeatNo rollOutHeatNo = new StorageCenterHeatNoInvoicingVO.RollOutHeatNo();
|
|
|
-// StorageCenterHeatNoInvoicingVO.StackHeatNo stackHeatNo = new StorageCenterHeatNoDetailVO.StackHeatNo();
|
|
|
-// StorageCenterHeatNoInvoicingVO.UnknownHeatNo unknownHeatNo = new StorageCenterHeatNoDetailVO.UnknownHeatNo();
|
|
|
-
|
|
|
-
|
|
|
// 查询 BilletBasicInfo 数据
|
|
|
LambdaQueryWrapper<BilletBasicInfo> basicInfoQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
basicInfoQueryWrapper.eq(BilletBasicInfo::getHeatNo, heatNo);
|
|
@@ -5232,15 +4773,11 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
if (oConvertUtils.listIsEmpty(list)) {
|
|
|
return storageCenterHeatNoInvoicingVO;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
// 按照 belongTable 分组
|
|
|
Map<String, List<BilletBasicInfo>> groupedByBelongTable = list.stream()
|
|
|
.collect(Collectors.groupingBy(
|
|
|
b -> Optional.ofNullable(b.getBelongTable()).orElse("unknown") // 处理 null 值
|
|
|
));
|
|
|
-
|
|
|
-
|
|
|
if (groupedByBelongTable.containsKey("roll_club_one")) {
|
|
|
|
|
|
List<BilletBasicInfo> billetBasicInfos = groupedByBelongTable.get("roll_club_one");
|
|
@@ -5307,7 +4844,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
rollSendDetailList.add(rollSendDetail);
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
// 最终赋值给 rollOneHeatNo
|
|
|
rollOneHeatNo.setSizeDetails(sizeDetailsList);
|
|
|
rollOneHeatNo.setRollSendDetails(rollSendDetailList);
|
|
@@ -5385,68 +4921,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
rollHeightHeatNo.setRollSendDetails(rollSendDetailList);
|
|
|
storageCenterHeatNoInvoicingVO.setRollHeightDetails(rollHeightHeatNo);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-// if (groupedByBelongTable.containsKey("unknown")) {
|
|
|
-//
|
|
|
-// List<BilletBasicInfo> billetBasicInfos = groupedByBelongTable.get("unknown");
|
|
|
-//
|
|
|
-// // 计算总重量 & 总条数
|
|
|
-// BigDecimal totalBlankOutput = billetBasicInfos.stream()
|
|
|
-// .map(BilletBasicInfo::getBilletWeight)
|
|
|
-// .filter(Objects::nonNull)
|
|
|
-// .map(BigDecimal::valueOf)
|
|
|
-// .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
-//
|
|
|
-// unknownHeatNo.setTotalAmount(billetBasicInfos.size());
|
|
|
-// unknownHeatNo.setTotalWeight(totalBlankOutput);
|
|
|
-//
|
|
|
-// // 按照 getLength 分组
|
|
|
-// Map<Integer, List<BilletBasicInfo>> groupedByLength = billetBasicInfos.stream()
|
|
|
-// .filter(b -> b.getLength() != null) // 先过滤掉 null,防止 NPE
|
|
|
-// .collect(Collectors.groupingBy(BilletBasicInfo::getLength));
|
|
|
-//
|
|
|
-// // 一次遍历,构造 sizeDetailsList 和 rollSendDetailList
|
|
|
-// List<StorageCenterHeatNoDetailVO.SizeDetail> sizeDetailsList = new ArrayList<>();
|
|
|
-// List<StorageCenterHeatNoDetailVO.RollSendDetail> rollSendDetailList = new ArrayList<>();
|
|
|
-//
|
|
|
-// groupedByLength.forEach((length, billets) -> {
|
|
|
-// // 计算 weight 总和
|
|
|
-// BigDecimal totalWeight = billets.stream()
|
|
|
-// .map(BilletBasicInfo::getBilletWeight)
|
|
|
-// .filter(Objects::nonNull)
|
|
|
-// .map(BigDecimal::valueOf)
|
|
|
-// .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
-//
|
|
|
-// int count = billets.size(); // 计算数据条数
|
|
|
-// // 取第一个 spec 值
|
|
|
-// String spec = Optional.ofNullable(billets.get(0).getSpec()).orElse("Unknown");
|
|
|
-//
|
|
|
-// // 创建 SizeDetail
|
|
|
-// StorageCenterHeatNoDetailVO.SizeDetail sizeDetail = new StorageCenterHeatNoDetailVO.SizeDetail();
|
|
|
-// sizeDetail.setSize(length);
|
|
|
-// sizeDetail.setSizeWeight(totalWeight);
|
|
|
-// sizeDetail.setSizeAmount(count);
|
|
|
-// sizeDetailsList.add(sizeDetail);
|
|
|
-//
|
|
|
-// // 创建 RollSendDetail
|
|
|
-// StorageCenterHeatNoDetailVO.RollSendDetail rollSendDetail = new StorageCenterHeatNoDetailVO.RollSendDetail();
|
|
|
-// rollSendDetail.setSize(length);
|
|
|
-// rollSendDetail.setWeight(totalWeight);
|
|
|
-// rollSendDetail.setAmount(count);
|
|
|
-// rollSendDetail.setSpec(spec);
|
|
|
-// rollSendDetailList.add(rollSendDetail);
|
|
|
-// });
|
|
|
-//
|
|
|
-// // 赋值给 unknownHeatNo
|
|
|
-// unknownHeatNo.setSizeDetails(sizeDetailsList);
|
|
|
-// unknownHeatNo.setRollSendDetails(rollSendDetailList);
|
|
|
-//
|
|
|
-// storageCenterHeatNoDetailVO.setUnknownDetails(unknownHeatNo);
|
|
|
-//
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
if (groupedByBelongTable.containsKey("roll_club_two")) {
|
|
|
|
|
|
List<BilletBasicInfo> billetBasicInfos = groupedByBelongTable.get("roll_club_two");
|
|
@@ -6724,34 +6198,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
return rollClubCommonList.stream().collect(Collectors.groupingBy(rollClubCommon -> rollClubCommon.getHeatNo() + "," + rollClubCommon.getShiftGroup() + "," + rollClubCommon.getShift()));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据铸机号、班次、班别查询当天交班记录,并根据提供的日志列表更新相应的热送总支数
|
|
|
- *
|
|
|
- * @param ccmNo 铸机号
|
|
|
- * @param cacheShint 班次信息
|
|
|
- * @param cacheShintGroup 班别信息
|
|
|
- * @param sum 热送总支数
|
|
|
- */
|
|
|
- public void updateShiftInfoByType(String ccmNo, String cacheShint, String cacheShintGroup, Integer sum, String type, String updateType) {
|
|
|
- LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapperCS = new LambdaQueryWrapper<>();
|
|
|
- queryWrapperCS.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
|
|
|
- .eq(BilletHotsendChangeShift::getShift, cacheShint)
|
|
|
- .eq(BilletHotsendChangeShift::getShiftGroup, cacheShintGroup)
|
|
|
- .between(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
- BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapperCS);
|
|
|
- if (oConvertUtils.isNotEmpty(billetHotsendChangeShift)) {
|
|
|
- String operationName = type.equals("hotSend")? "热送" : "热装";
|
|
|
- log.info("{}{}", ">>>>>B端车位发车统计当前班次" + operationName + "总支数:", sum + "班组:" + cacheShintGroup + "班次:" + cacheShint);
|
|
|
- billetHotsendChangeShift.setUpdateTime(new Date());
|
|
|
- if ("hotSend".equals(updateType)){
|
|
|
- billetHotsendChangeShift.setHotsendAmount(billetHotsendChangeShift.getHotsendAmount() + sum);
|
|
|
- }else{
|
|
|
- billetHotsendChangeShift.setHotfeignAmount(billetHotsendChangeShift.getHotfeignAmount() + sum);
|
|
|
- }
|
|
|
- billetHotsendChangeShiftService.updateById(billetHotsendChangeShift);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public OnDutyStatistics queryHotChargingTwoStatistics(String ccmNo,String changeShiftId) {
|
|
|
OnDutyStatistics onDutyStatistics = new OnDutyStatistics();
|
|
@@ -8114,7 +7560,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public void processRollHeightDetails(List<RollHeightDetails> rollHeightDetailsList) {
|
|
|
if (CollectionUtils.isEmpty(rollHeightDetailsList)) {
|
|
|
return;
|