easyExcel自定义导出,指定列,设置请求头背景色,加入合计行,设置合计行字体,背景色等等

news2024/9/29 13:27:27

效果图

1.引入easyExcel pom

        <dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>easyexcel</artifactId>
			<version>3.3.1</version>
		</dependency>

2.工具类-自定义样式handler-CustomCellWriteHandler



import java.util.HashMap;

import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;

import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.util.BooleanUtils;
import com.alibaba.excel.write.handler.AbstractCellWriteHandler;
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
/**
 * easyexcel自定义行列样式
 * 表头背景色,合计行背景色-字体颜色,
 * @author cf
 *
 * @date 2023-11-28 11:18:23
 */
public class CustomCellWriteHandler extends AbstractCellWriteHandler {

	// 字体颜色
	private Short colorIndex;
	// 背景颜色
	private Short bgColorIndex;
	// 行,以及对应的列,多个列逗号拼接,全列,-1
	private HashMap<Integer, String> rowColMap;

	/**
	 * 
	 * @param bgColorIndex -1 不设置
	 * @param colorIndex   -1 不设置
	 * @param rowColMap    value = -1,整行
	 */
	public CustomCellWriteHandler(Short bgColorIndex, Short colorIndex, HashMap<Integer, String> rowColMap) {
		this.colorIndex = colorIndex;
		this.bgColorIndex = bgColorIndex;
		this.rowColMap = rowColMap;
	}

	@Override
	public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row,
			Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead) {
		// 设置行高
		int rowIndex = row.getRowNum();
		System.out.println("当前行: " + rowIndex);
		short height = 600;
		row.setHeight(height);
	}

	@Override
	public void afterCellDispose(CellWriteHandlerContext context) {
		Cell cell = context.getCell();
		int rowIndex = cell.getRowIndex();
		int cellIndex = cell.getColumnIndex();

		// 自定义宽度处理

		// 自定义样式处理
		// 当前事件会在 数据设置到poi的cell里面才会回调
		// 判断不是头的情况 如果是fill 的情况 这里会==null 所以用not true
		Boolean head = context.getHead();
		if (BooleanUtils.isNotTrue(head)) {

			// 指定行 列设置背景色
			if (null != rowColMap && rowColMap.get(rowIndex) != null && !rowColMap.get(rowIndex).equals("-1")
					&& rowColMap.get(rowIndex).contains(cellIndex + "")) {
				setCellStyle(context, cell);
				// 某几行设置背景色
			} else if (null != rowColMap && rowColMap.get(rowIndex) != null && rowColMap.get(rowIndex).equals("-1")) {
				setCellStyle(context, cell);
			}
//            if (cell.getColumnIndex() == 8 && cell.getStringCellValue().contains("已通过")) {
//                // 拿到poi的workbook
//                Workbook workbook = context.getWriteWorkbookHolder().getWorkbook();
//                // 这里千万记住 想办法能复用的地方把他缓存起来 一个表格最多创建6W个样式
//                // 不同单元格尽量传同一个 cellStyle
//                CellStyle cellStyle = workbook.createCellStyle();
//                cellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex());
//                // 这里需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND
//                cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
//                cell.setCellStyle(cellStyle);
//                // 由于这里没有指定dataformat 最后展示的数据 格式可能会不太正确
//                // 这里要把 WriteCellData的样式清空, 不然后面还有一个拦截器 FillStyleCellWriteHandler 默认会将 WriteCellStyle 设置到
//                // cell里面去 会导致自己设置的不一样(很关键)
//                context.getFirstCellData().setWriteCellStyle(null);
//            } 
		} else {
			// 表头

		}
	}

	private void setCellStyle(CellWriteHandlerContext context, Cell cell) {
		Workbook workbook = context.getWriteWorkbookHolder().getWorkbook();
		Font font = workbook.createFont();
		font.setFontName("宋体");
		font.setBold(true);
		if (colorIndex >= 0) {
			font.setColor(colorIndex);
		}
//		font.setFontHeightInPoints((short)11);
		CellStyle cellStyle = workbook.createCellStyle();
		cellStyle.setFillForegroundColor(bgColorIndex);
		if (bgColorIndex >= 0) {
			cellStyle.setFillForegroundColor(bgColorIndex);
		}
		// 这里需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND
		cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		cellStyle.setFont(font);
		cellStyle.setAlignment(HorizontalAlignment.CENTER);
		cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
		cellStyle.setBorderBottom(BorderStyle.MEDIUM);
		cellStyle.setBorderLeft(BorderStyle.MEDIUM);
		cellStyle.setBorderRight(BorderStyle.MEDIUM);
		cellStyle.setBorderTop(BorderStyle.MEDIUM);

		// 样式写入单元格
		cell.setCellStyle(cellStyle);

		// 由于这里没有指定dataformat 最后展示的数据 格式可能会不太正确
		// 这里要把 WriteCellData的样式清空, 不然后面还有一个拦截器 FillStyleCellWriteHandler 默认会将
		// WriteCellStyle 设置到
		// cell里面去 会导致自己设置的不一样
		context.getFirstCellData().setWriteCellStyle(null);
	}

	/**
	 * 表头背景色等设置
	 * 
	 * @return
	 */
	public static HorizontalCellStyleStrategy getStyleStrategy() {

		// 头的策略
		WriteCellStyle headWriteCellStyle = new WriteCellStyle();
		// 设置对齐
		// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
		// 背景色, 设置为绿色,也是默认颜色
		headWriteCellStyle.setFillForegroundColor(IndexedColors.CORNFLOWER_BLUE.getIndex());
		// 字体
		// WriteFont headWriteFont = new WriteFont();
		// headWriteFont.setFontHeightInPoints((short) 12);
		// headWriteCellStyle.setWriteFont(headWriteFont);

		// 内容的策略
		WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
		// 这里需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND 不然无法显示背景颜色.头默认了
		// FillPatternType所以可以不指定
		// contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
		contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
		// 背景绿色
		contentWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE1.getIndex());

		// 字体策略
		WriteFont contentWriteFont = new WriteFont();
		// contentWriteFont.setFontHeightInPoints((short) 12);
		contentWriteCellStyle.setWriteFont(contentWriteFont);
		// 设置 自动换行
		contentWriteCellStyle.setWrapped(true);
		// 设置 垂直居中
		contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
		// 设置 水平居中
		contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
		// 设置边框样式
		contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
		contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
		contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
		contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);

		// 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现
		HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,
				contentWriteCellStyle);
		return horizontalCellStyleStrategy;
	}
}

