| @@ -215,4 +215,12 @@ public class WxRentContractController extends BaseController { | |||||
| return wxRentContractService.hasRentStatus(wxRentContract); | return wxRentContractService.hasRentStatus(wxRentContract); | ||||
| } | } | ||||
| @GetMapping("/hasContractNumber") | |||||
| @SystemControllerLog(description = "租赁合同-检查合同编号是否存在") | |||||
| public ResultData hasContractNumber(@ModelAttribute WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::hasContractNumber"); | |||||
| wxRentContract.setTenantId(getTenantId()); | |||||
| return wxRentContractService.hasContractNumber(wxRentContract); | |||||
| } | |||||
| } | } | ||||
| @@ -54,4 +54,7 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||||
| List<WxRentContract> selectRentContractByMerchantId(WxRentContract wxRentContract); | List<WxRentContract> selectRentContractByMerchantId(WxRentContract wxRentContract); | ||||
| List<WxRentContract> selectRentContractByShopId(WxRentContract record); | List<WxRentContract> selectRentContractByShopId(WxRentContract record); | ||||
| int hasContractNumber(WxRentContract wxRentContract); | |||||
| } | } | ||||
| @@ -80,4 +80,7 @@ public interface WxRentContractService { | |||||
| void updateInvalidContract(Long rentContractId); | void updateInvalidContract(Long rentContractId); | ||||
| ResultData hasRentStatus(WxRentContract wxRentContract); | ResultData hasRentStatus(WxRentContract wxRentContract); | ||||
| ResultData hasContractNumber(WxRentContract wxRentContract); | |||||
| } | } | ||||
| @@ -670,6 +670,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData hasContractNumber(WxRentContract wxRentContract) { | |||||
| int count = wxRentContractMapper.hasContractNumber(wxRentContract); | |||||
| return new ResultData(Result.SUCCESS, "操作成功", count > 0 ? true : false); | |||||
| } | |||||
| public void updateInvalidStatus(WxRentContract record) { | public void updateInvalidStatus(WxRentContract record) { | ||||
| Long id = record.getId(); | Long id = record.getId(); | ||||
| //审核流程中止 | //审核流程中止 | ||||
| @@ -252,5 +252,24 @@ | |||||
| where status in(2,3,4) | where status in(2,3,4) | ||||
| and merchant_id = #{merchantId} | and merchant_id = #{merchantId} | ||||
| </select> | </select> | ||||
| <select id="hasContractNumber" parameterType="com.iformall.domain.po.WxRentContract" | |||||
| resultType="int"> | |||||
| select count(*) from ( | |||||
| select * from wx_rent_contract where tenant_id=#{tenantId} | |||||
| and contract_number=#{contractNumber} | |||||
| and status not in(5,6,7) | |||||
| union | |||||
| select * from wx_rent_contract where tenant_id=#{tenantId} | |||||
| and contract_number=#{contractNumber} | |||||
| and apply_status in(1,2) | |||||
| ) r | |||||
| <where> | |||||
| <if test="id!=null and id!=''"> | |||||
| r.id!=#{id} | |||||
| </if> | |||||
| </where> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||