Browse Source

fix

release_toaliyun_real
winter 1 year ago
parent
commit
e0a616131d
2 changed files with 9 additions and 15 deletions
  1. +2
    -11
      mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java
  2. +7
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java

+ 2
- 11
mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java View File

@@ -278,7 +278,7 @@ public class WxPropertyContract extends TenantEntity {
} }
} }
public Map<Long,BigDecimal> getRentShopAreaRate() {
public Map<Long,BigDecimal> getRentShopArea() {
String rentInfo = this.getRentInfo(); String rentInfo = this.getRentInfo();
if (!StringUtils.isBlank(rentInfo)) { if (!StringUtils.isBlank(rentInfo)) {
Map<Long,BigDecimal> shopAreaMap = new HashMap<Long,BigDecimal>(); Map<Long,BigDecimal> shopAreaMap = new HashMap<Long,BigDecimal>();
@@ -296,16 +296,7 @@ public class WxPropertyContract extends TenantEntity {
total = total.add(new BigDecimal("rentArea")); total = total.add(new BigDecimal("rentArea"));
} }
} }
if (total.compareTo(new BigDecimal(0)) <= 0 ) {
total = new BigDecimal(1);
}
Map<Long,BigDecimal> shopAreaRateMap = new HashMap<Long,BigDecimal>();
for (Iterator<Long> 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; return null;
} }


+ 7
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -511,14 +511,15 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
List<Long> shopIds = wxPropertyContract.shopIdsByShop(); List<Long> shopIds = wxPropertyContract.shopIdsByShop();
Map<Long, BigDecimal> shopAreaRateMap = wxPropertyContract.getRentShopAreaRate();
Map<Long, BigDecimal> shopAreaRateMap = wxPropertyContract.getRentShopArea();
if (null == shopAreaRateMap) { if (null == shopAreaRateMap) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"无店铺信息"); throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"无店铺信息");
} }
for (int i = 0 ; i < shopIds.size(); i++) { for (int i = 0 ; i < shopIds.size(); i++) {
Long shopId = shopIds.get(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(); WxAllBill wxBillDeposit = new WxAllBill();
wxBillDeposit.setId(idWorker.nextId()); wxBillDeposit.setId(idWorker.nextId());
@@ -668,7 +669,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
} }
List<Long> shopIdList = wxPropertyContract.shopIdsByShop(); List<Long> shopIdList = wxPropertyContract.shopIdsByShop();
Map<Long, BigDecimal> shopAreaRateMap = wxPropertyContract.getRentShopAreaRate();
Map<Long, BigDecimal> shopAreaRateMap = wxPropertyContract.getRentShopArea();
if (null == shopAreaRateMap) { if (null == shopAreaRateMap) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"无店铺信息"); 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 ++ ){ for (int g = 0 ; g < shopIdList.size(); g ++ ){
WxAllBill rs = new WxAllBill(); WxAllBill rs = new WxAllBill();
Long sid = shopIdList.get(g); 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 { try {
BeanUtils.copyProperties(rs, rb); BeanUtils.copyProperties(rs, rb);
rs.setId(idWorker.nextId()); rs.setId(idWorker.nextId());


Loading…
Cancel
Save