|
|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.iformall.controller.contract; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.annotation.SystemControllerLog; |
|
|
|
import com.iformall.annotation.UserDataRuleAnnotation; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
@@ -7,6 +8,7 @@ import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.domain.po.base.BaseEntity; |
|
|
|
import com.iformall.enums.EnumContractType; |
|
|
|
import com.iformall.enums.EnumFlowContractType; |
|
|
|
import com.iformall.enums.EnumFlowKey; |
|
|
|
@@ -323,12 +325,48 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
if (1 == validStatus) { |
|
|
|
List<Integer> statuss = new ArrayList<Integer>(); |
|
|
|
statuss.add(EnumRentContractStatus.PAING.getCode()); |
|
|
|
statuss.add(EnumRentContractStatus.OUT_DATE.getCode()); |
|
|
|
statuss.add(EnumRentContractStatus.READY_FOR_PAING.getCode()); |
|
|
|
wxRentContract.setStatuss(statuss); |
|
|
|
} |
|
|
|
return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 一个商户只能存在一个续签合同。如果有计租中的,则取计租中最新的一条,如果没有计租中的,则取正常到期最近的一条 |
|
|
|
* @param wxRentContract |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("getXuQianRentContract") |
|
|
|
@ApiImplicitParams({}) |
|
|
|
@SystemControllerLog(description = "查询续签合同") |
|
|
|
public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); |
|
|
|
wxRentContract.updateTenantInfo(getTenantInfo()); |
|
|
|
List<Integer> statuss = new ArrayList<Integer>(); |
|
|
|
statuss.add(EnumRentContractStatus.PAING.getCode()); |
|
|
|
statuss.add(EnumRentContractStatus.OUT_DATE.getCode()); |
|
|
|
wxRentContract.setStatuss(statuss); |
|
|
|
wxRentContract.setSortColumn(BaseEntity.SortField.Createtime_DESC.getValue()); |
|
|
|
PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, 1, 100000); |
|
|
|
if (null != page && null != page.getList()) { |
|
|
|
List<WxRentContract> painglist = new ArrayList<WxRentContract>(); |
|
|
|
painglist.addAll(page.getList()); |
|
|
|
painglist.stream().filter( p -> p.getStatus().intValue()==EnumRentContractStatus.PAING.getCode().intValue()); |
|
|
|
if (painglist.size()>0) { |
|
|
|
return new ResultData(wxRentContractService.getById(painglist.get(0).getId())); |
|
|
|
}else { |
|
|
|
List<WxRentContract> outdatelist = new ArrayList<WxRentContract>(); |
|
|
|
outdatelist.addAll(page.getList()); |
|
|
|
outdatelist.stream().filter( p -> p.getStatus().intValue()==EnumRentContractStatus.OUT_DATE.getCode().intValue()); |
|
|
|
if (outdatelist.size() > 0 ) { |
|
|
|
return new ResultData(wxRentContractService.getById(outdatelist.get(0).getId())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("getMerchantList") |
|
|
|
@SystemControllerLog(description = "获取商户列表") |
|
|
|
@ApiImplicitParams({ |
|
|
|
|