From c007f0ca1785db093d48f4846cda82fe8e955765 Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期三, 27 五月 2020 09:59:29 +0800 Subject: [PATCH] merage --- src/main/java/com/highdatas/mdm/controller/SysViewLogicController.java | 66 +++++++++++++++++++++++++++++++-- 1 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/highdatas/mdm/controller/SysViewLogicController.java b/src/main/java/com/highdatas/mdm/controller/SysViewLogicController.java index faf107b..3d074ad 100644 --- a/src/main/java/com/highdatas/mdm/controller/SysViewLogicController.java +++ b/src/main/java/com/highdatas/mdm/controller/SysViewLogicController.java @@ -32,22 +32,46 @@ @Autowired ISysViewLogicmapService logicmapService; + /** + * + * @description: 鑾峰彇瑙嗗浘閫昏緫杞崲鍒楄〃 + * @return: 閫昏緫杞崲鍒楄〃 + * + */ @RequestMapping(value = "/all", method = RequestMethod.GET) public Result getList() { + //鑾峰彇鍙湁鐨勫垪琛� List<SysViewLogic> aciveLogic = logicService.selectList(new EntityWrapper<SysViewLogic>().eq("active", true)); return Result.success(aciveLogic); } + /** + * + * @description: 鑾峰彇瑙嗗浘宸茬粡浣跨敤鐨勯�昏緫鍒楄〃 + * @param parentId 瑙嗗浘id + * @return: 瑙嗗浘宸茬粡浣跨敤鐨勯�昏緫鍒楄〃 + * + */ @RequestMapping(value = "/allmap/{parentId}", method = RequestMethod.GET) public Result allmap(@PathVariable String parentId) { + //瑙嗗浘宸茬粡浣跨敤鐨勯�昏緫鍒楄〃 List<SysViewLogicmap> aciveLogic = logicmapService.selectList(new EntityWrapper<SysViewLogicmap>().eq(Constant.PARENT_ID, parentId)); return Result.success(aciveLogic); } + /** + * + * @description: 鏇存柊瑙嗗浘宸茬粡浣跨敤鐨勯�昏緫鍒楄〃 + * @param parentId 瑙嗗浘id + * @return: 鏄惁鏇存柊鎴愬姛宸茬粡浣跨敤鐨勯�昏緫鍒楄〃 + * + */ @RequestMapping(value = "/updateMaps/{parentId}", method = RequestMethod.POST) public Result updateMaps(@PathVariable String parentId, @RequestBody List<SysViewLogicmap> logicmaps) { + //鍒犻櫎鍘熸潵鐨刴apping鍏崇郴 boolean delete = logicmapService.delete(new EntityWrapper<SysViewLogicmap>().eq(Constant.PARENT_ID, parentId)); boolean insert = false; + //寰幆鍒涘缓鏂扮殑瀛楁鍜岄�昏緫鐨刴apping鍏崇郴 for (SysViewLogicmap logicmap : logicmaps) { insert = logicmap.setId(DbUtils.getUUID()).setParentId(parentId).insert(); if (!insert) { @@ -57,9 +81,15 @@ return Result.success(null); } - + /** + * + * @description: 娣诲姞瑙嗗浘宸茬粡浣跨敤鐨勯�昏緫 + * @return: 鏄惁娣诲姞鎴愬姛 + * + */ @RequestMapping(value = "/addmap", method = RequestMethod.POST) public Result addmap(@RequestBody SysViewLogicmap logicmap) { + //娣诲姞涓�鏉¢�昏緫杞崲鍏崇郴 boolean insert = logicmap.setId(DbUtils.getUUID()).insert(); if (insert) { return Result.success(insert); @@ -67,9 +97,16 @@ return Result.error(CodeMsg.INSERT_ERROR); } } - + /** + * + * @description: 鍒犻櫎瑙嗗浘宸茬粡浣跨敤鐨勯�昏緫 + * @param id mapping 鍏崇郴鐨刬d + * @return: 鏄惁鍒犻櫎鎴愬姛 + * + */ @RequestMapping(value = "/deletemap/{id}", method = RequestMethod.POST) public Result deletemap(@PathVariable String id) { + //閫氳繃id 鍒犻櫎mapping鍏崇郴 boolean delete = logicmapService.deleteById(id); if (delete) { return Result.success(CodeMsg.DELETE_SUCCESS); @@ -77,13 +114,20 @@ return Result.success(CodeMsg.DELETE_ERROR); } } - + /** + * + * @description: 鏇存柊瑙嗗浘宸茬粡浣跨敤鐨勯�昏緫 + * @return: 鏄惁鏇存柊鎴愬姛 + * + */ @RequestMapping(value = "/updatemap", method = RequestMethod.POST) public Result updatemap(@RequestBody SysViewLogicmap logicmap) { String id = logicmap.getId(); + //鍒ゆ柇id鏄惁瀛樺湪 if (StringUtils.isEmpty(id)) { return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); } + //鏇存柊璁板綍 boolean insert = logicmap.updateById(); if (insert) { return Result.success(insert); @@ -91,9 +135,15 @@ return Result.error(CodeMsg.INSERT_ERROR); } } - + /** + * + * @description: 娣诲姞绯荤粺涓彲浠ヤ娇鐢ㄧ殑閫昏緫杞崲绫诲瀷 + * @return: 鏄惁娣诲姞鎴愬姛 + * + */ @RequestMapping(value = "/add", method = RequestMethod.POST) public Result add(@RequestBody SysViewLogic logic) { + //娣诲姞璁板綍 boolean insert = logic.setId(DbUtils.getUUID()).insert(); if (insert) { return Result.success(insert); @@ -102,12 +152,20 @@ } } + /** + * + * @description: 鏇存柊绯荤粺涓彲浠ヤ娇鐢ㄧ殑閫昏緫杞崲绫诲瀷 + * @return: 鏄惁鏇存柊鎴愬姛 + * + */ @RequestMapping(value = "/update", method = RequestMethod.POST) public Result update(@RequestBody SysViewLogic logic) { String id = logic.getId(); + //鍒ゆ柇id鏄惁瀛樺湪 if (StringUtils.isEmpty(id)) { return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); } + //鏇存柊璁板綍 boolean b = logic.updateById(); if (b) { return Result.success(logic); -- Gitblit v1.8.0