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());