Browse Source

#运行报表

zhongwei
yang_shj 2 months ago
parent
commit
ef0bcf6c8b
  1. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
  2. 16
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  3. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  4. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/MonitorService.java
  5. 33
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  6. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/controller/TicketInfoEvaluateController.java

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java

@ -8,10 +8,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer; import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springblade.core.mp.support.QueryField; import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
@ -191,4 +189,7 @@ public class StationEntity extends TenantEntity implements Serializable {
@ApiModelProperty("删除记录ID") @ApiModelProperty("删除记录ID")
private Long deletedId; private Long deletedId;
@ApiModelProperty("站点在线状态 0-在线 1-离线")
private Integer onLine;
} }

16
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -56,6 +56,22 @@ public class MonitorScheduledTask {
} }
/** /**
* 站点在线状态同步
* @return ReturnT<String>
*/
//@XxlJob(REAL_TIME_DATA)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadStationOnLine() {
String param = "";
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadStationOnLine(param);
return new ReturnT<>("SUCCESS");
}
/**
* 集中监控数据处理 * 集中监控数据处理
* @return ReturnT<String> * @return ReturnT<String>
*/ */

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -257,7 +257,7 @@ public class AlarmServiceImpl implements AlarmService {
} }
// 批量保存中断告警数据 // 批量保存中断告警数据
this.interruptionAlarmService.saveBatch(entities); this.interruptionAlarmService.saveBatch(entities);
// FIXME 发送HZ3000中通讯告警 // 发送HZ3000中通讯告警
this.sendInterruptionMsg(entities); this.sendInterruptionMsg(entities);
} }
@ -284,7 +284,6 @@ public class AlarmServiceImpl implements AlarmService {
}); });
} }
/** /**
* 查询当天数据中断告警记录 * 查询当天数据中断告警记录
* @param stations * @param stations

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/MonitorService.java

@ -12,6 +12,9 @@ public interface MonitorService {
// 实时数据刷新 // 实时数据刷新
void loadRealData(String param); void loadRealData(String param);
// 站点在线状态刷新
void loadStationOnLine(String param);
// 集中监控数据处理 // 集中监控数据处理
void loadMonitoring(String param); void loadMonitoring(String param);
} }

33
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -83,6 +83,8 @@ public class MonitorServiceImpl implements MonitorService {
private final IAnalyseDataSearchClient analyseDataSearchClient; private final IAnalyseDataSearchClient analyseDataSearchClient;
private static final String STATION_ON_LINE_KEY = "iot:real:data:";
private static final ExecutorService pool = new ThreadPoolExecutor(20, 20, 2L, TimeUnit.MINUTES, new LinkedBlockingQueue<>(256), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); private static final ExecutorService pool = new ThreadPoolExecutor(20, 20, 2L, TimeUnit.MINUTES, new LinkedBlockingQueue<>(256), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy());
private static boolean isSendMail = true; private static boolean isSendMail = true;
@ -247,6 +249,37 @@ public class MonitorServiceImpl implements MonitorService {
} }
/** /**
* 站点在线状态刷新
* @param param
*/
@Override
public void loadStationOnLine(String param) {
// 查询接入站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getDataOrigin,0)
);
if(CollectionUtil.isEmpty(stations)){
return;
}
stations.forEach(station->{
// 在线
if(redisTemplate.hasKey(STATION_ON_LINE_KEY + station.getCode()) && station.getOnLine() == 1){
stationService.update(Wrappers.<StationEntity>lambdaUpdate()
.set(StationEntity::getOnLine,0)
.eq(StationEntity::getId,station.getId())
);
// 离线
}else if(!redisTemplate.hasKey(STATION_ON_LINE_KEY + station.getCode()) && station.getOnLine() == 0){
stationService.update(Wrappers.<StationEntity>lambdaUpdate()
.set(StationEntity::getOnLine,1)
.eq(StationEntity::getId,station.getId())
);
}
});
}
/**
* 计算切分次数 * 计算切分次数
*/ */
private static Integer countStep(Integer size) { private static Integer countStep(Integer size) {

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/controller/TicketInfoEvaluateController.java

@ -43,6 +43,7 @@ public class TicketInfoEvaluateController extends BladeController {
private final IWorkTicketInfoService workTicketInfoService; private final IWorkTicketInfoService workTicketInfoService;
private final IStandardTicketInfoService standardTicketInfoService; private final IStandardTicketInfoService standardTicketInfoService;
@PostMapping("/save") @PostMapping("/save")
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
@ApiOperation(value = "新增") @ApiOperation(value = "新增")

Loading…
Cancel
Save