浏览代码

添加超时结算功能

lighter 10 月之前
父节点
当前提交
a941137b69

+ 5 - 4
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SiZyController.java

@@ -31,7 +31,6 @@ public class SiZyController {
         return service.admissRegister(p);
     }
 
-    @PassToken
     @PostMapping("/modifyAdmissionInfo")
     public ResultVo<String> modifyAdmissionInfo(@RequestBody ZyPatientInfo p) {
         return service.modifyAdmissionInfo(p);
@@ -68,21 +67,23 @@ public class SiZyController {
         return service.hospitalizationPreSettlement(p);
     }
 
-    @PassToken
     @PostMapping("/dischargeProcessing")
     public ResultVo<String> dischargeProcessing(@RequestBody ZyPatientInfo p) {
         return service.dischargeProcessing(p);
     }
 
-    @PassToken
     @PostMapping("/revokeDischarge")
     public ResultVo<String> revokeDischarge(@RequestBody ZyPatientInfo p) {
         return service.revokeDischarge(p);
     }
 
-    @PassToken
     @PostMapping("/revokeSettlement")
     public ResultVo<String> revokeSettlement(@RequestBody ZyPatientInfo p) {
         return service.revokeSettlement(p);
     }
+
+    @PostMapping("/timeoutSettlement")
+    public ResultVo<String> timeoutSettlement(@RequestBody ZyPatientInfo p) {
+        return service.timeoutSettlement(p);
+    }
 }

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

