java 纯代码导出pdf合并单元格

java 纯代码导出pdf合并单元格
接上篇博客 java导出pdf(纯代码实现) 后有一部分猿友叫我提供一下源码,实际上我的源码已经贴在帖子上了,都是同样的步骤,只是加多一点设置就可以了。今天我再次上传一下相对情况比较完整导出PDF的场景,包含列表,合并单元格,设置边框等,具体请先看效果图:
注:次效果图仅供参考,内容均为测试数据不具有任何意义。
在这里插入图片描述
废话不多说,直接上源码:

@SneakyThrows@PostMapping("/download")@ApiOperation(value = "模板下载")public void download(@RequestBody TemplateDownloadDTO downloadDTO, HttpServletRequest request, HttpServletResponse response){//该导出仅针对一条数据故要传id确定数据Assert.notNull(downloadDTO.getId(),"id必传");request.getSession();String fileName = "文件名称";PdfUtil.setResponseContentType(response,fileName);stockOutService.download(downloadDTO,response);}

以下为导出PDF头部设置,具体在另外一个帖子中有

public static void setResponseContentType(HttpServletResponse response, String fileName) throws UnsupportedEncodingException {response.setContentType("application/pdf");response.setCharacterEncoding("utf-8");response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "utf-8") + ".pdf");response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");}

以下是逻辑部分

