ソースを参照

修复断账患者查不到结算单的问题。

lighter 3 年 前
コミット
9464ba6e1c

+ 3 - 3
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiQueryDao.java

@@ -132,7 +132,7 @@ public interface SiQueryDao {
                            @Param("nullCtnt") String nullCtnt);
 
     @Select("select type=#{type},pat_no,times,ledger_sn,psn_name,setl_id,gend,setl_time,medfee_sumamt,psn_no " +
-            "from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and isnull(revoked,0)!=1")
+            "from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and revoked=0")
     List<SetlIndex> selectSetlIndex(QrySetlListPrm q);
 
     @Select("select top 1 * from t_si_pat_info where pat_no=#{patNo} and times=#{times} order by ledger_sn desc")
@@ -165,10 +165,10 @@ public interface SiQueryDao {
             "staffName=(select rtrim(name) from a_employee_mi where a_employee_mi.code=a.staff_id), " +
             "a.balc,a.medfee_sumamt,a.hifp_pay,a.acct_pay,a.cvlserv_pay,a.psn_cash_pay, " +
             "a.hifob_pay,a.oth_pay,a.hifmi_pay,a.maf_pay " +
-            "from t_si_setlinfo a, t_si_pat_info b, zy_inactpatient c where a.setl_id=#{setlId} " +
+            "from t_si_setlinfo a, t_si_pat_info b, ${table} c where a.setl_id=#{setlId} " +
             "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 a.times=c.admiss_times")
-    InptntSetlmtLst selectZySetlifo(@Param("setlId") String setlId);
+    InptntSetlmtLst selectZySetlifo(@Param("setlId") String setlId, @Param("table") String table);
 
     @Select("select account_date from zy_ledger_file where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{sn}")
     Date selectAccountDate(@Param("patNo") String patNo,

+ 5 - 2
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -819,9 +819,12 @@ public class SiQueryService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, cuminfo.getMessage());
         }
         if (index.getType() == SetlType.INPATIENT.getCode()) {
-            InptntSetlmtLst lst = dao.selectZySetlifo(index.getSetlId());
+            InptntSetlmtLst lst = dao.selectZySetlifo(index.getSetlId(), "zy_inactpatient");
             if (null == lst) {
-                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
+                lst = dao.selectZySetlifo(index.getSetlId(), "zy_actpatient");
+                if (null == lst) {
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
+                }
             }
             if (siPatInfo.getLedgerSn() > 1) {
                 Date accountdate = dao.selectAccountDate(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn() - 1);

+ 1 - 1
src/main/resources/application.yml

@@ -8,7 +8,7 @@ spring:
     cache: false
   datasource:
     dynamic:
-      primary: dev
+      primary: his
       strict: false
       datasource:
         his: