| @@ -83,52 +83,6 @@ public class WxRentPropertyContractController extends WxContractBaseController { | |||||
| List<Long> floorIds = new ArrayList<Long>(); | List<Long> floorIds = new ArrayList<Long>(); | ||||
| List<Long> buildIds = new ArrayList<Long>(); | List<Long> buildIds = new ArrayList<Long>(); | ||||
| List<Long> shopIds = new ArrayList<Long>(); | List<Long> shopIds = new ArrayList<Long>(); | ||||
| // for (int i = 0 ; i < arrays.size(); i ++) { | |||||
| // JSONObject o = arrays.getJSONObject(i); | |||||
| // try { | |||||
| // floorIds.add(Long.parseLong(o.getString("floor"))); | |||||
| // }catch(Exception e) { | |||||
| // floorName = floorName +","+o.getString("floor"); | |||||
| // } | |||||
| // try { | |||||
| // buildIds.add(Long.parseLong(o.getString("building"))); | |||||
| // }catch(Exception e) { | |||||
| // buildingName = buildingName + ","+ o.getString("building"); | |||||
| // } | |||||
| // try { | |||||
| // shopIds.add(Long.parseLong(o.getString("id"))); | |||||
| // }catch(Exception e) { | |||||
| // shopNumber = shopNumber +","+o.getString("id"); | |||||
| // } | |||||
| // } | |||||
| // | |||||
| // WxMallBuilding bq = new WxMallBuilding(); | |||||
| // bq.setIds(buildIds); | |||||
| // PageInfo<WxMallBuilding> bpage = buildingService.listAsPage(bq, 1, 1000); | |||||
| // if (null != bpage && null != bpage.getList()) { | |||||
| // for (WxMallBuilding wmb : bpage.getList()) { | |||||
| // buildingName = buildingName +"," + wmb.getBuildingName(); | |||||
| // } | |||||
| // } | |||||
| // | |||||
| // WxMallFloor fq = new WxMallFloor(); | |||||
| // fq.setIds(floorIds); | |||||
| // PageInfo<WxMallFloor> fpage = floorService.listAsPage(fq, 1, 1000); | |||||
| // if (null != fpage && null != fpage.getList()) { | |||||
| // for (WxMallFloor wmf : fpage.getList()) { | |||||
| // floorName = floorName +"," + wmf.getFloorName(); | |||||
| // } | |||||
| // } | |||||
| // | |||||
| // WxShop ws = new WxShop(); | |||||
| // ws.setIds(shopIds); | |||||
| // PageInfo<WxShop> spage = wxShopService.listAsPage(ws, 1, 1000); | |||||
| // if (null != spage && null != spage.getList()) { | |||||
| // for (WxShop shop : spage.getList()) { | |||||
| // shopNumber = shopNumber+","+shop.getShopNumber(); | |||||
| // } | |||||
| // } | |||||
| wrc.setFloorName(floorName); | wrc.setFloorName(floorName); | ||||
| wrc.setBuildingName(buildingName); | wrc.setBuildingName(buildingName); | ||||
| wrc.setShopNumber(shopNumber); | wrc.setShopNumber(shopNumber); | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.domain.vo; | package com.iformall.domain.vo; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| @@ -21,6 +22,8 @@ public class WxRentPropertyContractVo extends TenantEntity { | |||||
| private Long rentId; | private Long rentId; | ||||
| private Long propertyId; | private Long propertyId; | ||||
| private Long customersId; | |||||
| private String floorName; | private String floorName; | ||||
| private String buildingName; | private String buildingName; | ||||
| @@ -104,5 +107,8 @@ public class WxRentPropertyContractVo extends TenantEntity { | |||||
| private String queryShopNumber; | private String queryShopNumber; | ||||
| @TableField(exist = false) | |||||
| private String merchantName; | |||||
| } | } | ||||
| @@ -4,14 +4,17 @@ import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxAllBill; | import com.iformall.domain.po.WxAllBill; | ||||
| import com.iformall.domain.po.WxContractCustomers; | |||||
| import com.iformall.domain.po.WxFlowRecord; | import com.iformall.domain.po.WxFlowRecord; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | import com.iformall.domain.vo.WxRentPropertyContractVo; | ||||
| import com.iformall.enums.EnumContract; | import com.iformall.enums.EnumContract; | ||||
| import com.iformall.enums.EnumContractOperationType; | import com.iformall.enums.EnumContractOperationType; | ||||
| import com.iformall.enums.EnumContractType; | import com.iformall.enums.EnumContractType; | ||||
| import com.iformall.enums.EnumRentShopType; | import com.iformall.enums.EnumRentShopType; | ||||
| import com.iformall.mapper.WxContractCustomersMapper; | |||||
| import com.iformall.mapper.WxPropertyContractMapper; | import com.iformall.mapper.WxPropertyContractMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.service.WxAgileContractService; | import com.iformall.service.WxAgileContractService; | ||||
| @@ -45,6 +48,9 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||||
| @Autowired | @Autowired | ||||
| WxPropertyContractMapper wxPropertyContractMapper; | WxPropertyContractMapper wxPropertyContractMapper; | ||||
| @Autowired | |||||
| WxContractCustomersMapper wxContractCustomersMapper; | |||||
| @Autowired | @Autowired | ||||
| WxPropertyContractService wxPropertyContractService; | WxPropertyContractService wxPropertyContractService; | ||||
| @@ -71,7 +77,51 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||||
| }else { | }else { | ||||
| record.setIds(ids); | record.setIds(ids); | ||||
| } | } | ||||
| return 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 ) { | |||||
| List<Long> customersIdList = new ArrayList<Long>(); | |||||
| for (int i = 0 ; i < pageInfo.getList().size(); i ++ ){ | |||||
| WxRentPropertyContractVo contract = pageInfo.getList().get(i); | |||||
| if (null != contract.getCustomersId()) { | |||||
| customersIdList.add(contract.getCustomersId()); | |||||
| } | |||||
| } | |||||
| Map<Long,WxContractCustomers> customersMap = getContractCustomersMap(record,customersIdList); | |||||
| for (int i = 0 ; i < pageInfo.getList().size(); i ++ ) { | |||||
| WxRentPropertyContractVo contract = pageInfo.getList().get(i); | |||||
| String merchantName = ""; | |||||
| if (null != customersMap && null != contract.getCustomersId()) { | |||||
| WxContractCustomers cc = customersMap.get(contract.getCustomersId()); | |||||
| if (null != cc) { | |||||
| merchantName = merchantName + cc.getName(); | |||||
| } | |||||
| } | |||||
| contract.setMerchantName(merchantName); | |||||
| } | |||||
| } | |||||
| return pageInfo; | |||||
| } | |||||
| private Map<Long,WxContractCustomers> getContractCustomersMap(TenantEntity tenantEntity,List<Long> customerIds) { | |||||
| WxContractCustomers ccq = new WxContractCustomers(); | |||||
| ccq.updateTenantInfo(tenantEntity); | |||||
| ccq.setIds(customerIds); | |||||
| List<WxContractCustomers> cclist = wxContractCustomersMapper.findList(ccq); | |||||
| if (null != cclist && cclist.size() > 0 ){ | |||||
| Map<Long,WxContractCustomers> map = new HashMap<Long,WxContractCustomers>(); | |||||
| for (int i = 0 ; i < cclist.size() ; i ++ ) { | |||||
| WxContractCustomers cc = cclist.get(i); | |||||
| if (null != cc) { | |||||
| map.put(cc.getId(),cc); | |||||
| } | |||||
| } | |||||
| return map; | |||||
| } | |||||
| return null; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -249,7 +249,8 @@ | |||||
| <resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo"> | <resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo"> | ||||
| <id column="id" property="id"/> | <id column="id" property="id"/> | ||||
| <result column="tenant_id" property="tenantId"/> | <result column="tenant_id" property="tenantId"/> | ||||
| <result column="parent_tenant_id" property="parentTenantId"/> | |||||
| <result column="parent_tenant_id" property="parentTenantId"/> | |||||
| <result column="customers_id" jdbcType="BIGINT" property="customersId"/> | |||||
| <result column="rent_id" property="rentId"/> | <result column="rent_id" property="rentId"/> | ||||
| <result column="property_id" property="propertyId"/> | <result column="property_id" property="propertyId"/> | ||||
| <result column="rent_info" property="rentInfo"/> | <result column="rent_info" property="rentInfo"/> | ||||
| @@ -277,7 +278,7 @@ | |||||
| <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> | <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> | ||||
| select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.id as rent_id, pc.id as property_id, rc.rental_start_date,rc.rental_end_date,rc.`status`, | |||||
| select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.customers_id,rc.id as rent_id, pc.id as property_id, rc.rental_start_date,rc.rental_end_date,rc.`status`, | |||||
| rc.price as rent_price,rc.contract_number,rc.type,rc.apply_status,rc.price_detail,rc.revenue_fixed_rent_price,rc.revenue_rent_price, | rc.price as rent_price,rc.contract_number,rc.type,rc.apply_status,rc.price_detail,rc.revenue_fixed_rent_price,rc.revenue_rent_price, | ||||
| rc.rent_info,pc.price as property_price,pc.`status` as property_status, | rc.rent_info,pc.price as property_price,pc.`status` as property_status, | ||||
| rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute,rc.free_period_remark, | rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute,rc.free_period_remark, | ||||