| @@ -272,4 +272,7 @@ public class WxMerchant extends BaseEntity { | |||||
| @SortColumn(column = "consumeCount") | @SortColumn(column = "consumeCount") | ||||
| private String consumeCount; | private String consumeCount; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "1已关联合同", name = "hasContract") | |||||
| @TableField(exist = false) | |||||
| private Integer hasContract; | |||||
| } | } | ||||
| @@ -0,0 +1,37 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumHasContract { | |||||
| NO(0, "无"), | |||||
| HAS(1, "有"), | |||||
| ; | |||||
| public static EnumHasContract getEnum(Integer code) { | |||||
| for (EnumHasContract value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumHasContract(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -21,6 +21,8 @@ import com.iformall.mapper.*; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import com.iformall.utils.EventUtil; | import com.iformall.utils.EventUtil; | ||||
| import jodd.util.CollectionUtil; | |||||
| import org.apache.commons.collections.CollectionUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -748,6 +750,16 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| merchant.setShoplist(shops); | merchant.setShoplist(shops); | ||||
| } | } | ||||
| WxRentContract rc = new WxRentContract(); | |||||
| rc.setMerchantId(record.getId()); | |||||
| rc.setTenantId(record.getTenantId()); | |||||
| List<WxRentContract> rentContractList = wxRentContractMapper.findList(rc); | |||||
| if(CollectionUtils.isEmpty(rentContractList)){ | |||||
| merchant.setHasContract(EnumHasContract.NO.getCode()); | |||||
| }else{ | |||||
| merchant.setHasContract(EnumHasContract.HAS.getCode()); | |||||
| } | |||||
| } | } | ||||
| PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants); | PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants); | ||||
| return pageInfo; | return pageInfo; | ||||
| @@ -498,7 +498,7 @@ | |||||
| </if> | </if> | ||||
| <if test="null!=status and status==1 and type!=null and type==2"> | <if test="null!=status and status==1 and type!=null and type==2"> | ||||
| and s.id not in( | and s.id not in( | ||||
| SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status in(1,2,3,4) | |||||
| SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status in(1,2,3,4,8) | |||||
| and rent_shop_type=2 | and rent_shop_type=2 | ||||
| ) | ) | ||||
| </if> | </if> | ||||