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/WebPortalVIController.java | 51 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 39 insertions(+), 12 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java
index e9d431e..6471de0 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java
@@ -1,13 +1,12 @@
package com.vci.web.controller;
+import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.dto.ClonePortalVIDTOList;
import com.vci.dto.DeletePortalVIDTOList;
-import com.vci.dto.OsBtmTypeDTO;
import com.vci.dto.PortalVIDTO;
import com.vci.pagemodel.KeyValue;
import com.vci.pagemodel.PortalVIVO;
-import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
@@ -15,28 +14,29 @@
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LangBaseUtil;
+import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.enumpck.ItemDblEnum;
import com.vci.web.enumpck.ItemTypeEnum;
import com.vci.web.service.OsPortalVIServiceI;
-import com.vci.web.service.WebBtmIOServiceI;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
-
+import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
-import java.io.FileNotFoundException;
+import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
/**
- * 鍏紡鎺у埗鍣�
+ * 琛ㄥ崟/琛ㄦ牸鎺у埗鍣�
* @author weidy
* @date 2022-2-11
*/
+@VciBusinessLog(modelName="琛ㄥ崟/琛ㄦ牸鎺у埗鍣�",notStore=true)
@RestController
@RequestMapping("/portalVIController")
public class WebPortalVIController {
@@ -96,7 +96,7 @@
}
/**
- * 涓氬姟绫诲瀷鍒犻櫎
+ * 琛ㄥ崟/table鍒犻櫎
* btmTypeDTO 涓氬姟绫诲瀷瀵硅薄
* @return 鍒犻櫎缁撴灉
*/
@@ -113,7 +113,7 @@
}
}
/**
- * 涓氬姟绫诲瀷鍒犻櫎
+ * 琛ㄥ崟/table鍒犻櫎
* btmTypeDTO 涓氬姟绫诲瀷瀵硅薄
* @return 鍒犻櫎缁撴灉
*/
@@ -129,8 +129,11 @@
return BaseResult.fail(exceptionMessage);
}
}
+
/**
- *
+ * 琛ㄥ崟/table鍏嬮殕
+ * @param portalVIDTOList clong瀵硅薄
+ * @return
*/
@PostMapping("/clone")
@VciBusinessLog(operateName = "鍏嬮殕琛ㄥ崟/琛ㄦ牸")
@@ -149,12 +152,12 @@
/**
* 瀵煎嚭鏁版嵁搴撶殑琛ㄤ俊鎭埌excel
* @param response 鍝嶅簲瀵硅薄
- * @param btmTypeIds 涓氬姟绫诲瀷鐨勭紪鍙凤紝鐢ㄩ�楀彿鍒嗗壊
+ * @param ids 涓氬姟绫诲瀷鐨勭紪鍙凤紝鐢ㄩ�楀彿鍒嗗壊
*/
@PostMapping("/exportExcel")
@VciBusinessLog(operateName = "瀵煎嚭琛ㄥ崟/琛ㄦ牸鍒癳xcel涓�")
- public void exportExcel(String btmTypeIds,HttpServletResponse response){
- String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(btmTypeIds));
+ public void exportExcel(String ids,HttpServletResponse response){
+ String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(ids));
try {
ControllerUtil.writeFileToResponse(response,excelFileName);
} catch (IOException e) {
@@ -165,6 +168,30 @@
}
}
}
+
+ /**
+ * 瀵煎嚭鏁版嵁搴撶殑琛ㄤ俊鎭埌excel
+ * @param file 涓婁紶鐨勬枃浠�
+ */
+ @PostMapping("/importData")
+ @VciBusinessLog(operateName = "瀵煎叆琛ㄥ崟/琛ㄦ牸")
+ public BaseResult importData(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 portalVIServiceI.importData(file1);
+ } else {
+ return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"鏃犲鍏ョ殑鏂囦欢"});
+ }
+ }catch (Throwable e) {
+ throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
+ }finally {
+ file1.delete();
+ }
+ }
+
/**
* 鑾峰彇灞炴�у瓧娈电被鍨�
*/
--
Gitblit v1.9.3