excel 列單元格合并(合并列相同行)

代碼

  • 首先自定義注解CellMerge,用于標記哪些屬性需要合并,哪個是主鍵**(這里做了一個優化,可以標記多個主鍵)**
import org.dromara.common.excel.core.CellMergeStrategy;import java.lang.annotation.*;/*** excel 列單元格合并(合并列相同項)** 需搭配 {@link CellMergeStrategy} 策略使用** @author Lion Li*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface CellMerge {/*** col index*/int index() default -1;}
  • 再創建自定義單元格合并策略類CellMergeStrategy,當Excel中兩列主鍵相同時,合并被標記需要合并的列**(當前類增加多主鍵判斷是否需要合并)**

import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.merge.AbstractMergeStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import org.dromara.common.excel.annotation.CellMerge;import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;/*** 列值重復合并策略** @author Lion Li*/
@Slf4j
public class CellMergeStrategy extends AbstractMergeStrategy {private final List<CellRangeAddress> cellList;private final boolean hasTitle;private int rowIndex;public CellMergeStrategy(List<?> list, boolean hasTitle) {this.hasTitle = hasTitle;// 行合并開始下標this.rowIndex = hasTitle ? 1 : 0;this.cellList = handle(list, hasTitle);}@Overrideprotected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {// judge the list is not nullif (CollUtil.isNotEmpty(cellList)) {// the judge is necessaryif (cell.getRowIndex() == rowIndex && cell.getColumnIndex() == 0) {for (CellRangeAddress item : cellList) {sheet.addMergedRegion(item);}}}}@SneakyThrowsprivate List<CellRangeAddress> handle(List<?> list, boolean hasTitle) {List<CellRangeAddress> cellList = new ArrayList<>();if (CollUtil.isEmpty(list)) {return cellList;}Field[] fields = ReflectUtils.getFields(list.get(0).getClass(), field -> !"serialVersionUID".equals(field.getName()));// 有注解的字段List<Field> mergeFields = new ArrayList<>();List<Integer> mergeFieldsIndex = new ArrayList<>();for (int i = 0; i < fields.length; i++) {Field field = fields[i];if (field.isAnnotationPresent(CellMerge.class)) {CellMerge cm = field.getAnnotation(CellMerge.class);mergeFields.add(field);mergeFieldsIndex.add(cm.index() == -1 ? i : cm.index());if (hasTitle) {ExcelProperty property = field.getAnnotation(ExcelProperty.class);rowIndex = Math.max(rowIndex, property.value().length);}}}Map<Field, RepeatCell> map = new HashMap<>();// 生成兩兩合并單元格for (int i = 0; i < list.size(); i++) {for (int j = 0; j < mergeFields.size(); j++) {Field field = mergeFields.get(j);Object val = ReflectUtils.invokeGetter(list.get(i), field.getName());int colNum = mergeFieldsIndex.get(j);if (!map.containsKey(field)) {map.put(field, new RepeatCell(val, i));} else {RepeatCell repeatCell = map.get(field);Object cellValue = repeatCell.getValue();if (cellValue == null || "".equals(cellValue)) {// 空值跳過不合并continue;}if (!cellValue.equals(val)) {if (i - repeatCell.getCurrent() > 1) {cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));}map.put(field, new RepeatCell(val, i));} else if (j == 0) {if (i == list.size() - 1) {if (i > repeatCell.getCurrent()) {cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));}}} else {// 判斷前面的是否合并了RepeatCell firstCell = map.get(mergeFields.get(0));if (repeatCell.getCurrent() != firstCell.getCurrent()) {if (i == list.size() - 1) {if (i > repeatCell.getCurrent()) {cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));}} else if (repeatCell.getCurrent() < firstCell.getCurrent()) {if (i - repeatCell.getCurrent() > 1) {cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));}map.put(field, new RepeatCell(val, i));}} else if (i == list.size() - 1) {if (i > repeatCell.getCurrent()) {cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));}}}}}}return cellList;}@Data@AllArgsConstructorstatic class RepeatCell {private Object value;private int current;}
}

ExcelUtlis工具類

package org.dromara.common.excel.utils;import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.util.IdUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.fill.FillWrapper;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.utils.file.FileUtils;
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
import org.dromara.common.excel.core.*;import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.List;
import java.util.Map;/*** Excel相關處理** @author Lion Li*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ExcelUtil {/*** 同步導入(適用于小數據量)** @param is 輸入流* @return 轉換后集合*/public static <T> List<T> importExcel(InputStream is, Class<T> clazz) {return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();}/*** 使用校驗監聽器 異步導入 同步返回** @param is         輸入流* @param clazz      對象類型* @param isValidate 是否 Validator 檢驗 默認為是* @return 轉換后集合*/public static <T> ExcelResult<T> importExcel(InputStream is, Class<T> clazz, boolean isValidate) {DefaultExcelListener<T> listener = new DefaultExcelListener<>(isValidate);EasyExcel.read(is, clazz, listener).sheet().doRead();return listener.getExcelResult();}/*** 使用自定義監聽器 異步導入 自定義返回** @param is       輸入流* @param clazz    對象類型* @param listener 自定義監聽器* @return 轉換后集合*/public static <T> ExcelResult<T> importExcel(InputStream is, Class<T> clazz, ExcelListener<T> listener) {EasyExcel.read(is, clazz, listener).sheet().doRead();return listener.getExcelResult();}/*** 導出excel** @param list      導出數據集合* @param sheetName 工作表的名稱* @param clazz     實體類* @param response  響應體*/public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, HttpServletResponse response) {try {resetResponse(sheetName, response);ServletOutputStream os = response.getOutputStream();exportExcel(list, sheetName, clazz, false, os, null);} catch (IOException e) {throw new RuntimeException("導出Excel異常");}}/*** 導出excel** @param list      導出數據集合* @param sheetName 工作表的名稱* @param clazz     實體類* @param response  響應體* @param options   級聯下拉選*/public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, HttpServletResponse response, List<DropDownOptions> options) {try {resetResponse(sheetName, response);ServletOutputStream os = response.getOutputStream();exportExcel(list, sheetName, clazz, false, os, options);} catch (IOException e) {throw new RuntimeException("導出Excel異常");}}/*** 導出excel** @param list      導出數據集合* @param sheetName 工作表的名稱* @param clazz     實體類* @param merge     是否合并單元格* @param response  響應體*/public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, boolean merge, HttpServletResponse response) {try {resetResponse(sheetName, response);ServletOutputStream os = response.getOutputStream();exportExcel(list, sheetName, clazz, merge, os, null);} catch (IOException e) {throw new RuntimeException("導出Excel異常");}}/*** 導出excel** @param list      導出數據集合* @param sheetName 工作表的名稱* @param clazz     實體類* @param merge     是否合并單元格* @param response  響應體* @param options   級聯下拉選*/public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, boolean merge, HttpServletResponse response, List<DropDownOptions> options) {try {resetResponse(sheetName, response);ServletOutputStream os = response.getOutputStream();exportExcel(list, sheetName, clazz, merge, os, options);} catch (IOException e) {throw new RuntimeException("導出Excel異常");}}/*** 導出excel** @param list      導出數據集合* @param sheetName 工作表的名稱* @param clazz     實體類* @param os        輸出流*/public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, OutputStream os) {exportExcel(list, sheetName, clazz, false, os, null);}/*** 導出excel** @param list      導出數據集合* @param sheetName 工作表的名稱* @param clazz     實體類* @param os        輸出流* @param options   級聯下拉選內容*/public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, OutputStream os, List<DropDownOptions> options) {exportExcel(list, sheetName, clazz, false, os, options);}/*** 導出excel** @param list      導出數據集合* @param sheetName 工作表的名稱* @param clazz     實體類* @param merge     是否合并單元格* @param os        輸出流*/public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, boolean merge,OutputStream os, List<DropDownOptions> options) {//配置字體,表頭背景等HorizontalCellStyleStrategy horizontalCellStyleStrategy =setConfigure();ExcelWriterSheetBuilder builder = EasyExcel.write(os, clazz).autoCloseStream(false)// 自動適配.registerWriteHandler(new LongestMatchColumnWidthStyleStrategyPlus())//配置字體,表頭背景等.registerWriteHandler(horizontalCellStyleStrategy)// 大數值自動轉換 防止失真.registerConverter(new ExcelBigNumberConvert()).sheet(sheetName);if (merge) {// 合并處理器builder.registerWriteHandler(new CellMergeStrategy(list, true));}// 添加下拉框操作builder.registerWriteHandler(new ExcelDownHandler(options));//字符串去空格builder.registerWriteHandler(new StringTrimHandler());builder.doWrite(list);}/*** 單表多數據模板導出 模板格式為 {.屬性}** @param filename     文件名* @param templatePath 模板路徑 resource 目錄下的路徑包括模板文件名*                     例如: excel/temp.xlsx*                     重點: 模板文件必須放置到啟動類對應的 resource 目錄下* @param data         模板需要的數據* @param response     響應體*/public static void exportTemplate(List<Object> data, String filename, String templatePath, HttpServletResponse response) {try {resetResponse(filename, response);ServletOutputStream os = response.getOutputStream();exportTemplate(data, templatePath, os);} catch (IOException e) {throw new RuntimeException("導出Excel異常");}}/*** 單表多數據模板導出 模板格式為 {.屬性}** @param templatePath 模板路徑 resource 目錄下的路徑包括模板文件名*                     例如: excel/temp.xlsx*                     重點: 模板文件必須放置到啟動類對應的 resource 目錄下* @param data         模板需要的數據* @param os           輸出流*/public static void exportTemplate(List<Object> data, String templatePath, OutputStream os) {ClassPathResource templateResource = new ClassPathResource(templatePath);ExcelWriter excelWriter = EasyExcel.write(os).withTemplate(templateResource.getStream()).autoCloseStream(false)// 大數值自動轉換 防止失真.registerConverter(new ExcelBigNumberConvert()).build();WriteSheet writeSheet = EasyExcel.writerSheet().build();if (CollUtil.isEmpty(data)) {throw new IllegalArgumentException("數據為空");}// 單表多數據導出 模板格式為 {.屬性}for (Object d : data) {excelWriter.fill(d, writeSheet);}excelWriter.finish();}/*** 多表多數據模板導出 模板格式為 {key.屬性}** @param filename     文件名* @param templatePath 模板路徑 resource 目錄下的路徑包括模板文件名*                     例如: excel/temp.xlsx*                     重點: 模板文件必須放置到啟動類對應的 resource 目錄下* @param data         模板需要的數據* @param response     響應體*/public static void exportTemplateMultiList(Map<String, Object> data, String filename, String templatePath, HttpServletResponse response) {try {resetResponse(filename, response);ServletOutputStream os = response.getOutputStream();exportTemplateMultiList(data, templatePath, os);} catch (IOException e) {throw new RuntimeException("導出Excel異常");}}/*** 多sheet模板導出 模板格式為 {key.屬性}** @param filename     文件名* @param templatePath 模板路徑 resource 目錄下的路徑包括模板文件名*                     例如: excel/temp.xlsx*                     重點: 模板文件必須放置到啟動類對應的 resource 目錄下* @param data         模板需要的數據* @param response     響應體*/public static void exportTemplateMultiSheet(List<Map<String, Object>> data, String filename, String templatePath, HttpServletResponse response) {try {resetResponse(filename, response);ServletOutputStream os = response.getOutputStream();exportTemplateMultiSheet(data, templatePath, os);} catch (IOException e) {throw new RuntimeException("導出Excel異常");}}/*** 多表多數據模板導出 模板格式為 {key.屬性}** @param templatePath 模板路徑 resource 目錄下的路徑包括模板文件名*                     例如: excel/temp.xlsx*                     重點: 模板文件必須放置到啟動類對應的 resource 目錄下* @param data         模板需要的數據* @param os           輸出流*/public static void exportTemplateMultiList(Map<String, Object> data, String templatePath, OutputStream os) {ClassPathResource templateResource = new ClassPathResource(templatePath);ExcelWriter excelWriter = EasyExcel.write(os).withTemplate(templateResource.getStream()).autoCloseStream(false)// 大數值自動轉換 防止失真.registerConverter(new ExcelBigNumberConvert()).build();WriteSheet writeSheet = EasyExcel.writerSheet().build();if (CollUtil.isEmpty(data)) {throw new IllegalArgumentException("數據為空");}for (Map.Entry<String, Object> map : data.entrySet()) {// 設置列表后續還有數據FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();if (map.getValue() instanceof Collection) {// 多表導出必須使用 FillWrapperexcelWriter.fill(new FillWrapper(map.getKey(), (Collection<?>) map.getValue()), fillConfig, writeSheet);} else {excelWriter.fill(map.getValue(), writeSheet);}}excelWriter.finish();}/*** 多sheet模板導出 模板格式為 {key.屬性}** @param templatePath 模板路徑 resource 目錄下的路徑包括模板文件名*                     例如: excel/temp.xlsx*                     重點: 模板文件必須放置到啟動類對應的 resource 目錄下* @param data         模板需要的數據* @param os           輸出流*/public static void exportTemplateMultiSheet(List<Map<String, Object>> data, String templatePath, OutputStream os) {ClassPathResource templateResource = new ClassPathResource(templatePath);ExcelWriter excelWriter = EasyExcel.write(os).withTemplate(templateResource.getStream()).autoCloseStream(false)// 大數值自動轉換 防止失真.registerConverter(new ExcelBigNumberConvert()).build();if (CollUtil.isEmpty(data)) {throw new IllegalArgumentException("數據為空");}for (int i = 0; i < data.size(); i++) {WriteSheet writeSheet = EasyExcel.writerSheet(i).build();for (Map.Entry<String, Object> map : data.get(i).entrySet()) {// 設置列表后續還有數據FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();if (map.getValue() instanceof Collection) {// 多表導出必須使用 FillWrapperexcelWriter.fill(new FillWrapper(map.getKey(), (Collection<?>) map.getValue()), fillConfig, writeSheet);} else {excelWriter.fill(map.getValue(), writeSheet);}}}excelWriter.finish();}/*** 重置響應體*/static void resetResponse(String sheetName, HttpServletResponse response) throws UnsupportedEncodingException {String filename = encodingFilename(sheetName);FileUtils.setAttachmentResponseHeader(response, filename);response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");}/*** 解析導出值 0=男,1=女,2=未知** @param propertyValue 參數值* @param converterExp  翻譯注解* @param separator     分隔符* @return 解析后值*/public static String convertByExp(String propertyValue, String converterExp, String separator) {StringBuilder propertyString = new StringBuilder();String[] convertSource = converterExp.split(StringUtils.SEPARATOR);for (String item : convertSource) {String[] itemArray = item.split("=");if (StringUtils.containsAny(propertyValue, separator)) {for (String value : propertyValue.split(separator)) {if (itemArray[0].equals(value)) {propertyString.append(itemArray[1] + separator);break;}}} else {if (itemArray[0].equals(propertyValue)) {return itemArray[1];}}}return StringUtils.stripEnd(propertyString.toString(), separator);}/*** 反向解析值 男=0,女=1,未知=2** @param propertyValue 參數值* @param converterExp  翻譯注解* @param separator     分隔符* @return 解析后值*/public static String reverseByExp(String propertyValue, String converterExp, String separator) {StringBuilder propertyString = new StringBuilder();String[] convertSource = converterExp.split(StringUtils.SEPARATOR);for (String item : convertSource) {String[] itemArray = item.split("=");if (StringUtils.containsAny(propertyValue, separator)) {for (String value : propertyValue.split(separator)) {if (itemArray[1].equals(value)) {propertyString.append(itemArray[0] + separator);break;}}} else {if (itemArray[1].equals(propertyValue)) {return itemArray[0];}}}return StringUtils.stripEnd(propertyString.toString(), separator);}/*** 編碼文件名*/public static String encodingFilename(String filename) {return IdUtil.fastSimpleUUID() + "_" + filename + ".xlsx";}//配置字體,表頭背景等private static HorizontalCellStyleStrategy setConfigure() {// 頭的策略WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//        // 背景色
//        headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
//        WriteFont headWriteFont = new WriteFont();
//        headWriteFont.setFontHeightInPoints((short) 10);
//        headWriteCellStyle.setWriteFont(headWriteFont);// 內容的策略WriteCellStyle contentWriteCellStyle = new WriteCellStyle();contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);contentWriteCellStyle.setWrapped(true);contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);contentWriteCellStyle.setBorderTop(BorderStyle.THIN);contentWriteCellStyle.setBorderRight(BorderStyle.THIN);contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//設置// 這個策略是 頭是頭的樣式 內容是內容的樣式 其他的策略可以自己實現return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);}
}

