当前位置: 首页 > news >正文

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、导出已经完成了,展示效果

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

相关文章:

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

1、首先得先引用easyExcel的版本依赖&#xff0c;我那 <dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>2.2.6</version> </dependency> 2、然后得弄直接的实体类&#xff0c;&…...

【Linux网络编程】第十弹---打造初级网络计算器:从协议设计到服务实现

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】【C详解】【Linux系统编程】【Linux网络编程】 目录 1、Protocol.hpp 1.1、Request类 1.1.1、基本结构 1.1.2、构造析构函数 1.1.3、序列化函数 1.1.4、反…...

无限弹窗?无限重启?

Windows开机自启目录&#xff1a; "%USERPROFILE%\AppData\Roaming\Microsoft\windows\StartMenu\Programs\Startup" 基于这个和 start 命令&#xff0c; shutdown 命令&#xff0c; 编写 bat 病毒程序。 无限弹窗 echo start cmd > hack.txt echo %0 >>…...

深入详解人工智能机器学习常见算法中的K-means聚类

目录 引言 1. K-means聚类的基本概念 1.1 K-means聚类的定义 1.2 K-means聚类的核心思想 1.3 K-means聚类的目标函数 2. K-means聚类的核心原理 2.1 初始化 2.2 分配 2.3 更新 2.4 迭代 3. K-means聚类的具体实现 3.1 K-means聚类的算法流程 3.2 K-means聚类的Pyt…...

lc146LRU缓存——模仿LinkedHashMap

146. LRU 缓存 - 力扣&#xff08;LeetCode&#xff09; 法1&#xff1a; 调用java现有的LinkedHashMap的方法&#xff0c;但不太理解反正都不需要扩容&#xff0c;super(capacity, 1F, true);不行吗&#xff0c;干嘛还弄个装载因子0.75还中途扩容一次浪费时间。 class LRUC…...

全面深入解析:C语言动态库

引言 动态库&#xff08;Dynamic Library&#xff09;是现代软件开发中不可或缺的一部分&#xff0c;它们不仅提高了代码的重用性和维护性&#xff0c;还显著提升了系统的性能和资源利用率。本文将全面探讨C语言中的动态库&#xff0c;从基础概念到高级应用&#xff0c;通过丰…...

运用 SSM 实现垃圾分类系统智能化升级

目 录 摘 要 1 前 言 3 第1章 概述 4 1.1 研究背景 4 1.2 研究目的 4 1.3 研究内容 4 第二章 开发技术介绍 5 2.1Java技术 6 2.2 Mysql数据库 6 2.3 B/S结构 7 2.4 SSM框架 8 第三章 系统分析 9 3.1 可行性分析 9 3.1.1 技术可行性 9 3.1.2 经济可行性 10 3.1.3 操作可行性 10 …...

LeNet-5:深度学习与卷积神经网络的里程碑

目录 ​编辑 引言 LeNet-5的结构与原理 输入层 C1层&#xff1a;卷积层 S2层&#xff1a;池化层 C3层&#xff1a;卷积层 S4层&#xff1a;池化层 C5层&#xff1a;卷积层 F6层&#xff1a;全连接层 输出层 LeNet-5的算法基础 LeNet-5的优点 LeNet-5的现代应用 …...

从资产流动分析WIF市场潜力X.game深究其他未知因素

近日&#xff0c;两则关于WIF最新消息引起了投资者们的注意。据报道&#xff0c;11月28日Vintermute在过去13小时内累计从Binance交易所提取了价值533万美元的WIF&#xff0c;此举不仅彰显了其强大的资金实力&#xff0c;更在某种程度上推动了WIF币价的反弹&#xff1b;另一方面…...

深入解析Vue3响应式系统:从Proxy实现到依赖收集的核心原理

深入解析Vue3响应式系统&#xff1a;从Proxy实现到依赖收集的核心原理 响应式系统的基本原理 作为一个热门的JavaScript框架&#xff0c;Vue在3.x版本中引入了基于Proxy的响应式系统。这个系统的核心思想是利用Proxy对象拦截对数据的访问和修改&#xff0c;从而实现数据的自动更…...

