Ver Fonte

代码修改

于继渤 há 2 anos atrás
pai
commit
bf1117c8b6
25 ficheiros alterados com 2139 adições e 137 exclusões
  1. 5 5
      src/main/java/com/dk/mdm/controller/ivt/IntoReturnController.java
  2. 24 0
      src/main/java/com/dk/mdm/controller/mst/CusFollowController.java
  3. 24 0
      src/main/java/com/dk/mdm/controller/mst/CusFollowStaffController.java
  4. 8 8
      src/main/java/com/dk/mdm/generator/Generator.java
  5. 12 0
      src/main/java/com/dk/mdm/infrastructure/convert/mst/CusFollowConvert.java
  6. 12 0
      src/main/java/com/dk/mdm/infrastructure/convert/mst/CusFollowStaffConvert.java
  7. 1 0
      src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml
  8. 14 0
      src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.java
  9. 237 0
      src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.xml
  10. 14 0
      src/main/java/com/dk/mdm/mapper/mst/CusFollowStaffMapper.java
  11. 125 0
      src/main/java/com/dk/mdm/mapper/mst/CusFollowStaffMapper.xml
  12. 11 1
      src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml
  13. 296 0
      src/main/java/com/dk/mdm/model/pojo/mst/CusFollow.java
  14. 115 0
      src/main/java/com/dk/mdm/model/pojo/mst/CusFollowStaff.java
  15. 299 0
      src/main/java/com/dk/mdm/model/query/mst/CusFollowQuery.java
  16. 113 0
      src/main/java/com/dk/mdm/model/query/mst/CusFollowStaffQuery.java
  17. 106 0
      src/main/java/com/dk/mdm/model/response/mst/CusFollowStaffResponse.java
  18. 223 0
      src/main/java/com/dk/mdm/model/response/mst/CusFollowVOResponse.java
  19. 15 75
      src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java
  20. 115 0
      src/main/java/com/dk/mdm/model/vo/mst/CusFollowStaffVO.java
  21. 296 0
      src/main/java/com/dk/mdm/model/vo/mst/CusFollowVO.java
  22. 20 0
      src/main/java/com/dk/mdm/service/common/CommonService.java
  23. 8 48
      src/main/java/com/dk/mdm/service/ivt/IntoReturnService.java
  24. 23 0
      src/main/java/com/dk/mdm/service/mst/CusFollowService.java
  25. 23 0
      src/main/java/com/dk/mdm/service/mst/CusFollowStaffService.java

+ 5 - 5
src/main/java/com/dk/mdm/controller/ivt/IntoReturnController.java

