|
@@ -949,7 +949,7 @@ public class WorkFullManageController extends BaseController {
|
|
|
|
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- * 下载工程造价咨询质量控制流程单信息
|
|
|
|
|
|
+ * 下载签发流程单信息
|
|
* @param response
|
|
* @param response
|
|
* @param projectReportData
|
|
* @param projectReportData
|
|
*/
|
|
*/
|
|
@@ -1564,4 +1564,107 @@ public class WorkFullManageController extends BaseController {
|
|
map.put("day",day.toString());
|
|
map.put("day",day.toString());
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 下载备考表信息
|
|
|
|
+ * @param response
|
|
|
|
+ * @param projectReportData
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value="downloadReference")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public void downloadReference(HttpServletResponse response, ProjectReportData projectReportData) {
|
|
|
|
+ Map data = referenceData(projectReportData);
|
|
|
|
+ //模板对象
|
|
|
|
+ Template template=null;
|
|
|
|
+ //freemaker模板路径
|
|
|
|
+ File path = new File(this.getClass().getResource("/").getPath()+"/freemarker");
|
|
|
|
+ Configuration cfg = new Configuration();
|
|
|
|
+ try {
|
|
|
|
+ cfg.setDirectoryForTemplateLoading(path);
|
|
|
|
+ //选择对应的ftl文件
|
|
|
|
+ template = cfg.getTemplate("reference.ftl","UTF-8");
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ File docFile = new File("备考表(自动).doc");
|
|
|
|
+ FreemarkerUtil.generateFile(data,template,docFile);
|
|
|
|
+ ResponseUtil.docResponse("备考表(自动).doc",docFile,response);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Map<String,Object> referenceData(ProjectReportData projectReportData){
|
|
|
|
+ //freemarker参数值准备
|
|
|
|
+ Map<String,Object> data = new LinkedHashMap<>();
|
|
|
|
+ //本卷情况说明
|
|
|
|
+ data.put("informationNote","测试123456");
|
|
|
|
+ //立卷人(项目负责人)
|
|
|
|
+ data.put("projectLeader","张三");
|
|
|
|
+ //检查人(档案管理员)
|
|
|
|
+ data.put("archivist","韩丽");
|
|
|
|
+ //立卷时间(审批通过时间)
|
|
|
|
+ data.put("approvalTime","20210707");
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 生成目录信息
|
|
|
|
+ * @param response
|
|
|
|
+ * @param projectReportData
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value="downloadCatalogue")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public void downloadCatalogue(HttpServletResponse response, ProjectReportData projectReportData) {
|
|
|
|
+ Map data = catalogueData(projectReportData);
|
|
|
|
+ //模板对象
|
|
|
|
+ Template template=null;
|
|
|
|
+ //freemaker模板路径
|
|
|
|
+ File path = new File(this.getClass().getResource("/").getPath()+"/freemarker");
|
|
|
|
+ Configuration cfg = new Configuration();
|
|
|
|
+ try {
|
|
|
|
+ cfg.setDirectoryForTemplateLoading(path);
|
|
|
|
+ //选择对应的ftl文件
|
|
|
|
+ template = cfg.getTemplate("catalogue.ftl","UTF-8");
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ File docFile = new File("目录(自动).doc");
|
|
|
|
+ FreemarkerUtil.generateFile(data,template,docFile);
|
|
|
|
+ ResponseUtil.docResponse("目录(自动).doc",docFile,response);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Map<String,Object> catalogueData(ProjectReportData projectReportData){
|
|
|
|
+ //freemarker参数值准备
|
|
|
|
+ Map<String,Object> data = new LinkedHashMap<>();
|
|
|
|
+ //文号
|
|
|
|
+ data.put("number","123456");
|
|
|
|
+ //目录
|
|
|
|
+ List<Map<String,String>> list=new LinkedList<>();
|
|
|
|
+ //测试数据
|
|
|
|
+ Map<String,String> map=new HashMap<>();
|
|
|
|
+ map.put("count","1");
|
|
|
|
+ map.put("type","成果文件");
|
|
|
|
+ map.put("content","咨询报告书正文");
|
|
|
|
+ map.put("fileName","文件1");
|
|
|
|
+ map.put("fileType","docx");
|
|
|
|
+ list.add(map);
|
|
|
|
+ Map<String,String> map1=new HashMap<>();
|
|
|
|
+ map1.put("count","2");
|
|
|
|
+ map1.put("type","成果文件");
|
|
|
|
+ map1.put("content","审定单");
|
|
|
|
+ map1.put("fileName","文件2");
|
|
|
|
+ map1.put("fileType","docx");
|
|
|
|
+ list.add(map1);
|
|
|
|
+ Map<String,String> map2=new HashMap<>();
|
|
|
|
+ map2.put("count","3");
|
|
|
|
+ map2.put("type","依据文件");
|
|
|
|
+ map2.put("content","审定单");
|
|
|
|
+ map2.put("fileName","文件3");
|
|
|
|
+ map2.put("fileType","docx");
|
|
|
|
+ list.add(map2);
|
|
|
|
+ data.put("list",list);
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|