|
|
|
@@ -167,11 +167,9 @@ public class WxContractBaseController extends BaseController{ |
|
|
|
|
|
|
|
ShopValidAreaVo vo = new ShopValidAreaVo(); |
|
|
|
vo.setShopNumber(shop.getShopNumber()); |
|
|
|
; |
|
|
|
vo.setValidArea(shopArea);; |
|
|
|
|
|
|
|
if (shopArea.compareTo(new BigDecimal(0)) <= 0 ) { |
|
|
|
vo.setValidArea(new BigDecimal(0)); |
|
|
|
}else { |
|
|
|
if (shopArea.compareTo(new BigDecimal(0)) > 0 ) { |
|
|
|
BigDecimal contractShopArea = new BigDecimal(0); |
|
|
|
if (null != rentAreaMap) { |
|
|
|
contractShopArea = rentAreaMap.get(shopId); |
|
|
|
@@ -220,12 +218,8 @@ public class WxContractBaseController extends BaseController{ |
|
|
|
if (null != usedContractIds && usedContractIds.size() > 0 ) { |
|
|
|
BigDecimal usedArea = wxAgileContractService.sumShopContractAreas(tenantEntity, shopId,usedContractIds); |
|
|
|
BigDecimal totalUsedArea = usedArea.add(contractShopArea); |
|
|
|
BigDecimal remianArea = wxShopService.calcuteUsedShopArea(tenantEntity, shopId, totalUsedArea); |
|
|
|
if (remianArea.compareTo(new BigDecimal(0)) < 0 ) { |
|
|
|
vo.setValidArea(new BigDecimal(0)); |
|
|
|
}else { |
|
|
|
vo.setValidArea(remianArea); |
|
|
|
} |
|
|
|
BigDecimal remianArea = shopArea.subtract(totalUsedArea); |
|
|
|
vo.setValidArea(remianArea); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -244,7 +238,7 @@ public class WxContractBaseController extends BaseController{ |
|
|
|
Long shopId = it.next(); |
|
|
|
ShopValidAreaVo vo = shopVliadAreaMap.get(shopId); |
|
|
|
if ( null != vo && null != vo.getValidArea()) { |
|
|
|
if (vo.getValidArea().compareTo(new BigDecimal(0)) <= 0 ) { |
|
|
|
if (vo.getValidArea().compareTo(new BigDecimal(0)) < 0 ) { |
|
|
|
throw new MallinkException(Result.ERROR, "房间["+vo.getShopNumber()+"]面积不足。"); |
|
|
|
} |
|
|
|
} |
|
|
|
|