EasyExcel设置表头上面的那种大标题(前端传递来的大标题)

1、首先得先引用easyExcel的版本依赖,我那

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

2、然后得弄直接的实体类,(这个实体类是关键,主要的功能就是为了导出的表头还有大标题做准备)

解释:   @ExcelProperty(value ={"${bigHead}","区划名称"},index = 0) 

这个主要 ${bigHead} 这个是 大标题 ,这个标题是动态生成的,

package com.inspur.grp.hrss.labour.project.labourReport;import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.inspur.grp.hrss.labour.framework.base.BaseDomain;
import lombok.EqualsAndHashCode;/*** 每日更新统计记录(这个是是抽取出来的)对象 labour_day_updatetime**/
@EqualsAndHashCode
public class LabourDayUpdatetime extends BaseDomain {/** 主键 */@ExcelIgnoreprivate String id;@ExcelProperty(value ={"${bigHead}","区划名称"},index = 0)private String mc;/** 区的编码 */@ExcelIgnoreprivate String area;/** 镇的编码 */@ExcelIgnoreprivate String town;/** 村的编码 */@ExcelIgnoreprivate String community;/** 就业去向 */@ExcelIgnoreprivate String employDestination;/** 人员类别 */@ExcelIgnoreprivate String category;/** 是否就业 */@ExcelIgnoreprivate String isEmployed;/** 农村劳动力人数 */@ExcelProperty(value ={"${bigHead}","农村劳动力人数"},index = 1)private String ncldlrs;/** 更新人数 */@ExcelProperty(value ={"${bigHead}","农村劳动力更新人数"},index = 2)private String gxrsa;@ExcelProperty(value ={"${bigHead}","更新率"},index = 3)private String gxla;/** 就业人数 */@ExcelProperty(value ={"${bigHead}","就业人数"},index = 4)private String jyrsa;@ExcelProperty(value ={"${bigHead}","国外务工(劳动力)"},index = 5)private String guowaiwug;@ExcelProperty(value ={"${bigHead}","省外务工(劳动力)"},index = 6)private String shengwai;@ExcelProperty(value ={"${bigHead}","省外市内务工(劳动力)"},index = 7)private String shiwaishengnei;@ExcelProperty(value ={"${bigHead}","县外市内务工(劳动力)"},index = 8)private String xianwaishinwug;@ExcelProperty(value ={"${bigHead}","乡(镇)外县内务工(劳动力)"},index = 9)private String xiangzhenwaixianneiwug;@ExcelProperty(value ={"${bigHead}","乡(镇)内务工(劳动力)"},index = 10)private String xiangzhennwug;@ExcelProperty(value ={"${bigHead}","就业率(劳动力)"},index = 11)private String jyla;/** 脱贫劳动力人数 */@ExcelProperty(value ={"${bigHead}","脱贫劳动力人数"},index = 12)private String tpldlrs;@ExcelProperty(value ={"${bigHead}","更新人数(脱贫)"},index = 13)private String gxrsb;@ExcelProperty(value ={"${bigHead}","更新率(脱贫)"},index = 14)private String gxlb;@ExcelProperty(value ={"${bigHead}","就业人数(脱贫)"},index = 15)private String jyrsb;@ExcelProperty(value ={"${bigHead}","国外务工(脱贫)"},index = 16)private String tpguowaiwug;@ExcelProperty(value ={"${bigHead}","省外务工(脱贫)"},index = 17)private String tpshengwai;@ExcelProperty(value ={"${bigHead}","市外省内务工(脱贫)"},index = 18)private String tpshiwaishengnei;@ExcelProperty(value ={"${bigHead}","县外市内务工(脱贫)"},index = 19)private String tpxianwaishinwug;@ExcelProperty(value ={"${bigHead}","乡(镇)外县内务工(脱贫)"},index = 20)private String tpxiangzhenwaixianneiwug;@ExcelProperty(value ={"${bigHead}","乡(镇)内务工(脱贫)"},index = 21)private String tpxiangzhennwug;@ExcelProperty(value ={"${bigHead}","就业率(脱贫)"},index = 22)private String jylb;@ExcelProperty(value ={"${bigHead}","易迁劳动力人数"},index = 23)private String yqldlrs;@ExcelProperty(value ={"${bigHead}","更新人数(易迁)"},index = 24)private String gxrsc;@ExcelProperty(value ={"${bigHead}","更新率(易迁)"},index = 25)private String gxlc;@ExcelProperty(value ={"${bigHead}","就业人数(易迁)"},index = 26)private String jyrsc;@ExcelProperty(value ={"${bigHead}","国外务工(易迁)"},index = 27)private String yqguowaiwug;@ExcelProperty(value ={"${bigHead}","省外务工(易迁)"},index = 28)private String yqshengwai;@ExcelProperty(value ={"${bigHead}","市外省内(易迁)"},index = 29)private String yqshiwaishengnei;@ExcelProperty(value ={"${bigHead}","县外市内务工(易迁)"},index = 30)private String yqxianwaishinwug;@ExcelProperty(value ={"${bigHead}","乡(镇)外县内务工(易迁)"},index = 31)private String yqxiangzhenwaixianneiwug;@ExcelProperty(value ={"${bigHead}","乡(镇)内务工(易迁)"},index = 32)private String yqxiangzhennwug;@ExcelProperty(value ={"${bigHead}","就业率(易迁)"},index = 33)private String jylc;@ExcelProperty(value ={"${bigHead}","未更新的人数"},index = 34)private String xtzwgxdldlrs;public String getMc() {return mc;}public void setMc(String mc) {this.mc = mc;}public String getGxla() {return gxla;}public void setGxla(String gxla) {this.gxla = gxla;}public String getJyla() {return jyla;}public void setJyla(String jyla) {this.jyla = jyla;}public String getGxlb() {return gxlb;}public void setGxlb(String gxlb) {this.gxlb = gxlb;}public String getJylb() {return jylb;}public void setJylb(String jylb) {this.jylb = jylb;}public String getGxlc() {return gxlc;}public void setGxlc(String gxlc) {this.gxlc = gxlc;}public String getJylc() {return jylc;}public void setJylc(String jylc) {this.jylc = jylc;}public String getXtzwgxdldlrs() {return xtzwgxdldlrs;}public void setXtzwgxdldlrs(String xtzwgxdldlrs) {this.xtzwgxdldlrs = xtzwgxdldlrs;}public void setId(String id){this.id = id;}public String getId() {return id;}public void setArea(String area){this.area = area;}public String getArea() {return area;}public void setTown(String town) {this.town = town;}public String getTown() {return town;}public void setCommunity(String community) {this.community = community;}public String getCommunity() {return community;}public void setEmployDestination(String employDestination) {this.employDestination = employDestination;}public String getEmployDestination() {return employDestination;}public void setCategory(String category) {this.category = category;}public String getCategory() {return category;}public void setIsEmployed(String isEmployed) {this.isEmployed = isEmployed;}public String getIsEmployed() {return isEmployed;}public void setNcldlrs(String ncldlrs) {this.ncldlrs = ncldlrs;}public String getNcldlrs() {return ncldlrs;}public void setGxrsa(String gxrsa) {this.gxrsa = gxrsa;}public String getGxrsa() {return gxrsa;}public void setJyrsa(String jyrsa) {this.jyrsa = jyrsa;}public String getJyrsa() {return jyrsa;}public void setTpldlrs(String tpldlrs) {this.tpldlrs = tpldlrs;}public String getTpldlrs() {return tpldlrs;}public void setGxrsb(String gxrsb) {this.gxrsb = gxrsb;}public String getGxrsb() {return gxrsb;}public void setJyrsb(String jyrsb) {this.jyrsb = jyrsb;}public String getJyrsb() {return jyrsb;}public void setYqldlrs(String yqldlrs) {this.yqldlrs = yqldlrs;}public String getYqldlrs() {return yqldlrs;}public void setGxrsc(String gxrsc) {this.gxrsc = gxrsc;}public String getGxrsc() {return gxrsc;}public void setJyrsc(String jyrsc) {this.jyrsc = jyrsc;}public String getJyrsc() {return jyrsc;}public void setShengwai(String shengwai) {this.shengwai = shengwai;}public String getShengwai() {return shengwai;}public void setShiwaishengnei(String shiwaishengnei) {this.shiwaishengnei = shiwaishengnei;}public String getShiwaishengnei() {return shiwaishengnei;}public void setTpshengwai(String tpshengwai) {this.tpshengwai = tpshengwai;}public String getTpshengwai() {return tpshengwai;}public void setTpshiwaishengnei(String tpshiwaishengnei) {this.tpshiwaishengnei = tpshiwaishengnei;}public String getTpshiwaishengnei() {return tpshiwaishengnei;}public void setYqshengwai(String yqshengwai) {this.yqshengwai = yqshengwai;}public String getYqshengwai() {return yqshengwai;}public void setYqshiwaishengnei(String yqshiwaishengnei) {this.yqshiwaishengnei = yqshiwaishengnei;}public String getYqshiwaishengnei() {return yqshiwaishengnei;}public void setGuowaiwug(String guowaiwug) {this.guowaiwug = guowaiwug;}public String getGuowaiwug() {return guowaiwug;}public void setXianwaishinwug(String xianwaishinwug) {this.xianwaishinwug = xianwaishinwug;}public String getXianwaishinwug() {return xianwaishinwug;}public void setXiangzhennwug(String xiangzhennwug) {this.xiangzhennwug = xiangzhennwug;}public String getXiangzhennwug() {return xiangzhennwug;}public void setXiangzhenwaixianneiwug(String xiangzhenwaixianneiwug) {this.xiangzhenwaixianneiwug = xiangzhenwaixianneiwug;}public String getXiangzhenwaixianneiwug() {return xiangzhenwaixianneiwug;}public void setTpguowaiwug(String tpguowaiwug) {this.tpguowaiwug = tpguowaiwug;}public String getTpguowaiwug() {return tpguowaiwug;}public void setTpxianwaishinwug(String tpxianwaishinwug) {this.tpxianwaishinwug = tpxianwaishinwug;}public String getTpxianwaishinwug() {return tpxianwaishinwug;}public void setTpxiangzhennwug(String tpxiangzhennwug) {this.tpxiangzhennwug = tpxiangzhennwug;}public String getTpxiangzhennwug() {return tpxiangzhennwug;}public void setTpxiangzhenwaixianneiwug(String tpxiangzhenwaixianneiwug) {this.tpxiangzhenwaixianneiwug = tpxiangzhenwaixianneiwug;}public String getTpxiangzhenwaixianneiwug() {return tpxiangzhenwaixianneiwug;}public void setYqguowaiwug(String yqguowaiwug) {this.yqguowaiwug = yqguowaiwug;}public String getYqguowaiwug() {return yqguowaiwug;}public void setYqxianwaishinwug(String yqxianwaishinwug) {this.yqxianwaishinwug = yqxianwaishinwug;}public String getYqxianwaishinwug() {return yqxianwaishinwug;}public void setYqxiangzhennwug(String yqxiangzhennwug) {this.yqxiangzhennwug = yqxiangzhennwug;}public String getYqxiangzhennwug() {return yqxiangzhennwug;}public void setYqxiangzhenwaixianneiwug(String yqxiangzhenwaixianneiwug) {this.yqxiangzhenwaixianneiwug = yqxiangzhenwaixianneiwug;}public String getYqxiangzhenwaixianneiwug() {return yqxiangzhenwaixianneiwug;}}

