浏览代码

日志分析优化。

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

+ 1 - 1
src/main/java/thyyxxk/webserver/constants/sidicts/SiFunction.java

@@ -237,7 +237,7 @@ public enum SiFunction {
     /**
      * 通过此交易进出院撤销(出院撤销)
      */
-    REVOKE_DISCHARGE("2405", ""),
+    REVOKE_DISCHARGE("2405", "撤销出院办理"),
 
     /* =========================================== 人员备案 ========================================== */
     /**

+ 17 - 2
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiLogDao.java

@@ -15,13 +15,13 @@ public interface SiLogDao extends BaseMapper<SiLog> {
             "select msgid,infno,insuplc_admdvs,opter, " +
             "create_datetime,pat_no,times,infcode from t_si_log " +
             "where log_type=#{ftclg.logType} " +
-            "<if test=\"ftclg.infno!=null\">" +
+            "<if test=\"ftclg.infno!=null and ftclg.infno!=''\">" +
             "and infno=#{ftclg.infno} " +
             "</if>" +
             "<if test=\"ftclg.begntime!=null and ftclg.endtime!=null\">" +
             "and create_datetime&gt;=#{ftclg.begntime} and create_datetime&lt;=#{ftclg.endtime} " +
             "</if>" +
-            "<if test=\"ftclg.patNo!=null\">" +
+            "<if test=\"ftclg.patNo!=null and ftclg.patNo!=''\">" +
             "and pat_no=#{ftclg.patNo} " +
             "</if>" +
             "</script>")
@@ -30,4 +30,19 @@ public interface SiLogDao extends BaseMapper<SiLog> {
 
     @Select("select rtrim(name) from a_employee_mi where code=#{code}")
     String selectUserName(@Param("code") String code);
+
+    @Select("<script>" +
+            "select count(1) from t_si_log " +
+            "where log_type=#{ftclg.logType} and infcode=0 " +
+            "<if test=\"ftclg.infno!=null and ftclg.infno!=''\">" +
+            "and infno=#{ftclg.infno} " +
+            "</if>" +
+            "<if test=\"ftclg.begntime!=null and ftclg.endtime!=null\">" +
+            "and create_datetime&gt;=#{ftclg.begntime} and create_datetime&lt;=#{ftclg.endtime} " +
+            "</if>" +
+            "<if test=\"ftclg.patNo!=null and ftclg.patNo!=''\">" +
+            "and pat_no=#{ftclg.patNo} " +
+            "</if>" +
+            "</script>")
+    Integer selectSuccessSiLogCount(@Param("ftclg") FetchLog ftclg);
 }

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/log/FetchLog.java

@@ -11,6 +11,7 @@ public class FetchLog {
     private Date begntime;
     private Date endtime;
     private String patNo;
+    private Boolean needCalTips;
     private Integer currentPage;
     private Integer pageSize;
 }

+ 12 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiLogService.java

@@ -12,6 +12,7 @@ import thyyxxk.webserver.entity.medicalinsurance.log.FetchLog;
 import thyyxxk.webserver.entity.medicalinsurance.log.SiLog;
 import thyyxxk.webserver.utils.ResultVoUtil;
 
+import java.text.NumberFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -48,10 +49,21 @@ public class SiLogService {
             }
         }
         map.put("list", list);
+        if (null != ftchlg.getNeedCalTips() && ftchlg.getNeedCalTips()) {
+            Integer successCount = dao.selectSuccessSiLogCount(ftchlg);
+            if (null == successCount) {
+                successCount = 0;
+            }
+            NumberFormat numberFormat = NumberFormat.getInstance();
+            numberFormat.setMaximumFractionDigits(2);
+            String percentage = numberFormat.format((float) successCount / (float) iPage.getTotal() * 100) + "%";
+            map.put("tipMessage", "条件范围内接口调用共 " + iPage.getTotal() + " 次,成功 " + successCount + " 次,成功率:" + percentage);
+        }
         return ResultVoUtil.success(map);
     }
 
     public ResultVo<SiLog> selectSiLogBody(String msgid) {
         return ResultVoUtil.success(dao.selectById(msgid));
     }
+
 }