提交 a1f6a347 authored 作者: 杨雪's avatar 杨雪

修改模板

上级 769d5475
...@@ -5,7 +5,9 @@ import com.zjty.inspect.aop.AuthAnnotation; ...@@ -5,7 +5,9 @@ import com.zjty.inspect.aop.AuthAnnotation;
import com.zjty.inspect.entity.*; import com.zjty.inspect.entity.*;
import com.zjty.inspect.service.EvaReportService; import com.zjty.inspect.service.EvaReportService;
import com.zjty.inspect.service.EvaluationService; import com.zjty.inspect.service.EvaluationService;
import com.zjty.inspect.utils.*; import com.zjty.inspect.utils.ExcelUtil;
import com.zjty.inspect.utils.FreeMakerUtils;
import com.zjty.inspect.utils.WpsUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -27,6 +29,7 @@ import java.util.Map; ...@@ -27,6 +29,7 @@ import java.util.Map;
@RequestMapping("/evaluation") @RequestMapping("/evaluation")
@Api(value = "评估报告管理接口", description = "评估报告管理接口,提供页面的增、删、改、查") @Api(value = "评估报告管理接口", description = "评估报告管理接口,提供页面的增、删、改、查")
public class EvaluationController { public class EvaluationController {
private final EvaluationService evaluationService; private final EvaluationService evaluationService;
private final EvaReportService evaReportService; private final EvaReportService evaReportService;
...@@ -158,14 +161,6 @@ public class EvaluationController { ...@@ -158,14 +161,6 @@ public class EvaluationController {
@ApiOperation("下载报告") @ApiOperation("下载报告")
@ApiImplicitParams({
@ApiImplicitParam(name="id",value = "报告主键"),
@ApiImplicitParam(name="danjia",value = "单价"),
@ApiImplicitParam(name="yusuan",value = "总预算金额"),
@ApiImplicitParam(name="gong",value = "工作量"),
@ApiImplicitParam(name="ewai",value = "额外申请"),
@ApiImplicitParam(name="agree",value = "0不同意 1同意")
})
@PostMapping("/downloadWps") @PostMapping("/downloadWps")
public ServerResponse download(@RequestBody Download download){ public ServerResponse download(@RequestBody Download download){
// return ResponseEntity.ok("http://120.55.57.35:12345/static/uplaods/a36b17568d4e466dacf9f088a29b4dbc.docx"); // return ResponseEntity.ok("http://120.55.57.35:12345/static/uplaods/a36b17568d4e466dacf9f088a29b4dbc.docx");
......
...@@ -3,8 +3,6 @@ package com.zjty.inspect.utils; ...@@ -3,8 +3,6 @@ package com.zjty.inspect.utils;
import com.zjty.inspect.entity.TechnologyContent; import com.zjty.inspect.entity.TechnologyContent;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfig;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import java.io.*; import java.io.*;
import java.util.List; import java.util.List;
...@@ -28,6 +26,7 @@ public class FreeMakerUtils { ...@@ -28,6 +26,7 @@ public class FreeMakerUtils {
public static String createWord(Template template, Map<String, List<TechnologyContent>> dataMap)throws Exception{ public static String createWord(Template template, Map<String, List<TechnologyContent>> dataMap)throws Exception{
//文件路径 //文件路径
String filePath= "/opt/monitor/inspect/static/ins/doc/"; String filePath= "/opt/monitor/inspect/static/ins/doc/";
// String filePath= "/home/tykj/doc/";
//文件名称 //文件名称
String fileName = System.currentTimeMillis()+".docx"; String fileName = System.currentTimeMillis()+".docx";
......
...@@ -28,7 +28,11 @@ public class WpsUtil { ...@@ -28,7 +28,11 @@ public class WpsUtil {
keyValue.put("codeUrl", reform.getCodeUrl()); keyValue.put("codeUrl", reform.getCodeUrl());
keyValue.put("codeName", reform.getCodeName()); keyValue.put("codeName", reform.getCodeName());
keyValue.put("gitUrl", reform.getGitUrl()); keyValue.put("gitUrl", reform.getGitUrl());
keyValue.put("moduleNum", String.valueOf(reform.getModuleNum())); Integer moduleNum = reform.getModuleNum();
keyValue.put("moduleNum", "0");
if(moduleNum>0){
keyValue.put("moduleNum", String.valueOf(moduleNum));
}
keyValue.put("cost", String.valueOf(reform.getCost())); keyValue.put("cost", String.valueOf(reform.getCost()));
keyValue.put("address", flipYesOrNo(reform.getAddress())); keyValue.put("address", flipYesOrNo(reform.getAddress()));
keyValue.put("localContact", reform.getLocalContact()); keyValue.put("localContact", reform.getLocalContact());
...@@ -41,13 +45,13 @@ public class WpsUtil { ...@@ -41,13 +45,13 @@ public class WpsUtil {
Integer code = reform.getApplicationType().get(i); Integer code = reform.getApplicationType().get(i);
keyValue.put("applicationType" + i + 1, ApplicationType.getByCode(code).getName()); keyValue.put("applicationType" + i + 1, ApplicationType.getByCode(code).getName());
} }
keyValue.put("time", String.valueOf(reform.getTime())); keyValue.put("time", "0");
if(StringUtils.isEmpty(String.valueOf(reform.getTime()))){ if(!StringUtils.isEmpty(String.valueOf(reform.getTime()))&&reform.getTime()>0){
keyValue.put("time", "0"); keyValue.put("time", String.valueOf(reform.getTime()));
} }
keyValue.put("tableNum", "0"); keyValue.put("tableNum", "0");
if(!StringUtils.isEmpty(String.valueOf(reform.getTableNum()))){ if(!StringUtils.isEmpty(String.valueOf(reform.getTableNum()))&&reform.getTableNum()>0){
keyValue.put("tableNum", String.valueOf(reform.getTableNum())); keyValue.put("tableNum", String.valueOf(reform.getTableNum()));
} }
keyValue.put("databaseNum", String.valueOf(reform.getDatabaseNum())); keyValue.put("databaseNum", String.valueOf(reform.getDatabaseNum()));
...@@ -99,7 +103,9 @@ public class WpsUtil { ...@@ -99,7 +103,9 @@ public class WpsUtil {
keyValue.put("otherApi" + i1, "无"); keyValue.put("otherApi" + i1, "无");
continue; continue;
} }
keyValue.put("otherApi" + i1, otherApis.get(i).getApiName()); if(!StringUtils.isEmpty(otherApis.get(i).getApiName())) {
keyValue.put("otherApi" + i1, otherApis.get(i).getApiName().trim());
}
} }
repairMap("microService", 13, middleware.getMicroServices(), keyValue); repairMap("microService", 13, middleware.getMicroServices(), keyValue);
......
No preview for this file type
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论