From 8756ac5f231e381b8f3f41a6a06a24f5bdf11a4e Mon Sep 17 00:00:00 2001 From: 2369059705@qq.com <2369059705@qq.com> Date: 星期三, 28 六月 2023 10:02:00 +0800 Subject: [PATCH] 项目预警 --- product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java | 154 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 145 insertions(+), 9 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..4042289 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,11 +10,13 @@ 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") @@ -22,9 +24,9 @@ @Autowired ProjectInfoService projectInfoService; - + /** - * 鏍规嵁uuid鑾峰彇椤圭洰璇︽儏 + * 鑾峰彇妯℃澘椤圭洰鍒嗛」 * @param request * @return */ @@ -34,7 +36,7 @@ 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()); @@ -49,9 +51,9 @@ SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage()); } } - + /** - * 鏍规嵁uuid鑾峰彇椤圭洰璇︽儏 + * 鑾峰彇椤圭洰淇℃伅锛堥」鐩垎椤瑰涓爲锛� * @param request * @return */ @@ -61,7 +63,7 @@ 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()); @@ -76,9 +78,84 @@ SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_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_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(), + SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_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_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(), + SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage()); + } + } + + /** + * 鑾峰彇椤圭洰鍒嗘瀽鏁版嵁 + * @param request + * @return + */ + @RequestMapping(value = "/statist-analysis-report/{version}", method = RequestMethod.POST) + @ApiVersion(1) + public String statistAnalysis(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 ResultInfo.success(projectInfoService.statistAnalysis(fse.getString(Cmnconst.PROJECT_UUID))); +// return OK_List(projectInfoService.statistAnalysis(fse.getString(Cmnconst.PROJECT_UUID))); + } 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()); + } + } + + /** + * 鍒犻櫎鍗曚釜椤圭洰鍒嗛」楠岃瘉锛堟牴鎹绠楅獙璇佹槸鍚﹀垹闄わ級 * @param request * @return */ @@ -88,7 +165,7 @@ 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()); @@ -104,4 +181,63 @@ SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_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); + + //鍒ゆ柇uuid鏄惁涓虹┖ + if (BaseUtil.strIsNull(fse.getString(Cmnconst.PROJECT_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.listItemizeBudget(fse.getString(Cmnconst.PROJECT_UUID), fse.getString(Cmnconst.ITEMIZE_CODE), 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_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(), + SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_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_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(), + SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage()); + } + } + } -- Gitblit v1.9.2