354798ggg
2023-10-19 19737470afef2563d99ac133a5498ed845f1d822
product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java
@@ -24,6 +24,34 @@
    @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());
        }
    }
    /**
     * 获取模板项目分项
@@ -48,8 +76,8 @@
            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());
        }
    }
@@ -76,8 +104,8 @@
            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());
        }
    }
@@ -104,8 +132,8 @@
            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());
        }
    }
@@ -125,39 +153,11 @@
            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 = "/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());
        }
    }
    /**
     * 删除单个项目分项验证(根据预算验证是否删除)
@@ -183,8 +183,8 @@
            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());
        }
    }
@@ -201,23 +201,19 @@
            //获取参数
            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)));
            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_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());
        }
    }
@@ -249,8 +245,8 @@
            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());
        }
    }
@@ -276,8 +272,8 @@
            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());
        }
    }
@@ -304,8 +300,8 @@
            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());
        }
    }