Commit 578e3634 authored by yanghao's avatar yanghao

chore: 客户跟进联系人由名称修改为id,并在列表中返回联系人电话.

parent 0121e121
...@@ -99,6 +99,7 @@ CREATE TABLE `ecw_customer_followup` ( ...@@ -99,6 +99,7 @@ CREATE TABLE `ecw_customer_followup` (
`offer_id` bigint NULL DEFAULT NULL COMMENT '报价单', `offer_id` bigint NULL DEFAULT NULL COMMENT '报价单',
`follow_type` tinyint NULL DEFAULT NULL COMMENT '跟进类型 字典customer_followup_type', `follow_type` tinyint NULL DEFAULT NULL COMMENT '跟进类型 字典customer_followup_type',
`follow_time` datetime NULL DEFAULT NULL COMMENT '跟进时间', `follow_time` datetime NULL DEFAULT NULL COMMENT '跟进时间',
`contact_id` bigint NULL DEFAULT NULL COMMENT '联系人id',
`contact_name` varchar(63) NULL DEFAULT NULL COMMENT '联系人', `contact_name` varchar(63) NULL DEFAULT NULL COMMENT '联系人',
`follow_method` tinyint NULL DEFAULT NULL COMMENT '跟进方式 字典customer_followup_method', `follow_method` tinyint NULL DEFAULT NULL COMMENT '跟进方式 字典customer_followup_method',
`follow_user_id` bigint NULL DEFAULT NULL COMMENT '客户经理/跟进业务员id', `follow_user_id` bigint NULL DEFAULT NULL COMMENT '客户经理/跟进业务员id',
......
package cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup; package cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
...@@ -57,6 +58,11 @@ public class CustomerFollowupDO extends BaseDO { ...@@ -57,6 +58,11 @@ public class CustomerFollowupDO extends BaseDO {
* 跟进时间 * 跟进时间
*/ */
private Date followTime; private Date followTime;
/**
* 联系人id
*/
private Long contactId;
/** /**
* 联系人 * 联系人
*/ */
...@@ -109,4 +115,10 @@ public class CustomerFollowupDO extends BaseDO { ...@@ -109,4 +115,10 @@ public class CustomerFollowupDO extends BaseDO {
@TableField(exist = false) @TableField(exist = false)
private String followUserName; private String followUserName;
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
} }
...@@ -12,7 +12,9 @@ import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils; ...@@ -12,7 +12,9 @@ import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
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.dal.dataobject.customer.CustomerDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO;
import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper; import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper;
import cn.iocoder.yudao.module.customer.dal.mysql.customerContacts.CustomerContactsMapper;
import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService; import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService;
import cn.iocoder.yudao.module.customer.vo.customerOperateLog.CustomerOperateLogCreateReqVO; import cn.iocoder.yudao.module.customer.vo.customerOperateLog.CustomerOperateLogCreateReqVO;
import cn.iocoder.yudao.module.ecw.enums.CustomerFollowupStatusEnum; import cn.iocoder.yudao.module.ecw.enums.CustomerFollowupStatusEnum;
...@@ -49,6 +51,9 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -49,6 +51,9 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
@Resource @Resource
private CustomerMapper customerMapper; private CustomerMapper customerMapper;
@Resource
private CustomerContactsMapper customerContactsMapper;
/** /**
* 跟进单编号生成方式:GJ+年份+六位数字,按年份累计 * 跟进单编号生成方式:GJ+年份+六位数字,按年份累计
* @return * @return
...@@ -78,6 +83,10 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -78,6 +83,10 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// 插入 // 插入
CustomerFollowupDO followup = CustomerFollowupConvert.INSTANCE.convert(createReqVO); CustomerFollowupDO followup = CustomerFollowupConvert.INSTANCE.convert(createReqVO);
// 设置联系人名称
setContactName(followup);
followupMapper.insert(followup); followupMapper.insert(followup);
Long customerId = createReqVO.getCustomerId(); Long customerId = createReqVO.getCustomerId();
...@@ -108,6 +117,17 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -108,6 +117,17 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
return followup.getId(); return followup.getId();
} }
private void setContactName(CustomerFollowupDO followup) {
// 设置联系人名称
Long contactId = followup.getContactId();
if (contactId != null) {
CustomerContactsDO customerContactsDO = customerContactsMapper.selectById(contactId);
if (customerContactsDO != null) {
followup.setContactName(I18nMessage.getLang() == 0 ? customerContactsDO.getName() : customerContactsDO.getNameEn());
}
}
}
@Override @Override
public void updateFollowup(CustomerFollowupUpdateReqVO updateReqVO) { public void updateFollowup(CustomerFollowupUpdateReqVO updateReqVO) {
// 校验存在 // 校验存在
...@@ -121,6 +141,10 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -121,6 +141,10 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
} }
// 更新 // 更新
CustomerFollowupDO updateObj = CustomerFollowupConvert.INSTANCE.convert(updateReqVO); CustomerFollowupDO updateObj = CustomerFollowupConvert.INSTANCE.convert(updateReqVO);
// 设置联系人名称
setContactName(updateObj);
followupMapper.updateById(updateObj); followupMapper.updateById(updateObj);
Long customerId = updateReqVO.getCustomerId(); Long customerId = updateReqVO.getCustomerId();
......
...@@ -46,12 +46,14 @@ public class CustomerFollowupBackVO { ...@@ -46,12 +46,14 @@ public class CustomerFollowupBackVO {
@ApiModelProperty(value = "客户编号") @ApiModelProperty(value = "客户编号")
private String customerNumber; private String customerNumber;
// 联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ExcelProperty("联系人") @ExcelProperty("联系人")
@ApiModelProperty(value = "联系人") @ApiModelProperty(value = "联系人")
private String contactName; private String contactName;
//TODO 联系方式
@ApiModelProperty(value = "客户经理/跟进业务员id") @ApiModelProperty(value = "客户经理/跟进业务员id")
private Long followUserId; private Long followUserId;
@ExcelProperty("客户经理") @ExcelProperty("客户经理")
...@@ -133,4 +135,10 @@ public class CustomerFollowupBackVO { ...@@ -133,4 +135,10 @@ public class CustomerFollowupBackVO {
private String attatchment; private String attatchment;
@ExcelProperty("联系人电话")
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
} }
...@@ -37,6 +37,10 @@ public class CustomerFollowupBaseVO { ...@@ -37,6 +37,10 @@ public class CustomerFollowupBaseVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date followTime; private Date followTime;
//联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ApiModelProperty(value = "联系人") @ApiModelProperty(value = "联系人")
private String contactName; private String contactName;
......
...@@ -41,6 +41,10 @@ public class CustomerFollowupQueryVO extends PageParam { ...@@ -41,6 +41,10 @@ public class CustomerFollowupQueryVO extends PageParam {
@ApiModelProperty(value = "结束跟进时间") @ApiModelProperty(value = "结束跟进时间")
private Date endFollowTime; private Date endFollowTime;
//联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ApiModelProperty(value = "联系人") @ApiModelProperty(value = "联系人")
private String contactName; private String contactName;
......
...@@ -44,13 +44,15 @@ ...@@ -44,13 +44,15 @@
select a.*, b.number as customer_number, c.number as offer_number, select a.*, b.number as customer_number, c.number as offer_number,
d.nickname as creator_name, e.nickname as updater_name, d.nickname as creator_name, e.nickname as updater_name,
f.nickname as follow_user_name f.nickname as follow_user_name,
concat_ws( '', g.area_code, g.phone_new) as contact_phone
from ecw_customer_followup a from ecw_customer_followup a
left join ecw_customer b on a.customer_id = b.id left join ecw_customer b on a.customer_id = b.id
left join ecw_offer c on a.offer_id = c.offer_id left join ecw_offer c on a.offer_id = c.offer_id
left join system_user d on a.creator = d.id left join system_user d on a.creator = d.id
left join system_user e on a.updater = e.id left join system_user e on a.updater = e.id
left join system_user f on a.follow_user_id = f.id left join system_user f on a.follow_user_id = f.id
left join ecw_customer_contacts g on a.contact_id = g.id
WHERE 1=1 AND a.deleted = 0 WHERE 1=1 AND a.deleted = 0
......
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