From 907925068163c80cd871f7a2d48844913124d46d Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 26 Apr 2019 15:45:31 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E8=A1=A5=E5=BD=95=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AD=A5=E5=88=A4=E6=96=AD=E5=BA=97=E9=93=BA=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=B7=B2=E5=87=BA=E7=A7=9F]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxRentContractServiceImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 + " 已出租");