Commit f6ff2976ae80551cfd35bc8466d8c30fc2deaa45

Authored by 娄高锋
1 parent 5fef2d7b

update

src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -217,6 +217,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
217 217 // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
218 218 sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'" +
219 219 " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'";
  220 + if(line.length() != 0){
  221 + sql += " and xl_bm = '"+line+"'";
  222 + }
220 223  
221 224 ttList = jdbcTemplate.query(sql,
222 225 new RowMapper<Long>(){
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -638,6 +638,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
638 638 // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
639 639 sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'" +
640 640 " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'";
  641 + if(line.length() != 0){
  642 + sql += " and xl_bm = '"+line+"'";
  643 + }
641 644  
642 645 ttList = jdbcTemplate.query(sql,
643 646 new RowMapper<Long>(){
... ... @@ -646,7 +649,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
646 649 return rs.getLong("id");
647 650 }
648 651 });
649   -
650 652 }
651 653  
652 654 } catch (Exception e) {
... ... @@ -1127,38 +1129,39 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1127 1129 @Override
1128 1130 public List<Map<String, Object>> getModel(Map<String, Object> map) {
1129 1131 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
1130   - List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
1131   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
1132   - SimpleDateFormat sdfEE = new SimpleDateFormat("EEEE");
  1132 +// List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  1133 +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  1134 +// SimpleDateFormat sdfEE = new SimpleDateFormat("EEEE");
1133 1135  
1134 1136 String line = map.get("line").toString();
1135 1137 String startDate = map.get("startDate").toString();
1136 1138 String endDate = map.get("endDate").toString();
  1139 + String isCancel = "";
1137 1140  
1138   - if(startDate.length() == 0){
1139   - startDate = sdf.format(new Date());
1140   - }
1141   - if(endDate.length() == 0){
1142   - endDate = sdf.format(new Date());
  1141 + if(map.containsKey("isCancel") && map.get("isCancel").toString().trim().length() > 0){
  1142 + isCancel = map.get("isCancel").toString().trim();
1143 1143 }
1144 1144 try {
1145   -
1146   - String sql = "select tt.id, tt.name, qyrq, tt.rule_days, tt.special_days from bsth_c_s_ttinfo tt left join bsth_c_line cl on cl.id = tt.xl where tt.is_cancel = 0 and tt.is_enable_dis_template = 1";
1147   - if(line.length() != 0){
1148   - sql += " and cl.line_code = '"+line+"'";
  1145 + String sql = "select tt.id, tt.name from bsth_c_s_ttinfo tt left join" +
  1146 + " (select tt_info from bsth_c_s_sp_info where 1=1";
  1147 + if(startDate.trim().length() > 0)
  1148 + sql += " and schedule_date >= '"+startDate+"'";
  1149 + if(endDate.trim().length() > 0)
  1150 + sql += " and schedule_date <= '"+endDate+"'";
  1151 + if(line.trim().length() != 0){
  1152 + sql += " and xl_bm = '"+line+"'";
  1153 + } else {
  1154 + return resList;
1149 1155 }
1150   - sql += " order by tt.create_date desc";
  1156 + sql += " ) sp on sp.tt_info = tt.id where sp.tt_info is not null group by tt.id, tt.name";
1151 1157  
1152   - list = jdbcTemplate.query(sql,
  1158 + resList = jdbcTemplate.query(sql,
1153 1159 new RowMapper<Map<String, Object>>(){
1154 1160 @Override
1155 1161 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
1156 1162 Map<String, Object> map = new HashMap<String, Object>();
1157 1163 map.put("id", rs.getString("id"));
1158 1164 map.put("name", rs.getString("name"));
1159   - map.put("qyrq", rs.getString("qyrq"));
1160   - map.put("ruleDays", rs.getString("rule_days"));
1161   - map.put("specialDays", rs.getString("special_days"));
1162 1165 return map;
1163 1166 }
1164 1167 });
... ... @@ -1168,73 +1171,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1168 1171 e.printStackTrace();
1169 1172 }
1170 1173  
1171   - Date date1 = null;
1172   - Date date2 = null;
1173   - try {
1174   - date1 = sdf.parse(startDate);
1175   - date2 = sdf.parse(endDate);
1176   - } catch (ParseException e) {
1177   - // TODO Auto-generated catch block
1178   - e.printStackTrace();
1179   - }
1180   -
1181   - Set<Integer> ruleDays1 = new HashSet<Integer>();
1182   - List<String> specialDays1 = new ArrayList<String>();
1183   - for(long i = 0; ; i++){
1184   - Date tempDate = new Date(date1.getTime() + i*1000*60*60*24);
1185   - if(tempDate.getTime() > date2.getTime())
1186   - break;
1187   - String week = sdfEE.format(tempDate);
1188   - if(week.equals("星期一"))
1189   - ruleDays1.add(0);
1190   - else if(week.equals("星期二"))
1191   - ruleDays1.add(1);
1192   - else if(week.equals("星期三"))
1193   - ruleDays1.add(2);
1194   - else if(week.equals("星期四"))
1195   - ruleDays1.add(3);
1196   - else if(week.equals("星期五"))
1197   - ruleDays1.add(4);
1198   - else if(week.equals("星期六"))
1199   - ruleDays1.add(5);
1200   - else if(week.equals("星期日"))
1201   - ruleDays1.add(6);
1202   - specialDays1.add(sdf.format(tempDate));
1203   - }
1204   - for(Map<String, Object> m : list){
1205   - String[] ruleDays = m.get("ruleDays").toString().split(",");
1206   - String[] specialDays = m.get("specialDays").toString().split(",");
1207   - boolean flag = false;
1208   - DO:{
1209   - try {
1210   - long qyrq = sdf.parse(m.get("qyrq").toString()).getTime();
1211   - if(qyrq > date2.getTime())
1212   - break DO;
1213   - } catch (ParseException e) {
1214   - // TODO Auto-generated catch block
1215   - e.printStackTrace();
1216   - }
1217   - for(int i = 0; i < ruleDays.length; i++){
1218   - if(ruleDays[i].equals("1")){
1219   - if(ruleDays1.contains(i)){
1220   - flag = true;
1221   - break DO;
1222   - }
1223   - }
1224   - }
1225   - for(int i = 0; i < specialDays.length; i++){
1226   - for(int j = 0; j < specialDays1.size(); j++){
1227   - if(specialDays[i].equals(specialDays1.get(j))){
1228   - flag = true;
1229   - break DO;
1230   - }
1231   - }
1232   - }
1233   - }
1234   - if(flag)
1235   - resList.add(m);
1236   - }
1237   -
1238 1174 return resList;
1239 1175 }
1240 1176  
... ...
src/main/resources/static/pages/forms/statement/busInterval.html
... ... @@ -399,38 +399,38 @@
399 399 flag = 1;
400 400 var treeData = [];
401 401 var params = {};
402   -// if(statu == 0)
403   -// params['line'] = " ";
404   -// if(statu == 1)
405   -// params['line'] = line;
406   -// params['startDate'] = startDate;
407   -// params['endDate'] = endDate;
408   -// $get('/pcpc/getModel', params, function(result){
409   -// treeData = createTreeData(result);
410   -// var options = '<option value="">请选择...</option>';
411   -// $.each(treeData, function(i, g){
412   -// options += '<option value="'+g.id+'">'+g.name+'</option>';
413   -// });
414   -// $('#model').html(options)/* .select2() */;
415   -// flag = 0;
416   -// });
417 402 if(statu == 0)
  403 + params['line'] = " ";
  404 + if(statu == 1)
  405 + params['line'] = line;
  406 + params['startDate'] = $("#startDate").val();
  407 + params['endDate'] = $("#endDate").val();
  408 + $get('/pcpc/getModel', params, function(result){
  409 + treeData = createTreeData(result);
418 410 var options = '<option value="">请选择...</option>';
  411 + $.each(treeData, function(i, g){
  412 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  413 + });
419 414 $('#model').html(options)/* .select2() */;
420 415 flag = 0;
421   - if(statu == 1){
422   - params['xl.lineCode_eq'] = line;
423   - $get('/tic_ec', params, function(result){
424   - treeData = createTreeData(result.data.content);
425   - var options = '<option value="">请选择...</option>';
426   - $.each(treeData, function(i, g){
427   - if(!g.isCancel)
428   - options += '<option value="'+g.id+'">'+g.name+'</option>';
429   - });
430   - $('#model').html(options)/* .select2() */;
431   - flag = 0;
432   - });
433   - }
  416 + });
  417 +// if(statu == 0)
  418 +// var options = '<option value="">请选择...</option>';
  419 +// $('#model').html(options)/* .select2() */;
  420 +// flag = 0;
  421 +// if(statu == 1){
  422 +// params['xl.lineCode_eq'] = line;
  423 +// $get('/tic_ec', params, function(result){
  424 +// treeData = createTreeData(result.data.content);
  425 +// var options = '<option value="">请选择...</option>';
  426 +// $.each(treeData, function(i, g){
  427 +// if(!g.isCancel)
  428 +// options += '<option value="'+g.id+'">'+g.name+'</option>';
  429 +// });
  430 +// $('#model').html(options)/* .select2() */;
  431 +// flag = 0;
  432 +// });
  433 +// }
434 434 }
435 435  
436 436 /**
... ...
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
... ... @@ -473,29 +473,29 @@
473 473 flag = 1;
474 474 var treeData = [];
475 475 var params = {};
476   -// params['line'] = line;
477   -// params['startDate'] = startDate;
478   -// params['endDate'] = endDate;
479   -// $get('/pcpc/getModel', params, function(result){
480   -// treeData = createTreeData(result);
481   -// var options = '<option value="">请选择...</option>';
482   -// $.each(treeData, function(i, g){
483   -// options += '<option value="'+g.id+'">'+g.name+'</option>';
484   -// });
485   -// $('#model').html(options)/* .select2() */;
486   -// flag = 0;
487   -// });
488   - params['xl.lineCode_eq'] = line;
489   - $get('/tic_ec', params, function(result){
490   - treeData = createTreeData(result.data.content);
  476 + params['line'] = line;
  477 + params['startDate'] = startDate;
  478 + params['endDate'] = endDate;
  479 + $get('/pcpc/getModel', params, function(result){
  480 + treeData = createTreeData(result);
491 481 var options = '<option value="">请选择...</option>';
492 482 $.each(treeData, function(i, g){
493   - if(!g.isCancel)
494   - options += '<option value="'+g.id+'">'+g.name+'</option>';
  483 + options += '<option value="'+g.id+'">'+g.name+'</option>';
495 484 });
496 485 $('#model').html(options)/* .select2() */;
497 486 flag = 0;
498 487 });
  488 +// params['xl.lineCode_eq'] = line;
  489 +// $get('/tic_ec', params, function(result){
  490 +// treeData = createTreeData(result.data.content);
  491 +// var options = '<option value="">请选择...</option>';
  492 +// $.each(treeData, function(i, g){
  493 +// if(!g.isCancel)
  494 +// options += '<option value="'+g.id+'">'+g.name+'</option>';
  495 +// });
  496 +// $('#model').html(options)/* .select2() */;
  497 +// flag = 0;
  498 +// });
499 499 }
500 500  
501 501 /**
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -315,31 +315,32 @@
315 315 flag = 1;
316 316 var treeData = [];
317 317 var params = {};
318   -// params['line'] = line;
319   -// params['startDate'] = startDate;
320   -// params['endDate'] = endDate;
321   -// $get('/pcpc/getModel', params, function(result){
322   -// treeData = createTreeData(result);
323   -// var options = '<option value="">请选择...</option>';
324   -// var size = 0;
325   -// $.each(treeData, function(i, g){
326   -// options += '<option value="'+g.id+'">'+g.name+'</option>';
327   -// size++;
328   -// });
329   -// $('#model').html(options)/* .select2() */;
330   -// flag = 0;
331   -// });
332   - params['xl.lineCode_eq'] = line;
333   - $get('/tic_ec', params, function(result){
334   - treeData = createTreeData(result.data.content);
  318 + params['line'] = line;
  319 + params['startDate'] = startDate;
  320 + params['endDate'] = endDate;
  321 + $('#model').html('<option value="">载入中...</option>');
  322 + $get('/pcpc/getModel', params, function(result){
  323 + treeData = createTreeData(result);
335 324 var options = '<option value="">请选择...</option>';
  325 + var size = 0;
336 326 $.each(treeData, function(i, g){
337   - if(!g.isCancel)
338   - options += '<option value="'+g.id+'">'+g.name+'</option>';
  327 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  328 + size++;
339 329 });
340 330 $('#model').html(options)/* .select2() */;
341 331 flag = 0;
342 332 });
  333 +// params['xl.lineCode_eq'] = line;
  334 +// $get('/tic_ec', params, function(result){
  335 +// treeData = createTreeData(result.data.content);
  336 +// var options = '<option value="">请选择...</option>';
  337 +// $.each(treeData, function(i, g){
  338 +// if(!g.isCancel)
  339 +// options += '<option value="'+g.id+'">'+g.name+'</option>';
  340 +// });
  341 +// $('#model').html(options)/* .select2() */;
  342 +// flag = 0;
  343 +// });
343 344 }
344 345  
345 346 /**
... ...
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
... ... @@ -455,38 +455,38 @@
455 455 flag = 1;
456 456 var treeData = [];
457 457 var params = {};
458   -// if(statu == 0)
459   -// params['line'] = " ";
460   -// if(statu == 1)
461   -// params['line'] = line;
462   -// params['startDate'] = startDate;
463   -// params['endDate'] = endDate;
464   -// $get('/pcpc/getModel', params, function(result){
465   -// treeData = createTreeData(result);
466   -// var options = '<option value="">请选择...</option>';
467   -// $.each(treeData, function(i, g){
468   -// options += '<option value="'+g.id+'">'+g.name+'</option>';
469   -// });
470   -// $('#model').html(options);
471   -// flag = 0;
472   -// });
473 458 if(statu == 0)
  459 + params['line'] = " ";
  460 + if(statu == 1)
  461 + params['line'] = line;
  462 + params['startDate'] = $("#startDate").val();
  463 + params['endDate'] = $("#endDate").val();
  464 + $get('/pcpc/getModel', params, function(result){
  465 + treeData = createTreeData(result);
474 466 var options = '<option value="">请选择...</option>';
475   - $('#model').html(options)/* .select2() */;
476   - flag = 0;
477   - if(statu == 1){
478   - params['xl.lineCode_eq'] = line;
479   - $get('/tic_ec', params, function(result){
480   - treeData = createTreeData(result.data.content);
481   - var options = '<option value="">请选择...</option>';
482   - $.each(treeData, function(i, g){
483   - if(!g.isCancel)
484   - options += '<option value="'+g.id+'">'+g.name+'</option>';
485   - });
486   - $('#model').html(options)/* .select2() */;
487   - flag = 0;
  467 + $.each(treeData, function(i, g){
  468 + options += '<option value="'+g.id+'">'+g.name+'</option>';
488 469 });
489   - }
  470 + $('#model').html(options);
  471 + flag = 0;
  472 + });
  473 +// if(statu == 0)
  474 +// var options = '<option value="">请选择...</option>';
  475 +// $('#model').html(options)/* .select2() */;
  476 +// flag = 0;
  477 +// if(statu == 1){
  478 +// params['xl.lineCode_eq'] = line;
  479 +// $get('/tic_ec', params, function(result){
  480 +// treeData = createTreeData(result.data.content);
  481 +// var options = '<option value="">请选择...</option>';
  482 +// $.each(treeData, function(i, g){
  483 +// if(!g.isCancel)
  484 +// options += '<option value="'+g.id+'">'+g.name+'</option>';
  485 +// });
  486 +// $('#model').html(options)/* .select2() */;
  487 +// flag = 0;
  488 +// });
  489 +// }
490 490 }
491 491  
492 492 function updateLp(ttId){
... ...