3、然后定义一个接口接收的DTO类

package com.inspur.grp.hrss.labour.project.labourReport.dto;import com.inspur.grp.hrss.labour.project.labourReport.LabourDayUpdatetime;import java.util.List;public class ExportDataRequestDto {private List<LabourDayUpdatetime> labourDayUpdatetimeList;private String addressName; // 这个是前端传递的过了的标题名称// Getters and Setterspublic List<LabourDayUpdatetime> getLabourDayUpdatetimeList() {return labourDayUpdatetimeList;}public void setLabourDayUpdatetimeList(List<LabourDayUpdatetime> labourDayUpdatetimeList) {this.labourDayUpdatetimeList = labourDayUpdatetimeList;}public String getAddressName() {return addressName;}public void setAddressName(String addressName) {this.addressName = addressName;}
}

4、封装标题工具类

package com.inspur.grp.hrss.labour.util.IDCardUtils;import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.springframework.util.PropertyPlaceholderHelper;import java.util.List;
import java.util.Properties;public class ExcelTitleHandler implements CellWriteHandler {/**错误信息处理时正则表达式的格式*/private final String EXCEL_ERROR_REG = "^(.*)(\\(错误:)(.*)(\\))$";private String bigHead;PropertyPlaceholderHelper placeholderHelper = new PropertyPlaceholderHelper("${", "}");public ExcelTitleHandler( String bigHead) {this.bigHead = bigHead; //表头1}@Overridepublic void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead) {// 动态设置表头字段if (!ObjectUtil.isEmpty(head)) {List<String> headNameList = head.getHeadNameList();if (CollectionUtil.isNotEmpty(headNameList)) {Properties properties = new Properties();properties.setProperty("bigHead", bigHead);for (int i = 0 ; i < headNameList.size() ; i++){// 循环遍历替换headNameList.set(i, placeholderHelper.replacePlaceholders(headNameList.get(i), properties));}}}}@Overridepublic void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {}@Overridepublic void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, CellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) {}@Overridepublic void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<CellData> list, Cell cell, Head head, Integer integer, Boolean aBoolean) {}
}

5、开始接口请求

   //每日更新统计导出@PostMapping("/exportDataUpdate")public void exportDataUpdate(@RequestBody ExportDataRequestDto exportDataRequestDto, HttpServletResponse response) {labourDayUpdatetimeService.exportDataUpdate(exportDataRequestDto, response);}

6、service层

void exportDataUpdate(ExportDataRequestDto exportDataRequestDto, HttpServletResponse response);

7、serviceImpl实现类

 private void setIntValueFromDoubleString(LabourDayUpdatetime recode, String value, Consumer<String> setter) {if (value != null && !value.isEmpty()) {try {int intValue = (int) Double.parseDouble(value);setter.accept(String.valueOf(intValue));} catch (NumberFormatException e) {setter.accept("0");}} else {setter.accept("0");}}private void setFormattedPercentage(LabourDayUpdatetime recode, String value, Consumer<String> setter) {if (value != null && !value.isEmpty()) {try {double doubleValue = Double.parseDouble(value);String formattedValue = String.format("%.2f%%", doubleValue * 100);setter.accept(formattedValue);} catch (NumberFormatException e) {setter.accept("0.00%");}} else {setter.accept("0.00%");}}@Overridepublic void exportDataUpdate(ExportDataRequestDto exportDataRequestDto, HttpServletResponse response) {String bigHead=exportDataRequestDto.getAddressName()+"劳动力更新报表";List<LabourDayUpdatetime> labourDayUpdatetimeList = exportDataRequestDto.getLabourDayUpdatetimeList();labourDayUpdatetimeList.stream().forEach(recode->{setIntValueFromDoubleString(recode, recode.getNcldlrs(), recode::setNcldlrs);setIntValueFromDoubleString(recode, recode.getGxrsa(), recode::setGxrsa);setFormattedPercentage(recode, recode.getGxla(), recode::setGxla);setIntValueFromDoubleString(recode, recode.getJyrsa(), recode::setJyrsa);setIntValueFromDoubleString(recode, recode.getGuowaiwug(), recode::setGuowaiwug);setIntValueFromDoubleString(recode, recode.getShengwai(), recode::setShengwai);setIntValueFromDoubleString(recode, recode.getShiwaishengnei(), recode::setShiwaishengnei);setIntValueFromDoubleString(recode, recode.getXianwaishinwug(), recode::setXianwaishinwug);setIntValueFromDoubleString(recode, recode.getXiangzhennwug(), recode::setXiangzhenwaixianneiwug);setIntValueFromDoubleString(recode, recode.getXiangzhennwug(), recode::setXiangzhennwug);setFormattedPercentage(recode, recode.getJyla(), recode::setJyla);setIntValueFromDoubleString(recode, recode.getTpldlrs(), recode::setTpldlrs);setIntValueFromDoubleString(recode, recode.getGxrsb(), recode::setGxrsb);setFormattedPercentage(recode, recode.getGxlb(), recode::setGxlb);setIntValueFromDoubleString(recode, recode.getJyrsb(), recode::setJyrsb);setIntValueFromDoubleString(recode, recode.getTpguowaiwug(), recode::setTpguowaiwug);setIntValueFromDoubleString(recode, recode.getTpshengwai(), recode::setTpshengwai);setIntValueFromDoubleString(recode, recode.getTpshiwaishengnei(), recode::setTpshiwaishengnei);setIntValueFromDoubleString(recode, recode.getTpxianwaishinwug(), recode::setTpxianwaishinwug);setIntValueFromDoubleString(recode, recode.getTpxiangzhenwaixianneiwug(), recode::setTpxiangzhenwaixianneiwug);setIntValueFromDoubleString(recode, recode.getTpxiangzhennwug(), recode::setTpxiangzhennwug);setFormattedPercentage(recode, recode.getJylb(), recode::setJylb);setIntValueFromDoubleString(recode, recode.getYqldlrs(), recode::setYqldlrs);setIntValueFromDoubleString(recode, recode.getGxrsc(), recode::setGxrsc);setFormattedPercentage(recode, recode.getGxlc(), recode::setGxlc);setIntValueFromDoubleString(recode, recode.getJyrsc(), recode::setJyrsc);setIntValueFromDoubleString(recode, recode.getYqguowaiwug(), recode::setYqguowaiwug);setIntValueFromDoubleString(recode, recode.getYqshengwai(), recode::setYqshengwai);setIntValueFromDoubleString(recode, recode.getYqshiwaishengnei(), recode::setYqshiwaishengnei);setIntValueFromDoubleString(recode, recode.getYqxianwaishinwug(), recode::setYqxianwaishinwug);setIntValueFromDoubleString(recode, recode.getYqxiangzhenwaixianneiwug(), recode::setYqxiangzhenwaixianneiwug);setIntValueFromDoubleString(recode, recode.getYqxiangzhennwug(), recode::setYqxiangzhennwug);setFormattedPercentage(recode, recode.getJylc(), recode::setJylc);setIntValueFromDoubleString(recode, recode.getXtzwgxdldlrs(), recode::setXtzwgxdldlrs);});try {response.setContentType("application/vnd.ms-excel");response.setCharacterEncoding("utf-8");response.setHeader("Content-disposition", "attachment;filename=" + "数据" + ".xlsx");WriteCellStyle contentWriteCellStyle = new WriteCellStyle();contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);contentWriteCellStyle.setBorderTop(BorderStyle.THIN);contentWriteCellStyle.setBorderRight(BorderStyle.THIN);contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);WriteCellStyle headWriteCellStyle = new WriteCellStyle();headWriteCellStyle.setBorderLeft(BorderStyle.THIN);headWriteCellStyle.setBorderTop(BorderStyle.THIN);headWriteCellStyle.setBorderRight(BorderStyle.THIN);headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置头部标题居中headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现HorizontalCellStyleStrategy horizontalCellStyleStrategy =new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);EasyExcel.write(response.getOutputStream(), LabourDayUpdatetime.class).sheet("数据").registerWriteHandler(new ExcelTitleHandler(bigHead)).registerWriteHandler(new SimpleColumnWidthStyleStrategy(20)).registerWriteHandler(horizontalCellStyleStrategy).doWrite(labourDayUpdatetimeList);}catch (Exception e){throw new RuntimeException(e);}}

