Ver código fonte

查询患者参保信息时,住院病人实时设置最新的账页号

lighter 3 anos atrás
pai
commit
caf8713c49

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

@@ -20,6 +20,11 @@ import java.util.List;
 @Mapper
 public interface SiQueryDao {
 
+    @Select("select isnull(max(ledger_sn), isnull(min(ledger_sn), 1)) from zy_ledger_file where " +
+            "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
+    Integer selectMaxLedgerSn(@Param("inpatientNo") String inpatientNo,
+                              @Param("admissTimes") int admissTimes);
+
     /**
      * 查询门诊患者的身份证和姓名
      *

+ 3 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -82,6 +82,9 @@ public class SiQueryService {
             qryPsnBsInfo.setSocialNo(qpbi.getSocialNo());
             qryPsnBsInfo.setLedgerSn(0);
         }
+        if (null != qryPsnBsInfo.getLedgerSn() && qryPsnBsInfo.getLedgerSn() != 0) {
+            qryPsnBsInfo.setLedgerSn(dao.selectMaxLedgerSn(qryPsnBsInfo.getPatNo(), qryPsnBsInfo.getTimes()));
+        }
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.OBTAIN_BASIC_PERSON_INFO, qryPsnBsInfo.getAdmdvs());
         JSONObject data = new JSONObject();
         if (qryPsnBsInfo.getSocialNo().length() < 15) {