Commit 64f063bf authored by zhengyi's avatar zhengyi

补充客户列表最新跟进记录信息

parent dc53642f
package cn.iocoder.yudao.module.sale.vo.offer; package cn.iocoder.yudao.module.sale.vo.offer;
import cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupBackVO;
import cn.iocoder.yudao.module.depository.dto.LogisticsInfoDto; import cn.iocoder.yudao.module.depository.dto.LogisticsInfoDto;
import cn.iocoder.yudao.module.sale.vo.offer.prod.OfferProdRespVO; import cn.iocoder.yudao.module.sale.vo.offer.prod.OfferProdRespVO;
import cn.iocoder.yudao.module.sale.vo.offer.transport.OfferTransportCreateReqVO; import cn.iocoder.yudao.module.sale.vo.offer.transport.OfferTransportCreateReqVO;
import cn.iocoder.yudao.module.sale.vo.offer.transport.OfferTransportRespVO; import cn.iocoder.yudao.module.sale.vo.offer.transport.OfferTransportRespVO;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*; import lombok.*;
...@@ -90,4 +92,8 @@ public class OfferRespVO extends OfferBaseVO { ...@@ -90,4 +92,8 @@ public class OfferRespVO extends OfferBaseVO {
@ApiModelProperty(value = "业务员名称-客户经理") @ApiModelProperty(value = "业务员名称-客户经理")
private String businessManagerName; private String businessManagerName;
@ApiModelProperty("最新跟进记录信息")
@TableField(exist = false)
private CustomerFollowupBackVO followupBackVO;
} }
...@@ -2,8 +2,13 @@ package cn.iocoder.yudao.module.sale.controller.admin.offer; ...@@ -2,8 +2,13 @@ package cn.iocoder.yudao.module.sale.controller.admin.offer;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.customer.convert.customerFollowup.CustomerFollowupConvert;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO;
import cn.iocoder.yudao.module.customer.service.customerFollowup.CustomerFollowupService;
import cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerRespVO;
import cn.iocoder.yudao.module.sale.dal.dataobject.offer.OfferDO; import cn.iocoder.yudao.module.sale.dal.dataobject.offer.OfferDO;
import cn.iocoder.yudao.module.sale.vo.offer.*; import cn.iocoder.yudao.module.sale.vo.offer.*;
import cn.iocoder.yudao.module.sale.vo.offerApproval.OfferApprovalBackInfoVO; import cn.iocoder.yudao.module.sale.vo.offerApproval.OfferApprovalBackInfoVO;
...@@ -49,7 +54,8 @@ public class OfferController { ...@@ -49,7 +54,8 @@ public class OfferController {
private OfferService offerService; private OfferService offerService;
@Resource @Resource
private RoleApi roleApi; private RoleApi roleApi;
@Resource
private CustomerFollowupService customerFollowupService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建报价单管理") @ApiOperation("创建报价单管理")
...@@ -179,6 +185,17 @@ public class OfferController { ...@@ -179,6 +185,17 @@ public class OfferController {
// @PreAuthorize("@ss.hasPermission('ecw:offer:query')") // @PreAuthorize("@ss.hasPermission('ecw:offer:query')")
public CommonResult<PageResult<OfferRespVO>> getOfferPage(@Valid OfferPageReqVO pageVO) { public CommonResult<PageResult<OfferRespVO>> getOfferPage(@Valid OfferPageReqVO pageVO) {
PageResult<OfferRespVO> pageResult = offerService.offerPage(pageVO); PageResult<OfferRespVO> pageResult = offerService.offerPage(pageVO);
if (CollectionUtil.isNotEmpty(pageResult.getList())) {
for (OfferRespVO respVO : pageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getOfferId, respVO.getOfferId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(pageResult); return success(pageResult);
} }
...@@ -200,6 +217,17 @@ public class OfferController { ...@@ -200,6 +217,17 @@ public class OfferController {
} }
addDataScopeQuery(pageVO, loginUser, roleRespDTOS); addDataScopeQuery(pageVO, loginUser, roleRespDTOS);
PageResult<OfferRespVO> pageResult = offerService.offerPage(pageVO); PageResult<OfferRespVO> pageResult = offerService.offerPage(pageVO);
if (CollectionUtil.isNotEmpty(pageResult.getList())) {
for (OfferRespVO respVO : pageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getOfferId, respVO.getOfferId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(pageResult); return success(pageResult);
} }
...@@ -210,6 +238,17 @@ public class OfferController { ...@@ -210,6 +238,17 @@ public class OfferController {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
pageVO.setDeptId(Objects.isNull(loginUser) || Objects.isNull(loginUser.getDeptId()) ? 0L : loginUser.getDeptId()); pageVO.setDeptId(Objects.isNull(loginUser) || Objects.isNull(loginUser.getDeptId()) ? 0L : loginUser.getDeptId());
PageResult<OfferRespVO> pageResult = offerService.offerPage(pageVO); PageResult<OfferRespVO> pageResult = offerService.offerPage(pageVO);
if (CollectionUtil.isNotEmpty(pageResult.getList())) {
for (OfferRespVO respVO : pageResult.getList()) {
CustomerFollowupDO customerFollowupDO = customerFollowupService.getOne(new LambdaQueryWrapperX<CustomerFollowupDO>()
.eq(CustomerFollowupDO::getOfferId, respVO.getOfferId())
.orderByDesc(CustomerFollowupDO::getId)
.last("limit 1"));
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
}
}
return success(pageResult); return success(pageResult);
} }
......
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