1.app远程接口添加

This commit is contained in:
wr
2023-11-17 16:09:43 +08:00
parent bf6aec0f24
commit 56cb0bc38a
16 changed files with 161 additions and 17 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -25,4 +25,6 @@ public class OnlineRateParam {
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
@ApiModelProperty(name = "type", value = "区分类型0topid搜索 1devid搜索")
private Integer type;
}

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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 &lt;= #{param.endTime}
</if>
</where>
</select>

View File

@@ -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);
}
}