選擇工具類ExcelUtils導出

注解:

結果:

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/73300.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/73300.shtml
英文地址,請注明出處:http://en.pswp.cn/web/73300.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

flowable適配達夢7 (2.1)

經過第一版的問題解決&#xff0c;后端項目可以啟動&#xff0c;前端頁面也集成進去。 前端在流程設計頁面報錯 之后發現主要是組件中modelerStore這個值沒有 解決方法:在data增加對象 給component/process/designer.vue 中涉及到的每個子組件傳入 :modelerStore“modeler…

Prometheus Exporter系列-Mysql_Exporter一鍵部署

新項目舊項目都需要給研發配置mysql監控&#xff0c;這里mysql監控對應aws 阿里云 騰訊云 華為云的云mysql產品或開源自建mysql。 exporter安裝雖然簡單&#xff0c;經常手動操作不免讓人心煩&#xff0c;一鍵完成省去繁瑣的常規操作。 配置信息對的情況下測試多次都可以正常安…

2025年移動端開發性能優化實踐與趨勢分析

啟動速度優化 本質&#xff1a;縮短首次可見幀渲染時間。 方法&#xff1a; iOS&#xff1a;利用Core ML本地模型輕量化部署&#xff0c;減少云端等待。Android&#xff1a;強制啟用SplashScreen API&#xff0c;通過setKeepOnScreenCondition控制動畫時長。冷啟動需將耗時操…

