소스 검색

优化日志

lighter 2 일 전
부모
커밋
7c1aeaff07

+ 1 - 1
src/main/java/thyyxxk/sizyfeeoprnsystm/service/ExecService.java

@@ -99,7 +99,7 @@ public class ExecService {
         return cfg.getHospArea();
     }
 
-    private static String timestamp() {
+    private String timestamp() {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
         return sdf.format(new Date());
     }

+ 4 - 2
src/main/java/thyyxxk/sizyfeeoprnsystm/service/SiZyFeeService.java

@@ -363,7 +363,10 @@ public class SiZyFeeService {
         input.getJSONObject("input").put("feedetail", JSONArray.parse(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_HOSPITALIZATION_FEE_DETAILS);
         int infcode = result.getIntValue(RESULT_CODE);
-        String logMsg = infcode + "," + result.getString("inf_refmsgid");
+        String message = infcode == 0 ?
+                result.getString("inf_refmsgid") :
+                result.getString(ERROR_MESSAGE);
+        String logMsg = infcode + "," + message;
         log.info("【操作员:{}】,医保费用上传:\n患者:{},\n结果:{},\n参数:{}", p.getStaffId(),
                 p.getPsnInfo(), logMsg, input);
         if (infcode == 0) {
@@ -381,7 +384,6 @@ public class SiZyFeeService {
             zyDao.insertSiChargeTempFeeBatch(tempList);
             return new int[]{tempList.size(), fees.size() - tempList.size()};
         } else {
-            String message = result.getString(ERROR_MESSAGE);
             sendUploadResponse(p, message);
             return new int[]{fees.size(), 0};
         }