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

五分钟

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