Browse Source

退号后同步删除分诊记录

hurugang 3 years ago
parent
commit
95ea00b4b8

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

@@ -1,10 +1,7 @@
 package cn.hnthyy.thmz.mapper.his.mz;
 
 import cn.hnthyy.thmz.entity.his.mz.MzfzPatientOrder;
-import org.apache.ibatis.annotations.Insert;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.apache.ibatis.annotations.Update;
+import org.apache.ibatis.annotations.*;
 
 import java.util.List;
 
@@ -253,4 +250,12 @@ public interface MzfzPatientOrderMapper {
     @Update("update mzfz_patient_order set dept_code =#{deptCode},doctor_code =#{doctorCode},status_flag =#{statusFlag},room_code=null,fz_no=null,call_time=null where serial_no = #{serialNo} ")
     int updateMzfzPatientOrderWithNull(MzfzPatientOrder mzfzPatientOrder);
 
+    /**
+     * 删除分诊记录
+     * @param patientId
+     * @param times
+     * @return
+     */
+    @Delete("delete from mzfz_patient_order where patient_id = #{patientId} and  times =#{times}")
+    int deleteMzfzPatientOrder(@Param("patientId") String patientId, @Param("times") Integer times);
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzyReqrecServiceImpl.java

@@ -488,7 +488,6 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
             if (!Constants.BYJZ.equals(dbMzyReqrec.getPaymode())) {
                 dbMzyReqrec.setPaymode(Constants.CASH);
             }
-
             mzyReqrecMapper.insertMzyReqrec(dbMzyReqrec);
             reqrecRequestRelationMapper.selectReqrecRequestRelation(dbMzyReqrec.getSerialNo());
             Clinic clinic = new Clinic();
@@ -496,6 +495,7 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
             clinic.setTimes(mzyReqrec.getTimes());
             clinic.setClinicStatus(ClinicStatusEnum.BACK_REGISTRATION.code);
             clinicMapper.updateClinicByPatientIdAndTimes(clinic);
+            mzfzPatientOrderMapper.deleteMzfzPatientOrder(mzyReqrec.getPatientId(),mzyReqrec.getTimes());
         }
         return mzyReqrecMapper.updateMzyReqrec(mzyReqrec);
     }