提交 cc866ccb authored 作者: 马晨俊's avatar 马晨俊

mcj:

修复websocket输送问题,文件上传问题
上级 67b1e5a5
......@@ -91,18 +91,6 @@ public class EvaluationController {
return ServerResponse.ok(null);
}
@ApiOperation("根据报告id查询excel输入")
@GetMapping(value = "/in/excel/{id}")
public ServerResponse<List<ExcelDataTemp>> exportInName(@PathVariable String id) {
Evaluation evaluation = evaluationService.findById(id);
if (evaluation != null) {
List<ExcelDataTemp> excelDataTemp = ExcelUtil.parseExcel2Entity(evaluation);
return ServerResponse.ok(excelDataTemp);
} else {
return ServerResponse.ok(new ArrayList<>());
}
}
/**
* 修改评估报告
*
......
......@@ -10,11 +10,15 @@ import com.zjty.inspect.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.io.File;
import java.util.*;
......@@ -53,6 +57,8 @@ public class InspectController {
//应用类型转换:大型4
private Integer[] big = {5, 9};
@Value("${upload.location}")
private String uploadPath;
/**
* 上传代码进行评估
*
......@@ -381,23 +387,58 @@ public class InspectController {
return ServerResponse.ok(save.getId());
}
@ApiOperation("大文件分片上传")
// @PostMapping("/chunkUpload")
@PostMapping("/uploads")
private ServerResponse uploads(@RequestParam(value = "file") MultipartFile multfile) {
public ServerResponse fileChunkUpload(MultipartFileParam param, HttpServletRequest request, HttpServletResponse response){
// OSSInformation ossInformation = ossInformationService.queryOne();
// String root = ossInformation.getRoot();
String root = uploadPath;
//验证文件夹规则,不能包含特殊字符
java.io.File file = new java.io.File(root);
// createDirectoryQuietly(file);
System.out.println("88888888888888");
String path=file.getAbsolutePath();
response.setContentType("text/html;charset=UTF-8");
// response.setStatus对接前端插件
// 200, 201, 202: 当前块上传成功,不需要重传。
// 404, 415. 500, 501: 当前块上传失败,会取消整个文件上传。
// 其他状态码: 出错了,但是会自动重试上传。
try {
HashMap<String, String> map = new HashMap<>();
map.put("unzip","获取压缩文件");
File file = FileUtil.saveToLocal(multfile);
map.put("unzip","压缩文件解压完毕");
asyncTask.sendMessageToAll(map);
String name = file.getName();
String path = file.getCanonicalPath();
return ServerResponse.ok(new com.zjty.inspect.entity.File(name, path));
} catch (IOException e) {
/**
* 判断前端Form表单格式是否支持文件上传
*/
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if(!isMultipart){
//这里是我向前端发送数据的代码,可理解为 return 数据; 具体的就不贴了
System.out.println("不支持的表单格式");
return ServerResponse.badRequest();
}else {
param.setTaskId(param.getIdentifier());
File myfile = inspectService.chunkUploadByMappedByteBuffer(param,path);//service层
if (myfile!=null){
String name = myfile.getName();
String myPath = myfile.getCanonicalPath();
return ServerResponse.ok(new com.zjty.inspect.entity.File(name, myPath));
}else {
return ServerResponse.ok("继续断点传续!");
}
}
} catch (Exception e) {
e.printStackTrace();
return ServerResponse.error(500);
// System.out.println("上传文件失败");
// response.setStatus(415);
return ServerResponse.error(415, "上传文件失败");
}
}
@PostMapping("/gitdownload")
private ServerResponse gitDownloads(String gitAddress, String username, String password) {
try {
......@@ -412,7 +453,6 @@ public class InspectController {
private ServerResponse<Reform> uploadFileToInspect(MultipartFile file, String username) throws IOException {
Reform reform = ExcelUtil.parseExcel(file.getInputStream(),file.getOriginalFilename());
reform.setUsername(username);
System.out.println("1");
return ServerResponse.ok(reform);
}
}
......@@ -15,4 +15,6 @@ public class BaseDes {
private String des;
@ApiModelProperty(value = "版本号")
private String version;
@ApiModelProperty(value = "是否为其他项")
private Integer other;
}
......@@ -45,7 +45,9 @@ public class ServerResponse<T> implements Serializable {
}
public static <T> ServerResponse error(int status,String data){
return new ServerResponse(status,"请求失败",data);
}
public static <T> ServerResponse error(Object data){
return new ServerResponse(400,"请求失败",data);
}
......
......@@ -156,10 +156,10 @@ public class Inspector {
initData();
//扫描文件,进行文件分类
HashMap<String, String> map = new HashMap<>();
map.put("file","开始扫描文件");
map.put("msg","开始扫描文件");
asyncTask.sendMessageToAll(map);
scanFiles();
map.put("file","文件扫描结束");
map.put("msg","文件扫描结束");
asyncTask.sendMessageToAll(map);
//配置参数
inspectParameter.setCodeSize((int) codeSize);
......@@ -171,10 +171,10 @@ public class Inspector {
//根据扫描结果以及用户配置得出需要使用的规则及技术
ruleTransform(inspectParameter.getRecastMethod());
//扫描源代码文件
map.put("file","开始扫描源代码文件");
map.put("msg","开始扫描源代码文件");
asyncTask.sendMessageToAll(map);
forEachFilesMap();
map.put("file","源代码文件扫描结束");
map.put("msg","源代码文件扫描结束");
asyncTask.sendMessageToAll(map);
//将得到的告警信息根据技术id进行转换
Set<String> technologyIds = warns.stream().map(Warn::getTechnologyId).collect(Collectors.toSet());
......@@ -256,7 +256,7 @@ public class Inspector {
for (Path path1 : entry.getValue()) {
try {
fileNum = fileNum + 1;
map.put("totalFile", fileNum + "/" + fileSize);
map.put("msg", fileNum + "/" + fileSize);
System.out.println(fileNum + "/" + fileSize);
asyncTask.sendMessageToAll(map);
//如果文件类型为jar活着class则不读取
......
......@@ -24,7 +24,6 @@ public class AsyncTask {
* @Author: LiuJie
* @Date: 2019/5/20
*/
@Async("myTaskAsyncPool")
public void sendMessageToAll(Map<String,String> map) {
webSocketServer.sendMessageToAll(map);
}
......
......@@ -311,9 +311,14 @@ public class ExcelUtil {
ArrayList<DatabaseType> databaseTypes = new ArrayList<>();
for (int i = 74; i < 77; i++) {
String database = getExcelCell(i, 2, sheetAt);
String version = getExcelCell(i, 3, sheetAt);
String remark = getExcelCell(i, 4, sheetAt);
if (!"".equals(database)) {
DatabaseType byName = DatabaseType.getByName(database);
databaseTypes.add(byName);
DatabaseType databaseType = DatabaseType.getByName(database);
databaseTypes.add(databaseType);
}
if(!"".equals(remark)){
database1.setOtherContent(remark);
}
}
database1.setDatabaseType(databaseTypes);
......
......@@ -17,86 +17,89 @@ import java.util.*;
public class WpsUtil {
public static Map<String,String> createWps(Evaluation evaluation) {
HashMap<String,List<TechnologyContent>> teMap=new HashMap<>();
public static Map<String, String> createWps(Evaluation evaluation) {
HashMap<String, List<TechnologyContent>> teMap = new HashMap<>();
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());
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("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("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()));
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);
getSys("application", application, keyValue);
Details database = systemStructure.getDatabase();
getSys("database",database,keyValue);
getSys("database", database, keyValue);
Details nas = systemStructure.getNas();
getSys("nas",nas,keyValue);
getSys("nas", nas, keyValue);
Details slb = systemStructure.getSlb();
getSys("slb",slb,keyValue);
getSys("slb", slb, keyValue);
Details cdn = systemStructure.getCdn();
getSys("cdn",cdn,keyValue);
getSys("cdn", cdn, keyValue);
Details vps = systemStructure.getVps();
getSys("vps",vps,keyValue);
getSys("vps", vps, keyValue);
Browser browser = reform.getBrowser();
repairMap("compatibleBrowsers", 13, browser.getCompatibleBrowsers(), keyValue);
repairMap("browserPlugs",13,browser.getBrowserPlugs(),keyValue);
repairMap("middleware",13,reform.getMiddleware().getMiddlewareEnums(),keyValue);
repairMap("browserPlugs", 13, browser.getBrowserPlugs(), keyValue);
repairMap("middleware", 13, reform.getMiddleware().getMiddlewareEnums(), keyValue);
Middleware middleware = reform.getMiddleware();
List<OtherApi> otherApis = middleware.getOtherApis();
for (int i = 0; i < 13; i++) {
int i1 = i + 1;
if(i>=otherApis.size()){
keyValue.put("otherApi"+i1, "无");
if (i >= otherApis.size()) {
keyValue.put("otherApi" + i1, "无");
continue;
}
if(otherApis.get(i).getOther()==1){
keyValue.put("otherApi" + i1, otherApis.get(i).getDes());
continue;
}
keyValue.put("otherApi"+i1, otherApis.get(i).getApiName());
keyValue.put("otherApi" + i1, otherApis.get(i).getApiName());
}
repairMap("microService",13,middleware.getMicroServices(),keyValue);
repairMap("microService", 13, middleware.getMicroServices(), keyValue);
Database database1 = reform.getDatabase();
for (int i = 0; i < 13; i++) {
int i1 = i + 1;
if(i>=database1.getDatabaseType().size()){
keyValue.put("database"+i1, "无");
if (i >= database1.getDatabaseType().size()) {
keyValue.put("database" + i1, "无");
continue;
}
keyValue.put("database"+i1, database1.getDatabaseType().get(i).getName());
keyValue.put("database" + i1, database1.getDatabaseType().get(i).getName());
}
......@@ -111,21 +114,20 @@ public class WpsUtil {
keyValue.put("databaseDisasterTolerance", flipYesOrNo(database1.getDisasterTolerance()));
keyValue.put("databaseSeparate", flipYesOrNo(database1.getSeparate()));
keyValue.put("databasePerformance", flipYesOrNo(database1.getPerformance()));
keyValue.put("databaseOtherContent",database1.getOtherContent());
keyValue.put("databaseOtherContent", database1.getOtherContent());
Apply apply = reform.getApply();
keyValue.put("applyCost",String.valueOf(apply.getCost()));
keyValue.put("applyReason",apply.getReason());
keyValue.put("applyCost", String.valueOf(apply.getCost()));
keyValue.put("applyReason", apply.getReason());
DevelopLanguageSystem developLanguageSystem = reform.getDevelopLanguageSystem();
keyValue.put("language",developLanguageSystem.getName());
repairMap("devFrameworks",13,developLanguageSystem.getDevFrameworks(),keyValue);
repairMap("fontDevTechnologies",13,developLanguageSystem.getFontDevTechnologies(),keyValue);
repairMap("csDevTechnologies",13,developLanguageSystem.getCsDevTechnologies(),keyValue);
repairMap("opGAs",13,developLanguageSystem.getOpGAs(),keyValue);
repairMap("devLanguages",13,developLanguageSystem.getDevLanguages(),keyValue);
keyValue.put("language", developLanguageSystem.getName());
repairMap("devFrameworks", 13, developLanguageSystem.getDevFrameworks(), keyValue);
repairMap("fontDevTechnologies", 13, developLanguageSystem.getFontDevTechnologies(), keyValue);
repairMap("csDevTechnologies", 13, developLanguageSystem.getCsDevTechnologies(), keyValue);
repairMap("opGAs", 13, developLanguageSystem.getOpGAs(), keyValue);
repairMap("devLanguages", 13, developLanguageSystem.getDevLanguages(), keyValue);
LocalSystemDep localSystemDep = reform.getLocalSystemDep();
keyValue.put("localSystemDepName", localSystemDep.getName());
......@@ -135,147 +137,148 @@ public class WpsUtil {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = simpleDateFormat.format(assessmentReport.getTime());
keyValue.put("inspectTime", format);
keyValue.put("createTime", System.currentTimeMillis()+"");
keyValue.put("difficulty",String.valueOf(assessmentReport.getDifficulty()));
keyValue.put("budget",assessmentReport.getBudget());
keyValue.put("createTime", System.currentTimeMillis() + "");
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("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("sysScaleFileNum", sysScale.getFile().getNum().toString());
keyValue.put("sysScaleFileDes", sysScale.getFile().getDes());
keyValue.put("sysScaleModeNum",sysScale.getMode().getNum().toString());
keyValue.put("sysScaleModeDes",sysScale.getMode().getDes());
keyValue.put("sysScaleModeNum", sysScale.getMode().getNum().toString());
keyValue.put("sysScaleModeDes", sysScale.getMode().getDes());
TechnologyList technologyList = assessmentReport.getTechnologyList();
keyValue.put("technologyDes",technologyList.getDes());
keyValue.put("technologyDes", technologyList.getDes());
List<TechnologyReport> technologyReports = technologyList.getTechnologyReports();
for (int i = 0; i < technologyList.getTechnologyReports().size(); i++) {
int i2 = i + 1;
keyValue.put("technology"+i2, technologyReports.get(i).getTechnology());
keyValue.put("technology" + i2, technologyReports.get(i).getTechnology());
for (int i1 = 0; i1 < technologyReports.get(i).getTechnologyContents().size(); i1++) {
int i3 = i1 + 1;
TechnologyContent technologyContent = technologyReports.get(i).getTechnologyContents().get(i1);
keyValue.put("technologyContentLocal"+i2+"-"+i3, technologyContent.getLocal());
keyValue.put("technologyContentKeyWord"+i2+"-"+i3, technologyContent.getKeyWord());
keyValue.put("technologyContentFile"+i2+"-"+i3, technologyContent.getFile());
keyValue.put("technologyContentPosition"+i2+"-"+i3, technologyContent.getPosition());
keyValue.put("technologyContentStrategy"+i2+"-"+i3, getMode(technologyContent.getStrategy()));
keyValue.put("technologyContentLocal" + i2 + "-" + i3, technologyContent.getLocal());
keyValue.put("technologyContentKeyWord" + i2 + "-" + i3, technologyContent.getKeyWord());
keyValue.put("technologyContentFile" + i2 + "-" + i3, technologyContent.getFile());
keyValue.put("technologyContentPosition" + i2 + "-" + i3, technologyContent.getPosition());
keyValue.put("technologyContentStrategy" + i2 + "-" + i3, getMode(technologyContent.getStrategy()));
}
}
for (TechnologyReport technologyReport : technologyReports) {
teMap.put(technologyReport.getTechnology(),technologyReport.getTechnologyContents());
teMap.put(technologyReport.getTechnology(), technologyReport.getTechnologyContents());
}
Set<String> strings = teMap.keySet();
StringBuilder youhua=new StringBuilder();
StringBuilder xiugai=new StringBuilder();
StringBuilder weizhi=new StringBuilder();
StringBuilder youhua = new StringBuilder();
StringBuilder xiugai = new StringBuilder();
StringBuilder weizhi = new StringBuilder();
for (String string : strings) {
if(string.contains("优化")){
if (string.contains("优化")) {
List<TechnologyContent> technologyContents = teMap.get(string);
String str = DocumentWordUtil.getTableString(technologyContents, string, "优化");
youhua.append(str);
}else if(string.contains("不支持")){
} else if (string.contains("不支持")) {
List<TechnologyContent> technologyContents = teMap.get(string);
String str = DocumentWordUtil.getTableString(technologyContents, string, "重新开发");
xiugai.append(str);
}else if(string.contains("未知")){
} else if (string.contains("未知")) {
List<TechnologyContent> technologyContents = teMap.get(string);
String str = DocumentWordUtil.getTableString(technologyContents, string, "验证修改或重新开发");
weizhi.append(str);
}
}
keyValue.put("teyouhua",youhua.toString());
keyValue.put("texiugai",xiugai.toString());
keyValue.put("teweizhi",weizhi.toString());
keyValue.put("teyouhua", youhua.toString());
keyValue.put("texiugai", xiugai.toString());
keyValue.put("teweizhi", weizhi.toString());
Workload workload = assessmentReport.getWorkload();
keyValue.put("workloadDes",workload.getDes());
keyValue.put("workloadCost",String.valueOf(workload.getCost()));
keyValue.put("workloadMode",String.valueOf(workload.getMode()));
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()));
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()));
keyValue.put("workloadTestVolume", String.valueOf(test.getDevelopmentVolume()));
keyValue.put("workloadTestCorrectionFactor", String.valueOf(test.getCorrectionFactor()));
Basis deploy = workload.getDeploy();
keyValue.put("workloadDeployVolume",String.valueOf(deploy.getDevelopmentVolume()));
keyValue.put("workloadDeployCorrectionFactor",String.valueOf(deploy.getCorrectionFactor()));
keyValue.put("workloadDeployVolume", String.valueOf(deploy.getDevelopmentVolume()));
keyValue.put("workloadDeployCorrectionFactor", String.valueOf(deploy.getCorrectionFactor()));
Basis total = workload.getTotal();
keyValue.put("workloadTotalVolume",String.valueOf(total.getDevelopmentVolume()));
keyValue.put("workloadTotalCorrectionFactor",String.valueOf(total.getCorrectionFactor()));
keyValue.put("workloadTotalVolume", String.valueOf(total.getDevelopmentVolume()));
keyValue.put("workloadTotalCorrectionFactor", String.valueOf(total.getCorrectionFactor()));
DifficultyAssessment difficultyAssessment = assessmentReport.getDifficultyAssessment();
keyValue.put("difficultyAssessmentDes",difficultyAssessment.getDes());
keyValue.put("difficultyAssessmentDes", difficultyAssessment.getDes());
FrameDifficulty frameDifficulty = difficultyAssessment.getFrameDifficulty();
keyValue.put("difficultyDifficultySystemEvaluation",String.valueOf(frameDifficulty.getSystemEvaluation()));
keyValue.put("difficultyDifficultyMessage",String.valueOf(frameDifficulty.getMessage()));
keyValue.put("difficultyDifficultyDifficulty",String.valueOf(frameDifficulty.getDifficulty()));
keyValue.put("difficultyDifficultyLoad",String.valueOf(frameDifficulty.getLoad()));
keyValue.put("difficultyDifficultyDetails",Framework.getByCode(frameDifficulty.getDetails()).getName());
keyValue.put("difficultyDifficultyDistributed",flipYesOrNo(frameDifficulty.getDistributed()));
keyValue.put("difficultyDifficultyLoadBalance",flipYesOrNo(frameDifficulty.getLoadBalance()));
keyValue.put("difficultyDifficultyDisaster",flipYesOrNo(frameDifficulty.getDisaster()));
keyValue.put("difficultyDifficultyOtherDemand",frameDifficulty.getOtherDemand());
keyValue.put("difficultyDifficultySystemEvaluation", String.valueOf(frameDifficulty.getSystemEvaluation()));
keyValue.put("difficultyDifficultyMessage", String.valueOf(frameDifficulty.getMessage()));
keyValue.put("difficultyDifficultyDifficulty", String.valueOf(frameDifficulty.getDifficulty()));
keyValue.put("difficultyDifficultyLoad", String.valueOf(frameDifficulty.getLoad()));
keyValue.put("difficultyDifficultyDetails", Framework.getByCode(frameDifficulty.getDetails()).getName());
keyValue.put("difficultyDifficultyDistributed", flipYesOrNo(frameDifficulty.getDistributed()));
keyValue.put("difficultyDifficultyLoadBalance", flipYesOrNo(frameDifficulty.getLoadBalance()));
keyValue.put("difficultyDifficultyDisaster", flipYesOrNo(frameDifficulty.getDisaster()));
keyValue.put("difficultyDifficultyOtherDemand", 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()));
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()));
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()));
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()));
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){
public static DocumentContent setDocumentTable(List<String> data, int col) {
// String tableString = DocumentWordUtil.getTableString(data, col);
// DocumentContent documentContent = new DocumentContent();
// 设置进head标题下面的表格中
// documentContent.setDocumentTable(tableString);
return null;
}
public static List<DocumentContent> setDocumentContents(DocumentContent documentContent){
public static List<DocumentContent> setDocumentContents(DocumentContent documentContent) {
ArrayList<DocumentContent> documentContents = new ArrayList<>();
documentContents.add(documentContent);
return documentContents;
......@@ -294,6 +297,7 @@ public class WpsUtil {
}
return -1;
}
private static String getFilpFramework(int construction) {
switch (construction) {
case 1:
......@@ -319,6 +323,7 @@ public class WpsUtil {
return -1;
}
}
private static int SpecialYesOrNo(String target) {
if ("是".equals(target)) {
return 4;
......@@ -328,6 +333,7 @@ public class WpsUtil {
return -1;
}
}
private static String flipYesOrNo(Integer target) {
if (target == 1) {
return "是";
......@@ -337,8 +343,9 @@ public class WpsUtil {
return "我不清楚";
}
}
private static String flipSafeYesOrNo(Integer target) {
if(target==null){
if (target == null) {
return "否";
}
if (target == 4) {
......@@ -349,6 +356,7 @@ public class WpsUtil {
return "我不清楚";
}
}
private static String flipSpecialYesOrNo(Integer target) {
if (target == 4) {
return "是";
......@@ -360,7 +368,7 @@ public class WpsUtil {
}
private static String getMode(Integer target) {
if(target==null){
if (target == null) {
return "我不清楚";
}
if (target == 1) {
......@@ -373,7 +381,7 @@ public class WpsUtil {
}
private static String flipSafeStrong(Integer target) {
if(target==null || target==1){
if (target == null || target == 1) {
return "无";
}
if (target == 3) {
......@@ -384,71 +392,74 @@ public class WpsUtil {
return "我不清楚";
}
}
private static String strategyToString(Integer target){
if(target == 1){
private static String strategyToString(Integer target) {
if (target == 1) {
return "休息日或晚间切换";
}else if(target == 2){
} else if (target == 2) {
return "暂停服务";
}else if(target == 3){
} else if (target == 3) {
return "平滑过渡";
}else{
} else {
return "不清楚";
}
}
private static String localOrCloud(Integer deploy){
if(deploy==1){
private static String localOrCloud(Integer deploy) {
if (deploy == 1) {
return "本地";
}else if(deploy==2){
} else if (deploy == 2) {
return "政务云";
}else{
} else {
return "不清楚";
}
}
private static String getDis(Integer dis){
if(dis==1){
private static String getDis(Integer dis) {
if (dis == 1) {
return "否";
}else if(dis==2){
} else if (dis == 2) {
return "主备";
}else if(dis==3){
} else if (dis == 3) {
return "分布式";
}else{
} 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());
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());
}
private static void repairMap(String name,int size, List<BaseDes> list, Map<String, String> keyValue){
if(list!=null&&list.size()>0){
int len=list.size();
private static void repairMap(String name, int size, List<BaseDes> list, Map<String, String> keyValue) {
if (list != null && list.size() > 0) {
int len = list.size();
for (int i = 0; i < size; i++) {
int i1 = i + 1;
if(len>i){
if(!StringUtils.isEmpty(list.get(i).getName())) {
keyValue.put(name+ i1,list.get(i).getName());
}else{
keyValue.put(name + i1,"无" );
if (len > i) {
if (!StringUtils.isEmpty(list.get(i).getName())) {
keyValue.put(name + i1, list.get(i).getName());
} else {
keyValue.put(name + i1, "无");
}
}else {
keyValue.put(name+i1, "无");
} else {
keyValue.put(name + i1, "无");
}
}
}else{
} else {
for (int i = 0; i < size; i++) {
int i1 = i + 1;
keyValue.put(name+i1, "无");
keyValue.put(name + i1, "无");
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论