From e0a616131db86cd0f332d7e8e626c4c159fb0e3a Mon Sep 17 00:00:00 2001 From: winter <664946893@qq.com> Date: Mon, 11 Nov 2024 20:02:27 +0800 Subject: [PATCH] fix --- .../com/iformall/domain/po/WxPropertyContract.java | 13 ++----------- .../service/impl/WxPropertyContractServiceImpl.java | 11 +++++++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java index a5382d3f7..3baea98e4 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java @@ -278,7 +278,7 @@ public class WxPropertyContract extends TenantEntity { } } - public Map getRentShopAreaRate() { + public Map getRentShopArea() { String rentInfo = this.getRentInfo(); if (!StringUtils.isBlank(rentInfo)) { Map shopAreaMap = new HashMap(); @@ -296,16 +296,7 @@ public class WxPropertyContract extends TenantEntity { total = total.add(new BigDecimal("rentArea")); } } - if (total.compareTo(new BigDecimal(0)) <= 0 ) { - total = new BigDecimal(1); - } - Map shopAreaRateMap = new HashMap(); - for (Iterator it = shopAreaMap.keySet().iterator();it.hasNext();) { - Long sid = it.next(); - BigDecimal sa = shopAreaMap.get(sid); - shopAreaRateMap.put(sid, sa.divide(total,Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP)); - } - return shopAreaRateMap; + return shopAreaMap; } return null; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index c0cc3c2a3..ab34242de 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -511,14 +511,15 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService final IdWorker idWorker = IdWorker.get(); List shopIds = wxPropertyContract.shopIdsByShop(); - Map shopAreaRateMap = wxPropertyContract.getRentShopAreaRate(); + Map shopAreaRateMap = wxPropertyContract.getRentShopArea(); if (null == shopAreaRateMap) { throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"无店铺信息"); } for (int i = 0 ; i < shopIds.size(); i++) { Long shopId = shopIds.get(i); - BigDecimal shoprate = shopAreaRateMap.get(shopId); + BigDecimal shoprentArea = shopAreaRateMap.get(shopId); + BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxPropertyContract.getRentArea()),wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); WxAllBill wxBillDeposit = new WxAllBill(); wxBillDeposit.setId(idWorker.nextId()); @@ -668,7 +669,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } List shopIdList = wxPropertyContract.shopIdsByShop(); - Map shopAreaRateMap = wxPropertyContract.getRentShopAreaRate(); + Map shopAreaRateMap = wxPropertyContract.getRentShopArea(); if (null == shopAreaRateMap) { throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"无店铺信息"); } @@ -821,7 +822,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService for (int g = 0 ; g < shopIdList.size(); g ++ ){ WxAllBill rs = new WxAllBill(); Long sid = shopIdList.get(g); - BigDecimal shoprate = shopAreaRateMap.get(sid); + BigDecimal shoprentArea = shopAreaRateMap.get(sid); + BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxPropertyContract.getRentArea()),wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); + try { BeanUtils.copyProperties(rs, rb); rs.setId(idWorker.nextId());