3.工具类-导出  ExcelUtils

package com.yintong.xgj.common.util.excel;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.springframework.beans.BeanUtils;
import org.springframework.web.multipart.MultipartFile;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.fill.FillWrapper;


/**
 * excel工具类
 *
 */
public class ExcelUtils {

	/**
	 * Excel导出
	 *
	 * @param response  response
	 * @param fileName  文件名
	 * @param sheetName sheetName
	 * @param list      数据List
	 * @param pojoClass 对象Class
	 * @param columns   自定义列表
	 */
	public static void exportExcel(HttpServletResponse response, String fileName, String sheetName, List<?> list,
			Class<?> pojoClass, Set<String> columns) throws IOException {
		if (StringUtils.isBlank(fileName)) {
			// 当前日期
			fileName = DateUtils.format(new Date());
		}

		response.setContentType("application/vnd.ms-excel");
		response.setCharacterEncoding("UTF-8");
		fileName = URLEncoder.encode(fileName, "UTF-8");
		response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
		// 写入合计行样式;默认表头只有一行
//        TotalRowHandler totalRowHandler = new TotalRowHandler(list.size());
		// 指定行列
		HashMap<Integer, String> rowColMap = new HashMap<>();
//        rowColMap.put(1,"1,2");
//        rowColMap.put(2,"2");
		rowColMap.put(list.size(), "-1");// 合计行,最后一行设置颜色
		CustomCellWriteHandler totalRowHandler = new CustomCellWriteHandler((short) -1, IndexedColors.RED.index,
				rowColMap);
		if (columns != null && columns.size() > 0) {// 自定义列
			EasyExcel.write(response.getOutputStream(), pojoClass).includeColumnFieldNames(columns)
					.registerWriteHandler(CustomCellWriteHandler.getStyleStrategy())
					.registerWriteHandler(totalRowHandler).sheet(sheetName).doWrite(list);
		} else {
			EasyExcel.write(response.getOutputStream(), pojoClass)
					.registerWriteHandler(CustomCellWriteHandler.getStyleStrategy())
					.registerWriteHandler(totalRowHandler).sheet(sheetName).doWrite(list);
		}

	}

