Browse Source

#演示平台接口、30天发电量修改

zhongwei
yang_shj 9 months ago
parent
commit
9b9facd6ac
  1. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java
  2. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java

@ -7,6 +7,7 @@ import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.service.AbnormalAlarmService;
import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService;
import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
@ -39,6 +40,7 @@ import java.util.List;
@RequestMapping("/abnormal/alarm")
public class AbnormalAlarmController extends BladeController {
private final AbnormalAlarmService alarmService;
private final HistoryAbnormalAlarmService service;
/**
@ -154,4 +156,14 @@ public class AbnormalAlarmController extends BladeController {
return R.data(service.alarmData(page,query));
}
@ApiLog
@RequestMapping(value = "/syncMonAlar", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 10)
@ApiOperation(value = "当月告警数据记录", notes = "传入imsDutyMainEntity")
public R syncMonAlar() {
alarmService.alarmDataHandle("1");
return R.status(true);
}
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java

@ -63,7 +63,9 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
@Override
public void alarmDataHandle(String param) {
// 查询站点站点
List<StationEntity> stations = stationService.list();
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getDataOrigin,"0")
);
if(CollectionUtil.isEmpty(stations)){
return;
}
@ -73,7 +75,11 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
query.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
Calendar calendar = Calendar.getInstance();
query.setEndTime(LocalDateTime.parse(DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
if("1".equals(param)){
calendar.add(Calendar.DAY_OF_MONTH,-calendar.get(Calendar.DAY_OF_MONTH));
}else{
calendar.add(Calendar.MINUTE,-10);
}
query.setBeginTime(LocalDateTime.parse(DateUtil.format(calendar.getTime() , DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
query.setNeedPage(false);
query.setPage(1);

Loading…
Cancel
Save