Przeglądaj źródła

医生待开方+药师待审核

cgp 1 dzień temu
rodzic
commit
d9b3b29d41

+ 51 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/FsPrescribeDataScrmController.java

@@ -1,12 +1,21 @@
 package com.fs.app.controller;
 
 
+import com.fs.app.utils.JwtUtils;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
+import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
 import com.fs.his.service.IFsPrescribeDataScrmService;
+import com.fs.qw.vo.FsPrescribeDataScrmVO;
+import com.github.pagehelper.PageHelper;
+import io.jsonwebtoken.Claims;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -27,6 +36,9 @@ public class FsPrescribeDataScrmController extends BaseController
     @Autowired
     private IFsPrescribeDataScrmService fsPrescribeScrmService;
 
+    @Autowired
+    JwtUtils jwtUtils;
+
     /**
      * 查询处方表(SCRM)列表
      */
@@ -83,4 +95,43 @@ public class FsPrescribeDataScrmController extends BaseController
     {
         return toAjax(fsPrescribeScrmService.deleteFsPrescribeDataScrmByPrescribeIds(prescribeIds));
     }
+    /**
+     * 医生---查询待开方商城处方列表
+     * */
+    @GetMapping("/waitOpenPrescribeList")
+    public TableDataInfo waitOpenPrescribeList(FsPrescribeDataDoctorQueryDto queryDto){
+        String doctorId = getDoctorId();
+        if (StringUtils.isBlank(doctorId)){
+            throw new CustomException("登录已过期,请重新登录");
+        }
+        queryDto.setDoctorId(Long.valueOf(doctorId));
+        PageHelper.startPage(queryDto.getPageNum(),queryDto.getPageSize());
+        List<FsPrescribeDataScrmVO> list=fsPrescribeScrmService.waitOpenPrescribeList(queryDto);
+        return getDataTable(list);
+    }
+
+    /**
+     * 药师---查询待审核商城处方列表
+     * */
+    @GetMapping("/pendingStorePrescribeList")
+    public TableDataInfo pendingStorePrescribeList(FsPrescribeDataDrugDoctorQueryDto queryDto){
+        String doctorId = getDoctorId();
+        if (StringUtils.isBlank(doctorId)){
+            throw new CustomException("登录已过期,请重新登录");
+        }
+        queryDto.setDrugDoctorId(Long.valueOf(doctorId));
+        PageHelper.startPage(queryDto.getPageNum(),queryDto.getPageSize());
+        List<FsPrescribeDataScrmVO> list=fsPrescribeScrmService.pendingStorePrescribeList(queryDto);
+        return getDataTable(list);
+    }
+    /**
+     * 获取当前登录医生id
+     * */
+    private String getDoctorId()
+    {
+        String headValue =  ServletUtils.getRequest().getHeader("APPToken");
+        Claims claims=jwtUtils.getClaimByToken(headValue);
+        String doctorId = claims.getSubject().toString();
+        return doctorId;
+    }
 }

+ 3 - 3
fs-service/src/main/java/com/fs/his/domain/FsPrescribeDataScrm.java

@@ -28,7 +28,7 @@ public class FsPrescribeDataScrm extends BaseEntity
     private Long inquiryOrderId;
 
     /** 订单编号 */
-    private Long orderCode;
+    private String orderCode;
 
     /** 店铺订单ID */
     private Long storeOrderId;
@@ -39,7 +39,7 @@ public class FsPrescribeDataScrm extends BaseEntity
     /** 患者ID */
     private Long patientId;
 
-    /** 处⽅单ID(唯⼀ID) */
+    /** 处⽅编号 */
     private String prescribeCode;
 
     /** 患者描述 */
@@ -152,7 +152,7 @@ public class FsPrescribeDataScrm extends BaseEntity
     /** 订单来源 */
     private Integer source;
 
-    /** 医生是否确认 0未确认 1已确认 -1医生拒方 */
+    /** 医生是否确认 0待医生开方 1确认开方 -1医生拒方 */
     private Integer doctorConfirm;
 
     /** 医生开始操作时间(益寿缘从医生建议开始算) */

+ 27 - 0
fs-service/src/main/java/com/fs/his/dto/FsPrescribeDataDoctorQueryDto.java

