Sfoglia il codice sorgente

结算单中审核 不是 直接在老的上面该,而是直接生成新的

xiaochan 3 anni fa
parent
commit
862a77044e

+ 11 - 4
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -145,10 +145,11 @@ public interface UpIdCollectionDao {
             "       rtrim(dis_diag) as diag_code,  " +
             "       rtrim(dis_diag_comment) as diag_name,  " +
             "       case when dis_diag_no = 1 then 1 else 0 end as maindiag_flag  " +
-            "from zy_dis_diag_yb  " +
+            "from ${tableName}  " +
             "where inpatient_no = #{patNo} and admiss_times = #{times}")
     List<DiseinfoUpld> diseinfo(@Param("patNo") String patNo,
-                                @Param("times") Integer times);
+                                @Param("times") Integer times,
+                                @Param("tableName") String tableName);
 
     // 这里是手术操作信息
     @Select("select isnull(rtrim(ssjb),1)  as oprn_oprt_type, " +
@@ -160,10 +161,11 @@ public interface UpIdCollectionDao {
             "       rtrim(ssys) as oper_dr_code, " +
             "       (select top(1) rtrim(name) from a_employee_mi where code = mzys) as  anst_dr_name, " +
             "       rtrim(mzys) as anst_dr_code " +
-            "       from batj_ba4 " +
+            "       from ${tableName} " +
             "where zyh = #{patNo} and zycs = #{times}")
     List<OprninfoUpld> oprninfoUplds(@Param("patNo") String patNo,
-                                     @Param("times") Integer times);
+                                     @Param("times") Integer times,
+                                     @Param("tableName") String tableName);
 
     @Select("select receipt_no from zy_receipt where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn} and receipt_no<>'0000000'" +
             "and receipt_sn = 1")
@@ -171,6 +173,11 @@ public interface UpIdCollectionDao {
                   @Param("times") Integer times,
                   @Param("ledgerSn") Integer ledgerSn);
 
+    @Select("select isnull(audit_flag,0) from t_yb_setl_modify_req where pat_no = #{patNo} " +
+            "and admissTimes = #{admissTimes}")
+    Integer setlModifyReq(@Param("patNo") String patNo,
+                          @Param("times") Integer times);
+
     // 基金支付信息
     @Select("select fund_pay_type,fund_payamt=cast(fund_payamt as decimal(16,2)) from t_si_setldetail " +
             "where pat_no = #{patNo} and times = #{times} and ledger_sn = #{ledgerSn} ")

+ 19 - 14
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -80,15 +80,15 @@ public class SetlListUpldService {
         JSONObject jsonObject = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_SI_SETTLE_INFO, upldCollection.getData().getSetlinfo().getInsuplc());
         jsonObject.replace("input", input);
         // 这里是上传
-//        JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
-
-        JSONObject result = new JSONObject();
-        if (times % 2 == 0) {
-            result.put("infcode", 0);
-        } else {
-            result.put("infcode", -1);
-            result.put("err_msg", "知道你为啥失败吗?");
-        }
+        JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
+
+//        JSONObject result = new JSONObject();
+//        if (times % 2 == 0) {
+//            result.put("infcode", 0);
+//        } else {
+//            result.put("infcode", -1);
+//            result.put("err_msg", "知道你为啥失败吗?");
+//        }
         log.info("医保结算信息上传 \n操作人:{}\n参数:{} \n结果:{}", TokenUtil.getTokenUserId(), jsonObject, result);
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -97,7 +97,7 @@ public class SetlListUpldService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("医保中心报错:【%s】 ", result.getString("message")));
         }
         if (result.getIntValue(RESULT_CODE) == 0) {
-//            dao.fanHuiLiuShuiHao(result.getJSONObject(OUTPUT).getString("setl_list_id"), upldCollection.getData().getSetlinfo().getSetlId());
+            dao.fanHuiLiuShuiHao(result.getJSONObject(OUTPUT).getString("setl_list_id"), upldCollection.getData().getSetlinfo().getSetlId());
             return ResultVoUtil.success(ExceptionEnum.SUCCESS, "上传成功");
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("医保中心报错:【%s】 ", result.getString("err_msg")));
@@ -105,6 +105,8 @@ public class SetlListUpldService {
 
     public ResultVo<UpldCollection> getUploadInfo(String patNo, Integer times, Integer ledgerSn) throws Exception {
         log.info("住院号:{},次数:{},账页:{}", patNo, times, ledgerSn);
+        Integer setlModifyReq = dao.setlModifyReq(patNo, times);
+
         SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
         if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
@@ -133,7 +135,8 @@ public class SetlListUpldService {
         // 医保机构经办人
         setlinfoUpld.setHsorgOpter("未知");
         setlinfoUpld.setBillNo(dao.billNo(patNo, times, ledgerSn));
-        List<OprninfoUpld> oprninfoUpld = dao.oprninfoUplds(patNo, times);
+        // 手术
+        List<OprninfoUpld> oprninfoUpld = dao.oprninfoUplds(patNo, times, setlModifyReq == 1 ? "batj_ba4_modify" : "batj_ba4");
 
         if (ListUtil.notBlank(oprninfoUpld)) {
             // 用来存放最大的手术级别
@@ -223,8 +226,10 @@ public class SetlListUpldService {
                 zhongZhenJianHu.add(icuinfoUpld);
             }
         }
+
+
         List<PayinfoUpld> payinfo = dao.payinfoUpld(patNo, times, ledgerSn);
-        List<DiseinfoUpld> diseinfos = dao.diseinfo(patNo, times);
+        List<DiseinfoUpld> diseinfos = dao.diseinfo(patNo, times, setlModifyReq == 1 ? "zy_dis_diag_yb_modify" : "zy_dis_diag_yb");
 
         UpldCollection upldCollection = new UpldCollection();
         // 患者的基本信息
@@ -645,8 +650,8 @@ public class SetlListUpldService {
         dao.upAuditFlag(id, 3);
         if (auditFlag == 1) {
             // 审核通过需要 删除 并更新
-            dao.delYuanShuJu(req.getPatNo(), req.getTimes());
-            dao.auditTongGuo(req.getPatNo(), req.getTimes());
+//            dao.delYuanShuJu(req.getPatNo(), req.getTimes());
+//            dao.auditTongGuo(req.getPatNo(), req.getTimes());
             dao.updateReq(id, remark, auditStaff, auditName);
             return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "审核已通过 (*^▽^*)");
         }