|
@@ -8,7 +8,6 @@ import com.ruoyi.common.core.utils.DateUtils;
|
|
|
import com.ruoyi.common.core.utils.SpringUtils;
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
|
|
-import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
import com.sooka.sponest.event.centereventtdeptevent.domain.CentereventDeptEvent;
|
|
|
import com.sooka.sponest.event.centereventtdeptevent.service.ICentereventDeptEventService;
|
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
|
|
@@ -38,7 +37,9 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import static com.ruoyi.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
|
|
import static com.sooka.sponest.event.utils.EventConstants.*;
|
|
@@ -272,12 +273,6 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
String logId = this.insertEventLog(centereventTEventcatalogue);
|
|
|
if (StringUtils.isNotBlank(daHuaFireEventVO.getInfo().getPicture())) {
|
|
|
String[] pictures = daHuaFireEventVO.getInfo().getPicture().split(",");
|
|
|
- //图片结合中应由热感和高清两张图片
|
|
|
- if (pictures.length != 2) {
|
|
|
- //延迟获取图片
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
for (String picture : pictures) {
|
|
|
CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
tAttach.setBusId(logId);
|
|
@@ -292,6 +287,50 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public String updateFireEventImage(DaHuaEventBO eventBO) throws ClientException {
|
|
|
+ // 通过eventCode查询详情
|
|
|
+ CentereventTEventcatalogue centereventTEventcatalogue = centereventTEventcatalogueService.selectCentereventTEventcatalogueById(eventBO.getEventCode());
|
|
|
+ // 确认为 火情事件 并且 状态为上报
|
|
|
+ if ("1".equals(centereventTEventcatalogue.getEventType()) && "forest_event_status_1".equals(centereventTEventcatalogue.getEventStatusValue())) {
|
|
|
+ // 按照指定格式拼接路径
|
|
|
+ String url = "alarmCode=" + RemoteApiUtil.encodeUrl(eventBO.getAlarmCode()) + "&dbType=" + RemoteApiUtil.encodeUrl(eventBO.getDbType()) + "&alarmDate=" + RemoteApiUtil.encodeUrl(eventBO.getAlarmDate());
|
|
|
+ // 创建请求实体 并 发送请求
|
|
|
+ String prBody = new IccHttpHttpRequest(detailUrl + url)
|
|
|
+ // 设置token
|
|
|
+ .header(HEADER_KEY, HEADER_VALUE + RemoteApiUtil.getInstance().getToken())
|
|
|
+ // 客户端模式,设置请求头
|
|
|
+ .header(clientKey, clientValue)
|
|
|
+ // 发送请求
|
|
|
+ .execute();
|
|
|
+ // 处理响应结果
|
|
|
+ JSONObject responseData = JSON.parseObject(prBody);
|
|
|
+ if (responseData.getBoolean("success")) {
|
|
|
+ ArrayList<String> pictures = responseData.getJSONObject("data").getObject("pictures", ArrayList.class);
|
|
|
+ if (pictures.isEmpty()) {
|
|
|
+ logger.error("获取的图片集合为空-----请求结果:{}", prBody);
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ // 添加新附件
|
|
|
+ List<CenterdataTAttach> attachList = new ArrayList<>();
|
|
|
+ for (String picture : pictures) {
|
|
|
+ CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
+ tAttach.setBusId(eventBO.getLogId());
|
|
|
+ tAttach.setAttachPath(picture);
|
|
|
+ tAttach.setBusIndx(BUS_INDEX_1);
|
|
|
+ tAttach.setBusSource("DH_1");
|
|
|
+ tAttach.setFileType(FILE_TYPE_1);
|
|
|
+ attachList.add(tAttach);
|
|
|
+ }
|
|
|
+ return remoteDataService.delAndInsertBatch(JSON.toJSONString(attachList)).getMsg();
|
|
|
+ } else {
|
|
|
+ logger.error("请求远端异常-----请求结果:{}", prBody);
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "请刷新后重试";
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public String insertDaHuaOtherEvent(DaHuaOtherEventVO daHuaOtherEventVO) {
|
|
|
// 验证是否配置摄像头通道
|
|
|
CenterdataTCamera centerdataTCamera = SpringUtils.getBean(RemoteMonitorService.class).getInfoByChannelCode(daHuaOtherEventVO.getChannelSn()).getData();
|
|
@@ -373,53 +412,4 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
}
|
|
|
return centereventTEventcatalogue.getEventCode() + "_" + eventtype.getEventTypeName();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public int updateFireEventImage(DaHuaEventBO eventBO) throws ClientException {
|
|
|
- //通过eventCode查询详情
|
|
|
- CentereventTEventcatalogue centereventTEventcatalogue = centereventTEventcatalogueService.selectCentereventTEventcatalogueByEventCode(eventBO.getEventCode());
|
|
|
- //确认为 火情事件 并且 状态为上报
|
|
|
- if("1".equals(centereventTEventcatalogue.getEventType()) && "forest_event_status_1".equals(centereventTEventcatalogue.getEventStatusValue())){
|
|
|
- //按照指定格式拼接路径
|
|
|
- String url = "alarmCode=" + RemoteApiUtil.encodeUrl(eventBO.getAlarmCode()) + "&dbType=" + RemoteApiUtil.encodeUrl(eventBO.getDbType()) + "&alarmDate=" + RemoteApiUtil.encodeUrl(eventBO.getAlarmDate());
|
|
|
- //创建请求实体 并 发送请求
|
|
|
- String prBody = new IccHttpHttpRequest(detailUrl + url)
|
|
|
- //设置token
|
|
|
- .header(HEADER_KEY, HEADER_VALUE + RemoteApiUtil.getInstance().getToken())
|
|
|
- //客户端模式,设置请求头
|
|
|
- .header(clientKey, clientValue)
|
|
|
- //发送请求
|
|
|
- .execute();
|
|
|
- //打印响应结果cd
|
|
|
- JSONObject responseData = JSON.parseObject(prBody);
|
|
|
- if(responseData.getBoolean("success")){
|
|
|
- ArrayList<String> pictures = responseData.getJSONObject("data").getObject("pictures", ArrayList.class);
|
|
|
- if(pictures.isEmpty()){
|
|
|
- logger.error("获取的图片集合为空-----请求结果:{}", prBody);
|
|
|
- return -1;
|
|
|
- }
|
|
|
- //添加新附件
|
|
|
- List<CenterdataTAttach> attachList = new ArrayList<>();
|
|
|
- for (String picture : pictures) {
|
|
|
- CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
- tAttach.setBusId(eventBO.getLogId());
|
|
|
- tAttach.setAttachPath(picture);
|
|
|
- tAttach.setBusIndx(BUS_INDEX_1);
|
|
|
- tAttach.setBusSource("DH_1");
|
|
|
- tAttach.setFileType(FILE_TYPE_1);
|
|
|
- attachList.add(tAttach);
|
|
|
- }
|
|
|
- JSONObject requestObj = new JSONObject();
|
|
|
- requestObj.put("attachList", attachList);
|
|
|
- requestObj.put("busId", eventBO.getLogId());
|
|
|
- return remoteDataService.insertAttachToArray(requestObj.toJSONString());
|
|
|
- }else{
|
|
|
- logger.error("请求远端异常-----请求结果:{}", prBody);
|
|
|
- return -1;
|
|
|
- }
|
|
|
- }else{
|
|
|
- return 0;
|
|
|
- }
|
|
|
- }
|
|
|
}
|