ソースを参照

优化结算单查询

lighter 3 年 前
コミット
8c97b8ba35

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

@@ -887,10 +887,18 @@ public class SiQueryService {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
         if (null == result.getInteger("code")) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
+            String message = result.getString("message");
+            if (null == message) {
+                message = result.getString(ERROR_MESSAGE);
+            }
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + message);
         }
         if (result.getIntValue("code") != 0) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心出错:" + result.getString("message"));
+            String message = result.getString("message");
+            if (null == message) {
+                message = result.getString(ERROR_MESSAGE);
+            }
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心出错:" + message);
         }
         JSONArray array = result.getJSONArray("data");
         BigDecimal selfPaySum = new BigDecimal(0);
@@ -1215,7 +1223,11 @@ public class SiQueryService {
                 return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到费用明细。");
             }
             for (int i = 0; i < output.size(); i++) {
-                list.add(JSONObject.parseObject(output.getJSONObject(i).toJSONString(), SiSetlFeeDetl.class));
+                SiSetlFeeDetl fee = JSONObject.parseObject(output.getJSONObject(i).toJSONString(), SiSetlFeeDetl.class);
+                if (StringUtil.isBlank(fee.getSetlId())) {
+                    fee.setSetlId(setlId);
+                }
+                list.add(fee);
                 if (list.size() == 30) {
                     dao.insertSetlFeeDetlBatch(list);
                     list.clear();

+ 18 - 0
src/main/java/thyyxxk/webserver/utils/Test.java

@@ -0,0 +1,18 @@
+//package thyyxxk.webserver.utils;
+//
+//import java.text.DateFormat;
+//import java.text.SimpleDateFormat;
+//import java.util.Calendar;
+//import java.util.Date;
+//
+//public class Test {
+//    public static void main(String[] args) throws Exception {
+//        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        Date begntime = df.parse("2021-10-31 23:59:59");
+//        Calendar cal = Calendar.getInstance();
+//        cal.setTime(begntime);
+//        cal.add(Calendar.SECOND, 1);
+//        Date endtime = cal.getTime();
+//        System.out.println(df.format(endtime));
+//    }
+//}