|
|
|
@@ -116,9 +116,50 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
} |
|
|
|
} |
|
|
|
PageInfo<WxPropertyContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPropertyContractMapper.findList(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 ++ ){ |
|
|
|
WxPropertyContract 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 ++ ) { |
|
|
|
WxPropertyContract 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 |
|
|
|
public List<WxPropertyContract> findList(WxPropertyContract record) { |
|
|
|
return wxPropertyContractMapper.findList(record); |
|
|
|
|