Selaa lähdekoodia

益寿缘医生端-增加查看医生建议功能;增加统计拒方数量功能。

cgp 3 päivää sitten
vanhempi
commit
eabed42a2c

+ 11 - 2
fs-doctor-app/src/main/java/com/fs/app/controller/FsPrescribeController.java

@@ -9,19 +9,20 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.SecurityUtils;
-import com.fs.common.utils.StringUtils;
 import com.fs.his.domain.FsExportTask;
 import com.fs.his.domain.FsPatient;
 import com.fs.his.domain.FsPrescribe;
+import com.fs.his.dto.FsPrescribeRecordRejectDto;
 import com.fs.his.mapper.FsPatientMapper;
 import com.fs.his.param.FsPrescribeParam;
 import com.fs.his.service.IFsExportTaskService;
 import com.fs.his.service.IFsPrescribeRecordService;
 import com.fs.his.service.IFsPrescribeService;
 import com.fs.his.vo.FsPrescribeListVO;
+import com.fs.his.vo.FsPrescribeRecordRejectVo;
 import com.fs.his.vo.FsPrescribeVO;
-import com.fs.hisStore.domain.FsUserInformationCollection;
 import com.fs.hisStore.service.IFsUserInformationCollectionService;
+import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
@@ -98,6 +99,14 @@ public class FsPrescribeController extends BaseController
         }
         return getDataTable(list);
     }
+    /**
+     * 统计拒方数量
+     * */
+    @PostMapping("/rejectCount")
+    public R refuseCount(@RequestBody FsPrescribeRecordRejectDto rejectDto){
+        PageInfo<FsPrescribeRecordRejectVo> fsPrescribeRecordRejectVoPageInfo = prescribeRecordService.calculateRejectCount(rejectDto);
+        return R.ok().put("data", fsPrescribeRecordRejectVoPageInfo);
+    }
 
     /**
      * 导出处方列表

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

@@ -0,0 +1,24 @@
+package com.fs.his.dto;
+
+import lombok.Data;
+
+@Data
+public class FsPrescribeRecordRejectDto {
+    //处方Id
+    private Long prescribeId;
+    //处方编号
+    private String prescribeCode;
+    //医生名称
+    private String doctorName;
+    //患者名称
+    private String patientName;
+    //审核时间
+    private String auditTime;
+    //开始时间
+    private String beginAuditTime;
+    //结束时间
+    private String endAuditTime;
+    //分页参数
+    private Integer pageNum=1;
+    private Integer pageSize=10;
+}

+ 5 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPrescribeRecordMapper.java

@@ -6,6 +6,8 @@ import java.util.Map;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.his.domain.FsPrescribeRecord;
+import com.fs.his.dto.FsPrescribeRecordRejectDto;
+import com.fs.his.vo.FsPrescribeRecordRejectVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -79,4 +81,7 @@ public interface FsPrescribeRecordMapper extends BaseMapper<FsPrescribeRecord>{
             "    END AS percentage\n" +
             "FROM fs_prescibe_record WHERE doctor_id = #{doctorId} ")
     Map<String,Object> selectDoctorRefusePercentage(@Param("doctorId") Long doctorId);
+
+    //统计拒方数量
+    List<FsPrescribeRecordRejectVo> calculateRejectCount(FsPrescribeRecordRejectDto rejectDto);
 }

+ 10 - 0
fs-service/src/main/java/com/fs/his/service/IFsPrescribeRecordService.java

@@ -5,6 +5,9 @@ import java.util.Map;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.his.domain.FsPrescribeRecord;
+import com.fs.his.dto.FsPrescribeRecordRejectDto;
+import com.fs.his.vo.FsPrescribeRecordRejectVo;
+import com.github.pagehelper.PageInfo;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -65,4 +68,11 @@ public interface IFsPrescribeRecordService extends IService<FsPrescribeRecord>{
     List<FsPrescribeRecord> selectRecordListByPrescribeId(Long prescribeId);
 
     Map<String,Object> selectDoctorRefusePercentage(Long doctorId);
+
+    /**
+     * 统计拒方数量
+     * @param rejectDto
+     * @return
+     */
+    PageInfo<FsPrescribeRecordRejectVo> calculateRejectCount(FsPrescribeRecordRejectDto rejectDto);
 }

+ 11 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescibeRecordServiceImpl.java

@@ -7,8 +7,12 @@ import java.util.Map;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.his.domain.FsPrescribeRecord;
+import com.fs.his.dto.FsPrescribeRecordRejectDto;
 import com.fs.his.mapper.FsPrescribeRecordMapper;
 import com.fs.his.service.IFsPrescribeRecordService;
