Commit bbb3f840 authored by zhengyi's avatar zhengyi

客户列表补充返回最新跟进编号及最新跟进时间

parent 95c115a4
......@@ -4,12 +4,16 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 客户 DO
*
......@@ -523,4 +527,19 @@ public class CustomerDO extends BaseDO {
private String competitorNames;
@ApiModelProperty("最新跟进记录id")
@TableField(exist = false)
private Long followupId;
@ApiModelProperty("最新跟进记录编号")
@TableField(exist = false)
private String followupNumber;
@ApiModelProperty("最新跟进记录时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@TableField(exist = false)
private Date followupDate;
}
......@@ -40,6 +40,7 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customerAirLog.CustomerAi
import cn.iocoder.yudao.module.customer.dal.dataobject.customerApproval.CustomerApprovalDO;
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.customerFollowup.CustomerFollowupDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerPublicCatchLog.CustomerPublicCatchLogDO;
import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerLineMapper;
import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper;
......@@ -50,6 +51,7 @@ import cn.iocoder.yudao.module.customer.dal.mysql.customerPublicCatchLog.Custome
import cn.iocoder.yudao.module.customer.dto.*;
import cn.iocoder.yudao.module.customer.service.customerApproval.CustomerApprovalService;
import cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService;
import cn.iocoder.yudao.module.customer.service.customerFollowup.CustomerFollowupService;
import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService;
import cn.iocoder.yudao.module.customer.vo.customer.customerContacts.CustomerContactsBaseVO;
import cn.iocoder.yudao.module.customer.vo.customer.customerContacts.CustomerContactsCreateReqVO;
......@@ -115,6 +117,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
@Resource
private CustomerMapper customerMapper;
@Resource
private CustomerFollowupService customerFollowupService;
@Resource
private ParamValidatorService paramValidatorService;
......@@ -1178,6 +1182,19 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
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.setFollowupId(customerFollowupDO.getId());
customerDO.setFollowupNumber(customerFollowupDO.getNumber());
customerDO.setFollowupDate(customerFollowupDO.getCreateTime());
}
}
}
long total = customerMapper.getMyPageCount(pageReqVO);
return new PageResult<>(list, total,
mpPage.getSize(), page.getPage(),
......
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -236,5 +238,19 @@ public class CustomerRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "主营产品")
private String productIds;
@ApiModelProperty("最新跟进记录id")
@TableField(exist = false)
private Long followupId;
@ApiModelProperty("最新跟进记录编号")
@TableField(exist = false)
private String followupNumber;
@ApiModelProperty("最新跟进记录时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@TableField(exist = false)
private Date followupDate;
}
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