|
|
|
@@ -64,6 +64,7 @@ import com.iformall.enums.EnumRentContractType; |
|
|
|
import com.iformall.enums.EnumRentDayPriceCalcute; |
|
|
|
import com.iformall.enums.EnumRentShopType; |
|
|
|
import com.iformall.enums.EnumRentStartType; |
|
|
|
import com.iformall.enums.EnumShopStatus; |
|
|
|
import com.iformall.enums.EnumShopUsersStatus; |
|
|
|
import com.iformall.enums.EnumShopUsersType; |
|
|
|
import com.iformall.enums.EnumSystemUserType; |
|
|
|
@@ -1524,96 +1525,86 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
return new ResultData(Result.SUCCESS, "操作成功"); |
|
|
|
} |
|
|
|
|
|
|
|
// @Override |
|
|
|
// public PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageIndex, Integer pageSize) { |
|
|
|
// 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); |
|
|
|
// if (null == contractIds || contractIds.size() <= 0 ) { |
|
|
|
// rentContract.setId(-1L); |
|
|
|
// } else { |
|
|
|
// 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.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(); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// contract.setMerchantName(merchantName); |
|
|
|
// } |
|
|
|
// |
|
|
|
// } |
|
|
|
// return pageInfo; |
|
|
|
// } |
|
|
|
// |
|
|
|
// private Map<Long,WxContractCustomers> getContractCustomersMap(TenantEntity tenantEntity,List<Long> customerIds) { |
|
|
|
// if (null == customerIds || customerIds.size() <= 0 ) { |
|
|
|
// return null; |
|
|
|
// } |
|
|
|
// 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 PageInfo<WxRentContract> getRenevueContractList(WxRentContract rentContract, Integer pageIndex, Integer pageSize) { |
|
|
|
if (StringUtils.isNotBlank(rentContract.getFloorForRule()) || StringUtils.isNotBlank(rentContract.getShopNumber())) { |
|
|
|
List<Long> shopIdList = null; |
|
|
|
if (StringUtils.isNotBlank(rentContract.getShopNumber())) { |
|
|
|
WxShop sq = new WxShop(); |
|
|
|
sq.updateTenantInfo(rentContract); |
|
|
|
sq.setShopNumber(rentContract.getShopNumber()); |
|
|
|
sq.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
|
shopIdList = wxShopMapper.findIdList(sq); |
|
|
|
} |
|
|
|
|
|
|
|
List<Long> contractIds = wxAgileContractService.findBuildingFloorContractIds(rentContract, rentContract.getFloorForRule(), null, null, shopIdList, 0); |
|
|
|
if (null == contractIds || contractIds.size() <= 0 ) { |
|
|
|
rentContract.setId(-1L); |
|
|
|
} else { |
|
|
|
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.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(); |
|
|
|
} |
|
|
|
} |
|
|
|
contract.setMerchantName(merchantName); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return pageInfo; |
|
|
|
} |
|
|
|
|
|
|
|
private Map<Long,WxContractCustomers> getContractCustomersMap(TenantEntity tenantEntity,List<Long> customerIds) { |
|
|
|
if (null == customerIds || customerIds.size() <= 0 ) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
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}) |
|
|
|
|