1.infludb公共参数名调整
2.微服务调度中心任务-终端在线率
This commit is contained in:
@@ -272,10 +272,20 @@ public class LineController extends BaseController {
|
||||
@PostMapping("/getLineDetail")
|
||||
@ApiOperation("根据监测点集合获取监测点详情")
|
||||
@ApiImplicitParam(name = "list", value = "监测点集合")
|
||||
@ApiIgnore
|
||||
public HttpResult<List<LineDetail>> getLineDetail(@RequestParam(required = false) List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetail");
|
||||
LogUtil.njcnDebug(log, "{},监测点集合:{}", methodDescribe, list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineDetailMapper.getSpecifyLineDetail(list), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDeviceList")
|
||||
@ApiOperation("获取生成在线率的装置Id")
|
||||
@ApiIgnore
|
||||
public HttpResult<List<String>> getDeviceList() {
|
||||
String methodDescribe = getMethodDescribe("getDeviceList");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getDeviceList(), methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -313,6 +313,9 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
*/
|
||||
List<Line> getVoltageListBySubId(@Param("subId")String subId,@Param("voltageName")List<String> voltageName);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取生成在线率的装置Id
|
||||
* @return 装置Id
|
||||
*/
|
||||
List<String> getDeviceList();
|
||||
}
|
||||
|
||||
@@ -948,4 +948,8 @@ FROM
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDeviceList" resultType="string">
|
||||
SELECT Id FROM pq_device WHERE Dev_Model = 1 AND Dev_Data_Type IN (1,2) AND Run_Flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -19,15 +19,14 @@ import com.njcn.device.pojo.po.LineDetail;
|
||||
import com.njcn.device.pojo.vo.*;
|
||||
import com.njcn.device.service.LineService;
|
||||
import com.njcn.device.service.RunManageService;
|
||||
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||
import com.njcn.device.service.TerminalBaseService;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import com.njcn.device.service.TerminalBaseService;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
@@ -44,6 +43,8 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.njcn.influxdb.param.InfluxDBPublicParam.*;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
@@ -198,9 +199,9 @@ public class RunManageServiceImpl implements RunManageService {
|
||||
QueryResult queryResult;
|
||||
if (!lineId.isEmpty()) {
|
||||
//组装sql语句
|
||||
String stringBuilder = "time >= '" + startTime + "' and " + "time <= '" + endTime + "' and (" + InfluxDBPublicParam.DEV_INDEX +" ='" + lineId + "') ";
|
||||
String stringBuilder = "time >= '" + startTime + "' and " + "time <= '" + endTime + "' and (" + DEV_INDEX +" ='" + lineId + "') ";
|
||||
//sql语句
|
||||
String sql = "SELECT SUM("+InfluxDBPublicParam.ONLINEMIN+")/(SUM("+InfluxDBPublicParam.OFFLINEMIN+")+SUM("+InfluxDBPublicParam.ONLINEMIN+")) AS onlineRate FROM "+InfluxDBPublicParam.PQS_ONLINERATE+" WHERE " + stringBuilder+InfluxDBPublicParam.TIME_ZONE;
|
||||
String sql = "SELECT SUM("+ ONLINE_MIN+")/(SUM("+OFFLINE_MIN+")+SUM("+ONLINE_MIN+")) AS onlineRate FROM "+PQS_ONLINERATE+" WHERE " + stringBuilder+TIME_ZONE;
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
//处理结果集
|
||||
List<org.influxdb.dto.QueryResult.Series> list = queryResult.getResults().get(0).getSeries();
|
||||
|
||||
Reference in New Issue
Block a user