Commit 2ca6c409 authored by helinlin's avatar helinlin

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

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