sql字段修改前端联调
This commit is contained in:
@@ -24,7 +24,11 @@ import java.util.List;
|
||||
* @version 1.0.0
|
||||
* @date 2022年02月14日 14:02
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/deviceInfo", fallbackFactory = GeneralDeviceInfoClientFallbackFactory.class, contextId = "deviceInfo")
|
||||
@FeignClient(
|
||||
value = ServerInfo.DEVICE,
|
||||
path = "/deviceInfo",
|
||||
fallbackFactory = GeneralDeviceInfoClientFallbackFactory.class,
|
||||
contextId = "deviceInfo")
|
||||
public interface GeneralDeviceInfoClient {
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,11 @@ import java.util.Map;
|
||||
* @author denghuajun
|
||||
* @date 2022/2/28
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/line", fallbackFactory = LineFeignClientFallbackFactory.class, contextId = "line")
|
||||
@FeignClient(
|
||||
value = ServerInfo.DEVICE,
|
||||
path = "/line",
|
||||
fallbackFactory = LineFeignClientFallbackFactory.class,
|
||||
contextId = "line")
|
||||
public interface LineFeignClient {
|
||||
|
||||
/**
|
||||
@@ -304,4 +308,7 @@ public interface LineFeignClient {
|
||||
*/
|
||||
@PostMapping("/getOnIntegrityByIds")
|
||||
HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIds(@RequestBody OnlineRateParam param);
|
||||
|
||||
@PostMapping("getOnIntegrityByIdsAndTime")
|
||||
HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIdsAndTime(@RequestBody LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -224,10 +224,13 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
public HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIds(OnlineRateParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点数据完整率(谐波专用): ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIdsAndTime(LineBaseQueryParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点数据完整率: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +25,10 @@ public class LineBaseQueryParam {
|
||||
|
||||
@ApiModelProperty(name = "searchValue",value = "关键字搜索值")
|
||||
private String searchValue;
|
||||
|
||||
@ApiModelProperty(name = "startTime", value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(name = "endTime", value = "结束时间")
|
||||
private String endTime;
|
||||
}
|
||||
|
||||
@@ -6,12 +6,15 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
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.vo.DeptDeviceDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeptSubstationDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.ExceptionDeviceInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -48,6 +51,7 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
|
||||
private final TerminalBaseService terminalBaseService;
|
||||
|
||||
private final RStatOnlinerateDMapper onlineRateMapper;
|
||||
/**
|
||||
* 获取按部门分类的实际运行终端综合信息
|
||||
*/
|
||||
@@ -266,4 +270,14 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
@ApiOperation("终端在线率(谐波专用)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
|
||||
List<RStatOnlinerateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,18 +45,15 @@ public class LineController extends BaseController {
|
||||
|
||||
private final LineService lineService;
|
||||
|
||||
private final GeneralDeviceService generalDeviceService;
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final RStatIntegrityDMapper integrityDMapper;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailData")
|
||||
@ApiOperation("根据监测点id获取监测点详情")
|
||||
@@ -421,4 +418,14 @@ public class LineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onIntegrityByIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getOnIntegrityByIdsAndTime")
|
||||
@ApiOperation("监测点数据完整率")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIdsAndTime(@RequestBody LineBaseQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnIntegrityByIdsAndTime");
|
||||
List<RStatIntegrityVO> onIntegrityByIds = integrityDMapper.getOnIntegrityByIdsAndTime (param.getLineIds(),param.getStartTime(),param.getEndTime());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onIntegrityByIds,methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.LineDataIntegrity;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
@@ -36,4 +37,6 @@ public interface RStatIntegrityDMapper extends BaseMapper<RStatIntegrityD> {
|
||||
* @return List<OnlineRate>
|
||||
*/
|
||||
List<RStatIntegrityVO> getOnIntegrityByIds(@Param("param") OnlineRateParam param);
|
||||
|
||||
List<RStatIntegrityVO> getOnIntegrityByIdsAndTime (@Param("list")List<String> lineIds,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
r_stat_integrity_d
|
||||
<where>
|
||||
<if test="param!=null and param.ids != null and param.ids.size > 0">
|
||||
AND Dev_Id IN
|
||||
AND line_index IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
@@ -38,4 +38,29 @@
|
||||
</where>
|
||||
group by line_index ;
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getOnIntegrityByIdsAndTime" resultType="com.njcn.device.pq.pojo.vo.RStatIntegrityVO">
|
||||
SELECT
|
||||
line_index AS lineIndex,
|
||||
sum( real_time )/ sum( due_time )* 100 AS integrityRate
|
||||
FROM
|
||||
r_stat_integrity_d
|
||||
<where>
|
||||
<if test="list.size > 0">
|
||||
AND line_index IN
|
||||
<foreach collection='list' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="startTime != null and startTime !=''">
|
||||
AND time_id >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND time_id <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by line_index ;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
from r_stat_onlinerate_d
|
||||
<where>
|
||||
<if test="param!=null and param.ids != null and param.ids.size > 0">
|
||||
AND Dev_Id IN
|
||||
AND dev_index IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
Reference in New Issue
Block a user