	/**
	 * Excel导出,先sourceList转换成List<targetClass>,再导出
	 *
	 * @param response    response
	 * @param fileName    文件名
	 * @param sheetName   sheetName
	 * @param sourceList  原数据List
	 * @param targetClass 目标对象Class
	 */
	public static void exportExcelToTarget(HttpServletResponse response, String fileName, String sheetName,
			List<?> sourceList, Class<?> targetClass, Set<String> columns) throws Exception {
		List<Object> targetList = new ArrayList<Object>(sourceList.size());
		for (Object source : sourceList) {
			Object target = targetClass.newInstance();
			BeanUtils.copyProperties(source, target);
			targetList.add(target);
		}
		exportExcel(response, fileName, sheetName, targetList, targetClass, columns);
	}

	/**
	 * 导入
	 * 
	 * @param file
	 * @param targetClass
	 * @return
	 * @throws Exception
	 */
	public static List<Object> importExcelToTarget(MultipartFile file, Class<?> targetClass) throws Exception {
		List<Object> list = EasyExcel.read(file.getInputStream()).head(targetClass).sheet().doReadSync();
		return list;
	}

}

4.demo

实体

import java.math.BigDecimal;
import java.util.Date;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.yintong.xgj.entity.enums.TypeStateConvert;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(value = "采购入库导出", description = "")
@HeadStyle(fillBackgroundColor = 24)
public class GoodsInExcel {

	@ApiModelProperty(value = "工单号")
	@ExcelProperty(value = "工单号")
	private String orderNo;
	@ApiModelProperty(value = "时间" )
	@ExcelProperty(value = "时间" )
	@ColumnWidth(20)
	@DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
	private Date actionTime;
	@ApiModelProperty(value = "单据类型")
	@ExcelProperty(value = "单据类型" ,converter = TypeStateConvert.class)
	@ColumnWidth(15)
    private Integer typeState;
	@ApiModelProperty(value = "配件编码")
	@ExcelProperty(value = "配件编码")
	@ColumnWidth(15)
	private String postionNumber;
	@ApiModelProperty(value = "配件名称")
	@ExcelProperty(value = "配件名称")
	@ColumnWidth(15)
	private String gname;
	@ApiModelProperty(value = "规格")
	@ExcelProperty(value = "规格")
	private String spec;
	@ApiModelProperty(value = "单位")
	@ExcelProperty(value = "单位")
	private String unit;
	@ApiModelProperty(value = "数量")
	@ExcelProperty(value = "数量")
	private BigDecimal numbers;
	@ApiModelProperty(value = "单价")
	@ExcelProperty(value = "单价")
	private BigDecimal cost;
	@ApiModelProperty(value = "金额")
	@ExcelProperty(value = "金额")
	private BigDecimal price;
	@ApiModelProperty(value = "供应商")
	@ExcelProperty(value = "供应商")
	private String ftname;
	@ApiModelProperty(value = "采购人")
	@ExcelProperty(value = "采购人")
	private String acUserName;
	@ApiModelProperty(value = "备注")
	@ExcelProperty(value = "备注")
	@ColumnWidth(30)
	private String des;
	public GoodsInExcel() {
	};
}

接口

    @ApiOperation(value = "导出",response = GoodsInExcel.class)
	@GetMapping("inPageExport")
	@Permit(permit = "inPageExport")
	public void inPageExport(HttpServletResponse response,GoodsRecordQuery data,String columns) throws Exception {
        //查询数据
		List<Object> list = recordsService.exportList(data);
        //设置自定义导出列
		Set<String> hashSet = new HashSet<>();
		if (columns != null) {
			hashSet.addAll(Arrays.asList(columns.split(",")));
		}
        //获取或者计算合计行数据
		BigDecimal reduce = list.stream().map(gr ->{return gr.getNumbers();}).reduce(BigDecimal.ZERO, BigDecimal::add);
		BigDecimal reduce1 = list.stream().map(gr ->{return gr.getPrice();}).reduce(BigDecimal.ZERO, BigDecimal::add);
		GoodsRecord hj = new GoodsRecord();
		hj.setPrice(reduce1);
		hj.setNumbers(reduce);
		hj.setOrderNo("合计");
        //加入到导出数据最后一行
		list.add(hj);
        //调用工具类导出接口
		ExcelUtils.exportExcelToTarget(response, "明细表", "明细", list, GoodsInExcel.class,hashSet);
	}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1262003.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

