From c86748a2c254ea22ac8f57d7984cc4743efaaed7 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 26 七月 2024 16:53:07 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/PLTWEB

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java |   66 ++++++++++++++++++++++++++-------
 1 files changed, 52 insertions(+), 14 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 36029e9..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,15 +1,18 @@
 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.annotation.permission.VciPermission;
 import com.vci.starter.web.pagemodel.BaseQueryObject;
 import com.vci.starter.web.pagemodel.BaseResult;
 import com.vci.starter.web.pagemodel.DataGrid;
-import com.vci.web.dto.OsStatusDTO;
-import com.vci.web.pageModel.OsLifeCycleVO;
-import com.vci.web.pageModel.OsStatusVO;
+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.*;
 
@@ -36,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);
+        }
     }
 
     /**
@@ -52,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);
+        }
     }
 
     /**
@@ -62,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);
+        }
     }
 
     /**
@@ -73,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