diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 47c29080f..f94292ee8 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -636,22 +636,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { @Override public ResultData hasRentStatus(WxRentContract record) { String rentInfo = record.getRentInfo(); - JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); - int size = rentInfoArray.size(); - if (size == 0) { + if (StringUtils.isEmpty(rentInfo)) { return new ResultData(ErrorCode.SHOP_NOT_SELECTED); } + String[] split = rentInfo.split(","); + int size = split.length; //查询rent_info 包括 shopId for (int i = 0; i < size; i++) { - JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); + String shopId = split[i]; + WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); WxRentContract wxRentContractQuery = new WxRentContract(); wxRentContractQuery.setTenantId(record.getTenantId()); - Long shopId = rentInfoObject.getLong("shopId"); - String shopNumber = rentInfoObject.getString("shopNumber"); + String shopNumber = wxShop.getShopNumber(); if (shopId == null) { return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); } - wxRentContractQuery.setShopId(shopId); + wxRentContractQuery.setShopId(Long.valueOf(shopId)); int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery); if (count > 0) { return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租");