Commit 564d0ca05cd4744c72552c4959bc650fcfe0b256

Authored by 娄高锋
1 parent 12eb1138

update

src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -375,11 +375,11 @@ public class ReportServiceImpl implements ReportService{ @@ -375,11 +375,11 @@ public class ReportServiceImpl implements ReportService{
375 String[] minSjs = minfcsj.split(":"); 375 String[] minSjs = minfcsj.split(":");
376 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); 376 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
377 //查询时间里程 377 //查询时间里程
378 - String sqlPc=" (SELECT jhlc,fcsj,bc_type,lp,2 as xh FROM bsth_c_s_ttinfo_detail " 378 + String sqlPc=" (SELECT jhlc,fcsj,bc_type,lp,2 as xh, ists FROM bsth_c_s_ttinfo_detail "
379 + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) " 379 + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
380 + " union " 380 + " union "
381 - + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh FROM bsth_c_s_ttinfo_detail "  
382 - + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj"; 381 + + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh, ists FROM bsth_c_s_ttinfo_detail "
  382 + + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj";
383 383
384 Map<String, Object> map=new HashMap<String,Object>(); 384 Map<String, Object> map=new HashMap<String,Object>();
385 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, 385 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
@@ -391,6 +391,7 @@ public class ReportServiceImpl implements ReportService{ @@ -391,6 +391,7 @@ public class ReportServiceImpl implements ReportService{
391 m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc")); 391 m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
392 m.put("bcType", rs.getString("bc_type")); 392 m.put("bcType", rs.getString("bc_type"));
393 m.put("lp", rs.getString("lp")); 393 m.put("lp", rs.getString("lp"));
  394 + m.put("ists", rs.getObject("ists")==null?"0":rs.getString("ists"));
394 return m; 395 return m;
395 } 396 }
396 }); 397 });
@@ -400,6 +401,7 @@ public class ReportServiceImpl implements ReportService{ @@ -400,6 +401,7 @@ public class ReportServiceImpl implements ReportService{
400 int sj=0; 401 int sj=0;
401 402
402 for(int i=0;i<list.size();i++){ 403 for(int i=0;i<list.size();i++){
  404 + int temp = 0;
403 Map<String, Object> m=list.get(i); 405 Map<String, Object> m=list.get(i);
404 String time=m.get("fcsj").toString(); 406 String time=m.get("fcsj").toString();
405 String[] times = time.split(":"); 407 String[] times = time.split(":");
@@ -408,7 +410,7 @@ public class ReportServiceImpl implements ReportService{ @@ -408,7 +410,7 @@ public class ReportServiceImpl implements ReportService{
408 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){ 410 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
409 if(m.get("bcType").equals("in")){ 411 if(m.get("bcType").equals("in")){
410 if(sj!=0){ 412 if(sj!=0){
411 - yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj; 413 + temp =(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
412 } 414 }
413 sj=0; 415 sj=0;
414 } 416 }
@@ -418,7 +420,7 @@ public class ReportServiceImpl implements ReportService{ @@ -418,7 +420,7 @@ public class ReportServiceImpl implements ReportService{
418 if(sj==0){ 420 if(sj==0){
419 sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]); 421 sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
420 }else{ 422 }else{
421 - yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj; 423 + temp =(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
422 sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]); 424 sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
423 } 425 }
424 } 426 }
@@ -426,7 +428,7 @@ public class ReportServiceImpl implements ReportService{ @@ -426,7 +428,7 @@ public class ReportServiceImpl implements ReportService{
426 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){ 428 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
427 if(m.get("bcType").equals("in")){ 429 if(m.get("bcType").equals("in")){
428 if(sj!=0){ 430 if(sj!=0){
429 - yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj; 431 + temp =Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
430 } 432 }
431 sj=0; 433 sj=0;
432 } 434 }
@@ -436,7 +438,7 @@ public class ReportServiceImpl implements ReportService{ @@ -436,7 +438,7 @@ public class ReportServiceImpl implements ReportService{
436 if(sj==0){ 438 if(sj==0){
437 sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]); 439 sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
438 }else{ 440 }else{
439 - yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj; 441 + temp =Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
440 sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]); 442 sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
441 } 443 }
442 } 444 }
@@ -451,6 +453,9 @@ public class ReportServiceImpl implements ReportService{ @@ -451,6 +453,9 @@ public class ReportServiceImpl implements ReportService{
451 lp=m.get("lp").toString(); 453 lp=m.get("lp").toString();
452 454
453 } 455 }
  456 + if(m.containsKey("ists") && m.get("ists").equals("1")){
  457 + sj = 0;
  458 + }
454 } 459 }
455 if(yysj>0){ 460 if(yysj>0){
456 yycs =yygl/(yysj*1.0/60); 461 yycs =yygl/(yysj*1.0/60);
src/main/resources/static/pages/report/timetable/timetable.html
@@ -261,6 +261,9 @@ @@ -261,6 +261,9 @@
261 } 261 }
262 initPinYinSelect2('#line',data,''); 262 initPinYinSelect2('#line',data,'');
263 fage=true; 263 fage=true;
  264 +
  265 + line = data[0].id;
  266 + updateTtinfo();
264 } 267 }
265 268
266 269
@@ -271,7 +274,7 @@ @@ -271,7 +274,7 @@
271 flag = 1; 274 flag = 1;
272 var treeData = []; 275 var treeData = [];
273 var params = {}; 276 var params = {};
274 - params['line'] = $("#line").val(); 277 + params['line'] = line;
275 $get('/report/getTtinfo', params, function(result){ 278 $get('/report/getTtinfo', params, function(result){
276 treeData = createTreeData(result); 279 treeData = createTreeData(result);
277 var options = '<option value="">请选择...</option>'; 280 var options = '<option value="">请选择...</option>';
@@ -284,12 +287,15 @@ @@ -284,12 +287,15 @@
284 } 287 }
285 288
286 $("#line").on("change", function(){ 289 $("#line").on("change", function(){
  290 + line = $("#line").val();
287 updateTtinfo(); 291 updateTtinfo();
288 }) 292 })
289 293
  294 + var line = $("#line").val();
  295 +
290 //查询 296 //查询
291 $("#query").on('click',function(){ 297 $("#query").on('click',function(){
292 - var line = $("#line").val(); 298 + line = $("#line").val();
293 var xlName = $("#select2-line-container").html(); 299 var xlName = $("#select2-line-container").html();
294 var ttinfo = $("#ttinfo").val(); 300 var ttinfo = $("#ttinfo").val();
295 if(line==null || line ==""){ 301 if(line==null || line ==""){