FPGA实现GTP光口数据回环传输,基于Aurora 8b/10b编解码架构,提供2套工程源码和技术支持

目录 1、前言工程概述免责声明 2、相关方案推荐我已有的所有工程源码总目录----方便你快速找到自己喜欢的项目我这里已有的 GT 高速接口解决方案 3、工程详细设计方案工程设计原理框图用户数据发送模块基于GTP高速接口的数据回环传输架构GTP IP 简介GTP 基本结构GTP 发送和接收…...

Linux网络 UDP socket

背景知识 我们知道&#xff0c; IP 地址用来标识互联网中唯一的一台主机&#xff0c; port 用来标识该主机上唯一的一个网络进程&#xff0c;IPPort 就能表示互联网中唯一的一个进程。所以通信的时候&#xff0c;本质是两个互联网进程代表人来进行通信&#xff0c;{srcIp&…...

如何持续优化呼叫中心大模型呼入机器人的性能?

如何持续优化呼叫中心大模型呼入机器人的性能&#xff1f; 原作者&#xff1a;开源呼叫中心FreeIPCC&#xff0c;其Github&#xff1a;https://github.com/lihaiya/freeipcc 持续优化呼叫中心大模型呼入机器人的性能是一个复杂而细致的过程&#xff0c;它涉及到数据、模型结构…...

鸿蒙项目云捐助第四讲鸿蒙App应用的登陆注册页实现

根据app的操作流程可以知道&#xff0c;当启动页启动后&#xff0c;点击启动页中的页面就进入到了登录页。本讲就是针对于登录注册页的实现&#xff0c;实现的界面参考下图。 这里根据这个素材的参考实现鸿蒙Next云捐助的登录页。 一、鸿蒙Next云捐助登录页的实现 在项目中继…...

Windows本地搭建Redis集群(集群模式)

手打不易&#xff0c;如果转摘&#xff0c;请注明出处&#xff01; 注明原文&#xff1a;https://blog.csdn.net/q258523454/article/details/144477957 前言 Redis版本&#xff1a;redis 5.0.14.1 Windows版本&#xff1a;Windows10 本文只讲集群模式 1. 安装Redis 1.1 …...

使用FastGPT制做一个AI网站日志分析器

越来越的多网站面临每天上千次的扫描和各类攻击&#xff0c;及时发现攻击IP&#xff0c;并有效的屏蔽不良访问成为网站安全的重要保障&#xff0c;这里我们使用AI来完成对网站日志的日常分析。 我们来使用FastGPT来制做一个AI网站日志析器&#xff0c;下面就开始&#xff1a; …...

探索 Echarts 绘图:数据可视化的奇妙之旅

目录 一、Echarts 初印象 二、搭建 Echarts 绘图环境 三、绘制第一个图表&#xff1a;柱状图的诞生 四、图表的美化与定制&#xff1a;让数据更具吸引力 1. 主题切换&#xff1a;一键变换风格 2. 颜色调整&#xff1a;色彩搭配的艺术 3. 标签与提示框&#xff1a;丰富信…...

网络基础(IP和端口)

网络连接的核心-TCP/IP体系结构&#xff08;IP和端口&#xff09; 什么是IP地址 1.IP地址是电子设备&#xff08;计算机&#xff09;在互联网上的唯一标识 2.用来在互联网中寻找电脑 IP 地址就像是你家的地址一样&#xff0c;不过它是在网络世界里用来找到一台电脑或者其他网…...

UE4与WEB-UI通信

前端HTML代码 <!DOCTYPE html><html><head><meta charset"utf-8"><meta name"viewport" content"widthdevice-width, initial-scale1"><title>test web ui</title><script src"https://cdn.b…...

前缀和与差分算法详解

定义 前缀和是一种数据预处理技术&#xff0c;它指的是从数组的第一个元素开始&#xff0c;到当前元素为止的所有元素的和。这种技术可以快速计算任意区间内元素的和&#xff0c;而不需要每次都从头开始累加。 差分则是前缀和的逆运算&#xff0c;它主要用于处理对数组某个区…...

《深入探究:C++ 在多方面对 C 语言实现的优化》

