|
|
|
@@ -633,6 +633,33 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
updateInvalidStatus(wxRentContract); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData hasRentStatus(WxRentContract record) { |
|
|
|
String rentInfo = record.getRentInfo(); |
|
|
|
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); |
|
|
|
int size = rentInfoArray.size(); |
|
|
|
if (size == 0) { |
|
|
|
return new ResultData(ErrorCode.SHOP_NOT_SELECTED); |
|
|
|
} |
|
|
|
//查询rent_info 包括 shopId |
|
|
|
for (int i = 0; i < size; i++) { |
|
|
|
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); |
|
|
|
WxRentContract wxRentContractQuery = new WxRentContract(); |
|
|
|
wxRentContractQuery.setTenantId(record.getTenantId()); |
|
|
|
Long shopId = rentInfoObject.getLong("shopId"); |
|
|
|
String shopNumber = rentInfoObject.getString("shopNumber"); |
|
|
|
if (shopId == null) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); |
|
|
|
} |
|
|
|
wxRentContractQuery.setShopId(shopId); |
|
|
|
int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery); |
|
|
|
if (count > 0) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "操作成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateInvalidStatus(WxRentContract wxRentContract) { |
|
|
|
WxRentContract record = new WxRentContract(); |
|
|
|
record.setTenantId(wxRentContract.getTenantId()); |
|
|
|
|