Commit 80554387 by 翁国栋

crm需求

1.业务员可自行登记客户跟进提醒:精确到年、月、天
2.颜色列表
3客户导入增加字段
parent cff62489
......@@ -44,3 +44,18 @@ ADD COLUMN `secret` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL
ADD COLUMN `appidq` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `secret`,
ADD COLUMN `secretq` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `appidq`;
ALTER TABLE `admin_asso_txjlb`
MODIFY COLUMN `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '提醒用户姓名' AFTER `content`;
CREATE TABLE ` crm_remind_rule ` (
` id ` int(11) NOT NULL AUTO_INCREMENT,
` crm_group_member ` int(11) DEFAULT NULL COMMENT ''crm_business_group_member'',
` crm_client_id ` int(11) DEFAULT NULL COMMENT ''客户id'',
` remind_day ` varchar(10) DEFAULT NULL COMMENT ''提醒天数:YYYY-MM-DD'',
` create_time ` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT ''创建时间'',
` remind_num ` int(11) DEFAULT ''1'' COMMENT ''提醒次数'',
` delete_flag ` tinyint(1) DEFAULT ''0'' COMMENT ''逻辑删除标记0.未删除 1.删除'',
` org_code ` int(11) DEFAULT NULL,
` user_name ` varchar(50) DEFAULT NULL,
PRIMARY KEY (` id `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=''提醒规则'';
/**
* Title: CrmBusinessGroup.java
* Description:
* @author dsc
* @date 2020年6月5日
* @version 1.0
/**
* Title: CrmBusinessGroup.java
* Description:
* @author dsc
* @date 2020年6月5日
* @version 1.0
*/
package cn.timer.api.bean.crm;
......@@ -32,7 +32,7 @@ import lombok.NoArgsConstructor;
/**
* Title: CrmBusinessGroup.java
*
*
* @Description:
* @author dsc
* @date 2020年6月5日
......@@ -83,7 +83,7 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> {
@TableField(exist = false)
@ApiModelProperty(value = "组管理员信息")
private List<Map<String, Object>> managers;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "组管理员id")
......@@ -93,7 +93,7 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> {
@TableField(exist = false)
@ApiModelProperty(value = "组管理员信息")
private List<Map<String, Object>> members;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "组成员id")
......
/**
* Title: CrmClientFollow.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
/**
* Title: CrmClientFollow.java
* Description:
* @author dsc
* @date 2020年6月8日
* @version 1.0
*/
package cn.timer.api.bean.crm;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.*;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -29,7 +26,7 @@ import lombok.NoArgsConstructor;
/**
* Title: CrmClientFollow.java
*
*
* @Description:
* @author dsc
* @date 2020年6月8日
......@@ -58,28 +55,28 @@ public class CrmClientFollow extends Model<CrmClientFollow> {
@ApiModelProperty(value = "跟进内容")
private String content;
@ApiModelProperty(value = "客户数据状态 0-无 1-潜在 2-意向 3-签约 4-合作中 5-已封档")
private Integer clientStatus;
@ApiModelProperty(value = "联系人姓名")
private String name;
@ApiModelProperty(value = "联系人公司")
private String company;
@ApiModelProperty(value = "联系人职位")
private String position;
@ApiModelProperty(value = "联系人手机号")
private String cellphone;
@ApiModelProperty(value = "创建人")
private Integer createUser;
@ApiModelProperty(value = "企业id")
private Integer orgCode;
@ApiModelProperty(value = "创建人姓名")
private String createUserName;
......@@ -87,4 +84,9 @@ public class CrmClientFollow extends Model<CrmClientFollow> {
@ApiModelProperty(value = "创建时间")
private Date createTime;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "下次提醒时间")
private String remindTime;
}
package cn.timer.api.bean.crm;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 跟进记录的颜色标识配置
*
* @author wgd
* @email 862422848@qq.com
* @date 2023-07-27 17:33:50
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "crm_list_color")
@ApiModel("crm客戶列表颜色列表")
public class CrmListColor extends Model<CrmListColor> {
private static final long serialVersionUID = 1L;
/**
*
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
*
*/
private Integer crmBusinessGroup;
/**
* 0-无 1-潜在 2-意向 3-签约 4-合作中 5-已封档
*/
private Integer clientStatus;
/**
* 逻辑删除标记0.未删除 1.删除'
*/
private Integer deleteFlag;
/**
* 天数
*/
private Integer day1;
/**
* 颜色
*/
private String color1;
/**
* 天数
*/
private Integer day2;
/**
* 颜色
*/
private String color2;
/**
* 天数
*/
private Integer day3;
/**
* 颜色
*/
private String color3;
}
package cn.timer.api.bean.crm;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 提醒规则
*
* @author wgd
* @email 862422848@qq.com
* @date 2023-07-26 19:32:41
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "crm_remind_rule")
@ApiModel("客户提醒规则")
public class CrmRemindRule extends Model<CrmRemindRule> {
private static final long serialVersionUID = 1L;
/**
*
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* crm_business_group_member
*/
private Integer crmGroupMember;
/**
* 客户id
*/
private Integer crmClientId;
/**
* 提醒天数:YYYY-MM-DD
*/
private String remindDay;
/**
* 创建时间
*/
private Date createTime;
private Integer remindNum;
@ApiModelProperty(value="逻辑删除标记0.未删除 1.删除",example="0")
private Integer deleteFlag;
private Integer orgCode;
private String userName;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Title: CrmRuleController.java
* Description:
* @author dsc
* @date 2020年6月11日
* @version 1.0
*/
package cn.timer.api.controller.crm.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.timer.api.bean.admin.AdminAssoTxjlb;
import cn.timer.api.bean.crm.CrmClientAssociate;
import cn.timer.api.bean.crm.CrmClientData;
import cn.timer.api.bean.crm.CrmRemindRule;
import cn.timer.api.bean.crm.CrmSeaRule;
import cn.timer.api.dao.crm.CrmRemindRuleMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* Title: CrmRuleController.java
*
* @Description: 公海规则
* @author dsc
* @date 2020年6月11日
* @version 1.0
*/
@Configuration //1.主要用于标记配置类,兼备Component的效果。 // 2.开启定时任务
@Slf4j
public class CrmRuleTaskTiming {
@Autowired
private CrmRemindRuleMapper crmRemindRuleMapper;
//提醒时间到了
@Scheduled(cron = "0/1 * * * * ?") // 每小时扫描
@Transactional
public void getTimeRules() {
String today=DateUtil.today();
List<CrmRemindRule> crmRemindRuleList = crmRemindRuleMapper.selectCrmRemindRuleList(today);
if(crmRemindRuleList!=null&&crmRemindRuleList.size()>0){
//发送系统通知
crmRemindRuleList.forEach(v->{
AdminAssoTxjlb adminAssoTxjlb = AdminAssoTxjlb.builder().build();
adminAssoTxjlb.setEmpNum(v.getCrmGroupMember());
adminAssoTxjlb.setOrgCode(v.getOrgCode());
adminAssoTxjlb.setUserName(v.getUserName());
adminAssoTxjlb.setTxType(1);
adminAssoTxjlb.setTxstate(0);
adminAssoTxjlb.setContent("您有一位客户["+v.getUserName()+"]需要跟进");
adminAssoTxjlb.setAddtime(new Date().getTime());
adminAssoTxjlb.insert();
v.setDeleteFlag(1);
v.updateById();
});
}
}
}
......@@ -37,7 +37,7 @@ public class InsureTaskTiming {
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Scheduled(cron = "0 0 0 1 * ?")//每月第一天
@Scheduled(cron = "0/1 0 0 * * ?")//每月第一天
@Transactional(rollbackFor = Exception.class)
public void updateInsureStatusTask(){
try {
......
package cn.timer.api.dao.crm;
import cn.timer.api.bean.crm.CrmListColor;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 跟进记录的颜色标识配置
*
* @author wgd
* @email 862422848@qq.com
* @date 2023-07-27 17:33:50
*/
@Repository
public interface CrmListColorMapper extends BaseMapper<CrmListColor> {
}
package cn.timer.api.dao.crm;
import cn.timer.api.bean.crm.CrmRemindRule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 提醒规则
*
* @author wgd
* @email 862422848@qq.com
* @date 2023-07-26 19:32:41
*/
@Repository
public interface CrmRemindRuleMapper extends BaseMapper<CrmRemindRule> {
List<CrmRemindRule> selectCrmRemindRuleList(@Param("remindDay")String remindTime);
}
/**
* Title: CrmClientDataImportVo.java
* Description:
* @author dsc
* @date 2020年6月12日
* @version 1.0
/**
* Title: CrmClientDataImportVo.java
* Description:
* @author dsc
* @date 2020年6月12日
* @version 1.0
*/
package cn.timer.api.dto.crm;
......@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
/**
* Title: CrmClientDataImportVo.java
*
*
* @Description: 客户导入
* @author dsc
* @date 2020年6月12日
......@@ -50,13 +50,16 @@ public class CrmClientDataImportVo implements Serializable {
private String clientEmail;
// 详细地址
private String address;
private String province;
private String city;
private String district;
//微信
private String wechat;
//产品
private String product;
// 联系人信息
private String linkName;
private String cellphone;
......@@ -66,7 +69,7 @@ public class CrmClientDataImportVo implements Serializable {
private String telephone;
private String email;
private String linkAddress;
private String followuprecord;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.crm.CrmListColorMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.crm.CrmListColor" id="crmListColorMap">
<result property="id" column="id"/>
<result property="crmBusinessGroup" column="crm_business_group"/>
<result property="clientStatus" column="client_status"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="day1" column="day1"/>
<result property="color1" column="color1"/>
<result property="day2" column="day2"/>
<result property="color2" column="color2"/>
<result property="day3" column="day3"/>
<result property="color3" column="color3"/>
</resultMap>
<select id="selectById" resultType="cn.timer.api.bean.crm.CrmListColor">
select *
from crm_list_color
where id = #{id}
</select>
<insert id="insert" parameterType="cn.timer.api.bean.crm.CrmListColor" useGeneratedKeys="true"
keyProperty="id">
insert into crm_list_color
(
<if test="crmBusinessGroup != null">`crm_business_group`</if>
<if test="clientStatus != null">`client_status`</if>
<if test="deleteFlag != null">,`delete_flag`</if>
<if test="day1 != null">,`day1`</if>
<if test="color1 != null">,`color1`</if>
<if test="day2 != null">,`day2`</if>
<if test="color2 != null">,`color2`</if>
<if test="day3 != null">,`day3`</if>
<if test="color3 != null">,`color3`</if>
)
values
(
<if test="crmBusinessGroup != null">#{crmBusinessGroup}</if>
<if test="clientStatus != null">#{clientStatus}</if>
<if test="deleteFlag != null">,#{deleteFlag}</if>
<if test="day1 != null">,#{day1}</if>
<if test="color1 != null">,#{color1}</if>
<if test="day2 != null">,#{day2}</if>
<if test="color2 != null">,#{color2}</if>
<if test="day3 != null">,#{day3}</if>
<if test="color3 != null">,#{color3}</if>
)
</insert>
<update id="update" parameterType="cn.timer.api.bean.crm.CrmListColor">
update crm_list_color
<set>
<if test="crmBusinessGroup != null">`crm_business_group` = #{crmBusinessGroup},</if>
<if test="clientStatus != null">`client_status` = #{clientStatus},</if>
<if test="deleteFlag != null">`delete_flag` = #{deleteFlag},</if>
<if test="day1 != null">`day1` = #{day1},</if>
<if test="color1 != null">`color1` = #{color1},</if>
<if test="day2 != null">`day2` = #{day2},</if>
<if test="color2 != null">`color2` = #{color2},</if>
<if test="day3 != null">`day3` = #{day3},</if>
<if test="color3 != null">`color3` = #{color3}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from crm_list_color
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from crm_list_color where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.crm.CrmRemindRuleMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.crm.CrmRemindRule" id="crmRemindRuleMap">
<result property="id" column="id"/>
<result property="crmGroupMember" column="crm_group_member"/>
<result property="crmClientId" column="crm_client_id"/>
<result property="remindDay" column="remind_day"/>
<result property="createTime" column="create_time"/>
<result property="remindNum" column="remind_num"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="orgCode" column="org_code"/>
<result property="userName" column="user_name"/>
</resultMap>
<select id="selectById" resultType="cn.timer.api.bean.crm.CrmRemindRule">
select *
from crm_remind_rule
where id = #{id}
</select>
<insert id="insert" parameterType="cn.timer.api.bean.crm.CrmRemindRule" useGeneratedKeys="true"
keyProperty="id">
insert into crm_remind_rule
(
<if test="crmGroupMember != null">`crm_group_member`</if>
<if test="crmClientId != null">,`crm_client_id`</if>
<if test="remindDay != null">,`remind_day`</if>
<if test="createTime != null">,`create_time`</if>
<if test="remindNum != null">,`remind_num`</if>
<if test="deleteFlag != null">,`delete_flag`</if>
<if test="orgCode != null">,`org_code`</if>
<if test="userName != null">,`user_name`</if>
)
values
(
<if test="crmGroupMember != null">#{crmGroupMember}</if>
<if test="crmClientId != null">,#{crmClientId}</if>
<if test="remindDay != null">,#{remindDay}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="remindNum != null">,#{remindNum}</if>
<if test="deleteFlag != null">,#{deleteFlag}</if>
<if test="orgCode != null">,#{orgCode}</if>
<if test="userName != null">,#{userName}</if>
)
</insert>
<update id="update" parameterType="cn.timer.api.bean.crm.CrmRemindRule">
update crm_remind_rule
<set>
<if test="crmGroupMember != null">`crm_group_member` = #{crmGroupMember},</if>
<if test="crmClientId != null">`crm_client_id` = #{crmClientId},</if>
<if test="remindDay != null">`remind_day` = #{remindDay},</if>
<if test="createTime != null">`create_time` = #{createTime}</if>
<if test="remindNum != null">`create_time` = #{remind_num}</if>
<if test="deleteFlag != null">`create_time` = #{delete_flag}</if>
<if test="orgCode != null">`org_code` = #{orgCode}</if>
<if test="userName != null">`user_name` = #{userName}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from crm_remind_rule
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from crm_remind_rule where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectCrmRemindRuleList" resultType="cn.timer.api.bean.crm.CrmRemindRule">
select *
from crm_remind_rule
where delete_flag = 0 and remind_day>=#{remindDay}
</select>
</mapper>
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