Bläddra i källkod

总后台新增“统计管理—医生/销售sop总览统计”功能接口

cgp 2 veckor sedan
förälder
incheckning
be866c8c20

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

@@ -0,0 +1,63 @@
+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","");
+    }
+}

+ 214 - 0
fs-admin/src/main/java/com/fs/company/controller/SopStatsOverviewController.java

@@ -0,0 +1,214 @@
+package com.fs.company.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.his.domain.FsUser;
+import com.fs.his.domain.FsUserAddress;
+import com.fs.his.dto.SopDoctorTaskDto;
+import com.fs.his.param.FsStoreOrderParam;
+import com.fs.his.param.FsUserCouponParam;
+import com.fs.his.service.*;
+import com.fs.his.vo.FsPatientVO;
+import com.fs.his.vo.FsStoreOrderListVO;
+import com.fs.his.vo.FsUserCouponListVO;
+import com.fs.his.vo.SopDoctorTaskVo;
+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.Collections;
+import java.util.List;
+
+import static com.fs.his.utils.PhoneUtil.decryptAutoPhoneMk;
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
+
+/**
+ * 销售、医生sop总览统计
+ *
+ * @author fs
+ * @date 2021-03-22
+ */
+@RestController
+@RequestMapping("/sop/statistics")
+public class SopStatsOverviewController extends BaseController {
+
+
+    @Autowired
+    private IFsSopDoctorTaskService fsSopDoctorTaskService;
+
+    @Autowired
+    private IFsSopCompanyUserTaskService fsSopCompanyUserTaskService;
+
+    @Autowired
+    private IFsPatientService fsPatientService;
+
+    @Autowired
+    private IFsUserService fsUserService;
+
+    @Autowired
+    private IFsUserCouponService fsUserCouponService;
+
+    @Autowired
+    private IFsStoreOrderService fsStoreOrderService;
+
+
+    /**
+     * 查询医生处理sop任务列表
+     */
+    @PreAuthorize("@ss.hasPermi('sop:statistics:doctorStatsOverviewList')")
+    @GetMapping("/doctorStatsOverviewList")
+    public TableDataInfo doctorStatsOverviewList(SopDoctorTaskDto queryDto)
+    {
+        startPage();
+        List<SopDoctorTaskVo> list = fsSopDoctorTaskService.statsDoctorOverviewAllList(queryDto);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询销售处理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("/companyGetUserPhone/{id}")
+    public R companyGetUserPhone(@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","");
+    }
+
+    /**
+     * 医生端查询解密后的客户联系电话
+     * */
+    @GetMapping("/doctorGetUserPhone/{id}")
+    public R doctorGetUserPhone(@PathVariable("id") Long id){
+        SopDoctorTaskDto queryDto=new SopDoctorTaskDto();
+        queryDto.setId(id);
+        List<SopDoctorTaskVo> list = fsSopDoctorTaskService.statsDoctorOverviewAllList(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","");
+    }
+
+    /**
+     * 获取用户信息信息
+     */
+    @GetMapping(value = "/getPatient/{userId}")
+    public AjaxResult getPatient(@PathVariable("userId") Long userId)
+    {
+        List<FsPatientVO> fsPatientVOS = fsPatientService.selectFsPatientByUserId(userId);
+        for (FsPatientVO  fsPatientVO: fsPatientVOS) {
+            if (fsPatientVO.getPhone()!=null){
+                fsPatientVO.setPhone(fsPatientVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+
+            }
+
+        }
+        return AjaxResult.success(fsPatientVOS);
+    }
+
+    /**
+     * 获取用户详细信息
+     */
+    @GetMapping(value = "/userInfo/{userId}")
+    public AjaxResult getUserInfo(@PathVariable("userId") Long userId)
+    {
+        FsUser fsUser = fsUserService.selectFsUserByUserId(userId);
+        fsUser.setPhone(decryptAutoPhoneMk(fsUser.getPhone()));
+        return AjaxResult.success(fsUser);
+    }
+
+    /**
+     * 获取用户详细信息
+     */
+
+    @GetMapping(value = "/getUserAddr/{userId}")
+    public AjaxResult getUserAddr(@PathVariable("userId") Long userId)
+    {
+        List<FsUserAddress> fsUserAddresses = fsUserService.selectFsUserAddressByUserId(userId);
+        for (FsUserAddress fsUserAddress : fsUserAddresses) {
+            fsUserAddress.setPhone(decryptAutoPhoneMk(fsUserAddress.getPhone()));
+        }
+        return AjaxResult.success();
+    }
+
+    @GetMapping("/userCoupon/getList")
+    public TableDataInfo getList(FsUserCouponParam fsUserCoupon)
+    {
+        startPage();
+        List<FsUserCouponListVO> list = fsUserCouponService.selectFsUserCouponListVO(fsUserCoupon);
+        for (FsUserCouponListVO fsUserCouponListVO : list) {
+            if (fsUserCouponListVO.getPhone()!=null){
+                fsUserCouponListVO.setPhone(fsUserCouponListVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询病人列表
+     */
+    @GetMapping("/patient/list")
+    public TableDataInfo list(FsPatientVO fsPatient)
+    {
+        startPage();
+        List<FsPatientVO> list = fsPatientService.selectFsPatientListVO(fsPatient);
+        for (FsPatientVO fsPatientVO : list) {
+            if (fsPatientVO.getPhone()!=null){
+                fsPatientVO.setPhone(fsPatientVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+            if (fsPatientVO.getIdCard()!=null){
+                fsPatientVO.setIdCard(fsPatientVO.getIdCard().replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1**********$2"));
+            }
+            if (fsPatientVO.getMobile()!=null){
+                fsPatientVO.setMobile(fsPatientVO.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+
+
+        }
+        return getDataTable(list);
+    }
+    @GetMapping("/storeOrder/userOrderList")
+    public TableDataInfo userOrderList(FsStoreOrderParam fsStoreOrder)
+    {
+        startPage();
+        fsStoreOrder.setCompanyUserId(fsStoreOrder.getCompanyUserId());
+        List<FsStoreOrderListVO> list = fsStoreOrderService.selectFsStoreOrderListVO(fsStoreOrder);
+        if (CollectionUtils.isEmpty(list)){
+            return getDataTable(Collections.emptyList());
+        }
+        return getDataTable(list);
+
+    }
+
+}

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

@@ -142,7 +142,7 @@ public class FsSopDoctorTaskController extends BaseController
     }
 
     /**
-     * 销售端查询解密后的客户联系电话
+     * 医生端查询解密后的客户联系电话
      * */
     @GetMapping("/getUserPhone/{id}")
     public R getUserPhone(@PathVariable("id") Long id){

+ 2 - 0
fs-service/src/main/java/com/fs/his/dto/SopDoctorTaskDto.java

@@ -13,6 +13,8 @@ public class SopDoctorTaskDto  extends BaseEntity {
     /** 销售名称 */
     private String companyUserName;
 
+    private String doctorName;
+
     private Long doctorId;
 
     /** 用户姓名 */

+ 2 - 0
fs-service/src/main/java/com/fs/his/service/IFsSopDoctorTaskService.java

@@ -60,4 +60,6 @@ public interface IFsSopDoctorTaskService extends IService<FsSopDoctorTask>{
      * @return 结果
      */
     int deleteFsSopDoctorTaskById(Long id);
+
+    List<SopDoctorTaskVo> statsDoctorOverviewAllList(SopDoctorTaskDto queryDto);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsSopDoctorTaskServiceImpl.java

@@ -1,6 +1,7 @@
 package com.fs.his.service.impl;
 
 import java.text.SimpleDateFormat;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
@@ -111,4 +112,9 @@ public class FsSopDoctorTaskServiceImpl extends ServiceImpl<FsSopDoctorTaskMappe
     {
         return fsSopDoctorTaskMapper.deleteFsSopDoctorTaskById(id);
     }
+
+    @Override
+    public List<SopDoctorTaskVo> statsDoctorOverviewAllList(SopDoctorTaskDto queryDto) {
+        return fsSopDoctorTaskMapper.selectFsSopDoctorTaskVoList(queryDto);
+    }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/vo/SopDoctorTaskVo.java

@@ -19,6 +19,8 @@ public class SopDoctorTaskVo {
     @Excel(name = "销售姓名")
     private String companyUserName;
 
+    private String doctorName;
+
     @Excel(name = "套餐包")
     private String packageName;
 

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

@@ -61,12 +61,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sdt.update_time,
         sdt.remark,
         sdt.type,
+        fd.doctor_name,
         sdt.qw_external_contact_id
         FROM
         fs_sop_doctor_task sdt
         LEFT JOIN company_user cp ON sdt.company_user_id = cp.user_id
         LEFT JOIN qw_external_contact qwec ON sdt.qw_external_contact_id = qwec.id
         LEFT JOIN fs_user fu ON qwec.fs_user_id = fu.user_id
+        LEFT JOIN fs_doctor fd ON sdt.doctor_id = fd.doctor_id
         <where>
             <if test="id != null "> and sdt.id = #{id}</if>
             <if test="doctorId != null "> and sdt.doctor_id = #{doctorId}</if>
@@ -79,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="beginTime != null and beginTime != ''">
                 and sdt.create_time &gt;= str_to_date(#{beginTime}, '%Y-%m-%d %H:%i:%s')
             </if>