Browse Source

添加查看出院审核历史功能

lighter 2 years ago
parent
commit
e0104e7c34

+ 5 - 0
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SiSettleApplyController.java

@@ -44,4 +44,9 @@ public class SiSettleApplyController {
     public ResultVo<String> handleApply(@RequestBody SiSettleApply apply) {
         return service.handleApply(apply);
     }
+
+    @PostMapping("/selectApplyHistories")
+    public ResultVo<List<SiSettleApply>> selectApplyHistories(@RequestBody SiSettleApply apply) {
+        return service.selectApplyHistories(apply);
+    }
 }

+ 9 - 4
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiSettleApplyDao.java

@@ -33,11 +33,12 @@ public interface SiSettleApplyDao {
             "#{inputComment},getdate(),0,#{type},#{settleDatetime},0,#{acctUsedFlag},#{deathFlag},#{sortNo})")
     void insertSettleApply(SiSettleApply apply);
 
-    @Select("select a.pat_no,a.times,a.ledger_sn,a.status,a.type,c.sex as gender,rtrim(c.name) as name,b.med_type, " +
-            "wardName=(select rtrim(name) from zd_unit_code with(nolock) where code=c.ward),a.death_flag,a.sort_no " +
+    @Select("select a.*,c.sex as gender,rtrim(c.name) as name,b.med_type, " +
+            "handleStaffName=(select rtrim(d.name) from a_employee_mi d where d.code=a.handle_staff)," +
+            "wardName=(select rtrim(name) from zd_unit_code with(nolock) where code=c.ward) " +
             "from t_si_settle_apply a with(nolock), t_si_pat_info b with(nolock), zy_actpatient c with(nolock) " +
-            "where a.settled=0 and a.pat_no=b.pat_no and a.times=b.times " +
-            "and a.ledger_sn=b.ledger_sn and a.pat_no=c.inpatient_no")
+            "where a.settled=0 and a.pat_no=b.pat_no and a.times=b.times and a.ledger_sn=b.ledger_sn and a.pat_no=c.inpatient_no " +
+            "and sort_no=(select max(sort_no) from t_si_settle_apply c where c.pat_no=a.pat_no and c.times=a.times and c.ledger_sn=a.ledger_sn and c.type=a.type)")
     List<SiSettleApply> selectUnhandledApplies();
 
     @Select("select a.pat_no,a.times,a.ledger_sn,a.input_staff,a.input_comment,a.input_datetime,a.status,a.handle_staff,a.acct_used_flag, " +
@@ -68,4 +69,8 @@ public interface SiSettleApplyDao {
             "handle_comment=#{handleComment},handle_datetime=getdate() where pat_no=#{patNo} " +
             "and times=#{times} and ledger_sn=#{ledgerSn} and type=#{type} and sort_no=#{sortNo}")
     void handleApply(SiSettleApply apply);
+
+    @Select("select * from t_si_settle_apply where pat_no=#{patNo} and times=#{times} and " +
+            "ledger_sn=#{ledgerSn} and type=#{type} order by sort_no")
+    List<SiSettleApply> selectApplyHistories(SiSettleApply apply);
 }

+ 6 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiSettleApplyService.java

@@ -162,4 +162,10 @@ public class SiSettleApplyService {
         dao.handleApply(apply);
         return ResultVoUtil.success("处理成功。");
     }
+
+    public ResultVo<List<SiSettleApply>> selectApplyHistories(SiSettleApply apply) {
+        List<SiSettleApply> list = dao.selectApplyHistories(apply);
+        list.forEach(item -> item.setHandleStaffName(redis.getEmployeeName(item.getHandleStaff())));
+        return ResultVoUtil.success(list);
+    }
 }