|
@@ -17,36 +17,37 @@ public class test {
|
|
|
|
|
|
@RequestMapping(value = "/test")
|
|
|
public void saveElectricField() {
|
|
|
-
|
|
|
+ // 测试数据组装
|
|
|
List<Map<String, Object>> powerData = new ArrayList<>();
|
|
|
- Map<String, Object> dataText0 = new HashMap<>();
|
|
|
- dataText0.put("sj", new BigDecimal(8));
|
|
|
- dataText0.put("yc", new BigDecimal(7));
|
|
|
- powerData.add(dataText0);
|
|
|
- Map<String, Object> dataText1 = new HashMap<>();
|
|
|
- dataText1.put("sj", new BigDecimal(9));
|
|
|
- dataText1.put("yc", new BigDecimal(7));
|
|
|
- powerData.add(dataText1);
|
|
|
-
|
|
|
- Map<String, Object> dataText2 = new HashMap<>();
|
|
|
- dataText2.put("sj", new BigDecimal(5));
|
|
|
- dataText2.put("yc", new BigDecimal(6));
|
|
|
- powerData.add(dataText2);
|
|
|
-
|
|
|
- Map<String, Object> dataText3 = new HashMap<>();
|
|
|
- dataText3.put("sj", new BigDecimal(8));
|
|
|
- dataText3.put("yc", new BigDecimal(8));
|
|
|
- powerData.add(dataText3);
|
|
|
+ Map<String, Object> dataText = new HashMap<>();
|
|
|
+ dataText.put("sj", new BigDecimal(8));
|
|
|
+ dataText.put("yc", new BigDecimal(7));
|
|
|
+ powerData.add(dataText);
|
|
|
+ dataText = new HashMap<>();
|
|
|
+ dataText.put("sj", new BigDecimal(9));
|
|
|
+ dataText.put("yc", new BigDecimal(7));
|
|
|
+ powerData.add(dataText);
|
|
|
+
|
|
|
+ dataText = new HashMap<>();
|
|
|
+ dataText.put("sj", new BigDecimal(5));
|
|
|
+ dataText.put("yc", new BigDecimal(6));
|
|
|
+ powerData.add(dataText);
|
|
|
+
|
|
|
+ dataText = new HashMap<>();
|
|
|
+ dataText.put("sj", new BigDecimal(8));
|
|
|
+ dataText.put("yc", new BigDecimal(8));
|
|
|
+ powerData.add(dataText);
|
|
|
|
|
|
BigDecimal rl = new BigDecimal("10");
|
|
|
- String provinceEnum = "E62";
|
|
|
- String type = "POINT_S";
|
|
|
- JSONObject jsonResult = accuracyPassRateCalculateService.calculate(powerData, rl, provinceEnum, type, BigDecimal.ZERO);
|
|
|
- String reslut = jsonResult.getString("value");
|
|
|
+ String provinceEnum = "E61";
|
|
|
+ String type = "PASS";
|
|
|
+ // 计算
|
|
|
+ JSONObject jsonResult = accuracyPassRateCalculateService.calculate(powerData, rl, provinceEnum, type, new BigDecimal("80"));
|
|
|
+ // 计算结果
|
|
|
+ String reslut = jsonResult.getString("reslut");
|
|
|
String accuracy = "";
|
|
|
if ("success".equals(reslut)) {
|
|
|
accuracy = jsonResult.getString("value");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|