Commit 2ca6c409 authored by helinlin's avatar helinlin

添加APP接口 警情通话录音文件地址字段

parent 34994fb4
......@@ -9,7 +9,10 @@ import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.service.IVoiceRecordFileService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -45,20 +48,6 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceI
import com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum;
......@@ -134,6 +123,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Autowired
OrgUsrServiceImpl orgUsrServiceImpl;
@Autowired
VoiceRecordFileServiceImpl voiceRecordFileService;
private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) {
int result = 0;
......@@ -184,7 +175,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
// }
public IPage<AlertCalled> queryForCalledList(Page pageBean, Integer alertStatus, String alertTypeCode,
String alertSourceCode, String startTime, String endTime, String sort,String isFatherAlert) {
String alertSourceCode, String startTime, String endTime, String sort, String isFatherAlert) {
String[] split = sort != null ? sort.split(",") : null;
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 start */
......@@ -212,11 +203,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
String lift = split != null ? split[1] : null;
List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus,
alertTypeCode, alertSourceCode, startTime, endTime, data, lift,isFatherAlert);
alertTypeCode, alertSourceCode, startTime, endTime, data, lift, isFatherAlert);
IPage<AlertCalled> iPage = new Page<>();
iPage.setRecords(list);
iPage.setTotal(
alertCalledMapper.selectAllCount(alertStatus, alertTypeCode, alertSourceCode, startTime, endTime,isFatherAlert));
alertCalledMapper.selectAllCount(alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, isFatherAlert));
//iPage.setSize(pageBean.getSize());
return iPage;
......@@ -376,7 +367,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
// 警情报送
// 调用规则 警情初报
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(), null,null,null);
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(), null, null, null);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
/**
......@@ -660,16 +651,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
String bellNum = bellNumSb.toString();
bellNum = bellNum.substring(0, bellNum.length() - 1);
String[] bellNums = bellNum.split(",");
for (int i = 0; i < bellNums.length; i++)
{
for (int i = 0; i < bellNums.length; i++) {
//打开15s后自动关闭
try
{
try {
jcsControlServerClient.sendBellActionWithTime(bellNums[i], "1", 15);
}
catch (Exception e)
{
logger.info("打开警铃【"+bellNums[i]+"】异常!");
} catch (Exception e) {
logger.info("打开警铃【" + bellNums[i] + "】异常!");
}
}
}
......@@ -688,22 +675,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
if (!ValidationUtil.isEmpty(northDoor)) {
ControllerDto controllerDto = northDoor.get(0);
// 打开北站车库门
try
{
try {
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1,1,1,1");
}
catch (Exception e)
{
logger.info("打开北站车库门【"+controllerDto.getIp()+"】异常!");
} catch (Exception e) {
logger.info("打开北站车库门【" + controllerDto.getIp() + "】异常!");
}
// 打开北站车库门弱电警铃
try
{
try {
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 107, "1");
}
catch (Exception e)
{
logger.info("打开北站弱电警铃【"+controllerDto.getIp()+"】异常!");
} catch (Exception e) {
logger.info("打开北站弱电警铃【" + controllerDto.getIp() + "】异常!");
}
}
/**
......@@ -713,22 +694,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
if (!ValidationUtil.isEmpty(southDoor)) {
ControllerDto controllerDto = southDoor.get(0);
// 打开南站车库门
try
{
try {
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1");
}
catch (Exception e)
{
logger.info("打开南站车库门【"+controllerDto.getIp()+"】异常!");
} catch (Exception e) {
logger.info("打开南站车库门【" + controllerDto.getIp() + "】异常!");
}
// 打开南站车库门弱电警铃
try
{
try {
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 107, "1");
}
catch (Exception e)
{
logger.info("打开南站弱电警铃【"+controllerDto.getIp()+"】异常!");
} catch (Exception e) {
logger.info("打开南站弱电警铃【" + controllerDto.getIp() + "】异常!");
}
}
......@@ -771,7 +746,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// 警情基本信息
AlertCalled alertCalled = this.getById(id);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<>();
map.put("title", "【" + alertCalled.getAlertType() + "】" + alertCalled.getAddress());
queryWrapper.eq("alert_called_id", id);
......@@ -806,10 +781,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
map.put("alertType", alertCalled.getAlertType());
map.put("address", alertCalled.getAddress());
map.put("contactUser", alertCalled.getContactUser());
map.put("contactPhone", alertCalled.getContactPhone());
map.put("callTime", alertCalled.getCallTime());
//获取通话录音文件地址
List<VoiceRecordFileDto> voiceRecordFileDtos = voiceRecordFileService.listByAlertId(alertCalled.getSequenceNbr());
if (!voiceRecordFileDtos.isEmpty()) {
map.put("voiceRecordFile", voiceRecordFileDtos.get(0).getFilePath());
}
return map;
}
......@@ -938,13 +917,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// );
// firefightersName.addAll(contactNames);
List<Map<String, String>> list = orgUsrServiceImpl.getPersonSimpleDetail();
list.stream().forEach(i->{
String phone="";
if(i.containsKey("phone")) {
phone = QRCodeUtil.generateQRCode()+"@"+ i.get("phone").toString();
list.stream().forEach(i -> {
String phone = "";
if (i.containsKey("phone")) {
phone = QRCodeUtil.generateQRCode() + "@" + i.get("phone").toString();
i.replace("phone", phone);
}else {
phone = QRCodeUtil.generateQRCode()+"@"+ phone;
} else {
phone = QRCodeUtil.generateQRCode() + "@" + phone;
i.put("phone", phone);
}
});
......@@ -961,7 +940,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束 */
public Set<Map<String, Object>> getLocationLike(String locationt) {
Set<Map<String, Object>> set= alertCalledMapper.getLocation();
Set<Map<String, Object>> set = alertCalledMapper.getLocation();
set.remove(null);
return set;
}
......
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