Commit 43dd7c70 by 余根龙

Merge remote-tracking branch 'origin/master'

parents 2b17cfdc dd04942a
......@@ -32,7 +32,12 @@ public class LaneNorm extends Stage{
//剩余承载力
private Double residualCapacity;
//识别空间占有率
private String spotSpaceShare;
private Double spotSpaceShare;
//识别空间占有长度
private Integer spotSpaceLength;
//层级
private Integer order;
//类型
private String type;
}
......@@ -32,8 +32,8 @@ public class LaneNormSink extends RichSinkFunction<LaneNorm> {
String path = "E:\\zhht\\ZHHT-IRN-BD-ANALYSIS\\realtime\\hologram-streaming\\src\\main\\resources\\mysql.properties";
connection = MySQLUtils.getConnection(path);
insertPstmt = connection.prepareStatement("insert into " +
"app_cross_lane_norm(cross_id,lane_id,direction,cycle_id,max_queue_length,effect_green_time,pass_capacity,traffic_capacity,saturation,residual_capacity," +
"spot_space_share,lane_name,`order`,update_time) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
"app_cross_dimension_norm(cross_id,lane_id,direction,cycle_id,max_queue_length,effect_green_time,pass_capacity,traffic_capacity,saturation,residual_capacity," +
"spot_space_share,dimension_name,`order`,update_time,`type`,spot_space_length) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
}
@Override
......@@ -60,10 +60,12 @@ public class LaneNormSink extends RichSinkFunction<LaneNorm> {
insertPstmt.setDouble(8,value.getTrafficCapacity());
insertPstmt.setDouble(9,value.getSaturation());
insertPstmt.setDouble(10,value.getResidualCapacity());
insertPstmt.setString(11,value.getSpotSpaceShare());
insertPstmt.setDouble(11,value.getSpotSpaceShare());
insertPstmt.setString(12,value.getLaneName());
insertPstmt.setInt(13,value.getOrder());
insertPstmt.setString(14, DateUtils.getTodayTime());
insertPstmt.setString(15,value.getType());
insertPstmt.setInt(16,value.getSpotSpaceLength());
insertPstmt.execute();
}
}
......@@ -242,10 +242,8 @@ public class DateUtils {
*/
public static boolean compareDataIsBefore10Min(String s){
try {
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
Date afterDate = new Date(simpleDateFormat.parse(s).getTime() + 600000);
Date afterDate = new Date(Long.parseLong(s) + 600000);
return date.compareTo(afterDate)>0?false:true;
}catch (Exception e){
......
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