【MySQL篇】DEPENDENT SUBQUERY(依賴性子查詢)優化:從百秒到秒級響應的四種優化辦法

&#x1f4ab;《博主介紹》&#xff1a;?又是一天沒白過&#xff0c;我是奈斯&#xff0c;從事IT領域? &#x1f4ab;《擅長領域》&#xff1a;??擅長阿里云AnalyticDB for MySQL(分布式數據倉庫)、Oracle、MySQL、Linux、prometheus監控&#xff1b;并對SQLserver、NoSQL(…

全文 - MLIR Toy Tutorial Chapter 1: Toy Language and AST

Toy 語言 本教程&#xff0c;將會借助一個玩具語言來講解&#xff0c;這個語言我們稱其為 Toy。Toy 是一個基于張量的語言&#xff0c;它允許你定義函數&#xff0c;執行一些數學計算&#xff0c;并且打印結果。做這樣的設定&#xff0c;是因為我們希望讓教程保持簡明&#xff…

排序復習_代碼純享

頭文件 #pragma once #include<iostream> #include<vector> #include<utility> using std::vector; using std::cout; using std::cin; using std::endl; using std::swap;//插入排序 //1、直接插入排序&#xff08;穩定&#xff09; void InsertSort(vecto…

CSS語言的雙向鏈表

