Parcourir la source

医生操作时间业务

wjj il y a 5 jours
Parent
commit
6ef576f50d

+ 9 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/FsPrescribeController.java

@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 /**
  * 处方Controller
@@ -71,6 +72,14 @@ public class FsPrescribeController extends BaseController
             if (vo.getPatientTel()!=null){
                 vo.setPatientTel(vo.getPatientTel().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
             }
+            if (vo.getOperateTime() != null) {
+                int totalSeconds = Integer.parseInt(vo.getOperateTime());
+                long minutes = TimeUnit.SECONDS.toMinutes(totalSeconds);
+                long seconds = totalSeconds - TimeUnit.MINUTES.toSeconds(minutes);
+                vo.setOperateTime(minutes + "分" + seconds + "秒");
+            } else {
+                vo.setOperateTime("-");
+            }
         }
         return getDataTable(list);
     }

+ 13 - 0
fs-service/src/main/java/com/fs/his/domain/FsPrescribe.java

@@ -175,6 +175,19 @@ public class FsPrescribe extends BaseEntity
      */
     private Integer doctorConfirm;
 
+    /** 医生开始操作时间(益寿缘从医生建议开始算) */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date startOperateTime;
+
+    /** 医生开始操作时间(益寿缘从医生建议开始算) */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date endOperateTime;
+
+    /**
+     * 医生操作秒数
+     */
+    private Long operateSecond;
+
 
     public String getPrescribeImgStoreUrl() {
         return prescribeImgStoreUrl;

+ 12 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeServiceImpl.java

@@ -1,5 +1,7 @@
 package com.fs.his.service.impl;
 
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
@@ -1060,6 +1062,14 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
     public void confirmPrescribe(FsPrescribeParam param) {
         FsPrescribe fsPrescribe = fsPrescribeMapper.selectFsPrescribeByPrescribeId(param.getPrescribeId());
         fsPrescribe.setDoctorConfirm(1);
+        //医生操作结束时间(第一次确认处方)
+        if (fsPrescribe.getEndOperateTime() == null) {
+            fsPrescribe.setEndOperateTime(DateUtils.getNowDate());
+            if (fsPrescribe.getStartOperateTime() != null && fsPrescribe.getEndOperateTime() != null) {
+                Long seconds = DateUtil.between(fsPrescribe.getStartOperateTime(), fsPrescribe.getEndOperateTime(), DateUnit.SECOND);
+                fsPrescribe.setOperateSecond(seconds);
+            }
+        }
         //待审核
         fsPrescribe.setStatus(0);
         fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
@@ -1079,6 +1089,8 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
         fsPrescribe.setDoctorConfirm(0);
         //待审核
         fsPrescribe.setStatus(0);
+        //医生开始操作时间
+        fsPrescribe.setStartOperateTime(DateUtils.getNowDate());
         fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
     }
 

+ 3 - 0
fs-service/src/main/java/com/fs/his/vo/FsPrescribeListVO.java

@@ -168,4 +168,7 @@ public class FsPrescribeListVO {
      * 医生是否确认 0未确认 1已确认 -1其他系统
      */
     private Integer doctorConfirm;
+
+    //操作时间
+    private String operateTime;
 }

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

@@ -49,10 +49,21 @@
         <result property="source"    column="source"    />
         <result property="prescribeImgStoreUrl"    column="prescribe_img_store_url"    />
         <result property="doctorConfirm"    column="doctor_confirm"    />
+        <result property="startOperateTime"    column="start_operate_time"    />
+        <result property="endOperateTime"    column="end_operate_time"    />
+        <result property="operateSecond"    column="operate_second"    />
     </resultMap>
 
     <sql id="selectFsPrescribeVo">
-        select prescribe_id,prescribe_code_url,prescribe_img_store_url,source,cycle,icd_code,prescribe_type,recipe_type,patient_birthday,drug_doctor_sign_url,prescribe_doctor_id,doctor_sign_url,prescribe_doctor_sign_url, inquiry_order_id, store_order_id, user_id, patient_id, prescribe_code, patient_descs, now_illness, history_illness, patient_age, patient_name, weight, is_history_allergic, history_allergic, liver_unusual, renal_unusual, is_lactation, patient_tel, patient_gender, record_pic, prescribe_img_url, audit_reason, diagnose, doctor_id,drug_doctor_id, create_time, status, audit_time,remark,usage_json,store_id,doctor_confirm from fs_prescribe
+        select prescribe_id,prescribe_code_url
+             ,prescribe_img_store_url,source,cycle,icd_code,prescribe_type
+             ,recipe_type,patient_birthday,drug_doctor_sign_url,prescribe_doctor_id
+             ,doctor_sign_url,prescribe_doctor_sign_url, inquiry_order_id, store_order_id
+             , user_id, patient_id, prescribe_code, patient_descs, now_illness, history_illness
+             , patient_age, patient_name, weight, is_history_allergic, history_allergic, liver_unusual
+             , renal_unusual, is_lactation, patient_tel, patient_gender, record_pic, prescribe_img_url
+             , audit_reason, diagnose, doctor_id,drug_doctor_id, create_time, status, audit_time,remark
+             ,usage_json,store_id,doctor_confirm, start_operate_time,end_operate_time,operate_second from fs_prescribe
     </sql>
 
     <select id="selectFsPrescribeList" parameterType="FsPrescribe" resultMap="FsPrescribeResult">
@@ -234,6 +245,9 @@
             <if test="source != null">source = #{source},</if>
             <if test="prescribeImgStoreUrl != null">prescribe_img_store_url = #{prescribeImgStoreUrl},</if>
             <if test="doctorConfirm != null">doctor_confirm = #{doctorConfirm},</if>
+            <if test="startOperateTime != null">start_operate_time = #{startOperateTime},</if>
+            <if test="endOperateTime != null">end_operate_time = #{endOperateTime},</if>
+            <if test="operateSecond != null">operate_second = #{operateSecond},</if>
         </trim>
         where prescribe_id = #{prescribeId}
     </update>
@@ -276,7 +290,7 @@
         <if test="storeId != null "> and so.store_id = #{storeId}</if>
     </select>
     <select id="selectFsPrescribeListVOWithConfirm" resultType="com.fs.his.vo.FsPrescribeListVO">
-        select so.*,us.nick_name,dc.doctor_name,
+        select so.*,CAST(operate_second AS CHAR) operateTime,us.nick_name,dc.doctor_name,
                dp.doctor_name doctor_drug_name,
                fso.order_code,fso.`status` order_status,
                fse.store_name FROM fs_prescribe so