|
@@ -10,13 +10,13 @@ import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
|
import com.bizmatics.service.util.SessionLocal;
|
|
|
import com.bizmatics.service.vo.ApCountVO;
|
|
|
import com.bizmatics.service.vo.CommonIcoVO;
|
|
|
+import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
|
|
|
import org.checkerframework.checker.units.qual.A;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.Duration;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -68,4 +68,47 @@ public class AlarmPowerServiceImpl extends AbstractCrudService<AlarmPowerMapper,
|
|
|
baseMapper.list(page,SessionLocal.getUserId(),siteId,status,startTime,endTime);
|
|
|
return this.ToCommonPage(page);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> getLoopStatusList(Integer siteId) {
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ List<AlarmPower> loopStatusListMap = baseMapper.getLoopStatusListMap(siteId);
|
|
|
+ int int1 = 0;
|
|
|
+ int int12= 0;
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ loopStatusListMap.forEach(alarmPower -> {
|
|
|
+// if (alarmPower.getDigitalValue() == 0){
|
|
|
+// String time1 = formatter.format(alarmPower.getSoeTime());
|
|
|
+// }else if(alarmPower.getDigitalValue() == 1){
|
|
|
+// String time2 = formatter.format(alarmPower.getSoeTime());
|
|
|
+// }
|
|
|
+ if (alarmPower.getDigitalValue() == 0){
|
|
|
+// Duration differenceValue = Duration.between(time1 ,time2 );
|
|
|
+ // 获取的是两个时间相差的分钟数,如果想要相差小时数就调用toHours()
|
|
|
+// Long minutesTime = differenceValue .toMinutes();
|
|
|
+ }
|
|
|
+ });
|
|
|
+// Object value = LoopStatusList.get("LoadLive");
|
|
|
+
|
|
|
+// int day_count = baseMapper.getOffCountDMap(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);
|
|
|
+
|
|
|
+
|
|
|
+// Iterator<String> it = radMap.keySet().iterator();
|
|
|
+
|
|
|
+// int duration=0;
|
|
|
+// for (String name:LoopStatusList.keySet()) {
|
|
|
+//// String a =formatter.;
|
|
|
+//// LoopStatusList.get("sending_time");
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|