From eb54ef147728526158e8c7be5e05c62215464c56 Mon Sep 17 00:00:00 2001
From: whycrzg <ruanzhigang@whycst.com>
Date: 星期三, 31 三月 2021 10:40:02 +0800
Subject: [PATCH] 更新 项目管理-查询分页-筛选条件,删除文件

---
 src/main/java/com/whyc/controller/ProjectManageController.java |   69 +++++-----------------------------
 1 files changed, 11 insertions(+), 58 deletions(-)

diff --git a/src/main/java/com/whyc/controller/ProjectManageController.java b/src/main/java/com/whyc/controller/ProjectManageController.java
index 3553049..4cebd04 100644
--- a/src/main/java/com/whyc/controller/ProjectManageController.java
+++ b/src/main/java/com/whyc/controller/ProjectManageController.java
@@ -1,5 +1,6 @@
 package com.whyc.controller;
 
+import com.github.pagehelper.PageInfo;
 import com.whyc.config.MyProps;
 import com.whyc.dto.Response;
 import com.whyc.pojo.ProjectArchiveManage;
@@ -40,26 +41,10 @@
     private ProjectArchiveManageService archiveManageService;
 
 
-    @GetMapping("all")
-    @ApiOperation(value = "椤圭洰杩囩▼绠$悊-鏌ヨ鎵�鏈�")
-    public Response<List<ProjectManage>> searchAll() {
-
-        return service.searchAll();
-    }
-
-
-    @GetMapping("byCondition")
-    @ApiOperation(notes = "椤圭洰杩囩▼绠$悊",value = "椤圭洰杩囩▼绠$悊-鏉′欢鏌ヨ")
-    public Response<List<ProjectManage>> searchByCondition(@ApiParam(value = "鐢虫姤鏃ユ湡 鏍煎紡 2021/01/28",required = true) @RequestParam Date proCreatedate,
-                                                           @ApiParam(value = "椤圭洰绫诲瀷",required = true)@RequestParam String proSort,
-                                                           @ApiParam(value = "椤圭洰鐘舵��",required = true)@RequestParam int proState,
-                                                           @ApiParam(value = "椤圭洰缂栧彿",required = true)@RequestParam String proNum) {
-        ProjectManage projectManage = new ProjectManage();
-        projectManage.setProCreatedate(proCreatedate);
-        projectManage.setProSort(proSort);
-        projectManage.setProState(proState);
-        projectManage.setProNum(proNum);
-        return service.searchByCondition(projectManage);
+    @PostMapping("progressByCondition")
+    @ApiOperation(notes = "椤圭洰杩囩▼绠$悊", value = "椤圭洰杩囩▼绠$悊-鏌ヨ鍒嗛〉-鏍规嵁绛涢�夋潯浠�")
+    public Response<PageInfo<ProjectManage>> searchByCondition(@RequestParam int pageNum, @RequestParam int pageSize, @RequestBody ProjectManage projectManage) {
+        return service.searchByCondition(pageNum, pageSize, projectManage);
     }
 
     @PostMapping("add")
@@ -220,30 +205,6 @@
         return result.setMsg(0,"鏂囦欢涓嶅瓨鍦�");
     }
 
-    @DeleteMapping("/delDoc")
-    @ApiOperation(notes = "", value = "鏂囨。鏉愭枡鍒犻櫎")
-    public Response delDocment(@RequestParam String filePath) {
-        Response<Object> response = new Response<>();
-        File file = new File(filePath);
-        try {
-            if (file.exists()) {
-                File absoluteFile = file.getAbsoluteFile();
-                String name = absoluteFile.getName();
-                file.delete();
-                HashMap<Object, Object> map = new HashMap<>();
-                map.put("鍒犻櫎鐨勬枃浠跺悕", name);
-                map.put("鍒犻櫎鐨勬枃浠惰矾寰�", filePath);
-                response.setData(map);
-                response.setMsg(1, "鍒犻櫎鎴愬姛");
-            } else {
-                response.setMsg(0, "鏂囦欢涓嶅瓨鍦�");
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            return response.setMsg(0, "鍒犻櫎澶辫触");
-        }
-        return response;
-    }
 
 
     @GetMapping("managesState")
@@ -287,8 +248,8 @@
 
     }
 
-    @Delete("delDoc")
-    @ApiOperation(notes = "椤圭洰杩囩▼绠$悊-椤圭洰绠$悊-宸辩‘璁ら樁娈�",value = "鏂囨。鏉愭枡鍒犻櫎")
+    @DeleteMapping("delDoc")
+    @ApiOperation(notes = "椤圭洰杩囩▼绠$悊-椤圭洰绠$悊",value = "鏂囨。鏉愭枡鍒犻櫎")
     public  Response delDocumentation(@ApiParam(value = "椤圭洰缂栧彿", required = true) @RequestParam String proNum,
                                       @ApiParam(value = "椤圭洰鍚嶇О浠g爜", required = true) @RequestParam String proNameCode,
                                       @ApiParam(value = "鏂囨。璺緞", required = true) @RequestParam String proFilePath){
@@ -305,20 +266,12 @@
 
         return archiveManageService.searchArchiveAll();
     }
-    @GetMapping("archiveByCondition")
-    @ApiOperation(value = "椤圭洰褰掓。绠$悊-鏉′欢鏌ヨ")
-    public Response searchArchiveByCondition(@ApiParam(value = "寮�濮嬫棩鏈� 鏍煎紡 2021/03/27",required = true) @RequestParam Date proExecutionDate,
-                                             @ApiParam(value = "褰掓。鏃ユ湡 鏍煎紡 2021/03/27",required = true)@RequestParam Date proArchiveDate,
-                                             @ApiParam(value = "椤圭洰绫诲瀷",required = true)@RequestParam String proSort,
-                                             @ApiParam(value = "椤圭洰缂栧彿",required = true)@RequestParam String proNum) {
 
-        ProjectManage pm = new ProjectManage();
-        pm.setProExecutionDate(proExecutionDate);
-        pm.setProArchiveDate(proArchiveDate);
-        pm.setProSort(proSort);
-        pm.setProNum(proNum);
+    @PostMapping("archiveByCondition")
+    @ApiOperation(value = "椤圭洰褰掓。绠$悊-鏌ヨ鍒嗛〉-鏍规嵁绛涢�夋潯浠�")
+    public Response<PageInfo<ProjectManage>> searchArchiveByCondition(@RequestParam int pageNum, @RequestParam int pageSize, @RequestBody ProjectManage projectManage) {
 
-        return archiveManageService.searchArchiveByCondition(pm);
+        return archiveManageService.searchArchiveByCondition(pageNum,pageSize,projectManage);
     }
 
     @GetMapping("archiveProjectInfo")

--
Gitblit v1.9.1