skywalking告警UI界面有告警信息,webhook接口没有回调,400错误

400错误就是回调接口返回数据的属性对应不上 PostMapping(“/webhook”) public void webhook(RequestBody List alarmMessageList) 自定义的实体类AlarmMessage有问题 只能去官网找了 告警实体类官网 Getter EqualsAndHashCode RequiredArgsConstructor NoArgsConstructor(fo…

数据库基础入门 — 关联查询

我是南城余&#xff01;阿里云开发者平台专家博士证书获得者&#xff01; 欢迎关注我的博客&#xff01;一同成长&#xff01; 一名从事运维开发的worker&#xff0c;记录分享学习。 专注于AI&#xff0c;运维开发&#xff0c;windows Linux 系统领域的分享&#xff01; 本…

GAN:DCGAN-深度卷积生成对抗网络

论文&#xff1a;https://arxiv.org/pdf/1511.06434.pdf 发表&#xff1a;ICLR 2016 一、架构创新 1&#xff1a;全卷积网络&#xff1a;用逐步卷积代替确定性的空间池化函数&#xff08;如maxpooling&#xff09;&#xff0c;使网络学习自己的空间下采样。使用这种方法&#…

京东大数据(京东运营数据采集):2023年10月京东牛奶乳品行业品牌销售排行榜

鲸参谋监测的京东平台10月份牛奶乳品市场销售数据已出炉&#xff01; 10月份&#xff0c;牛奶乳品整体销售上涨。鲸参谋数据显示&#xff0c;今年10月&#xff0c;京东平台上牛奶乳品的销量将近1700万&#xff0c;同比增长1%&#xff1b;销售额将近17亿&#xff0c;同比增长约5…

双通道 12V 直流电机驱动芯片GC8548,可替代LV8548/LV8549/ONSEMI,内置 LDO,不需要逻辑电源,输入 兼容 3.3V 与 5V

GC8548 是一款双通道 12V 直流电机驱动芯 片&#xff0c;为摄像机、消费类产品、玩具和其他低压或 者电池供电的运动控制类应用提供了集成的电机 驱动解决方案。芯片一般用来驱动两个直流电机 或者驱动一个步进电机。 它可以工作在 3.8~12V 的电源电压上&#xff0c; 每通道能提…

如何通过内网穿透实现公网远程ssh连接kali系统

文章目录 1. 启动kali ssh 服务2. kali 安装cpolar 内网穿透3. 配置kali ssh公网地址4. 远程连接5. 固定连接SSH公网地址6. SSH固定地址连接测试 简单几步通过[cpolar 内网穿透](cpolar官网-安全的内网穿透工具 | 无需公网ip | 远程访问 | 搭建网站)软件实现ssh远程连接kali 1…

中小型公司如何搭建运维平台,rancher、kubersphere、rainbond

很多开发人员应该是了解过运维发布相关的平台或实际操作过应用发布&#xff0c;但又通常不是十分熟悉。在一个初创公司&#xff0c;或者没有成熟的运维发布平台的公司&#xff0c;如果让你来搭建一套发布平台&#xff0c;你应该如何去抉择呢&#xff1f; 这里我简单介绍几种。…

“大型”基础模型中幻觉的调查

Abstract 基础模型 (FM) 中的幻觉是指生成偏离事实或包含捏造信息的内容。这篇调查论文广泛概述了近期旨在识别、阐明和解决幻觉问题的努力&#xff0c;特别关注“大型”基础模型&#xff08;LFM&#xff09;。该论文对LFM特有的各种类型的幻觉现象进行了分类&#xff0c;并建…

Mybatis 源码搭建

文章目录 源码下载测试模块搭建学习博客 源码下载 首先下载mybatis-parent的源码&#xff1a;gitee地址 > https://gitee.com/callback_lab/mybatis-parent.git 然后下载mybatis的源码&#xff1a;gitee地址 > https://gitee.com/callback_lab/mybatis-src.git 带中文…

pandas(八)--实战一下

背景 收到一批数据&#xff0c;数据形式。采集数据的间隔时间是10分钟&#xff0c;全天采集数据&#xff0c;每天的数据量是144条 处理后的数据形式 分析 去除表格中的q的异常值&#xff0c;置为0去除重复行将原始表格中的date分裂成日期和时间缺失的时间点数据补0&#x…

最新的外贸自建站教程?做外贸如何建网站?

外贸自建站教程步骤有哪些&#xff1f;海洋建站如何做网站搭建&#xff1f; 想要了解关于外贸自建站的最新教程吗&#xff1f;外贸自建站不再是高不可攀的难题&#xff0c;相反&#xff0c;它为企业提供了更多的机会和自主掌握业务的空间。海洋建站将为您提供一份全面的指南&a…

山寨Stream API设计分析

作者简介&#xff1a;大家好&#xff0c;我是smart哥&#xff0c;前中兴通讯、美团架构师&#xff0c;现某互联网公司CTO 联系qq&#xff1a;184480602&#xff0c;加我进群&#xff0c;大家一起学习&#xff0c;一起进步&#xff0c;一起对抗互联网寒冬 私以为&#xff0c;Jav…

多类场景、遍布各地,融云 IM 支撑多款应用全球增长

&#xff08;全网都在找的《社交泛娱乐出海作战地图》&#xff0c;点击获取&#x1f446;&#xff09; 无论是面向企业场景的工作流协同还是消费场景的网络效应形成&#xff0c;商务社交还是陌生人社交&#xff0c;IM 都是必备组件。IM 遍布互联网各角落&#xff0c;出现在所有…

超声波雪深监测站冬季雪景的智能守护者

随着冬季的到来&#xff0c;白雪皑皑的景象让人感到无比美丽。然而&#xff0c;雪景的美丽却给人们的生活和出行带来了一定的困扰。雪的深度和分布是影响道路交通、公共安全和旅游体验的关键因素。为了解决这一问题&#xff0c;WX-XS1 超声波雪深监测站在冬季应运而生&#xff…

Nvidia VPI 双目相机生成深度图

nVidia VPI&#xff08;Vision Programming Interface&#xff09;提供了多种后端&#xff0c;用于执行图像处理和计算机视觉操作。不同的后端针对不同的硬件和用例进行了优化。这些后端包括&#xff1a; 1. CPU: 这是最通用的后端&#xff0c;它运行在标准的中央处理器&#…

【2023CANN训练营第二季】——Ascend C自定义算子工程介绍及实验

一、自定义算子工程介绍与创建 自定义算子工程是一个包含用户编写的host侧和kerne|侧算子实现文件的&#xff0c;用于编译和安装自定义算子run包的工程框架。 CANN软件包中提供了工程创建工具msopgen&#xff0c;开发者可以输入算子原型定义文件生成Ascend C算子开发工程。 需…

AMP State Evolution的计算:以伯努利先验为例

AMP State Evolution (SE)的计算 t 1 t1 t1时&#xff0c; E ( t ) E [ X 2 ] \mathcal E^{(t)} \mathbb E [X^2] E(t)E[X2]&#xff0c;SE的迭代式为 τ r ( t ) σ 2 1 δ E ( t ) E ( t 1 ) E ∣ η ( t ) ( X Z ) − X ∣ 2 , Z ∼ N ( 0 , τ r ( t ) ) \begin{a…

盘点72个Android系统源码安卓爱好者不容错过

盘点72个Android系统源码安卓爱好者不容错过 学习知识费力气&#xff0c;收集整理更不易。 知识付费甚欢喜&#xff0c;为咱码农谋福利。 链接&#xff1a;https://pan.baidu.com/s/1qiWeLjF2i4dlgmTYgPPSvw?pwd8888 提取码&#xff1a;8888 项目名称 A keyboardlisten…

AIGC系列之:升级版的Stable Diffusion之SDXL介绍

目录 AIGC工具对比 DALL-E MidJourney Stable Diffusion 相关资料 SDXL介绍 SDXL生图效果 SDXL训练LoRA流程 AIGC工具对比 在目前的三大新兴文本转图像模型中&#xff0c;Stable Diffusion诞生得最晚&#xff0c;但由于拥有发展良好的开源社区&#xff0c;它的用户关注…

Linux系统安装Docker-根据官方教程教程(以Ubuntu为例)

Linux系统安装Docker-根据官方教程教程&#xff08;以Ubuntu为例&#xff09; 1. 背景介绍2. 环境配置2.1 软件环境要求2.2 软件下载2.3 文档地址2.3 必备命令工具下载 3. 安装Docker3.1 使用root用户操作后续命令3.2 卸载可能存在的旧版本 4. 安装Docker4.1 更新依赖包4.4 配置…