Commit c9f8bdc8 authored by zhengyi's avatar zhengyi

客户列表相关查询返回客户最新跟进记录

parent 1ac03b4d
...@@ -118,9 +118,6 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, ...@@ -118,9 +118,6 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
@Resource @Resource
private CustomerMapper customerMapper; private CustomerMapper customerMapper;
@Resource
private CustomerFollowupService customerFollowupService;
@Resource @Resource
private ParamValidatorService paramValidatorService; private ParamValidatorService paramValidatorService;
...@@ -1183,17 +1180,6 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, ...@@ -1183,17 +1180,6 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
int start = (page.getPage() - 1) * page.getRows(); int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows(); int size = page.getRows();
List<CustomerDO> list = customerMapper.getMyPage(start, size, pageReqVO); List<CustomerDO> list = customerMapper.getMyPage(start, size, pageReqVO);
if (CollectionUtil.isNotEmpty(list)) {
for (CustomerDO customerDO : list) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getCustomerId, customerDO.getId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
customerDO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
long total = customerMapper.getMyPageCount(pageReqVO); long total = customerMapper.getMyPageCount(pageReqVO);
return new PageResult<>(list, total, return new PageResult<>(list, total,
mpPage.getSize(), page.getPage(), mpPage.getSize(), page.getPage(),
......
...@@ -20,12 +20,14 @@ import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; ...@@ -20,12 +20,14 @@ import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import cn.iocoder.yudao.module.customer.convert.customer.CustomerConvert; import cn.iocoder.yudao.module.customer.convert.customer.CustomerConvert;
import cn.iocoder.yudao.module.customer.convert.customerBank.CustomerBankConvert; import cn.iocoder.yudao.module.customer.convert.customerBank.CustomerBankConvert;
import cn.iocoder.yudao.module.customer.convert.customerContacts.CustomerContactsConvert; import cn.iocoder.yudao.module.customer.convert.customerContacts.CustomerContactsConvert;
import cn.iocoder.yudao.module.customer.convert.customerFollowup.CustomerFollowupConvert;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.commission.CustomerCommissionDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.commission.CustomerCommissionDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.complaint.CustomerComplaintDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.complaint.CustomerComplaintDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerBank.CustomerBankDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customerBank.CustomerBankDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO;
import cn.iocoder.yudao.module.customer.dal.mysql.customerDetail.CustomerDetailMapper; import cn.iocoder.yudao.module.customer.dal.mysql.customerDetail.CustomerDetailMapper;
import cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto; import cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto;
import cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO; import cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO;
...@@ -38,6 +40,7 @@ import cn.iocoder.yudao.module.customer.service.customer.complaint.follow.Custom ...@@ -38,6 +40,7 @@ import cn.iocoder.yudao.module.customer.service.customer.complaint.follow.Custom
import cn.iocoder.yudao.module.customer.service.customerBank.CustomerBankService; import cn.iocoder.yudao.module.customer.service.customerBank.CustomerBankService;
import cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService; import cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService;
import cn.iocoder.yudao.module.customer.service.customerCredit.CustomerCreditService; import cn.iocoder.yudao.module.customer.service.customerCredit.CustomerCreditService;
import cn.iocoder.yudao.module.customer.service.customerFollowup.CustomerFollowupService;
import cn.iocoder.yudao.module.customer.service.customerLevel.CustomerLevelService; import cn.iocoder.yudao.module.customer.service.customerLevel.CustomerLevelService;
import cn.iocoder.yudao.module.customer.service.customerLevelLog.CustomerLevelLogServiceImpl; import cn.iocoder.yudao.module.customer.service.customerLevelLog.CustomerLevelLogServiceImpl;
import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService; import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService;
...@@ -117,7 +120,8 @@ public class CustomerController { ...@@ -117,7 +120,8 @@ public class CustomerController {
@Resource @Resource
private CustomerService customerService; private CustomerService customerService;
@Resource
private CustomerFollowupService customerFollowupService;
@Resource @Resource
private CustomerMergeService customerMergeService; private CustomerMergeService customerMergeService;
...@@ -528,7 +532,19 @@ public class CustomerController { ...@@ -528,7 +532,19 @@ public class CustomerController {
PageResult<CustomerDO> pageResult = PageResult<CustomerDO> pageResult =
customerService.getWaitToConfirmCustomerPageReq(customerPageReqVO, customerService.getWaitToConfirmCustomerPageReq(customerPageReqVO,
page); page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult)); PageResult<CustomerRespVO> respVOPageResult = CustomerConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(respVOPageResult.getList())) {
for (CustomerRespVO respVO : respVOPageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getCustomerId, respVO.getId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(respVOPageResult);
} }
private Integer getCustomerTime(String customers_to_be_assigned, int i) { private Integer getCustomerTime(String customers_to_be_assigned, int i) {
...@@ -552,7 +568,19 @@ public class CustomerController { ...@@ -552,7 +568,19 @@ public class CustomerController {
//PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageVO); //PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageVO);
PageResult<CustomerDO> pageResult = customerService.getMyCustomerPage(pageVO, page); PageResult<CustomerDO> pageResult = customerService.getMyCustomerPage(pageVO, page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult)); PageResult<CustomerRespVO> respVOPageResult = CustomerConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(respVOPageResult.getList())) {
for (CustomerRespVO respVO : respVOPageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getCustomerId, respVO.getId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(respVOPageResult);
} }
@GetMapping("/get-wait-for-distribution") @GetMapping("/get-wait-for-distribution")
...@@ -562,7 +590,19 @@ public class CustomerController { ...@@ -562,7 +590,19 @@ public class CustomerController {
// //
PageResult<CustomerDO> pageResult = PageResult<CustomerDO> pageResult =
customerService.getWaitToAssignedCustomerPageReq(customerPageReqVO, page); customerService.getWaitToAssignedCustomerPageReq(customerPageReqVO, page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult)); PageResult<CustomerRespVO> respVOPageResult = CustomerConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(respVOPageResult.getList())) {
for (CustomerRespVO respVO : respVOPageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getCustomerId, respVO.getId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(respVOPageResult);
} }
@GetMapping("/get-public") @GetMapping("/get-public")
...@@ -572,7 +612,19 @@ public class CustomerController { ...@@ -572,7 +612,19 @@ public class CustomerController {
PageResult<CustomerDO> pageResult = PageResult<CustomerDO> pageResult =
customerService.getOpenSeaCustomerPageReq(customerPageReqVO, page); customerService.getOpenSeaCustomerPageReq(customerPageReqVO, page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult)); PageResult<CustomerRespVO> respVOPageResult = CustomerConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(respVOPageResult.getList())) {
for (CustomerRespVO respVO : respVOPageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getCustomerId, respVO.getId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(respVOPageResult);
} }
@GetMapping("/delay/approval/info") @GetMapping("/delay/approval/info")
...@@ -673,7 +725,19 @@ public class CustomerController { ...@@ -673,7 +725,19 @@ public class CustomerController {
// customerPageReqVO.setFlag4QueryCondition("Y"); // customerPageReqVO.setFlag4QueryCondition("Y");
PageResult<CustomerDO> pageResult = customerService.getMyCustomerPage(customerPageReqVO, page); PageResult<CustomerDO> pageResult = customerService.getMyCustomerPage(customerPageReqVO, page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult)); PageResult<CustomerRespVO> respVOPageResult = CustomerConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(respVOPageResult.getList())) {
for (CustomerRespVO respVO : respVOPageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getCustomerId, respVO.getId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(respVOPageResult);
} }
@PutMapping("/confirm") @PutMapping("/confirm")
...@@ -752,7 +816,19 @@ public class CustomerController { ...@@ -752,7 +816,19 @@ public class CustomerController {
//PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageVO); //PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageVO);
PageResult<CustomerDO> pageResult = PageResult<CustomerDO> pageResult =
customerService.getMyCustomerPage(pageVO, page); customerService.getMyCustomerPage(pageVO, page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult)); PageResult<CustomerRespVO> respVOPageResult = CustomerConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(respVOPageResult.getList())) {
for (CustomerRespVO respVO : respVOPageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getCustomerId, respVO.getId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(respVOPageResult);
} }
@GetMapping("/deptPage") @GetMapping("/deptPage")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment