From b0ba39d78149af5e6f21bb4d5a6bfd23256996aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?=
<7507756+jiang_yuqi@user.noreply.gitee.com>
Date: Tue, 17 Dec 2024 22:35:51 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 47 ++
.../com/yanzhu/manage/domain/BasSignet.java | 126 +++++
.../com/yanzhu/manage/domain/BasTemplate.java | 126 +++++
.../yanzhu/manage/mapper/BasSignetMapper.java | 61 +++
.../manage/mapper/BasTemplateMapper.java | 61 +++
.../mapper/manage/BasSignetMapper.xml | 99 ++++
.../mapper/manage/BasTemplateMapper.xml | 100 ++++
yanzhu-modules/yanzhu-manage/pom.xml | 54 ++-
.../yanzhu/manage/config/ProfileConfig.java | 13 +
.../com/yanzhu/manage/config/SystemUtils.java | 33 ++
.../manage/controller/ProPlanController.java | 27 +-
.../com/yanzhu/manage/utils/pdf/FileUtil.java | 321 +++++++++++++
.../manage/utils/pdf/MyTableRenderPolicy.java | 305 ++++++++++++
.../manage/utils/pdf/PdfImageSignetUtil.java | 452 ++++++++++++++++++
.../com/yanzhu/manage/utils/pdf/PoiUtil.java | 436 +++++++++++++++++
.../pdf/ShangWuBiaoTableRenderPolicy.java | 191 ++++++++
.../manage/utils/pdf/WordToPdfUtil.java | 152 ++++++
.../src/main/resources/Aspose_license.xml | 14 +
18 files changed, 2592 insertions(+), 26 deletions(-)
create mode 100644 yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java
create mode 100644 yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasTemplate.java
create mode 100644 yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasSignetMapper.java
create mode 100644 yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasTemplateMapper.java
create mode 100644 yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml
create mode 100644 yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/SystemUtils.java
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/FileUtil.java
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/PdfImageSignetUtil.java
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/PoiUtil.java
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/ShangWuBiaoTableRenderPolicy.java
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/WordToPdfUtil.java
create mode 100644 yanzhu-modules/yanzhu-manage/src/main/resources/Aspose_license.xml
diff --git a/pom.xml b/pom.xml
index 0ecaea17..4b97c410 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,11 @@
4.0.6.B
2.14.2
5.8.20
+ 1.9.1
+ 2.1.7
+ 1.6.0-beta1
+ 1.0
+ 5.5.13
@@ -225,6 +230,48 @@
${yanzhu.version}
+
+
+ com.lowagie
+ itext
+ ${lowagie.version}
+
+
+
+ com.lowagie
+ itext-rtf
+ ${lowagie.version}
+
+
+
+ com.deepoove
+ poi-tl
+ ${poi-tl.version}
+
+
+
+
+
+ org.aspectj
+ aspectjweaver
+ ${aspectjweaver.version}
+
+
+
+ com.aspose
+ aspose-words
+ 15.8.0
+
+
+
+
+
+ com.itextpdf
+ itextpdf
+ ${itextpdf.version}
+
+
+
net.sf.mpxj
mpxj
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java
new file mode 100644
index 00000000..5ca234c0
--- /dev/null
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java
@@ -0,0 +1,126 @@
+package com.yanzhu.manage.domain;
+
+import com.yanzhu.common.core.annotation.Excel;
+import com.yanzhu.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 业务签名管理对象 bas_signet
+ *
+ * @author JiangYuQi
+ * @date 2024-12-17
+ */
+public class BasSignet extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 主键 */
+ private Long id;
+
+ /** 公司主键 */
+ @Excel(name = "公司主键")
+ private Long comId;
+
+ /** 项目主键 */
+ @Excel(name = "项目主键")
+ private Long projectId;
+
+ /** 用户主键 */
+ @Excel(name = "用户主键")
+ private Long userId;
+
+ /** 签名地址 */
+ @Excel(name = "签名地址")
+ private String signetPath;
+
+ /** 签名使用次数 */
+ @Excel(name = "签名使用次数")
+ private Long signetNumber;
+
+ /** 删除标识 */
+ @Excel(name = "删除标识")
+ private Long isDel;
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+ public void setComId(Long comId)
+ {
+ this.comId = comId;
+ }
+
+ public Long getComId()
+ {
+ return comId;
+ }
+ public void setProjectId(Long projectId)
+ {
+ this.projectId = projectId;
+ }
+
+ public Long getProjectId()
+ {
+ return projectId;
+ }
+ public void setUserId(Long userId)
+ {
+ this.userId = userId;
+ }
+
+ public Long getUserId()
+ {
+ return userId;
+ }
+ public void setSignetPath(String signetPath)
+ {
+ this.signetPath = signetPath;
+ }
+
+ public String getSignetPath()
+ {
+ return signetPath;
+ }
+ public void setSignetNumber(Long signetNumber)
+ {
+ this.signetNumber = signetNumber;
+ }
+
+ public Long getSignetNumber()
+ {
+ return signetNumber;
+ }
+ public void setIsDel(Long isDel)
+ {
+ this.isDel = isDel;
+ }
+
+ public Long getIsDel()
+ {
+ return isDel;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("comId", getComId())
+ .append("projectId", getProjectId())
+ .append("userId", getUserId())
+ .append("signetPath", getSignetPath())
+ .append("signetNumber", getSignetNumber())
+ .append("isDel", getIsDel())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("remark", getRemark())
+ .toString();
+ }
+}
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasTemplate.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasTemplate.java
new file mode 100644
index 00000000..e9439b72
--- /dev/null
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasTemplate.java
@@ -0,0 +1,126 @@
+package com.yanzhu.manage.domain;
+
+import com.yanzhu.common.core.annotation.Excel;
+import com.yanzhu.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 业务模板管理对象 bas_template
+ *
+ * @author JiangYuQi
+ * @date 2024-12-17
+ */
+public class BasTemplate extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 主键 */
+ private Long id;
+
+ /** 公司主键 */
+ @Excel(name = "公司主键")
+ private Long comId;
+
+ /** 项目主键 */
+ @Excel(name = "项目主键")
+ private Long projectId;
+
+ /** 模板名称 */
+ @Excel(name = "模板名称")
+ private String temName;
+
+ /** 模板类型 */
+ @Excel(name = "模板类型")
+ private String temType;
+
+ /** 模板地址 */
+ @Excel(name = "模板地址")
+ private String temPath;
+
+ /** 删除标识 */
+ @Excel(name = "删除标识")
+ private Long isDel;
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+ public void setComId(Long comId)
+ {
+ this.comId = comId;
+ }
+
+ public Long getComId()
+ {
+ return comId;
+ }
+ public void setProjectId(Long projectId)
+ {
+ this.projectId = projectId;
+ }
+
+ public Long getProjectId()
+ {
+ return projectId;
+ }
+ public void setTemName(String temName)
+ {
+ this.temName = temName;
+ }
+
+ public String getTemName()
+ {
+ return temName;
+ }
+ public void setTemType(String temType)
+ {
+ this.temType = temType;
+ }
+
+ public String getTemType()
+ {
+ return temType;
+ }
+ public void setTemPath(String temPath)
+ {
+ this.temPath = temPath;
+ }
+
+ public String getTemPath()
+ {
+ return temPath;
+ }
+ public void setIsDel(Long isDel)
+ {
+ this.isDel = isDel;
+ }
+
+ public Long getIsDel()
+ {
+ return isDel;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("comId", getComId())
+ .append("projectId", getProjectId())
+ .append("temName", getTemName())
+ .append("temType", getTemType())
+ .append("temPath", getTemPath())
+ .append("isDel", getIsDel())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("remark", getRemark())
+ .toString();
+ }
+}
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasSignetMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasSignetMapper.java
new file mode 100644
index 00000000..2e5ce8f4
--- /dev/null
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasSignetMapper.java
@@ -0,0 +1,61 @@
+package com.yanzhu.manage.mapper;
+
+import java.util.List;
+import com.yanzhu.manage.domain.BasSignet;
+
+/**
+ * 业务签名管理Mapper接口
+ *
+ * @author JiangYuQi
+ * @date 2024-12-17
+ */
+public interface BasSignetMapper
+{
+ /**
+ * 查询业务签名管理
+ *
+ * @param id 业务签名管理主键
+ * @return 业务签名管理
+ */
+ public BasSignet selectBasSignetById(Long id);
+
+ /**
+ * 查询业务签名管理列表
+ *
+ * @param basSignet 业务签名管理
+ * @return 业务签名管理集合
+ */
+ public List selectBasSignetList(BasSignet basSignet);
+
+ /**
+ * 新增业务签名管理
+ *
+ * @param basSignet 业务签名管理
+ * @return 结果
+ */
+ public int insertBasSignet(BasSignet basSignet);
+
+ /**
+ * 修改业务签名管理
+ *
+ * @param basSignet 业务签名管理
+ * @return 结果
+ */
+ public int updateBasSignet(BasSignet basSignet);
+
+ /**
+ * 删除业务签名管理
+ *
+ * @param id 业务签名管理主键
+ * @return 结果
+ */
+ public int deleteBasSignetById(Long id);
+
+ /**
+ * 批量删除业务签名管理
+ *
+ * @param ids 需要删除的数据主键集合
+ * @return 结果
+ */
+ public int deleteBasSignetByIds(Long[] ids);
+}
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasTemplateMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasTemplateMapper.java
new file mode 100644
index 00000000..5ee2eb1e
--- /dev/null
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/BasTemplateMapper.java
@@ -0,0 +1,61 @@
+package com.yanzhu.manage.mapper;
+
+import java.util.List;
+import com.yanzhu.manage.domain.BasTemplate;
+
+/**
+ * 业务模板管理Mapper接口
+ *
+ * @author JiangYuQi
+ * @date 2024-12-17
+ */
+public interface BasTemplateMapper
+{
+ /**
+ * 查询业务模板管理
+ *
+ * @param id 业务模板管理主键
+ * @return 业务模板管理
+ */
+ public BasTemplate selectBasTemplateById(Long id);
+
+ /**
+ * 查询业务模板管理列表
+ *
+ * @param basTemplate 业务模板管理
+ * @return 业务模板管理集合
+ */
+ public List selectBasTemplateList(BasTemplate basTemplate);
+
+ /**
+ * 新增业务模板管理
+ *
+ * @param basTemplate 业务模板管理
+ * @return 结果
+ */
+ public int insertBasTemplate(BasTemplate basTemplate);
+
+ /**
+ * 修改业务模板管理
+ *
+ * @param basTemplate 业务模板管理
+ * @return 结果
+ */
+ public int updateBasTemplate(BasTemplate basTemplate);
+
+ /**
+ * 删除业务模板管理
+ *
+ * @param id 业务模板管理主键
+ * @return 结果
+ */
+ public int deleteBasTemplateById(Long id);
+
+ /**
+ * 批量删除业务模板管理
+ *
+ * @param ids 需要删除的数据主键集合
+ * @return 结果
+ */
+ public int deleteBasTemplateByIds(Long[] ids);
+}
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml
new file mode 100644
index 00000000..b63eaab7
--- /dev/null
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id, com_id, project_id, user_id, signet_path, signet_number, is_del, create_by, create_time, update_by, update_time, remark from bas_signet
+
+
+
+
+
+
+
+ insert into bas_signet
+
+ com_id,
+ project_id,
+ user_id,
+ signet_path,
+ signet_number,
+ is_del,
+ create_by,
+ create_time,
+ update_by,
+ update_time,
+ remark,
+
+
+ #{comId},
+ #{projectId},
+ #{userId},
+ #{signetPath},
+ #{signetNumber},
+ #{isDel},
+ #{createBy},
+ #{createTime},
+ #{updateBy},
+ #{updateTime},
+ #{remark},
+
+
+
+
+ update bas_signet
+
+ com_id = #{comId},
+ project_id = #{projectId},
+ user_id = #{userId},
+ signet_path = #{signetPath},
+ signet_number = #{signetNumber},
+ is_del = #{isDel},
+ create_by = #{createBy},
+ create_time = #{createTime},
+ update_by = #{updateBy},
+ update_time = #{updateTime},
+ remark = #{remark},
+
+ where id = #{id}
+
+
+
+ delete from bas_signet where id = #{id}
+
+
+
+ delete from bas_signet where id in
+
+ #{id}
+
+
+
\ No newline at end of file
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml
new file mode 100644
index 00000000..0e01f3b2
--- /dev/null
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id, com_id, project_id, tem_name, tem_type, tem_path, is_del, create_by, create_time, update_by, update_time, remark from bas_template
+
+
+
+
+
+
+
+ insert into bas_template
+
+ com_id,
+ project_id,
+ tem_name,
+ tem_type,
+ tem_path,
+ is_del,
+ create_by,
+ create_time,
+ update_by,
+ update_time,
+ remark,
+
+
+ #{comId},
+ #{projectId},
+ #{temName},
+ #{temType},
+ #{temPath},
+ #{isDel},
+ #{createBy},
+ #{createTime},
+ #{updateBy},
+ #{updateTime},
+ #{remark},
+
+
+
+
+ update bas_template
+
+ com_id = #{comId},
+ project_id = #{projectId},
+ tem_name = #{temName},
+ tem_type = #{temType},
+ tem_path = #{temPath},
+ is_del = #{isDel},
+ create_by = #{createBy},
+ create_time = #{createTime},
+ update_by = #{updateBy},
+ update_time = #{updateTime},
+ remark = #{remark},
+
+ where id = #{id}
+
+
+
+ delete from bas_template where id = #{id}
+
+
+
+ delete from bas_template where id in
+
+ #{id}
+
+
+
\ No newline at end of file
diff --git a/yanzhu-modules/yanzhu-manage/pom.xml b/yanzhu-modules/yanzhu-manage/pom.xml
index 54df4d83..90d705ca 100644
--- a/yanzhu-modules/yanzhu-manage/pom.xml
+++ b/yanzhu-modules/yanzhu-manage/pom.xml
@@ -91,6 +91,54 @@
compile
+
+
+ com.lowagie
+ itext
+
+
+
+ com.lowagie
+ itext-rtf
+
+
+
+ com.lowagie
+ iTextAsian
+ 1.0
+
+
+
+ com.deepoove
+ poi-tl
+
+
+
+
+
+ org.aspectj
+ aspectjweaver
+
+
+
+ com.aspose
+ aspose-words
+
+
+
+
+
+ com.itextpdf
+ itextpdf
+
+
+
+
+ org.jsoup
+ jsoup
+ 1.17.2
+
+
com.aspose
aspose-tasks
@@ -98,11 +146,7 @@
system
${pom.basedir}\libs\aspose-tasks-24.10-jdk17.jar
-
- org.jsoup
- jsoup
- 1.17.2
-
+
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/ProfileConfig.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/ProfileConfig.java
index da802378..f79213f5 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/ProfileConfig.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/ProfileConfig.java
@@ -2,6 +2,7 @@ package com.yanzhu.manage.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
/**
@@ -14,4 +15,16 @@ public class ProfileConfig {
private String path;
+ public static String profile = "/statics";
+
+ public static String profilePath;
+
+ /**
+ * 初始化...
+ * @author JiangYuQi
+ */
+ @Bean
+ public void initProfileConfig() {
+ profilePath = path;
+ }
}
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/SystemUtils.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/SystemUtils.java
new file mode 100644
index 00000000..30aca37e
--- /dev/null
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/config/SystemUtils.java
@@ -0,0 +1,33 @@
+package com.yanzhu.manage.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+import java.util.Objects;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "spring.profiles")
+public class SystemUtils {
+
+ private String active;
+
+ /**
+ * 当前环境参数
+ * @author JiangYuQi
+ */
+ public static boolean isLinux = Boolean.FALSE;
+
+ /**
+ * 初始化...
+ * @author JiangYuQi
+ */
+ @Bean
+ public void initSettings() {
+ if(!Objects.equals("dev",active)){
+ isLinux = true;
+ }
+ }
+}
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProPlanController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProPlanController.java
index 45184e46..4a25cbba 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProPlanController.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProPlanController.java
@@ -1,20 +1,8 @@
package com.yanzhu.manage.controller;
-import java.io.File;
-import java.time.ZoneId;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.io.IOException;
-import java.util.UUID;
-import javax.servlet.http.HttpServletResponse;
-
-import com.alibaba.fastjson2.util.DateUtils;
import com.aspose.tasks.Project;
-import com.aspose.tasks.TableCollection;
import com.aspose.tasks.Task;
import com.aspose.tasks.TaskCollection;
-import com.yanzhu.common.core.utils.poi.ExcelUtil;
import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.common.core.web.page.TableDataInfo;
@@ -23,18 +11,15 @@ import com.yanzhu.common.log.enums.BusinessType;
import com.yanzhu.common.security.annotation.RequiresPermissions;
import com.yanzhu.manage.domain.ProPlan;
import com.yanzhu.manage.service.IProPlanService;
-import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* 计划管理Controller
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/FileUtil.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/FileUtil.java
new file mode 100644
index 00000000..c776c463
--- /dev/null
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/FileUtil.java
@@ -0,0 +1,321 @@
+package com.yanzhu.manage.utils.pdf;
+
+import java.io.*;
+import java.text.DecimalFormat;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * ////////////////////////////////////////////////////////////////////
+ * // _ooOoo_
+ * // o8888888o
+ * // 88" . "88
+ * // (| ^_^ |)
+ * // O\ = /O
+ * // ____/`---'\____
+ * // .' \\| |// `.
+ * // / \\||| : |||// \
+ * // / _||||| -:- |||||- \
+ * // | | \\\ - /// | |
+ * // | \_| ''\---/'' | |
+ * // \ .-\__ `-` ___/-. /
+ * // ___`. .' /--.--\ `. . ___
+ * // ."" '< `.___\_<|>_/___.' >'"".
+ * // | | : `- \`.;`\ _ /`;.`/ - ` : | |
+ * // \ \ `-. \_ __\ /__ _/ .-` / /
+ * // ========`-.____`-.___\_____/___.-`____.-'========
+ * // `=---='
+ * // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ * // 佛祖保佑 永无BUG 永不修改
+ * ////////////////////////////////////////////////////////////////////
+ *
+ * @ClassName FileUtil
+ * @Description 文件工具
+ * @Author JiangYuQi
+ * @DateTime 2021/6/8 16:50
+ * @Version 1.0
+ */
+public class FileUtil
+{
+ // 默认设置文件缓存大小 5M
+ private static final int BUFFER_SIZE = 5 * 1024;
+
+ /**
+ * @功能简介:获取文件大小
+ * @应用页面:
+ * @作者姓名:JiangYuQi
+ * @创建时间:2014年10月16日 下午6:56:12
+ * @param f 文件对象File对象
+ * @return:long型的字节数
+ * @throws Exception
+ * :
+ */
+ public static long getFileSizes(File f) throws Exception
+ {
+ long s = 0;
+ if (f.exists())
+ {
+ FileInputStream fis = null;
+ fis = org.apache.commons.io.FileUtils.openInputStream(f);
+ s = fis.available();
+ fis.close();
+ }
+ else
+ {
+ f.createNewFile();
+ //System.out.println("文件不存在");
+ }
+ return s;
+ }
+
+ /**
+ * @功能简介:判断是否存在该目录,不存在则创建
+ * @应用页面:
+ * @作者姓名:JiangYuQi
+ * @创建时间:2014年10月16日 下午6:57:56
+ * @param path
+ * :
+ */
+ public static void createDirectiory(String path)
+ {
+ File dir = org.apache.commons.io.FileUtils.getFile(path);
+ if (!dir.exists() && !dir.isDirectory())
+ {
+ dir.mkdirs();
+ }
+ }
+
+ /**
+ * @功能简介:获取文件夹里面所有文件的大小
+ * @应用页面:
+ * @作者姓名:JiangYuQi
+ * @创建时间:2014年10月16日 下午6:58:33
+ * @param f
+ * @return
+ * @throws Exception
+ * :
+ */
+ public static long getFileSize(File f) throws Exception
+ {
+ long size = 0;
+ File flist[] = f.listFiles();
+ for (int i = 0; i < flist.length; i++)
+ {
+ if (flist[i].isDirectory())
+ {
+ size = size + getFileSize(flist[i]);
+ }
+ else
+ {
+ size = size + flist[i].length();
+ }
+ }
+ return size;
+ }
+
+ /**
+ * @功能简介:根据字节数转换文件大小
+ * @应用页面:
+ * @作者姓名:JiangYuQi
+ * @创建时间:2014年10月16日 下午6:59:20
+ * @param fileS
+ * @return:
+ */
+ public static String formatFileSize(long fileS)
+ {// 转换文件大小
+ DecimalFormat df = new DecimalFormat("#.00");
+ String fileSizeString = "";
+ if (fileS < 1024)
+ {
+ fileSizeString = df.format((double) fileS) + "B";
+ }
+ else if (fileS < 1048576)
+ {
+ fileSizeString = df.format((double) fileS / 1024) + "KB";
+ }
+ else if (fileS < 1073741824)
+ {
+ fileSizeString = df.format((double) fileS / 1048576) + "MB";
+ }
+ else
+ {
+ fileSizeString = df.format((double) fileS / 1073741824) + "GB";
+ }
+ return fileSizeString;
+ }
+
+ /**
+ * @功能简介:递归求取目录文件个数
+ * @应用页面:
+ * @作者姓名:JiangYuQi
+ * @创建时间:2014年10月16日 下午7:00:05
+ * @param f
+ * @return:
+ */
+ public static long getFileListCount(File f)
+ {
+ long size = 0;
+ File flist[] = f.listFiles();
+ size = flist.length;
+ for (int i = 0; i < flist.length; i++)
+ {
+ if (flist[i].isDirectory())
+ {
+ size = size + getFileListCount(flist[i]);
+ size--;
+ }
+ }
+ return size;
+ }
+
+ /**
+ *
+ * @创建人:JiangYuQi
+ * @创建时间:2012-7-13
+ * @功能说明:文件复制
+ * @param sourceFile 源文件
+ * @param targetFile 目标文件
+ * @throws IOException
+ */
+ public static void copyFile(File sourceFile, File targetFile) throws IOException
+ {
+ BufferedInputStream inBuff = null;
+ BufferedOutputStream outBuff = null;
+ try
+ {
+ String tagetFilePath = targetFile.getPath();
+ String tagetFileName = targetFile.getName();
+ File targetFileMl = org.apache.commons.io.FileUtils.getFile(tagetFilePath.replaceAll(tagetFileName, ""));
+ if (!targetFileMl.exists())
+ {
+ targetFileMl.mkdirs();
+ }
+ // 新建文件输入流并对它进行缓冲
+ inBuff = new BufferedInputStream(org.apache.commons.io.FileUtils.openInputStream(sourceFile));
+
+ // 新建文件输出流并对它进行缓冲
+ outBuff = new BufferedOutputStream(org.apache.commons.io.FileUtils.openOutputStream(targetFile));
+
+ // 缓冲数组
+ byte[] b = new byte[BUFFER_SIZE];
+ int len;
+ while ((len = inBuff.read(b)) != -1)
+ {
+ outBuff.write(b, 0, len);
+ }
+ // 刷新此缓冲的输出流
+ outBuff.flush();
+ }
+ finally
+ {
+ // 关闭流
+ if (inBuff != null)
+ inBuff.close();
+ if (outBuff != null)
+ outBuff.close();
+ }
+ }
+
+ /**
+ *
+ * @创建人:JiangYuQi
+ * @创建时间:2012-7-13
+ * @功能说明:根据文件路径进行文件复制
+ * @param sourceFilePath 源文件路径
+ * @param targetFilePath 目标文件路径
+ * @throws IOException
+ */
+ public static void copyFile(String sourceFilePath, String targetFilePath) throws IOException
+ {
+ File sourceFile = org.apache.commons.io.FileUtils.getFile(sourceFilePath);
+ File targetFile = org.apache.commons.io.FileUtils.getFile(targetFilePath);
+ copyFile(sourceFile, targetFile);
+ }
+
+ /**
+ * 文件夹压缩成ZIP
+ *
+ * @param zipFileName 生成压缩文件夹路径
+ * @param sourceFileName 要压缩的文件路径
+ * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
+ * false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
+ * @throws RuntimeException 压缩失败会抛出运行时异常
+ */
+ public static Boolean folderToZip(String zipFileName, String sourceFileName, boolean KeepDirStructure) {
+ Boolean result = true;
+ long start = System.currentTimeMillis();//开始
+ ZipOutputStream zos = null;
+ try {
+ FileOutputStream fileOutputStream = org.apache.commons.io.FileUtils.openOutputStream(org.apache.commons.io.FileUtils.getFile(zipFileName));
+ zos = new ZipOutputStream(fileOutputStream);
+ File sourceFile = org.apache.commons.io.FileUtils.getFile(sourceFileName);
+ compress(sourceFile, zos, sourceFile.getName(), KeepDirStructure);
+ long end = System.currentTimeMillis();//结束
+ //System.out.println("压缩完成,耗时:" + (end - start) + " 毫秒");
+ } catch (Exception e) {
+ result = false;
+ e.printStackTrace();
+ } finally {
+ if (zos != null) {
+ try {
+ zos.close();
+ } catch (IOException e) {
+ e.getStackTrace();
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * 递归压缩方法
+ *
+ * @param sourceFile 源文件
+ * @param zos zip输出流
+ * @param name 压缩后的名称
+ * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
+ * false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
+ * @throws Exception
+ */
+ public static void compress(File sourceFile, ZipOutputStream zos, String name,
+ boolean KeepDirStructure) throws Exception {
+
+ if (sourceFile.isFile()) {
+ // 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
+ zos.putNextEntry(new ZipEntry(name));
+ // copy文件到zip输出流中
+ int len;
+ byte[] buf = new byte[1024];
+ FileInputStream in = org.apache.commons.io.FileUtils.openInputStream(sourceFile);
+ while ((len = in.read(buf)) != -1) {
+ zos.write(buf, 0, len);
+ }
+ // Complete the entry
+ zos.closeEntry();
+ in.close();
+ } else {
+ File[] listFiles = sourceFile.listFiles();
+ if (listFiles == null || listFiles.length == 0) {
+ // 需要保留原来的文件结构时,需要对空文件夹进行处理
+ if (KeepDirStructure) {
+ // 空文件夹的处理
+ zos.putNextEntry(new ZipEntry(name + "/"));
+ // 没有文件,不需要文件的copy
+ zos.closeEntry();
+ }
+ } else {
+ for (File file : listFiles) {
+ // 判断是否需要保留原来的文件结构
+ if (KeepDirStructure) {
+ // 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
+ // 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
+ compress(file, zos, name + "/" + file.getName(), KeepDirStructure);
+ } else {
+ compress(file, zos, file.getName(), KeepDirStructure);
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java
new file mode 100644
index 00000000..df8c12ec
--- /dev/null
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java
@@ -0,0 +1,305 @@
+package com.yanzhu.manage.utils.pdf;
+
+import com.deepoove.poi.NiceXWPFDocument;
+import com.deepoove.poi.XWPFTemplate;
+import com.deepoove.poi.policy.AbstractRenderPolicy;
+import com.deepoove.poi.template.ElementTemplate;
+import com.deepoove.poi.template.run.RunTemplate;
+import com.yanzhu.common.core.text.Convert;
+import com.yanzhu.common.core.utils.StringUtils;
+import org.apache.poi.xwpf.usermodel.*;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * ////////////////////////////////////////////////////////////////////
+ * // _ooOoo_
+ * // o8888888o
+ * // 88" . "88
+ * // (| ^_^ |)
+ * // O\ = /O
+ * // ____/`---'\____
+ * // .' \\| |// `.
+ * // / \\||| : |||// \
+ * // / _||||| -:- |||||- \
+ * // | | \\\ - /// | |
+ * // | \_| ''\---/'' | |
+ * // \ .-\__ `-` ___/-. /
+ * // ___`. .' /--.--\ `. . ___
+ * // ."" '< `.___\_<|>_/___.' >'"".
+ * // | | : `- \`.;`\ _ /`;.`/ - ` : | |
+ * // \ \ `-. \_ __\ /__ _/ .-` / /
+ * // ========`-.____`-.___\_____/___.-`____.-'========
+ * // `=---='
+ * // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ * // 佛祖保佑 永无BUG 永不修改
+ * ////////////////////////////////////////////////////////////////////
+ *
+ * @ClassName MyTableRenderPolicy
+ * @Description 自动以table渲染类
+ * @Author JiangYuQi
+ * @DateTime 2021/6/8 16:50
+ * @Version 1.0
+ */
+public class MyTableRenderPolicy extends AbstractRenderPolicy