Commit b21e56ff authored by tianbo's avatar tianbo

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/MsgLogServiceImpl.java
parents c45b18cd 50e06241
...@@ -113,4 +113,17 @@ public class MsgLogController extends BaseController { ...@@ -113,4 +113,17 @@ public class MsgLogController extends BaseController {
public ResponseModel<List<MsgLogDto>> selectForList() { public ResponseModel<List<MsgLogDto>> selectForList() {
return ResponseHelper.buildResponse(msgLogServiceImpl.queryForMsgLogList()); return ResponseHelper.buildResponse(msgLogServiceImpl.queryForMsgLogList());
} }
/**
* 告警数量统计
*
* @return Integer
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "告警数量统计", notes = "告警数量统计")
@GetMapping(value = "/count")
public ResponseModel<Integer> countByTerminalType(
@RequestParam(value = "terminalType",required = false) String terminalType) {
return ResponseHelper.buildResponse(msgLogServiceImpl.countByTerminalType(terminalType));
}
} }
\ No newline at end of file
...@@ -680,7 +680,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -680,7 +680,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
public List<AlertPaperInfoDto> getAlertPaperInfoList(List<String> regionCodes, Boolean isHistory) { public List<AlertPaperInfoDto> getAlertPaperInfoList(List<String> regionCodes, Boolean isHistory) {
List<AlertPaperInfoDto> temp = baseMapper.getAlertPaperInfoList(regionCodes, isHistory); List<AlertPaperInfoDto> temp = baseMapper.getAlertPaperInfoList(regionCodes, isHistory);
temp.stream().forEach(t -> { temp.forEach(t -> {
DispatchPaper paper = dispatchPaperService.getOne(new LambdaQueryWrapper<DispatchPaper>().eq(DispatchPaper::getIsDelete,false).eq(DispatchPaper::getAlertId,t.getAlertId())); DispatchPaper paper = dispatchPaperService.getOne(new LambdaQueryWrapper<DispatchPaper>().eq(DispatchPaper::getIsDelete,false).eq(DispatchPaper::getAlertId,t.getAlertId()));
if(paper != null) { if(paper != null) {
t.setFinishTime(paper.getFeedbackFinishTime()); t.setFinishTime(paper.getFeedbackFinishTime());
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertMsgDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertMsgDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MsgLogDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog; import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog;
import com.yeejoin.amos.boot.module.tzs.api.mapper.MsgLogMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.MsgLogMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IMsgLogService; import com.yeejoin.amos.boot.module.tzs.api.service.IMsgLogService;
import com.yeejoin.amos.boot.module.tzs.api.dto.MsgLogDto; import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
/** /**
...@@ -49,34 +51,42 @@ public class MsgLogServiceImpl extends BaseService<MsgLogDto,MsgLog,MsgLogMapper ...@@ -49,34 +51,42 @@ public class MsgLogServiceImpl extends BaseService<MsgLogDto,MsgLog,MsgLogMapper
return this.queryForList("" , false, terminalType); return this.queryForList("" , false, terminalType);
} }
public List<AlertMsgDto> queryForAlertMsg(List<String> regionCodes) { public List<AlertMsgDto> queryForAlertMsg(List<String> regionCodes) {
List<AlertMsgDto> alertMsgDtoList = Lists.newArrayList(); List<AlertMsgDto> alertMsgDtoList = Lists.newArrayList();
// 查询电梯警情预报消息 // 查询电梯警情预报消息
List<AlertPaperInfoDto> alertPaperInfoDtoList = List<AlertPaperInfoDto> alertPaperInfoDtoList =
alertCalledService.getAlertPaperInfoList(alertCalledService.authRegionCodeList(regionCodes),false); alertCalledService.getAlertPaperInfoList(alertCalledService.authRegionCodeList(regionCodes), false);
if (!ValidationUtil.isEmpty(alertPaperInfoDtoList)) { if (!ValidationUtil.isEmpty(alertPaperInfoDtoList)) {
alertPaperInfoDtoList.forEach(msg -> { alertPaperInfoDtoList.forEach(msg -> {
AlertMsgDto alertMsgDto = new AlertMsgDto(); AlertMsgDto alertMsgDto = new AlertMsgDto();
alertMsgDto.setBody(msg.getAddress()); alertMsgDto.setBody(msg.getAddress() + "发生" + msg.getAlarmType() + "事件");
alertMsgDto.setFrom("elevator"); alertMsgDto.setFrom("elevator");
alertMsgDto.setRelationId(String.valueOf(msg.getAlertId())); alertMsgDto.setRelationId(String.valueOf(msg.getAlertId()));
alertMsgDto.setTime(msg.getCallTime()); alertMsgDto.setTime(msg.getCallTime());
alertMsgDto.setType(msg.getAlarmType()); alertMsgDto.setType(msg.getAlarmType());
alertMsgDtoList.add(alertMsgDto);
}); });
} }
// 查询气瓶预警消息 // 查询气瓶预警消息
List<MsgLogDto> msgLogDtoList = queryForWebMsgLogList("WEB"); List<MsgLog> msgLogList = this.list(new LambdaQueryWrapper<MsgLog>().eq(MsgLog::getTerminalType, "WEB"));
if (!ValidationUtil.isEmpty(msgLogDtoList)) { if (!ValidationUtil.isEmpty(msgLogList)) {
msgLogDtoList.forEach(msg -> { msgLogList.forEach(msg -> {
AlertMsgDto alertMsgDto = new AlertMsgDto(); AlertMsgDto alertMsgDto = new AlertMsgDto();
alertMsgDto.setBody(msg.getBody()); alertMsgDto.setBody(msg.getBody());
alertMsgDto.setFrom("elevator"); alertMsgDto.setFrom("cylinder");
alertMsgDto.setRelationId(String.valueOf(msg.getSequenceNbr())); alertMsgDto.setRelationId(String.valueOf(msg.getSequenceNbr()));
alertMsgDto.setTime(msg.getSendTime()); alertMsgDto.setTime(msg.getSendTime());
alertMsgDto.setType(msg.getMsgTypeName()); alertMsgDto.setType(msg.getMsgTypeName());
alertMsgDtoList.add(alertMsgDto);
}); });
} }
return alertMsgDtoList; return alertMsgDtoList;
} }
public Integer countByTerminalType(String terminalType) {
return this.list(new LambdaQueryWrapper<MsgLog>().eq(StringUtils.isNotEmpty(terminalType), MsgLog::getTerminalType, terminalType)).size();
}
} }
\ No newline at end of file
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