From 696c68a9f7645bc35a9382a4e2271910b222f7b5 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 26 七月 2024 16:16:34 +0800 Subject: [PATCH] 状态池列表查询、查看应用范围接口上传 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 49 insertions(+), 10 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java index 718362f..db761d4 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java @@ -1,5 +1,6 @@ package com.vci.web.controller; +import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; @@ -7,8 +8,11 @@ import com.vci.dto.OsStatusDTO; import com.vci.pagemodel.OsLifeCycleVO; import com.vci.pagemodel.OsStatusVO; +import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.service.OsLifeCycleServiceI; import com.vci.web.service.OsStatusServiceI; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -35,14 +39,27 @@ private OsLifeCycleServiceI lifeCycleService; /** + * 鏃ュ織 + */ + private Logger logger = LoggerFactory.getLogger(getClass()); + + /** * 鐘舵�佺殑鍒楄〃 * @param queryObject 鏌ヨ瀵硅薄 * @return 鏄剧ず瀵硅薄 */ @GetMapping("/gridStatus") @VciBusinessLog(operateName = "鏌ョ湅鐘舵�佸垪琛�") - public DataGrid<OsStatusVO> gridStatus(BaseQueryObject queryObject){ - return statusService.gridStatus(queryObject.getConditionMap(),queryObject.getPageHelper()); + @VciUnCheckRight + public BaseResult<OsStatusVO> gridStatus(BaseQueryObject queryObject){ + try { + return BaseResult.dataGrid(statusService.gridStatus(queryObject.getConditionMap(),queryObject.getPageHelper())); + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "灞炴�х鐞嗗垪琛ㄦ煡璇㈡椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } } /** @@ -51,8 +68,17 @@ * @return 浣跨敤鐨勭敓鍛藉懆鏈熺殑瀵硅薄 */ @GetMapping("/listUsed") - public DataGrid<OsLifeCycleVO> listUsed(String oid){ - return lifeCycleService.listStatusUsed(oid); + @VciBusinessLog(operateName = "鏌ヨ鐘舵�佹睜鐨勫簲鐢ㄨ寖鍥�") + @VciUnCheckRight + public BaseResult<OsLifeCycleVO> listUsed(String oid){ + try { + return BaseResult.dataGrid(lifeCycleService.listStatusUsed(oid)); + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "灞炴�х鐞嗗垪琛ㄦ煡璇㈡椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } } /** @@ -61,9 +87,16 @@ * @return 鎵ц缁撴灉 */ @PostMapping("/addSave") - public BaseResult addSave(OsStatusDTO statusDTO){ - statusService.addSave(statusDTO); - return BaseResult.success(); + @VciUnCheckRight + public BaseResult addSave(@RequestBody OsStatusDTO statusDTO){ + try { + return statusService.addSave(statusDTO) ? BaseResult.success("娣诲姞鐘舵�佹垚鍔燂紒"):BaseResult.fail("娣诲姞鐘舵�佸け璐ワ紒"); + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "娣诲姞鐘舵�佹椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } } /** @@ -72,9 +105,15 @@ * @return 鎵ц缁撴灉 */ @PutMapping("/editSave") - public BaseResult editSave(OsStatusDTO statusDTO){ - statusService.editSave(statusDTO); - return BaseResult.success(); + public BaseResult editSave(@RequestBody OsStatusDTO statusDTO){ + try { + return statusService.editSave(statusDTO) ? BaseResult.success("淇敼鐘舵�佹垚鍔燂紒"):BaseResult.fail("淇敼鐘舵�佸け璐ワ紒"); + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "淇敼鐘舵�佹椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } } /** -- Gitblit v1.9.3