CSS語言的雙向鏈表 引言 在計算機科學中&#xff0c;數據結構是一個極為重要的概念&#xff0c;而鏈表則是最常見的數據結構之一。鏈表可以分為單向鏈表和雙向鏈表&#xff0c;其中雙向鏈表因其靈活性和高效性而受到廣泛應用。在前端開發的領域&#xff0c;尤其是CSS&#xf…

簡單理解機器學習中top_k、top_p、temperature三個參數的作用

AI系列文章&#xff1a; AWS AI認證考試中經常提及幾個重要的工具介紹 簡單理解機器學習中top_k、top_p、temperature三個參數的作用 用Deepseek Kimi 快速生成高質量的ppt 在機器學習中&#xff0c;top_k、top_p 和 temperature 是用于控制生成模型&#xff08;如語言模型…

紅寶書第十三講:詳解JavaScript核心對象:Array、Object、Date、RegExp

紅寶書第十三講&#xff1a;詳解JavaScript核心對象&#xff1a;Array、Object、Date、RegExp 資料取自《JavaScript高級程序設計&#xff08;第5版&#xff09;》。 查看總目錄&#xff1a;紅寶書學習大綱 一、Object&#xff1a;萬物皆對象的“盒子” Object是JavaScript中…

昆侖技術重構AI大模型落地范式,長期作“加法”迎來國產生態化“拐點”

