1.app远程接口添加
This commit is contained in:
@@ -480,7 +480,11 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
||||
new LambdaQueryWrapper<PowerDistributionarea>()
|
||||
.select(PowerDistributionarea::getId,
|
||||
PowerDistributionarea::getState,
|
||||
PowerDistributionarea::getVoltageLevel,PowerDistributionarea::getOrgId)
|
||||
PowerDistributionarea::getVoltageLevel,
|
||||
PowerDistributionarea::getOrgId,
|
||||
PowerDistributionarea::getPowerStationId,
|
||||
PowerDistributionarea::getLineId
|
||||
)
|
||||
.last(true, "limit " + page+ ",10000"));
|
||||
|
||||
List<DistributionMonitor> poList= new ArrayList<>();
|
||||
@@ -494,6 +498,8 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
||||
distributionMonitor.setVoltageLevel(powerDistributionarea.getVoltageLevel());
|
||||
distributionMonitor.setCreatedDate(LocalDateTime.now());
|
||||
distributionMonitor.setIfPowerUser(0);
|
||||
distributionMonitor.setPowerStationId(powerDistributionarea.getPowerStationId());
|
||||
distributionMonitor.setLineId(powerDistributionarea.getLineId());
|
||||
poList.add(distributionMonitor);
|
||||
|
||||
}
|
||||
|
||||
@@ -147,10 +147,10 @@ public interface GeneralDeviceInfoClient {
|
||||
HttpResult<List<DevDetail>> getDevInfoByIds(@RequestBody List<String> devIds);
|
||||
|
||||
/**
|
||||
* @Description: 根据topIds集合获取终端信息
|
||||
* @Description: 根据id集合获取终端消息信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/9 13:55
|
||||
*/
|
||||
@PostMapping("/getTopMsgInfoByIds")
|
||||
HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(@RequestBody List<String> topIds);
|
||||
HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(@RequestBody OnlineRateParam param);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(List<String> topIds) {
|
||||
public HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(OnlineRateParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据topIds集合获取终端信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -25,4 +25,6 @@ public class OnlineRateParam {
|
||||
@ApiModelProperty(name = "endTime", value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(name = "type", value = "区分类型0:topid搜索 1:devid搜索")
|
||||
private Integer type;
|
||||
}
|
||||
|
||||
@@ -322,11 +322,10 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getTopMsgInfoByIds")
|
||||
@ApiOperation("根据终端id集合获取终端信息")
|
||||
@ApiImplicitParam(name = "topIds", value = "单位部门索引", required = true)
|
||||
public HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(@RequestBody List<String> topIds) {
|
||||
@ApiOperation("根据id集合获取终端消息信息")
|
||||
public HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(@RequestBody OnlineRateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getTopMsgInfoByIds");
|
||||
List<TopMsgPO> runLineIds = generalDeviceService.getTopMsgInfoByIds(topIds);
|
||||
List<TopMsgPO> runLineIds = generalDeviceService.getTopMsgInfoByIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,runLineIds,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -13,5 +14,5 @@ public interface TopMsgMapper {
|
||||
Page<TopMsgPO> dailyDeviceAbnormalStatistics(Page<TopMsgPO> page,@Param("lineGrade") String lineGrade, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
List<TopMsgPO> dailyDeviceAbnormal(@Param("lineGrade") String lineGrade,@Param("startTime") DateTime startTime);
|
||||
List<TopMsgPO> selectByIds(@Param("ids") List<String> ids);
|
||||
List<TopMsgPO> selectByIds(@Param("param") OnlineRateParam param);
|
||||
}
|
||||
|
||||
@@ -80,11 +80,27 @@
|
||||
INNER JOIN pqs_top_msg ptm ON ptm.Dev_Id = dev.Id
|
||||
INNER JOIN pq_device device ON dev.id = device.Id
|
||||
<where>
|
||||
<if test="ids!=null and ids.size()!=0">
|
||||
ptm.Top_Id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="param.type == 0">
|
||||
<if test="param.ids!=null and param.ids.size()!=0">
|
||||
ptm.Top_Id IN
|
||||
<foreach collection="param.ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
<if test="param.type == 1">
|
||||
<if test="param.ids!=null and param.ids.size()!=0">
|
||||
dev.Id IN
|
||||
<foreach collection="param.ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND ptm.Time_Id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND ptm.Time_Id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.DeptDeviceDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeptSubstationDetailVO;
|
||||
@@ -780,7 +781,7 @@ public class GeneralDeviceService {
|
||||
return devDetails;
|
||||
}
|
||||
|
||||
public List<TopMsgPO> getTopMsgInfoByIds(List<String> topIds) {
|
||||
return topMsgMapper.selectByIds(topIds);
|
||||
public List<TopMsgPO> getTopMsgInfoByIds(OnlineRateParam param) {
|
||||
return topMsgMapper.selectByIds(param);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user