From 4d15ab766fcfd5449a77e003a4d9cbbc791c21f5 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期五, 06 八月 2021 12:43:21 +0800
Subject: [PATCH] fix 修复操作日志根据状态查询异常问题
---
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java | 56 ++++++++++++++++++++++++++++++--------------------------
1 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
index d1dc739..5343834 100644
--- a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
+++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
@@ -1,32 +1,26 @@
package com.ruoyi.generator.controller;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.io.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import cn.hutool.core.convert.Convert;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
-import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.generator.domain.GenTable;
import com.ruoyi.generator.domain.GenTableColumn;
import com.ruoyi.generator.service.IGenTableColumnService;
import com.ruoyi.generator.service.IGenTableService;
+import org.apache.commons.io.IOUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* 浠g爜鐢熸垚 鎿嶄綔澶勭悊
@@ -50,9 +44,7 @@
@GetMapping("/list")
public TableDataInfo genList(GenTable genTable)
{
- startPage();
- List<GenTable> list = genTableService.selectGenTableList(genTable);
- return getDataTable(list);
+ return genTableService.selectPageGenTableList(genTable);
}
/**
@@ -63,10 +55,12 @@
public AjaxResult getInfo(@PathVariable Long talbleId)
{
GenTable table = genTableService.selectGenTableById(talbleId);
+ List<GenTable> tables = genTableService.selectGenTableAll();
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
Map<String, Object> map = new HashMap<String, Object>();
map.put("info", table);
map.put("rows", list);
+ map.put("tables", tables);
return AjaxResult.success(map);
}
@@ -77,9 +71,7 @@
@GetMapping("/db/list")
public TableDataInfo dataList(GenTable genTable)
{
- startPage();
- List<GenTable> list = genTableService.selectDbTableList(genTable);
- return getDataTable(list);
+ return genTableService.selectPageDbTableList(genTable);
}
/**
@@ -99,7 +91,7 @@
/**
* 瀵煎叆琛ㄧ粨鏋勶紙淇濆瓨锛�
*/
- @PreAuthorize("@ss.hasPermi('tool:gen:list')")
+ @PreAuthorize("@ss.hasPermi('tool:gen:import')")
@Log(title = "浠g爜鐢熸垚", businessType = BusinessType.IMPORT)
@PostMapping("/importTable")
public AjaxResult importTableSave(String tables)
@@ -165,13 +157,25 @@
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
@Log(title = "浠g爜鐢熸垚", businessType = BusinessType.GENCODE)
@GetMapping("/genCode/{tableName}")
- public AjaxResult genCode(HttpServletResponse response, @PathVariable("tableName") String tableName)
+ public AjaxResult genCode(@PathVariable("tableName") String tableName)
{
genTableService.generatorCode(tableName);
return AjaxResult.success();
}
/**
+ * 鍚屾鏁版嵁搴�
+ */
+ @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
+ @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.UPDATE)
+ @GetMapping("/synchDb/{tableName}")
+ public AjaxResult synchDb(@PathVariable("tableName") String tableName)
+ {
+ genTableService.synchDb(tableName);
+ return AjaxResult.success();
+ }
+
+ /**
* 鎵归噺鐢熸垚浠g爜
*/
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
--
Gitblit v1.9.3