1.公共方法新增变电站信息查询
2.调整技术监督变电站查询方法
This commit is contained in:
@@ -10,6 +10,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
@@ -336,6 +337,14 @@ public class CommTerminalController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new ArrayList<>(), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/tagOrIdGetSub")
|
||||
@ApiOperation("获取变电站信息")
|
||||
public HttpResult<List<SubGetBase>> tagOrIdGetSub(@RequestBody SubstationParam substationParam) {
|
||||
String methodDescribe = getMethodDescribe("tagOrIdGetSub");
|
||||
List<SubGetBase> subGetBases = commTerminalService.tagOrIdGetSub(substationParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subGetBases, methodDescribe);
|
||||
}
|
||||
/**
|
||||
* 获取监测点的台账详细信息
|
||||
* @author cdf
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@@ -77,4 +79,7 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType);
|
||||
|
||||
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("runFlag")List<Integer> runFlag,@Param("dataType")List<Integer> dataType);
|
||||
|
||||
|
||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||
}
|
||||
|
||||
@@ -137,4 +137,46 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectSubStationList" resultType="com.njcn.device.biz.pojo.dto.SubGetBase">
|
||||
select
|
||||
DISTINCT
|
||||
substation.id id,
|
||||
substation.name name,
|
||||
pq_dept_line.id orgId,
|
||||
sub.Scale voltageLevel
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
inner join pq_line substation on dev.pid = substation.id
|
||||
inner join pq_substation sub on sub.id = substation.id
|
||||
<where>
|
||||
device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
<if test="param.orgIds!=null and param.orgIds.size!=0">
|
||||
and pq_dept_line.id in
|
||||
<foreach collection="param.orgIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.powerIds!=null and param.powerIds.size!=0">
|
||||
and substation.id in
|
||||
<foreach collection="param.powerIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.powerName !=null and param.powerName!='' ">
|
||||
and substation.name like CONCAT(CONCAT('%', #{param.powerName}), '%')
|
||||
</if>
|
||||
<if test="param.powerVoltageLevel!=null and param.powerVoltageLevel.size!=0">
|
||||
and sub.Scale in
|
||||
<foreach collection="param.powerVoltageLevel" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -83,4 +84,6 @@ public interface CommTerminalService {
|
||||
|
||||
|
||||
List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
|
||||
@@ -107,6 +109,10 @@ public interface DeptLineService extends IService<DeptLine> {
|
||||
|
||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType);
|
||||
|
||||
List<SubGetBase> getSubStationList(SubstationParam substationParam);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点id集合查询部门信息id
|
||||
* @param ids 部门ids
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -7,12 +8,14 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -250,6 +253,22 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam) {
|
||||
List<SubGetBase> subStationList = deptLineService.getSubStationList(substationParam);
|
||||
if(CollUtil.isNotEmpty(subStationList)){
|
||||
List<String> ids = subStationList.stream().map(SubGetBase::getOrgId).collect(Collectors.toList());
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(ids).getData();
|
||||
Map<String, String> deptMap = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
subStationList.stream().forEach(x->{
|
||||
if(deptMap.containsKey(x.getOrgId())){
|
||||
x.setOrgName(deptMap.get(x.getOrgId()));
|
||||
}
|
||||
});
|
||||
}
|
||||
return subStationList;
|
||||
}
|
||||
|
||||
|
||||
private List<Integer> filterDataTypeNew(String serverName) {
|
||||
List<Integer> devType = new ArrayList<>();
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.device.pq.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
@@ -124,6 +126,11 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
return deptLineMapper.orgSubStationInfoGet(devType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubGetBase> getSubStationList(SubstationParam substationParam) {
|
||||
return deptLineMapper.selectSubStationList(substationParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeptLine getLineByLineIds(String ids) {
|
||||
return this.getOne(new LambdaQueryWrapper<DeptLine>()
|
||||
|
||||
Reference in New Issue
Block a user