Commit 76d4c49e1aac1e01d6c6081459c3e30245e2ae1a
1 parent
3ef833c6
新增配人接口,线路营运状态
Showing
1 changed file
with
344 additions
and
18 deletions
src/main/java/com/bsth/server_rs/bigdata/BigdateService.java
| ... | ... | @@ -3,6 +3,9 @@ package com.bsth.server_rs.bigdata; |
| 3 | 3 | import java.sql.ResultSet; |
| 4 | 4 | import java.sql.SQLException; |
| 5 | 5 | import java.text.DecimalFormat; |
| 6 | +import java.text.SimpleDateFormat; | |
| 7 | +import java.util.Calendar; | |
| 8 | +import java.util.Date; | |
| 6 | 9 | import java.util.HashMap; |
| 7 | 10 | import java.util.List; |
| 8 | 11 | import java.util.Map; |
| ... | ... | @@ -96,16 +99,41 @@ public class BigdateService { |
| 96 | 99 | return ""; |
| 97 | 100 | } |
| 98 | 101 | } |
| 102 | + public Map<String, Long> getEndtime(String date){ | |
| 103 | + Map<String, Long> map=new HashMap<String,Long>(); | |
| 104 | + String sql="select xl,endtime from bsth_c_calc_count " | |
| 105 | + + " where date='"+date+"' "; | |
| 106 | + List<Map<String, Object>> list=jdbcTemplate.query(sql, | |
| 107 | + new RowMapper<Map<String, Object>>(){ | |
| 108 | + @Override | |
| 109 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 110 | + Map<String, Object> m=new HashMap<String, Object>(); | |
| 111 | + m.put("line", rs.getString("xl")); | |
| 112 | + m.put("endtime", rs.getString("endtime")); | |
| 113 | + return m; | |
| 114 | + } | |
| 115 | + }); | |
| 116 | + for (int i = 0; i < list.size(); i++) { | |
| 117 | + map.put(list.get(i).get("line").toString(), | |
| 118 | + Long.parseLong(list.get(i).get("endtime").toString())); | |
| 119 | + } | |
| 120 | + return map; | |
| 121 | + } | |
| 99 | 122 | @GET |
| 100 | 123 | @Path("/line/all") |
| 101 | 124 | public List<Map<String, Object>> findLineAll(){ |
| 102 | - String sql="SELECT company,line_code,name,level,shanghai_linecode, nature from bsth_c_line where " | |
| 103 | - + " shanghai_linecode is not null and shanghai_linecode !='' and destroy=0 and remove=0 "; | |
| 125 | + String sql="SELECT b.start_opt,a.company,a.line_code,a.name,a.level," | |
| 126 | + + " a.shanghai_linecode, a.nature from " | |
| 127 | + + " bsth_c_line a left join bsth_c_line_config b " | |
| 128 | + + " on a.id=b.line where " | |
| 129 | + + " a.shanghai_linecode is not null and a.shanghai_linecode !='' and a.destroy=0 " | |
| 130 | + + " and a.remove=0 "; | |
| 104 | 131 | List<Map<String, Object>> list=jdbcTemplate.query(sql, |
| 105 | 132 | new RowMapper<Map<String, Object>>(){ |
| 106 | 133 | @Override |
| 107 | 134 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 108 | 135 | Map<String, Object> m=new HashMap<String,Object>(); |
| 136 | + m.put("state", rs.getString("start_opt")); | |
| 109 | 137 | m.put("company", rs.getString("company")); |
| 110 | 138 | m.put("companyName", getGs(rs.getString("company"))); |
| 111 | 139 | m.put("lineCode",rs.getString("line_code")); |
| ... | ... | @@ -116,6 +144,56 @@ public class BigdateService { |
| 116 | 144 | return m; |
| 117 | 145 | } |
| 118 | 146 | }); |
| 147 | + Date d=new Date(); | |
| 148 | + SimpleDateFormat hm=new SimpleDateFormat("HH:mm"); | |
| 149 | + SimpleDateFormat ymd=new SimpleDateFormat("yyyy-MM-dd"); | |
| 150 | + | |
| 151 | + String qqrq=ymd.format(d); | |
| 152 | + String qqsj=hm.format(d); | |
| 153 | + String qqsjs[]=qqsj.split(":"); | |
| 154 | + Date nDate=new Date(); | |
| 155 | + Calendar calendar = Calendar.getInstance(); | |
| 156 | + calendar.setTime(nDate); | |
| 157 | + calendar.add(Calendar.DAY_OF_MONTH, -1); | |
| 158 | + Date dBefore = calendar.getTime(); | |
| 159 | + String qqrqbefore =ymd.format(dBefore); | |
| 160 | + int qqsjtime=Integer.parseInt(qqsjs[0])*60+Integer.parseInt(qqsjs[1]); | |
| 161 | + Map<String, Long> endMap1=getEndtime(qqrqbefore); | |
| 162 | + Map<String, Long> endMap2=getEndtime(qqrq); | |
| 163 | + | |
| 164 | + for (int i = 0; i < list.size(); i++) { | |
| 165 | + Map<String, Object> m=list.get(i); | |
| 166 | + int fcsjtime=0; | |
| 167 | + if(m.get("state")!=null){ | |
| 168 | + String start_opt[]=m.get("state").toString().split(":"); | |
| 169 | + fcsjtime=Integer.parseInt(start_opt[0])*60+Integer.parseInt(start_opt[1]); | |
| 170 | + } | |
| 171 | + //请求时间小于翻班时间 营运日期当做请求日期的前一天。 | |
| 172 | + long maxtime=d.getTime(); | |
| 173 | + String yyzt=""; | |
| 174 | + if(qqsjtime<fcsjtime){ | |
| 175 | + if(endMap1.get(m.get("lineCode").toString())!=null){ | |
| 176 | + if(endMap1.get(m.get("lineCode").toString())>=maxtime){ | |
| 177 | + yyzt="营运"; | |
| 178 | + }else{ | |
| 179 | + yyzt="未营运"; | |
| 180 | + } | |
| 181 | + }else{ | |
| 182 | + yyzt="未营运"; | |
| 183 | + } | |
| 184 | + }else{ | |
| 185 | + if(endMap2.get(m.get("lineCode").toString())!=null){ | |
| 186 | + if(endMap2.get(m.get("lineCode").toString())>=maxtime){ | |
| 187 | + yyzt="营运"; | |
| 188 | + }else{ | |
| 189 | + yyzt="未营运"; | |
| 190 | + } | |
| 191 | + }else{ | |
| 192 | + yyzt="未营运"; | |
| 193 | + } | |
| 194 | + } | |
| 195 | + m.put("state", yyzt); | |
| 196 | + } | |
| 119 | 197 | return list; |
| 120 | 198 | } |
| 121 | 199 | |
| ... | ... | @@ -123,14 +201,18 @@ public class BigdateService { |
| 123 | 201 | @GET |
| 124 | 202 | @Path("/line/company/{companyId}") |
| 125 | 203 | public List<Map<String, Object>> findLineByCompany(@PathParam("companyId") String companyId) { |
| 126 | - String sql="SELECT company,line_code,name,level,shanghai_linecode, nature from bsth_c_line where " | |
| 127 | - + " shanghai_linecode is not null and shanghai_linecode !='' and destroy=0 and remove=0 " | |
| 128 | - + " and company = '"+companyId+"'"; | |
| 204 | + String sql="SELECT b.start_opt,a.company,a.line_code,a.name,a.level," | |
| 205 | + + " a.shanghai_linecode, a.nature from " | |
| 206 | + + " bsth_c_line a left join bsth_c_line_config b " | |
| 207 | + + " on a.id=b.line where " | |
| 208 | + + " a.shanghai_linecode is not null and a.shanghai_linecode !='' and a.destroy=0 " | |
| 209 | + + " and a.remove=0 and a.company = '"+companyId+"'"; | |
| 129 | 210 | List<Map<String, Object>> list=jdbcTemplate.query(sql, |
| 130 | 211 | new RowMapper<Map<String, Object>>(){ |
| 131 | 212 | @Override |
| 132 | 213 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 133 | 214 | Map<String, Object> m=new HashMap<String,Object>(); |
| 215 | + m.put("state", rs.getString("start_opt")); | |
| 134 | 216 | m.put("company", rs.getString("company")); |
| 135 | 217 | m.put("companyName", getGs(rs.getString("company"))); |
| 136 | 218 | m.put("lineCode",rs.getString("line_code")); |
| ... | ... | @@ -141,20 +223,74 @@ public class BigdateService { |
| 141 | 223 | return m; |
| 142 | 224 | } |
| 143 | 225 | }); |
| 226 | + Date d=new Date(); | |
| 227 | + SimpleDateFormat hm=new SimpleDateFormat("HH:mm"); | |
| 228 | + SimpleDateFormat ymd=new SimpleDateFormat("yyyy-MM-dd"); | |
| 229 | + | |
| 230 | + String qqrq=ymd.format(d); | |
| 231 | + String qqsj=hm.format(d); | |
| 232 | + String qqsjs[]=qqsj.split(":"); | |
| 233 | + Date nDate=new Date(); | |
| 234 | + Calendar calendar = Calendar.getInstance(); | |
| 235 | + calendar.setTime(nDate); | |
| 236 | + calendar.add(Calendar.DAY_OF_MONTH, -1); | |
| 237 | + Date dBefore = calendar.getTime(); | |
| 238 | + String qqrqbefore =ymd.format(dBefore); | |
| 239 | + int qqsjtime=Integer.parseInt(qqsjs[0])*60+Integer.parseInt(qqsjs[1]); | |
| 240 | + Map<String, Long> endMap1=getEndtime(qqrqbefore); | |
| 241 | + Map<String, Long> endMap2=getEndtime(qqrq); | |
| 242 | + | |
| 243 | + for (int i = 0; i < list.size(); i++) { | |
| 244 | + Map<String, Object> m=list.get(i); | |
| 245 | + int fcsjtime=0; | |
| 246 | + if(m.get("state")!=null){ | |
| 247 | + String start_opt[]=m.get("state").toString().split(":"); | |
| 248 | + fcsjtime=Integer.parseInt(start_opt[0])*60+Integer.parseInt(start_opt[1]); | |
| 249 | + } | |
| 250 | + //请求时间小于翻班时间 营运日期当做请求日期的前一天。 | |
| 251 | + long maxtime=d.getTime(); | |
| 252 | + String yyzt=""; | |
| 253 | + if(qqsjtime<fcsjtime){ | |
| 254 | + if(endMap1.get(m.get("lineCode").toString())!=null){ | |
| 255 | + if(endMap1.get(m.get("lineCode").toString())>=maxtime){ | |
| 256 | + yyzt="营运"; | |
| 257 | + }else{ | |
| 258 | + yyzt="未营运"; | |
| 259 | + } | |
| 260 | + }else{ | |
| 261 | + yyzt="未营运"; | |
| 262 | + } | |
| 263 | + }else{ | |
| 264 | + if(endMap2.get(m.get("lineCode").toString())!=null){ | |
| 265 | + if(endMap2.get(m.get("lineCode").toString())>=maxtime){ | |
| 266 | + yyzt="营运"; | |
| 267 | + }else{ | |
| 268 | + yyzt="未营运"; | |
| 269 | + } | |
| 270 | + }else{ | |
| 271 | + yyzt="未营运"; | |
| 272 | + } | |
| 273 | + } | |
| 274 | + m.put("state", yyzt); | |
| 275 | + } | |
| 144 | 276 | return list; |
| 145 | 277 | } |
| 146 | 278 | |
| 147 | 279 | @GET |
| 148 | 280 | @Path("/line/{lineCode}") |
| 149 | 281 | public List<Map<String, Object>> findLineByCode(@PathParam("lineCode") String lineCode) { |
| 150 | - String sql="SELECT company,line_code,name,level,shanghai_linecode, nature from bsth_c_line where " | |
| 151 | - + " shanghai_linecode is not null and shanghai_linecode !='' and destroy=0 and remove=0 " | |
| 152 | - + " and line_code = '"+lineCode+"'"; | |
| 282 | + String sql="SELECT b.start_opt,a.company,a.line_code,a.name,a.level," | |
| 283 | + + " a.shanghai_linecode, a.nature from " | |
| 284 | + + " bsth_c_line a left join bsth_c_line_config b " | |
| 285 | + + " on a.id=b.line where " | |
| 286 | + + " a.shanghai_linecode is not null and a.shanghai_linecode !='' and a.destroy=0 " | |
| 287 | + + " and a.remove=0 and a.line_code = '"+lineCode+"'"; | |
| 153 | 288 | List<Map<String, Object>> list=jdbcTemplate.query(sql, |
| 154 | 289 | new RowMapper<Map<String, Object>>(){ |
| 155 | 290 | @Override |
| 156 | 291 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 157 | 292 | Map<String, Object> m=new HashMap<String,Object>(); |
| 293 | + m.put("state", rs.getString("start_opt")); | |
| 158 | 294 | m.put("company", rs.getString("company")); |
| 159 | 295 | m.put("companyName", getGs(rs.getString("company"))); |
| 160 | 296 | m.put("lineCode",rs.getString("line_code")); |
| ... | ... | @@ -165,20 +301,74 @@ public class BigdateService { |
| 165 | 301 | return m; |
| 166 | 302 | } |
| 167 | 303 | }); |
| 304 | + Date d=new Date(); | |
| 305 | + SimpleDateFormat hm=new SimpleDateFormat("HH:mm"); | |
| 306 | + SimpleDateFormat ymd=new SimpleDateFormat("yyyy-MM-dd"); | |
| 307 | + | |
| 308 | + String qqrq=ymd.format(d); | |
| 309 | + String qqsj=hm.format(d); | |
| 310 | + String qqsjs[]=qqsj.split(":"); | |
| 311 | + Date nDate=new Date(); | |
| 312 | + Calendar calendar = Calendar.getInstance(); | |
| 313 | + calendar.setTime(nDate); | |
| 314 | + calendar.add(Calendar.DAY_OF_MONTH, -1); | |
| 315 | + Date dBefore = calendar.getTime(); | |
| 316 | + String qqrqbefore =ymd.format(dBefore); | |
| 317 | + int qqsjtime=Integer.parseInt(qqsjs[0])*60+Integer.parseInt(qqsjs[1]); | |
| 318 | + Map<String, Long> endMap1=getEndtime(qqrqbefore); | |
| 319 | + Map<String, Long> endMap2=getEndtime(qqrq); | |
| 320 | + | |
| 321 | + for (int i = 0; i < list.size(); i++) { | |
| 322 | + Map<String, Object> m=list.get(i); | |
| 323 | + int fcsjtime=0; | |
| 324 | + if(m.get("state")!=null){ | |
| 325 | + String start_opt[]=m.get("state").toString().split(":"); | |
| 326 | + fcsjtime=Integer.parseInt(start_opt[0])*60+Integer.parseInt(start_opt[1]); | |
| 327 | + } | |
| 328 | + //请求时间小于翻班时间 营运日期当做请求日期的前一天。 | |
| 329 | + long maxtime=d.getTime(); | |
| 330 | + String yyzt=""; | |
| 331 | + if(qqsjtime<fcsjtime){ | |
| 332 | + if(endMap1.get(m.get("lineCode").toString())!=null){ | |
| 333 | + if(endMap1.get(m.get("lineCode").toString())>=maxtime){ | |
| 334 | + yyzt="营运"; | |
| 335 | + }else{ | |
| 336 | + yyzt="未营运"; | |
| 337 | + } | |
| 338 | + }else{ | |
| 339 | + yyzt="未营运"; | |
| 340 | + } | |
| 341 | + }else{ | |
| 342 | + if(endMap2.get(m.get("lineCode").toString())!=null){ | |
| 343 | + if(endMap2.get(m.get("lineCode").toString())>=maxtime){ | |
| 344 | + yyzt="营运"; | |
| 345 | + }else{ | |
| 346 | + yyzt="未营运"; | |
| 347 | + } | |
| 348 | + }else{ | |
| 349 | + yyzt="未营运"; | |
| 350 | + } | |
| 351 | + } | |
| 352 | + m.put("state", yyzt); | |
| 353 | + } | |
| 168 | 354 | return list; |
| 169 | 355 | } |
| 170 | 356 | |
| 171 | 357 | @GET |
| 172 | 358 | @Path("/line/level/{level}") |
| 173 | 359 | public List<Map<String, Object>> findLineByLevle(@PathParam("level") String level) { |
| 174 | - String sql="SELECT company,line_code,name,level,shanghai_linecode, nature from bsth_c_line where " | |
| 175 | - + " shanghai_linecode is not null and shanghai_linecode !='' and destroy=0 and remove=0 " | |
| 176 | - + " and level = '"+level+"'"; | |
| 360 | + String sql="SELECT b.start_opt,a.company,a.line_code,a.name,a.level," | |
| 361 | + + " a.shanghai_linecode, a.nature from " | |
| 362 | + + " bsth_c_line a left join bsth_c_line_config b " | |
| 363 | + + " on a.id=b.line where " | |
| 364 | + + " a.shanghai_linecode is not null and a.shanghai_linecode !='' and a.destroy=0 " | |
| 365 | + + " and a.remove=0 and a.level = '"+level+"'"; | |
| 177 | 366 | List<Map<String, Object>> list=jdbcTemplate.query(sql, |
| 178 | 367 | new RowMapper<Map<String, Object>>(){ |
| 179 | 368 | @Override |
| 180 | 369 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 181 | 370 | Map<String, Object> m=new HashMap<String,Object>(); |
| 371 | + m.put("state", rs.getString("start_opt")); | |
| 182 | 372 | m.put("company", rs.getString("company")); |
| 183 | 373 | m.put("companyName", getGs(rs.getString("company"))); |
| 184 | 374 | m.put("lineCode",rs.getString("line_code")); |
| ... | ... | @@ -189,6 +379,56 @@ public class BigdateService { |
| 189 | 379 | return m; |
| 190 | 380 | } |
| 191 | 381 | }); |
| 382 | + Date d=new Date(); | |
| 383 | + SimpleDateFormat hm=new SimpleDateFormat("HH:mm"); | |
| 384 | + SimpleDateFormat ymd=new SimpleDateFormat("yyyy-MM-dd"); | |
| 385 | + | |
| 386 | + String qqrq=ymd.format(d); | |
| 387 | + String qqsj=hm.format(d); | |
| 388 | + String qqsjs[]=qqsj.split(":"); | |
| 389 | + Date nDate=new Date(); | |
| 390 | + Calendar calendar = Calendar.getInstance(); | |
| 391 | + calendar.setTime(nDate); | |
| 392 | + calendar.add(Calendar.DAY_OF_MONTH, -1); | |
| 393 | + Date dBefore = calendar.getTime(); | |
| 394 | + String qqrqbefore =ymd.format(dBefore); | |
| 395 | + int qqsjtime=Integer.parseInt(qqsjs[0])*60+Integer.parseInt(qqsjs[1]); | |
| 396 | + Map<String, Long> endMap1=getEndtime(qqrqbefore); | |
| 397 | + Map<String, Long> endMap2=getEndtime(qqrq); | |
| 398 | + | |
| 399 | + for (int i = 0; i < list.size(); i++) { | |
| 400 | + Map<String, Object> m=list.get(i); | |
| 401 | + int fcsjtime=0; | |
| 402 | + if(m.get("state")!=null){ | |
| 403 | + String start_opt[]=m.get("state").toString().split(":"); | |
| 404 | + fcsjtime=Integer.parseInt(start_opt[0])*60+Integer.parseInt(start_opt[1]); | |
| 405 | + } | |
| 406 | + //请求时间小于翻班时间 营运日期当做请求日期的前一天。 | |
| 407 | + long maxtime=d.getTime(); | |
| 408 | + String yyzt=""; | |
| 409 | + if(qqsjtime<fcsjtime){ | |
| 410 | + if(endMap1.get(m.get("lineCode").toString())!=null){ | |
| 411 | + if(endMap1.get(m.get("lineCode").toString())>=maxtime){ | |
| 412 | + yyzt="营运"; | |
| 413 | + }else{ | |
| 414 | + yyzt="未营运"; | |
| 415 | + } | |
| 416 | + }else{ | |
| 417 | + yyzt="未营运"; | |
| 418 | + } | |
| 419 | + }else{ | |
| 420 | + if(endMap2.get(m.get("lineCode").toString())!=null){ | |
| 421 | + if(endMap2.get(m.get("lineCode").toString())>=maxtime){ | |
| 422 | + yyzt="营运"; | |
| 423 | + }else{ | |
| 424 | + yyzt="未营运"; | |
| 425 | + } | |
| 426 | + }else{ | |
| 427 | + yyzt="未营运"; | |
| 428 | + } | |
| 429 | + } | |
| 430 | + m.put("state", yyzt); | |
| 431 | + } | |
| 192 | 432 | return list; |
| 193 | 433 | } |
| 194 | 434 | /* |
| ... | ... | @@ -270,6 +510,91 @@ public class BigdateService { |
| 270 | 510 | */ |
| 271 | 511 | |
| 272 | 512 | /* |
| 513 | + * 线路配人接口开始 | |
| 514 | + */ | |
| 515 | + @GET | |
| 516 | + @Path("/linePerson/{type}/date/{date}") | |
| 517 | + public List<Map<String, Object>> findLinePersonByDate(@PathParam("type") String type,@PathParam("date") String date) { | |
| 518 | + String sql=""; | |
| 519 | + if(type.equals("all")){ | |
| 520 | + sql="select t.date,t.gsdm,t.xl,t.xl_name,t.jhprz as jhpr,t.sjpr" | |
| 521 | + + " from bsth_c_calc_count t where t.date='"+date+"'"; | |
| 522 | + } | |
| 523 | + if(type.equals("actual")){ | |
| 524 | + sql="select t.date,t.gsdm,t.xl,t.xl_name,t.jhprss as jhpr,t.sjpr" | |
| 525 | + + " from bsth_c_calc_count t where t.date='"+date+"'"; | |
| 526 | + } | |
| 527 | + List<Map<String, Object>> list=jdbcTemplate.query(sql, | |
| 528 | + new RowMapper<Map<String, Object>>(){ | |
| 529 | + @Override | |
| 530 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 531 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 532 | + m.put("date", rs.getString("date")); | |
| 533 | + m.put("company", rs.getString("gsdm")); | |
| 534 | + m.put("companyName", getGs(rs.getString("gsdm"))); | |
| 535 | + m.put("lineCode",rs.getString("xl")); | |
| 536 | + m.put("lineName", rs.getString("xl_name")); | |
| 537 | + String jhpr=rs.getString("jhpr"); | |
| 538 | + m.put("jhjsy", jhpr.split("/")[0]); | |
| 539 | + m.put("jhspy", jhpr.split("/")[1]); | |
| 540 | + String sjpr= rs.getString("sjpr"); | |
| 541 | + m.put("sjjsy", sjpr.split("/")[0]); | |
| 542 | + m.put("sjspy", sjpr.split("/")[1]); | |
| 543 | + return m; | |
| 544 | + } | |
| 545 | + }); | |
| 546 | + | |
| 547 | + return list; | |
| 548 | + } | |
| 549 | + | |
| 550 | + | |
| 551 | + @GET | |
| 552 | + @Path("/linePerson/{type}/date/{date}/line/{line}") | |
| 553 | + public List<Map<String, Object>> findLinePersonByDateLine(@PathParam("type") String type,@PathParam("date") String date, | |
| 554 | + @PathParam("line") String line) { | |
| 555 | + String sql=""; | |
| 556 | + if(type.equals("all")){ | |
| 557 | + sql="select t.date,t.gsdm,t.xl,t.xl_name,t.jhprz as jhpr,t.sjpr" | |
| 558 | + + " from bsth_c_calc_count t where t.date='"+date+"'" | |
| 559 | + + " and xl ='"+line+"'"; | |
| 560 | + } | |
| 561 | + if(type.equals("actual")){ | |
| 562 | + sql="select t.date,t.gsdm,t.xl,t.xl_name,t.jhprss as jhpr,t.sjpr" | |
| 563 | + + " from bsth_c_calc_count t where t.date='"+date+"'" | |
| 564 | + + " and xl ='"+line+"'"; | |
| 565 | + } | |
| 566 | + List<Map<String, Object>> list=jdbcTemplate.query(sql, | |
| 567 | + new RowMapper<Map<String, Object>>(){ | |
| 568 | + @Override | |
| 569 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 570 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 571 | + m.put("date", rs.getString("date")); | |
| 572 | + m.put("company", rs.getString("gsdm")); | |
| 573 | + m.put("companyName", getGs(rs.getString("gsdm"))); | |
| 574 | + m.put("lineCode",rs.getString("xl")); | |
| 575 | + m.put("lineName", rs.getString("xl_name")); | |
| 576 | + String jhpr=rs.getString("jhpr"); | |
| 577 | + m.put("jhjsy", jhpr.split("/")[0]); | |
| 578 | + m.put("jhspy", jhpr.split("/")[1]); | |
| 579 | + String sjpr= rs.getString("sjpr"); | |
| 580 | + m.put("sjjsy", sjpr.split("/")[0]); | |
| 581 | + m.put("sjspy", sjpr.split("/")[1]); | |
| 582 | + return m; | |
| 583 | + } | |
| 584 | + }); | |
| 585 | + | |
| 586 | + return list; | |
| 587 | + } | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + /* | |
| 593 | + * 线路配人接口结束 | |
| 594 | + */ | |
| 595 | + | |
| 596 | + | |
| 597 | + /* | |
| 273 | 598 | * 线路班次接口开始 |
| 274 | 599 | */ |
| 275 | 600 | @GET |
| ... | ... | @@ -597,17 +922,18 @@ public class BigdateService { |
| 597 | 922 | *安全驾驶接口开始 |
| 598 | 923 | */ |
| 599 | 924 | @GET |
| 600 | - @Path("/safedriving/date/{date}") | |
| 601 | - public List<Map<String, Object>> findSafedriving(@PathParam("date") String date) { | |
| 602 | - String accidentAll= GetHttpInterface.getHttpInterface("http://180.166.5.82:9006/safedriving/safedrivingInterface?StarTime="+date); | |
| 925 | + @Path("/safedriving/starDate/{starDate}/endDate/{endDate}") | |
| 926 | + public List<Map<String, Object>> findSafedriving(@PathParam("starDate") String starDate, | |
| 927 | + @PathParam("endDate") String endDate) { | |
| 928 | + String accidentAll= GetHttpInterface.getHttpInterface("http://180.166.5.82:9006/safedriving/safedrivingInterface?StarTime="+starDate+"&EndTime="+endDate); | |
| 603 | 929 | List<Map<String, Object>> list=(List<Map<String, Object>>) JSONObject.parse(accidentAll); |
| 604 | 930 | return list; |
| 605 | 931 | } |
| 606 | 932 | @GET |
| 607 | - @Path("/safedriving/date/{date}/line/{line}") | |
| 608 | - public List<Map<String, Object>> findSafedrivingByLine(@PathParam("date") String date, | |
| 609 | - @PathParam("line") String line) { | |
| 610 | - String accidentAll= GetHttpInterface.getHttpInterface("http://180.166.5.82:9006/safedriving/safedrivingInterface?StarTime="+date | |
| 933 | + @Path("/safedriving/starDate/{starDate}/endDate/{endDate}/line/{line}") | |
| 934 | + public List<Map<String, Object>> findSafedrivingByLine(@PathParam("starDate") String starDate, | |
| 935 | + @PathParam("endDate") String endDate,@PathParam("line") String line) { | |
| 936 | + String accidentAll= GetHttpInterface.getHttpInterface("http://180.166.5.82:9006/safedriving/safedrivingInterface?StarTime="+starDate+"&EndTime="+endDate | |
| 611 | 937 | +"&LineId="+line); |
| 612 | 938 | List<Map<String, Object>> list=(List<Map<String, Object>>) JSONObject.parse(accidentAll); |
| 613 | 939 | return list; | ... | ... |