Browse Source

Merge remote-tracking branch 'origin/master'

Administrator 1 year ago
parent
commit
736e4f3983

+ 9 - 21
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.web.controller.common;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.File;
 import java.util.ArrayList;
@@ -166,32 +167,19 @@ public class CommonController
     }
 
     /**
-     * 文件生成测试(单个)
+     * 文件删除测试(单个)
      */
     @GetMapping("/filetext")
     public AjaxResult filetext() throws Exception
     {
-        String html = "<html>\n" +
-                "<head>\n" +
-                "<title>Java生成HTML示例</title>\n" +
-                "</head>\n" +
-                "<body>\n" +
-                "Hello, World!\n" +
-                "</body>\n" +
-                "</html>";
-
-        // 将HTML内容写入文件
-        String folderPath = RuoYiConfig.getImportPath();
-        // 创建File对象
-        File folder = new File(folderPath);
-        // 检查文件夹是否存在
-        if (!folder.exists()) {
-            // 不存在则创建文件夹
-            folder.mkdirs();
+        try{
+            String path = "/home/ruoyi/uploadPath/upload/2023/10/16/企业微信截图_16813729836943_20231016152817A004.png";
+            Process process = Runtime.getRuntime().exec("rm -f "+path);
+        }catch (IOException e){
+            e.getMessage();
+            return AjaxResult.error("失败");
         }
-        String path = RuoYiConfig.getImportPath()+"/output.html";
-        HtmlGenerator.writeHtmlToFile(html, path);
-        return AjaxResult.success(path);
+        return AjaxResult.success("成功");
     }
 
 }

+ 11 - 19
ruoyi-admin/src/main/java/com/ruoyi/web/controller/investigate/InvestigateTableController.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.investigate;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -23,14 +24,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * 考察主Controller
- * 
+ *
  * @author ruoyi
  * @date 2023-10-10
  */
 @RestController
 @RequestMapping("/investigate/table")
-public class InvestigateTableController extends BaseController
-{
+public class InvestigateTableController extends BaseController {
     @Autowired
     private IInvestigateTableService investigateTableService;
 
@@ -39,11 +39,9 @@ public class InvestigateTableController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('investigate:table:list')")
     @GetMapping("/list")
-    public TableDataInfo list(InvestigateTable investigateTable)
-    {
+    public TableDataInfo list(InvestigateTable investigateTable) {
         startPage();
-        List<InvestigateTable> list = investigateTableService.selectInvestigateTableList(investigateTable);
-        return getDataTable(list);
+        return investigateTableService.selectInvestigateTableListData(investigateTable);
     }
 
     /**
@@ -51,8 +49,7 @@ public class InvestigateTableController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('investigate:table:listPage')")
     @GetMapping("/listPage")
-    public TableDataInfo listPage(InvestigateTable investigateTable)
-    {
+    public TableDataInfo listPage(InvestigateTable investigateTable) {
         List<InvestigateTable> list = investigateTableService.selectInvestigateTableList(investigateTable);
         return getDataTable(list);
     }
@@ -63,8 +60,7 @@ public class InvestigateTableController extends BaseController
     @PreAuthorize("@ss.hasPermi('investigate:table:export')")
     @Log(title = "考察主", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, InvestigateTable investigateTable)
-    {
+    public void export(HttpServletResponse response, InvestigateTable investigateTable) {
         List<InvestigateTable> list = investigateTableService.selectInvestigateTableList(investigateTable);
         ExcelUtil<InvestigateTable> util = new ExcelUtil<InvestigateTable>(InvestigateTable.class);
         util.exportExcel(response, list, "考察主数据");
@@ -74,8 +70,7 @@ public class InvestigateTableController extends BaseController
      * 获取考察主详细信息
      */
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(investigateTableService.selectInvestigateTableById(id));
     }
 
@@ -85,8 +80,7 @@ public class InvestigateTableController extends BaseController
     @PreAuthorize("@ss.hasPermi('investigate:table:add')")
     @Log(title = "考察主", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody InvestigateTable investigateTable)
-    {
+    public AjaxResult add(@RequestBody InvestigateTable investigateTable) {
         investigateTable.setCreateBy(getUsername());
         return toAjax(investigateTableService.insertInvestigateTable(investigateTable));
     }
@@ -97,8 +91,7 @@ public class InvestigateTableController extends BaseController
     @PreAuthorize("@ss.hasPermi('investigate:table:edit')")
     @Log(title = "考察主", businessType = BusinessType.UPDATE)
     @PostMapping("/put")
-    public AjaxResult edit(@RequestBody InvestigateTable investigateTable)
-    {
+    public AjaxResult edit(@RequestBody InvestigateTable investigateTable) {
         return toAjax(investigateTableService.updateInvestigateTable(investigateTable));
     }
 
@@ -108,8 +101,7 @@ public class InvestigateTableController extends BaseController
     @PreAuthorize("@ss.hasPermi('investigate:table:remove')")
     @Log(title = "考察主", businessType = BusinessType.DELETE)
     @GetMapping("/delete/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(investigateTableService.deleteInvestigateTableByIds(ids));
     }
 

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -20,7 +20,7 @@ spring:
     basename: i18n/messages
   profiles:
     active: druid
-    # active: prod
+    #active: prod
   # 文件上传
   servlet:
     multipart:

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IInvestigateTableService.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.service;
 import java.util.List;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.system.domain.InvestigateTable;
 import com.ruoyi.system.domain.InvestigateUser;
 
@@ -30,6 +31,9 @@ public interface IInvestigateTableService
      */
     public List<InvestigateTable> selectInvestigateTableList(InvestigateTable investigateTable);
 
+    public TableDataInfo selectInvestigateTableListData(InvestigateTable investigateTable);
+
+
     /**
      * 新增考察主
      * 

+ 22 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InvestigateTableServiceImpl.java

@@ -9,8 +9,11 @@ import java.util.UUID;
 import com.alibaba.fastjson2.JSONObject;
 import com.aliyun.dysmsapi20170525.models.SendBatchSmsRequest;
 import com.aliyun.dysmsapi20170525.models.SendBatchSmsResponse;
+import com.github.pagehelper.PageInfo;
 import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.constant.HttpStatus;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SendSmsUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -68,6 +71,25 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
         return investigateTableMapper.selectInvestigateTableList(investigateTable);
     }
 
+    /**
+     * 查询考察主列表
+     *
+     * @param investigateTable 考察主
+     * @return 考察主
+     */
+    @Override
+    public TableDataInfo selectInvestigateTableListData(InvestigateTable investigateTable) {
+        List<InvestigateTable> investigateTables = investigateTableMapper.selectInvestigateTableList(investigateTable);
+        List<InvestigateTable> investigateTables1 = investigateTableMapper.selectInvestigateTableList(investigateTable);
+
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.SUCCESS);
+        rspData.setMsg("查询成功");
+        rspData.setRows(investigateTables);
+        rspData.setTotal(new PageInfo(investigateTables1).getSize());
+        return rspData;
+    }
+
     /**
      * 新增考察主
      *