Commit 7208731a authored by wangjinjing's avatar wangjinjing

重复实践不推送

parent ad01b18a
......@@ -151,10 +151,6 @@ public class TraffController {
// importService.cleanCache();
// 将参数result中的部分数据存入redis中,并把格式校验成功的数据发布至对应频道中
// importService.cacheAndPublish(JsonUtil.beanToString(trffClientMessage));
//判断该事件在规定事件内是否发生过,发生过不需要入库
sendevent(trffClientMessage);
} catch (Exception e) {
log.error("MessageController receive putData error:" + e.toString());
......@@ -162,23 +158,42 @@ public class TraffController {
return ResultObj.ok(trffClientMessage);
}
public void sendevent( Alarm trffClientMessage){
List<String> imgBase64List = trffClientMessage.getImg_base64();
Traffalarmrecord traffAlarmRecord = new Traffalarmrecord();
String imgEnumHead = "IMG";
traffAlarmRecord.setAreaid(Long.valueOf(trffClientMessage.getDept()));
traffAlarmRecord.setRecordtype(trffClientMessage.getIncident_type().toLowerCase());
traffAlarmRecord.setVideourlfrom(trffClientMessage.getVideo_record_url());
traffAlarmRecord.setRecordtime(new Date(Long.valueOf(trffClientMessage.getTs())));
traffAlarmRecord.setCreatetime(new Date());
traffAlarmRecord.setObjlable(trffClientMessage.getObjLabel());
traffAlarmRecord.setPushstatus(9);//设置为未推送
String[] videoIdArr = trffClientMessage.getVideo_id().split("_");
traffAlarmRecord.setFdid(videoIdArr[0]);
Integer channelid = Integer.valueOf(videoIdArr[1]) + 1;
traffAlarmRecord.setChannelid(channelid);
//判断该事件在规定事件内是否发生过,发生过不需要入库
int exists=traffAlarmRecordMapper.selectExitsTraffAlarm(traffAlarmRecord);
if(exists>0){
//存在直接返回
return;
}
else{
//判断是否在正检时间内
exists=traffAlarmRecordMapper.selectInChecktimeTraffAlarm(traffAlarmRecord);
if(exists>0)
return;
}
traffAlarmRecord.setVideourlfrom(trffClientMessage.getVideo_record_url());
traffAlarmRecord.setCreatetime(new Date());
traffAlarmRecord.setObjlable(trffClientMessage.getObjLabel());
traffAlarmRecord.setPushstatus(9);//设置为未推送
//支持对某一个点位报施工事件后 倒推RECTIFYTIME 查看是否是施工事件 一段时间(时间可以配置)之前的停车事件和行人闯入事件矫正为施工事件
exists=traffAlarmRecordMapper.selectInworkRectifytimeTraffAlarm(traffAlarmRecord);
if(exists>0 && (traffAlarmRecord.getRecordtype().equalsIgnoreCase("no_motor_ban") ||traffAlarmRecord.getRecordtype().equalsIgnoreCase("illegal_parking") ))
{
//这个事件如果为停车事件或者行人闯入事件时,设置纠偏状态为1
}
List<String> imgBase64List = trffClientMessage.getImg_base64();
String imgEnumHead = "IMG";
Ftp ftp = ftpService.reloadFtp();
for (int i = 0; i < imgBase64List.size(); i++) {
/* 图片上传 */
......@@ -192,11 +207,6 @@ public void sendevent( Alarm trffClientMessage){
for (int i = 0; i < imgUrls.size(); i++) {
TraffAlarmRecordFromImgEnum.valueOf(imgEnumHead + i).setImg(traffAlarmRecord, imgUrls.get(i));
}
String[] videoIdArr = trffClientMessage.getVideo_id().split("_");
String fdid = videoIdArr[0];
traffAlarmRecord.setFdid(fdid);
Integer channelid = Integer.valueOf(videoIdArr[1]) + 1;
traffAlarmRecord.setChannelid(channelid);
if (StringEnum.ONE.getValue().equals(checkEnable)) {
/* 9:免审 */
......
......@@ -23,8 +23,12 @@ public interface TraffAlarmRecordMapper extends BaseMapper<Traffalarmrecord>, Co
Integer statisTraffalarmrecordstatByDay();
int updateTraffAlarmRectificationType(Traffalarmrecord traffalarmrecord);
Integer updateTraffAlarmRectificationType(Traffalarmrecord traffalarmrecord);
int selectExitsTraffAlarm(Traffalarmrecord traffalarmrecord);
Integer selectExitsTraffAlarm(Traffalarmrecord traffalarmrecord);
Integer selectInChecktimeTraffAlarm(Traffalarmrecord traffalarmrecord);
Integer selectInworkRectifytimeTraffAlarm(Traffalarmrecord traffalarmrecord);
}
\ 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