合并分支 'dev_third_stage' 到 'feature_20221014_noLogo'
Dev third stage 查看合并请求 laws-nio/laws-weilai!189
This commit is contained in:
+33
-1
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.jero.modules.system.util.FindsDepartsChildrenUtil.convertSysDepartToSysDepartTreeModel;
|
||||
|
||||
@@ -286,7 +288,37 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
|
||||
@Override
|
||||
public List<String> getSubDepIdsByDepId(String departId) {
|
||||
return this.baseMapper.getSubDepIdsByDepId(departId);
|
||||
List<String> idList = new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(departId)) {
|
||||
// 查询所有部门
|
||||
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
|
||||
query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
List<SysDepart> listAll = this.list(query);
|
||||
|
||||
List<SysDepart> result = new ArrayList<>();
|
||||
// 递归查询 指定父节点下的所有子节点,包括父节点
|
||||
if (CollectionUtil.isNotEmpty(listAll)) {
|
||||
recursion(listAll, result, departId);
|
||||
}
|
||||
|
||||
|
||||
idList.add(departId); // 加上父节点
|
||||
idList = result.stream().map(SysDepart::getId).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
return idList;
|
||||
}
|
||||
|
||||
// 递归查询子节点
|
||||
private void recursion(List<SysDepart> listAll, List<SysDepart> result, String fatherId) {
|
||||
List<SysDepart> childern = listAll.stream().filter(e-> fatherId.equals(e.getParentId())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(childern)) {
|
||||
result.addAll(childern);
|
||||
for(SysDepart depart : childern) {
|
||||
recursion(listAll, result, depart.getId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+98
-5
@@ -1025,17 +1025,26 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}
|
||||
}
|
||||
|
||||
//封面
|
||||
//封面(office版本)
|
||||
private void coverCn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
String titleCN,
|
||||
XWPFDocument document) {
|
||||
//封面标识
|
||||
String flag = "cover";
|
||||
String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//标题前面添加一个换行
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
|
||||
titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
//添加标题
|
||||
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
|
||||
//标题下面添加9个换行
|
||||
for (int i = 0; i < 9; i++) {
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
}
|
||||
WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
|
||||
@@ -1060,7 +1069,42 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
//添加下一页
|
||||
document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
}
|
||||
//封面
|
||||
//封面(WPS版本)
|
||||
// private void coverCn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
// String titleCN,
|
||||
// XWPFDocument document) {
|
||||
// //封面标识
|
||||
// String flag = "cover";
|
||||
// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//
|
||||
// titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
// WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
// WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0];
|
||||
// String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1];
|
||||
// int mothLast = Integer.valueOf(mothNew) + 1;
|
||||
//
|
||||
// //添加说明 2022/7/15 至 2022/8/14 期间发布的主要内容
|
||||
// String text = year + "/" + mothNew +"/15 至 "+year+"/"+mothLast+"/14期间发布的主要内容";
|
||||
// WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加换行
|
||||
// WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null,
|
||||
// false, false, null,null,null,flag);
|
||||
//
|
||||
// //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队
|
||||
// String text1 = "编辑: 整车工程 - 法规与认证&环保与材料科团队";
|
||||
// WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加下一页
|
||||
// document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
// }
|
||||
//封面(office版本)
|
||||
private void coverEn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
String titleCN,
|
||||
XWPFDocument document) {
|
||||
@@ -1074,11 +1118,19 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
String mothNewEn = getMothEn(mothNew);
|
||||
String mothLastEn = getMothEn(String.valueOf(mothLast));
|
||||
|
||||
// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//标题前面添加一个换行
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
|
||||
titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
//添加标题
|
||||
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//标题下面添加8个换行
|
||||
for (int i = 0; i < 8; i++) {
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
}
|
||||
|
||||
WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
|
||||
@@ -1101,6 +1153,47 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
//添加下一页
|
||||
document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
}
|
||||
//封面(WPS版本)
|
||||
// private void coverEn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
// String titleCN,
|
||||
// XWPFDocument document) {
|
||||
// //封面标识
|
||||
// String flag = "cover";
|
||||
//
|
||||
// String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0];
|
||||
// String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1];
|
||||
// int mothLast = Integer.valueOf(mothNew) + 1;
|
||||
// String moth = mothNew+"/"+year;
|
||||
// String mothNewEn = getMothEn(mothNew);
|
||||
// String mothLastEn = getMothEn(String.valueOf(mothLast));
|
||||
//
|
||||
//// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//
|
||||
// titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
// WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
// WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
//
|
||||
//
|
||||
// //添加说明 Update between July 15, 2022 and August 14, 2022
|
||||
// String text = "Update between "+mothNewEn+" 15,"+year+" and "+mothLastEn+" 14,"+year;
|
||||
// WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加换行
|
||||
// WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null,
|
||||
// false, false, null,null,null,flag);
|
||||
//
|
||||
// //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队
|
||||
// String text1 = "Edit By: Regulation & Homologation, Environmental & Materials Team";
|
||||
// WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加下一页
|
||||
// document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
// }
|
||||
|
||||
private String getMothEn(String moth){
|
||||
String result = "";
|
||||
|
||||
+167
-72
@@ -128,6 +128,10 @@ public class WordUtil {
|
||||
}
|
||||
|
||||
XWPFRun titleParagraphRun = titleParagraph.createRun();
|
||||
//封面中的换行
|
||||
if("break".equals(flag)){
|
||||
titleParagraphRun.addBreak();
|
||||
}
|
||||
if (isNewline) {
|
||||
titleParagraphRun.setText("\r");
|
||||
} else {
|
||||
@@ -202,45 +206,7 @@ public class WordUtil {
|
||||
styles.addStyle(style);
|
||||
}
|
||||
|
||||
// @SneakyThrows
|
||||
// public static void exportHeardAndFoot(XWPFDocument document){
|
||||
//// XWPFDocument document = new XWPFDocument();
|
||||
//
|
||||
// // create header-footer
|
||||
// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
||||
//
|
||||
// // create header start
|
||||
// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
// XWPFParagraph paragraph = header.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
//
|
||||
// XWPFRun run = paragraph.createRun();
|
||||
// run.setText("Header");
|
||||
//
|
||||
// // create footer start
|
||||
// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
//
|
||||
// run = paragraph.createRun();
|
||||
// run.setText("Footer");
|
||||
//
|
||||
// CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
// CTPageMar pageMar = sectPr.getPgMar();
|
||||
// if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
// pageMar.setLeft(BigInteger.valueOf(2000)); //720 TWentieths of an Inch Point (Twips) = 720/20 = 36 pt = 36/72 = 0.5"
|
||||
// pageMar.setRight(BigInteger.valueOf(720));
|
||||
// pageMar.setTop(BigInteger.valueOf(1440)); //1440 Twips = 1440/20 = 72 pt = 72/72 = 1"
|
||||
// pageMar.setBottom(BigInteger.valueOf(1440));
|
||||
//
|
||||
// pageMar.setHeader(BigInteger.valueOf(2000)); //45.4 pt * 20 = 908 = 45.4 pt header from top
|
||||
// pageMar.setFooter(BigInteger.valueOf(568)); //28.4 pt * 20 = 568 = 28.4 pt footer from bottom
|
||||
//
|
||||
// }
|
||||
//主要内容生成页眉页脚(office版本)
|
||||
@SneakyThrows
|
||||
public static void exportHeardAndFoot(XWPFDocument document,String month){
|
||||
XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
@@ -266,7 +232,7 @@ public class WordUtil {
|
||||
picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
|
||||
run.addTab();
|
||||
is.close();
|
||||
run.setText(" "+month);
|
||||
run.setText(" "+month);
|
||||
run.setFontSize(11);
|
||||
run.setFontFamily("Blue Sky Noto Regular");
|
||||
}
|
||||
@@ -313,20 +279,107 @@ public class WordUtil {
|
||||
|
||||
CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
//设置页面大小
|
||||
//设置页面大小(21*29.7)
|
||||
CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
pgSz.setW(BigInteger.valueOf(11907));
|
||||
pgSz.setH(BigInteger.valueOf(16840));
|
||||
pgSz.setW(BigInteger.valueOf(11905));
|
||||
pgSz.setH(BigInteger.valueOf(16838));
|
||||
CTPageMar pageMar = sectPr.getPgMar();
|
||||
if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
pageMar.setLeft(BigInteger.valueOf(1797)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1797));//右边距
|
||||
pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
|
||||
pageMar.setHeader(BigInteger.valueOf(720)); //页眉上边框到顶部的距离
|
||||
pageMar.setFooter(BigInteger.valueOf(720)); //页脚下边框到底部的距离
|
||||
}
|
||||
//主要内容生成页眉页脚(WPS版本)
|
||||
// @SneakyThrows
|
||||
// public static void exportHeardAndFoot(XWPFDocument document,String month){
|
||||
// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
||||
// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
//// String logoFilePath = "/jero-boot/home/weilai.png";
|
||||
// String logoFilePath = WordUtil.class.getClassLoader().getResource("static/home/weilai.png").getPath();
|
||||
// //页眉第一个段落展示logo-----------------------------------------------------------------------------------
|
||||
// if (org.apache.commons.lang3.StringUtils.isNotBlank(logoFilePath)) {
|
||||
// XWPFParagraph logo = header.createParagraph();
|
||||
// logo.setAlignment(ParagraphAlignment.LEFT);
|
||||
// XWPFRun run = logo.createRun();
|
||||
//
|
||||
// String imgFile = logoFilePath;
|
||||
// InputStream is = WordUtil.class.getClassLoader().getResourceAsStream("static/home/weilai.png");
|
||||
//// InputStream is = new FileInputStream(imgFile);
|
||||
// XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG, imgFile, Units.toEMU(95), Units.toEMU(35));
|
||||
// String blipID = "";
|
||||
// for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有,不然打开的logo图片不显示
|
||||
// blipID = header.getRelationId(picturedata);
|
||||
// }
|
||||
// picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
|
||||
// run.addTab();
|
||||
// is.close();
|
||||
// run.setText(" "+month);
|
||||
// run.setFontSize(11);
|
||||
// run.setFontFamily("Blue Sky Noto Regular");
|
||||
// }
|
||||
// //页眉第二个段落展示日期------------------------------------------------------------
|
||||
// XWPFParagraph paragraph = header.createParagraph();//创建新的段落
|
||||
//// paragraph.setAlignment(ParagraphAlignment.RIGHT);//段落文本的对齐方式
|
||||
// XWPFRun run = paragraph.createRun();
|
||||
//// run.setText(month);
|
||||
//
|
||||
// //页脚(三个段落分别展示3个内容)-----------------------------------------------------
|
||||
// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
// run = paragraph.createRun();
|
||||
// run.setText("NIO Internal");
|
||||
// run.setFontSize(11);
|
||||
// run.setFontFamily("Blue Sky Standard Regular");
|
||||
//
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.LEFT);
|
||||
// run = paragraph.createRun();
|
||||
// run.setText("NIO.com");
|
||||
// run.setFontSize(11);
|
||||
// run.setFontFamily("Blue Sky Noto Regular");
|
||||
//
|
||||
// //生成页码---------------------------------------------------------------------
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.RIGHT);
|
||||
// run = paragraph.createRun();
|
||||
// CTFldChar fldChar = run.getCTR().addNewFldChar();
|
||||
// fldChar.setFldCharType(STFldCharType.Enum.forString("begin"));
|
||||
//
|
||||
// run = paragraph.createRun();
|
||||
// CTText ctText = run.getCTR().addNewInstrText();
|
||||
// ctText.setStringValue("PAGE \\* MERGEFORMAT");
|
||||
// ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve"));
|
||||
//
|
||||
// fldChar = run.getCTR().addNewFldChar();
|
||||
// fldChar.setFldCharType(STFldCharType.Enum.forString("end"));
|
||||
// //----------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
// CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
// //设置页面大小
|
||||
// CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
// pgSz.setW(BigInteger.valueOf(11907));
|
||||
// pgSz.setH(BigInteger.valueOf(16840));
|
||||
// CTPageMar pageMar = sectPr.getPgMar();
|
||||
// if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
// pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
// pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
// pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
// pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
//
|
||||
// pageMar.setHeader(BigInteger.valueOf(720)); //页眉上边框到顶部的距离
|
||||
// pageMar.setFooter(BigInteger.valueOf(720)); //页脚下边框到底部的距离
|
||||
// }
|
||||
|
||||
/**
|
||||
* 主页面(只有页脚)
|
||||
@@ -356,18 +409,58 @@ public class WordUtil {
|
||||
if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
//设置页面大小
|
||||
CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
pgSz.setW(BigInteger.valueOf(11907));
|
||||
pgSz.setH(BigInteger.valueOf(16840));
|
||||
pgSz.setW(BigInteger.valueOf(11905));
|
||||
pgSz.setH(BigInteger.valueOf(16838));
|
||||
CTPageMar pageMar = sectPr.getPgMar();
|
||||
if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
pageMar.setLeft(BigInteger.valueOf(1797)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1797));//右边距
|
||||
pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
|
||||
pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离
|
||||
pageMar.setFooter(BigInteger.valueOf(1200)); //页脚下边框到底部的距离
|
||||
}
|
||||
// /**
|
||||
// * 主页面(只有页脚 WPS版本)
|
||||
// * @param document
|
||||
// * @param month
|
||||
// */
|
||||
// @SneakyThrows
|
||||
// public static void exportHeardAndFootMain(XWPFDocument document,String month){
|
||||
// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
||||
//// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//// XWPFParagraph paragraph = header.createParagraph();//创建新的段落
|
||||
//// XWPFRun run = paragraph.createRun();
|
||||
//
|
||||
// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
// XWPFParagraph paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
// XWPFRun run = paragraph.createRun();
|
||||
// run.setText("NIO Internal");
|
||||
// run.setFontSize(18);
|
||||
// run.setFontFamily("Blue Sky Standard Regular");
|
||||
//// run.setFontFamily("Blue Sky Noto Regular");
|
||||
// run.setBold(true);
|
||||
//
|
||||
//
|
||||
// CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
// //设置页面大小
|
||||
// CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
// pgSz.setW(BigInteger.valueOf(11907));
|
||||
// pgSz.setH(BigInteger.valueOf(16840));
|
||||
// CTPageMar pageMar = sectPr.getPgMar();
|
||||
// if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
// pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
// pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
// pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
// pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
//
|
||||
// pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离
|
||||
// pageMar.setFooter(BigInteger.valueOf(1200)); //页脚下边框到底部的距离
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出工具示例
|
||||
@@ -463,25 +556,25 @@ public class WordUtil {
|
||||
String workProgressEn = lawsMonthlyReportWriteEO.getWorkProgressEn();//NIO工作进展英文
|
||||
String lawsContactTemp = lawsMonthlyReportWriteEO.getLawsContact();//法规联系人
|
||||
String lawsContact = getLawsContact(loginUserList, lawsContactTemp);
|
||||
if(StringUtils.isNotEmpty(lawsContact)){
|
||||
List<String> lawsContactList = Arrays.asList(lawsContact.split(","));
|
||||
if (lawsContactList.size() > 4) {
|
||||
StringBuilder str = new StringBuilder();
|
||||
int count = 0;
|
||||
for (String s : lawsContactList) {
|
||||
str.append(s + ",");
|
||||
count++;
|
||||
if (count % 4 == 0) {
|
||||
str.append("\n");
|
||||
}
|
||||
}
|
||||
if(str.toString().endsWith("\n")){
|
||||
lawsContact = str.substring(0,str.length()-2);
|
||||
}else{
|
||||
lawsContact = str.substring(0,str.length()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if(StringUtils.isNotEmpty(lawsContact)){
|
||||
// List<String> lawsContactList = Arrays.asList(lawsContact.split(","));
|
||||
// if (lawsContactList.size() > 4) {
|
||||
// StringBuilder str = new StringBuilder();
|
||||
// int count = 0;
|
||||
// for (String s : lawsContactList) {
|
||||
// str.append(s + ",");
|
||||
// count++;
|
||||
// if (count % 4 == 0) {
|
||||
// str.append("\n");
|
||||
// }
|
||||
// }
|
||||
// if(str.toString().endsWith("\n")){
|
||||
// lawsContact = str.substring(0,str.length()-2);
|
||||
// }else{
|
||||
// lawsContact = str.substring(0,str.length()-1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
String link = lawsMonthlyReportWriteEO.getLink();//链接
|
||||
String technologyTerritoryName = "";
|
||||
@@ -1072,6 +1165,7 @@ public class WordUtil {
|
||||
ctTc.addNewP() : ctTc.getPArray(0);
|
||||
//getParagraph(ctP) 获取 XWPFParagraph
|
||||
XWPFParagraph par = cell.getParagraph(ctP);
|
||||
par.setAlignment(ParagraphAlignment.LEFT);
|
||||
//XWPFRun 设置格式
|
||||
XWPFRun run = par.createRun();
|
||||
//单元格内容换行
|
||||
@@ -1109,6 +1203,7 @@ public class WordUtil {
|
||||
ctTc.addNewP() : ctTc.getPArray(0);
|
||||
//getParagraph(ctP) 获取 XWPFParagraph
|
||||
XWPFParagraph par = cell.getParagraph(ctP);
|
||||
par.setAlignment(ParagraphAlignment.LEFT);
|
||||
//XWPFRun 设置格式
|
||||
XWPFRun run = par.createRun();
|
||||
//单元格内容换行 □ ■
|
||||
@@ -1169,13 +1264,13 @@ public class WordUtil {
|
||||
String blank = "";
|
||||
switch (value) {
|
||||
case "M":
|
||||
blank = " ";
|
||||
blank = " ";
|
||||
break;
|
||||
case "N":
|
||||
blank = "\r\n";
|
||||
break;
|
||||
case "企业":
|
||||
blank = " ";
|
||||
blank = " ";
|
||||
break;
|
||||
case "整车":
|
||||
blank = " ";
|
||||
@@ -1190,10 +1285,10 @@ public class WordUtil {
|
||||
blank = "";
|
||||
break;
|
||||
case "Enterprise":
|
||||
blank = " ";
|
||||
blank = " ";
|
||||
break;
|
||||
case "Vehicle":
|
||||
blank = " ";
|
||||
blank = " ";
|
||||
break;
|
||||
case "System/Parts":
|
||||
blank = "\r\n";
|
||||
|
||||
+7
-7
@@ -576,13 +576,13 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
//如果value中包含英文单、双引号,替换成中文的。 英文的符号影响到法规技术评估流程了。
|
||||
if(entry.getValue() != null){
|
||||
if(StringUtils.contains(entry.getValue().toString(),"'") || StringUtils.contains(entry.getValue().toString(),"\"")){
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue().toString().replaceAll("'", "‘").replaceAll("\"", "”");
|
||||
record1.put(key,value);
|
||||
}
|
||||
}
|
||||
// if(entry.getValue() != null){
|
||||
// if(StringUtils.contains(entry.getValue().toString(),"'") || StringUtils.contains(entry.getValue().toString(),"\"")){
|
||||
// String key = entry.getKey();
|
||||
// String value = entry.getValue().toString().replaceAll("'", "‘").replaceAll("\"", "”");
|
||||
// record1.put(key,value);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
// 拼接文件名
|
||||
|
||||
@@ -3,11 +3,11 @@ module.exports = {
|
||||
account: 'User Account',
|
||||
EnterAccountFuzzyQuery: 'Enter Account Fuzzy Search',
|
||||
Gender: 'Gender',
|
||||
pleaseSelect: 'Please Select',
|
||||
pleaseSelect: 'Please Select ',
|
||||
male: 'Male',
|
||||
female: 'Female',
|
||||
RealName: 'User Name',
|
||||
pleaseEnter: 'Please Enter',
|
||||
pleaseEnter: 'Please Enter ',
|
||||
phoneNumber: 'Phone Number',
|
||||
query: 'Search',
|
||||
userStatues: 'User Status',
|
||||
@@ -199,6 +199,7 @@ module.exports = {
|
||||
OperationType: 'Operation Type',
|
||||
selectOperationType: 'Please select Operation type',
|
||||
selectProblemClassification:'Please select Problem Classification',
|
||||
selectTranslationResults:'Please select Translation results',
|
||||
selectMarket:'Please select Market',
|
||||
RequestMethod: 'Request Method',
|
||||
RequestParameters: 'Request Parameters',
|
||||
@@ -348,8 +349,8 @@ module.exports = {
|
||||
standard: 'Number',
|
||||
title: 'Title',
|
||||
TextStatus: 'Text Status',
|
||||
PleaseEnter: 'Please enter',
|
||||
PleaseSelect: 'Please select',
|
||||
PleaseEnter: 'Please enter ',
|
||||
PleaseSelect: 'Please select ',
|
||||
PleaseEnterOrSelect: 'Please Enter Or Select',
|
||||
ModificationTime: 'Modification Time',
|
||||
ModificationContent: 'Modification Content',
|
||||
|
||||
@@ -197,10 +197,11 @@ module.exports = {
|
||||
enterSearchKeyword: '请输入搜索关键词',
|
||||
enterSearchContent:'请输入搜索内容',
|
||||
enterStandard:'请输入编号',
|
||||
enterTitle:'请输入标题',
|
||||
entertitle:'请输入标题',
|
||||
OperationType: '操作类型',
|
||||
selectOperationType: '请选择操作类型',
|
||||
selectProblemClassification:'请选择问题分类',
|
||||
selectTranslationResults:'请选择翻译结果',
|
||||
selectMarket:'请选择市场',
|
||||
RequestMethod: '请求方法',
|
||||
RequestParameters: '请求参数',
|
||||
|
||||
+12
-1
@@ -219,6 +219,17 @@
|
||||
localStorage.removeItem('serial_number')
|
||||
}
|
||||
this.isTrue = true
|
||||
let BaseQuery = localStorage.getItem('problemknowledgeBase')
|
||||
if (BaseQuery) {
|
||||
let content = JSON.parse(BaseQuery)
|
||||
if (content.id) {
|
||||
this.isTrue = false
|
||||
this.$nextTick(() => {
|
||||
this.$refs.problemKnowledgeBaseListViewRef.getData(JSON.parse(JSON.stringify(content)))
|
||||
})
|
||||
}
|
||||
localStorage.removeItem('problemknowledgeBase')
|
||||
}
|
||||
this.getList()
|
||||
this.replacePage()
|
||||
},
|
||||
@@ -351,7 +362,7 @@
|
||||
pageSize: this.pageSize,
|
||||
searchStr: this.searchStr,
|
||||
problemTypes: selectedTags.join(','),
|
||||
releaseStatus:'Have released'
|
||||
releaseStatus: 'Have released'
|
||||
}
|
||||
this.loading = true
|
||||
getAction(this.url.getInfoList, query).then((res) => {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="title-text" :title="$t('standard')">
|
||||
<span>{{$t('standard')}}</span>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
|
||||
<j-input class="box-input" :placeholder="$t('enterStandard')"
|
||||
v-model="queryParam.serialNumber"></j-input>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="title-text" :title="$t('title')">
|
||||
<span>{{$t('title')}}</span>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
|
||||
<j-input class="box-input" :placeholder="$t('entertitle')"
|
||||
v-model="queryParam.title"></j-input>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -27,7 +27,7 @@
|
||||
<span>{{$t('translationResults')}}</span>
|
||||
</div>
|
||||
<j-dict-select-tag class="box-input" v-model="queryParam.translationResult"
|
||||
:placeholder="$t('PleaseSelect')+$t('translationResults')"
|
||||
:placeholder="$t('selectTranslationResults')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" dictCode="translation_result"/>
|
||||
</div>
|
||||
|
||||
@@ -176,13 +176,20 @@
|
||||
})
|
||||
},
|
||||
checkedClick(item) {
|
||||
let newUrl = this.$router.resolve({
|
||||
path: '/problemKnowledgeBaseView',
|
||||
localStorage.setItem('problemknowledgeBase',JSON.stringify(item))
|
||||
this.$router.push({
|
||||
path: '/problemknowledgeBase',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
// let newUrl = this.$router.resolve({
|
||||
// path: '/problemknowledgeBase',
|
||||
// query: {
|
||||
// id: item.id
|
||||
// }
|
||||
// })
|
||||
// window.open(newUrl.href, '_blank')
|
||||
},
|
||||
pageOnChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
|
||||
Reference in New Issue
Block a user