Browse Source

新医保业务

lighter 4 years ago
parent
commit
7b075da00d

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

@@ -5,6 +5,7 @@ import thyyxxk.webserver.entity.medicalinsurance.query.*;
 import thyyxxk.webserver.entity.medicalinsurance.setllist.BrfChrgitm;
 import thyyxxk.webserver.entity.medicalinsurance.setllist.InptntSetlmtLst;
 import thyyxxk.webserver.entity.medicalinsurance.setllist.OtptntSetlmtLst;
+import thyyxxk.webserver.entity.medicalinsurance.setllist.YzsInptntSetlmtLst;
 
 import java.util.List;
 
@@ -135,6 +136,23 @@ public interface SiQueryDao {
             "from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and isnull(revoked,0)!=1")
     List<SetlIndex> selectSetlIndex(QrySetlListPrm q);
 
+    @Select("select a.setl_id,a.psn_name,a.gend,a.brdy,c.social_no,a.pat_no, " +
+            "a.age,rtrim(c.home_street) as addr,rtrim(home_tel) as tel, " +
+            "admDeptName=(select rtrim(name) from zd_unit_code where code=d.small_dept), " +
+            "rtrim(d.bed_no) as bedNo,d.admiss_date as admDate,d.dis_date, " +
+            "inHospDays=datediff(day,d.admiss_date,d.dis_date), " +
+            "admDeptName=(select icd_text from zy_in_diag_yb t where t.inpatient_no=a.pat_no " +
+            "and t.admiss_times=a.times and t.diag_no=1), " +
+            "referPhysician=(select rtrim(name) from a_employee_mi where code=d.refer_physician), " +
+            "disDiagName=(select rtrim(dis_diag_comment) from zy_dis_diag_yb t " +
+            "where t.inpatient_no=a.pat_no and t.admiss_times=a.times and t.dis_diag_no=1), " +
+            "a.hifmi_pay,a.maf_pay,a.fund_pay_sumamt,a.psn_part_amt,a.staff_id, " +
+            "staffName=(select rtrim(name) from a_employee_mi where code=a.staff_id) " +
+            "from t_si_setlinfo a, t_si_pat_info b, a_patient_mi c, zy_inactpatient d " +
+            "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.pat_no=d.inpatient_no and a.times=d.admiss_times")
+    YzsInptntSetlmtLst selectYzsZySetlinfo(@Param("setlId") String setlId);
+
     @Select("select a.mdtrt_id,a.psn_name,a.gend,a.age,a.psn_no,b.emp_name," +
             "a.psn_type,a.cvlserv_flag,a.pat_no,a.setl_id, " +
             "tel=(select rtrim(home_tel) from a_patient_mi where a_patient_mi.inpatient_no=a.pat_no), " +
@@ -149,14 +167,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.pat_no=#{patNo} and a.times=#{times} " +
-            "and a.ledger_sn=#{ledgerSn} and a.setl_id=#{setlId} " +
+            "from t_si_setlinfo a, t_si_pat_info b, zy_inactpatient 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("patNo") String patNo,
-                                    @Param("times") int times,
-                                    @Param("ledgerSn") int ledgerSn,
-                                    @Param("setlId") String setlId);
+    InptntSetlmtLst selectZySetlifo(@Param("setlId") String setlId);
 
     @Select("select charge_fee,med_chrgitm_type,chrgitm_lv from zy_detail_charge where inpatient_no=#{patNo} " +
             "and admiss_times=#{times} and trans_flag_yb=1 and ledger_sn=#{ledgerSn}")

+ 18 - 8
src/main/java/thyyxxk/webserver/entity/medicalinsurance/setllist/CuminfoInYear.java