+import com.fs.his.vo.FsPrescribeRecordRejectVo;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -109,4 +113,11 @@ public class FsPrescibeRecordServiceImpl extends ServiceImpl<FsPrescribeRecordMa
     public Map<String, Object> selectDoctorRefusePercentage(Long doctorId) {
         return prescribeRecordMapper.selectDoctorRefusePercentage(doctorId);
     }
+
+    @Override
+    public PageInfo<FsPrescribeRecordRejectVo> calculateRejectCount(FsPrescribeRecordRejectDto rejectDto) {
+        PageHelper.startPage(rejectDto.getPageNum(), rejectDto.getPageSize());
+        List<FsPrescribeRecordRejectVo> recordRejectVoList = prescribeRecordMapper.calculateRejectCount(rejectDto);
+        return new PageInfo<>(recordRejectVoList);
+    }
 }

+ 19 - 0
fs-service/src/main/java/com/fs/his/vo/FsPrescribeRecordRejectVo.java

@@ -0,0 +1,19 @@
+package com.fs.his.vo;
+
+import lombok.Data;
+
+@Data
+public class FsPrescribeRecordRejectVo {
+    //处方Id
+    private Long prescribeId;
+    //处方编号
+    private String prescribeCode;
+    //医生名称
+    private String doctorName;
+    //患者名称
+    private String patientName;
+    //审核时间
+    private String auditTime;
+    //拒绝原因
+    private String auditReason;
+}

+ 4 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -837,6 +837,10 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionByUserId(userId);
         if (collection != null) {
             vo.setAnswers(JSON.parseArray(collection.getJsonInfo(), AnswerVO.class));
+            //医生建议
+            if (collection.getDoctorAdvice() != null){
+                vo.setDoctorAdvice(collection.getDoctorAdvice());
+            }
         }
         return vo;
     }

+ 4 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsUserInformationCollectionVO.java

@@ -37,7 +37,11 @@ public class FsUserInformationCollectionVO {
 
     //是否过敏
     private String allergy;
+
     //备注
     private String remark;
 
+    //医生建议
+    private String doctorAdvice;
+
 }

+ 49 - 0
fs-service/src/main/resources/mapper/his/FsPrescibeRecordMapper.xml

@@ -18,6 +18,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="prescribeId"    column="prescribe_id"    />
     </resultMap>
 
+    <resultMap type="com.fs.his.vo.FsPrescribeRecordRejectVo" id="FsPrescribeRecordRejectResult">
+        <result property="prescribeId"    column="prescribe_id"    />
+        <result property="prescribeCode"    column="prescribe_code"    />
+        <result property="doctorName"    column="doctor_name"    />
+        <result property="patientName"    column="patient_name"    />
+        <result property="auditTime"    column="audit_time"    />
+        <result property="auditReason"    column="audit_reason"    />
+    </resultMap>
+
     <sql id="selectFsPrescribeRecordVo">
         select id, prescribe_img_url, doctor_id, drug_doctor_id, doctor_name, drug_doctor_name, status, audit_reason, create_time, update_time, prescribe_id from fs_prescibe_record
     </sql>
@@ -98,4 +107,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+    <select id="calculateRejectCount" resultMap="FsPrescribeRecordRejectResult">
+        SELECT
+            p.prescribe_id,
+            p.prescribe_code,
+            MAX(r.doctor_name) AS doctor_name,
+            p.patient_name,
+            MIN(r.create_time) AS audit_time,
+            MAX(r.audit_reason) AS audit_reason
+        FROM fs_prescibe_record r
+                 JOIN fs_prescribe p ON r.prescribe_id = p.prescribe_id
+        WHERE r.status = 2
+        <!-- 处方ID -->
+        <if test="prescribeId != null">
+            AND p.prescribe_id = #{prescribeId}
+        </if>
+        <!-- 处方编号 -->
+        <if test="prescribeCode != null and prescribeCode != ''">
+            AND p.prescribe_code = #{prescribeCode}
+        </if>
+        <!-- 医生姓名(建议模糊?若需精确则保留 =)-->
+        <if test="doctorName != null and doctorName != ''">
+            AND r.doctor_name = #{doctorName}
+        </if>
+        <!-- 患者姓名 -->
+        <if test="patientName != null and patientName != ''">
+            AND p.patient_name = #{patientName}
+        </if>
+        <!-- 审核时间范围 -->
+        <if test="beginAuditTime != null and beginAuditTime != ''">
+            AND r.create_time &gt;= #{beginAuditTime}
+        </if>
+        <if test="endAuditTime != null and endAuditTime != ''">
+            AND r.create_time &lt;= #{endAuditTime}
+        </if>
+        GROUP BY
+        p.prescribe_id,
+        p.prescribe_code,
+        p.patient_name
+    </select>
 </mapper>