浏览代码

优化总后台“统计管理—医生/销售sop总览统计”接口

cgp 2 周之前
父节点
当前提交
aa66caa5d6

+ 0 - 63
fs-admin/src/main/java/com/fs/company/controller/SopCompanyStatsOverviewController.java

@@ -1,63 +0,0 @@
-package com.fs.company.controller;
-
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.R;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.qw.dto.SopCompanyUserTaskDto;
-import com.fs.qw.service.IFsSopCompanyUserTaskService;
-import com.fs.qw.vo.SopCompanyUserTaskVo;
-import org.apache.commons.collections4.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-import static com.fs.his.utils.PhoneUtil.decryptPhone;
-
-/**
- * 销售、医生sop总览统计
- *
- * @author fs
- * @date 2021-03-22
- */
-@RestController
-@RequestMapping("/sop/company/statistics")
-public class SopCompanyStatsOverviewController  extends BaseController {
-
-    @Autowired
-    private IFsSopCompanyUserTaskService fsSopCompanyUserTaskService;
-
-
-    /**
-     * 查询销售处理sop任务列表
-     */
-    @PreAuthorize("@ss.hasPermi('sop:statistics:companyStatsOverviewList')")
-    @GetMapping("/companyStatsOverviewList")
-    public TableDataInfo companyStatsOverviewList(SopCompanyUserTaskDto queryDto)
-    {
-        startPage();
-        List<SopCompanyUserTaskVo> list = fsSopCompanyUserTaskService.statsOverviewAllList(queryDto);
-        return getDataTable(list);
-    }
-    /**
-     * 销售端查询解密后的客户联系电话
-     * */
-    @GetMapping("/getUserPhone/{id}")
-    public R getUserPhone(@PathVariable("id") Long id){
-        SopCompanyUserTaskDto queryDto=new SopCompanyUserTaskDto();
-        queryDto.setId(id);
-        List<SopCompanyUserTaskVo> list = fsSopCompanyUserTaskService.statsOverviewAllList(queryDto);
-        if (CollectionUtils.isNotEmpty(list)&&list.size()==1){
-            String userPhone=list.get(0).getPhone();
-            if (userPhone!=null&&userPhone.length()>11){
-                userPhone=decryptPhone(userPhone);
-            }
-            return R.ok().put("userPhone",userPhone);
-        }
-        return R.ok().put("userPhone","");
-    }
-}

+ 0 - 16
fs-doctor-app/src/main/java/com/fs/app/controller/FsSopDoctorTaskController.java

@@ -238,22 +238,6 @@ public class FsSopDoctorTaskController extends BaseController
         return getDataTable(list);
     }
 
