| @@ -262,8 +262,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| } else { | |||
| WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); | |||
| if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | |||
| if (wxShop != null && wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | |||
| return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); | |||
| } else { | |||
| return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); | |||
| } | |||
| } | |||
| } | |||
| @@ -485,8 +487,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| } else { | |||
| WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); | |||
| if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | |||
| if (wxShop != null && wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | |||
| return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); | |||
| } else { | |||
| return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); | |||
| } | |||
| } | |||
| } | |||
| @@ -1445,13 +1449,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } else { | |||
| WxShop record = new WxShop(); | |||
| record.setId(wxRentContract.getShopId()); | |||
| Map<String, Object> wxShop = wxShopMapper.findListMap(record).get(0); | |||
| //店铺信息 | |||
| result.put("shopNumber", wxShop.get("shopNumber")); | |||
| result.put("floorName", wxShop.get("floor")); | |||
| result.put("buildingName", wxShop.get("building")); | |||
| result.put("buildArea", wxShop.get("buildArea")); | |||
| result.put("operationArea", wxShop.get("operationArea")); | |||
| List<Map<String, Object>> wxShops = wxShopMapper.findListMap(record); | |||
| if (!wxShops.isEmpty()) { | |||
| //店铺信息 | |||
| Map<String, Object> wxShop = wxShops.get(0); | |||
| result.put("shopNumber", wxShop.get("shopNumber")); | |||
| result.put("floorName", wxShop.get("floor")); | |||
| result.put("buildingName", wxShop.get("building")); | |||
| result.put("buildArea", wxShop.get("buildArea")); | |||
| result.put("operationArea", wxShop.get("operationArea")); | |||
| } else { | |||
| result.put("shopNumber", " "); | |||
| result.put("floorName", " "); | |||
| result.put("buildingName", " "); | |||
| result.put("buildArea", " "); | |||
| result.put("operationArea", " "); | |||
| } | |||
| } | |||
| //MALL信息 | |||
| WxMall wxMall = new WxMall(); | |||
| @@ -1971,4 +1984,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxRentContractMapper.updateApplyStatus(wxRentContract); | |||
| } | |||
| public static void main(String[] args) { | |||
| Map<String, Integer> m = new HashMap<String, Integer>(); | |||
| m.put("zhangsan", 19); | |||
| m.put("lisi", 49); | |||
| m.put("wangwu", 19); | |||
| m.put("lisi", 20); | |||
| m.put("hanmeimei", null); | |||
| System.out.println(m); | |||
| System.out.println(m.size()); | |||
| } | |||
| } | |||