Răsfoiți Sursa

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

songyang 2 ani în urmă
părinte
comite
08b4ad14d4

+ 6 - 2
src/main/java/com/dk/mdm/controller/mst/CusFollowController.java

@@ -56,8 +56,12 @@ public class CusFollowController{
     public ResponseResultVO<?> insert(@RequestBody CusFollowVO cusFollowVO) {
         return cusFollowService.insert(cusFollowVO);
     }
-
-    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    /**
+     * @desc   : 查询跟进记录
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "条件查询", notes = "条件查询")
     @PostMapping({"select_by_list"})
     public ResponseResultVO<List<CusFollowResponse>> selectByList(@RequestBody CusFollowQuery customerQuery) {
         return cusFollowService.selectByList(customerQuery);

+ 14 - 3
src/main/java/com/dk/mdm/controller/mst/OrgController.java

@@ -5,7 +5,7 @@ import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.model.pojo.mst.Org;
 import com.dk.common.service.BaseService;
 import com.dk.mdm.model.query.mst.OrgQuery;
-import com.dk.mdm.model.vo.mst.OrgVO;
+import com.dk.common.model.vo.mst.OrgVO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -13,8 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import io.swagger.annotations.Api;
 import com.dk.mdm.service.mst.OrgService;
 
-import java.util.List;
-
 @Api(tags = "组织机构API接口")
 @RestController
 @RequestMapping("/mst/org")
@@ -49,6 +47,19 @@ public class OrgController{
         return orgService.insert(orgVO);
     }
 
+
+    /**
+     * @desc   : 新建组织部门--注册顶级部门
+     * @author : 姜永辉
+     * @date   : 2024/2/27 9:13
+     */
+    @ApiOperation( value = "新建组织部门", notes = "新建组织部门" )
+    @PostMapping({"insert_feign_org"})
+    @Transactional(rollbackFor = Exception.class)
+    public ResponseResultVO<?> insertFeignOrg(@RequestBody OrgVO orgVO) {
+        return orgService.insert(orgVO);
+    }
+
     /**
      * @desc   : 通过ID查询
      * @author : 宋扬

+ 1 - 3
src/main/java/com/dk/mdm/infrastructure/convert/mst/OrgConvert.java

@@ -1,9 +1,7 @@
 package com.dk.mdm.infrastructure.convert.mst;
 
-import com.dk.mdm.model.pojo.core.Organization;
 import com.dk.mdm.model.pojo.mst.Org;
-import com.dk.mdm.model.vo.core.OrganizationVO;
-import com.dk.mdm.model.vo.mst.OrgVO;
+import com.dk.common.model.vo.mst.OrgVO;
 import org.mapstruct.Mapper;
 
  /**

+ 0 - 2
src/main/java/com/dk/mdm/infrastructure/convert/mst/SupplierConvert.java

@@ -1,8 +1,6 @@
 package com.dk.mdm.infrastructure.convert.mst;
 
-import com.dk.mdm.model.pojo.mst.Org;
 import com.dk.mdm.model.pojo.mst.Supplier;
-import com.dk.mdm.model.vo.mst.OrgVO;
 import com.dk.mdm.model.vo.mst.SupplierVo;
 import org.mapstruct.Mapper;
 

+ 10 - 1
src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.java

@@ -23,7 +23,9 @@ public interface CusFollowMapper extends BaseMapper<CusFollow>{
      * @date : 2024/2/26 10:36
      */
     List<CusFollowResponse> selectByCond(CusFollowQuery cusFollowQuery);
-    List<CusFollowResponse> selectByList(CusFollowQuery cusFollowQuery);
+
+
+
 
     /**
      * @desc   : 根据条件进行查询(数量)
@@ -31,6 +33,13 @@ public interface CusFollowMapper extends BaseMapper<CusFollow>{
      * @date : 2024/2/26 10:36
      */
     Long countByCond(CusFollowQuery cusFollowQuery);
+
+    /**
+     * @desc   : 查询跟进记录
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    List<CusFollowResponse> selectByList(CusFollowQuery cusFollowQuery);
 	
 }
 

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

@@ -5,10 +5,10 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <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
+        follow_id, cus_id, follow_status, 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>
     <sql id="Base_Column_List_Join">
-        tccf.follow_id, tccf.cus_id, tccf.follow_status, tccf.follow_type, tccf.follow_org, tccf.follow_staff, tccf.follow_time, tccf.follow_data,
+        tccf.follow_id, tccf.cus_id, tccf.follow_status,  tccf.follow_org, tccf.follow_staff, tccf.follow_time, tccf.follow_data,
                  tccf.follow_time_len, tccf.stay_time_len, tccf.intention, tccf.invite_result, tccf.invite_time, tccf.design_staff,
                  tccf.next_follow_plan, tccf.next_follow_time,tccf.annex_paths, tccf.measure_status, tccf.remarks, tccf.flg_valid,
                  tccf.cp_id
@@ -18,7 +18,6 @@
         <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"/>
@@ -48,7 +47,6 @@
         <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"/>
@@ -74,8 +72,7 @@
         <result column="follow_count" property="followCount"/>
         <result column="follow_staff_name" property="followStaffName"/>
         <result column="create_time" property="createTime"  typeHandler="TimestampTypeHandler"/>
-
-
+        <result column="follow_status_name" property="followStatusName"/>
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -87,9 +84,7 @@
             <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>
@@ -173,9 +168,7 @@
             <if test="followStatus != null and followStatus != ''">
                 AND tccf.follow_status = #{followStatus}
             </if>
-            <if test="followType != null and followType != ''">
-                AND tccf.follow_type = #{followType}
-            </if>
+      
             <if test="followOrg != null and followOrg != ''">
                 AND tccf.follow_org = #{followOrg}
             </if>
@@ -248,18 +241,20 @@
         tmc.address_full AS "addressFull",
         tmo.org_name  AS  "orgName",
         tms.staff_name  AS  "staffName",
-        tmc.follow_count AS follow_count
+        tmc.follow_count AS follow_count,
+        tdk1.kind_name_i18n  ->> 'zh_CN' AS "follow_status_name"
         FROM dkic_b.t_crm_cus_follow tccf
         LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = tccf.cus_id
         LEFT JOIN dkic_b.t_mst_org tmo on tmo.org_id = tccf.follow_org
         LEFT JOIN dkic_b.t_mst_staff tms on tms.staff_id = tccf.follow_staff
+        LEFT JOIN  sys.t_data_kind tdk1  on tdk1.kind_code =  tccf.follow_status
         <include refid="Condition_Join"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
     </select>
 
-
+<!--查询跟进记录-->
     <select id="selectByList" resultMap="BaseResultMapResponse">
         SELECT
         <include refid="Base_Column_List_Join"/>,
@@ -270,11 +265,15 @@
         tms.staff_name  AS  "staffName",
         tmc.follow_count AS follow_count,
         tms.staff_name AS follow_staff_name,
-        tccf.op_create_time AS create_time
+        tccf.op_create_time AS create_time,
+        tdk1.kind_name_i18n  ->> 'zh_CN' AS "follow_status_name"
         FROM dkic_b.t_crm_cus_follow tccf
         LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = tccf.cus_id
         LEFT JOIN dkic_b.t_mst_org tmo on tmo.org_id = tccf.follow_org
         LEFT JOIN dkic_b.t_mst_staff tms on tms.staff_id = tccf.follow_staff
+
+        LEFT JOIN  sys.t_data_kind tdk1  on tdk1.kind_code =  tccf.follow_status
+
         <include refid="Condition_Join"/>
 
     </select>
@@ -319,7 +318,6 @@
         <trim suffixOverrides=",">
             cus_id,
             follow_status,
-            follow_type,
             follow_org,
             follow_staff,
             follow_time,
@@ -345,7 +343,6 @@
             <trim suffixOverrides=",">
                 #{item.cusId}::uuid,
                 #{item.followStatus},
-                #{item.followType},
                 #{item.followOrg}::uuid,
                 #{item.followStaff}::uuid,
                 #{item.followTime},

+ 18 - 10
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -91,6 +91,10 @@
         <result column="followStaffName" property="followStaffName"/>
         <result column="lastFollowStaffName" property="lastFollowStaffName"/>
         <result column="saleStatusName" property="saleStatusName"/>
+        <result column="next_follow_time" property="nextFollowTime" typeHandler="TimestampTypeHandler"/>
+
+        <result column="follow_staff" property="followStaff"/>
+        <result column="follow_staff_name" property="followStaffName"/>
 
     </resultMap>
 
@@ -176,13 +180,14 @@
                 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}) , '%')
+                AND (tmc.cus_code  like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.cus_name  like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.cus_phone like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.address_full like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.remarks like concat('%', my_ex.likequery(#{searchText}) , '%')
                 )
             </if>
 
-
         </where>
     </sql>
 
@@ -203,19 +208,18 @@
         tmo.org_name  AS  "orgName",
         tms.staff_name  AS  "staffName",
         tms2.staff_name  AS  "reportStaffName",
-        tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName"
---         tms3.staff_name  AS  "followStaffName",
---         tms4.staff_name  AS  "lastFollowStaffName"
+        tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName",
+        tcf.next_follow_time
         FROM dkic_b.t_mst_customer tmc
+        LEFT JOIN  ( select tccff.cus_id, max (tccff.next_follow_time)as next_follow_time from dkic_b.t_crm_cus_follow tccff group by tccff.cus_id )  tcf on tmc.cus_id = tcf.cus_id
         LEFT JOIN  dkic_b.t_mst_dictionary_data tmd  on tmd.data_id =  tmc.cus_from
         LEFT JOIN  dkic_b.t_mst_sale_channel tmsc  on tmsc.channel_id =  tmc.channel_id
         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"/>
+        order by tmc.cus_id DESC
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -249,6 +253,8 @@
         tms.staff_name  AS  "staffName",
         tms2.staff_name  AS  "reportStaffName",
         tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName"
+--         tccfs.follow_staff  as follow_staff,
+--         tms1.staff_name  as follow_staff_name
         FROM dkic_b.t_mst_customer tmc
         LEFT JOIN  dkic_b.t_mst_dictionary_data tmd  on tmd.data_id =  tmc.cus_from
         LEFT JOIN  dkic_b.t_mst_sale_channel tmsc  on tmsc.channel_id =  tmc.channel_id
@@ -256,7 +262,9 @@
         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
-        WHERE cus_id = #{cusId}::uuid
+--         LEFT JOIN  dkic_b.t_crm_cus_follow_staff  tccfs on tccfs.follow_staff = any(tmc.follow_staffs)
+--         LEFT JOIN  dkic_b.t_mst_staff tms1  on tms1.staff_id =  tccfs.follow_staff
+        WHERE tmc.cus_id = #{cusId}::uuid
     </select>
 
     <!-- 根据主键锁定表t_mst_customer的一行数据 -->

+ 1 - 6
src/main/java/com/dk/mdm/model/pojo/mst/CusFollow.java

@@ -61,12 +61,7 @@ public class CusFollow   implements Serializable {
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
+
 
 
     /**

+ 2 - 7
src/main/java/com/dk/mdm/model/query/mst/CusFollowQuery.java

@@ -64,12 +64,6 @@ public class CusFollowQuery extends PageInfo<CusFollowQuery> implements Serializ
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
 
 
     /**
@@ -282,7 +276,8 @@ public class CusFollowQuery extends PageInfo<CusFollowQuery> implements Serializ
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
-
+    @ApiModelProperty(value = "模糊查询")
+    private String searchText;
     /*
      * 相关属性
      * @TableField(exist = false)

+ 3 - 0
src/main/java/com/dk/mdm/model/query/mst/CustomerQuery.java

@@ -336,6 +336,9 @@ public class CustomerQuery extends PageInfo<CustomerQuery> implements Serializab
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "模糊查询")
+    private String searchText;
+
 
     /*
      * 相关属性

+ 20 - 7
src/main/java/com/dk/mdm/model/response/mst/CusFollowResponse.java

@@ -62,12 +62,7 @@ public class CusFollowResponse implements Serializable {
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
+
 
 
     /**
@@ -216,13 +211,25 @@ public class CusFollowResponse implements Serializable {
     @ApiModelProperty(value = "企业ID")
     private Integer cpId;
 
-
+    @ApiModelProperty(value = "客户名称")
     private String cusName;
+
+    @ApiModelProperty(value = "客户电话")
     private String cusPhone;
+
+    @ApiModelProperty(value = "销售部门")
     private String orgName;
+
+    @ApiModelProperty(value = "销售人员")
     private String staffName;
+
+    @ApiModelProperty(value = "跟进员工")
     private String followStaffName;
+
+    @ApiModelProperty(value = "详细地址")
     private String addressFull;
+
+    @ApiModelProperty(value = "跟进次数")
     private Integer followCount;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@@ -230,6 +237,12 @@ public class CusFollowResponse implements Serializable {
     private LocalDateTime createTime;
 
 
+    @ApiModelProperty(value = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    private String followStatusName;
+
+
+
+
     private static final long serialVersionUID = 1L;
 
 }

+ 8 - 0
src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java

@@ -289,6 +289,8 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
 
     @ApiModelProperty(value = "报备人")
     private String reportStaffName;
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
 
     @ApiModelProperty(value = "跟进人")
     private String followStaffName;
@@ -298,6 +300,12 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
 
     private String saleStatusName;
 
+    @ApiModelProperty(value = "提醒日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime nextFollowTime;
+
+
     private static final long serialVersionUID = 1L;
 
 }

+ 0 - 241
src/main/java/com/dk/mdm/model/response/mst/OrgResponse.java

@@ -1,241 +0,0 @@
-package com.dk.mdm.model.response.mst;
-
-import cn.afterturn.easypoi.excel.annotation.Excel;
-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.UuidListTypeHandler;
-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;
-import java.util.List;
-
-/**
- *  组织机构
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
-@ExportTitle("组织机构")
-@TableName(value = "t_mst_org", autoResultMap = true, schema =  "dkic_b")
-@ApiModel(value="实体类:组织机构", description="表名:t_mst_org")
-public class OrgResponse extends PageInfo<OrgResponse> implements Serializable {
-
-    /*
-     * 数据库字段
-     */
-
-    /**
-     * 组织ID
-     */
-//    @TableId(value = "org_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "组织ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String orgId;
-
-
-    /**
-     * 组织名称
-     */
-    @Excel(name = "组织名称")
-    @ApiModelProperty(value = "组织名称")
-    private String orgName;
-
-
-    /**
-     * 父级ID
-     */
-    @Excel(name = "父级ID")
-    @ApiModelProperty(value = "父级ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String parentId;
-
-
-    /**
-     * 显示顺序 (【1 ~ 46655】)
-     */
-    @Excel(name = "显示顺序 (【1 ~ 46655】)")
-    @ApiModelProperty(value = "显示顺序 (【1 ~ 46655】)")
-    private Integer displayNo;
-
-
-    /**
-     * 顶层ID
-     */
-    @Excel(name = "顶层ID")
-    @ApiModelProperty(value = "顶层ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String topId;
-
-
-    /**
-     * 上层ID
-     */
-    @Excel(name = "上层ID")
-    @ApiModelProperty(value = "上层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelUpper;
-
-
-    /**
-     * 下层ID
-     */
-    @Excel(name = "下层ID")
-    @ApiModelProperty(value = "下层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelLower;
-
-
-    /**
-     * 末级标识
-     */
-    @Excel(name = "末级标识")
-    @ApiModelProperty(value = "末级标识")
-    private Boolean levelLeaf;
-
-
-    /**
-     * 层级序号
-     */
-    @Excel(name = "层级序号")
-    @ApiModelProperty(value = "层级序号")
-    private Integer levelNo;
-
-
-    /**
-     * 层级代码
-     */
-    @Excel(name = "层级代码")
-    @ApiModelProperty(value = "层级代码")
-    private String levelCode;
-
-
-    /**
-     * 层级全称 (【 / 】)
-     */
-    @Excel(name = "层级全称 (【 / 】)")
-    @ApiModelProperty(value = "层级全称 (【 / 】)")
-    private String levelName;
-
-
-    /**
-     * 备注
-     */
-    @Excel(name = "备注")
-    @ApiModelProperty(value = "备注")
-    private String remarks;
-
-
-    /**
-     * 有效标识 (1:正常 0:停用)
-     */
-    @Excel(name = "有效标识 (1:正常 0:停用)")
-    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
-    private Boolean flgValid;
-
-
-    /**
-     * 企业ID
-     */
-    @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;
-
-
-    @ApiModelProperty(value = "")
-    private String orgCode;
-
-    @TableField(exist = false)
-    private List<OrgResponse> itemData;
-
-    /*
-     * 相关属性
-     * @TableField(exist = false)
-     */
-
-    /*
-     * 关联属性 + 查询条件
-     * @TableField(exist = false)
-     */
-
-
-    private static final long serialVersionUID = 1L;
-
-}

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

@@ -61,13 +61,6 @@ public class CusFollowVO implements Serializable {
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
-
 
     /**
      * 跟进部门

+ 0 - 95
src/main/java/com/dk/mdm/model/vo/mst/OrgVO.java

@@ -1,95 +0,0 @@
-package com.dk.mdm.model.vo.mst;
-
-import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.dk.common.infrastructure.annotaiton.ExportTitle;
-import com.dk.common.infrastructure.handler.UuidTypeHandler;
-import com.dk.common.model.pojo.PageInfo;
-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;
-
-
-/**
- *  组织部门
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
-@ExportTitle("组织部门")
-@TableName(value = "t_mst_org",schema ="dkic_b", autoResultMap = true)
-@ApiModel(value="实体类:组织机构", description="表名:t_mst_org")
-public class OrgVO extends PageInfo<OrgVO> implements Serializable {
-
-    /*
-     * 数据库字段
-     */
-
-    /**
-     * 组织ID
-     */
-    @TableId(value = "org_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "组织ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String orgId;
-
-
-    /**
-     * 组织代码
-     */
-    @Excel(name = "组织代码")
-    @ApiModelProperty(value = "组织代码")
-    private String orgCode;
-
-
-    /**
-     * 组织名称
-     */
-    @Excel(name = "组织名称")
-    @ApiModelProperty(value = "组织名称")
-    private String orgName;
-
-
-    /**
-     * 父级ID
-     */
-    @Excel(name = "父级ID")
-    @ApiModelProperty(value = "父级ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String parentId;
-
-    /**
-     * 工厂ID
-     */
-    @ApiModelProperty(value = "工厂ID")
-    private Integer cpId;
-
-    /**
-     * 显示顺序
-     */
-    @Excel(name = "显示顺序")
-    @ApiModelProperty(value = "显示顺序")
-    private Integer displayNo;
-
-    /**
-     * 顶层ID
-     */
-    @Excel(name = "顶层ID")
-    @ApiModelProperty(value = "顶层ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String topId;
-
-    private static final long serialVersionUID = 1L;
-
-}

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

@@ -699,7 +699,7 @@ public class CommonService extends BaseService<Map<String, Object>> {
             list = commonMapper.getDataKind(map);
         }
         //邀约结果
-        if (dataSourceCode.equals("invitationResults")) {
+        if (dataSourceCode.equals("inviteResult")) {
             map.put("kindType","邀约结果");
             list = commonMapper.getDataKind(map);
         }

+ 26 - 12
src/main/java/com/dk/mdm/service/mst/CusFollowService.java

@@ -101,7 +101,16 @@ public class CusFollowService extends BaseService<CusFollow> {
             rollbackFor = {Exception.class}
     )
     public ResponseResultVO<?> insert(CusFollowVO cusFollowVO) {
-
+        CusFollow cusFollow = cusFollowConvert.convertToPo(cusFollowVO);
+        //设置ID
+        Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMERFOLLOW.getName(), true);
+        cusFollow.setFollowId(uniqueNoteCode.get("outId").toString());
+        //跟进时间
+        cusFollow.setFollowTime(LocalDateTime.now());
+        //跟进人
+        cusFollow.setFollowStaff(authUtils.getStaff().getStaffId());
+        //跟进部门
+        cusFollow.setFollowOrg(authUtils.getStaff().getOrgId());
         if (cusFollowVO.getCusId() != null) {
             //查询客户
             Customer customer = customerMapper.selectById(cusFollowVO.getCusId());
@@ -176,12 +185,21 @@ public class CusFollowService extends BaseService<CusFollow> {
                 throw new BaseBusinessException(ErrorCodeEnum.CUSTOMER_SAME_COMPANY_TELEPHONE.getCode(),
                         ErrorCodeEnum.CUSTOMER_SAME_COMPANY_TELEPHONE.getMessage());
             }
+            customer.setLastFollowId(cusFollow.getFollowId());
+            customer.setLastFollowTime(cusFollow.getFollowTime());
+            customer.setLastFollowStaff(cusFollow.getFollowStaff());
             //修改跟进次数
             customer.setFollowCount(customer.getFollowCount() + 1);
             customerService.updateByUuid(customer);
         } else if (cusFollowVO.getCusPhone() != null && cusFollowVO.getCusName() != null) {
             //留资接待 新建客户
             Customer customer = new Customer();
+            //设置编码
+            Map<String, Object> customerNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMER.getName(), true);
+            customer.setCusId(customerNoteCode.get("outId").toString());
+            customer.setCusCode(customerNoteCode.get("outNote").toString());
+            //TODO  渠道 取当前登录人员工的渠道
+            customer.setChannelId("10112024-0302-0000-0000-00000759d8a4");
             customer.setCusName(cusFollowVO.getCusName());
             customer.setCusPhone(cusFollowVO.getCusPhone());
             customer.setAddressName(cusFollowVO.getAddressName());
@@ -192,9 +210,13 @@ public class CusFollowService extends BaseService<CusFollow> {
             customer.setReportStaff(authUtils.getStaff().getStaffId());
             customer.setReportTime(LocalDateTime.now());
             customer.setCpId(authUtils.getStaff().getCpId());
+            customer.setStaffId(authUtils.getStaff().getStaffId());
             customer.setOrgId(authUtils.getStaff().getOrgId());
             customer.setFollowCount(1);
-//            customer.setCustomerFrom(-1L);
+            customer.setLastFollowId(cusFollow.getFollowId());
+            customer.setLastFollowTime(cusFollow.getFollowTime());
+            customer.setLastFollowStaff(cusFollow.getFollowStaff());
+
 
             // 同商户 电话不同
             Long count = customerMapper.countByCond(
@@ -225,16 +247,8 @@ public class CusFollowService extends BaseService<CusFollow> {
         }
 
 
-        CusFollow cusFollow = cusFollowConvert.convertToPo(cusFollowVO);
-        //设置ID
-        Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMERFOLLOW.getName(), true);
-        cusFollow.setFollowId(uniqueNoteCode.get("outId").toString());
-        //跟进时间
-        cusFollow.setFollowTime(LocalDateTime.now());
-        //跟进人
-        cusFollow.setFollowStaff(authUtils.getStaff().getStaffId());
-        //跟进部门
-        cusFollow.setFollowOrg(authUtils.getStaff().getOrgId());
+
+
 
         // 约量尺
         if (Constant.BasicDataConstant.FOLLOW_STATUS_3.getValue().equals(cusFollow.getFollowStatus())) {

+ 1 - 1
src/main/java/com/dk/mdm/service/mst/OrgService.java

@@ -11,7 +11,7 @@ import com.dk.mdm.mapper.mst.OrgMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.mst.OrgQuery;
-import com.dk.mdm.model.vo.mst.OrgVO;
+import com.dk.common.model.vo.mst.OrgVO;
 import com.dk.mdm.service.common.CommonService;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;