Ver Fonte

Revert "20230313_sun两个大量的导出从前端导"

This reverts commit 8ce4ab13b6444a6b00f5d6015f47c1538bbbe06e.
15143018065 há 2 anos atrás
pai
commit
38c398bede

+ 8 - 7
ruoyi-modules/mz-business/src/main/java/com/ruoyi/business/controller/YljgKhJbxxController.java

@@ -117,20 +117,21 @@ public class YljgKhJbxxController extends BaseController
     @RequiresPermissions(value = {"business:rzjg:export", "search:rzjg:export"}, logical = Logical.OR)
     @Log(title = "养老机构_客户_基本信息", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public AjaxResult export(YljgKhJbxx yljgKhJbxx)
+    public void export(HttpServletResponse response, YljgKhJbxx yljgKhJbxx)
     {
-        return AjaxResult.success(yljgKhJbxxService.selectBusinessYljgKhJbxxList(yljgKhJbxx));
-//        List<YljgKhJbxx> list = yljgKhJbxxService.selectBusinessYljgKhJbxxList(yljgKhJbxx);
-//        ExcelUtil<YljgKhJbxx> util = new ExcelUtil<YljgKhJbxx>(YljgKhJbxx.class);
-//        util.exportExcel(response, list, "养老机构_客户_基本信息数据");
+        List<YljgKhJbxx> list = yljgKhJbxxService.selectBusinessYljgKhJbxxList(yljgKhJbxx);
+        ExcelUtil<YljgKhJbxx> util = new ExcelUtil<YljgKhJbxx>(YljgKhJbxx.class);
+        util.exportExcel(response, list, "养老机构_客户_基本信息数据");
     }
 
     @RequiresPermissions(value = {"business:rzjg:export", "search:rzjg:export"}, logical = Logical.OR)
     @Log(title = "养老机构_客户_基本信息", businessType = BusinessType.EXPORT)
     @PostMapping("/sq/export")
-    public AjaxResult sqExport(YljgKhJbxx yljgKhJbxx)
+    public void sqExport(HttpServletResponse response, YljgKhJbxx yljgKhJbxx)
     {
-        return AjaxResult.success(yljgKhJbxxService.selectBusinessYljgKhJbxxSqList(yljgKhJbxx));
+        List<YljgKhJbxx> list = yljgKhJbxxService.selectBusinessYljgKhJbxxSqList(yljgKhJbxx);
+        ExcelUtil<YljgKhJbxx> util = new ExcelUtil<YljgKhJbxx>(YljgKhJbxx.class);
+        util.exportExcel(response, list, "养老机构_客户_基本信息数据");
     }
 
     /**

+ 15 - 10
ruoyi-modules/mz-organization-khgl/src/main/java/com/ruoyi/organization/service/impl/YljgKhJbxxServiceImpl.java

@@ -12,7 +12,6 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.PageDomain;
 import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.security.utils.SecurityUtils;
-import com.ruoyi.common.security.utils.SysDeptJlUtils;
 import com.ruoyi.organization.domain.*;
 import com.ruoyi.organization.mapper.YljgKhHtxxMapper;
 import com.ruoyi.organization.mapper.YljgKhJbxxMapper;
@@ -24,7 +23,8 @@ import com.ruoyi.system.api.enums.DataStatus;
 import com.ruoyi.system.api.enums.ResultStatus;
 import com.ruoyi.system.api.enums.WhetherStatus;
 import com.ruoyi.system.domain.SysDeptJl;
-import com.ruoyi.system.mapper.SysDeptJlMapper;
+;import com.ruoyi.system.mapper.SysDeptJlMapper;
+import com.ruoyi.common.security.utils.SysDeptJlUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,8 +39,6 @@ import java.util.stream.Collectors;
 
 import static com.ruoyi.common.core.utils.DateUtils.YYYYMMDD;
 
-;
-
 /**
  * 养老机构_客户_基本信息Service业务层处理
  *
@@ -280,11 +278,11 @@ public class YljgKhJbxxServiceImpl implements IYljgKhJbxxService
     {
         List<YljgKhJbxx> res = yljgKhJbxxMapper.selectBusinessYljgKhJbxxList(yljgKhJbxx);
         res.forEach(r -> {
-//            try {
-//                r.setAge(DateUtils.getCurrentAge(DateUtils.dateTime(YYYYMMDD, r.getCsrq())) + "岁");
-//            } catch (Exception e) {
-//                r.setAge("0岁");
-//            }
+            try {
+                r.setAge(DateUtils.getCurrentAge(DateUtils.dateTime(YYYYMMDD, r.getCsrq())) + "岁");
+            } catch (Exception e) {
+                r.setAge("0岁");
+            }
             r.setXjdxzqy(SysDeptJlUtils.getDeptCache(r.getXzqhId()));
         });
         return res;
@@ -372,7 +370,14 @@ public class YljgKhJbxxServiceImpl implements IYljgKhJbxxService
     public List<YljgKhJbxx> selectBusinessYljgKhJbxxSqList(YljgKhJbxx yljgKhJbxx)
     {
         List<YljgKhJbxx> res = yljgKhJbxxMapper.selectBusinessYljgKhJbxxSqList(yljgKhJbxx);
-        res.forEach(r -> r.setXjdxzqy(SysDeptJlUtils.getDeptCache(r.getXzqhId())));
+        res.forEach(r -> {
+            try {
+                r.setAge(DateUtils.getCurrentAge(DateUtils.dateTime(YYYYMMDD, r.getCsrq())) + "岁");
+            } catch (Exception e) {
+                r.setAge("0岁");
+            }
+            r.setXjdxzqy(SysDeptJlUtils.getDeptCache(r.getXzqhId()));
+        });
         return res;
     }
 

+ 0 - 16
ruoyi-ui/src/api/search/xxcx/lrxx/rzjg.js

@@ -63,19 +63,3 @@ export function advancedListKhxxByJg(query) {
     params: query
   })
 }
-
-export function exportSqExcel(query) {
-  return request({
-    url: '/business/lrxxcx/sq/export',
-    method: 'post',
-    params: query
-  })
-}
-
-export function exportExcel(query) {
-  return request({
-    url: '/business/lrxxcx/export',
-    method: 'post',
-    params: query
-  })
-}

+ 13 - 58
ruoyi-ui/src/views/search/xxcx/lrxx/rzjg/index.vue

@@ -57,7 +57,7 @@
 
         <el-row :gutter="10" class="mb8">
           <el-col :span="1.5">
-            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="exportExcel"
+            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
               v-hasPermi="['business:rzjg:export']">导出
             </el-button>
           </el-col>
@@ -557,11 +557,10 @@
 </template>
 
 <script>
-import { getKhxxByJg, listChxxx, listJtxx, listKhxxByJg, advancedListKhxxByJg, exportExcel } from '@/api/search/xxcx/lrxx/rzjg'
+import { getKhxxByJg, listChxxx, listJtxx, listKhxxByJg, advancedListKhxxByJg } from '@/api/search/xxcx/lrxx/rzjg'
 import Treeselect from '@riophae/vue-treeselect'
 import { mapState } from 'vuex'
 import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
-import { Loading } from 'element-ui';
 
 export default {
   name: 'Khjbxx',
@@ -585,8 +584,7 @@ export default {
     'CH029',
     'CH047',
     'CZ028',
-    'XZ114',
-    "C0034",
+    'XZ114'
   ],
   data() {
     return {
@@ -607,7 +605,6 @@ export default {
       // 显示高级查询
       showDrawer: false,
       editJtxxAndChxxx: true,
-      downloadLoadingInstance: null,
       // 总条数
       total: 0,
       jtxxTotal: 0,
@@ -697,24 +694,6 @@ export default {
         pageSize:10,
         createuserType:'01',
       },
-      // 导出数据
-	    excelData:{
-				keys:[
-					{ label: '姓名', prop: 'xm', width: '' },
-					{ label: '性别', prop: 'xb', width: '' },
-					{ label: '身份证件类型', prop: 'zjlx', width: '' },
-					{ label: '公民身份证号码', prop: 'zjhm', width: '' },
-					{ label: '民族', prop: 'mz', width: '' },
-					{ label: '国籍', prop: 'gj', width: '' },
-					{ label: '户籍类别', prop: 'hjlb', width: '' },
-					{ label: '婚姻状况', prop: 'hyzk', width: '' },
-          { label: '居住地行政区划', prop: 'xjdxzqy', width: '' },
-          { label: '居住地址', prop: 'xjd', width: '' },
-          { label: '身体能力评估等级', prop: 'nlpg', width: '' },
-          { label: '人员状态', prop: 'ryzt', width: '' },
-				],
-		    vales:[]
-	    },
       // 表单参数
       form: {},
       familyForm: {},
@@ -970,42 +949,18 @@ export default {
     rowYljgKhChxxxIndex({ row, rowIndex }) {
       row.index = rowIndex + 1
     },
-    // /** 导出按钮操作 */
-    // handleExport() {
-    //   this.download(
-    //     'business/lrxxcx/export',
-    //     {
-    //       ...this.queryParams
-    //     },
-    //     `入住养老机构老年人信息.xlsx`
-    //   )
-    // },
-    exportExcel() {
-      this.downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
-      exportExcel(this.queryParams).then((res) => {
-        res.data.map((item) => {
-          if (item) {
-            item = decryptData_ECB(item, ["xm", "zjhm", "xjd"], [1, 2, 4]);
-            item.xb = this.translateDict("C0007", item.xb)
-            item.zjlx = this.translateDict("C0015", item.zjlx)
-            item.mz = this.translateDict("C0009", item.mz)
-            item.gj = this.translateDict("XZ002", item.gj)
-            item.hjlb = this.translateDict("C0031", item.hjlb)
-            item.hyzk = this.translateDict("C0010", item.hyzk)
-            item.nlpg = this.translateDict("CZ036", item.nlpg)
-            item.ryzt = this.translateDict("C0034", item.ryzt)
-          }
-        });
-        console.log(res.data)
-        this.excelData.vales = res.data;
-        this.handleExport(this.excelData,'入住养老机构老年人')
-        this.downloadLoadingInstance.close();
-      }).catch((r) => {
-        this.$modal.msgError(r);
-        this.downloadLoadingInstance.close();
-      });
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        'business/lrxxcx/export',
+        {
+          ...this.queryParams
+        },
+        `入住养老机构老年人信息.xlsx`
+      )
     },
     /**  */
