Commit 94eeaaf8 authored by duanruiming's avatar duanruiming

[test] 数据优化

parent b46c1dce
...@@ -221,13 +221,15 @@ public class SituationDetectionController extends BaseController { ...@@ -221,13 +221,15 @@ public class SituationDetectionController extends BaseController {
// todo 测试数据 // todo 测试数据
List<SignalManufacturerCountInfoVO> result = new ArrayList<>(); List<SignalManufacturerCountInfoVO> result = new ArrayList<>();
List<String> strings = Arrays.asList("大华", "东土", "海信", "海康"); List<String> strings = Arrays.asList("大华", "东土", "海信", "海康");
List<Integer> count1 = Arrays.asList(10, 25, 19, 29);
List<Integer> count2 = Arrays.asList(1, 2, 3, 3);
List<Integer> count3 = Arrays.asList(1, 2, 3, 2);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
SignalManufacturerCountInfoVO signalManufacturerCountInfoVO = new SignalManufacturerCountInfoVO(); SignalManufacturerCountInfoVO signalManufacturerCountInfoVO = new SignalManufacturerCountInfoVO();
signalManufacturerCountInfoVO.setName(strings.get(i)); signalManufacturerCountInfoVO.setName(strings.get(i));
Random random = new Random(); signalManufacturerCountInfoVO.setOnlineCount(count1.get(i));
signalManufacturerCountInfoVO.setOnlineCount(random.nextInt(50)); signalManufacturerCountInfoVO.setOfflineCount(count2.get(i));
signalManufacturerCountInfoVO.setOfflineCount(random.nextInt(10)); signalManufacturerCountInfoVO.setFaultCount(count3.get(i));
signalManufacturerCountInfoVO.setFaultCount(random.nextInt(5));
result.add(signalManufacturerCountInfoVO); result.add(signalManufacturerCountInfoVO);
} }
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment