feat(harmonic): 新增前置调试日志和事件统计功能

- 添加获取前置调试日志接口,支持按时间和关键词筛选
- 实现暂降原因和暂降类型统计数据查询功能
- 新增CsEventLogsVo和CsEventReasonAndTypeVo数据传输对象
- 优化事件查询逻辑,支持多等级告警筛选
- 修复设备交付服务中的空指针异常问题
- 移除设备使用状态修改的日志记录功能
- 更新事件用户服务中的前置信息显示逻辑
This commit is contained in:
xy
2026-06-13 11:33:31 +08:00
parent b2e9597839
commit ad7835f0db
14 changed files with 330 additions and 48 deletions

View File

@@ -19,7 +19,12 @@ public class CsLineDTO implements Serializable {
private String deviceId;
/**
* 装置id
* 装置名称
*/
private String deviceName;
/**
* 装置类型
*/
private String deviceType;

View File

@@ -57,7 +57,8 @@
<select id="findLineList" resultType="com.njcn.csdevice.pojo.dto.CsLineDTO">
SELECT
t1.*,
t2.dev_type deviceType
t2.dev_type deviceType,
t2.name deviceName
FROM
cs_line t1
LEFT JOIN cs_equipment_delivery t2 ON t1.device_id = t2.id

View File

@@ -24,7 +24,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.access.api.AskDeviceDataFeignClient;
import com.njcn.access.utils.MqttUtil;
import com.njcn.common.pojo.dto.DeviceLogDTO;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.csdevice.api.CsLedgerFeignClient;
import com.njcn.csdevice.constant.DataParam;
@@ -97,7 +96,7 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements CsEquipmentDeliveryService {
public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements CsEquipmentDeliveryService {
private final CsDevModelRelationService csDevModelRelationService;
private final ICsDataSetService csDataSetService;
private final ICsLedgerService csLedgerService;
@@ -260,12 +259,17 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
return result;
}
BeanUtils.copyProperties(csEquipmentDeliveryPO, result);
BeanUtils.copyProperties(csEquipmentDeliveryPO, result);
if (!Objects.isNull(csEquipmentDeliveryPO.getAssociatedEngineering()) && !Objects.equals(csEquipmentDeliveryPO.getAssociatedEngineering(), "")) {
result.setAssociatedEngineeringName(csLedgerService.findDataById(csEquipmentDeliveryPO.getAssociatedEngineering()).getName());
CsLedger csLedger = csLedgerService.findDataById(csEquipmentDeliveryPO.getAssociatedEngineering());
if (!Objects.isNull(csLedger)) {
result.setAssociatedEngineeringName(csLedger.getName());
}
}
if (!Objects.isNull(csEquipmentDeliveryPO.getAssociatedProject()) && !Objects.equals(csEquipmentDeliveryPO.getAssociatedProject(), "")) {
result.setAssociatedProjectName(csLedgerService.findDataById(csEquipmentDeliveryPO.getAssociatedProject()).getName());
CsLedger csLedger = csLedgerService.findDataById(csEquipmentDeliveryPO.getAssociatedProject());
if (!Objects.isNull(csLedger)) {
result.setAssociatedProjectName(csLedger.getName());
}
}
return result;
}
@@ -368,17 +372,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
csLedgerParam.setName(csEquipmentDeliveryAuditParm.getName());
csLedgerService.updateLedgerTree(csLedgerParam);
}
if (result) {
refreshDeviceDataCache();
if (!Objects.equals(po.getUsageStatus(), csEquipmentDeliveryAuditParm.getUsageStatus())) {
DeviceLogDTO dto = new DeviceLogDTO();
dto.setUserName(RequestUtil.getUsername());
dto.setOperate("设备使用状态被修改");
dto.setResult(1);
dto.setLoginName(RequestUtil.getLoginName());
csLogsFeignClient.addUserLog(dto);
}
}
return result;
}
@@ -1004,17 +997,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
csLedgerParam.setName(param.getName());
csLedgerService.updateLedgerTree(csLedgerParam);
}
if (result) {
refreshDeviceDataCache();
if (!Objects.equals(po.getUsageStatus(), param.getUsageStatus())) {
DeviceLogDTO dto = new DeviceLogDTO();
dto.setUserName(RequestUtil.getUsername());
dto.setOperate("设备使用状态被修改");
dto.setResult(1);
dto.setLoginName(RequestUtil.getLoginName());
csLogsFeignClient.addUserLog(dto);
}
}
//新增台账日志
CsTerminalLogs csTerminalLogs = new CsTerminalLogs();
csTerminalLogs.setDeviceId(csEquipmentDeliveryPo.getId());