Commit 1293d095 authored by 高飞's avatar 高飞

五分钟

parent 7208731a
...@@ -48,7 +48,7 @@ public class ScheduleTaskConfig { ...@@ -48,7 +48,7 @@ public class ScheduleTaskConfig {
if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)) { if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)) {
log.info("每个月最后一天执行删除前2个月车流量数据操作start"); log.info("每个月最后一天执行删除前2个月车流量数据操作start");
//删除2个月之前车流量详情的数据 //删除2个月之前车流量详情的数据
traffFlowService.deleteBeforeTwoMonthVehicles(DateUtils.getlastMonth(-2)); traffFlowService.deleteBeforeTwoMonthVehicles();
} }
} }
......
...@@ -9,43 +9,44 @@ import java.util.Date; ...@@ -9,43 +9,44 @@ import java.util.Date;
public class Traffalarmrecord implements java.io.Serializable { public class Traffalarmrecord implements java.io.Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
private Long recordid ;// 记录编号 主键序列 private Long recordid ;// ��¼��� ��������
private Integer algotype ;//--算法类型 默认是 0:公司 1:第三方公 private Integer algotype ;//--�㷨���� Ĭ���� 0:��˾ 1:��������˾
private Long areaid ;//--辖区编号 private Long areaid ;//--Ͻ�����
private String fdid ;//设备编号 private String fdid ;//�豸���
private Integer channelid ;//--通道编号 private Integer channelid ;//--ͨ�����
private Integer channeletype;//通道类型 可忽略 private Integer channeletype;//ͨ������ �ɺ���
private String channelname ;//通道名称 private String channelname ;//ͨ������
private Date recordtime ;//事件记录时间 private Date recordtime ;//�¼���¼ʱ��
private String recordtype ;//事件记录类型 private String recordtype ;//�¼���¼����
private String location ;//目标定位信 private String location ;//Ŀ�궨λ��Ϣ
private String img1urlfrom ;//图片源 private String img1urlfrom ;//ͼƬԴ��ַ
private String img1path ;//图片存储地 private String img1path ;//ͼƬ�洢��ַ
private String img2urlfrom ;//图片源 private String img2urlfrom ;//ͼƬԴ��ַ
private String img2path ;//图片存储地 private String img2path ;//ͼƬ�洢��ַ
private String img3urlfrom ;//图片源 private String img3urlfrom ;//ͼƬԴ��ַ
private String img3path ;//图片存储地 private String img3path ;//ͼƬ�洢��ַ
private String img4urlfrom ;//图片源 private String img4urlfrom ;//ͼƬԴ��ַ
private String img4path ;//图片存储地 private String img4path ;//ͼƬ�洢��ַ
private String img5urlfrom;//图片源 private String img5urlfrom;//ͼƬԴ��ַ
private String img5path ;//图片存储地 private String img5path ;//ͼƬ�洢��ַ
private String videourlfrom ;//视频源地 private String videourlfrom ;//��ƵԴ��ַ
private String videopath ;//视频存储地 private String videopath ;//��Ƶ�洢��ַ
private Date retrytime ;//video重试的最近一次的读取;时间 private Date retrytime ;//video���Ե����һ�εĶ�ȡ��ʱ��
private Integer retrycount ;//ideo重试读取总次数 private Integer retrycount ;//ideo���Զ�ȡ�ܴ���
private Integer recordlevel;//事件级别 --默认为0 其他类型暂时未知 private Integer recordlevel;//�¼����� --Ĭ��Ϊ0 ����������ʱδ֪
private Integer checkstatus ;//0:待审核 1:审核通过 2:审核不通过 9:免审 private Integer checkstatus ;//0:����� 1:���ͨ�� 2:��˲�ͨ�� 9:����
private String creator;//创建人 private String creator;//������
private Date createtime ;//创建时间 private Date createtime ;//����ʱ��
private String updator ;//更新人 private String updator ;//������
private Date updatetime ;//更新时间 private Date updatetime ;//����ʱ��
private String remark ; private String remark ;
private Integer pushstatus;//推送状态 private Integer pushstatus;//����״̬
private String pushdesc;//推送描述 private String pushdesc;//��������
private String pushcount;//推送次数 private String pushcount;//���ʹ���
private Date pushdate;//推送时间 private Date pushdate;//����ʱ��
private String processstatus ;//处理状态; private String processstatus ;//����״̬;
private String objlable; private String objlable;
private String rectificationtype;
@Override @Override
public String toString() { public String toString() {
......
...@@ -106,18 +106,20 @@ public class WebSocket { ...@@ -106,18 +106,20 @@ public class WebSocket {
* 根据videoid 群发 * 根据videoid 群发
*/ */
public void GroupSendingByVideoid(String name) { public void GroupSendingByVideoid(String name) {
log.info("name" + name);
if (null == traffFlowService) return; if (null == traffFlowService) return;
try { try {
List<Map> map = new ArrayList<>(); List<Map> map = new ArrayList<>();
if (null != webSocketSet.get(name) && null != webSocketSet.get(name).session && null != webSocketSet.get(name).session.getBasicRemote()) { if (null != webSocketSet.get(name) && null != webSocketSet.get(name).session && null != webSocketSet.get(name).session.getBasicRemote()) {
// log.info("name" + name); log.info("name" + name);
List<Map> dDayFlowmap = traffFlowService.selectFiveAndDayFlow(name); List<Map> dDayFlowmap = traffFlowService.selectFiveAndDayFlow(name);
if (null != dDayFlowmap) if (null != dDayFlowmap)
map.addAll(dDayFlowmap); map.addAll(dDayFlowmap);
List<Map> TypeDayFlow = traffFlowService.selectFiveAndTypeDayFlow(name); List<Map> TypeDayFlow = traffFlowService.selectFiveAndTypeDayFlow(name);
if (null != dDayFlowmap) if (null != dDayFlowmap)
map.addAll(TypeDayFlow); map.addAll(TypeDayFlow);
if (!map.isEmpty() && null!=webSocketSet.get(name)&&null!=webSocketSet.get(name).session) { log.info("JSONUtil.toJsonStr(map)" + JSONUtil.toJsonStr(map));
if (!map.isEmpty() && null!=webSocketSet.get(name) && null!=webSocketSet.get(name).session) {
synchronized (webSocketSet.get(name).session) { synchronized (webSocketSet.get(name).session) {
webSocketSet.get(name).session.getBasicRemote().sendText(JSONUtil.toJsonStr(map)); webSocketSet.get(name).session.getBasicRemote().sendText(JSONUtil.toJsonStr(map));
} }
......
...@@ -29,6 +29,6 @@ public interface TraffAlarmRecordMapper extends BaseMapper<Traffalarmrecord>, Co ...@@ -29,6 +29,6 @@ public interface TraffAlarmRecordMapper extends BaseMapper<Traffalarmrecord>, Co
Integer selectInChecktimeTraffAlarm(Traffalarmrecord traffalarmrecord); Integer selectInChecktimeTraffAlarm(Traffalarmrecord traffalarmrecord);
Integer selectInworkRectifytimeTraffAlarm(Traffalarmrecord traffalarmrecord); Integer updateInworkRectifytimeTraffAlarm(Traffalarmrecord traffalarmrecord);
} }
\ No newline at end of file
...@@ -20,7 +20,7 @@ public interface TraffFlowMapper { ...@@ -20,7 +20,7 @@ public interface TraffFlowMapper {
Integer statisVehiclesByDay(); Integer statisVehiclesByDay();
Integer deleteBeforeTwoMonthVehiclesDetails(String startime); Integer deleteBeforeTwoMonthVehiclesDetails();
Integer deleteVehiclesByDay(); Integer deleteVehiclesByDay();
......
...@@ -191,12 +191,15 @@ public class EventWriteService { ...@@ -191,12 +191,15 @@ public class EventWriteService {
condition.setRecordid(traffalarmrecord.getRecordid()); condition.setRecordid(traffalarmrecord.getRecordid());
String message = writeResultObj.getMessage(); String message = writeResultObj.getMessage();
boolean successFlag = writeResultObj.getStatus() == ResponseEnum.SUCCESS.getCode(); boolean successFlag = writeResultObj.getStatus() == ResponseEnum.SUCCESS.getCode();
condition.setPushdesc(message);
/* 失败但是因为数据已存在 */ /* 失败但是因为数据已存在 */
if (!successFlag && StringUtils.isNotBlank(message) && message.contains(CONTAINS_EXIST)) { if (!successFlag && StringUtils.isNotBlank(message) && message.contains(CONTAINS_EXIST)) {
condition.setPushstatus(1);
traffAlarmRecordMapper.updatePushEvent(condition);
return; return;
} }
/* 成功 */ /* 成功 */
condition.setPushdesc(message);
if (successFlag) { if (successFlag) {
condition.setPushstatus(0); condition.setPushstatus(0);
traffAlarmRecordMapper.updatePushEvent(condition); traffAlarmRecordMapper.updatePushEvent(condition);
......
...@@ -39,8 +39,8 @@ public class TraffFlowService { ...@@ -39,8 +39,8 @@ public class TraffFlowService {
} }
public void deleteBeforeTwoMonthVehicles(String starttime) { public void deleteBeforeTwoMonthVehicles() {
traffFlowMapper.deleteBeforeTwoMonthVehiclesDetails(starttime); traffFlowMapper.deleteBeforeTwoMonthVehiclesDetails();
} }
......
...@@ -25,6 +25,10 @@ public class DateUtils { ...@@ -25,6 +25,10 @@ public class DateUtils {
return formatCurrDateByType(YMDHMS); return formatCurrDateByType(YMDHMS);
} }
public static String formatCurrDateYMD(){
return formatCurrDateByType(Y_M_D);
}
public static String formatCurrDayNoSign(){ public static String formatCurrDayNoSign(){
return formatCurrDateByType(YMD); return formatCurrDateByType(YMD);
} }
......
...@@ -13,7 +13,7 @@ mybatis.configuration.map-underscore-to-camel-case=true ...@@ -13,7 +13,7 @@ mybatis.configuration.map-underscore-to-camel-case=true
mybatis.configuration.default-fetch-size=100 mybatis.configuration.default-fetch-size=100
mybatis.configuration.default-statement-timeout=3000 mybatis.configuration.default-statement-timeout=3000
#mybatis.mapperLocations = classpath:xxx.xml #mybatis.mapperLocations = classpath:xxx.xml
#logging.level.com.hzjt=debug logging.level.com.hzjt=debug
## �������ݿ�-����Դ���� ## �������ݿ�-����Դ����
#spring.datasource.url=jdbc:dm://127.0.0.1:12345/auditlocal_cq #spring.datasource.url=jdbc:dm://127.0.0.1:12345/auditlocal_cq
...@@ -31,7 +31,7 @@ mybatis.configuration.default-statement-timeout=3000 ...@@ -31,7 +31,7 @@ mybatis.configuration.default-statement-timeout=3000
# Mysql���ݿ�-����Դ���� # Mysql���ݿ�-����Դ����
#spring.datasource.username=test #spring.datasource.username=test
#spring.datasource.password=test #spring.datasource.password=test
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1522:helowin #spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1523:helowin
spring.datasource.username=hzjt spring.datasource.username=hzjt
spring.datasource.password=hzjt spring.datasource.password=hzjt
spring.datasource.url=jdbc:oracle:thin:@33.50.1.22:1521:orcl spring.datasource.url=jdbc:oracle:thin:@33.50.1.22:1521:orcl
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
b.video_id b.video_id
</insert> </insert>
<delete id="deleteBeforeTwoMonthVehiclesDetails"> <delete id="deleteBeforeTwoMonthVehiclesDetails">
delete from vehicle WHERE create_time <![CDATA[ <= ]]>to_date( #{starttime}||' 23:59:59','yyyy-mm-dd hh24:mi:ss') delete from vehicle WHERE create_time <![CDATA[ <= ]]>sysdate-33
</delete> </delete>
<delete id="deleteVehiclesByDay"> <delete id="deleteVehiclesByDay">
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<if test="pushdesc != null">pushdesc,</if> <if test="pushdesc != null">pushdesc,</if>
<if test="processstatus != null">processstatus,</if> <if test="processstatus != null">processstatus,</if>
<if test="objlable != null">objlable,</if> <if test="objlable != null">objlable,</if>
<if test="rectificationtype != null">rectificationtype ,</if>
</trim> </trim>
<trim prefix="select" suffix="from dual" suffixOverrides=","> <trim prefix="select" suffix="from dual" suffixOverrides=",">
...@@ -101,6 +102,7 @@ ...@@ -101,6 +102,7 @@
<if test="pushdesc != null">#{pushdesc},</if> <if test="pushdesc != null">#{pushdesc},</if>
<if test="processstatus != null">#{processstatus},</if> <if test="processstatus != null">#{processstatus},</if>
<if test="objlable != null">#{objlable},</if> <if test="objlable != null">#{objlable},</if>
<if test="rectificationtype != null">#{rectificationtype},</if>
</trim> </trim>
...@@ -129,55 +131,48 @@ ...@@ -129,55 +131,48 @@
<update id="updateTraffAlarmRectificationType" parameterType="com.hzjt.domain.Traffalarmrecord"> <update id="updateTraffAlarmRectificationType" parameterType="com.hzjt.domain.Traffalarmrecord">
UPDATE TRAFFALARMRECORD UPDATE TRAFFALARMRECORD
<set> <set>
<if test="item.processstatus != null"> <if test="processstatus != null">
rectificationtype=1, rectificationtype=1,
</if> </if>
</set> </set>
from TRAFFALARMRECORD a, from TRAFFALARMRECORD a,
(select * from TRAFFALARMRECORD a,(select * from TRAFFALARMRECORD b where (select * from TRAFFALARMRECORD a,(select * from TRAFFALARMRECORD b where
recordid=#{item.recordid,jdbcType=VARCHAR} )b recordid=#{recordid,jdbcType=VARCHAR} )b
where a.fdid =b.fdid and a.channelid=b.channelid where a.fdid =b.fdid and a.channelid=b.channelid
AND ( a.recordtime<![CDATA[ <= ]]> b.recordtime-10/(24*60)) AND ( a.recordtime<![CDATA[ <= ]]> b.recordtime-10/1440)
AND recordtype in ('roadworks_out_of_line','roadworks'))b 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 where recordtype in('illegal_parking','no_motor_ban') and a.fdid =b.fdid and a.channelid=b.channelid
</update> </update>
<select id="selectExitsTraffAlarm" parameterType="com.hzjt.domain.Traffalarmrecord" resultType="java.lang.Integer"> <!--<select id="selectExitsTraffAlarm" parameterType="com.hzjt.domain.Traffalarmrecord" resultType="java.lang.Integer">-->
select count(1) from TRAFFALARMRECORD a,t_code b where a.recordtype=#{item.recordtype,jdbcType=VARCHAR} <!--select count(1) from TRAFFALARMRECORD a,t_code b where a.recordtype=#{recordtype,jdbcType=VARCHAR}-->
and a.recordtype=LOWER (b.key)and recordtime>=sysdate-(b.REPEATTIME)/(24*60) <!--and a.recordtype=LOWER (b.key)and recordtime>=sysdate-(b.REPEATTIME)/(24*60)-->
and a.fdid=#{item.fdid,jdbcType=VARCHAR} <!--and a.fdid=#{fdid,jdbcType=VARCHAR}-->
and a.channelid=#{item.channelid,jdbcType=VARCHAR} <!--and a.channelid=#{channelid,jdbcType=VARCHAR}-->
</select> <!--</select>-->
<select id="selectInChecktimeTraffAlarm" parameterType="com.hzjt.domain.Traffalarmrecord" resultType="java.lang.Integer"> <select id="selectInChecktimeTraffAlarm" parameterType="com.hzjt.domain.Traffalarmrecord" resultType="java.lang.Integer">
select count(1) from TRAFFALARMRECORD a,t_code b select count(1) from videochecktime a,t_code b where
where a.recordtype=#{item.recordtype,jdbcType=VARCHAR} a.FDID=#{fdid,jdbcType=VARCHAR}
and a.fdid=#{item.fdid,jdbcType=VARCHAR} and a.CHANNELID=#{channelid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR} and a.RECORDTYPE=#{recordtype,jdbcType=VARCHAR}
and a.recordtype=LOWER (b.key) and a.RECORDTYPE=lower(b.key)
and recordtime<![CDATA[ <= ]]>(select LASTCHECKTIME from videochecktime c where and LASTCHECKTIME+(b.PUSHCHECKTIME)/1440 <![CDATA[ >= ]]>#{recordtime,jdbcType=TIMESTAMP}
a.fdid=#{item.fdid,jdbcType=VARCHAR} and LASTCHECKTIME <![CDATA[ < ]]>#{recordtime,jdbcType=TIMESTAMP}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
and recordtype=#{item.recordtype,jdbcType=VARCHAR})+(b.PUSHCHECKTIME)/(24*60)
and recordtime>(select LASTCHECKTIME from videochecktime c where
a.fdid=#{item.fdid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
and recordtype=#{item.recordtype,jdbcType=VARCHAR})
</select>
<select id="selectInworkRectifytimeTraffAlarm" parameterType="com.hzjt.domain.Traffalarmrecord" resultType="java.lang.Integer">
select count(1) from TRAFFALARMRECORD a,t_code b
where a.recordtype=#{item.recordtype,jdbcType=VARCHAR}
and a.recordtype=LOWER (b.key)
and a.fdid=#{item.fdid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
and recordtime>=#{item.recordtime,jdbcType=TIMESTAMP}-(b.RECTIFYTIME)/(24*60)
and recordtime<![CDATA[ < ]]>#{item.recordtime,jdbcType=TIMESTAMP}
and recordtype in ('roadworks_out_of_line','roadworks')
</select> </select>
<update id="updateInworkRectifytimeTraffAlarm" parameterType="com.hzjt.domain.Traffalarmrecord">
update TRAFFALARMRECORD set rectificationtype=1,recordtype='roadworks'
where fdid=#{fdid,jdbcType=VARCHAR}
and channelid=#{channelid,jdbcType=VARCHAR}
and recordtime>=#{recordtime,jdbcType=TIMESTAMP}-(select b.RECTIFYTIME from t_code b where recordtype=LOWER (b.key) )/1440
and recordtime<![CDATA[ < ]]>#{recordtime,jdbcType=TIMESTAMP}
and recordtype in ('illegal_parking','no_motor_ban')
</update>
</mapper> </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