Prechádzať zdrojové kódy

优化医生端sop任务查询逻辑

cgp 2 týždňov pred
rodič
commit
b757f446cf

+ 1 - 1
fs-company/src/main/java/com/fs/company/controller/qw/FsSopCompanyUserTaskController.java

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

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

@@ -4,12 +4,13 @@ import java.util.List;
 
 
 import com.fs.app.utils.JwtUtils;
-import com.fs.common.core.redis.RedisCache;
+import com.fs.common.core.domain.R;
 import com.fs.common.utils.ServletUtils;
 import com.fs.his.dto.SopDoctorTaskDto;
 import com.fs.his.vo.SopDoctorTaskVo;
 import io.jsonwebtoken.Claims;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -29,6 +30,8 @@ import com.fs.his.service.IFsSopDoctorTaskService;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.core.page.TableDataInfo;
 
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
+
 /**
  * 医生处理sop任务Controller
  * 
@@ -114,7 +117,28 @@ public class FsSopDoctorTaskController extends BaseController
         return toAjax(fsSopDoctorTaskService.deleteFsSopDoctorTaskByIds(ids));
     }
 
-    public String getDoctorId()
+    /**
+     * 销售端查询解密后的客户联系电话
+     * */
+    @GetMapping("/getUserPhone/{id}")
+    public R getUserPhone(@PathVariable("id") Long id){
+        SopDoctorTaskDto queryDto=new SopDoctorTaskDto();
+        queryDto.setId(id);
+        List<SopDoctorTaskVo> list = fsSopDoctorTaskService.selectFsSopDoctorTaskVoList(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","");
+    }
+
+    /**
+     * 获取当前登录医生id
+     * */
+    private String getDoctorId()
     {
         String headValue =  ServletUtils.getRequest().getHeader("APPToken");
         Claims claims=jwtUtils.getClaimByToken(headValue);

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

@@ -62,12 +62,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN qw_external_contact qwec ON sdt.user_id = qwec.id
         LEFT JOIN fs_user fu ON qwec.fs_user_id = fu.user_id
         <where>
-            <if test="id != null "> and sct.id = #{id}</if>
+            <if test="id != null "> and sdt.id = #{id}</if>
             <if test="doctorId != null "> and sdt.doctor_id = #{doctorId}</if>
             <if test="userId != null "> and sdt.user_id = #{userId}</if>
             <if test="packageId != null "> and sdt.package_id = #{packageId}</if>
             <if test="orderCode != null "> and sdt.order_code = #{orderCode}</if>
-            <if test="companyUserId != null "> and sct.company_user_id = #{companyUserId}</if>
+            <if test="companyUserId != null "> and sdt.company_user_id = #{companyUserId}</if>
             <if test="status != null "> and sdt.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>