Browse Source

优化客户信息表认领逻辑

cgp 6 days ago
parent
commit
b888f82432

+ 1 - 1
fs-service/src/main/java/com/fs/company/service/impl/CompanyUserServiceImpl.java

@@ -1092,7 +1092,7 @@ public class CompanyUserServiceImpl implements ICompanyUserService
         }
         CompanyUserAndDoctorVO companyUserAndDoctorVO=new CompanyUserAndDoctorVO();
         companyUserAndDoctorVO.setCompanyUserId(companyUser.getUserId());
-        companyUserAndDoctorVO.setCompanyUserName(companyUser.getUserName());
+        companyUserAndDoctorVO.setCompanyUserName(companyUser.getNickName());
         FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(companyUser.getDoctorId());
         if (fsDoctor==null){
             log.error("销售人员所绑定的医生不存在,销售companyUserId:{}",companyUserId);

+ 9 - 0
fs-service/src/main/java/com/fs/qw/domain/FsCompanyCustomer.java

@@ -89,6 +89,15 @@ public class FsCompanyCustomer extends BaseEntity {
     //认领状态0:未认领,1:已认领
     private int claimStatus;
 
+    //完善状态0:未认领,1:已认领
+    private int completeStatus;
+
+    //归属部门id
+    private int deptId;
+
+    //归属部门名称
+    private String deptName;
+
     //以下字段(非数据库字段,用于接收查询参数)
 
     /** 创建时间开始 */

+ 22 - 9
fs-service/src/main/resources/mapper/qw/FsCompanyCustomerMapper.xml

@@ -28,14 +28,18 @@
         <result property="importMemberId"    column="import_member_id"   />
         <result property="buyCount"          column="buy_count"          />
         <result property="claimStatus"       column="claim_status"       />
+        <result property="completeStatus"    column="complete_status"    />
+        <result property="deptId"            column="dept_id"            />
+        <result property="deptName"          column="dept_name"          />
     </resultMap>
 
     <sql id="selectFsCompanyCustomerVo">
         select id, customer_name, sex, age, address, phone, filing_time,
-               company_user_id, company_user_name, appointment_time, doctor_id, doctor_name,
-               present_illness, current_medication, allergy_history,
-               create_by, create_time, update_by, update_time, remark, del_flag, import_member_id,
-               buy_count,claim_status
+        company_user_id, company_user_name, appointment_time, doctor_id, doctor_name,
+        present_illness, current_medication, allergy_history,
+        create_by, create_time, update_by, update_time, remark, del_flag, import_member_id,
+        buy_count, claim_status,
+        complete_status, dept_id, dept_name
         from fs_company_customer
     </sql>
 
@@ -63,18 +67,15 @@
         <if test="endTime != null and endTime != ''">
             and filing_time &lt;= #{endTime}
         </if>
-        <!-- 创建时间(新增) -->
         <if test="beginCreateTime != null and beginCreateTime != ''">
             and create_time &gt;= #{beginCreateTime}
         </if>
         <if test="endCreateTime != null and endCreateTime != ''">
             and create_time &lt;= #{endCreateTime}
         </if>
-        <!-- 已购筛选 -->
         <if test="purchased != null and purchased == true">
             and buy_count > 0
         </if>
-        <!-- 购买次数范围 -->
         <if test="minBuyCount != null">
             and buy_count &gt;= #{minBuyCount}
         </if>
@@ -84,6 +85,9 @@
         <if test="importMemberId != null">
             and import_member_id = #{importMemberId}
         </if>
+        <if test="completeStatus != null">
+            and complete_status = #{completeStatus}
+        </if>
         order by filing_time desc
     </select>
 
@@ -140,6 +144,9 @@
             <if test="importMemberId != null">import_member_id,</if>
             <if test="buyCount != null">buy_count,</if>
             <if test="claimStatus != null">claim_status,</if>
+            <if test="completeStatus != null">complete_status,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
             create_time
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -162,13 +169,16 @@
             <if test="importMemberId != null">#{importMemberId},</if>
             <if test="buyCount != null">#{buyCount},</if>
             <if test="claimStatus != null">#{claimStatus},</if>
+            <if test="completeStatus != null">#{completeStatus},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
             sysdate()
         </trim>
     </insert>
 
-    <!-- 批量插入,支持 buy_count,若未传入则默认 0 -->
+    <!-- 批量插入-->
     <insert id="insertBatchFsCompanyCustomer">
-        INSERT IGNORE INTO fs_company_customer (customer_name, address, phone, create_time, import_member_id,claim_status)
+        INSERT IGNORE INTO fs_company_customer (customer_name, address, phone, create_time, import_member_id, claim_status)
         VALUES
         <foreach collection="companyCustomers" item="item" separator=",">
             (#{item.customerName}, #{item.address}, #{item.phone}, #{item.createTime}, #{item.importMemberId}, #{item.claimStatus})
@@ -196,6 +206,9 @@
             <if test="importMemberId != null">import_member_id = #{importMemberId},</if>
             <if test="buyCount != null">buy_count = #{buyCount},</if>
             <if test="claimStatus != null">claim_status = #{claimStatus},</if>
+            <if test="completeStatus != null">complete_status = #{completeStatus},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             update_time = sysdate()
         </set>