Merge remote-tracking branch 'origin/main'

This commit is contained in:
hzj
2025-12-16 16:23:57 +08:00
15 changed files with 56 additions and 19 deletions

View File

@@ -47,4 +47,7 @@ public class DeptGetLineParam {
@ApiModelProperty("监测点运行状态")
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
private Integer lineRunFlag;
@ApiModelProperty("搜索值")
private String searchValue;
}

View File

@@ -264,7 +264,11 @@ public class CommTerminalServiceImpl implements CommTerminalService {
public List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam) {
List<DeptGetSubStationDTO.Info> result = new ArrayList<>();
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()), deptGetLineParam.getPowerFlag(), deptGetLineParam.getLineRunFlag(), deptGetLineParam.getIsUpToGrid());
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()),
deptGetLineParam.getPowerFlag(),
deptGetLineParam.getLineRunFlag(),
deptGetLineParam.getIsUpToGrid(),
deptGetLineParam.getSearchValue());
Map<String, List<TerminalGetBase.Extend>> orgSub = anExtends.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
Map<String, String> deptNameMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
temDept.forEach(item -> {

View File

@@ -350,8 +350,10 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
Map<String, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
List<DeviceRunEvaluateVO.Detail> info = new ArrayList<>();
List<Integer> devRun=ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag());
param.setLineRunFlag(null);
//获取终端台账类信息
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag()), Arrays.asList(1));
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, devRun, Arrays.asList(1));
if (CollUtil.isNotEmpty(deviceInfo)) {
List<String> deviceIds = deviceInfo.stream()
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())

View File

@@ -82,7 +82,7 @@ public class RunManageServiceImpl implements RunManageService {
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
deviceInfoParam.setServerName("pqs-common");
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0,1,2).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
lineIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getLineIndexes().stream()).collect(Collectors.toList());
}
if (!CollectionUtils.isEmpty(lineIndexes)) {

View File

@@ -339,10 +339,10 @@
</if>
<if test="searchValue != '' and searchValue != null ">
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
AND sub.NAME LIKE #{searchValueLike}
AND (sub.NAME LIKE #{searchValueLike}
OR dev.NAME LIKE #{searchValueLike}
OR devT.Name LIKE #{searchValueLike}
OR device.IP LIKE #{searchValueLike}
OR device.IP LIKE #{searchValueLike})
</if>
ORDER BY
gdName,

View File

@@ -36,8 +36,10 @@ public class OnLineRateServiceImpl extends ServiceImpl<OnLineRateMapper, RStatOn
@Override
public DeviceOnlineRate deviceOnlineRateInfo(DeviceInfoParam.BusinessParam param) {
DeviceOnlineRate rate = new DeviceOnlineRate();
List<Integer> devRun = ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag());
param.setLineRunFlag(null);
//获取终端台账类信息
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag()), Arrays.asList(1));
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, devRun, Arrays.asList(1));
if (CollUtil.isNotEmpty(deviceInfo)) {
List<String> deviceIds = deviceInfo.stream()
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())

View File

@@ -81,7 +81,8 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType,
@Param("powerFlag")Integer powerFlag,
@Param("lineRunFlag") Integer lineRunFlag,
@Param("monitorFlag") Integer monitorFlag
@Param("monitorFlag") Integer monitorFlag,
@Param("searchValue") String searchValue
);
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,

View File

@@ -194,6 +194,12 @@
<if test="monitorFlag!=null ">
and lineDetail.Monitor_Flag = #{monitorFlag}
</if>
<if test="searchValue != '' and searchValue != null ">
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
AND (substation.name LIKE #{searchValueLike}
OR point.NAME LIKE #{searchValueLike}
)
</if>
</select>
<select id="getLineIdByDeptIds" resultType="string">
select

View File

