Commit 4bc11df9 authored by 王蔡翾's avatar 王蔡翾
Browse files

新增工单逻辑修改

parent 1d2b9e92
......@@ -141,14 +141,14 @@ public class BsWorkServiceImpl extends ServiceImpl <BsWorkMapper, BsWorkEntity>
if (bsProjectEntity!=null){
bsWorkDTO.setProjectId(bsProjectEntity.getId());
}
//先检查项目中是否存在相同错误,若存在则原来错误次数+1,不创建新工单,若不存在则创建工单
//先检查项目中是否存在相同错误且未处理的工单,若存在则原来错误次数+1,不创建新工单,若不存在则创建工单
QueryWrapper<BsWorkEntity> wrapper = new QueryWrapper<BsWorkEntity>()
.eq("project_id", bsWorkDTO.getProjectId());
if (bsWorkDTO.getDetail() != null) {
wrapper.eq("detail", bsWorkDTO.getDetail());
wrapper.eq("detail", bsWorkDTO.getDetail()).eq("待处理",bsWorkDTO.getStatus());
} else {
wrapper.isNull("detail");
wrapper.isNull("detail").eq("待处理",bsWorkDTO.getStatus());
}
BsWorkEntity bsWork = getOne(wrapper);
......
......@@ -54,7 +54,7 @@ public class ServerAlertTask {
bsWorkDTO.setDetail(projectServerAlertsVO.getDescription());
bsWorkDTO.setLoginName(user.getName());
bsWorkDTO.setHandleBy(schedule.getUserId());
bsWorkService.addWork(bsWorkDTO);
bsWorkService.addWorkByOperationTable(bsWorkDTO);
}
}
}
......
......@@ -33,7 +33,7 @@
bp.id as projectId
from project_server_alerts psa
left join bs_project bp on bp.ips like concat('%',psa.ip_address,'%') COLLATE utf8mb4_general_ci
where psa.alert_time >= #{time}
and psa.resolved = false
where psa.alert_time >= DATE_SUB(NOW(), INTERVAL 1 MINUTE)
and psa.resolved = false
</select>
</mapper>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment