1.用能系统空调关机策略
2.终端模块对外接口
This commit is contained in:
@@ -210,4 +210,14 @@ public interface LineFeignClient {
|
||||
@PostMapping("getDeviceList")
|
||||
HttpResult<List<String>> getDeviceList();
|
||||
|
||||
/**
|
||||
* 获取当前状态在线的监测点数量
|
||||
* @param lineIds 监测点集合
|
||||
* @return 在线的监测点数量
|
||||
* @author cdf
|
||||
* @date 2022/8/1
|
||||
*/
|
||||
@PostMapping("getOnLineCount")
|
||||
HttpResult<Integer> getOnLineCount(@RequestBody List<String> lineIds);
|
||||
|
||||
}
|
||||
|
||||
@@ -161,6 +161,12 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Integer> getOnLineCount(List<String> lineIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "或取在线监测点数量异常: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfoAsDept(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getPracticalRunDeviceInfoAsDept");
|
||||
List<GeneralDeviceDTO> deptDeviceInfos = generalDeviceService.getDeviceInfoAsDept(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
@@ -73,6 +74,7 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<List<GeneralDeviceDTO>> getOfflineRunDeviceInfoAsDept(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getOfflineRunDeviceInfoAsDept");
|
||||
List<GeneralDeviceDTO> deptDeviceInfos = generalDeviceService.getDeviceInfoAsDept(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(2).collect(Collectors.toList()));
|
||||
@@ -93,6 +95,7 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsDept(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getPracticalAllDeviceInfoAsDept");
|
||||
List<GeneralDeviceDTO> deptDeviceInfos = generalDeviceService.getDeviceInfoAsDept(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
||||
@@ -120,6 +123,7 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfoAsSubstation(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getPracticalRunDeviceInfoAsSubstation");
|
||||
List<GeneralDeviceDTO> substationDeviceInfos = generalDeviceService.getDeviceInfoAsSubstation(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
@@ -139,6 +143,7 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfo(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getPracticalRunDeviceInfo");
|
||||
List<GeneralDeviceDTO> deptDeviceInfos = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
@@ -158,6 +163,7 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<List<GeneralDeviceDTO>> getOfflineRunDeviceInfo(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getOfflineRunDeviceInfo");
|
||||
List<GeneralDeviceDTO> deptDeviceInfos = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(2).collect(Collectors.toList()));
|
||||
|
||||
@@ -288,4 +288,21 @@ public class LineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getDeviceList(), methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前状态在线的监测点数量
|
||||
* @param lineIds 监测点集合
|
||||
* @return 在线的监测点数量
|
||||
* @author cdf
|
||||
* @date 2022/8/1
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOnLineCount")
|
||||
@ApiOperation("获取当前状态在线的监测点数量")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点集合", required = true)
|
||||
public HttpResult<Integer> getOnLineCount(@RequestBody List<String> lineIds) {
|
||||
String methodDescribe = getMethodDescribe("getOnLineCount");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getOnLineCount(lineIds), methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -318,4 +318,10 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
* @return 装置Id
|
||||
*/
|
||||
List<String> getDeviceList();
|
||||
|
||||
/**
|
||||
* 获取当前状态在线的监测点数量
|
||||
* @return 装置Id
|
||||
*/
|
||||
Integer getOnLineCount(@Param("lineIds")List<String> lineIds);
|
||||
}
|
||||
|
||||
@@ -952,4 +952,23 @@ FROM
|
||||
<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>
|
||||
|
||||
|
||||
<select id="getOnLineCount" resultType="int">
|
||||
SELECT
|
||||
count( f.Com_Flag )
|
||||
FROM
|
||||
pq_line a
|
||||
INNER JOIN pq_line_detail b ON a.id = b.id
|
||||
INNER JOIN pq_line c ON a.pid = c.id
|
||||
INNER JOIN pq_line d ON c.pid = d.id
|
||||
INNER JOIN pq_device f ON d.id = f.id
|
||||
WHERE
|
||||
a.state = 1
|
||||
AND f.Com_Flag = 1
|
||||
AND a.id in
|
||||
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user