浏览代码

Merge branch 'master' of https://172.16.32.165/lighter/web-server

lighter 3 年之前
父节点
当前提交
fc187af141

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

@@ -45,9 +45,11 @@ public interface UpIdCollectionDao {
             "       a.insutype as hi_type  " + // -- 枚举 MdcsType
             "from t_si_setlinfo a, t_si_pat_info b " +
             "where a.pat_no=b.pat_no and a.times=b.times " +
-            "and a.pat_no = #{patNo} and a.times = #{times}")
+            "and a.pat_no = #{patNo} and a.times = #{times} " +
+            "and a.revoked = 0 ")
     SetlinfoUpld setlinfo1(@Param("patNo") String patNo,
-                           @Param("times") Integer times);
+                           @Param("times") Integer times,
+                           @Param("ledgerSn") Integer ledgerSn);
 
 
     @Select("select  rtrim(country) as ntly, " +  // 国籍

+ 2 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyiji/QueRenYiZhuShouFeiDao.java

@@ -175,7 +175,8 @@ public interface QueRenYiZhuShouFeiDao {
             " charge_status = #{item.chargeStatus}, op_id = #{code}, op_date = GETDATE() " +
             "</set>" +
             "WHERE act_order_no = #{item.actOrderNo} " +
-            "AND inpatient_no = #{item.inpatientNo} AND admiss_times = #{item.admissTimes} and occ_time = #{item.occTime} and act_order_no = #{item.actOrderNo}" +
+            "AND inpatient_no = #{item.inpatientNo} AND admiss_times = #{item.admissTimes} and occ_time = #{item.occTime} and act_order_no = #{item.actOrderNo} " +
+            "and charge_code = #{item.chargeCode}" +
             "</foreach>" +
             "</script>")
     void baoCunYiZhuQueFei(@Param("list") List<YzActOrder> list,

+ 16 - 5
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiManageService.java

@@ -311,7 +311,7 @@ public class SiManageService {
     }
 
     public ResultVo<JSONObject> upldSetlList(String patNo, Integer times, Integer ledgerSn) throws Exception {
-        SetlinfoUpld setlinfoUpld = upIdCollectionDao.setlinfo1(patNo, times);
+        SetlinfoUpld setlinfoUpld = upIdCollectionDao.setlinfo1(patNo, times, ledgerSn);
         if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
         }
@@ -421,6 +421,7 @@ public class SiManageService {
         JSONObject jsonObject = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_SI_SETTLE_INFO, setlinfoUpld.getInsuplc());
         jsonObject.replace("input", input);
         JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
+
         log.info("医保结算信息上传:\n参数:{} \n结果:{}", jsonObject, result);
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -445,17 +446,25 @@ public class SiManageService {
         if (ListUtil.isBlank(param)) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择需要上传的患者。");
         }
+        List<PureCodeName> keys = new ArrayList<>();
+        keys.add(new PureCodeName("patNo", "住院号"));
+        keys.add(new PureCodeName("times", "住院次数"));
+        keys.add(new PureCodeName("ledgerSn", "账页号"));
+        keys.add(new PureCodeName("message", "上传结果"));
+        keys.add(new PureCodeName("type", "错误类型"));
+
         for (int i = 0; i < param.size(); i++) {
             SiPatInfo siPatInfo = param.get(i);
             int percentage = makePercentage(i + 1, param.size());
             try {
                 ResultVo<JSONObject> resultVo = upldSetlList(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn());
                 upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(),
-                        resultVo.getMessage(), resultVo.getCode(), percentage);
+                        resultVo.getMessage(), resultVo.getCode() == 200 ? 1 : 2, percentage, keys);
             } catch (Exception e) {
                 log.info("批量上传结算单错误:{}", JSON.toJSONString(e));
+                e.printStackTrace();
                 upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(),
-                        e.getMessage(), ExceptionEnum.INTERNAL_SERVER_ERROR.getCode(), percentage);
+                        e.getMessage(), 3, percentage, keys);
             }
         }
         return ResultVoUtil.success();
@@ -482,15 +491,17 @@ public class SiManageService {
      *
      * @param meg 错误消息
      */
-    public void upldSetlErrorMessage(String patNo, Integer times, Integer ledgerSn, String meg, int code, int percentage) {
+    public void upldSetlErrorMessage(String patNo, Integer times, Integer ledgerSn, String meg, int type, int percentage, List<PureCodeName> keys) {
         JSONObject obj = new JSONObject();
         obj.put("name", "upldSetlListMessage");
         obj.put("message", meg);
         obj.put("patNo", patNo);
+        obj.put("keys", JSONArray.parseArray(JSONArray.toJSONString(keys)));
         obj.put("times", times);
         obj.put("ledgerSn", ledgerSn);
-        obj.put("code", code);
+        obj.put("type", type);
         obj.put("percentage", percentage);
+        obj.put("title", String.format("住院号:【%s】,住院次数:【%d】,账页号:【%d】。", patNo, times, ledgerSn));
         String message = obj.toJSONString();
         WebSocketServer.sendMessageByUserCode(TokenUtil.getTokenUserId(), message);
         log.info("发送错误通知:{}", message);