diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java index dc703c108..f74494c4d 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java @@ -247,11 +247,29 @@ public class WxContractBaseController extends BaseController{ } protected void rentContractValidShop(WxRentContract rentContract) throws Exception { + //当前的不能<=0 + Map rentAreaMap = rentContract.getRentShopArea(); + for (Iterator it = rentAreaMap.keySet().iterator();it.hasNext();) { + Long shopId= it.next(); + BigDecimal ra = rentAreaMap.get(shopId); + if (ra.compareTo(new BigDecimal(0)) <= 0 ) { + throw new MallinkException(Result.ERROR, "房间面积不能为0。"); + } + } contractValidShop(rentContract,rentContract.getId(),rentContract.getRentalStartDate(),rentContract.getRentalEndDate(),rentContract.shopIdsByRentInfo(), rentContract.getRentShopArea(),true); } protected void propertyContractValidShop(WxPropertyContract propertyContract) throws Exception { + //当前的不能<=0 + Map rentAreaMap = propertyContract.getRentShopArea(); + for (Iterator it = rentAreaMap.keySet().iterator();it.hasNext();) { + Long shopId= it.next(); + BigDecimal ra = rentAreaMap.get(shopId); + if (ra.compareTo(new BigDecimal(0)) <= 0 ) { + throw new MallinkException(Result.ERROR, "房间面积不能为0。"); + } + } contractValidShop(propertyContract,propertyContract.getId(),propertyContract.getRentalStartDate(),propertyContract.getRentalEndDate(),propertyContract.shopIdsByShop(), propertyContract.getRentShopArea(),false); }