| @@ -351,5 +351,9 @@ public class WxPropertyContract extends TenantEntity { | |||||
| private Long queryShopId; | private Long queryShopId; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String merchantName; | private String merchantName; | ||||
| @TableField(exist = false) | |||||
| private String queryShopIdStr; | |||||
| @TableField(exist = false) | |||||
| private List<Long> customersIdList; | |||||
| } | } | ||||
| @@ -570,5 +570,9 @@ public class WxRentContract extends TenantEntity { | |||||
| private Date salesEndTime; | private Date salesEndTime; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String merchantName; | private String merchantName; | ||||
| @TableField(exist = false) | |||||
| private String queryShopIdStr; | |||||
| @TableField(exist = false) | |||||
| private List<Long> customersIdList; | |||||
| } | } | ||||
| @@ -109,6 +109,10 @@ public class WxRentPropertyContractVo extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String merchantName; | private String merchantName; | ||||
| @TableField(exist = false) | |||||
| private String queryShopIdStr; | |||||
| @TableField(exist = false) | |||||
| private List<Long> customersIdList; | |||||
| } | } | ||||
| @@ -12,5 +12,7 @@ public interface WxContractCustomersMapper extends CommonMapper<WxContractCustom | |||||
| List<WxContractCustomers> findList(WxContractCustomers wxShop); | List<WxContractCustomers> findList(WxContractCustomers wxShop); | ||||
| List<Long> findIdList(WxContractCustomers wxShop); | |||||
| WxContractCustomers selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | WxContractCustomers selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | ||||
| } | } | ||||
| @@ -111,8 +111,25 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| @Override | @Override | ||||
| public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | ||||
| if (StringUtils.isNotBlank(record.getFloorForRule())) { | |||||
| List<Long> contractIds = wxAgileContractService.findBuildingFloorContractIds(record, record.getFloorForRule(), null, null, null, 0); | |||||
| if (StringUtils.isNotBlank(record.getFloorForRule()) || StringUtils.isNotBlank(record.getQueryShopIdStr())) { | |||||
| List<Long> shopIdList = null; | |||||
| if (StringUtils.isNotBlank(record.getQueryShopIdStr())) { | |||||
| String[] qsids = record.getQueryShopIdStr().split(","); | |||||
| if (null != qsids && qsids.length > 0 ) { | |||||
| shopIdList = new ArrayList<Long>(); | |||||
| for (int i = 0 ; i < qsids.length ; i ++) { | |||||
| String qsid = qsids[i]; | |||||
| if (StringUtils.isNotBlank(qsid)) { | |||||
| shopIdList.add(Long.parseLong(qsid)); | |||||
| } | |||||
| } | |||||
| if (shopIdList.size() <= 0 ) { | |||||
| shopIdList = null; | |||||
| } | |||||
| } | |||||
| } | |||||
| List<Long> contractIds = wxAgileContractService.findBuildingFloorContractIds(record, record.getFloorForRule(), null, null, shopIdList, 0); | |||||
| //List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(record, record.getFloorForRule() , null, null,record.getShopTypeForRule(), 0, 0,null); | //List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(record, record.getFloorForRule() , null, null,record.getShopTypeForRule(), 0, 0,null); | ||||
| if (null == contractIds || contractIds.size() <= 0 ) { | if (null == contractIds || contractIds.size() <= 0 ) { | ||||
| record.setId(-1L); | record.setId(-1L); | ||||
| @@ -120,6 +137,20 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| record.setIds(contractIds); | record.setIds(contractIds); | ||||
| } | } | ||||
| } | } | ||||
| //根据客户名称查询 | |||||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||||
| WxContractCustomers ccq = new WxContractCustomers(); | |||||
| ccq.updateTenantInfo(record); | |||||
| ccq.setName(record.getMerchantName()); | |||||
| List<Long> customersIdList = wxContractCustomersMapper.findIdList(ccq); | |||||
| if (null != customersIdList && customersIdList.size() > 0 ) { | |||||
| record.setCustomersIdList(customersIdList); | |||||
| }else { | |||||
| record.setId(-1L); | |||||
| } | |||||
| } | |||||
| PageInfo<WxPropertyContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPropertyContractMapper.findList(record)); | PageInfo<WxPropertyContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPropertyContractMapper.findList(record)); | ||||
| if (null != pageInfo && null != pageInfo.getList() && pageInfo.getList().size() > 0 ) { | if (null != pageInfo && null != pageInfo.getList() && pageInfo.getList().size() > 0 ) { | ||||
| List<Long> customersIdList = new ArrayList<Long>(); | List<Long> customersIdList = new ArrayList<Long>(); | ||||
| @@ -1704,8 +1704,25 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageIndex, Integer pageSize) { | public PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageIndex, Integer pageSize) { | ||||
| if (StringUtils.isNoneBlank(rentContract.getFloorForRule())) { | |||||
| List<Long> contractIds = wxAgileContractService.findBuildingFloorContractIds(rentContract, rentContract.getFloorForRule(), null, null, null, 0); | |||||
| if (StringUtils.isNotBlank(rentContract.getFloorForRule()) || StringUtils.isNotBlank(rentContract.getQueryShopIdStr())) { | |||||
| List<Long> shopIdList = null; | |||||
| if (StringUtils.isNotBlank(rentContract.getQueryShopIdStr())) { | |||||
| String[] qsids = rentContract.getQueryShopIdStr().split(","); | |||||
| if (null != qsids && qsids.length > 0 ) { | |||||
| shopIdList = new ArrayList<Long>(); | |||||
| for (int i = 0 ; i < qsids.length ; i ++) { | |||||
| String qsid = qsids[i]; | |||||
| if (StringUtils.isNotBlank(qsid)) { | |||||
| shopIdList.add(Long.parseLong(qsid)); | |||||
| } | |||||
| } | |||||
| if (shopIdList.size() <= 0 ) { | |||||
| shopIdList = null; | |||||
| } | |||||
| } | |||||
| } | |||||
| List<Long> contractIds = wxAgileContractService.findBuildingFloorContractIds(rentContract, rentContract.getFloorForRule(), null, null, shopIdList, 0); | |||||
| //List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(rentContract, rentContract.getFloorForRule() , null, null,rentContract.getShopTypeForRule(), 0, 0,null); | //List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(rentContract, rentContract.getFloorForRule() , null, null,rentContract.getShopTypeForRule(), 0, 0,null); | ||||
| if (null == contractIds || contractIds.size() <= 0 ) { | if (null == contractIds || contractIds.size() <= 0 ) { | ||||
| rentContract.setId(-1L); | rentContract.setId(-1L); | ||||
| @@ -1713,6 +1730,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| rentContract.setIds(contractIds); | rentContract.setIds(contractIds); | ||||
| } | } | ||||
| } | } | ||||
| //根据客户名称查询 | |||||
| if (StringUtils.isNotBlank(rentContract.getMerchantName())) { | |||||
| WxContractCustomers ccq = new WxContractCustomers(); | |||||
| ccq.updateTenantInfo(rentContract); | |||||
| ccq.setName(rentContract.getMerchantName()); | |||||
| List<Long> customersIdList = wxContractCustomersMapper.findIdList(ccq); | |||||
| if (null != customersIdList && customersIdList.size() > 0 ) { | |||||
| rentContract.setCustomersIdList(customersIdList); | |||||
| }else { | |||||
| rentContract.setId(-1L); | |||||
| } | |||||
| } | |||||
| //PageInfo<WxRentContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.getRentContractList(rentContract)); | //PageInfo<WxRentContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.getRentContractList(rentContract)); | ||||
| PageInfo<WxRentContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.findList(rentContract)); | PageInfo<WxRentContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.findList(rentContract)); | ||||
| if (null != pageInfo && null != pageInfo.getList()) { | if (null != pageInfo && null != pageInfo.getList()) { | ||||
| @@ -25,6 +25,7 @@ import com.iformall.service.WxRentContractService; | |||||
| import com.iformall.service.WxRentPropertyContractService; | import com.iformall.service.WxRentPropertyContractService; | ||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -71,12 +72,45 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||||
| @Override | @Override | ||||
| public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | ||||
| List<Long> ids = wxAgileContractService.findBuildingFloorContractIds(record, record.getFloorForRule(), null, null, null, 0); | |||||
| if (null == ids || ids.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| record.setIds(ids); | |||||
| if (StringUtils.isNotBlank(record.getFloorForRule()) || StringUtils.isNotBlank(record.getQueryShopIdStr())) { | |||||
| List<Long> shopIdList = null; | |||||
| if (StringUtils.isNotBlank(record.getQueryShopIdStr())) { | |||||
| String[] qsids = record.getQueryShopIdStr().split(","); | |||||
| if (null != qsids && qsids.length > 0 ) { | |||||
| shopIdList = new ArrayList<Long>(); | |||||
| for (int i = 0 ; i < qsids.length ; i ++) { | |||||
| String qsid = qsids[i]; | |||||
| if (StringUtils.isNotBlank(qsid)) { | |||||
| shopIdList.add(Long.parseLong(qsid)); | |||||
| } | |||||
| } | |||||
| if (shopIdList.size() <= 0 ) { | |||||
| shopIdList = null; | |||||
| } | |||||
| } | |||||
| } | |||||
| List<Long> contractIds = wxAgileContractService.findBuildingFloorContractIds(record, record.getFloorForRule(), null, null, shopIdList, 0); | |||||
| //List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(rentContract, rentContract.getFloorForRule() , null, null,rentContract.getShopTypeForRule(), 0, 0,null); | |||||
| if (null == contractIds || contractIds.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| } else { | |||||
| record.setIds(contractIds); | |||||
| } | |||||
| } | } | ||||
| //根据客户名称查询 | |||||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||||
| WxContractCustomers ccq = new WxContractCustomers(); | |||||
| ccq.updateTenantInfo(record); | |||||
| ccq.setName(record.getMerchantName()); | |||||
| List<Long> customersIdList = wxContractCustomersMapper.findIdList(ccq); | |||||
| if (null != customersIdList && customersIdList.size() > 0 ) { | |||||
| record.setCustomersIdList(customersIdList); | |||||
| }else { | |||||
| record.setId(-1L); | |||||
| } | |||||
| } | |||||
| PageInfo<WxRentPropertyContractVo> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); | PageInfo<WxRentPropertyContractVo> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); | ||||
| if (null != pageInfo && null != pageInfo.getList() && pageInfo.getList().size() > 0 ) { | if (null != pageInfo && null != pageInfo.getList() && pageInfo.getList().size() > 0 ) { | ||||
| List<Long> customersIdList = new ArrayList<Long>(); | List<Long> customersIdList = new ArrayList<Long>(); | ||||
| @@ -76,6 +76,12 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxContractCustomers" resultType="Long"> | |||||
| select id | |||||
| from wx_contract_customers | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| @@ -122,6 +122,13 @@ | |||||
| and business_id in (${businessForRule}) | and business_id in (${businessForRule}) | ||||
| </if> | </if> | ||||
| <if test=" null != customersIdList "> | |||||
| and customers_id in | |||||
| <foreach collection="customersIdList" index="index" item="cusItem" open="(" separator="," close=")"> | |||||
| #{cusItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -146,6 +146,13 @@ | |||||
| <if test=" null != queryShopId"> | <if test=" null != queryShopId"> | ||||
| and concat(',',shop_id_str,',') like concat('%,',#{queryShopId},',%') | and concat(',',shop_id_str,',') like concat('%,',#{queryShopId},',%') | ||||
| </if> | </if> | ||||
| <if test=" null != customersIdList "> | |||||
| and customers_id in | |||||
| <foreach collection="customersIdList" index="index" item="cusItem" open="(" separator="," close=")"> | |||||
| #{cusItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != statuss "> | <if test=" null != statuss "> | ||||
| and status in | and status in | ||||
| @@ -300,6 +307,13 @@ | |||||
| <if test=" null != propertyId and '' != propertyId"> | <if test=" null != propertyId and '' != propertyId"> | ||||
| and pc.`id` = #{propertyId} | and pc.`id` = #{propertyId} | ||||
| </if> | </if> | ||||
| <if test=" null != customersIdList "> | |||||
| and rc.customers_id in | |||||
| <foreach collection="customersIdList" index="index" item="cusItem" open="(" separator="," close=")"> | |||||
| #{cusItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <!-- <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1"> | <!-- <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1"> | ||||
| and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') | and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') | ||||
| </if> | </if> | ||||