目录 一、C 在 C 上进行的优化二、C 关键字&#xff08;C 98&#xff09;三、C 的输入输出1. cin 和 cout 的使用2. cin、cout 和 scanf()、printf() 的区别 三、命名空间1. 命名空间的使用2. 嵌套命名空间3. 在多个头文件中使用相同的命名空间 四、函数缺省值1. 缺省值的使用2…...

React 第十六节 useCallback 使用详解注意事项

useCallback 概述 1、useCallback 是在React 中多次渲染缓存函数的 Hook&#xff0c;返回一个函数的 memoized的值&#xff1b; 2、如果多次传入的依赖项不变&#xff0c;那么多次定义的时候&#xff0c;返回的值是相同的,防止频繁触发更新&#xff1b; 3、多应用在 父组件为函…...

使用C#和OPenCV实现圆形检测

文章目录 霍夫变换使用 OpenCV 和 C# 实现圆形检测 霍夫变换 在计算机视觉中&#xff0c;圆形检测是一个常见且有用的任务&#xff0c;特别是在物体识别、图像分析和图形处理等领域。OpenCV 是一个强大的开源计算机视觉库&#xff0c;它提供了许多工具来实现不同的图像处理功能…...

评估一套呼叫中心大模型呼入机器人的投入回报比?

评估一套呼叫中心大模型呼入机器人的投入回报比&#xff1f; 原作者&#xff1a;开源呼叫中心FreeIPCC&#xff0c;其Github&#xff1a;https://github.com/lihaiya/freeipcc 评估一套呼叫中心大模型呼入机器人的投入回报比&#xff08;ROI&#xff09;&#xff0c;是一个多…...

十八、Label 和 Selector

Label 是键值对,用来标识 Kubernetes 资源(如 Pod、Node、Service 等)的属性。它们并不直接影响资源的行为,但可以帮助用户快速组织、查询和操作这些资源。标签可以用于选择、过滤和分组。 Label: 标签对 k8s 中各种资源进行分类、分组,如Pod和节点进行分组。通过添加kev…...

实现按键按下(低电平)检测到下降沿

按照流程进行编程 步骤1&#xff1a; 初始化函数 包括时基工作参数配置 输入通道配置 更新中断使能 使能捕获、捕获中断及计数器 HAL_TIM_IC_Init(&ic_handle) //时基参数配置 HAL_TIM_IC_ConfigChannel(&ic_handle,&ic_config,TIM_CHANNEL_2) //输…...

解析 SSM 垃圾分类系统,助力生态平衡

前 言 垃圾分类系统&#xff0c;传统的垃圾分类系统模式还处于线下管理阶段&#xff0c;管理效率极低。随着垃圾分类系统信息的不断增多&#xff0c;传统基于线下管理模式已经无法满足当前用户需求&#xff0c;随着信息化时代的到来。通过该系统的设计&#xff0c;管理员可以管…...

软件工程 设计的复杂性

复杂性代表事件或事物的状态&#xff0c;它们具有多个相互关联的链接和高度复杂的结构。在软件编程中&#xff0c;随着软件设计的实现&#xff0c;元素的数量以及它们之间的相互联系逐渐变得庞大&#xff0c;一下子变得难以理解。 如果不使用复杂性指标和度量&#xff0c;软件…...

Nginx 限制只能白名单 uri 请求的配置

实际生产项目中&#xff0c;大多数时候我们会将后端的 http 接口通过前置 nginx 进行反向代理&#xff0c;对互联网用户提供服务。往往我们后端服务所能提供的接口服务是大于互联网用户侧的实际请求的接口地址数量的&#xff08;例如后端服务一共有100个api接口&#xff0c;经过…...

QT c++ 同时使用sqlite 和mysql数据库的问题

在项目开发中&#xff0c;同时使用了sqlite 和mysql数据库&#xff0c;分开这两部分运行功能都正常&#xff0c;但是一起运行&#xff0c;就异常&#xff0c;sqlite部分不能使用。 现象&#xff1a;出现如下提示 QSqlDatabasePrivate::addDatabase: duplicate connection nam…...