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

mcj:更新excel导入导出

上级 67a97991
...@@ -36,12 +36,12 @@ public class Details { ...@@ -36,12 +36,12 @@ public class Details {
* 台数 * 台数
*/ */
@ApiModelProperty(value = "台数") @ApiModelProperty(value = "台数")
private Integer num; private String num;
/** /**
* CPU核数 * CPU核数
*/ */
@ApiModelProperty(value = "CPU核数") @ApiModelProperty(value = "CPU核数")
private Integer cpuNum; private String cpuNum;
/** /**
* 单核主频 * 单核主频
*/ */
...@@ -51,7 +51,7 @@ public class Details { ...@@ -51,7 +51,7 @@ public class Details {
* 服务器总空间 * 服务器总空间
*/ */
@ApiModelProperty(value = "服务器总空间") @ApiModelProperty(value = "服务器总空间")
private double space; private String space;
/** /**
* 其他 * 其他
*/ */
......
...@@ -188,9 +188,9 @@ public class Reform { ...@@ -188,9 +188,9 @@ public class Reform {
@ApiModelProperty(value = "迁移策略",example = "1") @ApiModelProperty(value = "迁移策略",example = "1")
private Integer strategy = -1; private Integer strategy = -1;
@ApiModelProperty(value = "RTO") @ApiModelProperty(value = "RTO")
private Integer rto; private Integer rto = -1;
@ApiModelProperty(value = "RPO") @ApiModelProperty(value = "RPO")
private Integer rpo; private Integer rpo = -1;
/** /**
* 额外申请 * 额外申请
*/ */
......
...@@ -63,12 +63,13 @@ public class BudgetUitl { ...@@ -63,12 +63,13 @@ public class BudgetUitl {
inspectParameter.setMoneyRate(Double.valueOf(doubleHashMap.get(1))); inspectParameter.setMoneyRate(Double.valueOf(doubleHashMap.get(1)));
Double moneyRate = inspectParameter.getMoneyRate(); Double moneyRate = inspectParameter.getMoneyRate();
System.out.println(JSON.toJSONString("inspectParameter:"+inspectParameter)); System.out.println(JSON.toJSONString("inspectParameter:"+inspectParameter));
int mouth = inspectParameter.getYears(); int year = inspectParameter.getYears();
if(inspectParameter.getYears()==-1){ if(inspectParameter.getYears()==-1){
mouth=1; year=1;
} }
double pow = Math.pow(moneyRate, mouth); double pow = Math.pow(moneyRate, year);
BigDecimal.valueOf(pow);
double v = pow+1D;
//带修正系数资金 //带修正系数资金
ArrayList<String> strings = new ArrayList<>(); ArrayList<String> strings = new ArrayList<>();
strings.add("安全能力"); strings.add("安全能力");
......
...@@ -82,8 +82,7 @@ public class ExcelUtil { ...@@ -82,8 +82,7 @@ public class ExcelUtil {
String cycle = getExcelCell(5, 2, sheetAt); String cycle = getExcelCell(5, 2, sheetAt);
String s = cycle.replaceAll("年", ""); String s = cycle.replaceAll("年", "");
reform.setCycle(returnNum(s) * 12); reform.setCycle(returnNum(s));
String time = getExcelCell(6, 2, sheetAt); String time = getExcelCell(6, 2, sheetAt);
if (!"".equals(time)) { if (!"".equals(time)) {
if ("10年以上".equals(time)) { if ("10年以上".equals(time)) {
...@@ -175,7 +174,7 @@ public class ExcelUtil { ...@@ -175,7 +174,7 @@ public class ExcelUtil {
List<BaseDes> fontTechnologies = new ArrayList<>(); List<BaseDes> fontTechnologies = new ArrayList<>();
for (int i = 22; i < 27; i++) { for (int i = 22; i < 28; i++) {
String framework = getExcelCell(i, 2, sheetAt); String framework = getExcelCell(i, 2, sheetAt);
if ("".equals(framework)) { if ("".equals(framework)) {
continue; continue;
...@@ -192,10 +191,10 @@ public class ExcelUtil { ...@@ -192,10 +191,10 @@ public class ExcelUtil {
fontTechnologies.add(font); fontTechnologies.add(font);
} }
} }
developLanguageSystem.setFontDevTechnologies(fontTechnologies);
List<BaseDes> fontDevTechnologies = new ArrayList<>(); developLanguageSystem.setFontDevTechnologies(fontTechnologies);
for (int i = 28; i < 33; i++) { ArrayList<BaseDes> fontDevTechnologies = new ArrayList<BaseDes>();
for (int i = 28; i < 34; i++) {
String framework = getExcelCell(i, 2, sheetAt); String framework = getExcelCell(i, 2, sheetAt);
if ("".equals(framework)) { if ("".equals(framework)) {
continue; continue;
...@@ -214,6 +213,7 @@ public class ExcelUtil { ...@@ -214,6 +213,7 @@ public class ExcelUtil {
} }
developLanguageSystem.setCsDevTechnologies(fontDevTechnologies); developLanguageSystem.setCsDevTechnologies(fontDevTechnologies);
List<BaseDes> opGAS = new ArrayList<>(); List<BaseDes> opGAS = new ArrayList<>();
for (int i = 34; i < 39; i++) { for (int i = 34; i < 39; i++) {
String framework = getExcelCell(i, 2, sheetAt); String framework = getExcelCell(i, 2, sheetAt);
...@@ -276,7 +276,7 @@ public class ExcelUtil { ...@@ -276,7 +276,7 @@ public class ExcelUtil {
middleware.setMiddlewareEnums(middlewareEnums); middleware.setMiddlewareEnums(middlewareEnums);
ArrayList<OtherApi> otherApis = new ArrayList<>(); ArrayList<OtherApi> otherApis = new ArrayList<>();
for (int i = 51; i < 61; i++) { for (int i = 51; i < 62; i++) {
String api = getExcelCell(i, 2, sheetAt); String api = getExcelCell(i, 2, sheetAt);
if ("".equals(api)) { if ("".equals(api)) {
continue; continue;
...@@ -293,7 +293,7 @@ public class ExcelUtil { ...@@ -293,7 +293,7 @@ public class ExcelUtil {
middleware.setOtherApis(otherApis); middleware.setOtherApis(otherApis);
List<BaseDes> microServices = new ArrayList<>(); List<BaseDes> microServices = new ArrayList<>();
for (int i = 62; i < 72; i++) { for (int i = 62; i < 73; i++) {
String name = getExcelCell(i, 2, sheetAt); String name = getExcelCell(i, 2, sheetAt);
if (name == null || "".equals(name)) { if (name == null || "".equals(name)) {
continue; continue;
...@@ -402,6 +402,9 @@ public class ExcelUtil { ...@@ -402,6 +402,9 @@ public class ExcelUtil {
browser.setBrowserPlugs(browserPlugs); browser.setBrowserPlugs(browserPlugs);
reform.setBrowser(browser); reform.setBrowser(browser);
String excelCell = getExcelCell(108, 2, sheetAt);
String apply = getExcelCell(110, 2, sheetAt); String apply = getExcelCell(110, 2, sheetAt);
Apply apply1 = new Apply(); Apply apply1 = new Apply();
apply1.setCost(Double.valueOf(apply)); apply1.setCost(Double.valueOf(apply));
...@@ -428,6 +431,9 @@ public class ExcelUtil { ...@@ -428,6 +431,9 @@ public class ExcelUtil {
Details vpsdetails = getSysDetails(118, 2, sheetAt); Details vpsdetails = getSysDetails(118, 2, sheetAt);
systemStructure.setVps(vpsdetails); systemStructure.setVps(vpsdetails);
Details otherEquipment = getSysDetails(119, 2, sheetAt);
systemStructure.setOtherEquipment(otherEquipment);
reform.setSystemStructure(systemStructure); reform.setSystemStructure(systemStructure);
String rpo = getExcelCell(121, 2, sheetAt); String rpo = getExcelCell(121, 2, sheetAt);
...@@ -612,6 +618,8 @@ public class ExcelUtil { ...@@ -612,6 +618,8 @@ public class ExcelUtil {
return "单机运行"; return "单机运行";
case 4: case 4:
return "分布式"; return "分布式";
default:
break;
} }
return ""; return "";
} }
...@@ -667,7 +675,7 @@ public class ExcelUtil { ...@@ -667,7 +675,7 @@ public class ExcelUtil {
private static int returnNum(String target) { private static int returnNum(String target) {
if (!"".equals(target)) { if (!"".equals(target)) {
return Integer.valueOf(target); return Integer.parseInt(target);
} else { } else {
return 0; return 0;
} }
...@@ -675,7 +683,7 @@ public class ExcelUtil { ...@@ -675,7 +683,7 @@ public class ExcelUtil {
private static double returnDouble(String target) { private static double returnDouble(String target) {
if (!"".equals(target)) { if (!"".equals(target)) {
return Double.valueOf(target); return Double.parseDouble(target);
} else { } else {
return 0; return 0;
} }
...@@ -715,18 +723,21 @@ public class ExcelUtil { ...@@ -715,18 +723,21 @@ public class ExcelUtil {
details.setDeploy(2); details.setDeploy(2);
} }
String num3 = getExcelCell(rowNum, cellNum + 1, sheetAt); String num3 = getExcelCell(rowNum, cellNum + 1, sheetAt);
details.setNum(returnNum(num3)); details.setNum(num3);
String slbsys = getExcelCell(rowNum, cellNum + 2, sheetAt); String slbsys = getExcelCell(rowNum, cellNum + 2, sheetAt);
OperateSystem slbByName = OperateSystem.getByName(slbsys); OperateSystem slbByName = OperateSystem.getByName(slbsys);
details.setOperateSystem(slbByName); details.setOperateSystem(slbByName);
details.setCode(slbByName.getCode()); details.setCode(slbByName.getCode());
String cpu3 = getExcelCell(rowNum, cellNum + 3, sheetAt); String cpu3 = getExcelCell(rowNum, cellNum + 3, sheetAt);
details.setCpuNum(returnNum(cpu3)); details.setCpuNum(cpu3);
String ghz3 = getExcelCell(rowNum, cellNum + 4, sheetAt); String ghz3 = getExcelCell(rowNum, cellNum + 4, sheetAt);
details.setGhz(ghz3); details.setGhz(ghz3);
String space3 = getExcelCell(rowNum, cellNum + 5, sheetAt); String memory = getExcelCell(rowNum, cellNum + 5, sheetAt);
details.setSpace(returnDouble(space3)); details.setMemory(memory);
String space3 = getExcelCell(rowNum, cellNum + 6, sheetAt);
details.setSpace(space3);
return details; return details;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论