结算的bug修改

This commit is contained in:
haozq 2026-02-03 12:36:45 +08:00
parent cf19884318
commit 631ff33f7a
1 changed files with 67 additions and 40 deletions

View File

@ -192,9 +192,10 @@ public class NewSettlementService {
Comparator.nullsFirst(Comparator.naturalOrder())));
ProjectLeaseCostDetail firstItem = items.get(0);
//
if("1143".equals(machineTypeId)) {
if("612".equals(machineTypeId)) {
System.err.println(machineTypeId);
}
System.err.println(machineTypeId);
double totalItemAmount = 0.0;
//循环逻辑处理
//默认在操作日期之前 存量
@ -383,6 +384,28 @@ public class NewSettlementService {
}else {
if(delNum>0) {
if(fasetStarTime==null &&currentCount==0) {
fasetStarTime=operateTime;
currentCount=currentCount+addNum;
// 然后将领取的座位最后一天单独计算
double segmentAmount2 = currentCount * unitPrice * 1;
Map<String, Object> segment2 = new HashMap<>();
LocalDateTime nextDayTime = operateTime.plusDays(1);
segment2.put("startTime",operateTime.toString());
segment2.put("endTime", nextDayTime.toString());
segment2.put("days", 1);
segment2.put("count", currentCount);
segment2.put("amount", segmentAmount2);
segments.add(segment2);
totalItemAmount=totalItemAmount+segmentAmount2;
//然后减去
currentCount=currentCount-delNum;
fasetStarTime=nextDayTime;
String fasetStarTimeStr = formatLocalDateTimeToDate(fasetStarTime);
if(fasetStarTimeStr.equals(endTimeStr)) {
isLast=true;
}
}else {
String fasetStarTimeStr1 = formatLocalDateTimeToDate(fasetStarTime);
String operateTimeStr = formatLocalDateTimeToDate(operateTime);
if(fasetStarTimeStr1.equals(operateTimeStr)) {
@ -404,6 +427,7 @@ public class NewSettlementService {
segment.put("count", currentCount);
segment.put("amount", segmentAmount);
segments.add(segment);
currentCount=currentCount+addNum;
// 然后将领取的座位最后一天单独计算
@ -425,6 +449,9 @@ public class NewSettlementService {
isLast=true;
}
}
}else {
//无之前的数据的 第一次进来的
if(fasetStarTime==null) {