@@ -294,7 +294,7 @@
#{item.id}
</foreach>
</if>
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.lineOrDevice==0">
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.searchValue!='' and deviceInfoParam.lineOrDevice==0">
AND t1.name like CONCAT(CONCAT('%', #{deviceInfoParam.searchValue}), '%')
</if>
<!-- xy -->
@@ -344,7 +344,7 @@
#{item.id}
</foreach>
</if>
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.lineOrDevice==1">
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.searchValue!='' and deviceInfoParam.lineOrDevice==1">
AND t1.name like CONCAT(CONCAT('%', #{deviceInfoParam.searchValue}), '%')
</if>
<if test="devIds!=null and devIds.size()!=0">

View File

@@ -115,7 +115,7 @@ public interface DeptLineService extends IService<DeptLine> {
Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devType);
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag,Integer lineRunFlag,Integer monitorFlag);
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag,Integer lineRunFlag,Integer monitorFlag,String searchValue);
List<SubGetBase> getSubStationList(SubstationParam substationParam);

View File

@@ -35,6 +35,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -81,6 +82,15 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
detailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
.set(LineDetail::getActualArea, data.getArea())
.in(LineDetail::getId, lineIds));
} else {
List<String> deptList = Arrays.asList("130700000000", "130300000000", "130800000000", "130200000000", "131000000000");
Dept data = deptFeignClient.getDeptById(deptLineParam.getId()).getData();
if (deptList.contains(data.getArea())) {
List<String> lineIds = list.stream().map(LineDetail::getId).collect(Collectors.toList());
detailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
.set(LineDetail::getActualArea, data.getArea())
.in(LineDetail::getId, lineIds));
}
}
}
this.saveBatch(deptLines);
@@ -182,8 +192,13 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
}
@Override
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType, Integer powerFlag, Integer lineRunFlag,Integer monitorFlag) {
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag,monitorFlag);
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,
Integer powerFlag,
Integer lineRunFlag,
Integer monitorFlag,
String searchValue
) {
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag,monitorFlag,searchValue);
}
@Override

View File

@@ -55,10 +55,10 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
@Override
public AreaAnalysisVO getEventReason(DeviceInfoParam.BusinessParam deviceInfoParam) {
//获取暂降字典信息
// DictData voltageData = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
// if(ObjectUtil.isNull(voltageData)){
// throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
// }
DictData voltageData = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
if(ObjectUtil.isNull(voltageData)){
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
}
AreaAnalysisVO areaAnalysisVO = new AreaAnalysisVO();
List<DictData> dicReasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData();
List<DictData> dicTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData();
@@ -67,11 +67,11 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
List<String> lineIds = getAllLineIdList(generalDeviceDTOList);
//查询数据
// List<AreaAnalysisVO.Children> reasonList = assData(dicReasonList, lineIds, deviceInfoParam.getSearchBeginTime(), deviceInfoParam.getSearchEndTime(), "event_reason");
// List<AreaAnalysisVO.Children> reasonList = assData(dicReasonList, lineIds, deviceInfoParam.getSearchBeginTime(), deviceInfoParam.getSearchEndTime(), "event_reason");
List<RmpEventDetailPO> info = eventDetailService.list(new QueryWrapper<RmpEventDetailPO>()
.select("advance_reason,advance_type,count(event_id) as count")
.in("measurement_point_id", lineIds)
// .eq("event_type", voltageData.getId())
.eq("event_type", voltageData.getId())
.in("advance_reason", dicReasonList.stream().map(DictData::getId).collect(Collectors.toList()))
.in("advance_type", dicTypeList.stream().map(DictData::getId).collect(Collectors.toList()))
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()),"start_time" ,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))

View File

@@ -123,7 +123,8 @@ public class PollutionSubstationController extends BaseController {
public HttpResult<List<SubstationVo>> getSubstationInfo(@RequestParam(value = "deptIndex") String deptIndex,
@RequestParam(value = "searchValue",required=false) String searchValue,
@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "endTime") String endTime) {
@RequestParam(value = "endTime") String endTime
) {
String methodDescribe = getMethodDescribe("getSubstationInfo");
LogUtil.njcnDebug(log, "{},实体参数:{},{}", methodDescribe, deptIndex, searchValue);
List<SubstationVo> list = pollutionSubstationService.getSubstationInfo(deptIndex,searchValue,startTime,endTime);

View File

@@ -948,6 +948,7 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
deptGetLineParam.setDeptId(deptIndex);
deptGetLineParam.setMonitorStateRunning(false);
deptGetLineParam.setSearchValue(searchValue);
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
List<String> lineIds = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).flatMap(x -> x.getUnitChildrenList().stream()).distinct().collect(Collectors.toList());

View File

@@ -72,10 +72,12 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
List<Dept> data = deptFeignClient.getDirectSonSelf(param.getId()).getData();
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
deptGetLineParam.setDeptId(param.getId());
deptGetLineParam.setMonitorStateRunning(false);
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
List<String> lineIDS = deptGetChildrenMoreDTOS.stream()
.flatMap(x -> x.getStationIds().stream().flatMap(l -> l.getUnitChildrenList().stream()))
.distinct()
.collect(Collectors.toList());
//根据r_stat_limit_target_d来判断是否告警allTime flicker_overtime