装置在线率调度任务

This commit is contained in:
hanyong
2022-09-26 13:10:27 +08:00
parent 7f18439b12
commit adc1e44a71
8 changed files with 453 additions and 4 deletions

View File

@@ -219,6 +219,15 @@ public interface LineFeignClient {
@PostMapping("getDeviceList")
HttpResult<List<String>> getDeviceList();
/**
* 功能描述: 获取指定条件的监测点id(实际装置、投运、稳态或者双系统)
* @author xy
* @date 2022/7/8 14:24
* @return 装置id集合
*/
@PostMapping("getRunLineIdsList")
HttpResult<List<String>> getRunLineIdsList();
/**
* 获取当前状态在线的监测点数量
* @param lineIds 监测点集合
@@ -239,4 +248,14 @@ public interface LineFeignClient {
@PostMapping("getOnOrUnLine")
HttpResult<List<String>> getOnOrUnLine(@RequestBody LineBaseQueryParam lineBaseQueryParam);
/**
* 获取监测点设备id
* @param lineIds 监测点集合
* @return 监测点设备id
* @author cdf
* @date 2022/8/1
*/
@PostMapping("getOnLineDevLine")
HttpResult<List<OnlineLineDTO>> getOnLineDevLine(@RequestBody List<String> lineIds);
}

View File

@@ -168,6 +168,12 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> getRunLineIdsList() {
log.error("{}异常,降级处理,异常为:{}", "获取监测点Id集合: ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<Integer> getOnLineCount(List<String> lineIds) {
log.error("{}异常,降级处理,异常为:{}", "获取在线监测点数量异常: ", throwable.toString());
@@ -180,6 +186,12 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<OnlineLineDTO>> getOnLineDevLine(List<String> lineIds) {
log.error("{}异常,降级处理,异常为:{}", "获取监测点设备id异常: ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}

View File

@@ -0,0 +1,17 @@
package com.njcn.device.pojo.dto;
import lombok.Data;
/**
* pqs
*
* @author cdf
* @date 2022/9/23
*/
@Data
public class OnlineLineDTO {
private String lineId;
private String devId;
}

View File

@@ -306,6 +306,14 @@ public class LineController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getDeviceList(), methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getRunLineIdsList")
@ApiOperation("获取生成在线率的监测点Id")
public HttpResult<List<String>> getRunLineIdsList() {
String methodDescribe = getMethodDescribe("getRunLineIdsList");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getRunLineIdsList(), methodDescribe);
}
/**
* 获取当前状态在线的监测点数量
@@ -343,6 +351,21 @@ public class LineController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,idsRes, methodDescribe);
}
/**
* 获取监测点设备id
* @param lineIds 监测点集合
* @return 监测点设备id
* @author cdf
* @date 2022/8/1
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getOnLineDevLine")
@ApiOperation("获取当前状态在线的监测点数量")
@ApiImplicitParam(name = "lineIds", value = "监测点集合", required = true)
public HttpResult<List<OnlineLineDTO>> getOnLineDevLine(@RequestBody List<String> lineIds) {
String methodDescribe = getMethodDescribe("getOnLineDevLine");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getOnLineDevLine(lineIds), methodDescribe);
}
}

View File

@@ -7,13 +7,10 @@ import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.device.pojo.bo.BaseLineInfo;
import com.njcn.device.pojo.bo.DeviceType;
import com.njcn.device.pojo.bo.excel.TerminalBaseExcel;
import com.njcn.device.pojo.dto.OverLimitLineDTO;
import com.njcn.device.pojo.dto.PollutionLineDTO;
import com.njcn.device.pojo.dto.WarningSubstationDTO;
import com.njcn.device.pojo.dto.*;
import com.njcn.device.pojo.param.DeviceInfoParam;
import com.njcn.device.pojo.po.*;
import com.njcn.device.pojo.vo.*;
import com.njcn.device.pojo.dto.PollutionSubstationDTO;
import com.njcn.web.pojo.vo.LineDataVO;
import org.apache.ibatis.annotations.Param;
@@ -319,15 +316,32 @@ public interface LineMapper extends BaseMapper<Line> {
*/
List<String> getDeviceList();
/**
* 获取生成在线率的监测点Id
* @return 监测点Id
*/
List<String> getRunLineIdsList();
/**
* 获取当前状态在线的监测点数量
* @return Integer 在线监测点数量
*/
Integer getOnLineCount(@Param("lineIds")List<String> lineIds);
/**
* 获取监测点设备id
* @return Integer 监测点设备id
*/
List<OnlineLineDTO> getOnLineDevLine(@Param("lineIds")List<String> lineIds);
/**
* 获取当前状态在线和离线的监测点
* @return 在线或离线监测点ids
*/
List<String> getOnOrUnLine(@Param("list")List<String> lineIds,@Param("comFlag")Integer comFlag);
}

View File

@@ -902,6 +902,19 @@ FROM
SELECT Id FROM pq_device WHERE Dev_Model = 1 AND Dev_Data_Type IN (1,2) AND Run_Flag = 0
</select>
<select id="getRunLineIdsList" resultType="string">
select a.id from pq_line a
inner join pq_line b on a.pid = b.id
inner join pq_line c on b.pid = c.id
inner join pq_device d on c.id = d.id
where d.Dev_Model = 1
AND d.Dev_Data_Type IN (1,2)
AND d.Run_Flag = 0
and a.level = 6
and a.state = 1
</select>
<select id="getOnLineCount" resultType="int">
SELECT
@@ -921,6 +934,17 @@ FROM
</foreach>
</select>
<select id="getOnLineDevLine" resultType="OnlineLineDTO">
select a.id lineId,c.id devId from pq_line a
inner join pq_line b on a.pid = b.id
inner join pq_line c on b.pid = c.id
where a.id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<select id="getOnOrUnLine" resultType="String">
select a.id from pq_line a
inner join pq_line b on a.pid = b.id