@@ -0,0 +1,27 @@
+package com.fs.his.dto;
+
+import lombok.Data;
+
+@Data
+public class FsPrescribeDataDoctorQueryDto {
+    //患者姓名
+    private String patientName;
+
+    //处方状态 0待医生开方 1确认开方 -1医生拒方 */
+    private Integer doctorConfirm;
+
+    /** 处方类型 1西药 2中药 */
+    private Integer prescribeType;
+
+    /** 订单编号 */
+    private String orderCode;
+
+    /** 处⽅编号 */
+    private String prescribeCode;
+
+    /** 医生id*/
+    private Long doctorId;
+    //分页相关
+    private Integer pageNum;
+    private Integer pageSize;
+}

+ 24 - 0
fs-service/src/main/java/com/fs/his/dto/FsPrescribeDataDrugDoctorQueryDto.java

@@ -0,0 +1,24 @@
+package com.fs.his.dto;
+
+import lombok.Data;
+
+@Data
+public class FsPrescribeDataDrugDoctorQueryDto {
+    //患者姓名
+    private String patientName;
+
+    //处方状态 0待药师审核 1审核通过 2药师审核不通过 */
+    private Integer status;
+
+    /** 订单编号 */
+    private String orderCode;
+
+    /** 处⽅编号 */
+    private String prescribeCode;
+
+    /** 药师id*/
+    private Long drugDoctorId;
+    //分页相关
+    private Integer pageNum;
+    private Integer pageSize;
+}

+ 14 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPrescribeDataScrmMapper.java

@@ -1,6 +1,10 @@
 package com.fs.his.mapper;
 
 import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
+import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
+import com.fs.qw.vo.FsPrescribeDataScrmVO;
+
 import java.util.List;
 
 /**
@@ -58,4 +62,14 @@ public interface FsPrescribeDataScrmMapper
      * @return 结果
      */
     public int deleteFsPrescribeDataScrmByPrescribeIds(Long[] prescribeIds);
+
+    /**
+     * 医生---查询待开方商城处方列表
+     * */
+    List<FsPrescribeDataScrmVO> waitOpenPrescribeList(FsPrescribeDataDoctorQueryDto queryDto);
+
+    /**
+     * 药师---查询待审核商城处方列表
+     * */
+    List<FsPrescribeDataScrmVO> pendingStorePrescribeList(FsPrescribeDataDrugDoctorQueryDto queryDto);
 }

+ 18 - 0
fs-service/src/main/java/com/fs/his/service/IFsPrescribeDataScrmService.java

@@ -1,6 +1,10 @@
 package com.fs.his.service;
 
 import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
+import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
+import com.fs.qw.vo.FsPrescribeDataScrmVO;
+
 import java.util.List;
 
 /**
@@ -58,4 +62,18 @@ public interface IFsPrescribeDataScrmService
      * @return 结果
      */
     public int deleteFsPrescribeDataScrmByPrescribeId(Long prescribeId);
+
+    /**
+     * 医生---查询待开方商城处方列表
+     * @param queryDto
+     * @return
+     */
+    List<FsPrescribeDataScrmVO> waitOpenPrescribeList(FsPrescribeDataDoctorQueryDto queryDto);
+
+    /**
+     * 药师---查询待审核处方列表
+     * @param queryDto
+     * @return
+     */
+    List<FsPrescribeDataScrmVO> pendingStorePrescribeList(FsPrescribeDataDrugDoctorQueryDto queryDto);
 }

+ 24 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeDataScrmServiceImpl.java

@@ -2,10 +2,16 @@ package com.fs.his.service.impl;
 
 import com.fs.common.utils.DateUtils;
 import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
+import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
 import com.fs.his.mapper.FsPrescribeDataScrmMapper;
 import com.fs.his.service.IFsPrescribeDataScrmService;
+import com.fs.qw.vo.FsPrescribeDataScrmVO;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -92,4 +98,22 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
     {
         return fsPrescribeDataScrmMapper.deleteFsPrescribeDataScrmByPrescribeId(prescribeId);
     }
