修改终端在线率

This commit is contained in:
陈超
2022-07-05 22:14:26 +08:00
parent 88ede44ac9
commit 1da799ee4b
6 changed files with 21 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ import javax.validation.constraints.Pattern;
@Data
public class AlarmStrategyParam {
@ApiModelProperty(value = "告警策略Id", required = true)
@ApiModelProperty(value = "告警策略Id 关联字典表id", required = true)
@NotBlank(message = DeviceValidMessage.ID_NOT_BLANK)
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
private String id;

View File

@@ -75,7 +75,7 @@ public class ProgramVersionController extends BaseController {
String methodDescribe = getMethodDescribe("getProgramVersionById");
boolean res = programService.getProgramVersionById(id);
if (res) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FILE_EXIST, null, methodDescribe);
} else {
throw new BusinessException(CommonResponseEnum.NO_DATA);
}

View File

@@ -13,6 +13,7 @@ import com.njcn.device.pojo.vo.EventLogVO;
import com.njcn.device.service.LogManageService;
import com.njcn.event.api.EventDetailFeignClient;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import lombok.AllArgsConstructor;
import org.influxdb.dto.QueryResult;
@@ -151,12 +152,12 @@ public class LogManageServiceImpl implements LogManageService {
List<TerminalLogs> terminalLogs;
//组装sql语句
StringBuilder string = new StringBuilder();
string.append(DeviceValidMessage.TIME + " >= '" + startTime + DeviceValidMessage.START_TIME + "' and " + DeviceValidMessage.TIME + " <= '" + endTime + DeviceValidMessage.END_TIME + "'");
string.append(InfluxDBPublicParam.TIME + " >= '" + startTime + InfluxDBPublicParam.START_TIME + "' and " + InfluxDBPublicParam.TIME + " <= '" + endTime + InfluxDBPublicParam.END_TIME + "'");
if (!type.isEmpty()) {
string.append(" and terminal_type = '" + type +"'").append(" tz('Asia/Shanghai')");
string.append(" and terminal_type = '" + type +"'");
}
//sql语句
String sql = "SELECT * FROM pqs_terminal_logs WHERE " + string;
String sql = "SELECT * FROM "+InfluxDBPublicParam.PQS_TERMINAL_LOGS+" WHERE " + string + InfluxDBPublicParam.TIME_ZONE;
System.out.println("sql==========="+sql);
//结果集
QueryResult results = influxDbUtils.query(sql);
@@ -179,10 +180,10 @@ public class LogManageServiceImpl implements LogManageService {
StringBuilder string = new StringBuilder();
string.append(DeviceValidMessage.TIME + " >= '" + startTime + DeviceValidMessage.START_TIME + "' and " + DeviceValidMessage.TIME + " <= '" + endTime + DeviceValidMessage.END_TIME + "'");
if (result==1 || result==2) {
string.append(" and result=" + result).append(" tz('Asia/Shanghai')");
string.append(" and result=" + result);
}
//sql语句
String sql = "SELECT * FROM pqs_event_push_logs WHERE " + string;
String sql = "SELECT * FROM pqs_event_push_logs WHERE " + string +InfluxDBPublicParam.TIME_ZONE;
System.out.println("sql==========="+sql);
//结果集
QueryResult results = influxDbUtils.query(sql);