From 3cef269a7ad1d6e14ec2c25ee50d0644fe947d95 Mon Sep 17 00:00:00 2001 From: bonus <1203338439@qq.com> Date: Wed, 17 Dec 2025 11:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SltAgreementInfoController.java | 8 +++++--- .../service/impl/SltAgreementInfoServiceImpl.java | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index c9668782..d8e1eae2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -751,7 +751,7 @@ public class SltAgreementInfoController extends BaseController { if (null == bean.getLeasePrice()) { bean.setLeasePrice(BigDecimal.valueOf(0.00)); }else{ - bean.setLeasePrice(bean.getLeasePrice().setScale(2, RoundingMode.HALF_UP)); + bean.setLeasePrice(bean.getLeasePrice().setScale(3, RoundingMode.DOWN)); } if (null == bean.getNum()) { @@ -1290,7 +1290,8 @@ public class SltAgreementInfoController extends BaseController { BigDecimal leasePrice = bean.getLeasePrice(); BigDecimal num = bean.getNum(); BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays()); - BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays); +// BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays); + BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays).setScale(GlobalConstants.INT_2, RoundingMode.HALF_UP); if(costs!=null){ totalCostLease = totalCostLease.add(costs); } @@ -1450,7 +1451,8 @@ public class SltAgreementInfoController extends BaseController { BigDecimal leasePrice = bean.getLeasePrice(); BigDecimal num = bean.getNum(); BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays()); - BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays); + BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays).setScale(GlobalConstants.INT_2, RoundingMode.HALF_UP); + totalCostLease = totalCostLease.add(costs); bean.setCosts(costs); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index e5534b03..431b630c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -489,7 +489,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { if (leaseDays.compareTo(BigDecimal.ZERO) < 0) { leaseDays = BigDecimal.ZERO; } - BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays).setScale(GlobalConstants.INT_2, RoundingMode.DOWN); + BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays).setScale(GlobalConstants.INT_2, RoundingMode.HALF_UP); bean.setCosts(costs); } return leaseList; @@ -834,7 +834,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { id = sltInfoVo.getId(); sltInfoVo.setUpdateTime(DateUtils.getNowDate()); } - if (!sltInfoVo.getLeaseList().isEmpty()) { + if (sltInfoVo !=null) { List filteredLeaseList = getLeaseList(info).stream() .filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId())) .collect(Collectors.toList()); @@ -842,7 +842,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { sltAgreementInfoMapper.insertSltAgreementDetailLease(filteredLeaseList, id); } } - if (!sltInfoVo.getRepairList().isEmpty()) { + if (sltInfoVo !=null) { List filteredRepairList = getRepairList(info).stream() .filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId())) .collect(Collectors.toList()); @@ -850,7 +850,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { sltAgreementInfoMapper.insertSltAgreementDetailRepair(filteredRepairList, id); } } - if (!sltInfoVo.getScrapList().isEmpty()) { + if (sltInfoVo !=null) { List filteredScrapList = getScrapList(info).stream() .filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId())) .collect(Collectors.toList()); @@ -858,7 +858,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { sltAgreementInfoMapper.insertSltAgreementDetailScrap(filteredScrapList, id); } } - if (!sltInfoVo.getLoseList().isEmpty()) { + if (sltInfoVo !=null) { List filteredLoseList = getLoseList(info).stream() .filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId())) .collect(Collectors.toList());