Sfoglia il codice sorgente

导出 excel 表。

xiaochan 3 anni fa
parent
commit
1e04b25f8b

+ 16 - 4
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -300,7 +300,7 @@ public class SetlListUpldService {
     public void upldSetlErrorMessage(String patNo, Integer times, Integer ledgerSn, String meg,
                                      int type, int percentage, String outDeptName, String psnName, String referPhysicianName) {
         JSONObject obj = new JSONObject();
-        obj.put("name", "upldSetlListMessage");
+        obj.put("name", "jdtMessage");
         obj.put("psnName#患者姓名|1", psnName);
         obj.put("patNo#住院号|2", patNo);
         obj.put("times#住院次数|3", times);
@@ -381,6 +381,7 @@ public class SetlListUpldService {
      * @return 返回数据
      */
     public ResultVo<IPage<SiSetlinfoTemp>> huoQuJieSuanRenYuan(JieSuanDanChaXun param) {
+//        log.info("查询结算单信息:{}", JSON.toJSONStringWithDateFormat(param, DateUtil.DEFAULT_PATTERN));
         IPage<SiSetlinfoTemp> page = new Page<>();
         page.setRecords(dao.huoQuJieSuanRenYuan(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
                 param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getDecTypes(),
@@ -472,10 +473,21 @@ public class SetlListUpldService {
      * @param param    参数
      */
     public void exportExcel(HttpServletResponse response, JieSuanDanChaXun param) {
-        param.setPageSize(param.getTotal());
-        param.setCurrentPage(1);
+        param.setPageSize(100);
+        int currentPage = (int) Math.ceil(param.getTotal() / (double) 100);
+        List<SiSetlinfoTemp> list = new ArrayList<>();
+        JSONObject obj = new JSONObject();
+        obj.put("name", "jdtMessage");
+        obj.put("jdtType", "pureProgress");
+        obj.put("jdtTitle", "导出Excel");
+        obj.put("total", param.getTotal());
+        for (int i = 0; i < currentPage; i++) {
+            param.setCurrentPage(i + 1);
+            list.addAll(huoQuJieSuanRenYuan(param).getData().getRecords());
+            obj.put("size", list.size());
+            WebSocketServer.sendMessageByUserCode(TokenUtil.getTokenUserId(), obj.toString());
+        }
         log.info("医保结算单: {}", JSON.toJSONStringWithDateFormat(param, GetDateFormat.DATE));
-        List<SiSetlinfoTemp> list = huoQuJieSuanRenYuan(param).getData().getRecords();
         String[] title = {"姓名", "审核状态", "申报类型", "出院科室", "住院号/门诊号", "性别", "住院天数", "诊断编码", "诊断名称", "治疗方式", "总费用",
                 "报销金额", "险种类型", "人员类别", "结算时间", "医疗类别", "清算机构", "管床医生", "转科室", "转科次数"};
         String[][] content = new String[list.size()][];