提交 5159e174 authored 作者: 孙洁清's avatar 孙洁清

Merge branch 'lj-project' of git.yfzx.zjtys.com.cn:912-system/monitor/inspect into lj-project

# Conflicts: # src/main/java/com/zjty/inspect/utils/DocumentWordUtil.java
...@@ -32,6 +32,8 @@ public class MvcConfig extends WebMvcConfigurationSupport { ...@@ -32,6 +32,8 @@ public class MvcConfig extends WebMvcConfigurationSupport {
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**") registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/"); .addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/static/**")
.addResourceLocations("classpath:/static/");
} }
@Override @Override
......
...@@ -5,6 +5,7 @@ import com.zjty.inspect.aop.AuthAnnotation; ...@@ -5,6 +5,7 @@ import com.zjty.inspect.aop.AuthAnnotation;
import com.zjty.inspect.entity.*; import com.zjty.inspect.entity.*;
import com.zjty.inspect.service.EvaluationService; import com.zjty.inspect.service.EvaluationService;
import com.zjty.inspect.utils.ExcelUtil; import com.zjty.inspect.utils.ExcelUtil;
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;
...@@ -135,4 +136,17 @@ public class EvaluationController { ...@@ -135,4 +136,17 @@ public class EvaluationController {
Page<Evaluation> pageList = evaluationService.findSearch(searchMap, page, size); Page<Evaluation> pageList = evaluationService.findSearch(searchMap, page, size);
return ResponseEntity.ok(new PageResult<Evaluation>(pageList.getTotalElements(), pageList.getContent()) ); return ResponseEntity.ok(new PageResult<Evaluation>(pageList.getTotalElements(), pageList.getContent()) );
} }
/**
* 修改评估报告
* @param id id
* @return
*/
@GetMapping(value = "/bg/{id}")
@ApiOperation("修改评估报告")
public ResponseEntity findall(@PathVariable String id){
Evaluation evaluation = evaluationService.findById(id);
Map<String, String> wps = WpsUtil.createWps(evaluation);
return ResponseEntity.ok(wps);
}
} }
package com.zjty.inspect.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Download {
private String id;//主键
private String danjia;//单位
private String yusuan;//总预算金额
private String gong;//工作量
private String ewai;//额外申请
}
...@@ -3,6 +3,7 @@ package com.zjty.inspect.entity; ...@@ -3,6 +3,7 @@ package com.zjty.inspect.entity;
import lombok.Data; import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List; import java.util.List;
/** /**
...@@ -13,5 +14,5 @@ import java.util.List; ...@@ -13,5 +14,5 @@ import java.util.List;
public class ExcelDataTemp { public class ExcelDataTemp {
private String name; private String name;
private List<ExcelDataEntity> arrayList = new ArrayList(); private List<ExcelDataEntity> arrayList = new LinkedList<>();
} }
package com.zjty.inspect.enums; package com.zjty.inspect.enums;
import java.util.HashMap;
import java.util.Map;
public enum Framework { public enum Framework {
/** /**
* 架构 * 架构
*/ */
SEPARATE("分离型架构",1), SEPARATE("分离型架构",1),
MIXTURE("混合型架构",2); MIXTURE("混合型架构",2),
NONE("无",3);
Framework(String name,Integer status){ Framework(String name,Integer status){
this.name=name; this.name=name;
this.status=status; this.status=status;
...@@ -24,4 +27,27 @@ public enum Framework { ...@@ -24,4 +27,27 @@ public enum Framework {
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }
private static Map<String,Framework> frameWorkEnumMap=new HashMap<>();
private static Map<Integer,Framework> frameWorkEnumCodeMap=new HashMap<>();
static {
for (Framework frameWorkEnum : Framework.values()) {
frameWorkEnumMap.put(frameWorkEnum.getName(),frameWorkEnum);
frameWorkEnumCodeMap.put(frameWorkEnum.getStatus(),frameWorkEnum);
}
}
public static Framework getByName(String name){
Framework frameWorkEnum = frameWorkEnumMap.get(name);
if(frameWorkEnum==null){
return NONE;
}
return frameWorkEnum;
}
public static Framework getByCode(Integer code){
Framework frameWorkEnum = frameWorkEnumCodeMap.get(code);
if(frameWorkEnum==null){
return NONE;
}
return frameWorkEnum;
}
} }
package com.zjty.inspect.utils; package com.zjty.inspect.utils;
import com.zjty.inspect.entity.DocumentContent;
import com.zjty.inspect.entity.DocumentPage;
import com.zjty.inspect.entity.TitleHead;
import com.zjty.inspect.enums.DocumentTitleEnum; import com.zjty.inspect.enums.DocumentTitleEnum;
import org.springframework.util.StringUtils;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
...@@ -1302,4 +1306,66 @@ public class DocumentWordUtil { ...@@ -1302,4 +1306,66 @@ public class DocumentWordUtil {
" <w:trHeight w:val=\"400\" w:h-rule=\"atLeast\"/>\n" + " <w:trHeight w:val=\"400\" w:h-rule=\"atLeast\"/>\n" +
" </w:trPr>"; " </w:trPr>";
} }
public static String createDocument(DocumentPage documentPage) {
StringBuilder sb=new StringBuilder();
//前面部分内容
String standard = DocumentWordUtil.standard();
String enddard = DocumentWordUtil.enddard();
//标题内容
String maintitle = DocumentWordUtil.Maintitle();
// String subheading = DocumentWordUtil.subheading();
//标题下的内容
String standContent = DocumentWordUtil.content();
//表格内容
//页眉
String header = documentPage.getHeader();
String s1 = maintitle.replaceAll("#title#", header);
sb.append(standard);
sb.append(s1);
List<TitleHead> titleHeads = documentPage.getTitleHeads();
if(titleHeads!=null&&titleHeads.size()>0){
for (TitleHead titleHead : titleHeads) {
DocumentTitleEnum byCode = DocumentTitleEnum.getByCode(titleHead.getParentId());
if (byCode != null) {
String titleContent = DocumentWordUtil.subheading(byCode);
//标题名称
String name = titleHead.getName();
if (!StringUtils.isEmpty(name)) {
//标题级别
int parentId = titleHead.getParentId();
String s = titleContent.replaceAll("#title#", name)
.replaceAll("#parentId#", String.valueOf(parentId));
sb.append(s);
}
List<DocumentContent> documentContents = titleHead.getDocumentContents();
if (documentContents != null && documentContents.size() > 0) {
for (DocumentContent documentContent : documentContents) {
if (documentContent != null) {
String content = documentContent.getContent();
String baseUrl = documentContent.getBaseUrl();
String documentTable = documentContent.getDocumentTable();
if (!StringUtils.isEmpty(content)) {
String c = standContent;
String s = c.replaceAll("#content#", content);
sb.append(s);
}
if (!StringUtils.isEmpty(baseUrl)) {
}
if (!StringUtils.isEmpty(documentTable)) {
sb.append(documentTable);
}
}
}
}
}
}
}
sb.append(enddard);
return sb.toString();
}
} }
...@@ -472,12 +472,15 @@ public class ExcelUtil { ...@@ -472,12 +472,15 @@ public class ExcelUtil {
public static List<ExcelDataTemp> parseExcel2Entity(Evaluation evaluation) { public static List<ExcelDataTemp> parseExcel2Entity(Evaluation evaluation) {
ArrayList<ExcelDataTemp> excelDataTemps = new ArrayList<>(); ArrayList<ExcelDataTemp> excelDataTemps = new ArrayList<>();
ArrayList<String> tables = new ArrayList<>();
String inEva = evaluation.getInEva(); String inEva = evaluation.getInEva();
ExcelDataTemp excelDataTemp = new ExcelDataTemp(); ExcelDataTemp excelDataTemp = new ExcelDataTemp();
excelDataTemp.setName("基本信息"); excelDataTemp.setName("基本信息");
List<ExcelDataEntity> arrayList = excelDataTemp.getArrayList(); List<ExcelDataEntity> arrayList = excelDataTemp.getArrayList();
if (inEva != null) { if (inEva != null) {
Reform reform = JSON.parseObject(evaluation.getInEva(), Reform.class); Reform reform = JSON.parseObject(evaluation.getInEva(), Reform.class);
arrayList.add(exportEntity("用户名", reform.getUsername())); arrayList.add(exportEntity("用户名", reform.getUsername()));
if(reform.getAssessmentType()==1){ if(reform.getAssessmentType()==1){
arrayList.add(exportEntity("评估类型", "快速评估")); arrayList.add(exportEntity("评估类型", "快速评估"));
......
package com.zjty.inspect.utils;
import com.alibaba.fastjson.JSON;
import com.zjty.inspect.entity.*;
import com.zjty.inspect.enums.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Mcj
* @date 2020-04-17 09:58
*/
public class WpsUtil {
public static Map<String,String> createWps(Evaluation evaluation) {
Reform reform = JSON.parseObject(evaluation.getInEva(), Reform.class);
AssessmentReport assessmentReport = JSON.parseObject(evaluation.getOutEva(), AssessmentReport.class);
HashMap<String, String> keyValue = new HashMap<>();
keyValue.put("username",reform.getUsername());
keyValue.put("mode",getMode(reform.getMode()));
keyValue.put("projectName",reform.getProjectName());
keyValue.put("codeUrl",reform.getCodeUrl());
keyValue.put("codeName",reform.getCodeName());
keyValue.put("gitUrl",reform.getGitUrl());
keyValue.put("moduleNum",String.valueOf(reform.getModuleNum()));
keyValue.put("cost",String.valueOf(reform.getCost()));
keyValue.put("address",flipYesOrNo(reform.getAddress()));
keyValue.put("localContact",reform.getLocalContact());
keyValue.put("localPhone",reform.getLocalPhone());
keyValue.put("secret",flipYesOrNo(reform.getSecret()));
keyValue.put("disasterTolerance",flipYesOrNo(reform.getDisasterTolerance()));
keyValue.put("safe",flipSafeStrong(reform.getSafe()));
keyValue.put("framework",Framework.getByCode(reform.getFramework()).getName());
for (int i = 0; i < reform.getApplicationType().size(); i++) {
Integer code = reform.getApplicationType().get(i);
keyValue.put("applicationType"+i+1,ApplicationType.getByCode(code).getName());
}
keyValue.put("time",String.valueOf(reform.getTime()));
keyValue.put("tableNum",String.valueOf(reform.getTableNum()));
keyValue.put("databaseNum",String.valueOf(reform.getDatabaseNum()));
keyValue.put("strategy",strategyToString(reform.getStrategy()));
keyValue.put("rto", RtoEnum.getByCode(reform.getRto()).getName());
keyValue.put("rpo", RpoEnum.getByCode(reform.getRpo()).getName());
keyValue.put("unitName",reform.getUnitName());
keyValue.put("unitPhone",reform.getUnitPhone());
keyValue.put("unitContent",reform.getUnitContent());
keyValue.put("gradeProtection",flipYesOrNo(reform.getGradeProtection()));
keyValue.put("cycle",String.valueOf(reform.getCycle()));
SystemStructure systemStructure = reform.getSystemStructure();
Details application = systemStructure.getApplication();
getSys("application",application,keyValue);
Details database = systemStructure.getDatabase();
getSys("database",database,keyValue);
Details nas = systemStructure.getNas();
getSys("nas",nas,keyValue);
Details slb = systemStructure.getSlb();
getSys("slb",slb,keyValue);
Details cdn = systemStructure.getCdn();
getSys("cdn",cdn,keyValue);
Details vps = systemStructure.getVps();
getSys("vps",vps,keyValue);
Browser browser = reform.getBrowser();
List<BaseDes> compatibleBrowsers = browser.getCompatibleBrowsers();
for (int i = 0; i < compatibleBrowsers.size(); i++) {
keyValue.put("compatibleBrowsers"+i+1, compatibleBrowsers.get(i).getName());
}
List<BaseDes> browserPlugs = browser.getBrowserPlugs();
for (int i = 0; i < browserPlugs.size(); i++) {
keyValue.put("browserPlugs"+i+1, browserPlugs.get(i).getName());
}
Middleware middleware = reform.getMiddleware();
for (int i = 0; i < middleware.getMiddlewareEnums().size(); i++) {
keyValue.put("middleware"+i+1, middleware.getMiddlewareEnums().get(i).getName());
}
List<OtherApi> otherApis = middleware.getOtherApis();
for (int i = 0; i < otherApis.size(); i++) {
keyValue.put("otherApi"+i+1, otherApis.get(i).getApiName());
}
for (int i = 0; i < middleware.getMicroServices().size(); i++) {
keyValue.put("microService"+i+1, middleware.getMicroServices().get(i).getName());
}
Database database1 = reform.getDatabase();
for (int i = 0; i < database1.getDatabaseType().size(); i++) {
keyValue.put("database"+i+1, database1.getDatabaseType().get(i).getName());
}
keyValue.put("databaseView", flipYesOrNo(database1.getView()));
keyValue.put("databaseStorage", flipYesOrNo(database1.getStorage()));
keyValue.put("databaseFunction", flipYesOrNo(database1.getFunction()));
keyValue.put("databaseDbLink", flipYesOrNo(database1.getDbLink()));
keyValue.put("databaseTimeTask", flipYesOrNo(database1.getTimeTask()));
keyValue.put("databaseSequence", flipYesOrNo(database1.getSequence()));
keyValue.put("databaseTrigger", flipYesOrNo(database1.getTrigger()));
keyValue.put("databaseSafe", flipYesOrNo(database1.getSafe()));
keyValue.put("databaseDisasterTolerance", flipYesOrNo(database1.getDisasterTolerance()));
keyValue.put("databaseSeparate", flipYesOrNo(database1.getSeparate()));
keyValue.put("databasePerformance", flipYesOrNo(database1.getPerformance()));
keyValue.put("databaseOtherContent",database1.getOtherContent());
Apply apply = reform.getApply();
keyValue.put("applyCost",String.valueOf(apply.getCost()));
keyValue.put("applyReason",apply.getReason());
DevelopLanguageSystem developLanguageSystem = reform.getDevelopLanguageSystem();
keyValue.put("language",developLanguageSystem.getName());
for (int i = 0; i < developLanguageSystem.getDevFrameworks().size(); i++) {
keyValue.put("devFrameworks"+i+1, developLanguageSystem.getDevFrameworks().get(i).getName());
}
for (int i = 0; i < developLanguageSystem.getFontDevTechnologies().size(); i++) {
keyValue.put("fontDevTechnologies"+i+1, developLanguageSystem.getFontDevTechnologies().get(i).getName());
}
for (int i = 0; i < developLanguageSystem.getCsDevTechnologies().size(); i++) {
keyValue.put("csDevTechnologies"+i+1, developLanguageSystem.getCsDevTechnologies().get(i).getName());
}
for (int i = 0; i < developLanguageSystem.getOpGAs().size(); i++) {
keyValue.put("opGAs"+i+1, developLanguageSystem.getOpGAs().get(i).getName());
}
for (int i = 0; i < developLanguageSystem.getDevLanguages().size(); i++) {
keyValue.put("devLanguages"+i+1, developLanguageSystem.getDevLanguages().get(i).getName());
}
LocalSystemDep localSystemDep = reform.getLocalSystemDep();
keyValue.put("localSystemDepName", localSystemDep.getName());
keyValue.put("localSystemDepMoney", String.valueOf(localSystemDep.getMoney()));
keyValue.put("localSystemDepDes", localSystemDep.getDes());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = simpleDateFormat.format(assessmentReport.getTime());
keyValue.put("inspectTime", format);
keyValue.put("difficulty",String.valueOf(assessmentReport.getDifficulty()));
keyValue.put("budget",assessmentReport.getBudget());
SysScale sysScale = assessmentReport.getSysScale();
keyValue.put("sysScaleCodeNum",sysScale.getCode().getNum().toString());
keyValue.put("sysScaleCodeDes",sysScale.getCode().getDes());
keyValue.put("sysScaleFileNum",sysScale.getFile().getNum().toString());
keyValue.put("sysScaleFileDes",sysScale.getFile().getDes());
keyValue.put("sysScaleModeNum",sysScale.getMode().getNum().toString());
keyValue.put("sysScaleModeDes",sysScale.getMode().getDes());
TechnologyList technologyList = assessmentReport.getTechnologyList();
keyValue.put("technologyDes",technologyList.getDes());
List<TechnologyReport> technologyReports = technologyList.getTechnologyReports();
for (int i = 0; i < technologyList.getTechnologyReports().size(); i++) {
keyValue.put("technology"+i+1, technologyReports.get(i).getTechnology());
for (int i1 = 0; i1 < technologyReports.get(i).getTechnologyContents().size(); i1++) {
TechnologyContent technologyContent = technologyReports.get(i).getTechnologyContents().get(i1);
keyValue.put("technologyContentLocal"+i+1+"-"+i1+1, technologyContent.getLocal());
keyValue.put("technologyContentKeyWord"+i+1+"-"+i1+1, technologyContent.getKeyWord());
keyValue.put("technologyContentFile"+i+1+"-"+i1+1, technologyContent.getFile());
keyValue.put("technologyContentPosition"+i+1+"-"+i1+1, technologyContent.getPosition());
keyValue.put("technologyContentStrategy"+i+1+"-"+i1+1, getMode(technologyContent.getStrategy()));
}
}
Workload workload = assessmentReport.getWorkload();
keyValue.put("workloadDes",workload.getDes());
keyValue.put("workloadCost",String.valueOf(workload.getCost()));
keyValue.put("workloadMode",String.valueOf(workload.getMode()));
Basis development = workload.getDevelopment();
keyValue.put("workloadDevelopmentVolume",String.valueOf(development.getDevelopmentVolume()));
keyValue.put("workloadDevelopmentCorrectionFactor",String.valueOf(development.getCorrectionFactor()));
Basis test = workload.getTest();
keyValue.put("workloadTestVolume",String.valueOf(test.getDevelopmentVolume()));
keyValue.put("workloadTestCorrectionFactor",String.valueOf(test.getCorrectionFactor()));
Basis deploy = workload.getDevelopment();
keyValue.put("workloadDeployVolume",String.valueOf(deploy.getDevelopmentVolume()));
keyValue.put("workloadDeployCorrectionFactor",String.valueOf(deploy.getCorrectionFactor()));
Basis total = workload.getDevelopment();
keyValue.put("workloadTotalVolume",String.valueOf(total.getDevelopmentVolume()));
keyValue.put("workloadTotalCorrectionFactor",String.valueOf(total.getCorrectionFactor()));
DifficultyAssessment difficultyAssessment = assessmentReport.getDifficultyAssessment();
keyValue.put("difficultyAssessmentDes",difficultyAssessment.getDes());
FrameDifficulty frameDifficulty = difficultyAssessment.getFrameDifficulty();
keyValue.put("difficultyFrameDifficultySystemEvaluation",String.valueOf(frameDifficulty.getSystemEvaluation()));
keyValue.put("difficultyFrameDifficultyMessage",String.valueOf(frameDifficulty.getMessage()));
keyValue.put("difficultyFrameDifficultyDifficulty",String.valueOf(frameDifficulty.getDifficulty()));
keyValue.put("difficultyFrameDifficultyLoad",String.valueOf(frameDifficulty.getLoad()));
keyValue.put("difficultyFrameDifficultyDetails",Framework.getByCode(frameDifficulty.getDetails()).getName());
keyValue.put("difficultyFrameDifficultyDistributed",flipYesOrNo(frameDifficulty.getDistributed()));
keyValue.put("difficultyFrameDifficultyLoadBalance",flipYesOrNo(frameDifficulty.getLoadBalance()));
keyValue.put("difficultyFrameDifficultyDisaster",flipYesOrNo(frameDifficulty.getDisaster()));
keyValue.put("difficultyFrameDifficultyOtherDemand",frameDifficulty.getOtherDemand());
BrowserDifficulty browserDifficulty = difficultyAssessment.getBrowserDifficulty();
keyValue.put("browserDifficultySystemEvaluation",String.valueOf(browserDifficulty.getSystemEvaluation()));
keyValue.put("browserDifficultyMessage",String.valueOf(browserDifficulty.getMessage()));
keyValue.put("browserDifficultyDifficulty",String.valueOf(browserDifficulty.getDifficulty()));
keyValue.put("browserDifficultyLoad",String.valueOf(browserDifficulty.getLoad()));
keyValue.put("browserDifficultyStyle",flipYesOrNo(browserDifficulty.getStyle()));
keyValue.put("browserDifficultyApi",flipYesOrNo(browserDifficulty.getApi()));
keyValue.put("browserDifficultyPlugInUnit",flipYesOrNo(browserDifficulty.getPlugInUnit()));
keyValue.put("browserDifficultyGeography",flipYesOrNo(browserDifficulty.getGeography()));
keyValue.put("browserDifficultyPeripheral",flipYesOrNo(browserDifficulty.getPeripheral()));
keyValue.put("browserDifficultyAnimation",flipYesOrNo(browserDifficulty.getAnimation()));
keyValue.put("browserDifficultyThreeD",flipYesOrNo(browserDifficulty.getThreeD()));
keyValue.put("browserDifficultyDocument",flipYesOrNo(browserDifficulty.getDocument()));
keyValue.put("browserDifficultyMedia",flipYesOrNo(browserDifficulty.getMedia()));
keyValue.put("browserDifficultyFlash",flipYesOrNo(browserDifficulty.getFlash()));
keyValue.put("browserDifficultyOtherDemand",flipYesOrNo(browserDifficulty.getOtherDemand()));
MiddlewareDifficulty middlewareDifficulty = difficultyAssessment.getMiddlewareDifficulty();
keyValue.put("middlewareDifficultySystemEvaluation",String.valueOf(middlewareDifficulty.getSystemEvaluation()));
keyValue.put("middlewareDifficultyMessage",String.valueOf(middlewareDifficulty.getMessage()));
keyValue.put("middlewareDifficultyDifficulty",String.valueOf(middlewareDifficulty.getDifficulty()));
keyValue.put("middlewareDifficultyLoad",String.valueOf(middlewareDifficulty.getLoad()));
keyValue.put("middlewareDifficultyNumber",String.valueOf(middlewareDifficulty.getNumber()));
keyValue.put("middlewareDifficultyWeb",flipYesOrNo(middlewareDifficulty.getWeb()));
keyValue.put("middlewareDifficultyJndi",flipYesOrNo(middlewareDifficulty.getJndi()));
keyValue.put("middlewareDifficultyJms",flipYesOrNo(middlewareDifficulty.getJms()));
keyValue.put("middlewareDifficultyRoute",flipYesOrNo(middlewareDifficulty.getRoute()));
DatabaseDifficulty databaseDifficulty = difficultyAssessment.getDatabaseDifficulty();
keyValue.put("databaseDifficultyDifficulty",String.valueOf(databaseDifficulty.getDifficulty()));
keyValue.put("databaseDifficultyLoad",String.valueOf(databaseDifficulty.getLoad()));
keyValue.put("databaseDisasterTolerance",getDis(databaseDifficulty.getDisasterTolerance()));
keyValue.put("databaseDifficultySafe",flipYesOrNo(databaseDifficulty.getSafe()));
keyValue.put("databaseDifficultySeparate",flipYesOrNo(databaseDifficulty.getSeparate()));
keyValue.put("databaseDifficultyPerformance",flipYesOrNo(databaseDifficulty.getPerformance()));
ProgramDifficulty programDifficulty = difficultyAssessment.getProgramDifficulty();
keyValue.put("programDifficultyDifficulty",String.valueOf(programDifficulty.getDifficulty()));
keyValue.put("programDifficultyLoad",String.valueOf(programDifficulty.getLoad()));
return keyValue;
}
public static DocumentContent setDocumentTable(List<String> data,int col){
String tableString = DocumentWordUtil.getTableString(data, col);
DocumentContent documentContent = new DocumentContent();
//设置进head标题下面的表格中
documentContent.setDocumentTable(tableString);
return documentContent;
}
public static List<DocumentContent> setDocumentContents(DocumentContent documentContent){
ArrayList<DocumentContent> documentContents = new ArrayList<>();
documentContents.add(documentContent);
return documentContents;
}
private static int getFramework(String construction) {
switch (construction) {
case "B/S":
return 1;
case "C/S":
return 2;
case "单机运行":
return 0;
case "分布式":
return 4;
}
return -1;
}
private static String getFilpFramework(int construction) {
switch (construction) {
case 1:
return "B/S";
case 2:
return "C/S";
case 0:
return "单机运行";
case 4:
return "分布式";
default:
break;
}
return "";
}
private static int yesOrNo(String target) {
if ("是".equals(target)) {
return 1;
} else if ("否".equals(target)) {
return 2;
} else {
return -1;
}
}
private static int SpecialYesOrNo(String target) {
if ("是".equals(target)) {
return 4;
} else if ("否".equals(target)) {
return 0;
} else {
return -1;
}
}
private static String flipYesOrNo(Integer target) {
if (target == 1) {
return "是";
} else if (target == 2) {
return "否";
} else {
return "我不清楚";
}
}
private static String flipSafeYesOrNo(Integer target) {
if(target==null){
return "否";
}
if (target == 4) {
return "强";
} else if (target == 2) {
return "弱";
} else {
return "我不清楚";
}
}
private static String flipSpecialYesOrNo(Integer target) {
if (target == 4) {
return "是";
} else if (target == 0) {
return "否";
} else {
return "我不清楚";
}
}
private static String getMode(Integer target) {
if(target==null){
return "我不清楚";
}
if (target == 1) {
return "改造";
} else if (target == 2) {
return "适配";
} else {
return "我不清楚";
}
}
private static String flipSafeStrong(Integer target) {
if(target==null || target==1){
return "无";
}
if (target == 3) {
return "强";
} else if (target == 2) {
return "弱";
} else {
return "我不清楚";
}
}
private static String strategyToString(Integer target){
if(target == 1){
return "休息日或晚间切换";
}else if(target == 2){
return "暂停服务";
}else if(target == 3){
return "平滑过渡";
}else{
return "不清楚";
}
}
private static String localOrCloud(Integer deploy){
if(deploy==1){
return "本地";
}else if(deploy==2){
return "政务云";
}else{
return "不清楚";
}
}
private static String getDis(Integer dis){
if(dis==1){
return "否";
}else if(dis==2){
return "主备";
}else if(dis==3){
return "分布式";
}else{
return "不清楚";
}
}
private static void getSys(String sysName,Details application, Map<String,String> keyValue){
keyValue.put(sysName+"Deploy",localOrCloud(application.getDeploy()));
keyValue.put(sysName+"OperateSystem",application.getOperateSystem().getName());
keyValue.put(sysName+"Code",String.valueOf(application.getOperateSystem().getCode()));
keyValue.put(sysName+"Num",application.getNum());
keyValue.put(sysName+"CpuNum",application.getCpuNum());
keyValue.put(sysName+"Ghz",application.getGhz());
keyValue.put(sysName+"Space",application.getSpace());
keyValue.put(sysName+"Other",application.getSpace());
keyValue.put(sysName+"Edition",application.getEdition());
keyValue.put(sysName+"Memory",application.getMemory());
}
}
...@@ -66,4 +66,5 @@ spring.freemarker.template-loader-path=classpath:/templates ...@@ -66,4 +66,5 @@ spring.freemarker.template-loader-path=classpath:/templates
#spring.redis.port=6379 #spring.redis.port=6379
##Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 ##Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
#spring.redis.password= #spring.redis.password=
#宁波项目服务器ip
address=120.55.57.35 address=120.55.57.35
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论