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 375 String[] minSjs = minfcsj.split(":");
376 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 379 + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
380 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 384 Map<String, Object> map=new HashMap<String,Object>();
385 385 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
... ... @@ -391,6 +391,7 @@ public class ReportServiceImpl implements ReportService{
391 391 m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
392 392 m.put("bcType", rs.getString("bc_type"));
393 393 m.put("lp", rs.getString("lp"));
  394 + m.put("ists", rs.getObject("ists")==null?"0":rs.getString("ists"));
394 395 return m;
395 396 }
396 397 });
... ... @@ -400,6 +401,7 @@ public class ReportServiceImpl implements ReportService{
400 401 int sj=0;
401 402  
402 403 for(int i=0;i<list.size();i++){
  404 + int temp = 0;
403 405 Map<String, Object> m=list.get(i);
404 406 String time=m.get("fcsj").toString();
405 407 String[] times = time.split(":");
... ... @@ -408,7 +410,7 @@ public class ReportServiceImpl implements ReportService{
408 410 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
409 411 if(m.get("bcType").equals("in")){
410 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 415 sj=0;
414 416 }
... ... @@ -418,7 +420,7 @@ public class ReportServiceImpl implements ReportService{
418 420 if(sj==0){
419 421 sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
420 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 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 428 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
427 429 if(m.get("bcType").equals("in")){
428 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 433 sj=0;
432 434 }
... ... @@ -436,7 +438,7 @@ public class ReportServiceImpl implements ReportService{
436 438 if(sj==0){
437 439 sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
438 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 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 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 460 if(yysj>0){
456 461 yycs =yygl/(yysj*1.0/60);
... ...
src/main/resources/static/pages/report/timetable/timetable.html
... ... @@ -261,6 +261,9 @@
261 261 }
262 262 initPinYinSelect2('#line',data,'');
263 263 fage=true;
  264 +
  265 + line = data[0].id;
  266 + updateTtinfo();
264 267 }
265 268  
266 269  
... ... @@ -271,7 +274,7 @@
271 274 flag = 1;
272 275 var treeData = [];
273 276 var params = {};
274   - params['line'] = $("#line").val();
  277 + params['line'] = line;
275 278 $get('/report/getTtinfo', params, function(result){
276 279 treeData = createTreeData(result);
277 280 var options = '<option value="">请选择...</option>';
... ... @@ -284,12 +287,15 @@
284 287 }
285 288  
286 289 $("#line").on("change", function(){
  290 + line = $("#line").val();
287 291 updateTtinfo();
288 292 })
289 293  
  294 + var line = $("#line").val();
  295 +
290 296 //查询
291 297 $("#query").on('click',function(){
292   - var line = $("#line").val();
  298 + line = $("#line").val();
293 299 var xlName = $("#select2-line-container").html();
294 300 var ttinfo = $("#ttinfo").val();
295 301 if(line==null || line ==""){
... ...