+
+    @Override
+    public List<FsPrescribeDataScrmVO> waitOpenPrescribeList(FsPrescribeDataDoctorQueryDto queryDto) {
+        List<FsPrescribeDataScrmVO> list=fsPrescribeDataScrmMapper.waitOpenPrescribeList(queryDto);
+        if (CollectionUtils.isEmpty(list)){
+            return Collections.emptyList();
+        }
+        return list;
+    }
+
+    @Override
+    public List<FsPrescribeDataScrmVO> pendingStorePrescribeList(FsPrescribeDataDrugDoctorQueryDto queryDto) {
+        List<FsPrescribeDataScrmVO> list=fsPrescribeDataScrmMapper.pendingStorePrescribeList(queryDto);
+        if (CollectionUtils.isEmpty(list)){
+            return Collections.emptyList();
+        }
+        return list;
+    }
 }

+ 171 - 0
fs-service/src/main/java/com/fs/qw/vo/FsPrescribeDataScrmVO.java

@@ -0,0 +1,171 @@
+package com.fs.qw.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+@Data
+public class FsPrescribeDataScrmVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long prescribeId;
+
+    /** 处方类型 1西药 2中药 */
+    private Integer prescribeType;
+
+    /** 订单ID */
+    private Long inquiryOrderId;
+
+    /** 订单编号 */
+    private String orderCode;
+
+    /** 店铺订单ID */
+    private Long storeOrderId;
+
+    /** 用户ID */
+    private Long userId;
+
+    /** 患者ID */
+    private Long patientId;
+
+    /** 处⽅编号 */
+    private String prescribeCode;
+
+    /** 患者描述 */
+    private String patientDescs;
+
+    /** 现病史 */
+    private String nowIllness;
+
+    /** 既往史 */
+    private String historyIllness;
+
+    /** 患者年龄 */
+    private String patientAge;
+
+    /** 患者姓名 */
+    private String patientName;
+
+    /** 体重 */
+    private String weight;
+
+    /** 是否有过敏史(传值:是/否) */
+    private String isHistoryAllergic;
+
+    /** 过敏史 */
+    private String historyAllergic;
+
+    /** 肝功能是否异常(传值:是/否) */
+    private String liverUnusual;
+
+    /** 肾功能是否异常(传值:是/否) */
+    private String renalUnusual;
+
+    /** 是否是备孕/怀孕/哺乳期(传值:是 */
+    private String isLactation;
+
+    /** 患者电话 */
+    private String patientTel;
+
+    /** 患者性别(传数字,1男 0⼥) */
+    private Integer patientGender;
+
+    /** 复诊凭证 */
+    private String recordPic;
+
+    /** 处方图片地址 */
+    private String prescribeImgUrl;
+
+    /** 处方图片存储地址 */
+    private String prescribeImgStoreUrl;
+
+    /** 拒绝原因 */
+    private String auditReason;
+
+    /** 诊断 */
+    private String diagnose;
+
+    /** 医生ID */
+    private Long doctorId;
+
+    /** 药师ID */
+    private Long drugDoctorId;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 状态 0待药师审核 1审核通过 2药师审核不通过 */
+    private Integer status;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+
+    /** 使用JSON */
+    private String usageJson;
+
+    /** 备注 */
+    private String remark;
+
+    /** 店铺ID */
+    private Long storeId;
+
+    /** 处方医生id */
+    private Long prescribeDoctorId;
+
+    /** 医生签名 */
+    private String doctorSignUrl;
+
+    /** 处方医生签名 */
+    private String prescribeDoctorSignUrl;
+
+    /** 药师签名 */
+    private String drugDoctorSignUrl;
+
+    /** 患者生日 */
+    private String patientBirthday;
+
+    /** 制作类型 0-颗粒剂 1-膏方 */
+    private Integer recipeType;
+
+    /** 二维码图片 */
+    private String prescribeCodeUrl;
+
+    /** 用药周期 */
+    private Integer cycle;
+
+    /** icd_code */
+    private String icdCode;
+
+    /** 订单来源 */
+    private Integer source;
+
+    /** 医生是否确认 0待医生开方 1确认开方 -1医生拒方 */
+    private Integer doctorConfirm;
+
+    /** 医生开始操作时间(益寿缘从医生建议开始算) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startOperateTime;
+
+    /** 医生结束操作时间(医生第一次确认处方算) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endOperateTime;
+
+    /** 医生操作秒数 */
+    private Long operateSecond;
+
+    /** 第三方用户id */
+    private Long thirdPartyUserId;
+
+    /** 是否推送给第三方(0:未推送,1:已推送) */
+    private Integer isSendToThirdParty;
+
+    /** 手写信息采集主键id */
+    private Long handwriteCollectionId;
+
+    /** 客户信息表id */
+    private Long companyCustomerId;
+}

