|
|
|
@@ -452,6 +452,12 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
return new ResultData(Result.ERROR,e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
validShop(contract); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(Result.ERROR,e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
wxRentContractService.updateRentContractStatus(wxRentContract.getId()); |
|
|
|
if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { |
|
|
|
wxPropertyContractService.updatePropertyContractStatus(wxRentContract.getPropertyId()); |
|
|
|
@@ -479,6 +485,22 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void validShop(WxRentContract rentContract) throws Exception { |
|
|
|
//判断该合同的店铺是不是在商户的店铺的绑定关系里面 |
|
|
|
List<Long> shopIds = wxMerchantService.getMerchantShopIds(rentContract.getMerchantId()); |
|
|
|
if (null == shopIds) { |
|
|
|
throw new MallinkException(Result.ERROR, "该商户未绑定任何商铺。"); |
|
|
|
} |
|
|
|
List<Long> cids = rentContract.shopIdsByRentInfo(); |
|
|
|
if (null == cids) { |
|
|
|
throw new MallinkException(Result.ERROR, "该合同未绑定任何商铺。"); |
|
|
|
} |
|
|
|
|
|
|
|
if (!shopIds.containsAll(cids)) { |
|
|
|
throw new MallinkException(Result.ERROR, "该合同绑定的部分商铺未在商户绑定的店铺范围内。"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("apply") |
|
|
|
@SystemControllerLog(description = "租赁合同-提交审批") |
|
|
|
public ResultData apply(@RequestBody WxRentContract wxRentContract) { |
|
|
|
@@ -498,6 +520,12 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
return new ResultData(Result.ERROR,e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
validShop(rentContract); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(Result.ERROR,e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
if(rentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { |
|
|
|
if (rentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { |
|
|
|
rentContract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT, wxRentContract.getRemark(), wxRentContract.getId(),null)); |
|
|
|
|