From 96350be7a8fbfcb1163a5826022a442f8feb5fc9 Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期四, 13 二月 2025 14:05:26 +0800 Subject: [PATCH] 修改全局Result字段 --- ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java | 84 +++++++++++++++++++++--------------------- 1 files changed, 42 insertions(+), 42 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 1ac9ed9..082041a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -75,7 +75,7 @@ import com.ruoyi.common.annotation.Excel.Type; import com.ruoyi.common.annotation.Excels; import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.exception.UtilException; import com.ruoyi.common.utils.DateUtils; @@ -88,7 +88,7 @@ /** * Excel鐩稿叧澶勭悊 - * + * * @author ruoyi */ public class ExcelUtil<T> @@ -305,7 +305,7 @@ /** * 瀵筫xcel琛ㄥ崟榛樿绗竴涓储寮曞悕杞崲鎴恖ist - * + * * @param is 杈撳叆娴� * @return 杞崲鍚庨泦鍚� */ @@ -316,7 +316,7 @@ /** * 瀵筫xcel琛ㄥ崟榛樿绗竴涓储寮曞悕杞崲鎴恖ist - * + * * @param is 杈撳叆娴� * @param titleNum 鏍囬鍗犵敤琛屾暟 * @return 杞崲鍚庨泦鍚� @@ -342,7 +342,7 @@ /** * 瀵筫xcel琛ㄥ崟鎸囧畾琛ㄦ牸绱㈠紩鍚嶈浆鎹㈡垚list - * + * * @param sheetName 琛ㄦ牸绱㈠紩鍚� * @param titleNum 鏍囬鍗犵敤琛屾暟 * @param is 杈撳叆娴� @@ -526,25 +526,25 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param list 瀵煎嚭鏁版嵁闆嗗悎 * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О * @return 缁撴灉 */ - public AjaxResult exportExcel(List<T> list, String sheetName) + public Result exportExcel(List<T> list, String sheetName) { return exportExcel(list, sheetName, StringUtils.EMPTY); } /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param list 瀵煎嚭鏁版嵁闆嗗悎 * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О * @param title 鏍囬 * @return 缁撴灉 */ - public AjaxResult exportExcel(List<T> list, String sheetName, String title) + public Result exportExcel(List<T> list, String sheetName, String title) { this.init(list, sheetName, title, Type.EXPORT); return exportExcel(); @@ -552,7 +552,7 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param response 杩斿洖鏁版嵁 * @param list 瀵煎嚭鏁版嵁闆嗗悎 * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О @@ -565,7 +565,7 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param response 杩斿洖鏁版嵁 * @param list 瀵煎嚭鏁版嵁闆嗗悎 * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О @@ -582,23 +582,23 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О * @return 缁撴灉 */ - public AjaxResult importTemplateExcel(String sheetName) + public Result importTemplateExcel(String sheetName) { return importTemplateExcel(sheetName, StringUtils.EMPTY); } /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О * @param title 鏍囬 * @return 缁撴灉 */ - public AjaxResult importTemplateExcel(String sheetName, String title) + public Result importTemplateExcel(String sheetName, String title) { this.init(null, sheetName, title, Type.IMPORT); return exportExcel(); @@ -606,7 +606,7 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О * @return 缁撴灉 */ @@ -617,7 +617,7 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О * @param title 鏍囬 * @return 缁撴灉 @@ -632,7 +632,7 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @return 缁撴灉 */ public void exportExcel(HttpServletResponse response) @@ -654,10 +654,10 @@ /** * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 - * + * * @return 缁撴灉 */ - public AjaxResult exportExcel() + public Result exportExcel() { OutputStream out = null; try @@ -666,7 +666,7 @@ String filename = encodingFilename(sheetName); out = new FileOutputStream(getAbsoluteFile(filename)); wb.write(out); - return AjaxResult.success(filename); + return Result.success(filename); } catch (Exception e) { @@ -722,7 +722,7 @@ /** * 濉厖excel鏁版嵁 - * + * * @param index 搴忓彿 * @param row 鍗曞厓鏍艰 */ @@ -820,7 +820,7 @@ /** * 鍒涘缓琛ㄦ牸鏍峰紡 - * + * * @param wb 宸ヤ綔钖勫璞� * @return 鏍峰紡鍒楄〃 */ @@ -875,7 +875,7 @@ /** * 鏍规嵁Excel娉ㄨВ鍒涘缓琛ㄦ牸澶存牱寮� - * + * * @param wb 宸ヤ綔钖勫璞� * @return 鑷畾涔夋牱寮忓垪琛� */ @@ -911,7 +911,7 @@ /** * 鏍规嵁Excel娉ㄨВ鍒涘缓琛ㄦ牸鍒楁牱寮� - * + * * @param wb 宸ヤ綔钖勫璞� * @return 鑷畾涔夋牱寮忓垪琛� */ @@ -943,7 +943,7 @@ /** * 鏍规嵁Excel娉ㄨВ鍒涘缓琛ㄦ牸鍒楁牱寮� - * + * * @param styles 鑷畾涔夋牱寮忓垪琛� * @param field 灞炴�у垪淇℃伅 * @param excel 娉ㄨВ淇℃伅 @@ -1006,7 +1006,7 @@ /** * 璁剧疆鍗曞厓鏍间俊鎭� - * + * * @param value 鍗曞厓鏍煎�� * @param attr 娉ㄨВ鐩稿叧 * @param cell 鍗曞厓鏍间俊鎭� @@ -1188,7 +1188,7 @@ /** * 璁剧疆 POI XSSFSheet 鍗曞厓鏍兼彁绀烘垨閫夋嫨妗� - * + * * @param sheet 琛ㄥ崟 * @param textlist 涓嬫媺妗嗘樉绀虹殑鍐呭 * @param promptContent 鎻愮ず鍐呭 @@ -1225,7 +1225,7 @@ /** * 璁剧疆鏌愪簺鍒楃殑鍊煎彧鑳借緭鍏ラ鍒剁殑鏁版嵁,鏄剧ず涓嬫媺妗嗭紙鍏煎瓒呭嚭涓�瀹氭暟閲忕殑涓嬫媺妗嗭級. - * + * * @param sheet 瑕佽缃殑sheet. * @param textlist 涓嬫媺妗嗘樉绀虹殑鍐呭 * @param promptContent 鎻愮ず鍐呭 @@ -1277,7 +1277,7 @@ /** * 瑙f瀽瀵煎嚭鍊� 0=鐢�,1=濂�,2=鏈煡 - * + * * @param propertyValue 鍙傛暟鍊� * @param converterExp 缈昏瘧娉ㄨВ * @param separator 鍒嗛殧绗� @@ -1314,7 +1314,7 @@ /** * 鍙嶅悜瑙f瀽鍊� 鐢�=0,濂�=1,鏈煡=2 - * + * * @param propertyValue 鍙傛暟鍊� * @param converterExp 缈昏瘧娉ㄨВ * @param separator 鍒嗛殧绗� @@ -1351,7 +1351,7 @@ /** * 瑙f瀽瀛楀吀鍊� - * + * * @param dictValue 瀛楀吀鍊� * @param dictType 瀛楀吀绫诲瀷 * @param separator 鍒嗛殧绗� @@ -1364,7 +1364,7 @@ /** * 鍙嶅悜瑙f瀽鍊煎瓧鍏稿�� - * + * * @param dictLabel 瀛楀吀鏍囩 * @param dictType 瀛楀吀绫诲瀷 * @param separator 鍒嗛殧绗� @@ -1377,7 +1377,7 @@ /** * 鏁版嵁澶勭悊鍣� - * + * * @param value 鏁版嵁鍊� * @param excel 鏁版嵁娉ㄨВ * @return @@ -1454,7 +1454,7 @@ /** * 鑾峰彇涓嬭浇璺緞 - * + * * @param filename 鏂囦欢鍚嶇О */ public String getAbsoluteFile(String filename) @@ -1470,7 +1470,7 @@ /** * 鑾峰彇bean涓殑灞炴�у�� - * + * * @param vo 瀹炰綋瀵硅薄 * @param field 瀛楁 * @param excel 娉ㄨВ @@ -1502,7 +1502,7 @@ /** * 浠ョ被鐨勫睘鎬х殑get鏂规硶鏂规硶褰㈠紡鑾峰彇鍊� - * + * * @param o * @param name * @return value @@ -1645,7 +1645,7 @@ /** * 鍒涘缓宸ヤ綔琛� - * + * * @param sheetNo sheet鏁伴噺 * @param index 搴忓彿 */ @@ -1662,7 +1662,7 @@ /** * 鑾峰彇鍗曞厓鏍煎�� - * + * * @param row 鑾峰彇鐨勮 * @param column 鑾峰彇鍗曞厓鏍煎垪鍙� * @return 鍗曞厓鏍煎�� @@ -1722,7 +1722,7 @@ /** * 鍒ゆ柇鏄惁鏄┖琛� - * + * * @param row 鍒ゆ柇鐨勮 * @return */ @@ -1810,7 +1810,7 @@ /** * 鏍煎紡鍖栦笉鍚岀被鍨嬬殑鏃ユ湡瀵硅薄 - * + * * @param dateFormat 鏃ユ湡鏍煎紡 * @param val 琚牸寮忓寲鐨勬棩鏈熷璞� * @return 鏍煎紡鍖栧悗鐨勬棩鏈熷瓧绗� @@ -1876,7 +1876,7 @@ /** * 鑾峰彇瀵硅薄鐨勫瓙鍒楄〃鏂规硶 - * + * * @param name 鍚嶇О * @param pojoClass 绫诲璞� * @return 瀛愬垪琛ㄦ柟娉� -- Gitblit v1.9.3