Explorar o código

报表导入提示表不存在,报表管理员角色标识更换

shiqian %!s(int64=3) %!d(string=hai) anos
pai
achega
410aa8a9b9

+ 1 - 1
boman-gateway/src/main/java/com/boman/gateway/filter/AuthFilter.java

@@ -45,7 +45,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
     private final static String URL_JMREPORT = "/jmreport/";
     private final static String URL_REPORT = "/report/";
     /*** 角色表中 role_key ****/
-    private final static String REPORT_ROLE_KEY = "report_manager";
+    private final static String REPORT_ROLE_KEY = "user-admin";
     private final static String ADMIN_PERMISSIONS = "*:*:*";
 
     // 排除过滤的 uri 地址,nacos自行添加

+ 4 - 0
boman-report/src/main/java/com/boman/report/service/impl/ImportServiceImpl.java

@@ -59,6 +59,10 @@ public class ImportServiceImpl implements IImportServcie {
         Objects.requireNonNull(fileDto, "未上传文件!");
         ObjectUtils.requireNonNull(tableName, "表名为空!");
         GenTable genTable = redisService.getCacheObject(RedisKey.TABLE_INFO + tableName);
+        if (ObjectUtils.isEmpty(genTable)) {
+            return AjaxResult.error(String.format("[%s] 不存在,当前未建表或者未刷新缓存", tableName));
+        }
+
         Map<String, GenTableColumn> columnMap = this.genImportColumn(genTable.getColumns());
         List<GenTableColumn> columns = genColumData(tableName, columnMap);
         this.genBaseData(columns,  columnMap);

+ 2 - 2
boman-report/src/main/resources/mapper/StatisticReportMapper.xml

@@ -158,8 +158,8 @@
     </update>
 
     <select id="selectReportInfo" resultMap="ReportDtoResult" parameterType="java.util.Map">
-        select id, name from  jimu_report where
-             create_by = #{userName}
+        select id, name from  jimu_report
+        where create_by = #{userName} and del_flag = 0
             <if test="name != null and name != ''">
                 AND lower(name) like lower(concat('%', #{name}, '%'))
             </if>

+ 5 - 5
boman-report/src/main/resources/static/jmreport/desreport_/corelib/jmsheet.js

@@ -72543,7 +72543,7 @@
         }
     }
 
-    var _d = ["exportExcel_all", "exportText_pdf", "exportExcel_pdf", "export_img", "exportExcel_empty"], Sd = function () {
+    var _d = ["exportExcel_all", "exportText_pdf", "exportExcel_pdf", "export_img"/*, "exportExcel_empty"*/], Sd = function () {
         function e(t) {
             var n = this;
             !function (e, t) {
@@ -74614,7 +74614,7 @@
         else if ("exportExcel_pdf" === e) this.onSettingEvent("pdf");
         else if ("export_img" === e) this.onSettingEvent("export_img");
         else if ("exportText_pdf" === e) this.onSettingEvent("iText_pdf");
-        else if ("exportExcel_empty" === e) this.onExportExcelEmpty(i.settings);
+        //else if ("exportExcel_empty" === e) this.onExportExcelEmpty(i.settings);
         else if ("exportExcel_all" === e) this.onExportExcelAll(i.settings);
         else if ("print_screen" === e) this.verticalScrollbar.move({top: 0}),
             setTimeout((function () {
@@ -74868,7 +74868,7 @@
             }, this.onUploadExcel = function (e) {
             }, this.onExportExcelPage = function () {
             }, this.onExportExcelAll = function () {
-            }, this.onExportExcelEmpty = function () {
+           // }, this.onExportExcelEmpty = function () {
             }, this.dbClickChart = function () {
             }, this.selectedChartId = "";
             var d = this.data.settings.background;
@@ -75390,11 +75390,11 @@
             key: "onExportExcelAll", value: function (e) {
                 return this.sheet.onExportExcelAll = e, this
             }
-        },{
+        }/*,{
             key: "onExportExcelEmpty", value: function (e) {
                 return this.sheet.onExportExcelEmpty = e, this
             }
-        }, {
+        }*/, {
             key: "onSelectChart", value: function (e) {
                 return this.sheet.onSelectChart = e, this
             }

+ 30 - 30
boman-report/src/main/resources/static/jmreport/desreport_/js/biz/view.js

@@ -619,36 +619,36 @@ let xs = null;
                                          })
                                      })
                                  })
-                                 .onExportExcelEmpty(function(){
-                                     //导出全部excel
-                                     //window.open(baseFull+`/jmreport/exportAllExcel/${excelConfigId}?token=${token}`);
-                                     xs.getLayerBase64().then(values=>{
-                                         base64Arry = values;
-                                         var dataStr = '';
-                                         let queryParam  = rpViewInst.getRpQueryParam();
-                                         let pageInfo = xs.getPageInfo();
-                                         queryParam.pageNo = pageInfo.pageNo
-                                         queryParam.pageSize = pageInfo.pageSize
-                                         if (base64Arry != null && base64Arry.length > 0){
-                                             dataStr = JSON.stringify({excelConfigId:excelConfigId,base64Arry:base64Arry,queryParam: queryParam});
-                                         }else {
-                                             dataStr = JSON.stringify({excelConfigId:excelConfigId, queryParam:queryParam});
-                                         }
-                                         Vue.prototype.$Spin.show();
-                                         $http.post({
-                                             contentType:'json',
-                                             url:api.exportEmptyExcel,
-                                             data : dataStr,
-                                             success:(result)=>{
-                                                 ajaxFileDownload(result.file, result.name);
-                                             },
-                                             error:(e)=>{
-                                                 Vue.prototype.$Spin.hide();
-                                                 xs.tip(e.error);
-                                             }
-                                         })
-                                     })
-                                 })
+                                 // .onExportExcelEmpty(function(){
+                                 //     //导出全部excel
+                                 //     //window.open(baseFull+`/jmreport/exportAllExcel/${excelConfigId}?token=${token}`);
+                                 //     xs.getLayerBase64().then(values=>{
+                                 //         base64Arry = values;
+                                 //         var dataStr = '';
+                                 //         let queryParam  = rpViewInst.getRpQueryParam();
+                                 //         let pageInfo = xs.getPageInfo();
+                                 //         queryParam.pageNo = pageInfo.pageNo
+                                 //         queryParam.pageSize = pageInfo.pageSize
+                                 //         if (base64Arry != null && base64Arry.length > 0){
+                                 //             dataStr = JSON.stringify({excelConfigId:excelConfigId,base64Arry:base64Arry,queryParam: queryParam});
+                                 //         }else {
+                                 //             dataStr = JSON.stringify({excelConfigId:excelConfigId, queryParam:queryParam});
+                                 //         }
+                                 //         Vue.prototype.$Spin.show();
+                                 //         $http.post({
+                                 //             contentType:'json',
+                                 //             url:api.exportEmptyExcel,
+                                 //             data : dataStr,
+                                 //             success:(result)=>{
+                                 //                 ajaxFileDownload(result.file, result.name);
+                                 //             },
+                                 //             error:(e)=>{
+                                 //                 Vue.prototype.$Spin.hide();
+                                 //                 xs.tip(e.error);
+                                 //             }
+                                 //         })
+                                 //     })
+                                 // })
                              if(expData && "{}"!=JSON.stringify(expData)){
                                  xs.setExpData(expData);
                              }

+ 1 - 1
boman-report/src/main/resources/static/jmreport/desreport_/js/core/api.js

@@ -64,7 +64,7 @@ const api = {
     exportAllExcel: getOrigin('/exportAllExcel'),
     // 导出excel模板
     // exportEmptyExcel: getOrigin('/exportEmptyExcel'),
-    exportEmptyExcel: getOrigin('/exportAllExcel'),
+    // exportEmptyExcel: getOrigin('/exportAllExcel'),
     //导出全部Pdf
     exportPdf: getOrigin('/exportPdf'),
     //预览次数