@@ -65,11 +65,11 @@ public class IntoReturnController{
      * @author : 于继渤
      */
     @ApiOperation(
-            value = "冲正",
-            notes = "冲正"
+            value = "作废",
+            notes = "作废"
     )
-    @PostMapping("righting")
-    public ResponseResultVO<String> righting(@RequestBody IntoReturnVO intoReturnVO) {
-        return intoReturnService.righting(intoReturnVO.getPurId(),intoReturnVO.getIntoReturnIdList());
+    @PostMapping("cancel")
+    public ResponseResultVO<String> cancel(@RequestBody IntoReturnVO intoReturnVO) {
+        return intoReturnService.cancel(intoReturnVO);
     }
 }

+ 24 - 0
src/main/java/com/dk/mdm/controller/mst/CusFollowController.java

@@ -0,0 +1,24 @@
+package com.dk.mdm.controller.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollow;
+import com.dk.common.controller.BaseController;
+import com.dk.common.service.BaseService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import com.dk.mdm.service.mst.CusFollowService;
+
+@Api(tags = "客户跟进API接口")
+@RestController
+@RequestMapping("/mst/cusFollow")
+public class CusFollowController{
+
+    public BaseService<CusFollow> getService() {
+        return cusFollowService;
+    }
+
+    @Autowired
+    private CusFollowService cusFollowService;
+
+}

+ 24 - 0
src/main/java/com/dk/mdm/controller/mst/CusFollowStaffController.java

@@ -0,0 +1,24 @@
+package com.dk.mdm.controller.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollowStaff;
+import com.dk.common.controller.BaseController;
+import com.dk.common.service.BaseService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import com.dk.mdm.service.mst.CusFollowStaffService;
+
+@Api(tags = "客户跟进人API接口")
+@RestController
+@RequestMapping("/cusFollowStaff")
+public class CusFollowStaffController{
+
+    public BaseService<CusFollowStaff> getService() {
+        return cusFollowStaffService;
+    }
+
+    @Autowired
+    private CusFollowStaffService cusFollowStaffService;
+
+}

+ 8 - 8
src/main/java/com/dk/mdm/generator/Generator.java

@@ -53,7 +53,7 @@ public class Generator {
         GlobalConfig gc = new GlobalConfig();
         String projectPath = System.getProperty("user.dir");    //获取当前目录
         gc.setOutputDir(projectPath+"/src/main/java");          //输出到哪个目录
-        gc.setAuthor("姜永辉");                                    //作者
+        gc.setAuthor("于继渤");                                    //作者
         gc.setOpen(false);                                      //是否打开目录
         gc.setFileOverride(false);                              //是否覆盖
         gc.setServiceName("%sService");                         //去Service的I前缀
@@ -79,11 +79,11 @@ public class Generator {
         PackageConfig pc = new PackageConfig();
 //        pc.setModuleName("task");                  //模块包名
         pc.setParent("com.dk.mdm");        //父包路径
-        pc.setEntity("model.pojo.ivt");                     //实体层路径
-        pc.setMapper("mapper.ivt");                 //mapper层路径
-        pc.setXml("mapper.ivt");                       //xml层路径
-        pc.setServiceImpl("service.ivt");                   //业务层路径
-        pc.setController("controller.ivt");             //控制层路径
+        pc.setEntity("model.pojo.mst");                     //实体层路径
+        pc.setMapper("mapper.mst");                 //mapper层路径
+        pc.setXml("mapper.mst");                       //xml层路径
+        pc.setServiceImpl("service.mst");                   //业务层路径
+        pc.setController("controller.mst");             //控制层路径
         //app相关路径
 //        pc.setEntity("model.app.pojo.pset");                     //实体层路径
 //        pc.setMapper("mapper.app.pset");                 //mapper层路径
@@ -94,8 +94,8 @@ public class Generator {
 
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setTablePrefix("t_psi");                                             //表名前缀
-        strategy.setInclude("t_psi_inbound");                                        //设置要映射的表名,只需改这里即可,可以是一个数组,一次性生成多张表。
+        strategy.setTablePrefix("t_crm");                                             //表名前缀
+        strategy.setInclude("t_crm_cus_follow_staff");                                        //设置要映射的表名,只需改这里即可,可以是一个数组,一次性生成多张表。
         strategy.setNaming(NamingStrategy.underline_to_camel);                      //转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);                //字段下划线转驼峰
         strategy.setEntityLombokModel(true);                                        //是否使用lombok开启注解

+ 12 - 0
src/main/java/com/dk/mdm/infrastructure/convert/mst/CusFollowConvert.java

@@ -0,0 +1,12 @@
+package com.dk.mdm.infrastructure.convert.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollow;
+import com.dk.mdm.model.pojo.mst.Customer;
+import com.dk.mdm.model.vo.mst.CusFollowVO;
+import com.dk.mdm.model.vo.mst.CustomerVO;
+import org.mapstruct.Mapper;
+
+@Mapper(componentModel = "spring")
+public interface CusFollowConvert {
+    CusFollow convertToPo(CusFollowVO cusFollowVO);
+}

+ 12 - 0
src/main/java/com/dk/mdm/infrastructure/convert/mst/CusFollowStaffConvert.java

@@ -0,0 +1,12 @@
+package com.dk.mdm.infrastructure.convert.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollowStaff;
+import com.dk.mdm.model.pojo.mst.Customer;
+import com.dk.mdm.model.vo.mst.CusFollowStaffVO;
+import com.dk.mdm.model.vo.mst.CustomerVO;
+import org.mapstruct.Mapper;
+
+@Mapper(componentModel = "spring")
+public interface CusFollowStaffConvert {
+    CusFollowStaff convertToPo(CusFollowStaffVO cusFollowStaffVO);
+}

+ 1 - 0
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -93,6 +93,7 @@
         kind_type AS "kindType",
         kind_tags AS "kindTags",
         display_no AS "displayNo",
+        kind_code AS "id",
         remarks
         from sys.t_data_kind
         where flg_valid

+ 14 - 0
src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.java

@@ -0,0 +1,14 @@
+package com.dk.mdm.mapper.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollow;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+*  客户跟进 Mapper
+*/
+@Repository
+public interface CusFollowMapper extends BaseMapper<CusFollow>{
+	
+}
+

+ 237 - 0
src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.xml

@@ -0,0 +1,237 @@
+<?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="com.dk.mdm.mapper.mst.CusFollowMapper">
+
+    <!-- 通用设置 -->
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List">
+        follow_id, cus_id, follow_status, follow_type, follow_org, follow_staff, follow_time, follow_data, follow_time_len, stay_time_len, intention, invite_result, invite_time, design_staff, next_follow_plan, next_follow_time, annex_paths, measure_status, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.CusFollow">
+        <id column="follow_id" property="followId"/>
+                <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
+                <result column="follow_status" property="followStatus"/>
+                <result column="follow_type" property="followType"/>
+                <result column="follow_org" property="followOrg" typeHandler="UuidTypeHandler"/>
+                <result column="follow_staff" property="followStaff" typeHandler="UuidTypeHandler"/>
+            <result column="follow_time" property="followTime" typeHandler="TimestampTypeHandler"/>
+                <result column="follow_data" property="followData"/>
+                <result column="follow_time_len" property="followTimeLen"/>
+                <result column="stay_time_len" property="stayTimeLen"/>
+                <result column="intention" property="intention"/>
+                <result column="invite_result" property="inviteResult"/>
+            <result column="invite_time" property="inviteTime" typeHandler="TimestampTypeHandler"/>
+                <result column="design_staff" property="designStaff" typeHandler="UuidTypeHandler"/>
+                <result column="next_follow_plan" property="nextFollowPlan"/>
+            <result column="next_follow_time" property="nextFollowTime" typeHandler="TimestampTypeHandler"/>
+                <result column="annex_paths" property="annexPaths" typeHandler="JsonTypeHandler"/>
+                <result column="measure_status" property="measureStatus"/>
+                <result column="remarks" property="remarks"/>
+                <result column="flg_valid" property="flgValid"/>
+                <result column="cp_id" property="cpId"/>
+            <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
+            <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
+                <result column="op_app_code" property="opAppCode"/>
+            <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+                <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition">
+        <where>
+            <if test="cusId != null and cusId != ''">
+                AND cus_id = #{cusId}
+            </if>
+            <if test="followStatus != null and followStatus != ''">
+                AND follow_status = #{followStatus}
+            </if>
+            <if test="followType != null and followType != ''">
+                AND follow_type = #{followType}
+            </if>
+            <if test="followOrg != null and followOrg != ''">
+                AND follow_org = #{followOrg}
+            </if>
+            <if test="followStaff != null and followStaff != ''">
+                AND follow_staff = #{followStaff}
+            </if>
+            <if test="followTime != null">
+                AND follow_time = #{followTime}
+            </if>
+            <if test="followData != null and followData != ''">
+                AND follow_data = #{followData}
+            </if>
+            <if test="followTimeLen != null">
+                AND follow_time_len = #{followTimeLen}
+            </if>
+            <if test="stayTimeLen != null and stayTimeLen != ''">
+                AND stay_time_len = #{stayTimeLen}
+            </if>
+            <if test="intention != null and intention != ''">
+                AND intention = #{intention}
+            </if>
+            <if test="inviteResult != null and inviteResult != ''">
+                AND invite_result = #{inviteResult}
+            </if>
+            <if test="inviteTime != null">
+                AND invite_time = #{inviteTime}
+            </if>
+            <if test="designStaff != null and designStaff != ''">
+                AND design_staff = #{designStaff}
+            </if>
+            <if test="nextFollowPlan != null and nextFollowPlan != ''">
+                AND next_follow_plan = #{nextFollowPlan}
+            </if>
+            <if test="nextFollowTime != null">
+                AND next_follow_time = #{nextFollowTime}
+            </if>
+            <if test="annexPaths != null and annexPaths != ''">
+                AND annex_paths = #{annexPaths}
+            </if>
+            <if test="measureStatus != null and measureStatus != ''">
+                AND measure_status = #{measureStatus}
+            </if>
+            <if test="remarks != null and remarks != ''">
+                AND remarks = #{remarks}
+            </if>
+            <if test="flgValid != null">
+                AND flg_valid = #{flgValid}
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+            <if test="opCreateTime != null">
+                AND op_create_time = #{opCreateTime}
+            </if>
+            <if test="opCreateUserId != null and opCreateUserId != ''">
+                AND op_create_user_id = #{opCreateUserId}
+            </if>
+            <if test="opUpdateTime != null">
+                AND op_update_time = #{opUpdateTime}
+            </if>
+            <if test="opUpdateUserId != null and opUpdateUserId != ''">
+                AND op_update_user_id = #{opUpdateUserId}
+            </if>
+            <if test="opAppCode != null and opAppCode != ''">
+                AND op_app_code = #{opAppCode}
+            </if>
+            <if test="opTimestamp != null">
+                AND op_timestamp = #{opTimestamp}
+            </if>
+            <if test="opDbUser != null and opDbUser != ''">
+                AND op_db_user = #{opDbUser}
+            </if>
+        </where>
+    </sql>
+
+    <sql id="idsForeach">
+        <!-- 根据主键followId批量操作 -->
+        WHERE follow_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </sql>
+
+    <!-- 查询表t_crm_cus_follow,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow
+        <include refid="Condition"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表t_crm_cus_follow,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM t_crm_cus_follow
+        <include refid="Condition"/>
+    </select>
+
+    <!-- 根据主键查询表t_crm_cus_follow的一行数据 -->
+    <select id="selectById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow
+        WHERE follow_id = #{followId}::uuid
+    </select>
+
+    <!-- 根据主键锁定表t_crm_cus_follow的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow
+        WHERE follow_id = #{followId}
+        for update
+    </select>
+
+    <!-- 根据主键锁定表t_crm_cus_follow的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow
+        <include refid="idsForeach"/>
+        for update
+    </select>
+
+    <insert id="insertBatch">
+        insert into t_crm_cus_follow
+        (
+        <trim suffixOverrides=",">
+            cus_id,
+            follow_status,
+            follow_type,
+            follow_org,
+            follow_staff,
+            follow_time,
+            follow_data,
+            follow_time_len,
+            stay_time_len,
+            intention,
+            invite_result,
+            invite_time,
+            design_staff,
+            next_follow_plan,
+            next_follow_time,
+            annex_paths,
+            measure_status,
+            remarks,
+            cp_id,
+            op_app_code,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+            <trim suffixOverrides=",">
+                #{item.cusId}::uuid,
+                #{item.followStatus},
+                #{item.followType},
+                #{item.followOrg}::uuid,
+                #{item.followStaff}::uuid,
+                #{item.followTime},
+                #{item.followData},
+                #{item.followTimeLen},
+                #{item.stayTimeLen},
+                #{item.intention},
+                #{item.inviteResult},
+                #{item.inviteTime},
+                #{item.designStaff}::uuid,
+                #{item.nextFollowPlan},
+                #{item.nextFollowTime},
+                #{item.annexPaths},
+                #{item.measureStatus},
+                #{item.remarks},
+                #{item.cpId},
+                #{item.opAppCode},
+            </trim>
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 14 - 0
src/main/java/com/dk/mdm/mapper/mst/CusFollowStaffMapper.java

@@ -0,0 +1,14 @@
+package com.dk.mdm.mapper.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollowStaff;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+*  客户跟进人 Mapper
+*/
+@Repository
+public interface CusFollowStaffMapper extends BaseMapper<CusFollowStaff>{
+	
+}
+

+ 125 - 0
src/main/java/com/dk/mdm/mapper/mst/CusFollowStaffMapper.xml

@@ -0,0 +1,125 @@
+<?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="com.dk.mdm.mapper.mst.CusFollowStaffMapper">
+
+    <!-- 通用设置 -->
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List">
+        cus_id, follow_staff, last_follow_id, last_follow_status, last_follow_time, follow_count, cp_id
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.CusFollowStaff">
+        <id column="cus_id" property="cusId"/>
+                <result column="follow_staff" property="followStaff" typeHandler="UuidTypeHandler"/>
+                <result column="last_follow_id" property="lastFollowId" typeHandler="UuidTypeHandler"/>
+                <result column="last_follow_status" property="lastFollowStatus"/>
+            <result column="last_follow_time" property="lastFollowTime" typeHandler="TimestampTypeHandler"/>
+                <result column="follow_count" property="followCount"/>
+                <result column="cp_id" property="cpId"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition">
+        <where>
+            <if test="followStaff != null and followStaff != ''">
+                AND follow_staff = #{followStaff}
+            </if>
+            <if test="lastFollowId != null and lastFollowId != ''">
+                AND last_follow_id = #{lastFollowId}
+            </if>
+            <if test="lastFollowStatus != null and lastFollowStatus != ''">
+                AND last_follow_status = #{lastFollowStatus}
+            </if>
+            <if test="lastFollowTime != null">
+                AND last_follow_time = #{lastFollowTime}
+            </if>
+            <if test="followCount != null">
+                AND follow_count = #{followCount}
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+    </sql>
+
+    <sql id="idsForeach">
+        <!-- 根据主键cusId批量操作 -->
+        WHERE cus_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </sql>
+
+    <!-- 查询表t_crm_cus_follow_staff,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow_staff
+        <include refid="Condition"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表t_crm_cus_follow_staff,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM t_crm_cus_follow_staff
+        <include refid="Condition"/>
+    </select>
+
+    <!-- 根据主键查询表t_crm_cus_follow_staff的一行数据 -->
+    <select id="selectById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow_staff
+        WHERE cus_id = #{cusId}::uuid
+    </select>
+
+    <!-- 根据主键锁定表t_crm_cus_follow_staff的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow_staff
+        WHERE cus_id = #{cusId}
+        for update
+    </select>
+
+    <!-- 根据主键锁定表t_crm_cus_follow_staff的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_crm_cus_follow_staff
+        <include refid="idsForeach"/>
+        for update
+    </select>
+
+    <insert id="insertBatch">
+        insert into t_crm_cus_follow_staff
+        (
+        <trim suffixOverrides=",">
+            follow_staff,
+            last_follow_id,
+            last_follow_status,
+            last_follow_time,
+            follow_count,
+            cp_id,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+            <trim suffixOverrides=",">
+                #{item.followStaff}::uuid,
+                #{item.lastFollowId}::uuid,
+                #{item.lastFollowStatus},
+                #{item.lastFollowTime},
+                #{item.followCount},
+                #{item.cpId},
+            </trim>
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 11 - 1
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -90,6 +90,7 @@
         <result column="reportStaffName" property="reportStaffName"/>
         <result column="followStaffName" property="followStaffName"/>
         <result column="lastFollowStaffName" property="lastFollowStaffName"/>
+        <result column="saleStatusName" property="saleStatusName"/>
 
     </resultMap>
 
@@ -174,6 +175,13 @@
             <if test="cpId != null">
                 AND tmc.cp_id = #{cpId}
             </if>
+            <if  test="searchText != null">
+                AND (data_value  like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  dict_code  like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  remarks like concat('%', my_ex.likequery(#{searchText}) , '%')
+                )
+            </if>
+
 
         </where>
     </sql>
@@ -194,7 +202,8 @@
         tmsc.channel_name  AS  "channelName",
         tmo.org_name  AS  "orgName",
         tms.staff_name  AS  "staffName",
-        tms2.staff_name  AS  "reportStaffName"
+        tms2.staff_name  AS  "reportStaffName",
+        tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName"
 --         tms3.staff_name  AS  "followStaffName",
 --         tms4.staff_name  AS  "lastFollowStaffName"
         FROM dkic_b.t_mst_customer tmc
@@ -203,6 +212,7 @@
         LEFT JOIN  dkic_b.t_mst_org tmo  on tmo.org_id =  tmc.org_id
         LEFT JOIN  dkic_b.t_mst_staff tms  on tms.staff_id =  tmc.staff_id
         LEFT JOIN  dkic_b.t_mst_staff tms2  on tms2.staff_id =  tmc.report_staff
+        LEFT JOIN  sys.t_data_kind tdk  on tdk.kind_code =  tmc.sale_status
 --         LEFT JOIN  dkic_b.t_mst_staff tms3  on tms3.staff_id =  tmc.follow_staffs
 --         LEFT JOIN  dkic_b.t_mst_staff tms4  on tms4.staff_id =  tmc.last_follow_staff
         <include refid="Condition"/>

+ 296 - 0
src/main/java/com/dk/mdm/model/pojo/mst/CusFollow.java

@@ -0,0 +1,296 @@
+package com.dk.mdm.model.pojo.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ExportTitle("客户跟进")
+@TableName(value = "t_crm_cus_follow", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进", description="表名:t_crm_cus_follow")
+public class CusFollow   implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 跟进ID
+     */
+    @ApiModelProperty(value = "跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followId;
+
+
+    /**
+     * 客户ID (陌生接待时为null)
+     */
+    @Excel(name = "客户ID (陌生接待时为null)")
+    @ApiModelProperty(value = "客户ID (陌生接待时为null)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)
+     */
+    @Excel(name = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    @ApiModelProperty(value = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    private String followStatus;
+
+
+    /**
+     * 跟进方式 (【系统字典】电话、微信、上门、进店)
+     */
+    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    private String followType;
+
+
+    /**
+     * 跟进部门
+     */
+    @Excel(name = "跟进部门")
+    @ApiModelProperty(value = "跟进部门")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followOrg;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 跟进时间
+     */
+    @Excel(name = "跟进时间")
+    @ApiModelProperty(value = "跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime followTime;
+
+
+    /**
+     * 跟进内容
+     */
+    @Excel(name = "跟进内容")
+    @ApiModelProperty(value = "跟进内容")
+    private String followData;
+
+
+    /**
+     * 跟进时长 (分钟)
+     */
+    @Excel(name = "跟进时长 (分钟)")
+    @ApiModelProperty(value = "跟进时长 (分钟)")
+    private Integer followTimeLen;
+
+
+    /**
+     * 留店时长 (【系统字典】10-20、20-30。。)
+     */
+    @Excel(name = "留店时长 (【系统字典】10-20、20-30。。)")
+    @ApiModelProperty(value = "留店时长 (【系统字典】10-20、20-30。。)")
+    private String stayTimeLen;
+
+
+    /**
+     * 客户意向 (【系统字典】)
+     */
+    @Excel(name = "客户意向 (【系统字典】)")
+    @ApiModelProperty(value = "客户意向 (【系统字典】)")
+    private String intention;
+
+
+    /**
+     * 邀约结果 (【系统字典】)
+     */
+    @Excel(name = "邀约结果 (【系统字典】)")
+    @ApiModelProperty(value = "邀约结果 (【系统字典】)")
+    private String inviteResult;
+
+
+    /**
+     * 邀约时间
+     */
+    @Excel(name = "邀约时间")
+    @ApiModelProperty(value = "邀约时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime inviteTime;
+
+
+    /**
+     * 设计师
+     */
+    @Excel(name = "设计师")
+    @ApiModelProperty(value = "设计师")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String designStaff;
+
+
+    /**
+     * 下次跟进计划
+     */
+    @Excel(name = "下次跟进计划")
+    @ApiModelProperty(value = "下次跟进计划")
+    private String nextFollowPlan;
+
+
+    /**
+     * 下次跟进时间 (提醒时间)
+     */
+    @Excel(name = "下次跟进时间 (提醒时间)")
+    @ApiModelProperty(value = "下次跟进时间 (提醒时间)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime nextFollowTime;
+
+
+    /**
+     * 跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
+     */
+    @Excel(name = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @ApiModelProperty(value = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONObject annexPaths;
+
+
+    /**
+     * 量尺状态 (【系统字典】)
+     */
+    @Excel(name = "量尺状态 (【系统字典】)")
+    @ApiModelProperty(value = "量尺状态 (【系统字典】)")
+    private String measureStatus;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 115 - 0
src/main/java/com/dk/mdm/model/pojo/mst/CusFollowStaff.java

@@ -0,0 +1,115 @@
+package com.dk.mdm.model.pojo.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进人
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("客户跟进人")
+@TableName(value = "t_crm_cus_follow_staff", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进人", description="表名:t_crm_cus_follow_staff")
+public class CusFollowStaff extends PageInfo<CusFollowStaff> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 客户ID
+     */
+
+    @ApiModelProperty(value = "客户ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 最后跟进ID
+     */
+    @Excel(name = "最后跟进ID")
+    @ApiModelProperty(value = "最后跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String lastFollowId;
+
+
+    /**
+     * 最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)
+     */
+    @Excel(name = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    @ApiModelProperty(value = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    private String lastFollowStatus;
+
+
+    /**
+     * 最后跟进时间
+     */
+    @Excel(name = "最后跟进时间")
+    @ApiModelProperty(value = "最后跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime lastFollowTime;
+
+
+    /**
+     * 跟进次数
+     */
+    @Excel(name = "跟进次数")
+    @ApiModelProperty(value = "跟进次数")
+    private Integer followCount;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 299 - 0
src/main/java/com/dk/mdm/model/query/mst/CusFollowQuery.java

@@ -0,0 +1,299 @@
+package com.dk.mdm.model.query.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.JsonTypeHandler;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("客户跟进")
+@TableName(value = "t_crm_cus_follow", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进", description="表名:t_crm_cus_follow")
+public class CusFollowQuery extends PageInfo<CusFollowQuery> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 跟进ID
+     */
+    @ApiModelProperty(value = "跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followId;
+
+
+    /**
+     * 客户ID (陌生接待时为null)
+     */
+    @Excel(name = "客户ID (陌生接待时为null)")
+    @ApiModelProperty(value = "客户ID (陌生接待时为null)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)
+     */
+    @Excel(name = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    @ApiModelProperty(value = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    private String followStatus;
+
+
+    /**
+     * 跟进方式 (【系统字典】电话、微信、上门、进店)
+     */
+    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    private String followType;
+
+
+    /**
+     * 跟进部门
+     */
+    @Excel(name = "跟进部门")
+    @ApiModelProperty(value = "跟进部门")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followOrg;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 跟进时间
+     */
+    @Excel(name = "跟进时间")
+    @ApiModelProperty(value = "跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime followTime;
+
+
+    /**
+     * 跟进内容
+     */
+    @Excel(name = "跟进内容")
+    @ApiModelProperty(value = "跟进内容")
+    private String followData;
+
+
+    /**
+     * 跟进时长 (分钟)
+     */
+    @Excel(name = "跟进时长 (分钟)")
+    @ApiModelProperty(value = "跟进时长 (分钟)")
+    private Integer followTimeLen;
+
+
+    /**
+     * 留店时长 (【系统字典】10-20、20-30。。)
+     */
+    @Excel(name = "留店时长 (【系统字典】10-20、20-30。。)")
+    @ApiModelProperty(value = "留店时长 (【系统字典】10-20、20-30。。)")
+    private String stayTimeLen;
+
+
+    /**
+     * 客户意向 (【系统字典】)
+     */
+    @Excel(name = "客户意向 (【系统字典】)")
+    @ApiModelProperty(value = "客户意向 (【系统字典】)")
+    private String intention;
+
+
+    /**
+     * 邀约结果 (【系统字典】)
+     */
+    @Excel(name = "邀约结果 (【系统字典】)")
+    @ApiModelProperty(value = "邀约结果 (【系统字典】)")
+    private String inviteResult;
+
+
+    /**
+     * 邀约时间
+     */
+    @Excel(name = "邀约时间")
+    @ApiModelProperty(value = "邀约时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime inviteTime;
+
+
+    /**
+     * 设计师
+     */
+    @Excel(name = "设计师")
+    @ApiModelProperty(value = "设计师")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String designStaff;
+
+
+    /**
+     * 下次跟进计划
+     */
+    @Excel(name = "下次跟进计划")
+    @ApiModelProperty(value = "下次跟进计划")
+    private String nextFollowPlan;
+
+
+    /**
+     * 下次跟进时间 (提醒时间)
+     */
+    @Excel(name = "下次跟进时间 (提醒时间)")
+    @ApiModelProperty(value = "下次跟进时间 (提醒时间)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime nextFollowTime;
+
+
+    /**
+     * 跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
+     */
+    @Excel(name = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @ApiModelProperty(value = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONObject annexPaths;
+
+
+    /**
+     * 量尺状态 (【系统字典】)
+     */
+    @Excel(name = "量尺状态 (【系统字典】)")
+    @ApiModelProperty(value = "量尺状态 (【系统字典】)")
+    private String measureStatus;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 113 - 0
src/main/java/com/dk/mdm/model/query/mst/CusFollowStaffQuery.java

@@ -0,0 +1,113 @@
+package com.dk.mdm.model.query.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进人
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("客户跟进人")
+@TableName(value = "t_crm_cus_follow_staff", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进人", description="表名:t_crm_cus_follow_staff")
+public class CusFollowStaffQuery extends PageInfo<CusFollowStaffQuery> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 客户ID
+     */
+
+    @ApiModelProperty(value = "客户ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 最后跟进ID
+     */
+    @Excel(name = "最后跟进ID")
+    @ApiModelProperty(value = "最后跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String lastFollowId;
+
+
+    /**
+     * 最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)
+     */
+    @Excel(name = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    @ApiModelProperty(value = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    private String lastFollowStatus;
+
+
+    /**
+     * 最后跟进时间
+     */
+    @Excel(name = "最后跟进时间")
+    @ApiModelProperty(value = "最后跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime lastFollowTime;
+
+
+    /**
+     * 跟进次数
+     */
+    @Excel(name = "跟进次数")
+    @ApiModelProperty(value = "跟进次数")
+    private Integer followCount;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 106 - 0
src/main/java/com/dk/mdm/model/response/mst/CusFollowStaffResponse.java

@@ -0,0 +1,106 @@
+package com.dk.mdm.model.response.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进人
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ExportTitle("客户跟进人")
+@TableName(value = "t_crm_cus_follow_staff", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进人", description="表名:t_crm_cus_follow_staff")
+public class CusFollowStaffResponse implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 客户ID
+     */
+
+    @ApiModelProperty(value = "客户ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 最后跟进ID
+     */
+    @Excel(name = "最后跟进ID")
+    @ApiModelProperty(value = "最后跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String lastFollowId;
+
+
+    /**
+     * 最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)
+     */
+    @Excel(name = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    @ApiModelProperty(value = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    private String lastFollowStatus;
+
+
+    /**
+     * 最后跟进时间
+     */
+    @Excel(name = "最后跟进时间")
+    @ApiModelProperty(value = "最后跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime lastFollowTime;
+
+
+    /**
+     * 跟进次数
+     */
+    @Excel(name = "跟进次数")
+    @ApiModelProperty(value = "跟进次数")
+    private Integer followCount;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 223 - 0
src/main/java/com/dk/mdm/model/response/mst/CusFollowVOResponse.java

@@ -0,0 +1,223 @@
+package com.dk.mdm.model.response.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.JsonTypeHandler;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ExportTitle("客户跟进")
+@TableName(value = "t_crm_cus_follow", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进", description="表名:t_crm_cus_follow")
+public class CusFollowVOResponse implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 跟进ID
+     */
+    @ApiModelProperty(value = "跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followId;
+
+
+    /**
+     * 客户ID (陌生接待时为null)
+     */
+    @Excel(name = "客户ID (陌生接待时为null)")
+    @ApiModelProperty(value = "客户ID (陌生接待时为null)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)
+     */
+    @Excel(name = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    @ApiModelProperty(value = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    private String followStatus;
+
+
+    /**
+     * 跟进方式 (【系统字典】电话、微信、上门、进店)
+     */
+    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    private String followType;
+
+
+    /**
+     * 跟进部门
+     */
+    @Excel(name = "跟进部门")
+    @ApiModelProperty(value = "跟进部门")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followOrg;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 跟进时间
+     */
+    @Excel(name = "跟进时间")
+    @ApiModelProperty(value = "跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime followTime;
+
+
+    /**
+     * 跟进内容
+     */
+    @Excel(name = "跟进内容")
+    @ApiModelProperty(value = "跟进内容")
+    private String followData;
+
+
+    /**
+     * 跟进时长 (分钟)
+     */
+    @Excel(name = "跟进时长 (分钟)")
+    @ApiModelProperty(value = "跟进时长 (分钟)")
+    private Integer followTimeLen;
+
+
+    /**
+     * 留店时长 (【系统字典】10-20、20-30。。)
+     */
+    @Excel(name = "留店时长 (【系统字典】10-20、20-30。。)")
+    @ApiModelProperty(value = "留店时长 (【系统字典】10-20、20-30。。)")
+    private String stayTimeLen;
+
+
+    /**
+     * 客户意向 (【系统字典】)
+     */
+    @Excel(name = "客户意向 (【系统字典】)")
+    @ApiModelProperty(value = "客户意向 (【系统字典】)")
+    private String intention;
+
+
+    /**
+     * 邀约结果 (【系统字典】)
+     */
+    @Excel(name = "邀约结果 (【系统字典】)")
+    @ApiModelProperty(value = "邀约结果 (【系统字典】)")
+    private String inviteResult;
+
+
+    /**
+     * 邀约时间
+     */
+    @Excel(name = "邀约时间")
+    @ApiModelProperty(value = "邀约时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime inviteTime;
+
+
+    /**
+     * 设计师
+     */
+    @Excel(name = "设计师")
+    @ApiModelProperty(value = "设计师")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String designStaff;
+
+
+    /**
+     * 下次跟进计划
+     */
+    @Excel(name = "下次跟进计划")
+    @ApiModelProperty(value = "下次跟进计划")
+    private String nextFollowPlan;
+
+
+    /**
+     * 下次跟进时间 (提醒时间)
+     */
+    @Excel(name = "下次跟进时间 (提醒时间)")
+    @ApiModelProperty(value = "下次跟进时间 (提醒时间)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime nextFollowTime;
+
+
+    /**
+     * 跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
+     */
+    @Excel(name = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @ApiModelProperty(value = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONObject annexPaths;
+
+
+    /**
+     * 量尺状态 (【系统字典】)
+     */
+    @Excel(name = "量尺状态 (【系统字典】)")
+    @ApiModelProperty(value = "量尺状态 (【系统字典】)")
+    private String measureStatus;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 15 - 75
src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java

@@ -273,91 +273,31 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
     private Integer cpId;
 
 
-    /**
-     * 创建时间 (触发器自动处理)
-     */
-    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opCreateTime;
-
-
-    /**
-     * 创建用户 (触发器自动处理)
-     */
-    @Excel(name = "创建用户 (触发器自动处理)")
-    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opCreateUserId;
-
-
-    /**
-     * 修改时间 (触发器自动处理)
-     */
-    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opUpdateTime;
-
-
-    /**
-     * 修改用户 (触发器自动处理)
-     */
-    @Excel(name = "修改用户 (触发器自动处理)")
-    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opUpdateUserId;
-
-
-    /**
-     * 数据操作应用 (触发器自动处理)
-     */
-    @Excel(name = "数据操作应用 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
-    private String opAppCode;
-
-
-    /**
-     * 数据时间戳 (触发器自动处理)
-     */
-    @Excel(name = "数据时间戳 (触发器自动处理)")
-    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opTimestamp;
-
-
-    /**
-     * 数据操作数据库用户 (触发器自动处理)
-     */
-    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
-    private String opDbUser;
-
-
-    /*
-     * 相关属性
-     * @TableField(exist = false)
-     */
-
-    /*
-     * 关联属性 + 查询条件
-     * @TableField(exist = false)
-     */
-
-
 
 
+    @ApiModelProperty(value = "来源名称")
     private String cusFromName;
+
+    @ApiModelProperty(value = "渠道")
     private String channelName;
+
+    @ApiModelProperty(value = "部门")
     private String orgName;
+
+    @ApiModelProperty(value = "员工")
     private String staffName;
+
+    @ApiModelProperty(value = "报备人")
     private String reportStaffName;
+
+    @ApiModelProperty(value = "跟进人")
     private String followStaffName;
+
+    @ApiModelProperty(value = "")
     private String lastFollowStaffName;
 
+    private String saleStatusName;
+
     private static final long serialVersionUID = 1L;
 
 }

+ 115 - 0
src/main/java/com/dk/mdm/model/vo/mst/CusFollowStaffVO.java

@@ -0,0 +1,115 @@
+package com.dk.mdm.model.vo.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进人
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("客户跟进人")
+@TableName(value = "t_crm_cus_follow_staff", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进人", description="表名:t_crm_cus_follow_staff")
+public class CusFollowStaffVO extends PageInfo<CusFollowStaffVO> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 客户ID
+     */
+
+    @ApiModelProperty(value = "客户ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 最后跟进ID
+     */
+    @Excel(name = "最后跟进ID")
+    @ApiModelProperty(value = "最后跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String lastFollowId;
+
+
+    /**
+     * 最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)
+     */
+    @Excel(name = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    @ApiModelProperty(value = "最后跟进状态 (【系统字典】跟进状态:报备、跟进、邀约、报价、成交)")
+    private String lastFollowStatus;
+
+
+    /**
+     * 最后跟进时间
+     */
+    @Excel(name = "最后跟进时间")
+    @ApiModelProperty(value = "最后跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime lastFollowTime;
+
+
+    /**
+     * 跟进次数
+     */
+    @Excel(name = "跟进次数")
+    @ApiModelProperty(value = "跟进次数")
+    private Integer followCount;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 296 - 0
src/main/java/com/dk/mdm/model/vo/mst/CusFollowVO.java

@@ -0,0 +1,296 @@
+package com.dk.mdm.model.vo.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.JsonTypeHandler;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *  客户跟进
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ExportTitle("客户跟进")
+@TableName(value = "t_crm_cus_follow", autoResultMap = true)
+@ApiModel(value="实体类:客户跟进", description="表名:t_crm_cus_follow")
+public class CusFollowVO implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 跟进ID
+     */
+    @ApiModelProperty(value = "跟进ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followId;
+
+
+    /**
+     * 客户ID (陌生接待时为null)
+     */
+    @Excel(name = "客户ID (陌生接待时为null)")
+    @ApiModelProperty(value = "客户ID (陌生接待时为null)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)
+     */
+    @Excel(name = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    @ApiModelProperty(value = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    private String followStatus;
+
+
+    /**
+     * 跟进方式 (【系统字典】电话、微信、上门、进店)
+     */
+    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
+    private String followType;
+
+
+    /**
+     * 跟进部门
+     */
+    @Excel(name = "跟进部门")
+    @ApiModelProperty(value = "跟进部门")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followOrg;
+
+
+    /**
+     * 跟进人
+     */
+    @Excel(name = "跟进人")
+    @ApiModelProperty(value = "跟进人")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
+
+
+    /**
+     * 跟进时间
+     */
+    @Excel(name = "跟进时间")
+    @ApiModelProperty(value = "跟进时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime followTime;
+
+
+    /**
+     * 跟进内容
+     */
+    @Excel(name = "跟进内容")
+    @ApiModelProperty(value = "跟进内容")
+    private String followData;
+
+
+    /**
+     * 跟进时长 (分钟)
+     */
+    @Excel(name = "跟进时长 (分钟)")
+    @ApiModelProperty(value = "跟进时长 (分钟)")
+    private Integer followTimeLen;
+
+
+    /**
+     * 留店时长 (【系统字典】10-20、20-30。。)
+     */
+    @Excel(name = "留店时长 (【系统字典】10-20、20-30。。)")
+    @ApiModelProperty(value = "留店时长 (【系统字典】10-20、20-30。。)")
+    private String stayTimeLen;
+
+
+    /**
+     * 客户意向 (【系统字典】)
+     */
+    @Excel(name = "客户意向 (【系统字典】)")
+    @ApiModelProperty(value = "客户意向 (【系统字典】)")
+    private String intention;
+
+
+    /**
+     * 邀约结果 (【系统字典】)
+     */
+    @Excel(name = "邀约结果 (【系统字典】)")
+    @ApiModelProperty(value = "邀约结果 (【系统字典】)")
+    private String inviteResult;
+
+
+    /**
+     * 邀约时间
+     */
+    @Excel(name = "邀约时间")
+    @ApiModelProperty(value = "邀约时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime inviteTime;
+
+
+    /**
+     * 设计师
+     */
+    @Excel(name = "设计师")
+    @ApiModelProperty(value = "设计师")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String designStaff;
+
+
+    /**
+     * 下次跟进计划
+     */
+    @Excel(name = "下次跟进计划")
+    @ApiModelProperty(value = "下次跟进计划")
+    private String nextFollowPlan;
+
+
+    /**
+     * 下次跟进时间 (提醒时间)
+     */
+    @Excel(name = "下次跟进时间 (提醒时间)")
+    @ApiModelProperty(value = "下次跟进时间 (提醒时间)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime nextFollowTime;
+
+
+    /**
+     * 跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
+     */
+    @Excel(name = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @ApiModelProperty(value = "跟进附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONObject annexPaths;
+
+
+    /**
+     * 量尺状态 (【系统字典】)
+     */
+    @Excel(name = "量尺状态 (【系统字典】)")
+    @ApiModelProperty(value = "量尺状态 (【系统字典】)")
+    private String measureStatus;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 20 - 0
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -705,6 +705,26 @@ public class CommonService extends BaseService<Map<String, Object>> {
         if (dataSourceCode.equals("staff")) {
             list = commonMapper.getStaff(map);
         }
+        //客户意向
+        if (dataSourceCode.equals("customerIntention")) {
+            map.put("kindType","客户意向");
+            list = commonMapper.getDataKind(map);
+        }
+        //留店时长
+        if (dataSourceCode.equals("storeRetentionTime")) {
+            map.put("kindType","留店时长");
+            list = commonMapper.getDataKind(map);
+        }
+        //邀约结果
+        if (dataSourceCode.equals("invitationResults")) {
+            map.put("kindType","邀约结果");
+            list = commonMapper.getDataKind(map);
+        }
+        //量尺状态
+        if (dataSourceCode.equals("scaleStatus")) {
+            map.put("kindType","量尺状态");
+            list = commonMapper.getDataKind(map);
+        }
         return ResponseResultUtil.success(list);
     }
 }

+ 8 - 48
src/main/java/com/dk/mdm/service/ivt/IntoReturnService.java

@@ -287,62 +287,22 @@ public class IntoReturnService extends BaseService<IntoReturn> {
     //TODO 未完成
 
     /**
-     * @desc : 冲正
+     * @desc : 作废
      * @date : 2022/6/28 16:58
      * @author : 于继渤
      */
     @Transactional(rollbackFor = {Exception.class})
-    public ResponseResultVO<String> righting(String purId, List<String> intoReturnIdList) {
+    public ResponseResultVO<String> cancel(IntoReturnVO intoReturnVO) {
         //根据订单id查询到订单
-        Purchase purchase = purchaseMapper.selectPurchaseByRighting(new PurchaseQuery().setPurId(purId));
-
-
-        //查询采购退货数据List
-        List<IntoReturn> intoReturnList = intoReturnMapper.selectReturnList(intoReturnIdList);
-
-        //根据订单id查询所有退货单
-        List<IntoReturnResponse> intoReturnResponsesList = intoReturnMapper.selectByCond(new IntoReturnQuery().setIntoReturnIdList(intoReturnIdList));
-
-
-        //本次冲正退货总额
-        BigDecimal sumReturnAmount = intoReturnResponsesList.stream().map(IntoReturnResponse::getSumAmount)
-                .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
-
-//        for (IntoReturn intoReturn : intoReturnList) {
+//        Purchase purchase = purchaseMapper.selectPurchaseByRighting(new PurchaseQuery().setPurId(purId));
+//
 //
+//        //查询采购退货数据List
+//        List<IntoReturn> intoReturnList = intoReturnMapper.selectReturnList(intoReturnIdList);
 //
-//        }
-        //订单退货金额、退货数量
-        purchase.setReturnAmt(purchase.getReturnAmt().subtract(intoReturnList.stream()
-                .map(IntoReturn::getSumAmount).reduce(BigDecimal.ZERO, BigDecimal::add)).setScale(2, BigDecimal.ROUND_HALF_UP));
-        purchase.setReturnQty(purchase.getReturnQty().subtract(intoReturnList.stream()
-                .map(IntoReturn::getSumQuantity).reduce(BigDecimal.ZERO, BigDecimal::add)).setScale(6, BigDecimal.ROUND_HALF_UP));
+//        //根据订单id查询所有退货单
+//        List<IntoReturnResponse> intoReturnResponsesList = intoReturnMapper.selectByCond(new IntoReturnQuery().setIntoReturnIdList(intoReturnIdList));
         return null;
     }
 
-
-    //TODO 未完成
-    @Transactional(rollbackFor = {Exception.class})
-    public void rightingByIbossReturnSuccess(IntoReturn intoReturn) {
-        //修改原单总单的状态
-        intoReturnMapper.updateById(new IntoReturn().setReturnId(intoReturn.getReturnId()).
-                setReturnStatus("退货状态-冲正"));
-
-
-        //region 根据id查询原始单据信息、生成逆向生成销售退货总单数据
-        //根据id查询原始单据信息
-        IntoReturn intoReturnRig = intoReturnMapper.selectReturnByRighting(intoReturn.getReturnId());
-        Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.OUTBOUND.getName(), false);
-        intoReturnRig.setReturnId(codeMap.get("outId").toString()).setReturnNo(codeMap.get("outNote").toString())
-                .setReturnType(Constant.returnType.PURRETURN.getName());
-
-        intoReturnRig.setReturnType("退货类型-冲正");
-        intoReturnRig.setReturnStatus("退货状态-冲正");
-        //退货单状态 冲正
-        intoReturnRig.setMakeTime(LocalDateTime.now());
-        //endregion
-
-
-    }
-
 }

+ 23 - 0
src/main/java/com/dk/mdm/service/mst/CusFollowService.java

@@ -0,0 +1,23 @@
+package com.dk.mdm.service.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollow;
+import com.dk.mdm.mapper.mst.CusFollowMapper;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional
+public class CusFollowService extends BaseService<CusFollow> {
+
+	@Override
+	public BaseMapper<CusFollow> getRepository() {
+		return cusFollowMapper;
+	}
+
+	@Autowired
+	private CusFollowMapper cusFollowMapper;
+
+}

+ 23 - 0
src/main/java/com/dk/mdm/service/mst/CusFollowStaffService.java

@@ -0,0 +1,23 @@
+package com.dk.mdm.service.mst;
+
+import com.dk.mdm.model.pojo.mst.CusFollowStaff;
+import com.dk.mdm.mapper.mst.CusFollowStaffMapper;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional
+public class CusFollowStaffService extends BaseService<CusFollowStaff> {
+
+	@Override
+	public BaseMapper<CusFollowStaff> getRepository() {
+		return cusFollowStaffMapper;
+	}
+
+	@Autowired
+	private CusFollowStaffMapper cusFollowStaffMapper;
+
+}