winter 1 год назад
Родитель
Сommit
e0a616131d
2 измененных файлов: 9 добавлений и 15 удалений
  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 Просмотреть файл

@@ -278,7 +278,7 @@ public class WxPropertyContract extends TenantEntity {
}
}
public Map<Long,BigDecimal> getRentShopAreaRate() {
public Map<Long,BigDecimal> getRentShopArea() {
String rentInfo = this.getRentInfo();
if (!StringUtils.isBlank(rentInfo)) {
Map<Long,BigDecimal> shopAreaMap = new HashMap<Long,BigDecimal>();
@@ -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<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;
}


+ 7
- 4
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<Long> shopIds = wxPropertyContract.shopIdsByShop();
Map<Long, BigDecimal> shopAreaRateMap = wxPropertyContract.getRentShopAreaRate();
Map<Long, BigDecimal> 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<Long> shopIdList = wxPropertyContract.shopIdsByShop();
Map<Long, BigDecimal> shopAreaRateMap = wxPropertyContract.getRentShopAreaRate();
Map<Long, BigDecimal> 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());


Загрузка…
Отмена
Сохранить