From 0552181155581ecd56242d8e4d3f90d420873a3f Mon Sep 17 00:00:00 2001
From: 354798ggg <1074825718@qq.com>
Date: 星期二, 17 十月 2023 16:46:51 +0800
Subject: [PATCH] 20231017优化——项目信息权限,出库权限

---
 product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java |  263 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 232 insertions(+), 31 deletions(-)

diff --git a/product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java b/product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java
index c09202d..9ddf56c 100644
--- a/product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java
+++ b/product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java
@@ -10,31 +10,62 @@
 import com.product.project.management.config.Cmnconst;
 import com.product.project.management.config.SystemCode;
 import com.product.project.management.service.ProjectInfoService;
+import com.product.core.config.CoreConst;
 import com.product.core.controller.support.AbstractBaseController;
 import com.product.core.entity.FieldSetEntity;
 import com.product.core.exception.BaseException;
 import com.product.module.sys.version.ApiVersion;
 import com.product.util.BaseUtil;
+import com.product.util.ResultInfo;
 
 @RequestMapping("/api/qxlw-project")
 @RestController("qxlw-project-controller")
-public class ProjectInfoController extends AbstractBaseController{
+public class ProjectInfoController extends AbstractBaseController {
 
-	@Autowired
-	ProjectInfoService projectInfoService;
-	
-	 /**
-     * 鏍规嵁uuid鑾峰彇椤圭洰璇︽儏
+    @Autowired
+    ProjectInfoService projectInfoService;
+    
+    /**
+     * 	鑾峰彇椤圭洰鍒楄〃锛堟牴鎹垱寤轰汉锛�
+     *
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/list-project-by-created/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String listProjectByCreated(HttpServletRequest request) {
+        try {
+            // 鑾峰彇鍙傛暟
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+
+            //鍒ゆ柇鍒嗛〉鍙傛暟鏄惁涓虹┖
+            if (BaseUtil.strIsNull(fse.getString(CoreConst.CPAGE)) || BaseUtil.strIsNull(fse.getString(CoreConst.PAGESIZE))) {
+                return this.error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText());
+            }
+            return OK_List(projectInfoService.listProjectByCreated(fse.getInteger(Cmnconst.CPAGE), fse.getInteger(Cmnconst.PAGESIZE)));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
+        }
+    }
+
+    /**
+     * 鑾峰彇妯℃澘椤圭洰鍒嗛」
+     *
      * @param request
      * @return
      */
     @RequestMapping(value = "/get-projectTypeItem/{version}", method = RequestMethod.POST)
     @ApiVersion(1)
-    public String getProjectTypeItem(HttpServletRequest request){
+    public String getProjectTypeItem(HttpServletRequest request) {
         try {
             // 鑾峰彇鍙傛暟
             FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
-            
+
             // 鍒ゆ柇uuid鏄惁涓虹┖
             if (BaseUtil.strIsNull(fse.getString(Cmnconst.PROJECTTYPE))) {
                 return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
@@ -45,23 +76,24 @@
             return this.error(e);
         } catch (Exception e) {
             e.printStackTrace();
-            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
-                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
         }
     }
-    
+
     /**
-     * 鏍规嵁uuid鑾峰彇椤圭洰璇︽儏
+     * 鑾峰彇椤圭洰淇℃伅锛堥」鐩垎椤瑰涓爲锛�
+     *
      * @param request
      * @return
      */
     @RequestMapping(value = "/get-projectItem/{version}", method = RequestMethod.POST)
     @ApiVersion(1)
-    public String getProjectItem(HttpServletRequest request){
+    public String getProjectItem(HttpServletRequest request) {
         try {
             // 鑾峰彇鍙傛暟
             FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
-            
+
             // 鍒ゆ柇uuid鏄惁涓虹┖
             if (BaseUtil.strIsNull(fse.getUUID())) {
                 return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
@@ -72,36 +104,205 @@
             return this.error(e);
         } catch (Exception e) {
             e.printStackTrace();
-            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
-                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
         }
     }
-    
+
     /**
-     * 	鍒嗛」鍒犻櫎楠岃瘉
+     * 鑾峰彇椤圭洰瀛愯〃鍒嗛」锛堝崟涓爲锛�
+     *
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/get-projectAllItem/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String getProjectAllItem(HttpServletRequest request) {
+        try {
+            // 鑾峰彇鍙傛暟
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+
+            // 鍒ゆ柇uuid鏄惁涓虹┖
+            if (BaseUtil.strIsNull(fse.getString(Cmnconst.PROJECT_UUID))) {
+                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
+            }
+            return OK_List(projectInfoService.getProjectAllItem(fse.getString(Cmnconst.PROJECT_UUID)));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
+        }
+    }
+
+    /**
+     * 鑾峰彇椤圭洰淇℃伅(鏃犲垎椤靛弬鏁�)
+     *
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/list-project/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String listProject(HttpServletRequest request) {
+        try {
+            return OK_List(projectInfoService.listProject());
+        } catch (BaseException e) {
+            e.printStackTrace();
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
+        }
+    }
+
+
+    /**
+     * 鍒犻櫎鍗曚釜椤圭洰鍒嗛」楠岃瘉锛堟牴鎹绠楅獙璇佹槸鍚﹀垹闄わ級
+     *
      * @param request
      * @return
      */
     @RequestMapping(value = "/del-itemize-valdate/{version}", method = RequestMethod.POST)
     @ApiVersion(1)
     public String deleteItemizeValidate(HttpServletRequest request) {
-    	try {
-    		//鑾峰彇鍙傛暟
-    		FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
-    		
-    		//鍒ゆ柇uuid鏄惁涓虹┖
-    		if (BaseUtil.strIsNull(fse.getUUID())) {
-    			return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
-    		}
-    		projectInfoService.deleteItemizeValidate(fse.getUUID());
-    		return OK();
-    	} catch (BaseException e) {
+        try {
+            //鑾峰彇鍙傛暟
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+
+            //鍒ゆ柇uuid鏄惁涓虹┖
+            if (BaseUtil.strIsNull(fse.getUUID())) {
+                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
+            }
+            projectInfoService.deleteItemizeValidate(fse.getUUID());
+            return OK();
+        } catch (BaseException e) {
             e.printStackTrace();
             return this.error(e);
         } catch (Exception e) {
             e.printStackTrace();
-            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
-            		SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
         }
     }
+
+    /**
+     * 鑾峰彇椤圭洰棰勭畻淇℃伅
+     *
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/list-itemize-budget/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String listItemizeBudget(HttpServletRequest request) {
+        try {
+            //鑾峰彇鍙傛暟
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+
+
+            //鍒ゆ柇鍒嗛〉鍙傛暟鏄惁涓虹┖
+            if (BaseUtil.strIsNull(fse.getString(CoreConst.CPAGE)) || BaseUtil.strIsNull(fse.getString(CoreConst.PAGESIZE))) {
+                return this.error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText());
+            }
+            return OK_List(projectInfoService.listItemizeBudget(fse.getString(Cmnconst.ITEMIZE_UUID), fse.getInteger(CoreConst.CPAGE), fse.getInteger(CoreConst.PAGESIZE)));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
+        }
+    }
+
+    /**
+     * 鑾峰彇椤圭洰鍒嗛」鏉愭枡
+     *
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/list-material-v/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String listMaterialV(HttpServletRequest request) {
+        try {
+            //鑾峰彇鍙傛暟
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+
+            //鍒ゆ柇uuid鏄惁涓虹┖
+            if (BaseUtil.strIsNull(fse.getString(Cmnconst.UUID))) {
+                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
+            }
+
+            //鍒ゆ柇鍒嗛〉鍙傛暟鏄惁涓虹┖
+            if (BaseUtil.strIsNull(fse.getString(CoreConst.CPAGE)) || BaseUtil.strIsNull(fse.getString(CoreConst.PAGESIZE))) {
+                return this.error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText());
+            }
+            return OK_List(projectInfoService.listMaterialV(fse.getString(Cmnconst.UUID), fse.getInteger(CoreConst.CPAGE), fse.getInteger(CoreConst.PAGESIZE)));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
+        }
+    }
+
+    /**
+     * 鑾峰彇椤圭洰鍒嗛」鏉愭枡
+     *
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/find-inventory_v/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String findInventoryV(HttpServletRequest request) {
+        try {
+            //鑾峰彇鍙傛暟
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+            //鍒ゆ柇浠撳簱鍜屾潗鏂欐槸鍚︿负绌�
+            if (BaseUtil.strIsNull(fse.getString("warehouse_uuid"))||BaseUtil.strIsNull(fse.getString("material_uuid"))) {
+                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
+            }
+            return OK_List(projectInfoService.findInventoryV(fse.getString("warehouse_uuid"), fse.getString("material_uuid")));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
+        }
+    }
+
+    /**
+     * 鏍规嵁uuid鑾峰彇椤圭洰鍒嗛」鏍戠粨鏋勮鎯�
+     *
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/get-treeProjectItem/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String getTreeProjectItem(HttpServletRequest request) {
+        try {
+            // 鑾峰彇鍙傛暟
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+
+            // 鍒ゆ柇uuid鏄惁涓虹┖
+            if (BaseUtil.strIsNull(fse.getUUID())) {
+                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
+            }
+            return ResultInfo.success(projectInfoService.getTreeProjectItem(fse.getUUID()));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return this.error(SystemCode.PROJECT_INFO_OPERATE_ERROR.getValue(),
+                    SystemCode.PROJECT_INFO_OPERATE_ERROR.getText() + e.getMessage());
+        }
+    }
+
 }

--
Gitblit v1.9.2