@@ -78,18 +78,10 @@ public interface SiQueryDao {
     void updatePsnIdetType(@Param("psnIdetType") String psnIdetType,
                            @Param("psnNo") String psnNo);
 
-    /**
-     * 获取患者的医保基本信息
-     *
-     * @param patNo    住院号
-     * @param times    住院次数
-     * @param ledgerSn 账页号
-     * @return 医保基本信息
-     */
+
     @Select("select * from t_si_pat_info where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
-    SiPatInfo selectSiPatInfoForZy(@Param("patNo") String patNo,
-                                   @Param("times") int times,
-                                   @Param("ledgerSn") int ledgerSn);
+    SiPatInfo selectSiPatInfo(@Param("patNo") String patNo, @Param("times") int times, @Param("ledgerSn") int ledgerSn);
+
 
     /**
      * 获取患者的医保个人编号
@@ -115,17 +107,6 @@ public interface SiQueryDao {
     CodeName selectPsnNoByPatNoAndMedType(@Param("patNo") String patNo,
                                           @Param("medType") String medType);
 
-    /**
-     * 获取患者的医保基本信息
-     *
-     * @param patNo 门诊号
-     * @param times 门诊次数
-     * @return 医保基本信息
-     */
-    @Select("select * from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
-    SiPatInfo selectSiPatInfoForMz(@Param("patNo") String patNo,
-                                   @Param("times") int times);
-
     /**
      * 取消入院登记后清空就诊id
      *
@@ -149,9 +130,6 @@ public interface SiQueryDao {
     @Select("select setl_id from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn} and revoked=0")
     String selectSetlId(@Param("patNo") String patNo, @Param("times") int times, @Param("ledgerSn") int ledgerSn);
 
-    @Select("select * from t_si_pat_info where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
-    SiPatInfo selectSiPatInfo(@Param("patNo") String patNo, @Param("times") int times, @Param("ledgerSn") int ledgerSn);
-
     @Select("select top 1 insuplc_admdvs from t_si_pat_info where pat_no=#{patNo} and times=#{times} " +
             "and insuplc_admdvs is not null order by ledger_sn desc")
     String selectAdmdvs(@Param("patNo") String patNo, @Param("times") int times);

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

@@ -53,7 +53,7 @@ public class SiQueryService {
     }
 
     public ResultVo<SiPatInfo> getSiPatInfo(QryPsnBsInfo qryPsnBsInfo) {
-        SiPatInfo siPatInfo = dao.selectSiPatInfoForZy(qryPsnBsInfo.getPatNo(), qryPsnBsInfo.getTimes(), qryPsnBsInfo.getLedgerSn());
+        SiPatInfo siPatInfo = dao.selectSiPatInfo(qryPsnBsInfo.getPatNo(), qryPsnBsInfo.getTimes(), qryPsnBsInfo.getLedgerSn());
         if (null == siPatInfo) {
             siPatInfo = new SiPatInfo();
         }
@@ -361,12 +361,12 @@ public class SiQueryService {
         return ResultVoUtil.success(setlInfo);
     }
 
-    private SiPatInfo getSiPatInfo(BscQryPrm q) {
+    public SiPatInfo getSiPatInfo(BscQryPrm q) {
         if (null == q.getMdtrtId()) {
             if (null == q.getLedgerSn()) {
                 q.setLedgerSn(0);
             }
-            return dao.selectSiPatInfoForZy(q.getPatNo(), q.getTimes(), q.getLedgerSn());
+            return dao.selectSiPatInfo(q.getPatNo(), q.getTimes(), q.getLedgerSn());
         }
         return dao.selectSiPatInfoByMdtrtId(q.getMdtrtId());
     }

+ 111 - 91
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -160,7 +160,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> modifyAdmissionInfo(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者医保不在院!");
         }
@@ -196,7 +196,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeAdmission(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保在院信息!");
         }
@@ -297,7 +297,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeUploadFees(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保在院信息!");
         }
@@ -352,7 +352,7 @@ public class SiZyService {
         if (null == fee.getOriDetailSn()) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先处理违规退费。");
         }
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(fee.getPatNo(), fee.getTimes(), fee.getLedgerSn());
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(fee.getPatNo(), fee.getTimes(), fee.getLedgerSn());
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_HOSPITALIZATION_FEE_DETAILS,
                 siPatInfo.getInsuplcAdmdvs());
         JSONArray data = new JSONArray();
@@ -385,7 +385,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeSingleCharge(String patNo, int times, int ledgerSn, int detailSn) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(patNo, times, ledgerSn);
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(patNo, times, ledgerSn);
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_HOSPITALIZATION_FEE_DETAILS,
                 siPatInfo.getInsuplcAdmdvs());
         JSONArray data = new JSONArray();
@@ -487,7 +487,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeDischarge(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
             transbackTables(p);
             return ResultVoUtil.success("取消出院办理成功。");
@@ -517,15 +517,19 @@ public class SiZyService {
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
 
+    private void fillBeginTime(ZyPatientInfo p) {
+        if (null == p.getYbRegisterDate()) {
+            Date beginTime = dismissService.getBegntime(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), "zy_actpatient");
+            p.setYbRegisterDate(beginTime);
+        }
+    }
+
     private ResultVo<String> inpatientSettlement(ZyPatientInfo p) {
         PreSetlmt preSetlmt;
-        Date begntime = p.getYbRegisterDate();
-        if (null == begntime) {
-            begntime = dismissService.getBegntime(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), "zy_actpatient");
-        }
+        fillBeginTime(p);
         if (p.getMidSetl()) {
             preSetlmt = dao.selectPreSetlmtForMidSetl(p.getInpatientNo(), p.getAdmissTimes(),
-                    p.getLedgerSn(), begntime, p.getZjdzDatetime());
+                    p.getLedgerSn(), p.getYbRegisterDate(), p.getZjdzDatetime());
         } else {
             preSetlmt = dao.selectPreSetlmt(p.getInpatientNo(), p.getAdmissTimes(),
                     p.getLedgerSn(), "2999-12-31 23:59:59.999");
@@ -579,102 +583,118 @@ public class SiZyService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
         if (infcode == 0) {
-            JSONObject setlinfo = result.getJSONObject(OUTPUT).getJSONObject("setlinfo");
-            SiSetlinfo setlinfoEntity = JSONObject.parseObject(setlinfo.toJSONString(), SiSetlinfo.class);
-            setlinfoEntity.setPatNo(p.getInpatientNo());
-            setlinfoEntity.setTimes(p.getAdmissTimes());
-            setlinfoEntity.setLedgerSn(p.getLedgerSn());
-            setlinfoEntity.setStaffId(TokenUtil.getInstance().getTokenUserId());
-            setlinfoEntity.setRevoked(YesOrNo.NO.getCode());
-            setlinfoEntity.setSetlType(ClrType.INPATIENT.getCode());
-            setlinfoEntity.setInsuplcAdmdvs(preSetlmt.getInsuplcAdmdvs());
-            setlinfoEntity.setBegntime(begntime);
-            setlinfoEntity.setEndtime(p.getDismissDate());
-            setlinfoEntity.setHiPaymtd(CommonUtil.calcHiPaymtd(setlinfoEntity.getInsuplcAdmdvs(),setlinfoEntity.getMedType(),setlinfoEntity.getInsutype(),setlinfoEntity.getSetlTime()));
-            setlinfoEntity.setMedinsType(MedInsTypeUtil.getMedInsType(setlinfoEntity));
-            JSONArray setldetail = result.getJSONObject(OUTPUT).getJSONArray("setldetail");
-            BigDecimal hospitalPart = BigDecimal.ZERO;
-            for (int i = 0; i < setldetail.size(); i++) {
-                SiSetldetail setldetailEntity = JSONObject.parseObject(setldetail.getJSONObject(i).toJSONString(), SiSetldetail.class);
-                setldetailEntity.setPatNo(p.getInpatientNo());
-                setldetailEntity.setTimes(p.getAdmissTimes());
-                setldetailEntity.setLedgerSn(p.getLedgerSn());
-                if (setldetailEntity.getFundPayType().equals("999996") || setldetailEntity.getSetlProcInfo().equals("999996")) {
-                    hospitalPart = hospitalPart.add(setldetailEntity.getFundPayamt());
-                }
-                setldetldao.insert(setldetailEntity);
+            p.setInsuplcAdmdvs(preSetlmt.getInsuplcAdmdvs());
+            return executeHisSettlement(result.getJSONObject(OUTPUT), p);
+        }
+        revokeDischarge(p);
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
+    }
+
+    public ResultVo<String> timeoutSettlement(ZyPatientInfo p) {
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        if (null == siPatInfo) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "[t_si_pat_info]没有此患者的就诊信息。");
+        }
+        fillBeginTime(p);
+        p.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs());
+        JSONObject output = queryService.execute5203(siPatInfo);
+        return executeHisSettlement(output, p);
+    }
+
+    private ResultVo<String> executeHisSettlement(JSONObject output, ZyPatientInfo p) {
+        JSONObject setlinfo = output.getJSONObject("setlinfo");
+        SiSetlinfo setlinfoEntity = JSONObject.parseObject(setlinfo.toJSONString(), SiSetlinfo.class);
+        setlinfoEntity.setPatNo(p.getInpatientNo());
+        setlinfoEntity.setTimes(p.getAdmissTimes());
+        setlinfoEntity.setLedgerSn(p.getLedgerSn());
+        setlinfoEntity.setStaffId(TokenUtil.getInstance().getTokenUserId());
+        setlinfoEntity.setRevoked(YesOrNo.NO.getCode());
+        setlinfoEntity.setSetlType(ClrType.INPATIENT.getCode());
+        setlinfoEntity.setInsuplcAdmdvs(p.getInsuplcAdmdvs());
+        setlinfoEntity.setBegntime(p.getYbRegisterDate());
+        setlinfoEntity.setEndtime(p.getDismissDate());
+        setlinfoEntity.setHiPaymtd(CommonUtil.calcHiPaymtd(setlinfoEntity.getInsuplcAdmdvs(),setlinfoEntity.getMedType(),setlinfoEntity.getInsutype(),setlinfoEntity.getSetlTime()));
+        setlinfoEntity.setMedinsType(MedInsTypeUtil.getMedInsType(setlinfoEntity));
+        JSONArray setldetail = output.getJSONArray("setldetail");
+        BigDecimal hospitalPart = BigDecimal.ZERO;
+        for (int i = 0; i < setldetail.size(); i++) {
+            SiSetldetail setldetailEntity = JSONObject.parseObject(setldetail.getJSONObject(i).toJSONString(), SiSetldetail.class);
+            setldetailEntity.setPatNo(p.getInpatientNo());
+            setldetailEntity.setTimes(p.getAdmissTimes());
+            setldetailEntity.setLedgerSn(p.getLedgerSn());
+            if (setldetailEntity.getFundPayType().equals("999996") || setldetailEntity.getSetlProcInfo().equals("999996")) {
+                hospitalPart = hospitalPart.add(setldetailEntity.getFundPayamt());
             }
-            setlinfoEntity.setHospPartAmt(hospitalPart.doubleValue());
-            setlinfodao.insert(setlinfoEntity);
-            setlinfodao.updateSiZyInfoSetlId(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(),
-                    setlinfoEntity.getSetlId(), setlinfoEntity.getMedinsSetlId(), input.getString("msgid"));
-            setlinfodao.updateApplySettled(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), YesOrNo.YES.getCode());
+            setldetldao.insert(setldetailEntity);
+        }
+        setlinfoEntity.setHospPartAmt(hospitalPart.doubleValue());
+        setlinfodao.insert(setlinfoEntity);
+        setlinfodao.updateSiZyInfoSetlId(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(),
+                setlinfoEntity.getSetlId(), setlinfoEntity.getMedinsSetlId(), setlinfoEntity.getMedinsSetlId());
+        setlinfodao.updateApplySettled(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), YesOrNo.YES.getCode());
 
-            // 跨省异地数据不参与对账,对总账时无需统计进去。
-            if (setlinfoEntity.getFundPaySumamt() > 0 && setlinfoEntity.getInsuplcAdmdvs().startsWith("43")) {
-                InstStlLdgChk ldgChk = new InstStlLdgChk();
-                ldgChk.setInsutype(setlinfoEntity.getInsutype());
-                ldgChk.setClrType(setlinfoEntity.getClrType());
-                ldgChk.setSetlOptins(setlinfoEntity.getClrOptins());
-                ldgChk.setStmtBegndate(setlinfoEntity.getSetlTime());
-                ldgChk.setStmtEnddate(setlinfoEntity.getSetlTime());
-                ResultVo<String> totalLedgerCheck = manageService.institutionSettlementLedgerCheck(ldgChk);
-                if (totalLedgerCheck.getCode() != ExceptionEnum.SUCCESS.getCode()) {
-                    InstStlLdgChk detlChk = new InstStlLdgChk();
-                    detlChk.setSetlOptins(ldgChk.getSetlOptins());
-                    detlChk.setStmtBegndate(ldgChk.getStmtBegndate());
-                    detlChk.setStmtEnddate(ldgChk.getStmtEnddate());
-                    detlChk.setClrType(ldgChk.getClrType());
-                    detlChk.setRefdSetlFlag(YesOrNo.NO.getCodeStr());
-                    ResultVo<List<InsSetlDetlChkRslt>> detailLedgerCheck = manageService.institutionSettlementDetailCheck(detlChk);
-                    if (detailLedgerCheck.getCode() != ExceptionEnum.SUCCESS.getCode()) {
-                        revokeSettlement(p);
-                        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, detailLedgerCheck.getMessage());
-                    }
-                    for (InsSetlDetlChkRslt insSetlDetlChkRslt : detailLedgerCheck.getData()) {
-                        if (Objects.equals(insSetlDetlChkRslt.getSetlId(), setlinfoEntity.getSetlId())) {
-                            if (!Objects.equals(insSetlDetlChkRslt.getStmtRslt(), "0")) {
-                                revokeSettlement(p);
-                                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, insSetlDetlChkRslt.getMemo());
-                            }
-                            break;
+        // 跨省异地数据不参与对账,对总账时无需统计进去。
+        if (setlinfoEntity.getFundPaySumamt() > 0 && setlinfoEntity.getInsuplcAdmdvs().startsWith("43")) {
+            InstStlLdgChk ldgChk = new InstStlLdgChk();
+            ldgChk.setInsutype(setlinfoEntity.getInsutype());
+            ldgChk.setClrType(setlinfoEntity.getClrType());
+            ldgChk.setSetlOptins(setlinfoEntity.getClrOptins());
+            ldgChk.setStmtBegndate(setlinfoEntity.getSetlTime());
+            ldgChk.setStmtEnddate(setlinfoEntity.getSetlTime());
+            ResultVo<String> totalLedgerCheck = manageService.institutionSettlementLedgerCheck(ldgChk);
+            if (totalLedgerCheck.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+                InstStlLdgChk detlChk = new InstStlLdgChk();
+                detlChk.setSetlOptins(ldgChk.getSetlOptins());
+                detlChk.setStmtBegndate(ldgChk.getStmtBegndate());
+                detlChk.setStmtEnddate(ldgChk.getStmtEnddate());
+                detlChk.setClrType(ldgChk.getClrType());
+                detlChk.setRefdSetlFlag(YesOrNo.NO.getCodeStr());
+                ResultVo<List<InsSetlDetlChkRslt>> detailLedgerCheck = manageService.institutionSettlementDetailCheck(detlChk);
+                if (detailLedgerCheck.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+                    revokeSettlement(p);
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, detailLedgerCheck.getMessage());
+                }
+                for (InsSetlDetlChkRslt insSetlDetlChkRslt : detailLedgerCheck.getData()) {
+                    if (Objects.equals(insSetlDetlChkRslt.getSetlId(), setlinfoEntity.getSetlId())) {
+                        if (!Objects.equals(insSetlDetlChkRslt.getStmtRslt(), "0")) {
+                            revokeSettlement(p);
+                            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, insSetlDetlChkRslt.getMemo());
                         }
+                        break;
                     }
                 }
             }
-            queryService.saveCumInfo(setlinfoEntity);
-            MedinsSettleFee settleFee = new MedinsSettleFee();
-            if (p.getMidSetl()) {
-                settleFee.setZjdzDatetime(p.getZjdzDatetime());
-            }
-            settleFee.setMidSetl(p.getMidSetl());
-            settleFee.setStaffId(TokenUtil.getInstance().getTokenUserId());
-            settleFee.setInpatientNo(p.getInpatientNo());
-            settleFee.setAdmissTimes(p.getAdmissTimes());
-            settleFee.setBedNo(p.getBedNo());
-            settleFee.setWardCode(p.getAdmissWard());
-            settleFee.setDeptCode(p.getAdmissDept());
-            settleFee.setTotalCost(setlinfo.getString("medfee_sumamt"));
-            settleFee.setTczf(setlinfo.getString("fund_pay_sumamt"));
-            settleFee.setHospitalPay(setlinfo.getString("hosp_part_amt"));
-            settleFee.setGrzhzf(setlinfo.getString("acct_pay"));
-            settleFee.setDbzf(setlinfo.getString("hifmi_pay"));
-            settleFee.setXjzf(setlinfo.getString("psn_cash_pay"));
-            settleFee.setTable(p.getTable());
-            return dismissService.executeDischarging(settleFee);
         }
-        revokeDischarge(p);
-        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
+        queryService.saveCumInfo(setlinfoEntity);
+        MedinsSettleFee settleFee = new MedinsSettleFee();
+        if (p.getMidSetl()) {
+            settleFee.setZjdzDatetime(p.getZjdzDatetime());
+        }
+        settleFee.setMidSetl(p.getMidSetl());
+        settleFee.setStaffId(TokenUtil.getInstance().getTokenUserId());
+        settleFee.setInpatientNo(p.getInpatientNo());
+        settleFee.setAdmissTimes(p.getAdmissTimes());
+        settleFee.setBedNo(p.getBedNo());
+        settleFee.setWardCode(p.getAdmissWard());
+        settleFee.setDeptCode(p.getAdmissDept());
+        settleFee.setTotalCost(setlinfo.getString("medfee_sumamt"));
+        settleFee.setTczf(setlinfo.getString("fund_pay_sumamt"));
+        settleFee.setHospitalPay(setlinfo.getString("hosp_part_amt"));
+        settleFee.setGrzhzf(setlinfo.getString("acct_pay"));
+        settleFee.setDbzf(setlinfo.getString("hifmi_pay"));
+        settleFee.setXjzf(setlinfo.getString("psn_cash_pay"));
+        settleFee.setTable(p.getTable());
+        return dismissService.executeDischarging(settleFee);
     }
 
     public ResultVo<String> revokeSettlement(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == p.getStaffId()) {
             p.setStaffId(TokenUtil.getInstance().getTokenUserId());
         }
         if (null == p.getLedgerSn()) {
             p.setLedgerSn(dao.selectMaxLedgerSn(p.getInpatientNo(), p.getAdmissTimes()));
         }
+        SiPatInfo siPatInfo = queryDao.selectSiPatInfo(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getSetlId())) {
             return revokeDischarge(p);
         }