瀏覽代碼

住院接收

lighter 2 月之前
父節點
當前提交
4423f51855

+ 2 - 5
src/main/java/thyyxxk/webserver/controller/medicaladvice/patientinfo/AdjustBedController.java

@@ -56,11 +56,8 @@ public class AdjustBedController {
 
     @PostMapping("receivePatient")
     public ResultVo<String> receivePatient(@RequestBody ZyActpatient actpatient) {
-        int res = service.receivePatient(actpatient);
-        if (res > 0) {
-            return ResultVoUtil.success("接收成功。");
-        }
-        return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "接收失败,更新数据失败。");
+        service.receivePatient(actpatient);
+        return ResultVoUtil.success("接收成功。");
     }
 
     @PostMapping("getIdleBedNoList")

+ 4 - 3
src/main/java/thyyxxk/webserver/dao/his/medicaladvice/patientinfo/AdjustBedDao.java

@@ -72,9 +72,10 @@ public interface AdjustBedDao {
             "gender=case when sex='1' then N'男' when sex='2' then N'女' else N'未知' end, " +
             "wardName=(select rtrim(d.name) from zd_unit_code d where d.code=ward), " +
             "smallDeptName=(select rtrim(d.name) from zd_unit_code d where d.code=small_dept) " +
-            "from zy_actpatient where ward=#{ward} and bed_status='0'")
+            "from zy_prepatient where ward=#{ward} ")
     List<ZyActpatient> getPreAdmPatients(String ward);
 
-    @Update("update zy_actpatient set bed_status='1' where inpatient_no=#{patNo}")
-    int updateBedStatus(String patNo);
+    @Update("insert into zy_actpatient select * from zy_prepatient d where d.inpatient_no=#{patNo};" +
+            "delete from zy_prepatient where inpatient_no=#{patNo}")
+    void updateBedStatus(String patNo);
 }

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/ZyActpatient.java

@@ -23,6 +23,8 @@ public class ZyActpatient implements Serializable {
     public static final String ZY_INACTPATIENT = "zy_inactpatient";
     //在院表
     public static final String ZY_ACTPATIENT = "zy_actpatient";
+    //待接收
+    public static final String ZY_PREPATIENT = "zy_prepatient";
 
     /**
      * 自费病人身份

+ 2 - 2
src/main/java/thyyxxk/webserver/service/medicaladvice/patientinfo/AdjustBedService.java

@@ -166,8 +166,8 @@ public class AdjustBedService {
         return dao.getPreAdmPatients(ward);
     }
 
-    public int receivePatient(ZyActpatient actpatient) {
-        return dao.updateBedStatus(actpatient.getInpatientNo());
+    public void receivePatient(ZyActpatient actpatient) {
+        dao.updateBedStatus(actpatient.getInpatientNo());
     }
 
     public ResultVo<List<Map>> getIdleBedNoList(ZyBedPreMsg msg) {

+ 2 - 3
src/main/java/thyyxxk/webserver/service/zygl/ZyActpatientService.java

@@ -184,7 +184,7 @@ public class ZyActpatientService {
         zyActpatient.setSex(aPatientMiDb.getSex());
         zyActpatient.setInputDate(now);
         zyActpatient.setZkWard(zyActpatient.getSmallDept());
-        zyActpatient.setTableName(ZyActpatient.ZY_ACTPATIENT);
+        zyActpatient.setTableName(ZyActpatient.ZY_PREPATIENT);
         int num = zyActpatientMapper.insertZyActpatient(zyActpatient);
         if (num > 0) {
             //修改门诊住院申请单
@@ -281,7 +281,7 @@ public class ZyActpatientService {
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public int deleteZyActpatient(ZyActpatient param) {
+    public void deleteZyActpatient(ZyActpatient param) {
         AssertUtil.isnotBlank(param.getInpatientNo(), "住院号不能为空");
         APatientMi aPatientMiDb = aPatientMiService.queryPatientMiByInPatientNo(param.getInpatientNo());
         if (aPatientMiDb == null) {
@@ -371,7 +371,6 @@ public class ZyActpatientService {
         zyWorkLog.setWardCode(zyActpatient.getWard());
         zyWorkLog.setName(userCache.getUserInfoByToken().getName());
         zyActpatientMapper.insertZyWorkLog(zyWorkLog);
-        return num;
     }