|
@@ -6,6 +6,7 @@ import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.common.util.DateUtils;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
+import com.gyee.runeconomy.mapper.auto.ProEconAlarmTypeMapper;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.model.vo.YcdlVo;
|
|
|
import com.gyee.runeconomy.service.auto.*;
|
|
@@ -14,9 +15,6 @@ import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.sql.Timestamp;
|
|
|
-import java.text.DateFormat;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -43,6 +41,9 @@ public class ApplicationService {
|
|
|
|
|
|
@Resource
|
|
|
private IProEconShutdownEventService shutdownEventService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ProEconAlarmTypeMapper proEconAlarmTypeMapper;
|
|
|
@Resource
|
|
|
private IEdosUtil edosUtil;
|
|
|
|
|
@@ -386,7 +387,11 @@ public class ApplicationService {
|
|
|
|
|
|
vo.setName(wpls.get(0).getName());
|
|
|
vo.setWpid(wpls.get(0).getNemCode());
|
|
|
- vo.setDate(qwt.get(0).getRecordDate());
|
|
|
+ if (qwt.size()>0) {
|
|
|
+ vo.setDate(qwt.get(0).getRecordDate());
|
|
|
+ }else {
|
|
|
+ vo.setDate(LocalDate.ofEpochDay(2023-12-12));
|
|
|
+ }
|
|
|
vo.setRfdl(bq.getPointValueInDouble());
|
|
|
if (qwt.size()>0) {
|
|
|
vo.setYcdl(qwt.get(0).getDayPowerForecast().doubleValue());
|
|
@@ -423,45 +428,11 @@ public class ApplicationService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Map<Integer,Object> shutdown(String type,String wpId) throws Exception {
|
|
|
-
|
|
|
- long longDate = System.currentTimeMillis();
|
|
|
- Date nowDate = new Date(longDate);
|
|
|
- DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- String formattedDate = dateFormat.format(nowDate);
|
|
|
- Timestamp startTime = Timestamp.valueOf(formattedDate + " 00:00:00");
|
|
|
-
|
|
|
- Map<String,Object> zb = new HashMap<>();
|
|
|
-
|
|
|
- List<ProEconAlarmType> types = alarmTypeService.list();
|
|
|
- List<ProEconAlarmConfiguration> configurations = alarmConfigurationService.list();
|
|
|
- int totalSize = 0;
|
|
|
- for (ProEconAlarmType ty :types) {
|
|
|
-
|
|
|
- List<ProEconShutdownEvent> qwt = null;
|
|
|
- zb = new HashMap<>();
|
|
|
-
|
|
|
- List<ProEconAlarmConfiguration> collect = configurations.stream()
|
|
|
- .filter(c -> ty.getNemCode().equals(c.getComponents()))
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- totalSize += collect.stream()
|
|
|
- .flatMap(c -> {
|
|
|
- QueryWrapper<ProEconShutdownEvent> qw = new QueryWrapper<>();
|
|
|
- qw.lambda().ge(ProEconShutdownEvent::getStartTime, startTime);
|
|
|
- qw.lambda().eq(ProEconShutdownEvent::getWarningId, c.getId());
|
|
|
- return shutdownEventService.list(qw).stream();
|
|
|
- })
|
|
|
- .collect(Collectors.toList())
|
|
|
- .size(); // 累加每个列表的大小
|
|
|
+ public List<Map<String, Object>> shutdown(String type,String wpId) throws Exception {
|
|
|
|
|
|
+ List<Map<String, Object>> typeCounts = proEconAlarmTypeMapper.getAlarmTypeCounts();
|
|
|
|
|
|
- zb.put("name",ty.getName());
|
|
|
- zb.put("rgzcs",totalSize);
|
|
|
-// zb.put("rgzcs",qwt.size());
|
|
|
-// zb.put("rgzcs",qwt.size());
|
|
|
-
|
|
|
- }
|
|
|
+ List<String> typee = new ArrayList<>();
|
|
|
|
|
|
return null;
|
|
|
}
|