+ 34 - 5
fs-service/src/main/resources/mapper/his/FsPrescribeDataScrmMapper.xml

@@ -73,7 +73,7 @@
                prescribe_code_url, cycle, icd_code, source, doctor_confirm, start_operate_time,
                end_operate_time, operate_second, third_party_user_id, is_send_to_third_party,
                handwrite_collection_id, company_customer_id
-        from fs_prescribe_scrm
+        from fs_prescribe_data_scrm
     </sql>
 
     <select id="selectFsPrescribeDataScrmByPrescribeId" parameterType="Long" resultMap="FsPrescribeDataScrmResult">
@@ -115,8 +115,37 @@
         order by create_time desc
     </select>
 
+    <select id="waitOpenPrescribeList" resultType="com.fs.qw.vo.FsPrescribeDataScrmVO">
+        select pds.* from fs_prescribe_data_scrm pds
+        left join fs_company_customer fcc on pds.prescribe_id = fcc.prescribe_id
+        <where>
+            pds.doctor_id = #{doctorId}
+            <if test="prescribeType != null"> and prescribe_type = #{prescribeType}</if>
+            <if test="orderCode != null"> and order_code = #{orderCode}</if>
+            <if test="prescribeCode != null and prescribeCode != ''"> and prescribe_code = #{prescribeCode}</if>
+            <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
+            <if test="doctorId != null"> and doctor_id = #{doctorId}</if>
+            <if test="doctorConfirm != null"> and doctor_confirm = #{doctorConfirm}</if>
+        </where>
+        order by create_time desc
+    </select>
+
+
+    <select id="pendingStorePrescribeList" resultType="com.fs.qw.vo.FsPrescribeDataScrmVO">
+        select pds.* from fs_prescribe_data_scrm pds
+        left join fs_company_customer fcc on pds.prescribe_id = fcc.prescribe_id
+        <where>
+            pds.drug_doctor_id = #{drugDoctorId}
+            <if test="orderCode != null"> and order_code = #{orderCode}</if>
+            <if test="prescribeCode != null and prescribeCode != ''"> and prescribe_code = #{prescribeCode}</if>
+            <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
+            <if test="status != null"> and status = #{status}</if>
+        </where>
+        order by create_time desc
+    </select>
+
     <insert id="insertFsPrescribeDataScrm" parameterType="FsPrescribeDataScrm" useGeneratedKeys="true" keyProperty="prescribeId">
-        insert into fs_prescribe_scrm
+        insert into fs_prescribe_data_scrm
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="prescribeType != null">prescribe_type,</if>
             <if test="inquiryOrderId != null">inquiry_order_id,</if>
@@ -226,7 +255,7 @@
     </insert>
 
     <update id="updateFsPrescribeDataScrm" parameterType="FsPrescribeDataScrm">
-        update fs_prescribe_scrm
+        update fs_prescribe_data_scrm
         <trim prefix="SET" suffixOverrides=",">
             <if test="prescribeType != null">prescribe_type = #{prescribeType},</if>
             <if test="inquiryOrderId != null">inquiry_order_id = #{inquiryOrderId},</if>
@@ -284,11 +313,11 @@
     </update>
 
     <delete id="deleteFsPrescribeDataScrmByPrescribeId" parameterType="Long">
-        delete from fs_prescribe_scrm where prescribe_id = #{prescribeId}
+        delete from fs_prescribe_data_scrm where prescribe_id = #{prescribeId}
     </delete>
 
     <delete id="deleteFsPrescribeDataScrmByPrescribeIds" parameterType="Long">
-        delete from fs_prescribe_scrm where prescribe_id in
+        delete from fs_prescribe_data_scrm where prescribe_id in
         <foreach collection="array" item="prescribeId" open="(" separator="," close=")">
             #{prescribeId}
         </foreach>