7、前端vue的接口

具体代码就不列出了,这个   daochu 就是一个按钮button

daochu(){if(this.tableData.length==0){this.$message({ message: '请确保有数据进行导出', type: 'warning' });return;}else{const loading = this.$loading({lock: true,text: '导出中',spinner: 'el-icon-loading',background: ' rgba(255, 255, 255, 0.6)'});var data = {labourDayUpdatetimeList: this.tableData, // 这个tableData 这个是你要导出的数据addressName: this.addressName // 这个是你要给你的excel设置的大标题}//发送接口请求labourReportApi.exportDataUpdate(data).then(res => { const url = window.URL.createObjectURL(new Blob([res]));const link = document.createElement('a');link.href = url;link.setAttribute('download', '每日更新情况调度统计.xlsx');document.body.appendChild(link);link.click();document.body.removeChild(link);window.URL.revokeObjectURL(url);this.$message({message: '导出数据成功', type: 'success' });setTimeout(() => {loading.close();}, 1000);})}},

8、具体vue请求

这个是一个js,你可以赋值到你自己的接口js里面去

import request from "@/util/request";
var prefixD = customConfig.VUE_APP_CLIENT_ID + "/labourReport/updatetimeDayTj";
export default {//每日更新导出exportDataUpdate: async function (params) {return request({url: prefixD + "/exportDataUpdate",method: "post",data: params,responseType: "arraybuffer",headers: {'Content-Type': 'application/json'}})},}

9、导出已经完成了,展示效果

因为数据量很多,就展示部分

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

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

相关文章

纯血鸿蒙崛起,原生Android挑战?两大操作系统巅峰对决,智能设备未来谁主沉浮?

鸿蒙HarmonyOS和原生Android系统虽然在一些方面相似&#xff0c;但在架构、设计理念、API、开发工具等方面存在一些差异。鸿蒙系统的目标是跨设备、分布式的操作系统&#xff0c;强调多设备协同和资源共享&#xff0c;而Android则主要集中在智能手机和移动设备领域。 下面将从…

计算机网络:传输层、应用层、网络安全、视频/音频/无线网络、下一代因特网

目录 &#xff08;五&#xff09;传输层 1&#xff0e;传输层寻址与端口 2&#xff0e;无连接服务与面向连接服务 3. 传输连接的建立与释放 4. UDP 的优点 5. UDP 和 TCP 报文段报头格式 6. TCP 的流量控制 7&#xff0e;TCP 的拥塞控制 8. TCP 传送连接的管理 &#…

【前端开发】HTML+CSS网页,可以拿来当作业(免费开源)

HTML代码 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content_lizhongyu"widthdevice-width, initial-scale1.0"><title>小兔鲜儿-新鲜、惠民、快捷<…

CV(4)--边缘提取和相机模型

前言 仅记录学习过程&#xff0c;有问题欢迎讨论 边缘提取&#xff08;涉及语义分割&#xff09;&#xff1a; 图象的边缘是指图象局部区域亮度变化显著的部分,也有正负之分&#xff0c;暗到亮为正 求边缘的幅度&#xff1a;sobel&#xff0c;Canny算子 图像分高频分量和低…

智能技术引领未来:自动图像标注的创新应用与发展

&#x1f351;个人主页&#xff1a;Jupiter. &#x1f680; 所属专栏&#xff1a;传知代码 欢迎大家点赞收藏评论&#x1f60a; 目录 概述算法原理核心逻辑效果演示使用方式参考文献 参考文献&#xff1a;需要本文的详细复现过程的项目源码、数据和预训练好的模型可从该地址处获…

C语言-排序

常见的排序算法分为以下四种&#xff0c;插入排序&#xff0c;选择排序&#xff0c;交换排序&#xff0c;归并排序。 一、插入排序 (一)直接插入排序 直接插入排序&#xff0c;将一段数组看做被分成已排序序列和未排序序列&#xff0c;排序过程是从未排序序列的元素开始&…

【Java笔记】LinkedList 底层结构

一、LinkedList 的全面说明 LinkedList底层实现了双向链表和双端队列特点可以添加任意元素(元素可以重复)&#xff0c;包括null线程不安全&#xff0c;没有实现同步 二、LinkedList 的底层操作机制 三、LinkedList的增删改查案例 public class LinkedListCRUD { public stati…

网管平台(基础篇):路由器的介绍与管理

路由器简介 路由器&#xff08;Router&#xff09;是一种计算机网络设备&#xff0c;它的主要作用是将数据通过打包&#xff0c;并按照一定的路径选择算法&#xff0c;将网络传送至目的地。路由器能够连接两个或更多个网络&#xff0c;并根据信道的情况自动选择和设定路由&…

排序算法(2):选择排序

问题 排序 [30, 24, 5, 58, 18, 36, 12, 42, 39] 选择排序 选择排序每次从待排序序列中选出最小&#xff08;或最大&#xff09;的元素&#xff0c;将其放到序列的起始位置&#xff0c;然后&#xff0c;再从剩余未排序元素中继续寻找最小&#xff08;或最大&#xff09;元素…

Tongweb8命令行使用收集(by lqw)

文章目录 声明对应版本修改thanos用户密码部署应用到默认实例节点相关操作新增节点(一般一个服务器ip只能装一个节点)启动节点(需确认节点没有运行)停止节点删除节点节点新增应用节点查看应用节点启动应用节点停止应用节点卸载应用(谨慎操作,卸载后应用就没有了,建议备份后…

Artec Leo3D扫描仪在重型机械设备定制中的应用【沪敖3D】

挑战&#xff1a;一家加拿大制造商需要有效的方法&#xff0c;为富于变化且难度较高的逆向工程&#xff0c;快速、安全、准确地完成重型机械几何采集。 解决方案&#xff1a;Artec Leo, Artec Studio, Geomagic for SOLIDWORKS 效果&#xff1a;Artec Leo三维扫描代替过去的手动…

题海拾贝:力扣 141.环形链表

Hello大家好&#xff01;很高兴我们又见面啦&#xff01;给生活添点passion&#xff0c;开始今天的编程之路&#xff01; 我的博客&#xff1a;<但凡. 我的专栏&#xff1a;《编程之路》、《数据结构与算法之美》、《题海拾贝》 欢迎点赞&#xff0c;关注&#xff01; 1、题…

Vite快速构建Vue教程

步骤 1: 初始化项目目录 创建一个名为 projects 的文件夹&#xff0c;作为存放所有 Vite 项目的根目录。这个文件夹将容纳多个独立的 Vite 项目。 步骤 2: 创建 Vite 项目 右键点击 projects 文件夹并选择“在此处打开终端”或使用您偏好的代码编辑器&#xff08;如 VSCode&…

深入理解 CSS 文本换行: overflow-wrap 和 word-break

前言 正常情况下&#xff0c;在固定宽度的盒子中的中文会自动换行。但是&#xff0c;当遇到非常长的英文单词或者很长的 URL 时&#xff0c;文本可能就不会自动换行&#xff0c;而会溢出所在容器。幸运的是&#xff0c;CSS 为我们提供了一些和文本换行相关的属性&#xff1b;今…

HarmonyOS 5.0应用开发——属性动画

【高心星出品】 文章目录 属性动画animateTo属性动画animation属性动画 属性动画 属性接口&#xff08;以下简称属性&#xff09;包含尺寸属性、布局属性、位置属性等多种类型&#xff0c;用于控制组件的行为。针对当前界面上的组件&#xff0c;其部分属性&#xff08;如位置属…

《探索视频数字人:开启未来视界的钥匙》

一、引言 1.1视频数字人技术的崛起 在当今科技飞速发展的时代&#xff0c;视频数字人技术如一颗璀璨的新星&#xff0c;正逐渐成为各领域瞩目的焦点。它的出现&#xff0c;犹如一场科技风暴&#xff0c;彻底改变了传统的视频制作方式&#xff0c;为各个行业带来了前所未有的机…

免费下载 | 2024算网融合技术与产业白皮书

《2024算网融合技术与产业白皮书&#xff08;2023年&#xff09;》的核心内容概括如下&#xff1a; 算网融合发展概述&#xff1a; 各国细化算网战略&#xff0c;指引行业应用创新升级。 算网融合市场快速增长&#xff0c;算力互联成为投资新热点。 算网融合产业模式逐渐成型…

基于卷积神经网络的图像二分类检测模型训练与推理实现教程 | 幽络源

前言 对于本教程&#xff0c;说白了&#xff0c;就是期望能通过一个程序判断一张图片是否为某个物体&#xff0c;或者说判断一张图片是否为某个缺陷。因为本教程是针对二分类问题&#xff0c;因此主要处理 是 与 不是 的问题&#xff0c;比如我的模型是判断一张图片是否为苹果…

RabbitMQ个人理解与基本使用

目录 一. 作用&#xff1a; 二. RabbitMQ的5中队列模式&#xff1a; 1. 简单模式 2. Work模式 3. 发布/订阅模式 4. 路由模式 5. 主题模式 三. 消息持久化&#xff1a; 消息过期时间 ACK应答 四. 同步接收和异步接收&#xff1a; 应用场景 五. 基本使用 &#xff…

前端怎么预览pdf

1.背景 后台返回了一个在线的pdf地址&#xff0c;需要我这边去做一个pdf的预览&#xff08;需求1&#xff09;&#xff0c;并且支持配置是否可以下载&#xff08;需求2&#xff09;&#xff0c;需要在当前页就能预览&#xff08;需求3&#xff09;。之前我写过一篇预览pdf的文…