-    /**
-     * 获取病人详细信息
-     */
-    @GetMapping(value = "/{patientId}")
-    public AjaxResult getInfo1(@PathVariable("patientId") Long patientId)
-    {
-        FsPatient fsPatient = fsPatientService.selectFsPatientByPatientId(patientId);
-        if (fsPatient.getIdCard()!=null){
-            fsPatient.setIdCard(fsPatient.getIdCard().replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1**********$2"));
-        }
-        if (fsPatient.getMobile()!=null){
-            fsPatient.setMobile(fsPatient.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
-        }
-        return AjaxResult.success(fsPatient);
-    }
-
     @GetMapping("/storeOrder/userOrderList")
     public TableDataInfo userOrderList(FsStoreOrderParam fsStoreOrder)
     {

+ 2 - 0
fs-service/src/main/java/com/fs/qw/dto/SopCompanyUserTaskDto.java

@@ -14,6 +14,8 @@ public class SopCompanyUserTaskDto extends BaseEntity {
     /** 医生姓名 */
     private String doctorName;
 
+    /** 医生姓名 */
+    private String companyUserName;
 
     private Long doctorId;
 

+ 4 - 1
fs-service/src/main/java/com/fs/qw/vo/SopCompanyUserTaskVo.java

@@ -26,9 +26,12 @@ public class SopCompanyUserTaskVo {
     /** 套餐包Id */
     private Long packageId;
 
-    /** 套餐包Id */
+    /** 销售Id */
     private Long companyUserId;
 
+    /** 销售名称 */
+    private String companyUserName;
+
     /** 订单号 */
     private String orderCode;
 

+ 4 - 3
fs-service/src/main/resources/mapper/his/FsSopDoctorTaskMapper.xml

@@ -40,13 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="packageName"  column="package_name" />
         <result property="avatar" column="avatar" />
         <result property="phone"  column="phone" />
+        <result property="doctor_name"  column="doctorName" />
     </resultMap>
 
     <sql id="selectFsSopDoctorTaskVo">
         select id, company_user_id,doctor_id, user_id, status, create_time, update_time, remark, package_id, order_code, type,qw_external_contact_id from fs_sop_doctor_task
     </sql>
 
-    <select id="selectFsSopDoctorTaskVoList" parameterType="com.fs.his.vo.SopDoctorTaskVo" resultMap="SopDoctorTaskVoResult">
+    <select id="selectFsSopDoctorTaskVoList" parameterType="com.fs.his.dto.SopDoctorTaskDto" resultMap="SopDoctorTaskVoResult">
         SELECT
         sdt.id,
         sdt.user_id,
@@ -80,8 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="type != null "> and sdt.type = #{type}</if>
             <if test="qwUserId != null "> and qwec.qw_user_id = #{qwUserId}</if>
             <if test="name != null "> and qwec.name like concat('%', #{name}, '%')</if>
-            <if test="companyUserName != null "> and cp.nick_name like concat('%', #{companyUserName}, '%')</if>
-            <if test="doctorName != null "> and fd.doctor_name like concat('%', #{doctorName}, '%')</if>
+            <if test="companyUserName != null and companyUserName !='' "> and cp.nick_name like concat('%', #{companyUserName}, '%')</if>
+            <if test="doctorName != null and doctorName !='' "> and fd.doctor_name like concat('%', #{doctorName}, '%')</if>
             <if test="beginTime != null and beginTime != ''">
                 and sdt.create_time &gt;= str_to_date(#{beginTime}, '%Y-%m-%d %H:%i:%s')
             </if>

+ 6 - 2
fs-service/src/main/resources/mapper/qw/FsSopCompanyUserTaskMapper.xml

@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="avatar" column="avatar" />
         <result property="phone"  column="phone" />
         <result property="packageName"  column="package_name" />
+        <result property="companyUserName"  column="nick_name" />
     </resultMap>
 
     <sql id="selectFsSopCompanyUserTaskVo">
@@ -64,12 +65,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sct.update_time,
         sct.remark,
         sct.type,
+        cu.nick_name,
         sct.qw_external_contact_id
         FROM
         fs_sop_company_user_task sct
         LEFT JOIN fs_doctor fd ON sct.doctor_id = fd.doctor_id
         LEFT JOIN qw_external_contact qwec ON sct.qw_external_contact_id = qwec.id
         LEFT JOIN fs_user fu ON qwec.fs_user_id = fu.user_id
+        LEFT JOIN company_user cu ON cu.user_id = sct.company_user_id
         <where>
             <if test="id != null "> and sct.id = #{id}</if>
             <if test="doctorId != null "> and sct.doctor_id = #{doctorId}</if>
@@ -80,8 +83,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyUserId != null "> and sct.company_user_id = #{companyUserId}</if>
             <if test="status != null "> and sct.status = #{status}</if>
             <if test="qwUserId != null "> and qwec.qw_user_id = #{qwUserId}</if>
-            <if test="name != null "> and qwec.name like concat('%', #{name}, '%')</if>
-            <if test="doctorName != null "> and fd.doctor_name like concat('%', #{doctorName}, '%')</if>
+            <if test="name != null and name !='' "> and qwec.name like concat('%', #{name}, '%')</if>
+            <if test="doctorName != null and  doctorName != ''"> and fd.doctor_name like concat('%', #{doctorName}, '%')</if>
+            <if test="companyUserName != null and  companyUserName !=''"> and cu.nick_name like concat('%', #{companyUserName}, '%')</if>
             <if test="beginTime != null and beginTime != ''">
                 and sct.create_time &gt;= str_to_date(#{beginTime}, '%Y-%m-%d %H:%i:%s')
             </if>