作者 | 曾響鈴 文 | 響鈴說 DeepSeek的爆火&#xff0c;在業內迅速掀起了一場國產化的變革。“國產大模型國產算力”軟硬協同的范式正在被重構&#xff0c;AI產業國產化的含金量持續提升&#xff0c;越來越多的企業在這一趨勢下加速走上數智化轉型路徑。 其中&#xff0c;以…

原開源鴻蒙倉庫停止更新

2月24日&#xff0c;gitee 上的開源鴻蒙組織&#xff0c;所有代碼停止更新&#xff0c;查看代碼倉顯示已關閉&#xff0c;不少小伙伴以為停止更新了&#xff0c;發生了什么&#xff1f; 原因很簡單&#xff0c;所有代碼倉遷移至 Gitcode&#xff0c;至于為什么改用 Gitcode&…

Spring Boot框架中常用注解

以下是Spring Boot框架中常用注解的詳細說明&#xff0c;包括名稱、用途、用法、使用位置及擴展示例&#xff0c;按功能模塊分類整理&#xff1a; 一、核心啟動與配置注解 1. SpringBootApplication 用途&#xff1a;主啟動類注解&#xff0c;整合了 Configuration、EnableAu…

Azure Delta Lake、Databricks和Event Hubs實現實時欺詐檢測

