Commit 3d7a3113 authored by zhengyi's avatar zhengyi

跟进列表返回上级跟进记录详情信息

parent 435f94ed
......@@ -37,6 +37,13 @@ public interface CustomerFollowupConvert {
*/
CustomerFollowupBackVO convert(CustomerFollowupDO bean);
/***
* 实体转返回VO
* @param bean
* @return
*/
CustomerFollowupParentVO convertParent(CustomerFollowupDO bean);
/***
* 实体列表转返回VO列表
* @param list
......
package cn.iocoder.yudao.module.customer.service.customerFollowup;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderNumberLogEvent;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
......
......@@ -86,9 +86,6 @@ public class CustomerFollowupBackVO {
@ApiModelProperty("部门名称")
private String deptName;
@ExcelProperty(value = "跟进方式", converter = DictConvert.class)
@DictFormat("customer_followup_method")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
......@@ -170,5 +167,8 @@ public class CustomerFollowupBackVO {
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "上级跟进详情")
private CustomerFollowupParentVO parentVO;
}
package cn.iocoder.yudao.module.customer.vo.customerFollowup;
import cn.iocoder.yudao.framework.excel.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 客户跟进 Response VO
* @author yanghao
*/
@Data
@ApiModel("管理后台-上级客户跟进详情 VO")
public class CustomerFollowupParentVO {
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ExcelProperty("编号")
@ApiModelProperty(value = "编号")
private String number;
@ExcelProperty(value = "跟进类型", converter = DictConvert.class)
@DictFormat("customer_followup_type")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followType;
@ExcelProperty(value = "销售阶段", converter = DictConvert.class)
@DictFormat("sale_stage")
@ApiModelProperty(value = "销售阶段 字典sale_stage")
private Integer saleStage;
@ApiModelProperty(value = "报价单")
private Long offerId;
@ExcelProperty("报价单")
@ApiModelProperty(value = "报价单编号")
private String offerNumber;
@ExcelProperty("跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "跟进时间")
private Date followTime;
@ApiModelProperty(value = "客户编号")
private Long customerId;
@ExcelProperty("客户编号")
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ExcelProperty("客户名称")
@ApiModelProperty(value = "客户名称")
private String customerName;
@ExcelProperty("客户来源")
@ApiModelProperty(value = "客户来源")
private String customerSource;
@ExcelProperty("客户创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "客户创建时间")
private Date customerCreateTime;
// 联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ExcelProperty("联系人")
@ApiModelProperty(value = "联系人")
private String contactName;
@ApiModelProperty(value = "客户经理/跟进业务员id")
private Long followUserId;
@ApiModelProperty("客户经理")
private String followUserName;
@ApiModelProperty(value = "客户经理/跟进业务员所属部门id")
private Long deptId;
@ApiModelProperty("部门名称")
private String deptName;
@ExcelProperty(value = "跟进方式", converter = DictConvert.class)
@DictFormat("customer_followup_method")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followMethod;
@ExcelProperty("目的")
@ApiModelProperty(value = "目的")
private String purpose;
@ExcelProperty(value = "结果", converter = DictConvert.class)
@DictFormat("customer_followup_result_type")
@ApiModelProperty(value = "跟进结果 字典customer_followup_result_type")
private Integer resultType;
@ExcelProperty("跟进情况")
@ApiModelProperty(value = "客户反馈")
private String feedback;
@ExcelProperty("下次跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "下次跟进时间")
private Date nextTime;
@ExcelProperty("下次跟进计划")
@ApiModelProperty(value = "下次跟进计划")
private String nextPlan;
@ExcelProperty("关联跟进纪录")
@ApiModelProperty(value = "上一级跟进单号")
private String parentNumber;
@ApiModelProperty(value = "上一级跟进单ID")
private String parentId;
@ExcelProperty(value = "提交状态", converter = DictConvert.class)
@DictFormat("customer_followup_status")
@ApiModelProperty(value = "状态 字典customer_followup_status")
private Integer status;
//creator_name
@ExcelProperty("创建人")
@ApiModelProperty(value = "创建人名称")
private String creatorName;
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
// updater_name
@ExcelProperty("最后更新人")
@ApiModelProperty(value = "更新人名称")
private String updaterName;
@ExcelProperty("最后更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "附件 多个以逗号分隔")
private String attatchment;
@ExcelProperty("联系人电话")
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
}
......@@ -120,7 +120,18 @@ public class CustomerFollowupController {
// @PreAuthorize("@ss.hasPermission('customer:followup:query')")
public CommonResult<PageResult<CustomerFollowupBackVO>> getFollowupPage(@Valid CustomerFollowupQueryVO query, PageVO page) {
PageResult<CustomerFollowupDO> pageResult = followupService.getFollowupPage(query, page);
return success(CustomerFollowupConvert.INSTANCE.convertPage(pageResult));
PageResult<CustomerFollowupBackVO> backVOPageResult = CustomerFollowupConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(backVOPageResult.getList())){
for (CustomerFollowupBackVO followupBackVO : backVOPageResult.getList()) {
if (Objects.nonNull(followupBackVO.getParentId())){
CustomerFollowupDO followupDO = followupService.getById(followupBackVO.getParentId());
if (Objects.nonNull(followupDO)){
followupBackVO.setParentVO(CustomerFollowupConvert.INSTANCE.convertParent(followupDO));
}
}
}
}
return success(backVOPageResult);
}
@GetMapping("/data/space/page")
......@@ -140,7 +151,18 @@ public class CustomerFollowupController {
}
addDataScopeQuery(query, loginUser, roleRespDTOS);
PageResult<CustomerFollowupDO> pageResult = followupService.getFollowupPage(query, page);
return success(CustomerFollowupConvert.INSTANCE.convertPage(pageResult));
PageResult<CustomerFollowupBackVO> backVOPageResult = CustomerFollowupConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(backVOPageResult.getList())){
for (CustomerFollowupBackVO followupBackVO : backVOPageResult.getList()) {
if (Objects.nonNull(followupBackVO.getParentId())){
CustomerFollowupDO followupDO = followupService.getById(followupBackVO.getParentId());
if (Objects.nonNull(followupDO)){
followupBackVO.setParentVO(CustomerFollowupConvert.INSTANCE.convertParent(followupDO));
}
}
}
}
return success(backVOPageResult);
}
@GetMapping("/data/space/export-excel")
......
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