| @@ -229,12 +229,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | ||||
| WxRentContract wxRentContract = new WxRentContract(); | WxRentContract wxRentContract = new WxRentContract(); | ||||
| wxRentContract.setTenantId(record.getTenantId()); | wxRentContract.setTenantId(record.getTenantId()); | ||||
| wxRentContract.setShopId(rentInfoObject.getLong("shopId")); | |||||
| Long shopId = rentInfoObject.getLong("shopId"); | |||||
| wxRentContract.setShopId(shopId); | |||||
| int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract); | int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract); | ||||
| if (count > 0) { | if (count > 0) { | ||||
| String shopNumber = rentInfoObject.getString("shopNumber"); | String shopNumber = rentInfoObject.getString("shopNumber"); | ||||
| return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); | return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); | ||||
| } | } | ||||
| WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); | |||||
| if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | |||||
| return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); | |||||
| } | |||||
| } | } | ||||
| } else { | } else { | ||||
| WxRentContract wxRentContract = new WxRentContract(); | WxRentContract wxRentContract = new WxRentContract(); | ||||
| @@ -298,7 +303,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| // 更新 | // 更新 | ||||
| ResultData resultData = getResultDataForUpdate(record, userId); | ResultData resultData = getResultDataForUpdate(record, userId); | ||||
| if (resultData.code != Result.SUCCESS) { | |||||
| return resultData; | |||||
| } | |||||
| if (dbRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { | if (dbRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { | ||||
| if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null | if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null | ||||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0)) { | && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0)) { | ||||
| @@ -442,11 +449,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery); | int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery); | ||||
| if (count > 0) { | if (count > 0) { | ||||
| String shopNumber = rentInfoObject.getString("shopNumber"); | String shopNumber = rentInfoObject.getString("shopNumber"); | ||||
| return new ResultData(ErrorCode.SHOP_IS_RENT, "店铺 " + shopNumber + " 已出租"); | |||||
| return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); | |||||
| } | } | ||||
| WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); | WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); | ||||
| if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | ||||
| return new ResultData(ErrorCode.SHOP_IS_RENT, "店铺 " + wxShop.getShopNumber() + " 已出租"); | |||||
| return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1175,6 +1182,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| } | } | ||||
| ResultData resultData = getResultDataForUpdate(record, userId); | ResultData resultData = getResultDataForUpdate(record, userId); | ||||
| if (resultData.code != Result.SUCCESS) { | |||||
| return resultData; | |||||
| } | |||||
| // 启动审批流 | // 启动审批流 | ||||
| if(record.getFlowParams() != null){ | if(record.getFlowParams() != null){ | ||||
| record.getFlowParams().put("businessId",record.getId().toString()); | record.getFlowParams().put("businessId",record.getId().toString()); | ||||