Commit 02b7ad8c authored by liuzeheng's avatar liuzeheng

跟进记录

parent f2d8257e
......@@ -80,6 +80,16 @@ public class CustomerFollowDO extends BaseDO {
*/
private Long adminId;
private String followNo ;
private String followResult ;
private String followFile;
private Date nextFollowTime ;
private String nextPlan ;
/**
* 跟进业务员
......
......@@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerF
import cn.iocoder.yudao.module.customer.dto.follow.CustomerFollowPageDTO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowExportReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowPageReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowRespVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Mapper;
......@@ -94,27 +95,79 @@ public interface CustomerFollowMapper extends BaseMapperX<CustomerFollowDO> {
IPage<CustomerFollowDO> customerFollowPage(@Param("mpPage") IPage<CustomerFollowDO> mpPage, @Param("query") CustomerFollowPageReqVO query, @Param("types") List<String> types);
@ResultType(CustomerFollowDO.class)
@ResultType(CustomerFollowRespVO.class)
@Select({
"<script>",
"select ",
"f.*, ",
"f.*,c.number, ",
"t3.phone_new phone,",
"u1.nickname as creatorName , ",
"u2.nickname as updaterName , ",
"u.nickname as follow_user_name ",
"from ecw_customer_follow f ",
"left join ecw_customer c on c.id = f.customer_id ",
"left join system_user u on u.id = f.follow_user_Id ",
"left join system_user u1 on u1.id = f.creator ",
"left join system_user u2 on u2.id = f.updater ",
"LEFT JOIN ecw_customer_contacts t3 ON c.id = t3.customer_id AND t3.is_default = 1 and t3.deleted=0" ,
"where f.deleted = 0",
"<when test = 'types != null'>",
"AND f.`follow_type` in ",
"<foreach item='type' index='index' collection='types' open='(' separator=',' close=')'>#{type}</foreach> ",
"</when>",
"<when test = 'query.followNo != null and query.followNo != \"\" '>",
"AND f.`follow_no` like concat('%',concat(#{query.followNo},'%'))",
"</when>",
"<when test = 'query.contactName != null and query.contactName != \"\" '>",
"AND f.`contact_name` like concat('%',concat(#{query.contactName},'%'))",
"</when>",
"<when test = 'query.beginCreateTime != null and query.endCreateTime != null '>",
"AND f.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}",
"</when>",
"<when test = 'query.beginFollowTime != null and query.endFollowTime != null '>",
"AND f.`follow_time` between #{query.beginFollowTime} and #{query.endFollowTime}",
"</when>",
"<when test = 'query.customerId != null'>",
"AND f.`customer_id` = #{query.customerId}",
"</when>",
"<when test = 'query.bizId != null'>",
"AND f.`biz_id` = #{query.bizId}",
"</when>",
"<when test = 'query.bizNo != null and query.bizNo != \"\" '>",
"AND f.`biz_no` like concat('%',concat(#{query.bizNo},'%'))",
"<when test = 'query.followUserId != null'>",
"AND f.`follow_user_id` = #{query.followUserId}",
"</when>",
"group by f.id " ,
" limit #{start}, #{size} " ,
"</script>"
})
List<CustomerFollowRespVO> getFollowPage(@Param("start") int start, @Param("size") int size, @Param("query") CustomerFollowPageDTO query, @Param("types") List<String> types);
@Select({
"<script>",
"select count(*) ",
"from ecw_customer_follow f ",
"left join ecw_customer c on c.id = f.customer_id ",
"left join system_user u on u.id = f.follow_user_Id ",
"where f.deleted = 0",
"<when test = 'types != null'>",
"AND f.`follow_type` in ",
"<foreach item='type' index='index' collection='types' open='(' separator=',' close=')'>#{type}</foreach> ",
"</when>",
"<when test = 'query.followNo != null and query.followNo != \"\" '>",
"AND f.`follow_no` like concat('%',concat(#{query.followNo},'%'))",
"</when>",
"<when test = 'query.contactName != null and query.contactName != \"\" '>",
"AND f.`contact_name` like concat('%',concat(#{query.contactName},'%'))",
"</when>",
"<when test = 'query.beginCreateTime != null and query.endCreateTime != null '>",
"AND f.`follow_time` between #{query.beginCreateTime} and #{query.endCreateTime}",
"AND f.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}",
"</when>",
"<when test = 'query.beginFollowTime != null and query.endFollowTime != null '>",
"AND f.`follow_time` between #{query.beginFollowTime} and #{query.endFollowTime}",
"</when>",
"<when test = 'query.customerId != null'>",
"AND f.`customer_id` = #{query.customerId}",
......@@ -122,7 +175,10 @@ public interface CustomerFollowMapper extends BaseMapperX<CustomerFollowDO> {
"<when test = 'query.bizId != null'>",
"AND f.`biz_id` = #{query.bizId}",
"</when>",
"<when test = 'query.followUserId != null'>",
"AND f.`follow_user_id` = #{query.followUserId}",
"</when>",
"</script>"
})
IPage<CustomerFollowDO> getFollowPage(@Param("mpPage") IPage<CustomerFollowDO> mpPage, @Param("query") CustomerFollowPageDTO query, @Param("types") List<String> types);
long getFollowPageCount( @Param("query") CustomerFollowPageDTO query , @Param("types") List<String> types);
}
......@@ -18,14 +18,14 @@ public class CustomerFollowPageDTO extends PageParam {
@ApiModelProperty(value = "跟进业务数据ID,回访类型的就是客户id,投诉跟进类型的就是投诉id, 商务洽谈就是报价单ID")
private Long bizId;
@ApiModelProperty(value = "业务编号")
private String bizNo;
@ApiModelProperty(value = "编号")
private String followNo;
@ApiModelProperty(value = "跟进类型 参见字典customer_follow_type 查询参数可以多个使用','分割")
private String followType;
//@ApiModelProperty(value = "联系人")
//private String contactName;
@ApiModelProperty(value = "联系人")
private String contactName;
@ApiModelProperty(value = "跟进业务员")
private Long followUserId;
......@@ -48,4 +48,7 @@ public class CustomerFollowPageDTO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
@ApiModelProperty(value = "跟进方式")
private Integer followMethod ;
}
......@@ -4,10 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO;
import cn.iocoder.yudao.module.customer.dto.follow.CustomerFollowPageDTO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowCreateReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowExportReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowPageReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowUpdateReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.*;
import javax.validation.Valid;
import java.util.Collection;
......@@ -67,7 +64,7 @@ public interface CustomerFollowService extends IService<CustomerFollowDO> {
PageResult<CustomerFollowDO> getCustomerFollowPage(CustomerFollowPageReqVO pageReqVO);
PageResult<CustomerFollowDO> customerFollowPage(CustomerFollowPageReqVO pageReqVO);
PageResult<CustomerFollowDO> getFollowPage(CustomerFollowPageDTO pageVO);
PageResult<CustomerFollowRespVO> getFollowPage(CustomerFollowPageDTO pageVO);
/**
* 获得客户投诉跟进列表, 用于 Excel 导出
*
......
......@@ -10,10 +10,7 @@ import cn.iocoder.yudao.module.customer.convert.customer.complaint.follow.Custom
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO;
import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerFollowMapper;
import cn.iocoder.yudao.module.customer.dto.follow.CustomerFollowPageDTO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowCreateReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowExportReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowPageReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.CustomerFollowUpdateReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.follow.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jodd.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
......@@ -99,14 +96,19 @@ public class CustomerFollowServiceImpl extends AbstractService<CustomerFollowMap
}
@Override
public PageResult<CustomerFollowDO> getFollowPage(CustomerFollowPageDTO pageReqVO) {
public PageResult<CustomerFollowRespVO> getFollowPage(CustomerFollowPageDTO pageReqVO) {
PageVO page = new PageVO();
page.setPage(pageReqVO.getPageNo());
page.setRows(pageReqVO.getPageSize());
page.setField("f.id");
IPage<CustomerFollowDO> mpPage = MyBatisUtils.buildPage(page);
customerFollowMapper.getFollowPage(mpPage, pageReqVO, StringUtils.isNotBlank(pageReqVO.getFollowType()) ? Arrays.asList(pageReqVO.getFollowType().split(StrUtil.COMMA)) : null);
return PageResult.of(mpPage);
// customerFollowMapper.getFollowPage(mpPage, pageReqVO, StringUtils.isNotBlank(pageReqVO.getFollowType()) ? Arrays.asList(pageReqVO.getFollowType().split(StrUtil.COMMA)) : null);
// return PageResult.of(mpPage);
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<CustomerFollowRespVO> list = customerFollowMapper.getFollowPage(start, size, pageReqVO, StringUtils.isNotBlank(pageReqVO.getFollowType()) ? Arrays.asList(pageReqVO.getFollowType().split(StrUtil.COMMA)) : null);
long total = customerFollowMapper.getFollowPageCount(pageReqVO, StringUtils.isNotBlank(pageReqVO.getFollowType()) ? Arrays.asList(pageReqVO.getFollowType().split(StrUtil.COMMA)) : null);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
@Override
......
......@@ -75,4 +75,6 @@ public class CustomerFollowBaseVO {
@ApiModelProperty(value = "最后更新人")
private String updater ;
private String number ;
}
......@@ -16,4 +16,13 @@ public class CustomerFollowRespVO extends CustomerFollowBaseVO {
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
@ApiModelProperty(value = "创建人", required = true)
private String creator ;
private String creatorName ;
private String updaterName ;
private String phone ;
}
......@@ -84,8 +84,8 @@ public class CustomerFollowController {
@GetMapping("/followPage")
@ApiOperation("跟进列表数据-分页")
public CommonResult<PageResult<CustomerFollowRespVO>> getFollowPage(@Valid CustomerFollowPageDTO pageVO) {
PageResult<CustomerFollowDO> pageResult = customerFollowService.getFollowPage(pageVO);
return success(CustomerFollowConvert.INSTANCE.convertPage(pageResult));
PageResult<CustomerFollowRespVO> pageResult = customerFollowService.getFollowPage(pageVO);
return success(pageResult);
}
//@GetMapping("/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