|
@@ -25,6 +25,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
|
|
+import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -66,6 +68,17 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
|
|
|
|
|
List<InvAccount> invAccountIPage = insAccountMapper.selectAccountsListPage(invAccountQueryVo);
|
|
List<InvAccount> invAccountIPage = insAccountMapper.selectAccountsListPage(invAccountQueryVo);
|
|
|
|
|
|
|
|
|
|
+ for (InvAccount invAccount : invAccountIPage) {
|
|
|
|
|
+ if (invAccount.getInvoicingAmountExcess() != null) {
|
|
|
|
|
+ String invoicingAmountExcess = invAccount.getInvoicingAmountExcess();
|
|
|
|
|
+ BigDecimal amount = new BigDecimal(invoicingAmountExcess);
|
|
|
|
|
+ BigDecimal roundedAmount = amount.setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
+ invAccount.setInvoicingAmountExcess(roundedAmount.toString());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ invAccount.setInvoicingAmountExcess(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//计算当前季度剩余300000减去
|
|
//计算当前季度剩余300000减去
|
|
|
invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.quarterStartTime());
|
|
invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.quarterStartTime());
|
|
@@ -102,7 +115,10 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
.findFirst()
|
|
.findFirst()
|
|
|
.map(ord -> {
|
|
.map(ord -> {
|
|
|
if (ord.getSumInvoicingAmount() != null) {
|
|
if (ord.getSumInvoicingAmount() != null) {
|
|
|
- rel.setSumInvoicingAmount(new BigDecimal(rel.getSumInvoicingAmount()).add(new BigDecimal(ord.getSumInvoicingAmount())).toString());
|
|
|
|
|
|
|
+ BigDecimal sumInvoicingAmountDecimal = new BigDecimal(rel.getSumInvoicingAmount()).add(new BigDecimal(ord.getSumInvoicingAmount()));
|
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
|
+ String sumInvoicingAmountString = df.format(sumInvoicingAmountDecimal);
|
|
|
|
|
+ rel.setSumInvoicingAmount(sumInvoicingAmountString);
|
|
|
}
|
|
}
|
|
|
return rel;
|
|
return rel;
|
|
|
}).orElse(null)
|
|
}).orElse(null)
|
|
@@ -127,8 +143,11 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
boolean found = false;
|
|
boolean found = false;
|
|
|
for (InvAccountSumAmount yearAmount : sumYearAmount) {
|
|
for (InvAccountSumAmount yearAmount : sumYearAmount) {
|
|
|
if (yearAmount.getAccountId().equals(invAccount.getAccountId())) {
|
|
if (yearAmount.getAccountId().equals(invAccount.getAccountId())) {
|
|
|
- invAccount.setYearAmount(yearAmount.getYearAmount());
|
|
|
|
|
- invAccount.setQuarterAmount(yearAmount.getQuarterAmount());
|
|
|
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
|
+ String formattedYearAmount = df.format(Double.parseDouble(yearAmount.getYearAmount()));
|
|
|
|
|
+ String formattedQuarterAmount = df.format(Double.parseDouble(yearAmount.getQuarterAmount()));
|
|
|
|
|
+ invAccount.setYearAmount(formattedYearAmount);
|
|
|
|
|
+ invAccount.setQuarterAmount(formattedQuarterAmount);
|
|
|
found = true;
|
|
found = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -235,7 +254,10 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
.findFirst()
|
|
.findFirst()
|
|
|
.map(ord -> {
|
|
.map(ord -> {
|
|
|
if (ord.getSumInvoicingAmount() != null) {
|
|
if (ord.getSumInvoicingAmount() != null) {
|
|
|
- rel.setSumInvoicingAmount(new BigDecimal(rel.getSumInvoicingAmount()).add(new BigDecimal(ord.getSumInvoicingAmount())).toString());
|
|
|
|
|
|
|
+ BigDecimal sumSumInvoicingAmountDecimal = new BigDecimal(rel.getSumInvoicingAmount()).add(new BigDecimal(ord.getSumInvoicingAmount()));
|
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
|
+ String sumQuarterAmountExcessString = df.format(sumSumInvoicingAmountDecimal);
|
|
|
|
|
+ rel.setSumInvoicingAmount(sumQuarterAmountExcessString);
|
|
|
}
|
|
}
|
|
|
return rel;
|
|
return rel;
|
|
|
}).orElse(null)
|
|
}).orElse(null)
|
|
@@ -281,8 +303,11 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
boolean found = false;
|
|
boolean found = false;
|
|
|
for (InvAccountSumAmount yearAmount : sumYearAmount) {
|
|
for (InvAccountSumAmount yearAmount : sumYearAmount) {
|
|
|
if (yearAmount.getAccountId().equals(invAccount.getAccountId())) {
|
|
if (yearAmount.getAccountId().equals(invAccount.getAccountId())) {
|
|
|
- accountExcel.setYearAmount(yearAmount.getYearAmount());
|
|
|
|
|
- accountExcel.setQuarterAmount(yearAmount.getQuarterAmount());
|
|
|
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
|
+ String formattedYearAmount = df.format(Double.parseDouble(yearAmount.getYearAmount()));
|
|
|
|
|
+ String formattedQuarterAmount = df.format(Double.parseDouble(yearAmount.getQuarterAmount()));
|
|
|
|
|
+ accountExcel.setYearAmount(formattedYearAmount);
|
|
|
|
|
+ accountExcel.setQuarterAmount(formattedQuarterAmount);
|
|
|
found = true;
|
|
found = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|