設計Azure云架構方案實現Azure Delta Lake和Azure Databricks&#xff0c;結合 Azure Event Hubs/Kafka 攝入實時數據&#xff0c;通過 Delta Lake 實現 Exactly-Once 語義&#xff0c;實時欺詐檢測&#xff08;流數據寫入 Delta Lake&#xff0c;批處理模型實時更新&#xff0…

車載以太網網絡測試 -23【TCPUDP通信示例】

1 摘要 在車載通信場景中&#xff0c;TCP以及UDP的通信可以用于多種應用&#xff0c;例如車輛狀態監控、遠程控制、數據采集等。以下是詳細的代碼示例&#xff0c;展示了如何使用Python實現簡單的TCP客戶端與服務端通信以及簡單的UDP客戶端與服務端通信&#xff0c;并模擬了車…

SpringBoot大學生競賽管理系統設計與實現

一個用于管理大學生競賽報名、信息查詢與競賽管理的系統&#xff0c;采用了現代化的SpringBoot框架進行開發。該系統的主要功能包括學生信息管理、教師信息管理、競賽報名審核、競賽信息管理等模塊&#xff0c;適用于學校或教育機構進行競賽活動的組織與管理。系統界面簡潔&…

深入解析libsunrpc:構建分布式系統的核心RPC庫

深入解析libsunrpc&#xff1a;構建分布式系統的核心RPC庫 引言 在分布式系統開發中&#xff0c;遠程過程調用&#xff08;Remote Procedure Call, RPC&#xff09; 是連接不同節點、實現跨網絡服務調用的關鍵技術。作為SUN公司開源的經典RPC實現&#xff0c;libsunrpc 憑借其…

MinIO搭建部署

1、命令行安裝 訪問monio官網下載應用程序 # wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio-20250228095516.0.0-1.x86_64.rpm -O minio.rpm # sudo dnf install minio.rpm # mkdir ~/minio # minio server ~/minio --console-address :90012、dock…

Linux修改SSH端口號

我這里那RedHat系列的操作系統舉例,修改SSH端口號 修改SSH配置文件:/etc/ssh/sshd_config,將端口號修改為2222.vim /etc/ssh/sshd_config重啟SSH服務systemctl restart sshd# 如果是比較舊的OS,使用下面的命令重啟 service ssh restart驗證端口更改是否成功netstat -tulnp …

【嵌入式Linux】基于ArmLinux的智能垃圾分類系統項目

目錄 1. 功能需求2. Python基礎2.1 特點2.2 Python基礎知識2.3 dict嵌套簡單說明 3. C語言調用Python3.1 搭建編譯環境3.2 直接調用python語句3.3 調用無參python函數3.4 調用有參python函數 4. 阿里云垃圾識別方案4.1 接入阿里云4.2 C語言調用阿里云Python接口 5. 香橙派使用攝…

【商城實戰(63)】配送區域與運費設置全解析

【商城實戰】專欄重磅來襲&#xff01;這是一份專為開發者與電商從業者打造的超詳細指南。從項目基礎搭建&#xff0c;運用 uniapp、Element Plus、SpringBoot 搭建商城框架&#xff0c;到用戶、商品、訂單等核心模塊開發&#xff0c;再到性能優化、安全加固、多端適配&#xf…