EPC、国网、南网模板
This commit is contained in:
parent
be0bf2fde6
commit
35ed22e757
|
|
@ -309,7 +309,7 @@ public class TestGW {
|
|||
data.put("list5", list5);
|
||||
WordUtils.exportMillCertificateWord2(null, null, data, "test", "GW.ftl", "C:\\Users\\10488\\Desktop\\test (2)\\");
|
||||
} catch (Exception e) {
|
||||
log.error("EPC下载", e);
|
||||
log.error("GW下载", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,133 @@
|
|||
package com.bonus.tool.template;
|
||||
|
||||
import com.bonus.tool.template.util.FreeMarkerUtil;
|
||||
import com.bonus.tool.template.util.WordUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:Test
|
||||
* @author:cwchen
|
||||
* @date:2025-04-25-17:05
|
||||
* @version:1.0
|
||||
* @description:
|
||||
*/
|
||||
@Slf4j
|
||||
public class TestNW {
|
||||
|
||||
public static void download() {
|
||||
Map<String, Object> data = new HashMap<>(16);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
List<Map<String, Object>> list2 = new ArrayList<>();
|
||||
String fileName = null;
|
||||
try {
|
||||
data.put("title","中老500千伏联网项目(老挝段)EPC总承包项目投标技术文件");
|
||||
data.put("Introduction","项目经理、设计负责人、采购负责人、施工负责人、商务负责人等主要负责人");
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("i",i + 1);
|
||||
map.put("zw","项目经理");
|
||||
map.put("name","王杰" + (i + 1));
|
||||
map.put("zc","工程师");
|
||||
map.put("zsmc","建造师证");
|
||||
map.put("level","一级");
|
||||
map.put("zh","云1532016201673770");
|
||||
map.put("zy","机电工程");
|
||||
map.put("ylbx","正常");
|
||||
map.put("bz","");
|
||||
list.add(map);
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("hasJj",true);
|
||||
if(i == 0 || i== 3){
|
||||
map.put("zy","项目经理简介");
|
||||
map.put("hasJj",true);
|
||||
}else{
|
||||
map.put("zy","项目经理");
|
||||
map.put("hasJj",false);
|
||||
}
|
||||
map.put("name","王杰" + (i + 1));
|
||||
map.put("age","13");
|
||||
map.put("xl","本科");
|
||||
map.put("zc","工程师");
|
||||
map.put("zw","职务");
|
||||
map.put("rz","项目经理");
|
||||
map.put("byxx","2007年6月毕业于三峡大学机械设计制造及其自动化专业");
|
||||
map.put("Introduction","项目经理简历表");
|
||||
List<Map<String,Object>> infoList = new ArrayList<>();
|
||||
for (int j = 0; j < 3; j++){
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("time","2019.3-2020.12");
|
||||
map2.put("xm","乌东德电站送电广东广西输电工程送端电网侧交流配套工程-龙开口、鲁地拉电站改接入丽山换流站线路工程(三标段)");
|
||||
map2.put("zy","项目经理");
|
||||
map2.put("lxr","云南电网建设分公司\n" +
|
||||
"0871-63011815");
|
||||
infoList.add(map2);
|
||||
}
|
||||
List<Map<String,Object>> imgList = new ArrayList<>();
|
||||
for (int j = 0; j < 3; j++){
|
||||
Map<String, Object> map3 = new HashMap<>();
|
||||
map3.put("width","4959860");
|
||||
map3.put("height","3492375");
|
||||
map3.put("index",(100 * (i + 1)) + (j + 1));
|
||||
if(j == 0){
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片3.png"));
|
||||
}else if(j == 1){
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片4.png"));
|
||||
}else if(j == 2){
|
||||
map3.put("width","5325745");
|
||||
map3.put("height","7534910");
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
}
|
||||
if(i == 0 && j == 0){
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
}
|
||||
imgList.add(map3);
|
||||
}
|
||||
map.put("yjTitle","项目经理业绩");
|
||||
List<Map<String,Object>> yjList = new ArrayList<>();
|
||||
for (int j = 0; j < 3; j++){
|
||||
Map<String, Object> map3 = new HashMap<>();
|
||||
map3.put("yj","业绩" + (j + 1) + ":" + "乌东德电站送电广东广西输电工程送端电网侧交流配套工程-龙开口、鲁地拉电站改接入丽山换流站线路工程(三标段)");
|
||||
List<Map<String,Object>> imgList2 = new ArrayList<>();
|
||||
for (int k = 0; k < 3; k++) {
|
||||
Map<String, Object> map4 = new HashMap<>();
|
||||
map4.put("index",(10000 * (j + 1)) + (k + 1));
|
||||
map4.put("width","5325745");
|
||||
map4.put("height","7534910");
|
||||
map4.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
imgList2.add(map4);
|
||||
}
|
||||
map3.put("imgList",imgList2);
|
||||
yjList.add(map3);
|
||||
}
|
||||
map.put("infoList",infoList);
|
||||
map.put("imgList",imgList);
|
||||
map.put("yjList",yjList);
|
||||
list2.add(map);
|
||||
}
|
||||
data.put("list",list);
|
||||
data.put("list2",list2);
|
||||
WordUtils.exportMillCertificateWord2(null,null, data, "test", "NW.ftl","C:\\Users\\10488\\Desktop\\test (2)\\");
|
||||
} catch (Exception e) {
|
||||
log.error("NW下载", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
download();
|
||||
}
|
||||
|
||||
public static String handleValue(String value){
|
||||
if(StringUtils.isBlank(value)){
|
||||
return "";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue