月报整合导出--添加行业资讯动态模板
This commit is contained in:
+6
@@ -193,4 +193,10 @@ public class LawsMonthlyReportWriteEO implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String ids;
|
||||
|
||||
//新添字段
|
||||
private String relatedAreasCn;//相关领域中文
|
||||
private String relatedAreasEn;//相关领域英文
|
||||
private String source;//来源
|
||||
private String time;//日期
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@ package com.jero.modules.report.enums;
|
||||
public enum ContentTemplateEnum {
|
||||
DEFAULT_TEMPLATE("默认模板","1"),
|
||||
NEW_REQUEST_LIST_TEMPLATE("新征求意见清单模板","2"),
|
||||
NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE("新发布标准清单模板","3");
|
||||
NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE("新发布标准清单模板","3"),
|
||||
INDUSTRY_INFORMATION_TRENDS("行业资讯动态","4");
|
||||
|
||||
|
||||
|
||||
|
||||
+4
@@ -29,5 +29,9 @@
|
||||
<result column="laws_contact" property="lawsContact" />
|
||||
<result column="link" property="link" />
|
||||
<result column="export_state" property="exportState" />
|
||||
<result column="related_areas_cn" property="relatedAreasCn" />
|
||||
<result column="related_areas_en" property="relatedAreasEn" />
|
||||
<result column="source" property="source" />
|
||||
<result column="time" property="time" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
|
||||
+4
-1
@@ -791,8 +791,11 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
if(ContentTemplateEnum.DEFAULT_TEMPLATE.getValue().equals(contentTemplate)){
|
||||
//写入模板
|
||||
WordUtil.exportWordExcelDefault(document,lawsMonthlyReportWriteEO,sysDictItems,categoryList,cut,loginUserList);
|
||||
|
||||
}
|
||||
if(ContentTemplateEnum.INDUSTRY_INFORMATION_TRENDS.getValue().equals(contentTemplate)){
|
||||
WordUtil.exportWordExcelIndustry(document,lawsMonthlyReportWriteEO,cut);
|
||||
}
|
||||
|
||||
// else if(ContentTemplateEnum.NEW_REQUEST_LIST_TEMPLATE.getValue().equals(contentTemplate)){
|
||||
// //新征求意见清单模板
|
||||
// WordUtil.exportWordExcelAsk(document,lawsMonthlyReportWriteEO,cut);
|
||||
|
||||
+153
-31
@@ -406,54 +406,163 @@ public class WordUtil {
|
||||
//第1行
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
//第1行
|
||||
setCell(table.getRow(0), "相关领域",technologyTerritoryName);
|
||||
setCell(table, 0, "相关领域",technologyTerritoryName);
|
||||
//第2行
|
||||
setCell(table.getRow(1), "适用车型",applyCarName);
|
||||
setCell(table,1, "适用车型",applyCarName);
|
||||
//第3行
|
||||
setCell(table.getRow(2), "适用范围",applyScopeName);
|
||||
setCell(table,2, "适用范围",applyScopeName);
|
||||
//第4行
|
||||
setCell(table.getRow(3), "状态",stateName);
|
||||
setCell(table,3, "状态",stateName);
|
||||
//第5行
|
||||
setCell(table.getRow(4), "用法",useMethodName);
|
||||
setCell(table,4, "用法",useMethodName);
|
||||
//第6行
|
||||
setCell(table.getRow(5), "实施车型",implementCar);
|
||||
setCell(table,5, "实施车型",implementCar);
|
||||
//第7行
|
||||
setCell(table.getRow(6), "新车型实施日期",newCarImplementTime);
|
||||
setCell(table,6, "新车型实施日期",newCarImplementTime);
|
||||
//第8行
|
||||
setCell(table.getRow(7), "在产车实施日期",productionCarImplementTime);
|
||||
setCell(table,7, "在产车实施日期",productionCarImplementTime);
|
||||
//第9行
|
||||
setCell(table.getRow(8), "主要内容",contentCn);
|
||||
setCell(table,8, "主要内容",contentCn);
|
||||
//第10行
|
||||
setCell(table.getRow(9), "NIO工作进展",workProgressCn);
|
||||
setCell(table,9, "NIO工作进展",workProgressCn);
|
||||
//第11行
|
||||
setCell(table.getRow(10), "法规联系人",lawsContact);
|
||||
setCell(table,10, "法规联系人",lawsContact);
|
||||
//第12行
|
||||
setCell(table.getRow(11), "链接",link);
|
||||
setCell(table,11, "链接",link);
|
||||
}else{
|
||||
//第1行
|
||||
setCell(table.getRow(0), "Related Areas",technologyTerritoryName);
|
||||
setCell(table,0, "Related Areas",technologyTerritoryName);
|
||||
//第2行
|
||||
setCell(table.getRow(1), "Vehicle Type",applyCarName);
|
||||
setCell(table,1,"Vehicle Type",applyCarName);
|
||||
//第3行
|
||||
setCell(table.getRow(2), "Scope",applyScopeName);
|
||||
setCell(table,2,"Scope",applyScopeName);
|
||||
//第4行
|
||||
setCell(table.getRow(3), "Status",stateName);
|
||||
setCell(table,3,"Status",stateName);
|
||||
//第5行
|
||||
setCell(table.getRow(4), "usage",useMethodName);
|
||||
setCell(table,4,"usage",useMethodName);
|
||||
//第6行
|
||||
setCell(table.getRow(5), "Implementation Model",implementCar);
|
||||
setCell(table,5,"Implementation Model",implementCar);
|
||||
//第7行
|
||||
setCell(table.getRow(6), "New Type Execution Date",newCarImplementTime);
|
||||
setCell(table,6,"New Type Execution Date",newCarImplementTime);
|
||||
//第8行
|
||||
setCell(table.getRow(7), "New Vehicle Execution Date",productionCarImplementTime);
|
||||
setCell(table,7,"New Vehicle Execution Date",productionCarImplementTime);
|
||||
//第9行
|
||||
setCell(table.getRow(8), "Main Content",contentEn);
|
||||
setCell(table,8,"Main Content",contentEn);
|
||||
//第10行
|
||||
setCell(table.getRow(9), "NIO Work Progress",workProgressEn);
|
||||
setCell(table,9,"NIO Work Progress",workProgressEn);
|
||||
//第11行
|
||||
setCell(table.getRow(10), "Regulatory Contact",lawsContact);
|
||||
setCell(table, 10,"Regulatory Contact",lawsContact);
|
||||
//第12行
|
||||
setCell(table.getRow(11), "Link",link);
|
||||
setCell(table, 11,"Link",link);
|
||||
}
|
||||
// if(CutEnum.CN.getValue().equals(cut)){
|
||||
// //第1行
|
||||
// setCell(table.getRow(0), "相关领域",technologyTerritoryName);
|
||||
// //第2行
|
||||
// setCell(table.getRow(1), "适用车型",applyCarName);
|
||||
// //第3行
|
||||
// setCell(table.getRow(2), "适用范围",applyScopeName);
|
||||
// //第4行
|
||||
// setCell(table.getRow(3), "状态",stateName);
|
||||
// //第5行
|
||||
// setCell(table.getRow(4), "用法",useMethodName);
|
||||
// //第6行
|
||||
// setCell(table.getRow(5), "实施车型",implementCar);
|
||||
// //第7行
|
||||
// setCell(table.getRow(6), "新车型实施日期",newCarImplementTime);
|
||||
// //第8行
|
||||
// setCell(table.getRow(7), "在产车实施日期",productionCarImplementTime);
|
||||
// //第9行
|
||||
// setCell(table.getRow(8), "主要内容",contentCn);
|
||||
// //第10行
|
||||
// setCell(table.getRow(9), "NIO工作进展",workProgressCn);
|
||||
// //第11行
|
||||
// setCell(table.getRow(10), "法规联系人",lawsContact);
|
||||
// //第12行
|
||||
// setCell(table.getRow(11), "链接",link);
|
||||
// }else{
|
||||
// //第1行
|
||||
// setCell(table.getRow(0), "Related Areas",technologyTerritoryName);
|
||||
// //第2行
|
||||
// setCell(table.getRow(1), "Vehicle Type",applyCarName);
|
||||
// //第3行
|
||||
// setCell(table.getRow(2), "Scope",applyScopeName);
|
||||
// //第4行
|
||||
// setCell(table.getRow(3), "Status",stateName);
|
||||
// //第5行
|
||||
// setCell(table.getRow(4), "usage",useMethodName);
|
||||
// //第6行
|
||||
// setCell(table.getRow(5), "Implementation Model",implementCar);
|
||||
// //第7行
|
||||
// setCell(table.getRow(6), "New Type Execution Date",newCarImplementTime);
|
||||
// //第8行
|
||||
// setCell(table.getRow(7), "New Vehicle Execution Date",productionCarImplementTime);
|
||||
// //第9行
|
||||
// setCell(table.getRow(8), "Main Content",contentEn);
|
||||
// //第10行
|
||||
// setCell(table.getRow(9), "NIO Work Progress",workProgressEn);
|
||||
// //第11行
|
||||
// setCell(table.getRow(10), "Regulatory Contact",lawsContact);
|
||||
// //第12行
|
||||
// setCell(table.getRow(11), "Link",link);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 行业资讯动态
|
||||
* @param document
|
||||
* @param lawsMonthlyReportWriteEO
|
||||
* @param cut
|
||||
*/
|
||||
public static void exportWordExcelIndustry(XWPFDocument document,
|
||||
LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,
|
||||
String cut) {
|
||||
String relatedAreasCn = lawsMonthlyReportWriteEO.getRelatedAreasCn();//相关领域中文
|
||||
String relatedAreasEn = lawsMonthlyReportWriteEO.getRelatedAreasEn();//相关领域英文
|
||||
String source = lawsMonthlyReportWriteEO.getSource();//来源
|
||||
String time = lawsMonthlyReportWriteEO.getTime();//日期
|
||||
String contentCn = lawsMonthlyReportWriteEO.getContentCn();//主要内容中文
|
||||
String contentEn = lawsMonthlyReportWriteEO.getContentEn();//主要内容英文
|
||||
String link = lawsMonthlyReportWriteEO.getLink();//链接
|
||||
|
||||
XWPFTable table = document.createTable(5, 2);
|
||||
|
||||
//表格属性
|
||||
CTTblPr tablePr = table.getCTTbl().addNewTblPr();
|
||||
//表格宽度
|
||||
CTJc cTJc = tablePr.addNewJc();
|
||||
//居中
|
||||
cTJc.setVal(STJc.CENTER);
|
||||
//列宽自动分割
|
||||
CTTblWidth tableWidth = tablePr.addNewTblW();
|
||||
//设置表格宽度
|
||||
tableWidth.setType(STTblWidth.DXA);
|
||||
tableWidth.setW(BigInteger.valueOf(8000));
|
||||
|
||||
|
||||
//第1行
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
//第1行
|
||||
setCell(table, 0, "相关领域",relatedAreasCn);
|
||||
//第2行
|
||||
setCell(table,1, "来源",source);
|
||||
//第3行
|
||||
setCell(table,2, "日期",time);
|
||||
//第4行
|
||||
setCell(table,3, "主要内容",contentCn);
|
||||
//第5行
|
||||
setCell(table,4, "链接",link);
|
||||
}else{
|
||||
//第1行
|
||||
setCell(table,0, "Related Areas",relatedAreasEn);
|
||||
//第2行
|
||||
setCell(table,1,"source",source);
|
||||
//第3行
|
||||
setCell(table,2,"Date",time);
|
||||
//第4行
|
||||
setCell(table,3,"Main Content",contentEn);
|
||||
//第5行
|
||||
setCell(table,4,"Link",link);
|
||||
}
|
||||
}
|
||||
public static void exportWordExcelAsk(XWPFDocument document,
|
||||
@@ -668,19 +777,32 @@ public class WordUtil {
|
||||
return fieldValueName;
|
||||
}
|
||||
|
||||
private static void setCell(XWPFTableRow tableRow, String fieldName,String technologyTerritory) {
|
||||
private static void setCell(XWPFTable table, int number, String fieldName,String technologyTerritory) {
|
||||
|
||||
tableRow.setHeight(500);
|
||||
CTTblWidth ctTblWidth0 = tableRow.getCell(0).getCTTc().addNewTcPr().addNewTcW();
|
||||
table.getRow(number).setHeight(500);
|
||||
CTTblWidth ctTblWidth0 = table.getRow(number).getCell(0).getCTTc().addNewTcPr().addNewTcW();
|
||||
ctTblWidth0.setType(STTblWidth.DXA);
|
||||
ctTblWidth0.setW(BigInteger.valueOf(3000));
|
||||
CTTblWidth ctTblWidth1 = tableRow.getCell(1).getCTTc().addNewTcPr().addNewTcW();
|
||||
ctTblWidth0.setW(BigInteger.valueOf(2000));
|
||||
CTTblWidth ctTblWidth1 = table.getRow(number).getCell(1).getCTTc().addNewTcPr().addNewTcW();
|
||||
ctTblWidth1.setType(STTblWidth.DXA);
|
||||
ctTblWidth1.setW(BigInteger.valueOf(5000));
|
||||
|
||||
tableRow.getCell(0).setText(fieldName);
|
||||
tableRow.getCell(1).setText(technologyTerritory);
|
||||
table.getRow(number).getCell(0).setText(fieldName);
|
||||
table.getRow(number).getCell(1).setText(technologyTerritory);
|
||||
}
|
||||
// private static void setCell(XWPFTableRow tableRow, String fieldName,String technologyTerritory) {
|
||||
//
|
||||
// tableRow.setHeight(500);
|
||||
// CTTblWidth ctTblWidth0 = tableRow.getCell(0).getCTTc().addNewTcPr().addNewTcW();
|
||||
// ctTblWidth0.setType(STTblWidth.DXA);
|
||||
// ctTblWidth0.setW(BigInteger.valueOf(3000));
|
||||
// CTTblWidth ctTblWidth1 = tableRow.getCell(1).getCTTc().addNewTcPr().addNewTcW();
|
||||
// ctTblWidth1.setType(STTblWidth.DXA);
|
||||
// ctTblWidth1.setW(BigInteger.valueOf(5000));
|
||||
//
|
||||
// tableRow.getCell(0).setText(fieldName);
|
||||
// tableRow.getCell(1).setText(technologyTerritory);
|
||||
// }
|
||||
|
||||
private static String getLawsContact(List<LoginUser> userList, String lawsContact) {
|
||||
if(com.jero.modules.system.util.StringUtils.isNotBlank(lawsContact)){
|
||||
|
||||
Reference in New Issue
Block a user