Commit 1d1a1f06 authored by yzm's avatar yzm

mqtt西复线服务解决id 重复问题

parent 8e42ad9e
......@@ -95,8 +95,8 @@ public class Receiver {
/* 9:免审 */
traffAlarmRecord.setCheckstatus(9);
}
int recordid = traffAlarmRecordMapper.selectmax();
traffAlarmRecord.setRecordid((long)(recordid+1));
//int recordid = traffAlarmRecordMapper.selectmax();
//traffAlarmRecord.setRecordid((long)(recordid+1));
traffAlarmRecord.setProcessstatus("0");
traffAlarmRecord.setAreaid(Long.valueOf(trffClientMessage.getDept()));
traffAlarmRecord.setRecordtype(trffClientMessage.getIncident_type().toLowerCase());
......@@ -137,7 +137,7 @@ public class Receiver {
connection.setReadTimeout(2000);
connection.setConnectTimeout(3000);
connection.setRequestMethod("GET");
String pname = DateUtils.formatCurrDayNoSign() + "_" + recordid + "_0000_" + key.replace("path", "");
String pname = DateUtils.formatCurrDayNoSign() + "_" + traffAlarmRecord.getFdid() +"_"+ traffAlarmRecord.getRecordid() + key.replace("path", "");
String fileName = pname + ".mp4";
String ftputl = FTPUtil.getFtpUrl(ftp) + basepath + "/" + fileName;
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
......
......@@ -14,9 +14,9 @@ public class DateUtils {
public static String getDateString(Date date) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
String dateString = formatter.format(date);
return dateString ;
}
......
......@@ -6,7 +6,7 @@
set retrytime= sysdate,
retrycount= retrycount+1
<trim prefix="," suffixOverrides=",">
<if test="img1path!=null">img1path=#{img1path},</if>
<!--<if test="img1path!=null">img1path=#{img1path},</if>-->
<if test="img2path!=null">img2path=#{img2path},</if>
<if test="img3path!=null">img3path=#{img3path},</if>
<if test="img4path!=null">img4path=#{img4path},</if>
......@@ -26,6 +26,9 @@
</update>
<insert id="inserTraffAlarmRecord">
<selectKey keyProperty="recordid" resultType="Long" order="BEFORE">
select nvl(max(recordid),0)+1 from traffalarmrecord
</selectKey>
insert into traffalarmrecord
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordid != null">recordid,</if>
......
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