电子口岸网站做资料库,石家庄住建局网站,wordpress极简中文主题,网页素材及网站架构制作Linux 查询当前进程所在的路径 top 命令查询相应的进程号pid ps -ef |grep 进程名 lsof -I:端口号 netstat -anp|grep 端口号 cd /proc/进程id cwd 进程运行目录 exe 执行程序的绝对路径 cmdline 程序运行时输入的命令行命令 environ 记录了进程运行时的环境变量 fd 目录下是进… Linux 查询当前进程所在的路径 top 命令查询相应的进程号pid ps -ef |grep 进程名 lsof -I:端口号 netstat -anp|grep 端口号 cd /proc/进程id cwd 进程运行目录 exe 执行程序的绝对路径 cmdline 程序运行时输入的命令行命令 environ 记录了进程运行时的环境变量 fd 目录下是进程打开或使用的文件的符号连接 查看端口号对应进程 lsof -i :端口号 ubuntu 安装ssh sudo apt-get install openssh-server OpenGauss SpringBoot 配置 driver-class-name: org.postgresql.Driver url:jdbc:postgresql://ip:port/db-name 共享WiFi 将带有无线网卡的电脑设置成热点(一般win10以上的系统) 右键转到设置可编辑WiFi信息。 MyBatis 使用map类型作为参数复杂查询导出数据 interface声明 /*** author Be.insighted*/Mapperpublic interface InterviewerMapper{IPageTInterviewer query(IPage? page, Param(param) MapString, ? param);} mapper.xml ?xml version1.0 encodingUTF-8?
!DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//EN http://mybatis.org/dtd/mybatis-3-mapper.dtd
mapper namespacecom.*.mapper.InterviewerMapper!--面试官查询 管理端 --select idquery resultTypecom.*.entity.TInterviewer parameterTypemapselect * from t_tablewhere del_flag0 and valid_flag0if testparam.keyword ! null and param.keyword ! and (INSTR(interviewer_name,#{param.keyword}) or interviewer_code #{param.keyword}) !--姓名或者工号--/ifif testparam.companyCode ! null and param.companyCode ! and company_code #{param.companyCode} !--企业编号--/ifif testparam.positionCode ! null and param.positionCode ! and position_code #{param.positionCode} !--岗位编码--/ifif testparam.label ! null and param.label ! and INSTR(label,#{param.label}) !--标签--/ifif testparam.interviewerStatus ! null and param.interviewerStatus ! and interviewer_status #{param.interviewerStatus} !--状态--/ifif testparam.interviewerStatus nulland interviewer_status 0 !--状态--/ifif testparam.ids ! nullAND id inforeach collectionparam.ids indexindex open( close) itemitem separator,#{item}/foreach/iforder by create_time desc/select
/mapper对应的controller GetMapping(value /interviewer/en/export)ApiOperation(value 面试官导出)public void export(HttpServletResponse response, InterviewerParams params) throws IOException, IllegalAccessException {LoginUser sysUser (LoginUser) SecurityUtils.getSubject().getPrincipal();String companyCode sysUser.getCompanyId();TInterviewer interviewer interviewerConvert.toEntity(params);interviewer.setCompanyCode(companyCode);interviewer.setDelFlag(false);IPage? page new Page();page.setCurrent(params.getPageNo());page.setSize(params.getPageSize());MapString, Object paramMap new HashMap();String id params.getIds();if (StrUtil.isNotBlank(id)) {EnInfo enInfo enInfoService.getById(companyCode);String companyName enInfo.getEnName();// 导出选中的数据paramMap.put(ids, id.split(,));ListTInterviewer records interviewerService.lambdaQuery().in(TInterviewer::getId, id.split(,)).list();ListInterviewerVO temps records.stream().map(item - {InterviewerVO vo new InterviewerVO();BeanUtils.copyProperties(item, vo);vo.setCompanyName(companyName);return vo;}).collect(Collectors.toList());ListString positionCodes records.stream().map(TInterviewer::getPositionCode).collect(Collectors.toList());ListString collect positionCodes.stream().distinct().collect(Collectors.toList());MapString, String positionCode2NameMap new HashMap(collect.size());if (!CollectionUtils.isEmpty(collect)) {ListTPosition positions positionService.lambdaQuery().in(TPosition::getPositionCode, collect).list();positionCode2NameMap positions.stream().collect(Collectors.toMap(TPosition::getPositionCode, TPosition::getPositionName));for (int i 0; i temps.size(); i) {temps.get(i).setPositionName(positionCode2NameMap.get(temps.get(i).getPositionCode()));}}if (!CollectionUtils.isEmpty(temps)) {ExcelUtilInterviewerVO excelUtil new ExcelUtil();excelUtil.setClose(false);excelUtil.buildExcel(response, temps);}return;} else {paramMap.put(keyword, params.getKeyword());paramMap.put(interviewerStatus, params.getInterviewerStatus());paramMap.put(positionCode, params.getPositionCode());paramMap.put(label, params.getLabel());paramMap.put(companyCode, companyCode);}IPageTInterviewer pageInfo interviewerService.query4En(page, paramMap);ListTInterviewer records pageInfo.getRecords();EnInfo enInfo enInfoService.getById(companyCode);String companyName enInfo.getEnName();ListInterviewerVO temps records.stream().map(item - {InterviewerVO vo new InterviewerVO();BeanUtils.copyProperties(item, vo);vo.setCompanyName(companyName);return vo;}).collect(Collectors.toList());ListString positionCodes records.stream().map(TInterviewer::getPositionCode).collect(Collectors.toList());ListString collect positionCodes.stream().distinct().collect(Collectors.toList());MapString, String positionCode2NameMap new HashMap(collect.size());if (!CollectionUtils.isEmpty(collect)) {ListTPosition positions positionService.lambdaQuery().in(TPosition::getPositionCode, collect).list();positionCode2NameMap positions.stream().collect(Collectors.toMap(TPosition::getPositionCode, TPosition::getPositionName));for (int i 0; i temps.size(); i) {temps.get(i).setPositionName(positionCode2NameMap.get(temps.get(i).getPositionCode()));}}if (!CollectionUtils.isEmpty(temps)) {ExcelUtilInterviewerVO excelUtil new ExcelUtil();excelUtil.setClose(false);excelUtil.buildExcel(response, temps);}}导出Excel工具类 package com.*.utils;import cn.com.*.annotation.Column;
import cn.com.*.annotation.Title;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.URLUtil;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;/*** author Be.insighted* title: ExcelUtil* description: 默认每个sheet最多50000条数据 超过另起一个sheet* date date 2023-11-14 15:42*/
Data
public class ExcelUtilT {/*** 设置每行的宽度 每个值的index 对应第几列 如{1500,1000} 表示第一个1500长度 第二个1000长度 以此类推*/private int[] size;/*** 查询条件文本描述*/private String queryCriteria;/*** 是否关闭流 默认关闭*/private boolean close true;public ExcelUtil() {this.queryCriteria null;}public ExcelUtil(String queryCriteria) {this.queryCriteria queryCriteria;}public void buildExcel(HttpServletResponse response, ListT list, String filename) throws IOException, IllegalAccessException {String name Objects.isNull(filename) ? : filename;OutputStream output response.getOutputStream();response.reset();response.setCharacterEncoding(UTF-8);name URLEncoder.encode(name DateUtil.format(new Date(), yyyyMMddHHmmss) .xls, UTF-8);response.setHeader(Cache-Control, no-cache, no-store, must-revalidate);response.setHeader(Content-Disposition, attachment; filename URLUtil.encode(name, UTF-8));response.setHeader(Pragma, no-cache);response.setHeader(Expires, 0);response.setContentType(application/msexcel;charsetutf-8);ListString parameter new ArrayList();ListField fieldArrayList new ArrayList();if (CollUtil.isNotEmpty(list)) {Class? clazz list.get(0).getClass();Field[] fields clazz.getDeclaredFields();for (Field field : fields) {if (field.getAnnotation(Column.class) ! null) {if (!StringUtils.isEmpty(field.getAnnotation(Column.class).name())) {parameter.add(field.getAnnotation(Column.class).name());} else {parameter.add(field.getName());}fieldArrayList.add(field);}}Title title clazz.getDeclaredAnnotation(Title.class);if (title ! null) {name title.title();}} else {return;}HSSFWorkbook hssfWorkbook new HSSFWorkbook();try {final int sheetNum (int) Math.ceil((float) list.size() / 50000);HSSFCellStyle style hssfWorkbook.createCellStyle();style.setFillForegroundColor((short) 22);style.setFillPattern(FillPatternType.SOLID_FOREGROUND);style.setBorderBottom(BorderStyle.THIN);style.setBorderLeft(BorderStyle.THIN);style.setBorderRight(BorderStyle.THIN);style.setBorderTop(BorderStyle.THIN);style.setAlignment(HorizontalAlignment.CENTER);style.setVerticalAlignment(VerticalAlignment.CENTER);//2022年4月8日17:16:09 增加解决导出数据之后数据并未换行只有双击之后才展现换行效果style.setWrapText(true);HSSFFont font hssfWorkbook.createFont();font.setFontHeightInPoints((short) 12);style.setFont(font);HSSFCellStyle style2 hssfWorkbook.createCellStyle();style2.setAlignment(HorizontalAlignment.CENTER);//垂直居中style2.setVerticalAlignment(VerticalAlignment.CENTER);//2022年4月8日17:16:09 增加解决导出数据之后数据并未换行只有双击之后才展现换行效果style2.setWrapText(true);for (int n 1; n sheetNum; n) {final HSSFSheet sheet hssfWorkbook.createSheet(sheet - n);ListT toOut null;if (sheetNum 1) {if (n sheetNum) {toOut getSubList(list, 0, list.size() - 1);} else {toOut getSubList(list, 0, 50000);}} else {toOut list;}if (CollUtil.isNotEmpty(toOut)) {Class? clazz toOut.get(0).getClass();HSSFRow row1 sheet.createRow(0);HSSFCell cellTitle row1.createCell(0);cellTitle.setCellStyle(style);Title title clazz.getDeclaredAnnotation(Title.class);if (title ! null) {if (StringUtils.isNotBlank(queryCriteria)) {cellTitle.setCellValue(title.title() queryCriteria);} else {cellTitle.setCellValue(title.title());}sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, parameter.size() - 1));}if (getSize() ! null getSize().length 0) {for (int i 0; i getSize().length; i) {sheet.setColumnWidth(i, getSize()[i]);}} else {int length parameter.size();this.size new int[length];for (int i 0; i length; i) {this.size[i] 10000;sheet.setColumnWidth(i, getSize()[i]);}}HSSFRow row2 sheet.createRow(1);for (int i 0; i parameter.size(); i) {HSSFCell cell row2.createCell(i);cell.setCellStyle(style);cell.setCellValue(parameter.get(i));}for (int i 0; i toOut.size(); i) {HSSFRow row sheet.createRow(i 2);for (int j 0; j fieldArrayList.size(); j) {Field field fieldArrayList.get(j);Object value ReflectUtil.getFieldValue(toOut.get(i), field);HSSFCell cell row.createCell(j);cell.setCellStyle(style2);Column column field.getDeclaredAnnotation(Column.class);if (value ! null !null.equals(value)) {String rule column.timeFormat();boolean rate column.rate();boolean condition StringUtils.isNotBlank(rule) (field.getType().equals(Date.class) ||field.getType().equals(java.sql.Date.class) ||field.getType().equals(Time.class) ||field.getType().equals(Timestamp.class));if (condition) {SimpleDateFormat simpleDateFormat new SimpleDateFormat(rule);cell.setCellValue(simpleDateFormat.format(value));} else if (rate field.getType().equals(BigDecimal.class)) {BigDecimal valueReal (BigDecimal) value;cell.setCellValue(valueReal.multiply(new BigDecimal(100)) %);} else {cell.setCellValue(value.toString());}} else {if (field.getType().equals(Integer.class) || field.getType().equals(Long.class) ||field.getType().equals(Double.class) || field.getType().equals(Float.class) ||field.getType().equals(BigDecimal.class)) {cell.setCellValue(0);} else {cell.setCellValue();}}}}}}hssfWorkbook.write(output);} finally {IoUtil.close(hssfWorkbook);if (close) {IoUtil.close(output);}}}/*** 截取list 含左不含右** param list* param fromIndex* param toIndex* param T* return*/private static T ListT getSubList(ListT list, int fromIndex, int toIndex) {ListT listClone list;ListT sub listClone.subList(fromIndex, toIndex);return new ArrayList(sub);}} column、title注解定义 Retention(RetentionPolicy.RUNTIME)
Target(ElementType.FIELD)
Inherited
Documented
public interface Column {String name() default ;String timeFormat() default ;boolean rate() default false;
}Retention(RetentionPolicy.RUNTIME)
Target(ElementType.TYPE)
Inherited
Documented
public interface Title {String title() default ;}导出的对象定义 Data
Accessors(chain true)
ApiModel(value 面试官表示)
Title(title 面试官信息)
public class InterviewerVO implements Serializable {private String id;/*** 企业编码*/Excel(name 企业编码)Column(name 企业编码)Dict( dictTablesys_depart,dicCodeid,dicTextdepart_name)private String companyCode;/*** 企业名称*/Excel(name 企业名称)Column(name 企业名称)private String companyName;/*** 面试官名称*/Excel(name 面试官名称)Column(name 面试官名称)private String interviewerName;/*** 面试官编号取黄河人才网的id*/private String interviewerCode;/*** 部门*/private String department;/*** 岗位名称*/Excel(name 岗位名称)Column(name 岗位名称)private String positionName;/*** 岗位code*/private String positionCode;/*** 标签*/Excel(name 标签)Column(name 标签)private String label;/*** 联系方式*/Excel(name 联系方式)Column(name 联系方式)private String contactInfo;/*** 面试官类别*/Dict(dicCode interviewer_type)private String interviewerType;/*** 面试官状态*/Dict(dicCode interviewer_status)private String interviewerStatus;/*** 面试官有效标识*/private String validFlag;/*** 创建人姓名*/Excel(name 创建人)Column(name 创建人)private String createName;/*** 创建人工号*/private String createCode;/*** 创建时间*/JsonFormat(pattern yyyy-MM-dd HH:mm:ss, timezone GMT8)private Date createTime;/*** 更新人*/private String updateName;/*** 更新时间*/private Date updateTime;
} 文章转载自: http://www.morning.cnqdn.cn.gov.cn.cnqdn.cn http://www.morning.zckhn.cn.gov.cn.zckhn.cn http://www.morning.ksqyj.cn.gov.cn.ksqyj.cn http://www.morning.cwpny.cn.gov.cn.cwpny.cn http://www.morning.sacxbs.cn.gov.cn.sacxbs.cn http://www.morning.qdmdp.cn.gov.cn.qdmdp.cn http://www.morning.cklld.cn.gov.cn.cklld.cn http://www.morning.zdsdn.cn.gov.cn.zdsdn.cn http://www.morning.bpmfl.cn.gov.cn.bpmfl.cn http://www.morning.prysb.cn.gov.cn.prysb.cn http://www.morning.zdmlt.cn.gov.cn.zdmlt.cn http://www.morning.wnjsp.cn.gov.cn.wnjsp.cn http://www.morning.njqpg.cn.gov.cn.njqpg.cn http://www.morning.bbtn.cn.gov.cn.bbtn.cn http://www.morning.mlbn.cn.gov.cn.mlbn.cn http://www.morning.jtrqn.cn.gov.cn.jtrqn.cn http://www.morning.qsmmq.cn.gov.cn.qsmmq.cn http://www.morning.jfbrt.cn.gov.cn.jfbrt.cn http://www.morning.yltyr.cn.gov.cn.yltyr.cn http://www.morning.fjkkx.cn.gov.cn.fjkkx.cn http://www.morning.xcjwm.cn.gov.cn.xcjwm.cn http://www.morning.jzbjx.cn.gov.cn.jzbjx.cn http://www.morning.nfnxp.cn.gov.cn.nfnxp.cn http://www.morning.wrlqr.cn.gov.cn.wrlqr.cn http://www.morning.dzqyn.cn.gov.cn.dzqyn.cn http://www.morning.stpkz.cn.gov.cn.stpkz.cn http://www.morning.htmhl.cn.gov.cn.htmhl.cn http://www.morning.pmsl.cn.gov.cn.pmsl.cn http://www.morning.lyhry.cn.gov.cn.lyhry.cn http://www.morning.lyhry.cn.gov.cn.lyhry.cn http://www.morning.mnkhk.cn.gov.cn.mnkhk.cn http://www.morning.pqjlp.cn.gov.cn.pqjlp.cn http://www.morning.nwrzf.cn.gov.cn.nwrzf.cn http://www.morning.qkcyk.cn.gov.cn.qkcyk.cn http://www.morning.vattx.cn.gov.cn.vattx.cn http://www.morning.ctwwq.cn.gov.cn.ctwwq.cn http://www.morning.smrty.cn.gov.cn.smrty.cn http://www.morning.mmxt.cn.gov.cn.mmxt.cn http://www.morning.whothehellami.com.gov.cn.whothehellami.com http://www.morning.frsxt.cn.gov.cn.frsxt.cn http://www.morning.ptqpd.cn.gov.cn.ptqpd.cn http://www.morning.wjmb.cn.gov.cn.wjmb.cn http://www.morning.qyxnf.cn.gov.cn.qyxnf.cn http://www.morning.guanszz.com.gov.cn.guanszz.com http://www.morning.bbgn.cn.gov.cn.bbgn.cn http://www.morning.xlmgq.cn.gov.cn.xlmgq.cn http://www.morning.mlnbd.cn.gov.cn.mlnbd.cn http://www.morning.snyqb.cn.gov.cn.snyqb.cn http://www.morning.smnxr.cn.gov.cn.smnxr.cn http://www.morning.rsbqq.cn.gov.cn.rsbqq.cn http://www.morning.mdpcz.cn.gov.cn.mdpcz.cn http://www.morning.ypqwm.cn.gov.cn.ypqwm.cn http://www.morning.jwrcz.cn.gov.cn.jwrcz.cn http://www.morning.bfbl.cn.gov.cn.bfbl.cn http://www.morning.trsfm.cn.gov.cn.trsfm.cn http://www.morning.ltkzb.cn.gov.cn.ltkzb.cn http://www.morning.nstml.cn.gov.cn.nstml.cn http://www.morning.tgbx.cn.gov.cn.tgbx.cn http://www.morning.trhlb.cn.gov.cn.trhlb.cn http://www.morning.tturfsoc.com.gov.cn.tturfsoc.com http://www.morning.qjldz.cn.gov.cn.qjldz.cn http://www.morning.yhywx.cn.gov.cn.yhywx.cn http://www.morning.mwkwg.cn.gov.cn.mwkwg.cn http://www.morning.lqtwb.cn.gov.cn.lqtwb.cn http://www.morning.ggjlm.cn.gov.cn.ggjlm.cn http://www.morning.lblsx.cn.gov.cn.lblsx.cn http://www.morning.xsctd.cn.gov.cn.xsctd.cn http://www.morning.qnzk.cn.gov.cn.qnzk.cn http://www.morning.qxmnf.cn.gov.cn.qxmnf.cn http://www.morning.zxdhp.cn.gov.cn.zxdhp.cn http://www.morning.ftcrt.cn.gov.cn.ftcrt.cn http://www.morning.mfltz.cn.gov.cn.mfltz.cn http://www.morning.dqxnd.cn.gov.cn.dqxnd.cn http://www.morning.brkc.cn.gov.cn.brkc.cn http://www.morning.dskzr.cn.gov.cn.dskzr.cn http://www.morning.gmplp.cn.gov.cn.gmplp.cn http://www.morning.lbbgf.cn.gov.cn.lbbgf.cn http://www.morning.shinezoneserver.com.gov.cn.shinezoneserver.com http://www.morning.pbksb.cn.gov.cn.pbksb.cn http://www.morning.hxgly.cn.gov.cn.hxgly.cn