/*** 调运明细模板下载** @param downloadDTO 入参* @param response    返回*/@Overridepublic void download(TemplateDownloadDTO downloadDTO, HttpServletResponse response) {		//你自己的查询数据的逻辑部分,我这里做了删减不展示List<StockOutDtlVO> vos = BeanUtils.copyListPropertiesByClass(list, StockOutDtlVO.class);vo.setDtls(vos);//定义全局字体静态变量Font titlefont;Font headfont = null;Font headfont1 = null;Font keyfont = null;Font textfont = null;Font textfont1 = null;Font content = null;Font space = null;Font space1 = null;Font space2 = null;Font space3 = null;//最大宽度try {BaseFont font = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);titlefont = new Font(font, 16, Font.BOLD);//四号headfont = new Font(font, 14, Font.BOLD);headfont1 = new Font(font, 14, Font.NORMAL);//三号content = new Font(font, 16, Font.NORMAL);//小四textfont = new Font(font, 11, Font.BOLD);textfont1 = new Font(font, 11, Font.NORMAL);space = new Font(font, 2, Font.NORMAL);space1 = new Font(font, 10, Font.NORMAL);space2 = new Font(font, 30, Font.NORMAL);space3 = new Font(font, 20, Font.NORMAL);} catch (Exception e) {e.printStackTrace();}BaseFont bf;Font font = null;try {//创建字体bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);font = new Font(bf, 22, Font.BOLD, BaseColor.BLACK);} catch (Exception e) {e.printStackTrace();}Document document = new Document(new Rectangle(PageSize.A4));//设置PDF工作区上下左右和纸张的边距document.setMargins(60, 60, 72, 72);try {PdfWriter writer = PdfWriter.getInstance(document, response.getOutputStream());//页码,具体详见另外一篇帖子writer.setPageEvent(new PdfPageUtil());document.open();Paragraph paragraph = new Paragraph("深圳市市级救灾物资调运明细表", font);paragraph.setAlignment(Element.ALIGN_CENTER);document.add(paragraph);document.add(new Paragraph("\n", space1));Paragraph paragraph1 = new Paragraph(CharSequenceUtil.format("编号:{}", vo.getDjbh()), headfont1);paragraph1.setAlignment(Element.ALIGN_RIGHT);document.add(paragraph1);document.add(new Paragraph("\n", space));float[] widths = {25f, 25f, 25f, 25f, 25f, 25f};PdfPTable table = new PdfPTable(widths);table.setSpacingBefore(20f);table.setWidthPercentage(100.0f);table.setHeaderRows(Element.ALIGN_CENTER);table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);PdfPCell cell = null;//第一行cell = new PdfPCell(new Paragraph("调出单位", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setFixedHeight(55);table.addCell(cell);cell = new PdfPCell(new Paragraph(vo.getDcdwmc(), textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("接收单位", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph(vo.getJsdwmc(), textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("储备服务单位", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("XXXX", textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("调出地点", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setFixedHeight(55);table.addCell(cell);cell = new PdfPCell(new Paragraph(vo.getDckdmc(), textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("接收地点", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph(vo.getPsdz(), textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("车牌号", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph(null, textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("联系人", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setFixedHeight(55);table.addCell(cell);cell = new PdfPCell(new Paragraph("联系人", textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("联系人", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph(vo.getJsdwlxr(), textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("联系人\n(司机)", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph(null, textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("联系电话", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setFixedHeight(40);table.addCell(cell);cell = new PdfPCell(new Paragraph("1300000000", textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("联系电话", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph(vo.getJsdwlxrdh(), textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("联系人电话", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph(null, textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("车型及运输费用结算", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setFixedHeight(55);table.addCell(cell);String concent = CharSequenceUtil.format("车型:{} \n\n 结算方式:{}", getCx(vo), getJsfs(vo));cell = new PdfPCell(new Paragraph(concent, textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);//合并单元格cell.setColspan(5);cell.setRowspan(1);table.addCell(cell);cell = new PdfPCell(new Paragraph("调出时间", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setFixedHeight(40);table.addCell(cell);cell = new PdfPCell(new Paragraph("    月      日      时      分", textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setColspan(2);cell.setRowspan(1);table.addCell(cell);cell = new PdfPCell(new Paragraph("应送达时间", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("    月      日      时      分", textfont1));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setColspan(2);cell.setRowspan(1);table.addCell(cell);cell = new PdfPCell(new Paragraph("物资名称", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);cell.setFixedHeight(40);table.addCell(cell);cell = new PdfPCell(new Paragraph("规格型号", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);//后面2个单元格合并cell.setColspan(2);//合并为1个cell.setRowspan(1);table.addCell(cell);cell = new PdfPCell(new Paragraph("数量", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("单位", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);cell = new PdfPCell(new Paragraph("备注", textfont));cell.setVerticalAlignment(Element.ALIGN_MIDDLE);cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);//以下为列表数据输出List<StockOutDtlVO> dtl = vo.getDtls();if (dtl.size() > 0) {for (StockOutDtlVO stock : dtl) {PdfPCell cell1 = new PdfPCell(new Paragraph(stock.getWzmc(), textfont1));PdfPCell cell2 = new PdfPCell(new Paragraph(stock.getGgxh(), textfont1));PdfPCell cell3 = new PdfPCell(new Paragraph(stock.getSl().toString(), textfont1));PdfPCell cell4 = new PdfPCell(new Paragraph(stock.getDw(), textfont1));PdfPCell cell5 = new PdfPCell(new Paragraph(stock.getBz(), textfont1));cell1.setHorizontalAlignment(Element.ALIGN_CENTER);cell1.setVerticalAlignment(Element.ALIGN_MIDDLE);cell1.setFixedHeight(40);cell2.setHorizontalAlignment(Element.ALIGN_CENTER);cell2.setVerticalAlignment(Element.ALIGN_MIDDLE);cell2.setColspan(2);cell2.setRowspan(1);
//                    cell2.setFixedHeight(20);cell3.setHorizontalAlignment(Element.ALIGN_CENTER);cell3.setVerticalAlignment(Element.ALIGN_MIDDLE);
//                    cell3.setFixedHeight(20);cell4.setHorizontalAlignment(Element.ALIGN_CENTER);cell4.setVerticalAlignment(Element.ALIGN_MIDDLE);
//                    cell4.setFixedHeight(20);cell5.setHorizontalAlignment(Element.ALIGN_CENTER);cell5.setVerticalAlignment(Element.ALIGN_MIDDLE);
//                    cell5.setFixedHeight(20);table.addCell(cell1);table.addCell(cell2);table.addCell(cell3);table.addCell(cell4);table.addCell(cell5);}}document.add(table);document.add(new Paragraph("\n", space2));float[] widthes = {25f, 25f};table = new PdfPTable(widthes);table.setSpacingBefore(20f);table.setWidthPercentage(100.0f);PdfPCell cell1 = new PdfPCell(new Paragraph("储备管理服务单位:", headfont1));cell1.setVerticalAlignment(Element.ALIGN_LEFT);cell1.setHorizontalAlignment(Element.ALIGN_MIDDLE);cell1.setFixedHeight(35);//加上该配置不显示单元格边框cell1.setBorder(0);PdfPCell cell2 = new PdfPCell(new Paragraph("承运司机:", headfont1));cell2.setVerticalAlignment(Element.ALIGN_LEFT);cell2.setHorizontalAlignment(Element.ALIGN_MIDDLE);cell2.setBorder(0);table.addCell(cell1);table.addCell(cell2);document.add(table);float[] widthe2 = {25f, 25f, 25f};table = new PdfPTable(widthe2);table.setSpacingBefore(20f);table.setWidthPercentage(100.0f);PdfPCell cell3 = new PdfPCell(new Paragraph("调出单位初审:", headfont1));cell3.setVerticalAlignment(Element.ALIGN_LEFT);cell3.setHorizontalAlignment(Element.ALIGN_MIDDLE);cell3.setFixedHeight(35);cell3.setBorder(0);PdfPCell cell4 = new PdfPCell(new Paragraph("复核:", headfont1));cell4.setVerticalAlignment(Element.ALIGN_LEFT);cell4.setHorizontalAlignment(Element.ALIGN_MIDDLE);cell4.setBorder(0);PdfPCell cell5 = new PdfPCell(new Paragraph("领导审批:", headfont1));cell5.setVerticalAlignment(Element.ALIGN_LEFT);cell5.setHorizontalAlignment(Element.ALIGN_MIDDLE);cell5.setBorder(0);table.addCell(cell3);table.addCell(cell4);table.addCell(cell5);document.add(table);float[] widthe3 = {25f, 25f};table = new PdfPTable(widthe3);table.setSpacingBefore(20f);table.setWidthPercentage(100.0f);PdfPCell cell6 = new PdfPCell(new Paragraph("接收单位签收人:", headfont1));cell6.setVerticalAlignment(Element.ALIGN_LEFT);cell6.setHorizontalAlignment(Element.ALIGN_MIDDLE);cell6.setFixedHeight(35);cell6.setBorder(0);PdfPCell cell7 = new PdfPCell(new Paragraph("签收时间:    月    日    时    分", headfont1));cell7.setVerticalAlignment(Element.ALIGN_LEFT);cell7.setHorizontalAlignment(Element.ALIGN_MIDDLE);cell7.setBorder(0);table.addCell(cell6);table.addCell(cell7);document.add(table);document.close();} catch (Exception e) {e.printStackTrace();}}

该用到的步骤我已经标注的很详细了,即是我自己的学习记录希望能帮到各位猿友。如有不足之处还望多多指教!

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

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

相关文章

Python中实现列表边循环边删除的详细指南

更多Python学习内容&#xff1a;ipengtao.com 在 Python 中&#xff0c;有时需要在遍历列表的同时对其进行修改&#xff0c;即边循环边删除元素。这可能涉及到一些注意事项&#xff0c;以确保不会导致意外结果。本文将深入探讨如何在 Python 中实现这一需求&#xff0c;并提供详…

使用vue3实现echarts漏斗图表以及实现echarts全屏放大效果

1.首先安装echarts 安装命令&#xff1a;npm install echarts --save 2.页面引入 echarts import * as echarts from echarts; 3.代码 <template> <div id"main" :style"{ width: 400px, height: 500px }"></div> </template> …

基于element ui封装table组件

效果图&#xff1a; 1.封装表格代码如下 <template> <div><div class"TableList"><el-tablev-loading"loading"selection-change"selectionChange"class"table":data"tableData":border"hasBorde…

table表格中使用el-popover 无效问题解决

实例只针对单个的按钮管用在表格里每一列都有el-popover相当于是v-for遍历了 所以我们在触发按钮的时候并不是单个的触发某一个 主要执行 代码 <el-popover placement"left" :ref"popover-${scope.$index}"> 动态绑定了ref 关闭弹窗 执行deltask…

Centos如何修改ssh端口

想必很大一部分的同学用的是centos服务器&#xff0c;对于默认的22端口存在一定的安全风险&#xff0c;所以今天我们一起看下如何修改ssh端口 一、什么是SSH SSH&#xff08;Secure Shell&#xff09;是一种安全的远程登录协议&#xff0c;它允许您通过网络远程连接到Linux系统…

【零基础入门VUE】VueJS - 环境设置

✍面向读者&#xff1a;所有人 ✍所属专栏&#xff1a;零基础入门VUE专栏https://blog.csdn.net/arthas777/category_12537076.html 直接在 HTML 文件中使用 <script> 标签 <html><head><script type "text/javascript" src "vue.min.j…

【一分钟】ThinkPHP v6.0 (poc-yaml-thinkphp-v6-file-write)环境复现及poc解析

写在前面 一分钟表示是非常短的文章&#xff0c;只会做简单的描述。旨在用较短的时间获取有用的信息 环境下载 官方环境下载器&#xff1a;https://getcomposer.org/Composer-Setup.exe 下载文档时可以设置代理&#xff0c;不然下载不上&#xff0c;你懂的 下载成功 cmd cd…

SASS循环

<template><div><button class"btn type-1">默认按钮</button><button class"type-2">主要按钮</button><button class"type-3">成功按钮</button><button class"type-4">信息…

Jetpack Compose中使用Android View

使用AndroidView创建日历 Composable fun AndroidViewPage() {AndroidView(factory {CalendarView(it)},modifier Modifier.fillMaxWidth(),update {it.setOnDateChangeListener { view, year, month, day ->Toast.makeText(view.context, "${year}年${month 1}月$…

《MySQL》事务篇

事务特性 ACID Atomicity原子性&#xff1a;事务中的操作要么全部完成&#xff0c;要么全部失败。 Consistency一致性&#xff1a;事务操作前后&#xff0c;数据满足完整性约束。 Isolation隔离性&#xff1a;允许并发执行事务&#xff0c;每个事务都有自己的数据空间&…

Linux中的gcc\g++使用

文章目录 gcc\g的使用预处理编译汇编链接函数库gcc选项 gcc\g的使用 这里我们需要知道gcc和g实际上是对应的c语言和c编译器&#xff0c;而其他的Java&#xff08;半解释型&#xff09;&#xff0c;PHP&#xff0c;Python等语言实际上是解释型语言&#xff0c;因此我们经常能听…

单字符检测模型charnet使用方法,极简

Git链接 安装按照上面的说明&#xff0c;说下使用。 把tools下面的test做了一点修改&#xff0c;可以读取一张图片&#xff0c;把里面的单个字符都检测和识别出来。 然后绘制到屏幕上。 import torch from charnet.modeling.model import CharNet import cv2, os import num…

scratch打砖块游戏 2023年12月中国电子学会图形化编程 少儿编程 scratch编程等级考试三级真题和答案解析

scratch打砖块游戏 2023年12月电子学会图形化编程Scratch等级考试三级真题 一、题目要求 1、准备工作 (1)删除小猫角色,选择角色小球Ball、砖块Button3和球板Paddle (2)选择背景Stars,在背景底端绘制一条红色的线段 (3)建立一个变量“分数” 2、功能实现 (1)…

EXPLORING DIFFUSION MODELS FOR UNSUPERVISED VIDEO ANOMALY DETECTION 论文阅读

EXPLORING DIFFUSION MODELS FOR UNSUPERVISED VIDEO ANOMALY DETECTION 论文阅读 ABSTRACT1. INTRODUCTION2. RELATEDWORK3. METHOD4. EXPERIMENTAL ANALYSIS AND RESULTS4.1. Comparisons with State-Of-The-Art (SOTA)4.2. Diffusion Model Analysis4.3. Qualitative Result…

iPhone 13 Pro 更换『移植电芯』和『超容电池』体验

文章目录 考虑换电池Ⅰ 方案一Ⅱ 方案二 总结危险 Note系列地址 简 述: 首发买的iPhone 13P &#xff08;2021.09&#xff09;&#xff0c;随性使用一年出头&#xff0c;容量就暴跌 85%&#xff0c;对比朋友一起买的同款&#xff0c;还是95%。这已经基本得一天两充 >_<&a…

C# WPF上位机开发(报表导出)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 对于在工厂上班的小伙伴来说&#xff0c;导出生产数据、生成报表&#xff0c;这是很习以为常的一个工作。之前的文章中&#xff0c;虽然我们也介绍…

git 学习 之一个规范的 commit 如何写

最好的话做一件完整的事情就提交一次

MetalLB:本地Kubernetes集群的LoadBalancer负载均衡利器

背景 在本地集群进行测试时&#xff0c;我们常常面临一个棘手的问题&#xff1a;Service Type不支持LoadBalancer&#xff0c;而我们只能选择使用NodePort作为替代。这种情况下&#xff0c;我们通常会配置Service为NodePort&#xff0c;并使用externalIPs将流量导入Kubernetes…

人工智能(AI)的发展历程是怎样的?无际Ai带来分享

自人工智能&#xff08;AI&#xff09;概念诞生以来&#xff0c;它经历了数次高潮与低谷的起伏。从最初的神经网络模型到如今的深度学习技术&#xff0c;AI已经成为驱动21世纪科技发展的重要力量。在此过程中&#xff0c;AI不仅改变了科技领域的发展方向&#xff0c;也在逐步影…

代码随想录刷题笔记(DAY2)

今日总结&#xff1a;今天在学 vue 做项目&#xff0c;学校还有很多作业要完成&#xff0c;熬到现在写完了三道题&#xff0c;有点太晚了&#xff0c;最后一道题的题解明天早起补上。 Day 2 01. 有序数组的平方&#xff08;No. 977&#xff09; 给你一个按 非递减顺序 排序的…