代码调整
This commit is contained in:
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -24,4 +25,13 @@ public interface DeptLineFeignClient {
|
||||
|
||||
@PostMapping("removeBind")
|
||||
HttpResult<Integer> removeBind(@RequestParam("id") String id);
|
||||
/**
|
||||
* @Description:获取部门和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType] 0:暂态 1:稳态
|
||||
* @return: com.njcn.common.pojo.response.HttpResult<java.lang.Integer>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/19
|
||||
*/
|
||||
@PostMapping("getLineByDeptRelation")
|
||||
HttpResult<Map<String,List<String>>> getLineByDeptRelation(@RequestParam("devDataType") Integer devDataType);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -255,4 +256,26 @@ public interface LineFeignClient {
|
||||
*/
|
||||
@PostMapping("getOnLineDevLine")
|
||||
HttpResult<List<OnlineLineDTO>> getOnLineDevLine(@RequestBody List<String> lineIds);
|
||||
|
||||
/**
|
||||
* @Description: 获取变电站和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType] 0:暂态 1:稳态
|
||||
* @return: com.njcn.common.pojo.response.HttpResult<java.util.Map<java.lang.String,java.util.List<java.lang.String>>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/20
|
||||
*/
|
||||
@PostMapping("getLineBySubstationRelation")
|
||||
HttpResult<Map<String,List<String>>> getLineBySubstationRelation(@RequestParam("devDataType") Integer devDataType);
|
||||
|
||||
/**
|
||||
* 获取监测点基础详情
|
||||
* @param lineIds 监测点id集合
|
||||
* @return 监测点详情信息
|
||||
* @author cdf
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("getLineDetailList")
|
||||
HttpResult<List<LineDetailDataVO>> getLineDetailList(@RequestBody List<String> lineIds);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -48,6 +49,12 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
|
||||
log.error("{}异常,降级处理,异常为:{}", "部门解除绑定", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Map<String,List<String>>> getLineByDeptRelation(Integer devDataType) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取部门和监测点的关系(分稳态暂态)", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,11 @@ import com.njcn.device.pq.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -192,6 +195,18 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Map<String,List<String>>> getLineBySubstationRelation(@RequestParam("devDataType") Integer devDataType) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取变电站和监测点的关系(分稳态暂态): ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<LineDetailDataVO>> getLineDetailList(@RequestBody List<String> lineIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点基础详情异常: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,4 +75,10 @@ public class LineDetailDataVO {
|
||||
@ApiModelProperty(name = "dealCapacity",value = "用户协议容量(MVA)")
|
||||
private Float dealCapacity;
|
||||
|
||||
/**
|
||||
* 测量间隔(1-10分钟)
|
||||
*/
|
||||
@ApiModelProperty(name = "timeInterval",value = "测量间隔(1-10分钟)")
|
||||
private Integer timeInterval;
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -107,5 +108,14 @@ public class DeptLineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getLineByDeptRelation")
|
||||
@ApiOperation("获取部门和监测点的关系(分稳态暂态)")
|
||||
@ApiImplicitParam(name = "devDataType", value = "数据类型(0:暂态系统;1:稳态系统;)", required = true)
|
||||
public HttpResult<Map<String,List<String>> > getLineByDeptRelation(@RequestParam("devDataType") Integer devDataType) {
|
||||
String methodDescribe = getMethodDescribe("getLineByDeptRelation");
|
||||
Map<String,List<String>> map= deptLineService.getLineByDeptRelation(devDataType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -124,7 +125,7 @@ public class LineController extends BaseController {
|
||||
@ApiOperation("根据监测点id获取越限数值")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineOverLimitData");
|
||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||
Overlimit result = lineService.getOverLimitData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
@@ -375,4 +376,28 @@ public class LineController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/getLineBySubstationRelation")
|
||||
@ApiOperation("获取变电站和监测点的关系(分稳态暂态)")
|
||||
@ApiImplicitParam(name = "devDataType", value = "数据类型(0:暂态系统;1:稳态系统;)", required = true)
|
||||
public HttpResult<Map<String,List<String>>> getLineBySubstationRelation(@RequestParam("devDataType") Integer devDataType) {
|
||||
String methodDescribe = getMethodDescribe("getLineBySubstationRelation");
|
||||
Map<String,List<String>> map= lineService.getLineBySubstationRelation(devDataType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取基础监测点详细信息
|
||||
* @author cdf
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/getLineDetailList")
|
||||
@ApiOperation("获取基础监测点详细信息")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点id集合", required = true)
|
||||
public HttpResult<List<LineDetailDataVO>> getLineDetailList(@RequestBody List<String> lineIds) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetailList");
|
||||
List<LineDetailDataVO> resList= lineService.getLineDetailList(lineIds);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.njcn.device.pq.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import java.util.List;
|
||||
@@ -44,4 +45,26 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
* @return
|
||||
*/
|
||||
List<String> getMyselfBindLine(@Param("deptId")String deptId);
|
||||
|
||||
@Select ("SELECT\n" +
|
||||
"\tpq_dept_line.Id,\n" +
|
||||
"\tpq_dept_line.Line_Id\n" +
|
||||
"FROM\n" +
|
||||
"\tpq_dept_line\n" +
|
||||
"WHERE\n" +
|
||||
"\tEXISTS (\n" +
|
||||
"\t\tSELECT\n" +
|
||||
"\t\t\t1\n" +
|
||||
"\t\tFROM\n" +
|
||||
"\t\t\tpq_device,\n" +
|
||||
"\t\t\tpq_line\n" +
|
||||
"\t\tWHERE\n" +
|
||||
"\t\t\tSUBSTRING_INDEX(\n" +
|
||||
"\t\t\t\tSUBSTRING_INDEX(pq_line.Pids, ',', 5),\n" +
|
||||
"\t\t\t\t',',\n" +
|
||||
"\t\t\t\t- 1\n" +
|
||||
"\t\t\t) = pq_device.Id\n" +
|
||||
"\t\tAND pq_line.Id = pq_dept_line.Line_Id and (pq_device.Dev_Data_Type= 2 or pq_device.Dev_Data_Type = #{devDataType})\n" +
|
||||
"\t)")
|
||||
List<DeptLine> getLineByDeptRelation(@Param("devDataType")Integer devDataType);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -33,4 +34,12 @@ public interface LineDetailMapper extends BaseMapper<LineDetail> {
|
||||
*/
|
||||
List<LineDetail> getSpecifyLineDetail(@Param("list") List<String> list);
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定的监测点信息以及电压等级(需要其他字段可在基础上扩充)
|
||||
* @param lineIds 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineDetailDataVO> getLineDetailInfo(@Param("lineIds") List<String> lineIds);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@@ -330,4 +331,31 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
* @return 在线或离线监测点ids
|
||||
*/
|
||||
List<String> getOnOrUnLine(@Param("list")List<String> lineIds,@Param("comFlag")Integer comFlag);
|
||||
/**
|
||||
* @Description: 获取变电站id和监测点id用
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.po.Line>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/20
|
||||
*/
|
||||
@Select ("SELECT\n" +
|
||||
"\tpq_line.Id,\n" +
|
||||
"\tSUBSTRING_INDEX(\n" +
|
||||
"\t\tSUBSTRING_INDEX(pq_line.Pids, ',', 4),\n" +
|
||||
"\t\t',' ,- 1\n" +
|
||||
"\t) AS Pids\n" +
|
||||
"FROM\n" +
|
||||
"\tpq_line,\n" +
|
||||
"\tpq_device\n" +
|
||||
"WHERE\n" +
|
||||
"\tpq_line.`Level` = 6\n" +
|
||||
"AND SUBSTRING_INDEX(\n" +
|
||||
"\tSUBSTRING_INDEX(pq_line.Pids, ',', 5),\n" +
|
||||
"\t',' ,- 1\n" +
|
||||
") = pq_device.Id\n" +
|
||||
"AND (\n" +
|
||||
"\tpq_device.Dev_Data_Type = 2\n" +
|
||||
"\tOR pq_device.Dev_Data_Type = #{devDataType}\n" +
|
||||
") ")
|
||||
List<Line> getLineBySubstationRelation(@Param("devDataType")Integer devDataType);
|
||||
}
|
||||
|
||||
@@ -36,4 +36,20 @@
|
||||
A1.Pid = A2.Id AND A2.Pid = A3.Id AND A3.Id = C.Id AND
|
||||
C.Dev_Model = 1 AND C.Dev_Data_Type IN (1,2) AND C.Run_Flag = 0 AND A1.Id = D.Id
|
||||
</select>
|
||||
|
||||
<select id="getLineDetailInfo" resultType="com.njcn.device.pq.pojo.vo.LineDetailDataVO">
|
||||
select
|
||||
a.name lineName,
|
||||
c.Time_Interval,
|
||||
e.name scale
|
||||
from pq_line a
|
||||
inner join pq_line b on a.pid = b.id
|
||||
inner join pq_line_detail c on a.id = c.id
|
||||
inner join pq_voltage d on b.id = d.id
|
||||
left join sys_dict_data e on d.scale = e.id
|
||||
where a.id in
|
||||
<foreach collection="lineIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -52,4 +53,12 @@ public interface DeptLineService extends IService<DeptLine> {
|
||||
* @date 2022/1/25 9:28
|
||||
*/
|
||||
List<String> getLineByDeptId(String id);
|
||||
/**
|
||||
* @Description: 获取部门和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.Map<java.lang.String,java.util.List<java.lang.String>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/19
|
||||
*/
|
||||
Map<String, List<String>> getLineByDeptRelation(Integer devDataType);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,13 @@ import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测点类
|
||||
@@ -155,4 +158,22 @@ public interface LineService {
|
||||
* @Date: 2022/10/10
|
||||
*/
|
||||
List<DeptLineCountVO> getDeptLineCount(DeviceInfoParam deviceInfoParam);
|
||||
|
||||
/**
|
||||
* @Description: 获取变电站和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.Map<java.lang.String,java.util.List<java.lang.String>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/20
|
||||
*/
|
||||
Map<String, List<String>> getLineBySubstationRelation(Integer devDataType);
|
||||
|
||||
/**
|
||||
* 获取监测点基础详情
|
||||
* @param lineIds 监测点id集合
|
||||
* @return 监测点详情信息
|
||||
* @author cdf
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
List<LineDetailDataVO> getLineDetailList(List<String> lineIds);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -24,6 +26,8 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> implements DeptLineService {
|
||||
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deptBindLine(DeptLineParam deptLineParam) {
|
||||
@@ -67,5 +71,24 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
return this.lambdaQuery().in(DeptLine::getId, id).list().stream().map(DeptLine::getLineId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param devDataType
|
||||
* @Description: 获取部门和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.Map<java.lang.String, java.util.List < java.lang.String>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/19
|
||||
*/
|
||||
@Override
|
||||
public Map<String, List<String>> getLineByDeptRelation(Integer devDataType) {
|
||||
|
||||
Map<String, List<String>> map = new HashMap<> ();
|
||||
|
||||
List<DeptLine> deptLines = deptLineMapper.getLineByDeptRelation(devDataType);
|
||||
Map<String, List<String>> collect = deptLines.stream ( ).collect (Collectors.groupingBy (DeptLine::getId, Collectors.mapping (DeptLine::getLineId,Collectors.toList ())));
|
||||
|
||||
return collect;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -776,6 +776,31 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return deptLineCountVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param devDataType
|
||||
* @Description: 获取变电站和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.Map<java.lang.String, java.util.List < java.lang.String>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/20
|
||||
*/
|
||||
@Override
|
||||
public Map<String, List<String>> getLineBySubstationRelation(Integer devDataType) {
|
||||
|
||||
Map<String, List<String>> map = new HashMap<> ();
|
||||
|
||||
List<Line> deptLines = lineMapper.getLineBySubstationRelation(devDataType);
|
||||
Map<String, List<String>> collect = deptLines.stream ( ).collect (Collectors.groupingBy (Line::getPids, Collectors.mapping (Line::getId,Collectors.toList ())));
|
||||
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDetailDataVO> getLineDetailList(List<String> lineIds){
|
||||
|
||||
return lineDetailMapper.getLineDetailInfo(lineIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户选择的时间区间返回月份日期
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user