|
|
@@ -2297,6 +2297,9 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
for (FinAccBillsVO item : finStlBills.getFinAccBillsVOList()) {
|
|
|
FinStlBillsItems stlBillsItems = this.assignmentProcess(item, stlBills);
|
|
|
stlBillsItems.setPType("DZ");
|
|
|
+ if (new BigDecimal("0.00").compareTo(item.getReconciliationCurrentAmount()) == 0){
|
|
|
+ throw new RuntimeException("本次金额不能为零");
|
|
|
+ }
|
|
|
stlBillsItems.setCurrentStlAmountNet(item.getReconciliationCurrentAmount());
|
|
|
stlBillsItems.setCurrentStlAmount(item.getReconciliationCurrentAmount());
|
|
|
stlBillsItems.setCurrentStlAmountLoc(item.getReconciliationCurrentAmount().multiply(item.getExrate()).setScale(2, RoundingMode.HALF_UP));
|
|
|
@@ -2418,6 +2421,9 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
for (FinAccBillsVO item : finStlBills.getFinAccBillsVOList()) {
|
|
|
FinStlBillsItems stlBillsItems = this.assignmentProcess(item, stlBills);
|
|
|
stlBillsItems.setPType("FFSQ");
|
|
|
+ if (new BigDecimal("0.00").compareTo(item.getAppliedCurrentStlAmount()) == 0){
|
|
|
+ throw new RuntimeException("本次金额不能为零");
|
|
|
+ }
|
|
|
stlBillsItems.setCurrentStlAmountNet(item.getAppliedCurrentStlAmount());
|
|
|
stlBillsItems.setCurrentStlAmount(item.getAppliedCurrentStlAmount());
|
|
|
stlBillsItems.setCurrentStlAmountLoc(item.getAppliedCurrentStlAmount().multiply(item.getExrate()).setScale(2, RoundingMode.HALF_UP));
|
|
|
@@ -2518,10 +2524,16 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
FinStlBillsItems stlBillsItems = this.assignmentProcess(item, stlBills);
|
|
|
stlBillsItems.setPType("STL");
|
|
|
if ("D".equals(item.getAccountDc())) {
|
|
|
+ if (new BigDecimal("0.00").compareTo(item.getAppliedInvoiceCurrentStlAmount()) == 0){
|
|
|
+ throw new RuntimeException("本次金额不能为零");
|
|
|
+ }
|
|
|
stlBillsItems.setCurrentStlAmountNet(item.getAppliedInvoiceCurrentStlAmount());
|
|
|
stlBillsItems.setCurrentStlAmount(item.getAppliedInvoiceCurrentStlAmount());
|
|
|
stlBillsItems.setCurrentStlAmountLoc(item.getAppliedInvoiceCurrentStlAmount().multiply(item.getExrate()).setScale(2, RoundingMode.HALF_UP));
|
|
|
} else if ("C".equals(item.getAccountDc())) {
|
|
|
+ if (new BigDecimal("0.00").compareTo(item.getAppliedCurrentStlAmount()) == 0){
|
|
|
+ throw new RuntimeException("本次金额不能为零");
|
|
|
+ }
|
|
|
stlBillsItems.setCurrentStlAmountNet(item.getAppliedCurrentStlAmount());
|
|
|
stlBillsItems.setCurrentStlAmount(item.getAppliedCurrentStlAmount());
|
|
|
stlBillsItems.setCurrentStlAmountLoc(item.getAppliedCurrentStlAmount().multiply(item.getExrate()).setScale(2, RoundingMode.HALF_UP));
|
|
|
@@ -3567,11 +3579,12 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
}
|
|
|
List<FinAccBills> finAccBillsList = new ArrayList<>();
|
|
|
List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
+ int count = 1;
|
|
|
for (FinStlBillsItems item : finStlBillsItemsList) {
|
|
|
FinAccBills finAccBills = finAccBillsListAll.stream().filter(e -> e.getId().equals(item.getAccBillId()))
|
|
|
.findFirst().orElse(null);
|
|
|
if (finAccBills == null) {
|
|
|
- throw new RuntimeException("未找到账单明细,操作失败");
|
|
|
+ throw new RuntimeException("第"+count+"行未找到账单明细,操作失败");
|
|
|
}
|
|
|
boolean status = Boolean.FALSE;
|
|
|
//计算字段null值处理
|
|
|
@@ -3593,7 +3606,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
if (finAccBills.getStlAmountDr().abs().compareTo(finAccBills.getAmountDr().abs()) > 0 ||
|
|
|
finAccBills.getStlAmountDrUsd().abs().compareTo(finAccBills.getAmountDrUsd().abs()) > 0
|
|
|
) {
|
|
|
- throw new RuntimeException("结算金额大于账单金额,操作失败");
|
|
|
+ throw new RuntimeException("第"+count+"行结算金额大于账单金额,操作失败");
|
|
|
}
|
|
|
} else if ("C".equals(item.getDc())) {
|
|
|
if (exrateType.equals(item.getCurCode())) {
|
|
|
@@ -3613,7 +3626,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
if (finAccBills.getStlAmountCr().abs().compareTo(finAccBills.getAmountCr().abs()) > 0 ||
|
|
|
finAccBills.getStlAmountCrUsd().abs().compareTo(finAccBills.getAmountCrUsd().abs()) > 0
|
|
|
) {
|
|
|
- throw new RuntimeException("结算金额大于账单金额,操作失败");
|
|
|
+ throw new RuntimeException("第"+count+"行结算金额大于账单金额,操作失败");
|
|
|
}
|
|
|
}
|
|
|
if (status) {
|
|
|
@@ -3634,7 +3647,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
BigDecimal stlTtlAmount = feeCenters.stream().map(FeeCenter::getStlTtlAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
if (item.getCurrentStlAmount().compareTo(new BigDecimal("0.00")) == 0 ||
|
|
|
item.getCurrentStlAmount().abs().compareTo(item.getAmount().abs().subtract(stlTtlAmount).abs()) > 0) {
|
|
|
- throw new RuntimeException("本次结算金额不能为零或大于未结算金额");
|
|
|
+ throw new RuntimeException("第"+count+"行本次结算金额不能为零或大于未结算金额");
|
|
|
}
|
|
|
for (FeeCenter e : feeCenters) {
|
|
|
int version = StringUtil.isBlank(e.getVersion()) ? 1 : Integer.parseInt(e.getVersion());
|
|
|
@@ -3682,8 +3695,9 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
|
|
|
}
|
|
|
}
|
|
|
if (currentStlAmount.compareTo(new BigDecimal("0.00")) != 0) {
|
|
|
- throw new RuntimeException("结算金额计算错误,操作失败");
|
|
|
+ throw new RuntimeException("第"+count+"行结算金额计算错误,操作失败");
|
|
|
}
|
|
|
+ count++;
|
|
|
}
|
|
|
feeCenterService.saveOrUpdateBatch(feeCenterList);
|
|
|
finAccBillsService.saveOrUpdateBatch(finAccBillsList);
|