diff --git a/Dockerfile_gray b/Dockerfile_gray
index 07a2e3d..f5d7026 100644
--- a/Dockerfile_gray
+++ b/Dockerfile_gray
@@ -1,5 +1,7 @@
FROM openjdk:8u181-jre-alpine
ENV LANG en_US.UTF-8
+RUN mkdir -p /usr/share/fonts/chinese
+COPY fonts/* /usr/share/fonts/chinese/
RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories &&\
apk add tzdata &&\
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone &&\
@@ -10,7 +12,6 @@ RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk
apk add msttcorefonts-installer &&\
apk add fontconfig &&\
apk --update add unzip &&\
- mkdir -p /usr/share/fonts/chinese &&\
cd /tmp &&\
wget http://kkfileview.keking.cn/fonts.zip &&\
unzip -d /usr/share/fonts/chinese fonts.zip &&\
@@ -18,6 +19,11 @@ RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk
mkfontscale &&\
mkfontdir &&\
fc-cache -fv &&\
+ COPY /usr/share/fonts/korean /usr/share/fonts &&\
+ cd /usr/share/fonts/korean &&\
+ mkfontscale &&\
+ mkfontdir &&\
+ fc-cache -fv &&\
rm -rf /var/cache/*
COPY ./server/target/crm-print-server-1.0.0.jar /
diff --git a/crm-print.iml b/crm-print.iml
deleted file mode 100644
index f409c0e..0000000
--- a/crm-print.iml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/fonts/(환)세고딕.TTF b/fonts/(환)세고딕.TTF
new file mode 100755
index 0000000..b7bb1a3
Binary files /dev/null and b/fonts/(환)세고딕.TTF differ
diff --git a/fonts/.gitkeep b/fonts/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/office-plugin/office-plugin.iml b/office-plugin/office-plugin.iml
deleted file mode 100644
index 46b5623..0000000
--- a/office-plugin/office-plugin.iml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/server/src/main/java/cn/keking/service/ContractService.java b/server/src/main/java/cn/keking/service/ContractService.java
index 736a1bf..5b39011 100644
--- a/server/src/main/java/cn/keking/service/ContractService.java
+++ b/server/src/main/java/cn/keking/service/ContractService.java
@@ -229,8 +229,15 @@ public class ContractService {
return desc;
}
+ /**
+ * 返回 pdf 文件
+ * @param templateName
+ * @param dataMap
+ * @return
+ * @throws Exception
+ */
- public File download(String templateName, Map dataMap) throws Exception {
+ public File download(String templateName, Map dataMap,String type) throws Exception {
OutputStream os = null;
try {
File outFile = new File(Consts.uploadAbsDir());
@@ -259,10 +266,57 @@ public class ContractService {
xwpfDocument.write(os);
String outFilePath = Consts.uploadAbsDir()+ File.separator+ pdfName;
officeToPdfService.openOfficeToPDF(pathFile, outFilePath);
- //返回pdf
- return new File(outFilePath);
+ if("pdf".equals(type)){
+ //返回pdf
+ return new File(outFilePath);
+ }
//返回word
- //return new File(pathFile);
+ return new File(pathFile);
+ } finally {
+ if (os != null) {
+ os.close();
+ }
+ }
+ }
+
+
+
+ /**
+ * 返回 word 文件
+ * @param templateName
+ * @param dataMap
+ * @return
+ * @throws Exception
+ */
+
+ public File downloadWord(String templateName, Map dataMap) throws Exception {
+ OutputStream os = null;
+ try {
+ File outFile = new File(Consts.uploadAbsDir());
+ if (!outFile.exists()) {
+ outFile.mkdirs();
+ }
+ String templatePath = Consts.getTemplatePath();
+ String abTemplatePath = templatePath + File.separator + templateName + ".docx";
+ //判断模板是否存在
+ File file = new File(abTemplatePath);
+ if(!file.exists()){
+ throw new KkFileException("请先上传模板!");
+ }
+ XWPFDocument xwpfDocument = WordExportUtil.exportWord07(abTemplatePath, dataMap);
+ //如果是签收单,则需要合并单元格
+ if (Consts.RECEIPT_FORM.equals(templateName)){
+ List