|
@@ -3,15 +3,15 @@ package com.syjy.calculate.conotroller;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.syjy.calculate.service.AccuracyPassRateCalculateService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
-@RestController
|
|
|
+@Controller
|
|
|
@RequestMapping("/test")
|
|
|
-public class test {
|
|
|
+public class Test {
|
|
|
@Autowired
|
|
|
private AccuracyPassRateCalculateService accuracyPassRateCalculateService;
|
|
|
|
|
@@ -21,7 +21,7 @@ public class test {
|
|
|
List<Map<String, Object>> powerData = new ArrayList<>();
|
|
|
Map<String, Object> dataText = new HashMap<>();
|
|
|
dataText.put("sj", new BigDecimal(8));
|
|
|
- dataText.put("yc", new BigDecimal(7));
|
|
|
+ dataText.put("yc", new BigDecimal(0));
|
|
|
powerData.add(dataText);
|
|
|
dataText = new HashMap<>();
|
|
|
dataText.put("sj", new BigDecimal(9));
|
|
@@ -39,8 +39,8 @@ public class test {
|
|
|
powerData.add(dataText);
|
|
|
|
|
|
BigDecimal rl = new BigDecimal("10");
|
|
|
- String provinceEnum = "E61";
|
|
|
- String type = "PASS";
|
|
|
+ String provinceEnum = "E64";
|
|
|
+ String type = "POINT_S";
|
|
|
// 计算
|
|
|
JSONObject jsonResult = accuracyPassRateCalculateService.calculate(powerData, rl, provinceEnum, type, new BigDecimal("80"));
|
|
|
// 计算结果
|
|
@@ -50,4 +50,5 @@ public class test {
|
|
|
accuracy = jsonResult.getString("value");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|