|
@@ -1,11 +1,14 @@
|
|
package com.bizmatics.service.impl;
|
|
package com.bizmatics.service.impl;
|
|
|
|
|
|
import com.bizmatics.model.RtSwitchData;
|
|
import com.bizmatics.model.RtSwitchData;
|
|
|
|
+import com.bizmatics.persistence.mapper.AlarmPowerMapper;
|
|
import com.bizmatics.persistence.mapper.RtSwitchDataMapper;
|
|
import com.bizmatics.persistence.mapper.RtSwitchDataMapper;
|
|
import com.bizmatics.service.RtSwitchDataService;
|
|
import com.bizmatics.service.RtSwitchDataService;
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -19,7 +22,6 @@ import java.util.*;
|
|
@Service
|
|
@Service
|
|
public class RtSwitchDataServiceImpl extends AbstractCrudService<RtSwitchDataMapper, RtSwitchData> implements RtSwitchDataService {
|
|
public class RtSwitchDataServiceImpl extends AbstractCrudService<RtSwitchDataMapper, RtSwitchData> implements RtSwitchDataService {
|
|
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public List<Map<String, Object>> getOne(Integer siteId) {
|
|
public List<Map<String, Object>> getOne(Integer siteId) {
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
@@ -35,22 +37,29 @@ public class RtSwitchDataServiceImpl extends AbstractCrudService<RtSwitchDataMap
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<Map<String, Object>> getLoopStatus(Integer siteId) {
|
|
public List<Map<String, Object>> getLoopStatus(Integer siteId) {
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
Map<String, Object> radMap = baseMapper.getLoopStatusMap(siteId);
|
|
Map<String, Object> radMap = baseMapper.getLoopStatusMap(siteId);
|
|
- Iterator<String> it = radMap.keySet().iterator();
|
|
|
|
Object value = radMap.get("LoadLive");
|
|
Object value = radMap.get("LoadLive");
|
|
int day_count = baseMapper.getOffCountDMap(siteId);
|
|
int day_count = baseMapper.getOffCountDMap(siteId);
|
|
int month_count = baseMapper.getOffCountMMap(siteId);
|
|
int month_count = baseMapper.getOffCountMMap(siteId);
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("LoadLive",value);
|
|
|
|
+ map.put("day_count",day_count);
|
|
|
|
+ map.put("month_count",month_count);
|
|
|
|
+ list.add(map);
|
|
|
|
|
|
|
|
|
|
|
|
+// Map<String, Object> LoopStatusList = baseMapper.getLoopStatusListMap(siteId);
|
|
|
|
+//// Iterator<String> it = radMap.keySet().iterator();
|
|
|
|
|
|
|
|
+// int duration=0;
|
|
|
|
+// for (String name:LoopStatusList.keySet()) {
|
|
|
|
+//// String a =formatter.;
|
|
|
|
+// radMap.get("sending_time");
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
|
|
- for (String name:radMap.keySet()) {
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
- map.put("name",name);
|
|
|
|
- map.put("value",radMap.get(name));
|
|
|
|
- list.add(map);
|
|
|
|
- }
|
|
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
}
|
|
}
|