+
     particulars(row) {
       this.dataDetails = {}
       getKhxxByJg(row.id).then((response) => {

+ 10 - 46
ruoyi-ui/src/views/search/xxcx/lrxx/sqfw/index.vue

@@ -45,7 +45,7 @@
 
         <el-row :gutter="10" class="mb8">
           <el-col :span="1.5">
-            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="exportExcel"
+            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
               v-hasPermi="['business:rzjg:export']">导出
             </el-button>
           </el-col>
@@ -539,9 +539,8 @@
 </template>
 
 <script>
-import { getKhxxByJg, listChxxx, listJtxx, listKhxxByJg, listKhxxBySqJg, advancedListKhxxBySqJg, exportSqExcel } from '@/api/search/xxcx/lrxx/rzjg'
+import { getKhxxByJg, listChxxx, listJtxx, listKhxxByJg, listKhxxBySqJg, advancedListKhxxBySqJg } from '@/api/search/xxcx/lrxx/rzjg'
 import Treeselect from "@riophae/vue-treeselect";
-import { Loading } from 'element-ui';
 import { mapGetters, mapState } from "vuex";
 import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
 
@@ -567,7 +566,6 @@ export default {
     "CH029",
     "CH047",
     "CZ028",
-    "C0034",
   ],
   data() {
     return {
@@ -582,7 +580,6 @@ export default {
       single: true,
       // 非多个禁用
       multiple: true,
-      downloadLoadingInstance: null,
       expands: [],
       // 显示搜索条件
       showSearch: true,
@@ -673,24 +670,6 @@ export default {
         children: "children",
         label: "name"
       },
-      // 导出数据
-	    excelData:{
-				keys:[
-					{ label: '姓名', prop: 'xm', width: '' },
-					{ label: '性别', prop: 'xb', width: '' },
-					{ label: '身份证件类型', prop: 'zjlx', width: '' },
-					{ label: '公民身份证号码', prop: 'zjhm', width: '' },
-					{ label: '民族', prop: 'mz', width: '' },
-					{ label: '国籍', prop: 'gj', width: '' },
-					{ label: '户籍类别', prop: 'hjlb', width: '' },
-					{ label: '婚姻状况', prop: 'hyzk', width: '' },
-          { label: '居住地行政区划', prop: 'xjdxzqy', width: '' },
-          { label: '居住地址', prop: 'xjd', width: '' },
-          { label: '身体能力评估等级', prop: 'nlpg', width: '' },
-          { label: '人员状态', prop: 'ryzt', width: '' },
-				],
-		    vales:[]
-	    },
       // 表单参数
       form: {},
       familyForm: {},
@@ -937,29 +916,14 @@ export default {
       row.index = rowIndex + 1;
     },
     /** 导出按钮操作 */
-    exportExcel() {
-      this.downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
-      exportSqExcel(this.queryParams).then((res) => {
-        res.data.map((item) => {
-          if (item) {
-            item = decryptData_ECB(item, ["xm", "zjhm", "xjd"], [1, 2, 4]);
-            item.xb = this.translateDict("C0007", item.xb)
-            item.zjlx = this.translateDict("C0015", item.zjlx)
-            item.mz = this.translateDict("C0009", item.mz)
-            item.gj = this.translateDict("XZ002", item.gj)
-            item.hjlb = this.translateDict("C0031", item.hjlb)
-            item.hyzk = this.translateDict("C0010", item.hyzk)
-            item.nlpg = this.translateDict("CZ036", item.nlpg)
-            item.ryzt = this.translateDict("C0034", item.ryzt)
-          }
-        });
-        this.excelData.vales = res.data;
-        this.handleExport(this.excelData,'享受社区服务老年人')
-        this.downloadLoadingInstance.close();
-      }).catch((r) => {
-        this.$modal.msgError(r);
-        this.downloadLoadingInstance.close();
-      });
+    handleExport() {
+      this.download(
+        "business/lrxxcx/sq/export",
+        {
+          ...this.queryParams,
+        },
+        `享受社区服务老年人信息.xlsx`
+      );
     },
     /**  */