winter 1 год назад
Родитель
Сommit
6967f9135b
4 измененных файлов: 91 добавлений и 93 удалений
  1. +7
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  4. +81
    -90
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 7
- 2
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Просмотреть файл

@@ -258,6 +258,12 @@ public class WxRentContractController extends WxContractBaseController {
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData getRevenueContractList(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) {
if (null == wxRentContract) wxRentContract = new WxRentContract();
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxRentContract.setFloorForRule(dataRule.getFloorIds());
wxRentContract.setBusinessForRule(dataRule.getBussinessIds());
wxRentContract.setShopTypeForRule(dataRule.getShopTypes());
}
wxRentContract.updateTenantInfo(getTenantInfo());
List<Integer> typeList = new ArrayList<Integer>();
typeList.add(EnumRentContractType.RENT_BY_JOINT.getCode());
@@ -269,8 +275,7 @@ public class WxRentContractController extends WxContractBaseController {
//statusList.add(EnumRentContractStatus.READY_FOR_PAING.getCode());
wxRentContract.setStatuss(statusList);
wxRentContract.setSortColumns(SortField.Createtime_DESC);
//return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize));
return new ResultData();
return new ResultData(wxRentContractService.getRenevueContractList(wxRentContract, pageNum, pageSize));
}
//查询联营扣点,联营取高的合同账单周期


+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java Просмотреть файл

@@ -372,5 +372,7 @@ public class WxRentContract extends TenantEntity {
private List<Long> calcuteShopIds;
@TableField(exist = false)
private Integer calcuteIsProperty;
@TableField(exist = false)
private String shopNumber;
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java Просмотреть файл

@@ -80,7 +80,7 @@ public interface WxRentContractService {

ResultData updateRentContract(WxRentContract wxRentContract);

//PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize);
PageInfo<WxRentContract> getRenevueContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize);

//void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId);



+ 81
- 90
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -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})


Загрузка…
Отмена
Сохранить