| @@ -2,8 +2,10 @@ package com.iformall.domain.vo.invest; | |||||
| import com.iformall.enums.EnumCustomerType; | import com.iformall.enums.EnumCustomerType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestDemandQuery extends InvestPageQuery { | public class InvestDemandQuery extends InvestPageQuery { | ||||
| /** | /** | ||||
| @@ -2,8 +2,10 @@ package com.iformall.domain.vo.invest; | |||||
| import com.iformall.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestFollowQuery extends InvestPageQuery { | public class InvestFollowQuery extends InvestPageQuery { | ||||
| /** | /** | ||||
| @@ -1,8 +1,10 @@ | |||||
| package com.iformall.domain.vo.invest; | package com.iformall.domain.vo.invest; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestMessageQuery extends InvestPageQuery { | public class InvestMessageQuery extends InvestPageQuery { | ||||
| /** | /** | ||||
| @@ -2,8 +2,10 @@ package com.iformall.domain.vo.invest; | |||||
| import com.iformall.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestOperateRecordQuery extends InvestPageQuery { | public class InvestOperateRecordQuery extends InvestPageQuery { | ||||
| /** | /** | ||||
| @@ -2,8 +2,10 @@ package com.iformall.domain.vo.invest; | |||||
| import com.iformall.enums.EnumRemindDateType; | import com.iformall.enums.EnumRemindDateType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestRemindQuery extends InvestPageQuery { | public class InvestRemindQuery extends InvestPageQuery { | ||||
| /** | /** | ||||
| @@ -2,8 +2,10 @@ package com.iformall.domain.vo.invest; | |||||
| import com.iformall.enums.EnumTaskStatus; | import com.iformall.enums.EnumTaskStatus; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestTaskQuery extends InvestPageQuery { | public class InvestTaskQuery extends InvestPageQuery { | ||||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | ||||
| @@ -64,21 +64,27 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| customerParams = queryParams.getCustomer(); | customerParams = queryParams.getCustomer(); | ||||
| demandParams = queryParams.getDemand(); | demandParams = queryParams.getDemand(); | ||||
| } | } | ||||
| InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>(); | InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>(); | ||||
| LambdaQueryWrapper<InvestDemandEntity> queryWrapperDemand = new LambdaQueryWrapper<>(demandParams); | |||||
| InvestPageResult<InvestCustomerEntity> customers = customerService.queryPage(buildPageQuery(params, customerParams)); | |||||
| if (CollectionUtils.isEmpty(customers.getRecords())) { | |||||
| return investPage; | |||||
| List<InvestDemandEntity> demandList = demandService.list(new LambdaQueryWrapper<>(demandParams)); | |||||
| LambdaQueryWrapper<InvestCustomerEntity> queryWrapperCustomer = new LambdaQueryWrapper<>(customerParams); | |||||
| InvestPageResult<InvestCustomerEntity> customers; | |||||
| if (Objects.isNull(InvestUserContext.getDataUser())) { | |||||
| queryWrapperCustomer.in(ObjectUtils.allNotNull(params.getDemandOwner()),InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); | |||||
| } else { | |||||
| if(CollectionUtils.isEmpty(demandList)) { | |||||
| return investPage; | |||||
| } else { | |||||
| queryWrapperCustomer.in(InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); | |||||
| } | |||||
| } | } | ||||
| queryWrapperDemand.in(InvestDemandEntity::getCustomerId, getIds(customers.getRecords(), InvestCustomerEntity::getId)); | |||||
| List<InvestDemandEntity> demandList = demandService.list(queryWrapperDemand); | |||||
| customers = customerService.queryPage(buildPageQuery(params, null), queryWrapperCustomer); | |||||
| List<InvestDemandVo> resultList = getTargeInfoList(demandList, customers.getRecords()); | List<InvestDemandVo> resultList = getTargeInfoList(demandList, customers.getRecords()); | ||||
| BeanUtils.copyProperties(customers, investPage); | BeanUtils.copyProperties(customers, investPage); | ||||
| investPage.setRecords(resultList); | investPage.setRecords(resultList); | ||||
| if (CollectionUtils.isEmpty(customers.getRecords())) { | |||||
| return investPage; | |||||
| } | |||||
| return investPage; | return investPage; | ||||
| } | } | ||||