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 | 200 +++++++++++++++++++++++++++++-------------------- 1 files changed, 117 insertions(+), 83 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 eaa6c84..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 @@ -20,19 +20,48 @@ @RequestMapping("/api/qxlw-project") @RestController("qxlw-project-controller") -public class ProjectInfoController extends AbstractBaseController{ +public class ProjectInfoController extends AbstractBaseController { - @Autowired - ProjectInfoService projectInfoService; + @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); @@ -47,19 +76,20 @@ 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-projectItem/{version}", method = RequestMethod.POST) @ApiVersion(1) - public String getProjectItem(HttpServletRequest request){ + public String getProjectItem(HttpServletRequest request) { try { // 鑾峰彇鍙傛暟 FieldSetEntity fse = BaseUtil.getFieldSetEntity(request); @@ -74,19 +104,20 @@ 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){ + public String getProjectAllItem(HttpServletRequest request) { try { // 鑾峰彇鍙傛暟 FieldSetEntity fse = BaseUtil.getFieldSetEntity(request); @@ -101,120 +132,94 @@ 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-project/{version}", method = RequestMethod.POST) @ApiVersion(1) public String listProject(HttpServletRequest request) { - try { - return OK_List(projectInfoService.listProject()); - } catch (BaseException e) { + 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()); + 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()); - } - } /** - * 鍒犻櫎鍗曚釜椤圭洰鍒嗛」楠岃瘉锛堟牴鎹绠楅獙璇佹槸鍚﹀垹闄わ級 + * 鍒犻櫎鍗曚釜椤圭洰鍒嗛」楠岃瘉锛堟牴鎹绠楅獙璇佹槸鍚﹀垹闄わ級 + * * @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); + 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) { + //鍒ゆ柇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); + 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) { + //鍒ゆ柇鍒嗛〉鍙傛暟鏄惁涓虹┖ + 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_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 */ @@ -240,18 +245,47 @@ 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 = "/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){ + public String getTreeProjectItem(HttpServletRequest request) { try { // 鑾峰彇鍙傛暟 FieldSetEntity fse = BaseUtil.getFieldSetEntity(request); @@ -266,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()); } } -- Gitblit v1.9.2