diff --git a/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java b/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java index db0914f..15fa814 100644 --- a/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java +++ b/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java @@ -626,7 +626,6 @@ public class NettyServerHandler extends SimpleChannelInboundHandler> items = (List>) map.get("Items"); for (Map item : items) { AlarmLog alarmLog = BeanUtil.toBean(item, AlarmLog.class); - alarmLog.setAlarmSourceType("1"); String patroldeviceCode = alarmLog.getPatroldeviceCode(); List substationPatroldevices = nettyServerHandler.substationPatroldeviceService.list(new LambdaQueryWrapper().eq(SubstationPatroldevice::getPatroldeviceCode, patroldeviceCode)); diff --git a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java index dfe59b8..f6e7aed 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java @@ -35,6 +35,8 @@ import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.URLDecoder; import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; @@ -203,12 +205,14 @@ public class AlgorithmArrangeController { map.put("stationName", algorithmArrange.getStationName()); Map businessTypeMap = sysDictionaryItemsService.getDeviceMapByType("businessType"); Map stationTypeMap = sysDictionaryItemsService.getDeviceMapByType("stationType"); - JSONObject businessTypeJSON= JSONUtil.parseObj(businessTypeMap.get("resultMap")); - JSONObject stationTypeJSON= JSONUtil.parseObj(stationTypeMap.get("resultMap")); - String businessType = StrUtil.isNotBlank(algorithmArrange.getBusinessType()) ? businessTypeJSON.getStr(algorithmArrange.getBusinessType()) : ""; - String stationType = StrUtil.isNotBlank(algorithmArrange.getStationType()) ? stationTypeJSON.getStr(algorithmArrange.getStationType()) : ""; + JSONObject businessTypeJSON = JSONUtil.parseObj(businessTypeMap.get("resultMap")); + JSONObject stationTypeJSON = JSONUtil.parseObj(stationTypeMap.get("resultMap")); + String businessType = StrUtil.isNotBlank(algorithmArrange.getBusinessType()) ? + businessTypeJSON.getStr(algorithmArrange.getBusinessType()) : ""; + String stationType = StrUtil.isNotBlank(algorithmArrange.getStationType()) ? + stationTypeJSON.getStr(algorithmArrange.getStationType()) : ""; map.put("stationType", stationType); - map.put("businessType",businessType); + map.put("businessType", businessType); map.put("voltLevel", algorithmArrange.getVoltLevel()); map.put("status", "完成"); map.put("date", DateUtil.now()); @@ -243,7 +247,7 @@ public class AlgorithmArrangeController { "")).getPath() + "templates" + File.separator + "布点报告模板.docx"; XWPFTemplate compile = XWPFTemplate.compile(path, config); XWPFTemplate template = compile.render(map); -// template.write(new FileOutputStream("E:\\巡视报告模板.docx")); + // template.write(new FileOutputStream("E:\\巡视报告模板.docx")); response.setContentType("application/octet-stream"); response.setHeader("Content-disposition", "attachment;filename=reportTemp.docx"); @@ -255,6 +259,113 @@ public class AlgorithmArrangeController { PoitlIOUtils.closeQuietlyMulti(template, bos, out); } + @PostMapping("/createArrangeById") + @ApiOperation("创建布点报告") + public ResponseResult exportArrangeById(String id) throws IOException { + Map map = new HashMap<>(); + AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id); + map.put("arrangeName", algorithmArrange.getArrangeName()); + map.put("stationName", algorithmArrange.getStationName()); + Map businessTypeMap = sysDictionaryItemsService.getDeviceMapByType("businessType"); + Map stationTypeMap = sysDictionaryItemsService.getDeviceMapByType("stationType"); + JSONObject businessTypeJSON = JSONUtil.parseObj(businessTypeMap.get("resultMap")); + JSONObject stationTypeJSON = JSONUtil.parseObj(stationTypeMap.get("resultMap")); + String businessType = StrUtil.isNotBlank(algorithmArrange.getBusinessType()) ? + businessTypeJSON.getStr(algorithmArrange.getBusinessType()) : ""; + String stationType = StrUtil.isNotBlank(algorithmArrange.getStationType()) ? + stationTypeJSON.getStr(algorithmArrange.getStationType()) : ""; + map.put("stationType", stationType); + map.put("businessType", businessType); + map.put("voltLevel", algorithmArrange.getVoltLevel()); + map.put("status", "完成"); + map.put("date", DateUtil.now()); + List> arrangeDeviceInfo = algorithmArrangeDeviceService.getArrangeDeviceInfo(id); + arrangeDeviceInfo.forEach(a -> { + // 图片流 + a.put("index", arrangeDeviceInfo.indexOf(a) + 1); + }); + try { + + String arrangeImageUrl = algorithmArrange.getArrangeImageUrl(); + if (StrUtil.isNotBlank(arrangeImageUrl)) { + map.put("img", + Pictures.ofStream(Files.newInputStream(new File(httpServerConfig.getPlanFilePath() + arrangeImageUrl).toPath()), FileUtil.getPictureType(arrangeImageUrl)).fitSize().create()); + } + + } catch (Exception e) { + log.error(e.getMessage()); + } + List> demo = getMapData(); + //创建一个列表的规则 + HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy(); + //设置列表配置,如果有多个列表时需加.bind("list1", policy) 新列表配置即可 + Configure config = Configure.builder().bind("list", policy).build(); + if (!arrangeDeviceInfo.isEmpty()) { + map.put("list", arrangeDeviceInfo); + } else { + map.put("list", demo); + } + // 加载模板渲染数据 + String path = Objects.requireNonNull(Objects.requireNonNull(ClassUtils.getDefaultClassLoader()).getResource( + "")).getPath() + "templates" + File.separator + "布点报告模板.docx"; + XWPFTemplate compile = XWPFTemplate.compile(path, config); + XWPFTemplate template = compile.render(map); + String fileName = "report" + File.separator + id + ".docx"; + String filePath = httpServerConfig.getPlanFilePath() + fileName; + Path reportPath = Paths.get(filePath); + // 确保父目录存在,如果不存在则创建 + Files.createDirectories(reportPath.getParent()); + template.write(Files.newOutputStream(reportPath)); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(AlgorithmArrange::getId, id).set(AlgorithmArrange::getCustom2, fileName); + algorithmArrangeService.update(updateWrapper); + return ResponseResult.success(); + } + + @GetMapping("/downloadArrangeReport") + @ApiOperation("下载布点报告") + public void downloadArrangeReport(String id, HttpServletResponse response) { + try { + AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id); + String fileName = algorithmArrange.getCustom2(); + if (StrUtil.isBlank(fileName)) { + return; + } + // 构建文件路径 + String filePath = httpServerConfig.getPlanFilePath() + fileName; + File file = new File(filePath); + + if (!file.exists()) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "报告文件不存在"); + return; + } + + // 设置响应头 + response.setContentType("application/octet-stream"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + id + ".docx\""); + + // 输出文件流到响应 + try (InputStream inputStream = Files.newInputStream(file.toPath()); + OutputStream out = response.getOutputStream()) { + + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + out.write(buffer, 0, bytesRead); + } + out.flush(); + } + + } catch (Exception e) { + log.error("下载报告失败:{}", e.getMessage(), e); + try { + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "下载失败:" + e.getMessage()); + } catch (IOException ex) { + log.error("发送错误响应失败:{}", ex.getMessage()); + } + } + } + private List> getMapData() { List> demo = new ArrayList<>(); Map map = new HashMap<>(); diff --git a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java index 5ae5ac6..4cc8108 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java @@ -6,9 +6,7 @@ import com.yfd.platform.modules.algorithm.domain.AlgorithmArrangeDevice; import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeDeviceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; @@ -31,12 +29,23 @@ public class AlgorithmArrangeDeviceController { private IAlgorithmArrangeDeviceService algorithmArrangeDeviceService; @GetMapping("/getArrangeDeviceInfo") - @ApiOperation("查询当前布点的主设备数量") + @ApiOperation("查询布点区域的设备数量") public ResponseResult getArrangeDeviceInfo(String arrangeId) { List> maps = algorithmArrangeDeviceService.getArrangeDeviceInfo(arrangeId); return ResponseResult.successData(maps); } + @PostMapping("/saveBatchArrange") + @ApiOperation("批量保存或修改布点数据") + public ResponseResult saveBatchArrange(@RequestBody List algorithmArrangeDevices) { + boolean b = algorithmArrangeDeviceService.saveOrUpdateBatch(algorithmArrangeDevices); + if (b) { + return ResponseResult.success(); + } else { + return ResponseResult.error(); + } + } + @GetMapping("/getArrangeDeviceById") @ApiOperation("根据ID查询当前布点详情") public ResponseResult getArrangeDeviceById(String arrangeId) { diff --git a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/domain/AlgorithmClass.java b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/domain/AlgorithmClass.java index 840d602..1bd3719 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/domain/AlgorithmClass.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/domain/AlgorithmClass.java @@ -3,6 +3,7 @@ package com.yfd.platform.modules.algorithm.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import java.io.Serializable; import io.swagger.annotations.ApiModel; @@ -57,5 +58,9 @@ public class AlgorithmClass implements Serializable { @ApiModelProperty("服务地址") private String serviceAddress; - + /** + * 类型,1:故障预警;2:故障诊断,3:健康评估 + */ + @ApiModelProperty("类型,1:故障预警;2:故障诊断,3:健康评估") + private String algorithmType; } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/service/impl/AlgorithmParamsServiceImpl.java b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/service/impl/AlgorithmParamsServiceImpl.java index bd59268..b1075dc 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/service/impl/AlgorithmParamsServiceImpl.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/service/impl/AlgorithmParamsServiceImpl.java @@ -1,6 +1,7 @@ package com.yfd.platform.modules.algorithm.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.net.NetUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -11,9 +12,14 @@ import com.yfd.platform.modules.algorithm.mapper.AlgorithmDeviceMapper; import com.yfd.platform.modules.algorithm.mapper.AlgorithmLogsMapper; import com.yfd.platform.modules.algorithm.mapper.AlgorithmParamsMapper; import com.yfd.platform.modules.algorithm.service.IAlgorithmParamsService; +import com.yfd.platform.modules.basedata.domain.Substation; import com.yfd.platform.modules.basedata.domain.SubstationComponent; import com.yfd.platform.modules.basedata.mapper.SubstationComponentMapper; +import com.yfd.platform.modules.basedata.mapper.SubstationMapper; +import com.yfd.platform.modules.patroltask.domain.AlarmLog; +import com.yfd.platform.modules.patroltask.mapper.AlarmLogMapper; import com.yfd.platform.utils.HttpRESTfulUtils; +import com.yfd.platform.utils.SecurityUtils; import com.yfd.platform.utils.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -21,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.net.URI; import java.net.URISyntaxException; +import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; @@ -28,7 +35,7 @@ import java.util.Map; /** *

- * 服务实现类 + * 服务实现类 *

* * @author zhengsl @@ -46,9 +53,15 @@ public class AlgorithmParamsServiceImpl extends ServiceImpl> mapList = algorithmParamsMapper.getAnalyseParams(id, componentId); - if (mapList.size() <= 0) { - return null; + if (mapList.isEmpty()) { + return new JSONObject(); } Map senData = new HashMap<>(); for (Map map : mapList) { @@ -152,6 +165,14 @@ public class AlgorithmParamsServiceImpl extends ServiceImpl senData) { + + Substation substation = + substationMapper.selectOne(new LambdaQueryWrapper().eq(Substation::getStationCode, + component.getStationCode())); + AlarmLog alarmLog = new AlarmLog(); + alarmLog.setStationCode(component.getStationCode()); + if (substation != null) { + // 注意:这里原代码用了 stationCode 当 stationId,可能需要修正 + alarmLog.setStationId(substation.getStationId()); + } + alarmLog.setStationName(component.getStationName()); + alarmLog.setAreaId(component.getAreaId()); + alarmLog.setAreaName(component.getAreaName()); + alarmLog.setBayId(component.getBayId()); + alarmLog.setBayName(component.getBayName()); + alarmLog.setMainDeviceId(component.getMainDeviceId()); + alarmLog.setMainDeviceName(component.getMainDeviceName()); + alarmLog.setMaterialId(component.getMaterialId()); + alarmLog.setComponentId(component.getComponentId()); + alarmLog.setComponentName(component.getComponentName()); + alarmLog.setValue(JSONObject.toJSONString(senData)); // 推荐转为 JSON 字符串 + alarmLog.setContent(desc + ":" + description); + alarmLog.setAlarmDate(DateUtil.now()); + alarmLog.setAlarmLevel("3"); + alarmLog.setTaskAlarmType("4"); + alarmLog.setCheckFlag("0"); + alarmLog.setDatastatus("1"); + + // 设置告警来源类型 + if ("1".equals(algorithmClass.getAlgorithmType())) { + alarmLog.setTaskAlarmType("5"); + } else if ("2".equals(algorithmClass.getAlgorithmType())) { + alarmLog.setTaskAlarmType("6"); + } + alarmLog.setLastmodifier(SecurityUtils.getCurrentUsername()); + alarmLog.setLastmodifydate(new Timestamp(System.currentTimeMillis())); + + return alarmLog; + } + } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AlarmLogController.java b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AlarmLogController.java index 58d985c..cfb39b3 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AlarmLogController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AlarmLogController.java @@ -3,6 +3,7 @@ package com.yfd.platform.modules.patroltask.controller; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; @@ -49,7 +50,6 @@ import java.util.stream.Collectors; * 告警日志表 前端控制器 *

* - * * @since 2023-05-03 */ @RestController @@ -95,12 +95,13 @@ public class AlarmLogController { if (StrUtil.isBlank(stationId)) { return ResponseResult.successData(null); } - List list =alarmLogService.getNotCheckAlarmCount(stationId); -// String[] split = stationId.split(","); -// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); -// queryWrapper.eq(AlarmLog::getDatastatus, "1").in(AlarmLog::getStationId, Arrays.asList(split)).eq(AlarmLog::getCheckFlag -// , 0).orderByDesc(AlarmLog::getAlarmDate); -// List list = alarmLogService.list(queryWrapper); + List list = alarmLogService.getNotCheckAlarmCount(stationId); + // String[] split = stationId.split(","); + // LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // queryWrapper.eq(AlarmLog::getDatastatus, "1").in(AlarmLog::getStationId, Arrays.asList(split)).eq + // (AlarmLog::getCheckFlag + // , 0).orderByDesc(AlarmLog::getAlarmDate); + // List list = alarmLogService.list(queryWrapper); Map map = new HashMap<>(); map.put("count", list.size()); map.put("notCheck", list); @@ -125,7 +126,8 @@ public class AlarmLogController { } List idList = Arrays.asList(stationId.split(",")); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.in(AlarmLog::getStationId, idList).isNotNull(AlarmLog::getAlarmLevel).eq(AlarmLog::getDatastatus, "1").select(AlarmLog::getId, + queryWrapper.in(AlarmLog::getStationId, idList).isNotNull(AlarmLog::getAlarmLevel).eq(AlarmLog::getDatastatus + , "1").select(AlarmLog::getId, AlarmLog::getContent, AlarmLog::getAlarmLevel, AlarmLog::getAlarmDate, AlarmLog::getStationName); List> maps = alarmLogService.listMaps(queryWrapper); Map>> alarmLevel = maps.stream().collect(Collectors.groupingBy(m -> m.get( @@ -188,25 +190,36 @@ public class AlarmLogController { return ResponseResult.successData(alarmList); } + // @GetMapping("/getAlarmLogPage") + // @ApiOperation("根据设备编号查询告警列表") + // public ResponseResult getAlarmLogPage(Page> page,) { + // + // return ResponseResult.successData(null); + // } + @GetMapping("/getAlarmLogPage") @ApiOperation("告警信息确认分页") public ResponseResult getAlarmLogPage(Page> page, String stationCode, String taskAlarmType, - String alarmLevel, String checkFlag,String alarmSourceType, String startDate, String endDate) { + String alarmLevel, String checkFlag, String alarmSourceType, + String startDate, String endDate) { if (StrUtil.isBlank(stationCode)) { return ResponseResult.successData(page); } Page> alarmList = alarmLogService.getAlarmLogPage(page, stationCode, taskAlarmType, - alarmLevel, checkFlag,alarmSourceType, startDate, endDate); + alarmLevel, checkFlag, alarmSourceType, startDate, endDate); List> records = alarmList.getRecords(); records.forEach(r -> { - String patroldeviceCode = r.get("patroldeviceCode").toString(); - LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); - queryWrapper1.eq(DeviceChannel::getDeviceid, patroldeviceCode).select(DeviceChannel::getDeviceid, - DeviceChannel::getChannelid); - List> channelList = deviceChannelService.listMaps(queryWrapper1); - if (channelList != null && channelList.size() > 0) { - r.put("channelList", channelList); + String patroldeviceCode = ObjectUtil.isNotEmpty(r.get("patroldeviceCode")) ? + r.get("patroldeviceCode").toString() : ""; + if (StrUtil.isNotBlank(patroldeviceCode)) { + LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); + queryWrapper1.eq(DeviceChannel::getDeviceid, patroldeviceCode).select(DeviceChannel::getDeviceid, + DeviceChannel::getChannelid); + List> channelList = deviceChannelService.listMaps(queryWrapper1); + if (channelList != null && !channelList.isEmpty()) { + r.put("channelList", channelList); + } } }); alarmList.setRecords(records); @@ -267,7 +280,8 @@ public class AlarmLogController { @ApiOperation("根据机器人编号查询告警历史(前20条)") public ResponseResult getAlarmHistory(String patroldeviceCode) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(AlarmLog::getPatroldeviceCode, patroldeviceCode).select(AlarmLog::getAlarmDate,AlarmLog::getContent).orderByDesc(AlarmLog::getAlarmDate).last("LIMIT 20"); + queryWrapper.eq(AlarmLog::getPatroldeviceCode, patroldeviceCode).select(AlarmLog::getAlarmDate, + AlarmLog::getContent).orderByDesc(AlarmLog::getAlarmDate).last("LIMIT 20"); List> mapList = alarmLogService.listMaps(queryWrapper); return ResponseResult.successData(mapList); } @@ -279,7 +293,6 @@ public class AlarmLogController { return ResponseResult.successData(alarmLog); } - @GetMapping("/getConfirmationRate") @ApiOperation("告警准确率统计") public ResponseResult getConfirmationRate(String stationId) { @@ -289,7 +302,7 @@ public class AlarmLogController { @GetMapping("/sendAlarmById") @ApiOperation("发送报警") - public ResponseResult sendAlarmById(String stationId,String id) { + public ResponseResult sendAlarmById(String stationId, String id) { AlarmLog alarmLog = alarmLogService.getById(id); JSONObject jsonObject = JSONUtil.parseObj(alarmLog); TaskResult taskResult = taskResultMapper.selectById(alarmLog.getTaskResultId()); @@ -340,7 +353,7 @@ public class AlarmLogController { } status.put("sendExcelData", "1"); ExecutorService executorService = Executors.newFixedThreadPool(1); - executorService.submit(()->{ + executorService.submit(() -> { try { processExcelWithSending("D:\\riis\\video\\excel\\" + fileName); } catch (Exception e) { diff --git a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/domain/AlarmLog.java b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/domain/AlarmLog.java index ef7d9fd..cfba369 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/domain/AlarmLog.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/domain/AlarmLog.java @@ -309,8 +309,4 @@ public class AlarmLog implements Serializable { */ private String region; - /** - * 报警来源类型(1:智巡;2:辅控) - */ - private String alarmSourceType; } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java index ac47f03..e1400fa 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java @@ -712,7 +712,6 @@ public class AlarmLogServiceImpl extends ServiceImpl i alarmLog.setAreaName(taskResult.getAreaName()); alarmLog.setBayId(taskResult.getBayId()); alarmLog.setBayName(taskResult.getBayName()); - alarmLog.setAlarmSourceType("1"); alarmLog.setMainDeviceId(taskResult.getMainDeviceId()); alarmLog.setMainDeviceName(taskResult.getMainDeviceName()); alarmLog.setComponentId(taskResult.getComponentId()); @@ -1764,7 +1763,6 @@ public class AlarmLogServiceImpl extends ServiceImpl i alarmLog.setComponentName(taskResult.getComponentName()); alarmLog.setDeviceId(taskResult.getDeviceId()); alarmLog.setDeviceName(taskResult.getDeviceName()); - alarmLog.setAlarmSourceType("1"); alarmLog.setPatroldeviceCode(taskResult.getPatroldeviceCode()); alarmLog.setPatroldeviceName(taskResult.getPatroldeviceName()); alarmLog.setMaterialId(taskResult.getMaterialId()); @@ -1986,7 +1984,6 @@ public class AlarmLogServiceImpl extends ServiceImpl i if ("2000".equals(code)) { Thread.sleep(1500);//延迟1.5秒 AlarmLog alarmLog = new AlarmLog(); - alarmLog.setAlarmSourceType("1"); alarmLog.setId(IdUtil.fastSimpleUUID()); //摄像机ID String deviceid = jsonObject.getStr("requestId"); diff --git a/riis-system/src/main/resources/mapper/patroltask/AlarmLogMapper.xml b/riis-system/src/main/resources/mapper/patroltask/AlarmLogMapper.xml index cc45a39..53a5d02 100644 --- a/riis-system/src/main/resources/mapper/patroltask/AlarmLogMapper.xml +++ b/riis-system/src/main/resources/mapper/patroltask/AlarmLogMapper.xml @@ -79,7 +79,7 @@ SELECT id, station_id, - alarm_source_type, + task_alarm_type, content, alarm_level alarm_level, alarm_date @@ -144,7 +144,6 @@ al.notice_linkages, al.alarm_class, al.region, - al.alarm_source_type, tr.patroldevice_code deviceId, tr.patroldevice_channelcode channelId, tr.patroldevice_pos patroldevicePos, @@ -240,9 +239,6 @@ AND al.check_flag = #{checkFlag} - - AND al.alarm_source_type = #{alarmSourceType} - and al.alarm_date >= #{startDate} @@ -250,8 +246,6 @@ and al.alarm_date < DATE_ADD(#{endDate}, INTERVAL 1 DAY) ORDER BY al.alarm_date DESC - -