Commit 63d5614f authored by 高飞's avatar 高飞

重复事件不推送

parent 0f7cd3fd
......@@ -159,7 +159,6 @@ public class TraffController {
}
public void sendevent( Alarm trffClientMessage){
List<String> imgBase64List = trffClientMessage.getImg_base64();
Traffalarmrecord traffAlarmRecord = new Traffalarmrecord();
String imgEnumHead = "IMG";
Ftp ftp = ftpService.reloadFtp();
......@@ -214,6 +213,15 @@ public void sendevent( Alarm trffClientMessage){
if (traffAlarmRecord != null && traffAlarmRecord.getRecordid() != null) {
traffAlarmRecordMapper.updateTraffAlarmRecordUrl(traffAlarmRecord);
}
if(traffAlarmRecord.getRecordtype().equalsIgnoreCase("roadworks") || traffAlarmRecord.getRecordtype().equalsIgnoreCase("roadworks_out_of_line"))
{
//工程类的更新10分钟之前该videoid 下的 工程类和行人闯入和违停的记录施工纠偏类型为1
traffAlarmRecordMapper.updateTraffAlarmRectificationType(traffAlarmRecord);
}
//如果监控视频为空,延时加载重新获取
if(null==recordBak.getVideopath() || "".equalsIgnoreCase(recordBak.getVideopath())) {
......@@ -241,10 +249,13 @@ public void sendevent( Alarm trffClientMessage){
//推送给第三方
ResultObj obj = eventWriteService.updateAndAutoSendEvent(traffAlarmRecord);
log.info("调用接口推送给广达返回信息:" + obj.toString());
log.info("send to guangda:HTTP_OK" + obj.toString());
}
}
else{
ResultObj obj = eventWriteService.updateAndAutoSendEvent(traffAlarmRecord);
log.info("send to guangda HttpURLConnection.HTTP_Fail--->response message:" + obj.toString());
}
} catch (IOException e) {
System.out.println(e.toString());
log.error(e.toString());
......@@ -254,16 +265,18 @@ public void sendevent( Alarm trffClientMessage){
}
return 1;
},30, TimeUnit.SECONDS); //等待30秒钟执行
},50, TimeUnit.SECONDS); //等待50秒钟执行
}else {
//推送给第三方
ResultObj obj = eventWriteService.updateAndAutoSendEvent(traffAlarmRecord);
log.info("调用接口推送给广达返回信息:" + obj.toString());
log.info("send to guangda novideopath --->response message" + obj.toString());
}
} catch (Exception e) {
log.error("解析事件告警数据异常 :" + e.getMessage());
log.error("alarm fail :" + e.getMessage());
}
}
......
......@@ -23,4 +23,6 @@ public interface TraffAlarmRecordMapper extends BaseMapper<Traffalarmrecord>, Co
Integer statisTraffalarmrecordstatByDay();
int updateTraffAlarmRectificationType(Traffalarmrecord traffalarmrecord);
}
\ No newline at end of file
......@@ -132,9 +132,9 @@ public class FTPUtil {
changeWorkingDirectory(ftpClient, path);
flag = ftpClient.storeFile(filename, input);
if (flag) {
log.info("FTP上传文件成功!");
log.info("FTP upload success!");
} else {
log.info("FTP上传文件失败!");
log.info("FTP upload fail!");
}
} else {
flag = false;
......@@ -143,10 +143,10 @@ public class FTPUtil {
}
} catch (IOException e) {
flag = false;
log.error("FTP文件上传失败!", e);
log.error("FTP upload fail!", e);
} catch (Exception e) {
flag = false;
log.error("FTP文件上传失败!", e);
log.error("FTP upload fail!", e);
} finally {
IOUtils.closeQuietly(input);
closeConnect(ftpClient);
......
......@@ -126,7 +126,21 @@
and A.RECORDTIME<![CDATA[ < ]]>TRUNC(SYSDATE)
group by to_char(A.RECORDTIME,'yyyy-MM-DD'),recordtype,A.FDID,CHANNELID,areaid
</insert>
<update id="updateTraffAlarmRectificationType" parameterType="com.hzjt.domain.Traffalarmrecord">
UPDATE TRAFFALARMRECORD
<set>
<if test="item.processstatus != null">
rectificationtype=1,
</if>
</set>
from TRAFFALARMRECORD a,
(select * from TRAFFALARMRECORD a,(select * from TRAFFALARMRECORD b where recordid=#{item.recordid,jdbcType=VARCHAR} )b
where a.fdid =b.fdid and a.channelid=b.channelid
AND ( a.recordtime<![CDATA[ <= ]]> b.recordtime-10/(24*60))
AND recordtype in ('roadworks_out_of_line','roadworks'))b
where recordtype in('illegal_parking','no_motor_ban') and a.fdid =b.fdid and a.channelid=b.channelid
</update>
</mapper>
\ 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