1.app远程接口代码提交
This commit is contained in:
@@ -7,6 +7,8 @@ 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.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -127,4 +129,28 @@ public interface GeneralDeviceInfoClient {
|
||||
*/
|
||||
@GetMapping("/deptGetRunLineEvent")
|
||||
HttpResult<List<String>> deptGetRunLineEvent(@RequestParam("deptId")String deptId);
|
||||
|
||||
/**
|
||||
* 根据单位获取终端集合
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/deptGetRunDev")
|
||||
HttpResult<List<String>> deptGetRunDev(@RequestParam("deptId")String deptId);
|
||||
|
||||
/**
|
||||
* 根据终端id集合获取终端信息
|
||||
* @param devIds
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getDevInfoByIds")
|
||||
HttpResult<List<DevDetail>> getDevInfoByIds(@RequestBody List<String> devIds);
|
||||
|
||||
/**
|
||||
* @Description: 根据topIds集合获取终端信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/9 13:55
|
||||
*/
|
||||
@PostMapping("/getTopMsgInfoByIds")
|
||||
HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(@RequestBody List<String> topIds);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -311,4 +313,17 @@ public interface LineFeignClient {
|
||||
|
||||
@PostMapping("getOnIntegrityByIdsAndTime")
|
||||
HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIdsAndTime(@RequestBody LineBaseQueryParam param);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 根据监测点id获取监测点集合
|
||||
* @param ids
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 15:55
|
||||
*/
|
||||
@PostMapping("/getLineDetailByIds")
|
||||
HttpResult<List<LineDetailVO.Detail>> getLineDetailByIds(@RequestBody List<String> ids);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ 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.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -98,6 +100,24 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取单位暂态系统投运监测点", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> deptGetRunDev(String deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据单位获取终端集合", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DevDetail>> getDevInfoByIds(List<String> devIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据终端id集合获取终端信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(List<String> topIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据topIds集合获取终端信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -231,6 +231,12 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点数据完整率: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<LineDetailVO.Detail>> getLineDetailByIds(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据监测点id获取监测点集合: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -8,6 +9,14 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TopMsgPO extends BaseEntity {
|
||||
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String topId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String ip;
|
||||
|
||||
private String cityName;
|
||||
|
||||
private String subName;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description: 终端信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 15:34
|
||||
*/
|
||||
@Data
|
||||
public class DevDetail {
|
||||
|
||||
@ApiModelProperty("终端id")
|
||||
private String devIndex;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty("ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("供电公司")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String bdzName;
|
||||
|
||||
@ApiModelProperty("数据更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("终端等级")
|
||||
private String lineGrade;
|
||||
|
||||
@ApiModelProperty("通讯状态(0:中断;1:正常)")
|
||||
private Integer comFlag;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -26,4 +28,53 @@ public class LineDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
@Data
|
||||
public static class Detail extends LineDetailVO implements Serializable{
|
||||
|
||||
@ApiModelProperty("区域id")
|
||||
private String areaId;
|
||||
|
||||
@ApiModelProperty("区域名称")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty("终端id")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty("监测点Id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("测量间隔(1-10分钟)")
|
||||
private Integer timeInterval;
|
||||
|
||||
@ApiModelProperty("接线类型")
|
||||
private Integer ptType;
|
||||
|
||||
@ApiModelProperty("电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@ApiModelProperty("数据更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("终端等级")
|
||||
private String lineGrade;
|
||||
|
||||
@ApiModelProperty("通讯状态(0:中断;1:正常)")
|
||||
private Integer comFlag;
|
||||
|
||||
@ApiModelProperty("PT一次变比")
|
||||
private Double PT1;
|
||||
|
||||
@ApiModelProperty("PT二次变比")
|
||||
private Double PT2;
|
||||
|
||||
@ApiModelProperty("CT一次变比")
|
||||
private Double CT1;
|
||||
|
||||
@ApiModelProperty("CT二次变比")
|
||||
private Double CT2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +125,14 @@ public class DeptLineController extends BaseController {
|
||||
DeptLine lineByLineIds = deptLineService.getLineByLineIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineByLineIds, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getLineNodeByDeptId")
|
||||
@ApiOperation("部门Id获取所有子集部门绑定监测点")
|
||||
@ApiImplicitParam(name = "id", value = "部门id", required = true)
|
||||
public HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineNodeByDeptId");
|
||||
List<String> list = deptLineService.getLineNodeByDeptId(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,8 @@ 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.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -301,7 +299,34 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,runLineIds,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/deptGetRunDev")
|
||||
@ApiOperation("根据单位获取终端id")
|
||||
@ApiImplicitParam(name = "deptId", value = "单位部门索引", required = true)
|
||||
public HttpResult<List<String>> deptGetRunDev(@RequestParam("deptId")String deptId) {
|
||||
String methodDescribe = getMethodDescribe("deptGetRunDev");
|
||||
List<String> runLineIds = generalDeviceService.deptGetRunDev(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,runLineIds,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDevInfoByIds")
|
||||
@ApiOperation("根据终端id集合获取终端信息")
|
||||
@ApiImplicitParam(name = "deptId", value = "单位部门索引", required = true)
|
||||
public HttpResult<List<DevDetail>> getDevInfoByIds(@RequestBody List<String> devIds) {
|
||||
String methodDescribe = getMethodDescribe("getDevInfoByIds");
|
||||
List<DevDetail> runLineIds = generalDeviceService.getDevInfoByIds(devIds);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,runLineIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getTopMsgInfoByIds")
|
||||
@ApiOperation("根据终端id集合获取终端信息")
|
||||
@ApiImplicitParam(name = "deptId", value = "单位部门索引", required = true)
|
||||
public HttpResult<List<TopMsgPO>> getTopMsgInfoByIds(@RequestBody List<String> topIds) {
|
||||
String methodDescribe = getMethodDescribe("getTopMsgInfoByIds");
|
||||
List<TopMsgPO> runLineIds = generalDeviceService.getTopMsgInfoByIds(topIds);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,runLineIds,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,4 +433,13 @@ public class LineController extends BaseController {
|
||||
Page<HalfReportVO> halfReportVOS = lineService.halfReport(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,halfReportVOS,methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getLineDetailByIds")
|
||||
@ApiOperation("根据监测点id获取监测点集合")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<LineDetailVO.Detail>> getLineDetailByIds(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetailByIds");
|
||||
List<LineDetailVO.Detail> line = lineService.getLineDetailByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,line,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
||||
@@ -63,4 +64,13 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||
List<LineInfluxDbOnlineVO> getOnlineEvaluate(@Param("list") List<String> devIndexes,
|
||||
@Param("begin") String searchBeginTime,
|
||||
@Param("end") String searchEndTime);
|
||||
|
||||
/**
|
||||
* @Description: 获取终端集合信息
|
||||
* @param ids
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.vo.app.DevDetail>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 15:40
|
||||
*/
|
||||
List<DevDetail> selectDevByIds(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -532,4 +532,13 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
|
||||
Map<String,String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取监测点集合信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 14:37
|
||||
*/
|
||||
List<LineDetailVO.Detail> selectByIds(@Param("ids") List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,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);
|
||||
}
|
||||
|
||||
@@ -214,4 +214,37 @@
|
||||
|
||||
GROUP BY r.dev_index
|
||||
</select>
|
||||
<select id="selectDevByIds" resultType="com.njcn.device.pq.pojo.vo.DevDetail">
|
||||
SELECT
|
||||
gd.NAME as gdName,
|
||||
substation.NAME as bdzName,
|
||||
device.id as devIndex,
|
||||
device.NAME as devName,
|
||||
lineDetail.Line_Grade AS lineGrade,
|
||||
deviceDetail.Update_Time AS timeID,
|
||||
deviceDetail.ip as ip,
|
||||
deviceDetail.Com_Flag as comFlag
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
pq_line gd,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail
|
||||
WHERE
|
||||
<if test="ids!=null and ids.size()!=0">
|
||||
device.id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
AND line.pid = voltage.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND line.id = lineDetail.id
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1424,5 +1424,51 @@
|
||||
and sub.id = dev.pid
|
||||
AND line.id = #{lineId}
|
||||
</select>
|
||||
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail">
|
||||
SELECT DISTINCT
|
||||
area.name as areaId,
|
||||
gd.NAME gdName,
|
||||
substation.NAME subName,
|
||||
device.id devId,
|
||||
device.NAME devName,
|
||||
line.id as lineId,
|
||||
line.NAME lineName,
|
||||
lineDetail.Time_Interval as timeInterval,
|
||||
lineDetail.PT_Type as ptType,
|
||||
lineDetail.Line_Grade,
|
||||
lineDetail.PT1 as PT1,
|
||||
lineDetail.PT2 as PT2,
|
||||
lineDetail.CT1 as CT1,
|
||||
lineDetail.CT2 as CT2,
|
||||
deviceDetail.Update_Time AS timeID,
|
||||
deviceDetail.ip ip,
|
||||
deviceDetail.Com_Flag as comFlag,
|
||||
vg.Scale as voltageLevel
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
pq_line gd,
|
||||
pq_line area,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail,
|
||||
pq_voltage vg
|
||||
WHERE
|
||||
line.pid = voltage.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND gd.pid = area.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND line.id = lineDetail.id
|
||||
AND vg.Id = voltage.id
|
||||
<if test="ids!=null and ids.size()!=0">
|
||||
AND line.id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -52,4 +52,40 @@
|
||||
AND pld.Line_Grade=#{lineGrade}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">
|
||||
SELECT
|
||||
top_id as topId,
|
||||
dev.Id AS devId,
|
||||
city.NAME AS cityName,
|
||||
sub.NAME AS subName,
|
||||
dev.NAME AS deviceName,
|
||||
device.ip AS ip,
|
||||
ptm.Time_Id AS time,
|
||||
CAST(
|
||||
ptm.Integrity_Value AS DECIMAL ( 13, 2 )) AS integrityValue,
|
||||
ptm.Integrity_Flag AS integrityFlag,
|
||||
ptm.Comout_Count AS comOutCount,
|
||||
ptm.Comout_Desc AS comOutDesc,
|
||||
ptm.Alarm_Count AS alarmCount,
|
||||
ptm.Alarm_Desc AS alarmDesc,
|
||||
CAST(
|
||||
ptm.Flow_Value AS DECIMAL ( 13, 2 )) AS flowValue,
|
||||
ptm.OnlineRate_Flag AS onlineRateFlag,
|
||||
CAST(
|
||||
ptm.OnlineRate_Value AS DECIMAL ( 13, 2 )) AS onlineRateValue
|
||||
FROM
|
||||
pq_line dev
|
||||
INNER JOIN pq_line sub ON dev.pid = sub.id
|
||||
INNER JOIN pq_line city ON sub.pid = city.id
|
||||
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>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -63,6 +63,18 @@ public interface DeptLineService extends IService<DeptLine> {
|
||||
* @date 2022/1/25 9:28
|
||||
*/
|
||||
List<String> getLineByDeptId(String id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 根据部门id获取所有子集部门所包含的部门信息
|
||||
* @param id
|
||||
* @return: java.util.List<java.lang.String>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 14:54
|
||||
*/
|
||||
List<String> getLineNodeByDeptId(String id);
|
||||
|
||||
/**
|
||||
* @Description: 获取部门和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
|
||||
@@ -196,4 +196,13 @@ public interface LineService {
|
||||
* 根据监测点批量获取监测点信息
|
||||
*/
|
||||
List<LineDTO> getLineDetailBatch(List<String> ids);
|
||||
|
||||
/**
|
||||
* @Description: 获取监测点集合(APP)
|
||||
* @param ids
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.LineDetailVO.Detail>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 15:46
|
||||
*/
|
||||
List<LineDetailVO.Detail> getLineDetailByIds(List<String> ids);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,10 @@ import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -30,6 +33,8 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deptBindLine(DeptLineParam deptLineParam) {
|
||||
@@ -78,6 +83,16 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
return this.lambdaQuery().in(DeptLine::getId, id).list().stream().map(DeptLine::getLineId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineNodeByDeptId(String id) {
|
||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptInfos.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList());
|
||||
List<DeptLine> userLine = this.list(new LambdaQueryWrapper<DeptLine>()
|
||||
.in(DeptLine::getId, deptIds)
|
||||
);
|
||||
return userLine.stream().map(DeptLine::getLineId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param devDataType
|
||||
* @Description: 获取部门和监测点的关系(分稳态暂态)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
@@ -10,16 +11,15 @@ import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.mapper.DeviceMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.TopMsgMapper;
|
||||
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.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.Substation;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.DeptDeviceDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeptSubstationDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.ExceptionDeviceInfoVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
@@ -68,6 +68,7 @@ public class GeneralDeviceService {
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
private final TopMsgMapper topMsgMapper;
|
||||
|
||||
|
||||
/**
|
||||
@@ -743,4 +744,43 @@ public class GeneralDeviceService {
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param deptId 部门id
|
||||
* @author cdf
|
||||
* @date 2023/7/20
|
||||
*/
|
||||
public List<String> deptGetRunDev(String deptId) {
|
||||
List<String> runLineIds = this.deptGetRunLine(deptId,Stream.of(0).collect(Collectors.toList()),Stream.of(0,2).collect(Collectors.toList()));
|
||||
List<Line> lines = lineMapper.selectList(new LambdaQueryWrapper<Line>()
|
||||
.select(Line::getPids)
|
||||
.in(Line::getId,runLineIds)
|
||||
);
|
||||
if(CollUtil.isNotEmpty(lines)){
|
||||
return lines.stream().map(line -> {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
return idsArray[4];
|
||||
}).distinct().collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<DevDetail> getDevInfoByIds(List<String> devIds) {
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
|
||||
List<DevDetail> devDetails = deviceMapper.selectDevByIds(devIds);
|
||||
for (DevDetail devDetail : devDetails) {
|
||||
//终端等级
|
||||
if(gradeMap.containsKey(devDetail.getLineGrade())){
|
||||
devDetail.setLineGrade(String.valueOf(gradeMap.get(devDetail.getLineGrade())));
|
||||
}
|
||||
}
|
||||
return devDetails;
|
||||
}
|
||||
|
||||
public List<TopMsgPO> getTopMsgInfoByIds(List<String> topIds) {
|
||||
return topMsgMapper.selectByIds(topIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import com.njcn.web.utils.GeneralUtil;
|
||||
@@ -504,6 +505,37 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return lineDTOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDetailVO.Detail> getLineDetailByIds(List<String> ids) {
|
||||
List<LineDetailVO.Detail> details = this.baseMapper.selectByIds(ids);
|
||||
//获取行政区域
|
||||
List<String> areaIds = details.stream().map(LineDetailVO.Detail::getAreaId).distinct().collect(Collectors.toList());
|
||||
List<Area> data = areaFeignClient.areaNameByList(areaIds).getData();
|
||||
Map<String, String> areaMap = data.stream().collect(Collectors.toMap(Area::getId, Area::getName));
|
||||
//获取电压字典
|
||||
List<DictData> dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
Map<String, String> dictMap = dictType.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
//获取终端等级
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
|
||||
for (LineDetailVO.Detail detail : details) {
|
||||
//获取行政区域名称
|
||||
if(areaMap.containsKey(detail.getAreaId())){
|
||||
detail.setAreaName(areaMap.get(detail.getAreaId()));
|
||||
}
|
||||
//电压
|
||||
if(dictMap.containsKey(detail.getVoltageLevel())){
|
||||
detail.setVoltageLevel(dictMap.get(detail.getVoltageLevel()));
|
||||
}
|
||||
//终端等级
|
||||
if(gradeMap.containsKey(detail.getLineGrade())){
|
||||
detail.setLineGrade(String.valueOf(gradeMap.get(detail.getLineGrade())));
|
||||
}
|
||||
}
|
||||
return details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.event.api.fallback.EventDetailFeignClientFallbackFactory;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.GeneralVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -51,4 +51,9 @@ public interface EventDetailFeignClient {
|
||||
@PostMapping("/getEventDetailCount")
|
||||
HttpResult<List<GeneralVO>> getEventDetailCount(@RequestBody Map<String, Object> condMap);
|
||||
|
||||
/**
|
||||
* 根据暂态id集合获取暂降列表
|
||||
*/
|
||||
@PostMapping("/getEventDetailByIdsList")
|
||||
HttpResult<List<RmpEventDetailPO>> getEventDetailByIdsList(@RequestBody List<String> ids);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.GeneralVO;
|
||||
import com.njcn.event.utils.EventlEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -56,6 +57,12 @@ public class EventDetailFeignClientFallbackFactory implements FallbackFactory<Ev
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RmpEventDetailPO>> getEventDetailByIdsList(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据暂态id集合获取暂降列表", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.event.mapper.majornetwork.EventDetailMapper;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.GeneralVO;
|
||||
import com.njcn.event.service.majornetwork.EventDetailService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -141,4 +142,16 @@ public class EventDetailController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, generalVOS, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据监测点集合获取短时终端,电压暂升,电压暂降
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getEventDetailByIdsList")
|
||||
@ApiOperation("根据暂态id集合获取暂降列表")
|
||||
public HttpResult<List<RmpEventDetailPO>> getEventDetailByIdsList(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getEventDetailByIdsList");
|
||||
List<RmpEventDetailPO> eventDetailPOS = eventDetailService.listByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eventDetailPOS, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +125,12 @@ public interface DeptFeignClient {
|
||||
*/
|
||||
@GetMapping("/getDepSonDetailIdByDeptId")
|
||||
HttpResult<List<DeptDTO>> getDepSonDetailByDeptId(@RequestParam("deptId") String deptId);
|
||||
|
||||
/**
|
||||
* 根据部门id查询当前部门所有父级部门id
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUpByDeptIds")
|
||||
HttpResult<List<String>> getUpByDeptIds(@RequestParam("deptId") String deptId);
|
||||
}
|
||||
|
||||
@@ -64,4 +64,12 @@ public interface UserFeignClient {
|
||||
*/
|
||||
@PostMapping("/userByIdList")
|
||||
HttpResult<List<User>> getUserByIdList(@RequestBody List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据部门ids查询用户信息
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserByDeptIds")
|
||||
HttpResult<List<User>> getUserByDeptIds(@RequestBody List<String> deptId);
|
||||
}
|
||||
|
||||
@@ -122,6 +122,12 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeign
|
||||
log.error("{}异常,降级处理,异常为:{}","查询前部门的的下级子部门list,(如果没子部门就是返回当前部门)",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getUpByDeptIds(String deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据部门id查询当前部门所有父级部门id",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,12 @@ public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeign
|
||||
log.error("{}异常,降级处理,异常为:{}","根据用户id集合查询用户信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<User>> getUserByDeptIds(List<String> deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据部门ids查询用户信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,7 +447,20 @@ public class DeptController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id查询当前部门所有父级部门id
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getUpByDeptIds")
|
||||
@ApiOperation("根据部门id查询当前部门所有父级部门id")
|
||||
@ApiImplicitParam(name = "deptId", value = "用户部门id", required = true)
|
||||
public HttpResult<List<String>> getUpByDeptIds(@RequestParam("deptId") String deptId) {
|
||||
String methodDescribe = getMethodDescribe("getUpByDeptIds");
|
||||
List<String> users = deptService.getUpByDeptIds(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
/*++++++++++++++++++++++++++++++++pms专用+++++++++++++++++++++++++++++++begin*/
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.user.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.LogInfo;
|
||||
@@ -444,5 +445,25 @@ public class UserController extends BaseController {
|
||||
List<User> users = userService.getUserListByDeptId(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门ids查询用户信息
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getUserByDeptIds")
|
||||
@ApiOperation("根据部门ids查询用户信息")
|
||||
@ApiImplicitParam(name = "deptId", value = "用户部门id", required = true)
|
||||
public HttpResult<List<User>> getUserByDeptIds(@RequestBody List<String> deptId) {
|
||||
String methodDescribe = getMethodDescribe("getUpByDeptIds");
|
||||
List<User> users = userService.list(new LambdaQueryWrapper<User>()
|
||||
.in(User::getDeptId,deptId)
|
||||
.eq(User::getSmsNotice,1)
|
||||
.eq(User::getState,1)
|
||||
);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,4 +116,13 @@ public interface DeptMapper extends BaseMapper<Dept> {
|
||||
* @date 2022/10/09
|
||||
*/
|
||||
List<String> getDeptSonId(@Param("deptId") String deptId);
|
||||
|
||||
/**
|
||||
* @Description: 查询所有父级部门
|
||||
* @param deptId
|
||||
* @return: java.util.List<java.lang.String>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/9 15:59
|
||||
*/
|
||||
List<String> selectUpByDeptIds(@Param("deptId") String deptId);
|
||||
}
|
||||
|
||||
@@ -184,4 +184,23 @@
|
||||
select id from sys_dept where sys_dept.Pid=#{deptId} and state = 1
|
||||
</select>
|
||||
|
||||
<select id="selectUpByDeptIds" resultType="java.lang.String">
|
||||
SELECT
|
||||
T2.id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@r AS _id,
|
||||
( SELECT @r := Pid FROM sys_dept WHERE id = _id LIMIT 1 ) AS parent_id,
|
||||
@l := @l + 1 AS lvl
|
||||
FROM
|
||||
( SELECT @r := #{deptId}, @l := 0 ) vars,
|
||||
sys_dept h
|
||||
WHERE
|
||||
Pid >> 0
|
||||
) T1
|
||||
JOIN sys_dept T2 ON T1.parent_id = T2.id
|
||||
ORDER BY
|
||||
T1.lvl DESC;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -65,4 +65,5 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -218,4 +218,12 @@ public interface IDeptService extends IService<Dept> {
|
||||
* @Date: 2023/1/10
|
||||
*/
|
||||
List<DeptDTO> getDepSonDetailByDeptId(String deptId);
|
||||
|
||||
/**
|
||||
* @Description: 向上查询部门信息
|
||||
* @param deptId 部门id
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/9 15:57
|
||||
*/
|
||||
List<String> getUpByDeptIds(String deptId);
|
||||
}
|
||||
|
||||
@@ -458,4 +458,11 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
}).collect (Collectors.toList ( ));
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getUpByDeptIds(String deptId) {
|
||||
List<String> list = this.baseMapper.selectUpByDeptIds(deptId);
|
||||
list.add(deptId);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user