From e38f4d12d2b051c42202d8554f4c92020d8be294 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 22 七月 2024 10:10:58 +0800
Subject: [PATCH] 枚举类型导入,部门管理取消唯一标识列
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebEnumController.java | 129 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 115 insertions(+), 14 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebEnumController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebEnumController.java
index 14f0e92..e8beb3e 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebEnumController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebEnumController.java
@@ -1,5 +1,6 @@
package com.vci.web.controller;
+import com.vci.dto.OsEnumDTO;
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.pagemodel.BaseQueryObject;
@@ -8,11 +9,12 @@
import com.vci.pagemodel.KeyValue;
import com.vci.pagemodel.OsEnumItemVO;
import com.vci.pagemodel.OsEnumVO;
+import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.OsEnumServiceI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -34,6 +36,11 @@
private OsEnumServiceI enumService;
/**
+ * 鏃ュ織
+ */
+ private Logger logger = LoggerFactory.getLogger(getClass());
+
+ /**
* 鑾峰彇鏋氫妇鐨勪笅鎷夋
* @param comboxKey 鏋氫妇鐨勫悕绉�
* @return 鏋氫妇鐨勪笅鎷夊��
@@ -45,6 +52,27 @@
return BaseResult.success(enumService.getEnum(comboxKey));
}
+ /**
+ * 鍙傜収鏋氫妇鍒楄〃
+ * @param baseQueryObject 鏌ヨ鏉′欢
+ * @return 鍒楄〃鐨勫唴瀹�
+ */
+ @GetMapping( "/referDataGrid")
+ @VciBusinessLog(operateName = "鍙傜収鏋氫妇鍒楄〃")
+ public DataGrid<OsEnumVO> referDataGrid(BaseQueryObject baseQueryObject){
+ return enumService.referDataGrid(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
+ }
+
+ /**
+ * 鑾峰彇鏋氫妇鐨勬槑缁�
+ * @param pkEnum 鏋氫妇鐨勪富閿�
+ * @return 鏋氫妇鐨勯�夐」
+ */
+ @GetMapping("/gridEnumItemByOid")
+ @VciBusinessLog(operateName = "鑾峰彇鏋氫妇鐨勬槑缁�")
+ public DataGrid<OsEnumItemVO> gridEnumItemByOid(String pkEnum){
+ return enumService.gridEnumItemByOid(pkEnum);
+ }
/**
* 鑾峰彇鏁版嵁鐨勫瘑绾�
@@ -60,24 +88,97 @@
/**
* 鏋氫妇鍒楄〃
- * @param baseQueryObject 鏌ヨ鏉′欢
+ * @param enumName 鏌ヨ鏉′欢name
* @return 鍒楄〃鐨勫唴瀹�
*/
- @GetMapping( "/gridEnum")
+ @GetMapping( "/getEnumTypeList")
@VciBusinessLog(operateName = "鏋氫妇鍒楄〃")
- public DataGrid<OsEnumVO> gridEnum(BaseQueryObject baseQueryObject){
- return enumService.referDataGrid(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
+ @VciUnCheckRight
+ public BaseResult<List<OsEnumVO>> getEnumTypeList(String enumName) {
+ try {
+ return BaseResult.dataList(enumService.getEnumTypeList(enumName));
+ }catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "鏋氫妇绠$悊鍒楄〃鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
}
/**
- * 鑾峰彇鏋氫妇鐨勬槑缁�
- * @param pkEnum 鏋氫妇鐨勪富閿�
- * @return 鏋氫妇鐨勯�夐」
+ * 娣诲姞鍗曟潯鏋氫妇
+ * @param osEnumDTO
+ * @return 鍒楄〃鐨勫唴瀹�
*/
- @GetMapping("/gridEnumItemByOid")
- @VciBusinessLog(operateName = "鑾峰彇鏋氫妇鐨勬槑缁�")
- public DataGrid<OsEnumItemVO> gridEnumItemByOid(String pkEnum){
- return enumService.gridEnumItemByOid(pkEnum);
+ @PostMapping( "/addEnumType")
+ @VciBusinessLog(operateName = "娣诲姞鏋氫妇")
+ @VciUnCheckRight
+ public BaseResult addEnumType(@RequestBody OsEnumDTO osEnumDTO) {
+ try {
+ return enumService.addEnumType(osEnumDTO) ? BaseResult.success("鏋氫妇绫诲瀷娣诲姞鎴愬姛锛�"):BaseResult.fail("鏋氫妇绫诲瀷娣诲姞澶辫触锛�");
+ }catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "澧炲姞鏋氫妇绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
+ }
+
+ /**
+ * 淇敼鍗曟潯鏋氫妇锛堝甫淇敼鏋氫妇椤瑰姛鑳斤級
+ * @param osEnumDTO
+ * @return 鍒楄〃鐨勫唴瀹�
+ */
+ @PutMapping( "/updateEnumType")
+ @VciBusinessLog(operateName = "淇敼鏋氫妇")
+ @VciUnCheckRight
+ public BaseResult updateEnumType(@RequestBody OsEnumDTO osEnumDTO) {
+ try {
+ return enumService.updateEnumType(osEnumDTO) ? BaseResult.success("鏋氫妇绫诲瀷淇敼鎴愬姛锛�"):BaseResult.fail("鏋氫妇绫诲瀷淇敼澶辫触锛�");
+ }catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "淇敼鏋氫妇绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
+ }
+
+ /**
+ * 鍒犻櫎鏋氫妇
+ * @param osEnumDTOS
+ * @return 鍒楄〃鐨勫唴瀹�
+ */
+ @DeleteMapping( "/deleteEnumTypes")
+ @VciBusinessLog(operateName = "鍒犻櫎鏋氫妇")
+ @VciUnCheckRight
+ public BaseResult deleteEnumTypes(@RequestBody List<OsEnumDTO> osEnumDTOS) {
+ try {
+ return enumService.deleteEnumTypes(osEnumDTOS) ? BaseResult.success("鏋氫妇绫诲瀷鍒犻櫎鎴愬姛锛�"):BaseResult.fail("鏋氫妇绫诲瀷鍒犻櫎澶辫触锛�");
+ }catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "鍒犻櫎鏋氫妇绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
+ }
+
+ /**
+ * 鏌ョ湅鏋氫妇鐨勪娇鐢ㄨ寖鍥�
+ * @param enumName
+ * @return 鍒楄〃鐨勫唴瀹�
+ */
+ @GetMapping( "/getUsedEnumList")
+ @VciBusinessLog(operateName = "鏌ョ湅鏋氫妇鐨勪娇鐢ㄨ寖鍥�")
+ @VciUnCheckRight
+ public BaseResult getUsedEnumList(String enumName) {
+ try {
+ return BaseResult.dataList(enumService.getUsedEnumList(enumName));
+ }catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "鑾峰彇鏋氫妇鐨勪娇鐢ㄨ寖鍥存椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
}
}
--
Gitblit v1.10.0