| @@ -11,6 +11,7 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillProperty; | import com.iformall.domain.po.WxBillProperty; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.domain.po.base.BaseEntity.SortField; | import com.iformall.domain.po.base.BaseEntity.SortField; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -67,6 +68,11 @@ public class WxPropertyContractController extends WxContractBaseController { | |||||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | wxPropertyContract.updateTenantInfo(getTenantInfo()); | ||||
| Map<String, Object> result = new HashMap<>(); | Map<String, Object> result = new HashMap<>(); | ||||
| wxPropertyContract.setSortColumns(SortField.Createtime_DESC); | wxPropertyContract.setSortColumns(SortField.Createtime_DESC); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxPropertyContract.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxPropertyContract.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| PageInfo<WxPropertyContract> pageInfo = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | PageInfo<WxPropertyContract> pageInfo = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | ||||
| Integer hasFlow = null; | Integer hasFlow = null; | ||||
| if (null != pageInfo && null != pageInfo.getList()) { | if (null != pageInfo && null != pageInfo.getList()) { | ||||
| @@ -77,6 +77,11 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| wxRentContract.setSortColumns(SortField.Createtime_DESC); | wxRentContract.setSortColumns(SortField.Createtime_DESC); | ||||
| //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxRentContract.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxRentContract.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize); | PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize); | ||||
| Integer hasFlow = null; | Integer hasFlow = null; | ||||
| if (null != page && null != page.getList()) { | if (null != page && null != page.getList()) { | ||||
| @@ -7,6 +7,7 @@ import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | import com.iformall.domain.vo.WxRentPropertyContractVo; | ||||
| import com.iformall.service.WxMallBuildingService; | import com.iformall.service.WxMallBuildingService; | ||||
| import com.iformall.service.WxMallFloorService; | import com.iformall.service.WxMallFloorService; | ||||
| @@ -52,6 +53,11 @@ public class WxRentPropertyContractController extends WxContractBaseController { | |||||
| wxRentPropertyContractVo = new WxRentPropertyContractVo(); | wxRentPropertyContractVo = new WxRentPropertyContractVo(); | ||||
| } | } | ||||
| wxRentPropertyContractVo.updateTenantInfo(getTenantInfo()); | wxRentPropertyContractVo.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxRentPropertyContractVo.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxRentPropertyContractVo.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | ||||
| Integer hasFlow = null; | Integer hasFlow = null; | ||||
| if (null != page && null != page.getList()) { | if (null != page && null != page.getList()) { | ||||
| @@ -223,5 +223,8 @@ public class WxPropertyContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | ||||
| private Integer contractType; | private Integer contractType; | ||||
| @TableField(exist = false) | |||||
| private List<Long> merchantIds; | |||||
| } | } | ||||
| @@ -468,5 +468,8 @@ public class WxRentContract extends TenantEntity { | |||||
| } | } | ||||
| return shopList; | return shopList; | ||||
| } | } | ||||
| @TableField(exist = false) | |||||
| private List<Long> merchantIds; | |||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | import lombok.ToString; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| @@ -86,5 +87,7 @@ public class WxRentPropertyContractVo extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | ||||
| private Integer flowHas; | private Integer flowHas; | ||||
| private List<Long> merchantIds; | |||||
| } | } | ||||
| @@ -86,16 +86,20 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxShopService wxShopService; | WxShopService wxShopService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | ||||
| //Object rentContractStatusInfo = getRentContractStatusInfo(record); | |||||
| //PageHelper.startPage(pageIndex, pageSize); | |||||
| //List<Map<String, Object>> rentContractData = wxPropertyContractMapper.queryPropertyContractData(record); | |||||
| //Map<String, Object> result = new HashMap<>(); | |||||
| List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(record, record.getFloorForRule() , null, null, 0, 0); | |||||
| if (null == mids || mids.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| } else { | |||||
| record.setMerchantIds(mids); | |||||
| } | |||||
| PageInfo<WxPropertyContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPropertyContractMapper.findList(record)); | PageInfo<WxPropertyContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPropertyContractMapper.findList(record)); | ||||
| //result.put("rentContractStatusInfo", rentContractStatusInfo); | |||||
| //result.put("pageInfo", pageInfo); | |||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @@ -1812,6 +1812,12 @@ 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) { | ||||
| List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(rentContract, rentContract.getFloorForRule() , null, null, 0, 0); | |||||
| if (null == mids || mids.size() <= 0 ) { | |||||
| rentContract.setId(-1L); | |||||
| } else { | |||||
| rentContract.setMerchantIds(mids); | |||||
| } | |||||
| //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)); | ||||
| return pageInfo; | return pageInfo; | ||||
| @@ -15,12 +15,14 @@ import com.iformall.enums.EnumRentShopType; | |||||
| import com.iformall.mapper.WxPropertyContractMapper; | import com.iformall.mapper.WxPropertyContractMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.service.WxFlowRecordService; | import com.iformall.service.WxFlowRecordService; | ||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxPropertyContractService; | import com.iformall.service.WxPropertyContractService; | ||||
| import com.iformall.service.WxRentContractService; | import com.iformall.service.WxRentContractService; | ||||
| import com.iformall.service.WxRentPropertyContractService; | import com.iformall.service.WxRentPropertyContractService; | ||||
| 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; | ||||
| import org.springframework.context.annotation.Lazy; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| @@ -49,9 +51,19 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||||
| @Autowired | @Autowired | ||||
| WxFlowRecordService wxFlowRecordService; | WxFlowRecordService wxFlowRecordService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | ||||
| List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(record, record.getFloorForRule() , null, null, 0, 0); | |||||
| if (null == mids || mids.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| } else { | |||||
| record.setMerchantIds(mids); | |||||
| } | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); | ||||
| } | } | ||||
| @@ -109,25 +109,10 @@ | |||||
| <if test=" null != businessForRule and '' != businessForRule "> | <if test=" null != businessForRule and '' != businessForRule "> | ||||
| and business_id in (${businessForRule}) | and business_id in (${businessForRule}) | ||||
| </if> | </if> | ||||
| <if test=" null != floorForRule and '' != floorForRule "> | |||||
| and `id` in | |||||
| <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")"> | |||||
| select id from wx_property_contract where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select | |||||
| id from wx_shop where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and floor in (${floorForRule})) | |||||
| <if test=" null != merchantIds "> | |||||
| and merchant_id in | |||||
| <foreach collection="merchantIds" index="index" item="mItem" open="(" separator="," close=")"> | |||||
| #{mItem} | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| @@ -197,25 +197,11 @@ | |||||
| <if test=" null != businessForRule and '' != businessForRule "> | <if test=" null != businessForRule and '' != businessForRule "> | ||||
| and business_id in (${businessForRule}) | and business_id in (${businessForRule}) | ||||
| </if> | </if> | ||||
| <if test="null != floorForRule and '' != floorForRule "> | |||||
| and `id` in | |||||
| <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")"> | |||||
| select id from wx_rent_contract where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select | |||||
| id from wx_shop where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and floor in (${floorForRule})) | |||||
| <if test=" null != merchantIds "> | |||||
| and merchant_id in | |||||
| <foreach collection="merchantIds" index="index" item="mItem" open="(" separator="," close=")"> | |||||
| #{mItem} | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| @@ -432,39 +418,12 @@ | |||||
| <if test=" null != businessForRule and '' != businessForRule "> | <if test=" null != businessForRule and '' != businessForRule "> | ||||
| and rc.business_id in (${businessForRule}) | and rc.business_id in (${businessForRule}) | ||||
| </if> | </if> | ||||
| <if test="null != floorForRule and '' != floorForRule "> | |||||
| and rc.`id` in | |||||
| <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")"> | |||||
| select id from wx_rent_contract where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select | |||||
| id from wx_shop where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and floor in (${floorForRule})) | |||||
| <if test=" null != merchantIds "> | |||||
| and rc.merchant_id in | |||||
| <foreach collection="merchantIds" index="index" item="mItem" open="(" separator="," close=")"> | |||||
| #{mItem} | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <!-- <if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule "> | |||||
| and rc.shop_id in (select id from wx_shop where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and floor in (${floorForRule})) | |||||
| </if> --> | |||||
| </where> | </where> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| <if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if> | <if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if> | ||||