1.调整终端周期检测功能

This commit is contained in:
2026-07-10 12:07:57 +08:00
parent def4c066fe
commit 4a04c8f764
11 changed files with 78 additions and 22 deletions

View File

@@ -21,6 +21,8 @@ public class TerminalCheckParam extends BaseParam {
private String objName;
private String city;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate thisCheckTime;

View File

@@ -48,4 +48,6 @@ public class TerminalMaintainVO implements Serializable {
private Integer strategyFlag;
@ApiModelProperty(name = "子级")
List<TerminalMaintainVO> children;
private String objName;
}

View File

@@ -3,6 +3,7 @@ package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
import com.njcn.device.pq.pojo.po.Alarm;
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
@@ -44,6 +45,6 @@ public interface AlarmMapper extends BaseMapper<Alarm> {
boolean updateAlarmInfo(@Param("type")String type,@Param("devLineId")String devLineId,@Param("processTime")LocalDateTime processTime,@Param("userIndex")String userIndex);
Page<TerminalCheckVO> terminalCheckPage(Page<TerminalCheckVO> page);
Page<TerminalCheckVO> terminalCheckPage(Page<TerminalCheckVO> page, @Param("terminalCheckParam")TerminalCheckParam terminalCheckParam);
}

View File

@@ -162,10 +162,10 @@ ORDER BY
SELECT
dev.id AS devId,
dev.NAME AS devName,
dept.NAME AS areaName,
users.city AS areaName,
bd.name AS bdName,
detail.obj_id AS objId,
detail.obj_name AS objName,
users.project_name AS objName,
dev_detail.this_time_check AS thisCheckTime,
dev_detail.next_time_check AS nextCheckTime,
dev_detail.login_time AS loginDate,
@@ -190,10 +190,17 @@ ORDER BY
INNER JOIN pq_line dev ON bus.pid = dev.id
INNER JOIN pq_device dev_detail ON dev.id = dev_detail.id
INNER JOIN pq_line bd ON dev.pid = bd.id
INNER JOIN pq_dept_line dept_line ON line.id = dept_line.line_id
INNER JOIN sys_dept dept ON dept_line.id = dept.id AND dept.type = 0
LEFT JOIN SUPERVISION_USER_REPORT_FILE files on detail.obj_id = files.id
order by overdueDay desc
LEFT JOIN SUPERVISION_USER_REPORT users ON users.id = detail.obj_id
LEFT JOIN SUPERVISION_USER_REPORT_FILE files on users.id = files.id
<where>
<if test="terminalCheckParam.city!=null and terminalCheckParam.city !=''">
users.city = #{terminalCheckParam.city}
</if>
<if test="terminalCheckParam.searchValue!=null and terminalCheckParam.searchValue !=''">
and users.project_name like concat('%',#{terminalCheckParam.searchValue},'%')
</if>
</where>
order by checkStatus desc,loginDate desc
</select>

View File

@@ -57,7 +57,7 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
@Override
public Page<TerminalCheckVO> terminalCheckPage(TerminalCheckParam terminalCheckParam) {
Page<TerminalCheckVO> page = new Page<>(PageFactory.getPageNum(terminalCheckParam),PageFactory.getPageSize(terminalCheckParam));
Page<TerminalCheckVO> pageResult = alarmMapper.terminalCheckPage(page);
Page<TerminalCheckVO> pageResult = alarmMapper.terminalCheckPage(page,terminalCheckParam);
return pageResult;
}
}

View File

@@ -209,18 +209,24 @@
<select id="getDeviceByIdOnOrOff" resultType="com.njcn.device.pq.pojo.vo.TerminalBaseVO">
SELECT
case when
t3.obj_id is not null and t3.obj_id !='' then t3.obj_name
else sub.name end subName,
SELECT distinct
case when
t4.obj_id is not null and t4.obj_id !='' then t4.obj_name
else sub.name end subName,
t1.id devId,t1.name devName,t2.ip,t2.dev_type,t2.update_time,gd.name gdName
FROM
pq_line t3,
pq_line_detail t4,
pq_line bus,
pq_line t1,
pq_device t2,
pq_line sub,
pq_line gd
WHERE
t1.id = t2.id
t3.id = t4.id
and t3.pid = bus.id
and bus.pid = t1.id
and t1.id = t2.id
and t1.pid = sub.id
and sub.pid = gd.id
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">

View File

@@ -24,6 +24,10 @@ public interface TerminalMaintainMapper {
*/
List<TerminalMaintainVO> getTerminalDevInfo(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
List<TerminalMaintainVO> terminalConfig(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
/**
* 获取区域
* @author cdf

View File

@@ -38,6 +38,35 @@
</if>
</select>
<select id="terminalConfig" resultType="TerminalMaintainVO">
SELECT distinct
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
a.id,
a.pid,
a.level,
b.run_flag,
b.ip,
b.com_flag,
b.dev_type devType
FROM
pq_line line
inner join pq_line_detail detail on line.id = detail.id
inner join pq_line bus on line.pid = bus.id
inner join pq_line a on bus.pid = a.id
INNER JOIN pq_device b ON a.id = b.id
where a.id in
<foreach collection="devIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="comFlag != null">
AND b.Com_Flag=#{comFlag}
</if>
<if test="devType !=null and devType != ''">
AND b.Dev_Type =#{devType}
</if>
</select>
<select id="getGdAndSubList" resultType="TerminalMaintainVO">
select id,name,level,pid from pq_line where level = #{level} and state = 1 order by sort
</select>
@@ -77,14 +106,17 @@
<select id="getRunFlagList" resultType="TerminalMaintainVO">
SELECT
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
a.id,
a.pid,
a.NAME,
b.ip,
a.level,
b.run_flag
FROM
pq_line a
pq_line line
inner join pq_line_detail detail on line.id = detail.id
inner join pq_line bus on line.pid = bus.id
inner join pq_line a on bus.pid = a.id
INNER JOIN pq_device b ON a.id = b.id
WHERE a.id in
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">

View File

@@ -3,6 +3,7 @@ package com.njcn.device.terminal.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.njcn.common.pojo.dto.SimpleDTO;
@@ -108,10 +109,13 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
terminalMaintainVO.setName(generalDeviceDTO.getName());
terminalMaintainVO.setId(generalDeviceDTO.getIndex());
terminalMaintainVO.setLevel(1);
List<TerminalMaintainVO> devList = terminalMaintainMapper.getTerminalDevInfo(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
List<TerminalMaintainVO> devList = terminalMaintainMapper.terminalConfig(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
if (CollectionUtil.isEmpty(devList)) {
continue;
}
List<String> subIndexes = devList.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
List<TerminalMaintainVO> subList1 = terminalMaintainMapper.getPqLineGdAndSubList(subIndexes);
List<String> gdIndexes = subList1.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());

View File

@@ -68,8 +68,6 @@ public class ComAssessServiceImpl extends ServiceImpl<RStatComassesDMapper, RSta
String systemType = commTerminalGeneralClient.isPqOrPms().getData();
if (systemType.equals("pq")) {
List<UserLedgerVO> userLedgerVOList = userLedgerFeignClient.selectUserList(new UserReportParam()).getData();
Map<String, UserLedgerVO> userLedgerVOMap = userLedgerVOList.stream().collect(Collectors.toMap(UserLedgerVO::getId, Function.identity()));
@@ -158,8 +156,8 @@ public class ComAssessServiceImpl extends ServiceImpl<RStatComassesDMapper, RSta
comAssessVOList.add(comAssessVO);
}
}
List<ComAssessVO> list = comAssessVOList.stream().sorted(Comparator.comparing(ComAssessVO::getData).reversed()).collect(Collectors.toList());
return list;
// List<ComAssessVO> list = comAssessVOList.stream().sorted(Comparator.comparing(ComAssessVO::getData).reversed()).collect(Collectors.toList());
return comAssessVOList;
} else {
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.RUN.getCode(), DicDataTypeEnum.LINE_STATE.getCode()).getData();
PmsDeviceInfoParam param = new PmsDeviceInfoParam();

View File

@@ -340,11 +340,11 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
list.add(pollutionVO);
}
}
if (!CollectionUtils.isEmpty(list)) {
/* if (!CollectionUtils.isEmpty(list)) {
List<PollutionVO> listSort = list.stream().filter(x -> x.getData() != 3.14159).sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList());
listSort.addAll(list.stream().filter(x -> x.getData() == 3.14159).collect(Collectors.toList()));
return listSort;
}
}*/
return list;
}