Explorar o código

复诊后不更新医生信息

hurugang %!s(int64=3) %!d(string=hai) anos
pai
achega
2855303812

+ 4 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzfzPatientOrder.java

@@ -69,4 +69,8 @@ public class MzfzPatientOrder extends PageBean {
      * 电话号码
      */
     private String phoneNo;
+    /**
+     * 复诊 1 复诊
+     */
+    private Integer fzFlag;
 }

+ 5 - 5
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzfzPatientOrderMapper.java

@@ -14,8 +14,8 @@ public interface MzfzPatientOrderMapper {
      * @param mzfzPatientOrder
      * @return
      */
-    @Insert("insert into mzfz_patient_order (patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no)" +
-            " values(#{patientId},#{times},#{name},#{deptCode},#{roomCode},#{doctorCode},#{ghNo},#{visitDate,jdbcType=TIMESTAMP},#{slowFlag},#{serialNo},#{reqType},#{reqOrder},#{ampm},9999) ")
+    @Insert("insert into mzfz_patient_order (patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,fz_flag)" +
+            " values(#{patientId},#{times},#{name},#{deptCode},#{roomCode},#{doctorCode},#{ghNo},#{visitDate,jdbcType=TIMESTAMP},#{slowFlag},#{serialNo},#{reqType},#{reqOrder},#{ampm},9999,'0') ")
     int insertMzfzPatientOrder(MzfzPatientOrder mzfzPatientOrder);
 
 
@@ -63,7 +63,7 @@ public interface MzfzPatientOrderMapper {
      * @return
      */
     @Select({"<script>",
-            "select top ${pageSize} rtrim(patient_id) patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,status_flag,call_time FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzfz_patient_order_page.fz_no asc) AS RowNumber,",
+            "select top ${pageSize} rtrim(patient_id) patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,status_flag,call_time,fz_flag FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzfz_patient_order_page.fz_no asc) AS RowNumber,",
             "* from ${tableName} mzfz_patient_order_page WITH(NOLOCK) where 1=1 ",
             "<when test='statusFlagList!=null'>",
             " and status_flag in ",
@@ -132,7 +132,7 @@ public interface MzfzPatientOrderMapper {
      * @return
      */
     @Select({"<script>",
-            "select top ${pageSize} rtrim(patient_id) patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,status_flag,call_time FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzfz_patient_order_page.fz_no asc) AS RowNumber,",
+            "select top ${pageSize} rtrim(patient_id) patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,status_flag,call_time,fz_flag FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzfz_patient_order_page.fz_no asc) AS RowNumber,",
             "* from ${tableName} mzfz_patient_order_page WITH(NOLOCK) where 1=1 ",
             "<when test='statusFlagList!=null'>",
             " and status_flag in ",
@@ -171,7 +171,7 @@ public interface MzfzPatientOrderMapper {
      * @param serialNo
      * @return
      */
-    @Select("select rtrim(patient_id) patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,status_flag,call_time FROM mzfz_patient_order WITH(NOLOCK) where serial_no=#{serialNo}")
+    @Select("select rtrim(patient_id) patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,status_flag,call_time,fz_flag FROM mzfz_patient_order WITH(NOLOCK) where serial_no=#{serialNo}")
     MzfzPatientOrder selectBySerialNo(@Param("serialNo") String serialNo);
 
     /**

+ 15 - 13
src/main/java/cn/hnthyy/thmz/service/impl/thmz/ClinicServiceImpl.java

@@ -87,19 +87,21 @@ public class ClinicServiceImpl implements ClinicService {
         if (mzVisitTable == null) {
             throw new MzException("当前接诊患者的就诊记录不存在");
         }
-        MzyReqrec updateMzyReqrec = new MzyReqrec();
-        updateMzyReqrec.setPatientId(patientId);
-        updateMzyReqrec.setTimes(mzfzPatientOrder.getTimes());
-        updateMzyReqrec.setVisitedMark(YesNoEnum.YES.code);
-        updateMzyReqrec.setVisitDate(new Date());
-        updateMzyReqrec.setVisitDept(mzfzPatientOrder.getDeptCode());
-        updateMzyReqrec.setVisitDoctor(tokenUser.getUserIdCode());
-        mzyReqrecMapper.updateMzyReqrec(updateMzyReqrec);
-        Clinic clinic = new Clinic();
-        clinic.setPatientId(patientId);
-        clinic.setTimes(mzfzPatientOrder.getTimes());
-        clinic.setClinicStatus(ClinicStatusEnum.REGISTRATION_TO_CLINIC.code);
-        clinicMapper.updateClinicByPatientIdAndTimes(clinic);
+        if(mzfzPatientOrder.getFzFlag()==null || YesNoEnum.NO.code.equals(mzfzPatientOrder.getFzFlag())){
+            MzyReqrec updateMzyReqrec = new MzyReqrec();
+            updateMzyReqrec.setPatientId(patientId);
+            updateMzyReqrec.setTimes(mzfzPatientOrder.getTimes());
+            updateMzyReqrec.setVisitedMark(YesNoEnum.YES.code);
+            updateMzyReqrec.setVisitDate(new Date());
+            updateMzyReqrec.setVisitDept(mzfzPatientOrder.getDeptCode());
+            updateMzyReqrec.setVisitDoctor(tokenUser.getUserIdCode());
+            mzyReqrecMapper.updateMzyReqrec(updateMzyReqrec);
+            Clinic clinic = new Clinic();
+            clinic.setPatientId(patientId);
+            clinic.setTimes(mzfzPatientOrder.getTimes());
+            clinic.setClinicStatus(ClinicStatusEnum.REGISTRATION_TO_CLINIC.code);
+            clinicMapper.updateClinicByPatientIdAndTimes(clinic);
+        }
         MzfzPatientOrder updateMzfzPatientOrder = new MzfzPatientOrder();
         updateMzfzPatientOrder.setSerialNo(Integer.valueOf(serialNo));
         updateMzfzPatientOrder.setStatusFlag(MzfzStatusEnum.IN_CLINIC.code);