|
|
|
@@ -1706,8 +1706,51 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
}
|
|
|
|
//PageInfo<WxRentContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.getRentContractList(rentContract));
|
|
|
|
PageInfo<WxRentContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.findList(rentContract));
|
|
|
|
if (null != pageInfo && null != pageInfo.getList()) {
|
|
|
|
List<Long> customersIdList = new ArrayList<Long>();
|
|
|
|
for (int i = 0 ; i < pageInfo.getList().size(); i ++ ){
|
|
|
|
WxRentContract contract = pageInfo.getList().get(i);
|
|
|
|
if (null != contract.getCustomersId()) {
|
|
|
|
customersIdList.add(contract.getCustomersId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<Long,WxContractCustomers> customersMap = getContractCustomersMap(rentContract,customersIdList);
|
|
|
|
|
|
|
|
for (int i = 0 ; i < pageInfo.getList().size(); i ++ ) {
|
|
|
|
WxRentContract 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()+"/";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
merchantName = merchantName + contract.getRentInfoShopNumber();
|
|
|
|
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
|
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
|
|