|
@@ -76,6 +76,7 @@ import java.time.format.DateTimeFormatter;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import java.util.function.Function;
|
|
import java.util.function.Function;
|
|
|
|
+import java.util.function.Predicate;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
@@ -3971,6 +3972,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
List<StorageCenterInvoicingVO> resultList = heatsActuals.stream()
|
|
List<StorageCenterInvoicingVO> resultList = heatsActuals.stream()
|
|
.map(heat -> {
|
|
.map(heat -> {
|
|
String heatNo = heat.getHeatsCode();
|
|
String heatNo = heat.getHeatsCode();
|
|
|
|
+ Date createTime = heat.getCreateTime();
|
|
List<BilletBasicInfo> billets = groupedByHeatNo.getOrDefault(heatNo, Collections.emptyList());
|
|
List<BilletBasicInfo> billets = groupedByHeatNo.getOrDefault(heatNo, Collections.emptyList());
|
|
|
|
|
|
// 汇总重量
|
|
// 汇总重量
|
|
@@ -3989,6 +3991,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
BigDecimal sumWeight = BigDecimal.ZERO;
|
|
BigDecimal sumWeight = BigDecimal.ZERO;
|
|
int sumAmount = 0;
|
|
int sumAmount = 0;
|
|
|
|
|
|
|
|
+ Date storageTimeBegin = queryDTO.getStorageTimeBegin();
|
|
|
|
+ Date storageTimeEnd = queryDTO.getStorageTimeEnd();
|
|
|
|
+
|
|
if (storageCenterHeatNoInvoicingVO != null) {
|
|
if (storageCenterHeatNoInvoicingVO != null) {
|
|
if (storageCenterHeatNoInvoicingVO.getRollClubOneDetails() != null) {
|
|
if (storageCenterHeatNoInvoicingVO.getRollClubOneDetails() != null) {
|
|
sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubOneDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollClubOneDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
@@ -4010,6 +4015,56 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollOutShippDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
sumWeight = sumWeight.add(Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollOutShippDetails().getTotalWeight()).orElse(BigDecimal.ZERO));
|
|
sumAmount += Optional.ofNullable(storageCenterHeatNoInvoicingVO.getRollOutShippDetails().getTotalAmount()).orElse(0);
|
|
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(DateUtils.getStartOfDayByDate(storageTimeBegin)) && !createTime1.after(DateUtils.getEndOfDayByDate(storageTimeEnd));
|
|
|
|
+ } else if (storageTimeBegin != null) {
|
|
|
|
+ return !createTime1.before(DateUtils.getStartOfDayByDate(storageTimeBegin));
|
|
|
|
+ } else if (storageTimeEnd != null) {
|
|
|
|
+ return !createTime1.after(DateUtils.getEndOfDayByDate(storageTimeEnd));
|
|
|
|
+ } else {
|
|
|
|
+ return true; // 时间条件都为空,则不过滤
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // 过滤棒二
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 设置热号基础信息
|
|
// 设置热号基础信息
|
|
@@ -4017,6 +4072,7 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
heatNoDetail.setCcmNo(ccmNo);
|
|
heatNoDetail.setCcmNo(ccmNo);
|
|
heatNoDetail.setHeatNoWeight(sumWeight);
|
|
heatNoDetail.setHeatNoWeight(sumWeight);
|
|
heatNoDetail.setHeatNoAmount(sumAmount);
|
|
heatNoDetail.setHeatNoAmount(sumAmount);
|
|
|
|
+ heatNoDetail.setCreateTime(createTime);
|
|
|
|
|
|
StorageCenterInvoicingVO vo = new StorageCenterInvoicingVO();
|
|
StorageCenterInvoicingVO vo = new StorageCenterInvoicingVO();
|
|
vo.setHeatNoDetails(Collections.singletonList(heatNoDetail));
|
|
vo.setHeatNoDetails(Collections.singletonList(heatNoDetail));
|