@@ -12,19 +12,29 @@ public class CuminfoInYear {
     private Integer code;
     private String message;
     private Double yearAdmtimes = 0d;
-    private Double yearFeesum = 0d;
+    private Double yearMedfeesum = 0d;
     private Double yearPayedBegnline = 0d;
-    private Double yearFundpays = 0d;
+    private Double yearBaseFundPayAmt = 0d;
     private Double yearBigAmtpays = 0d;
-    private Double yearBigdssInspays = 0d;
-    private Double yearMafpays = 0d;
+    private Double yearBigdssFundPayAmt = 0d;
+    private Double yearMafPayAmt = 0d;
+
+
+    private Double yearPlcyfee;
+    private Double yearPrfrntlPayAmt;
+    private Double yearMafBigdssPayAmt;
+    private Double yearHospRedctnAmt;
+    private Double yearFnanclRmbrsmntAmt;
+    private Double yearOthPaySum;
+    private Double yearAllFundSumamt;
+    private String yearAllFundSumamtUpperCase;
 
     public void addYearAdmtimes(double val) {
         yearAdmtimes += val;
     }
 
     public void addYearFeesum(double val) {
-        yearFeesum += val;
+        yearMedfeesum += val;
     }
 
     public void addYearPayedbegnline(double val) {
@@ -32,7 +42,7 @@ public class CuminfoInYear {
     }
 
     public void addYearFundpays(double val) {
-        yearFundpays += val;
+        yearBaseFundPayAmt += val;
     }
 
     public void addYearBigAmtpays(double val) {
@@ -40,10 +50,10 @@ public class CuminfoInYear {
     }
 
     public void addYearBigdssInspays(double val) {
-        yearBigdssInspays += val;
+        yearBigdssFundPayAmt += val;
     }
 
     public void addYearMafpays(double val) {
-        yearMafpays += val;
+        yearMafPayAmt += val;
     }
 }

+ 4 - 5
src/main/java/thyyxxk/webserver/entity/medicalinsurance/setllist/YzsInptntSetlmtLst.java

@@ -82,7 +82,7 @@ public class YzsInptntSetlmtLst {
     private Double baseFundPayAmt;
     private String baseFundPayAmtUpperCase;
 
-    private Double bigdssFundPayAmt;
+    private Double hifmiPay;
     private Double accidntPayAmt;
     private Double mafPay;
     private Double bigdssSupPrefrnPayAmt;
@@ -90,9 +90,9 @@ public class YzsInptntSetlmtLst {
     private Double hospRedctnAmt;
     private Double fnanclRmbrsmntAmt;
     private Double othRmbrsmntAmt;
-    private Double psnPayAmt;
-    private Double rmbrsmntSumAmt;
-    private String rmbrsmntSumAmtUpperCase;
+    private Double psnPartAmt;
+    private Double fundPaySumamt;
+    private String fundPaySumamtUpperCase;
 
     private Double yearMedfeesum;
     private Double yearPlcyfee;
@@ -104,7 +104,6 @@ public class YzsInptntSetlmtLst {
     private Double yearHospRedctnAmt;
     private Double yearFnanclRmbrsmntAmt;
     private Double yearOthPaySum;
-
     private Double yearAllFundSumamt;
     private String yearAllFundSumamtUpperCase;
 

+ 11 - 14
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -14,10 +14,7 @@ import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.InHspPsnInfo;
 import thyyxxk.webserver.entity.medicalinsurance.outpatient.SpcChrDiseAcct;
 import thyyxxk.webserver.entity.medicalinsurance.query.*;
-import thyyxxk.webserver.entity.medicalinsurance.setllist.BrfChrgitm;
-import thyyxxk.webserver.entity.medicalinsurance.setllist.InptntSetlmtLst;
-import thyyxxk.webserver.entity.medicalinsurance.setllist.OtptntSetlmtLst;
-import thyyxxk.webserver.entity.medicalinsurance.setllist.CuminfoInYear;
+import thyyxxk.webserver.entity.medicalinsurance.setllist.*;
 import thyyxxk.webserver.utils.*;
 
 import java.time.LocalDate;
@@ -688,22 +685,22 @@ public class SiQueryService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, cuminfo.getMessage());
         }
         if (index.getType() == SetlType.YZS_INPATIENT.getCode()) {
-            return ResultVoUtil.success();
+            YzsInptntSetlmtLst lst = dao.selectYzsZySetlinfo(index.getSetlId());
+            return ResultVoUtil.success(lst);
         } else if (index.getType() == SetlType.NORMAL_INPATIENT.getCode()) {
-            InptntSetlmtLst lst = dao.selectZySetlifo(index.getPatNo(), index.getTimes(),
-                    index.getLedgerSn(), index.getSetlId());
+            InptntSetlmtLst lst = dao.selectZySetlifo(index.getSetlId());
             lst.setFixmedinsName(SiUtil.INSTITUTION_NAME);
             lst.setGendName(index.getGendName());
             SiEnumReflectUtil.inptntSetlmtLstReflect(lst);
             List<BrfChrgitm> chrgitms = dao.selectZyBrfChrgitms(index.getPatNo(), index.getTimes(), index.getLedgerSn());
             analyzeZyChrgitm(lst, chrgitms);
             lst.setYrAdmtimes(cuminfo.getYearAdmtimes());
-            lst.setYrMedfeeSumamt(cuminfo.getYearFeesum());
+            lst.setYrMedfeeSumamt(cuminfo.getYearMedfeesum());
             lst.setYrPayedBegnLine(cuminfo.getYearPayedBegnline());
-            lst.setYrFundPaySumamt(cuminfo.getYearFundpays());
+            lst.setYrFundPaySumamt(cuminfo.getYearBaseFundPayAmt());
             lst.setYrBigAmtFundPay(cuminfo.getYearBigAmtpays());
-            lst.setYrBigDssInsPay(cuminfo.getYearBigdssInspays());
-            lst.setYrMafPay(cuminfo.getYearMafpays());
+            lst.setYrBigDssInsPay(cuminfo.getYearBigdssFundPayAmt());
+            lst.setYrMafPay(cuminfo.getYearMafPayAmt());
             return listPolItemCodePayInfo(lst);
         } else {
             index.setLedgerSn(0);
@@ -715,10 +712,10 @@ public class SiQueryService {
             List<BrfChrgitm> chrgitms = dao.selectMzBrfChrgitms(index.getPatNo(), index.getTimes());
             analyzeMzChrgitm(lst, chrgitms);
             lst.setYrAdmtimes(cuminfo.getYearAdmtimes());
-            lst.setYrMedfeeSumamt(cuminfo.getYearFeesum());
-            lst.setYrFundPaySumamt(cuminfo.getYearFundpays());
+            lst.setYrMedfeeSumamt(cuminfo.getYearMedfeesum());
+            lst.setYrFundPaySumamt(cuminfo.getYearBaseFundPayAmt());
             lst.setYrBigAmtFundPay(cuminfo.getYearBigAmtpays());
-            lst.setYrMafPay(cuminfo.getYearMafpays());
+            lst.setYrMafPay(cuminfo.getYearMafPayAmt());
             lst.setFixmedinsName(SiUtil.INSTITUTION_NAME);
             return ResultVoUtil.success(lst);
         }

+ 6 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -24,6 +24,7 @@ import thyyxxk.webserver.entity.yibao.dismiss.YbSettleFee;
 import thyyxxk.webserver.entity.yibao.patient.Overview;
 import thyyxxk.webserver.service.yibao.DismissService;
 import thyyxxk.webserver.service.yibao.SettleService;
+import thyyxxk.webserver.service.yibao.XiangMuLuRuService;
 import thyyxxk.webserver.utils.*;
 import thyyxxk.webserver.websocket.WebSocketServer;
 
@@ -59,11 +60,13 @@ public class SiZyService {
     private final ExecService exec;
     private final SettleService settleService;
     private final DismissService dismissService;
+    private final XiangMuLuRuService xmlrService;
 
     @Autowired
     public SiZyService(SiZyDao dao, SiQueryDao queryDao, SiSetlinfoDao setlinfoDao,
                        SiSetldetailDao setldetailDao, ExecService exec,
-                       SettleService settleService, DismissService dismissService) {
+                       SettleService settleService, DismissService dismissService,
+                       XiangMuLuRuService xmlrService) {
         this.dao = dao;
         this.queryDao = queryDao;
         this.setlinfoDao = setlinfoDao;
@@ -71,6 +74,7 @@ public class SiZyService {
         this.exec = exec;
         this.settleService = settleService;
         this.dismissService = dismissService;
+        this.xmlrService = xmlrService;
     }
 
     public ResultVo<String> admissRegister(ZyPatientInfo p) {
@@ -173,6 +177,7 @@ public class SiZyService {
         dao.hisRecount(o.getInpatientNo(), o.getAdmissTimes(), o.getLedgerSn());
         o.setStaffId(TokenUtil.getTokenUserId());
         settleService.posNegOffset(o);
+        xmlrService.yiZhuTuiFeiPiPei(o.getInpatientNo(), o.getAdmissTimes());
         ZyPatientInfo p = dao.selectPatientInfo(o.getInpatientNo());
         p.setSid(o.getSid());
         p.setLedgerSn(o.getLedgerSn());