From e937d0111a52e2c13c50bbc3386d20a12d125899 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 06 九月 2024 10:54:54 +0800
Subject: [PATCH] 链接类型查询模板
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java | 33 ++++++++++++++++++++++++++++-----
1 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
index f33a04a..8b982bd 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
@@ -8,6 +8,8 @@
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.pagemodel.OsAttributeVO;
+import com.vci.starter.web.pagemodel.Tree;
+import com.vci.starter.web.pagemodel.TreeQueryObject;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
@@ -46,13 +48,35 @@
*/
private Logger logger = LoggerFactory.getLogger(getClass());
+
+
+ /**
+ * 鑾峰彇鎵�鏈変笟鍔$被鍨嬶紙鏍戝舰缁撴瀯锛�
+ * @return 鏌ヨ缁撴灉
+ */
+ @GetMapping( "/getTreeAttributes")
+ @VciBusinessLog(operateName = "鑾峰彇灞炴�э紙鏍戝舰缁撴瀯锛�")
+ public BaseResult<List<Tree>> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject){
+ try {
+ List<Tree> trees= attributeService.getTreeAttributesByBtmName(treeQueryObject);
+ return BaseResult.dataList(trees);
+ // return BaseResult.tree(trees);
+ }catch (Throwable e) {
+ e.printStackTrace();
+ String exceptionMessage = "鏌ヨ涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
+ }
+
+
/**
* 灞炴�у垪琛�
* @param baseQueryObject 鏌ヨ瀵硅薄
* @return 灞炴�х殑鏄剧ず瀵硅薄
*/
@GetMapping("/gridAttribute")
- @VciUnCheckRight
+ @VciBusinessLog(operateName = "灞炴�у垪琛�")
public BaseResult<OsAttributeVO> gridAttribute(BaseQueryObject baseQueryObject){
try {
return BaseResult.dataGrid(attributeService.gridAttribute(baseQueryObject));
@@ -107,7 +131,6 @@
*/
@PutMapping( "/updateAttribute")
@VciBusinessLog(operateName = "淇敼灞炴��")
- @VciUnCheckRight
public BaseResult updateAttribute(@RequestBody OsAttributeDTO osAttributeDTO) {
try {
return attributeService.updateAttribute(osAttributeDTO) ? BaseResult.success("灞炴�т慨鏀规垚鍔燂紒"):BaseResult.fail("灞炴�т慨鏀瑰け璐ワ紒");
@@ -165,7 +188,7 @@
@VciBusinessLog(operateName = "瀵煎嚭灞炴��")
public void exportAttributes(String exportFileName,String attrNames, HttpServletResponse response){
try {
- String excelPath = attributeService.exportAttributes(exportFileName,attrNames);
+ String excelPath = attributeService.exportAttributes(exportFileName,attrNames,false);
ControllerUtil.writeFileToResponse(response,excelPath);
} catch (Exception e) {
String msg = "瀵煎嚭鏋氫妇鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
@@ -208,14 +231,14 @@
* @return
*/
@PostMapping("/importAttributes")
- @VciUnCheckRight
+ @VciBusinessLog(operateName = "瀵煎叆灞炴��")
public BaseResult importAttributes(MultipartFile file){
String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename());
File file1 = new File(excelFileName);
try {
file.transferTo(new File(excelFileName));
if (file != null) {
- return attributeService.importAttributes(file1);
+ return attributeService.importAttributes(file1,false);
} else {
return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"鏃犲鍏ョ殑鏂囦欢"});
}
--
Gitblit v1.9.3