Commit ecf01a0cc2e23e687438faed88469fabd85f8554

Authored by 娄高锋
1 parent 3853ecfc

LGF 报表

src/main/java/com/bsth/controller/schedule/PeopleCarPlanController.java
... ... @@ -20,33 +20,33 @@ public class PeopleCarPlanController {
20 20 private PeopleCarPlanService peopleCarPlanService;
21 21  
22 22 @RequestMapping(value = "/queryPeopleCar", method = RequestMethod.GET)
23   - public List<Map<String,Object>> queryPeopleCar(@RequestParam String line, @RequestParam String date, @RequestParam String type){
24   - return peopleCarPlanService.queryPeopleCar(line, date, type);
  23 + public List<Map<String,Object>> queryPeopleCar(@RequestParam Map<String, Object> map){
  24 + return peopleCarPlanService.queryPeopleCar(map);
25 25 }
26 26  
27 27 @RequestMapping(value="/workDaily", method = RequestMethod.GET)
28   - public List<Map<String,Object>> workDaily(@RequestParam String line, @RequestParam String date, @RequestParam String type){
29   - return peopleCarPlanService.workDaily(line, date, type);
  28 + public List<Map<String,Object>> workDaily(@RequestParam Map<String, Object> map){
  29 + return peopleCarPlanService.workDaily(map);
30 30 }
31 31  
32 32 @RequestMapping(value="/scheduleAnaly", method = RequestMethod.GET)
33   - public Map<String, Object> scheduleAnaly(@RequestParam String page, @RequestParam String line, @RequestParam String startDate, @RequestParam String endDate, @RequestParam String model, @RequestParam String type){
34   - return peopleCarPlanService.scheduleAnaly(page, line, startDate, endDate, model, type);
  33 + public Map<String, Object> scheduleAnaly(@RequestParam Map<String, Object> map){
  34 + return peopleCarPlanService.scheduleAnaly(map);
35 35 }
36 36  
37 37 @RequestMapping(value="/getModel", method = RequestMethod.GET)
38   - public List<Map<String,Object>> getModel(@RequestParam String line, @RequestParam String startDate, @RequestParam String endDate){
39   - return peopleCarPlanService.getModel(line, startDate, endDate);
  38 + public List<Map<String,Object>> getModel(@RequestParam Map<String, Object> map){
  39 + return peopleCarPlanService.getModel(map);
40 40 }
41 41  
42 42 @RequestMapping(value="/firstAndLastBus", method = RequestMethod.GET)
43   - public List<Map<String,Object>> firstAndLastBus(@RequestParam String line, @RequestParam String date, @RequestParam String type){
44   - return peopleCarPlanService.firstAndLastBus(line, date, type);
  43 + public List<Map<String,Object>> firstAndLastBus(@RequestParam Map<String, Object> map){
  44 + return peopleCarPlanService.firstAndLastBus(map);
45 45 }
46 46  
47 47 @RequestMapping(value="/commandState", method = RequestMethod.GET)
48   - public List<Map<String,Object>> commandState(@RequestParam String line, @RequestParam String date, @RequestParam String code){
49   - return peopleCarPlanService.commandState(line, date, code);
  48 + public List<Map<String,Object>> commandState(@RequestParam Map<String, Object> map){
  49 + return peopleCarPlanService.commandState(map);
50 50 }
51 51  
52 52 }
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -18,7 +18,6 @@ import org.springframework.jdbc.core.RowMapper;
18 18 import org.springframework.stereotype.Service;
19 19  
20 20 import com.bsth.entity.realcontrol.ScheduleRealInfo;
21   -import com.bsth.entity.schedule.TTInfoDetail;
22 21 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
23 22 import com.bsth.service.BusIntervalService;
24 23 import com.bsth.service.schedule.PeopleCarPlanService;
... ... @@ -39,8 +38,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
39 38 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
40 39 private DecimalFormat df = new DecimalFormat("##0.00");
41 40  
42   - public List<ScheduleRealInfo> getSchedule(String line, String startDate, String endDate, String model, String times){
43   - List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>();
  41 + public List<ScheduleRealInfo> getSchedule(String company, String subCompany, String line, String startDate, String endDate, String model, String times){
  42 + List<Long> ttList = new ArrayList<Long>();
44 43 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
45 44 List<ScheduleRealInfo> resList = new ArrayList<ScheduleRealInfo>();
46 45  
... ... @@ -54,6 +53,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
54 53 String[] split = times.split("-");
55 54 sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'";
56 55 }
  56 + if(company.length() != 0){
  57 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  58 + }
57 59 sql += " and bc_type = 'normal'";
58 60  
59 61 list =jdbcTemplate.query(sql,
... ... @@ -85,23 +87,20 @@ public class BusIntervalServiceImpl implements BusIntervalService {
85 87 schedule.setClZbh(rs.getString("cl_zbh"));
86 88 schedule.setjGh(rs.getString("j_gh"));
87 89 schedule.setjName(rs.getString("j_name"));
  90 + schedule.setSpId(rs.getLong("sp_id"));
88 91 return schedule;
89 92 }
90 93 });
91 94  
92 95 if(model.length() != 0){
93   - sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'";
  96 +// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'";
  97 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type = 'normal'";
94 98  
95 99 ttList =jdbcTemplate.query(sql,
96   - new RowMapper<TTInfoDetail>(){
  100 + new RowMapper<Long>(){
97 101 @Override
98   - public TTInfoDetail mapRow(ResultSet rs, int rowNum) throws SQLException {
99   - TTInfoDetail ttInfo = new TTInfoDetail();
100   - ttInfo.setBcType(rs.getString("bc_type"));
101   - ttInfo.setBcs(rs.getInt("bcs"));
102   - ttInfo.setFcsj(rs.getString("fcsj"));
103   - ttInfo.setBcsj(rs.getInt("bcsj"));
104   - return ttInfo;
  102 + public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
  103 + return rs.getLong("id");
105 104 }
106 105 });
107 106 }
... ... @@ -133,11 +132,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
133 132 }
134 133 DO:{
135 134 if(model.length() != 0){
136   - for(TTInfoDetail tt : ttList){
137   - if(tt.getBcs() == schedule.getBcs() && tt.getFcsj().equals(schedule.getFcsj())
138   - && tt.getBcsj() == schedule.getBcsj()){
139   - resList.add(schedule);
140   - break DO;
  135 + for(Long tt : ttList){
  136 + if(tt == schedule.getSpId()){
  137 + resList.add(schedule);
  138 + break DO;
141 139 }
142 140 }
143 141 } else {
... ... @@ -210,7 +208,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
210 208 public List<Map<String, Object>> interval(Map<String, Object> map) {
211 209 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
212 210 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
213   -
  211 +
  212 + String company = map.get("company").toString();
  213 + String subCompany = map.get("subCompany").toString();
214 214 String line = map.get("line").toString();
215 215 String startDate = map.get("startDate").toString();
216 216 String endDate = map.get("endDate").toString();
... ... @@ -228,7 +228,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
228 228 times = "06:00-07:00";
229 229 }
230 230  
231   - List<ScheduleRealInfo> list = this.getSchedule(line, startDate, endDate, model, times);
  231 + List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, startDate, endDate, model, times);
232 232  
233 233 String[] date1 = startDate.split("-");
234 234 String[] date2 = endDate.split("-");
... ... @@ -254,7 +254,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
254 254 long sjInterval = 0;
255 255 int jhNum = 0;
256 256 int sjNum = 0;
257   - String company = "", subCompany = "";
  257 + String companyName = "", subCompanyName = "";
258 258 Map<String, Object> tempMap = new HashMap<String, Object>();
259 259 Map<String, List<ScheduleRealInfo>> temp = new HashMap<String, List<ScheduleRealInfo>>();
260 260 for(ScheduleRealInfo schedule : keyMap.get(key)){
... ... @@ -269,10 +269,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
269 269 jhNum++;
270 270 ScheduleRealInfo schedule1 = tempList.get(i - 1);
271 271 ScheduleRealInfo schedule2 = tempList.get(i);
272   - if(schedule1.getGsName() != null && company.length() == 0)
273   - company = schedule1.getGsName();
274   - if(schedule1.getFgsName() != null && subCompany.length() == 0)
275   - subCompany = schedule1.getFgsName();
  272 +
  273 + if(schedule1.getGsName() != null && companyName.length() == 0)
  274 + companyName = schedule1.getGsName();
  275 + if(schedule1.getFgsName() != null && subCompanyName.length() == 0)
  276 + subCompanyName = schedule1.getFgsName();
  277 +
276 278 jhInterval += schedule2.getFcsjT();
277 279 jhInterval -= schedule1.getFcsjT();
278 280 if(schedule1.getFcsjActual()!=null && schedule2.getFcsjActual()!=null){
... ... @@ -290,8 +292,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
290 292 tempMap.put("line", keys[0]);
291 293 tempMap.put("qdz", keys[1]);
292 294 tempMap.put("times", times);
293   - tempMap.put("company", company);
294   - tempMap.put("subCompany", subCompany);
  295 + tempMap.put("company", companyName);
  296 + tempMap.put("subCompany", subCompanyName);
295 297 if(jhNum != 0)
296 298 tempMap.put("jhInterval", jhInterval/jhNum);
297 299 else
... ... @@ -333,6 +335,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
333 335 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
334 336 Map<String, Object> modelMap = new HashMap<String, Object>();
335 337  
  338 + String company = map.get("company").toString();
  339 + String subCompany = map.get("subCompany").toString();
336 340 String line = map.get("line").toString();
337 341 String startDate = map.get("startDate").toString();
338 342 String endDate = map.get("endDate").toString();
... ... @@ -351,7 +355,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
351 355 times = "06:00-07:00";
352 356 }
353 357  
354   - List<ScheduleRealInfo> list = this.getSchedule(line, startDate, endDate, model, times);
  358 + List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, startDate, endDate, model, times);
355 359  
356 360 String[] date1 = startDate.split("-");
357 361 String[] date2 = endDate.split("-");
... ... @@ -389,12 +393,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
389 393 double yssd = 0;
390 394 int yyNum = 0;
391 395 int ysNum = 0;
392   - String company = "", subCompany = "";
  396 + String companyName = "", subCompanyName = "";
393 397 for(ScheduleRealInfo schedule : keyMap.get(key)){
394   - if(schedule.getGsName() != null && company.length() == 0)
395   - company = schedule.getGsName();
396   - if(schedule.getFgsName() != null && subCompany.length() == 0)
397   - subCompany = schedule.getFgsName();
  398 + if(schedule.getGsName() != null && companyName.length() == 0)
  399 + companyName = schedule.getGsName();
  400 + if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  401 + subCompanyName = schedule.getFgsName();
398 402 if(!tempMap.containsKey("xlDir"))
399 403 tempMap.put("xlDir", schedule.getXlDir());
400 404 if(!tempMap.containsKey("qdz_zdz") && schedule.getXlDir().equals("0"))
... ... @@ -424,8 +428,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
424 428 tempMap.put("line", keys[0]);
425 429 tempMap.put("lp", keys[1]);
426 430 tempMap.put("zdz", keys[2]);
427   - tempMap.put("company", company);
428   - tempMap.put("subCompany", subCompany);
  431 + tempMap.put("company", companyName);
  432 + tempMap.put("subCompany", subCompanyName);
429 433  
430 434 tempMap.put("yysj", (yysj/60) + "小时" + (yysj%60) + "分钟");
431 435 yysjSum += yysj;
... ... @@ -465,7 +469,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
465 469 List<Integer> keyList = new ArrayList<Integer>();
466 470 Map<Integer, List<Map<String, Object>>> temp = new HashMap<Integer, List<Map<String,Object>>>();
467 471 for(Map<String, Object> m : keyMap2.get(key)){
468   - Integer num = Integer.valueOf(m.get("lp").toString())*10+Integer.valueOf(m.get("xlDir").toString());
  472 + String lp = m.get("lp").toString();
  473 + String str = "";
  474 + for(int i = 0; i < lp.length(); i++){
  475 + str += (int)lp.charAt(i);
  476 + }
  477 + Integer num = Integer.valueOf(str)*10+Integer.valueOf(m.get("xlDir").toString());
469 478 if(!temp.containsKey(num)){
470 479 temp.put(num, new ArrayList<Map<String, Object>>());
471 480 keyList.add(num);
... ... @@ -494,6 +503,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
494 503 Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>();
495 504 Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>();
496 505  
  506 + String company = map.get("company").toString();
  507 + String subCompany = map.get("subCompany").toString();
497 508 String line = map.get("line").toString();
498 509 String startDate = map.get("startDate").toString();
499 510 String endDate = map.get("endDate").toString();
... ... @@ -512,7 +523,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
512 523 times = "06:00-07:00";
513 524 }
514 525  
515   - list = getSchedule(line, startDate, endDate, model, times);
  526 + list = getSchedule(company, subCompany, line, startDate, endDate, model, times);
516 527  
517 528 String[] date1 = startDate.split("-");
518 529 String[] date2 = endDate.split("-");
... ... @@ -559,12 +570,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
559 570 long sjtz = 0l;
560 571 long tzsjMax = 0l;
561 572 long tzsjMin = 0l;
562   - String company = "", subCompany = "";
  573 + String companyName = "", subCompanyName = "";
563 574 for(ScheduleRealInfo schedule : keyMap.get(key)){
564   - if(schedule.getGsName() != null && company.length() == 0)
565   - company = schedule.getGsName();
566   - if(schedule.getFgsName() != null && subCompany.length() == 0)
567   - subCompany = schedule.getFgsName();
  575 + if(schedule.getGsName() != null && companyName.length() == 0)
  576 + companyName = schedule.getGsName();
  577 + if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  578 + subCompanyName = schedule.getFgsName();
568 579 long tzsj = 0l;
569 580 long yssj = 0l;
570 581 jhbc++;
... ... @@ -618,8 +629,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
618 629 tempMap.put("jhfc", keys[3]);
619 630 tempMap.put("station", keys[4]);
620 631 tempMap.put("times", times);
621   - tempMap.put("company", company);
622   - tempMap.put("subCompany", subCompany);
  632 + tempMap.put("company", companyName);
  633 + tempMap.put("subCompany", subCompanyName);
623 634 if(startDate.equals(endDate))
624 635 tempMap.put("dates", startDate);
625 636 else
... ... @@ -692,10 +703,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
692 703 int wdfc2 = 0;
693 704 int ys = 0;
694 705 int tz = 0;
695   - String company = "";
  706 + String companyName = "", subCompanyName = "";
696 707 for(Map<String, Object> m : keyMap0.get(key)){
697   - if(m.containsKey("company") && company.length() == 0)
698   - company = m.get("company").toString();
  708 + if(m.containsKey("company") && companyName.length() == 0)
  709 + companyName = m.get("company").toString();
  710 + if(m.containsKey("subCompany") && subCompanyName.length() == 0)
  711 + subCompanyName = m.get("subCompany").toString();
699 712 jhbc += Integer.valueOf(m.get("jhbc").toString());
700 713 sjbc += Integer.valueOf(m.get("sjbc").toString());
701 714 wddf1 += Integer.valueOf(m.get("wddf1").toString().substring(0, m.get("wddf1").toString().length() - 1));
... ... @@ -709,7 +722,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
709 722 tempMap.put("dates", startDate);
710 723 else
711 724 tempMap.put("dates", startDate + "--" + endDate);
712   - tempMap.put("company", company);
  725 + tempMap.put("company", companyName);
  726 + tempMap.put("subCompany", subCompanyName);
713 727 String[] keys = key.split("/");
714 728 tempMap.put("line", keys[0]);
715 729 tempMap.put("lp", keys[1]);
... ... @@ -733,11 +747,23 @@ public class BusIntervalServiceImpl implements BusIntervalService {
733 747  
734 748 for(String key : keyMap1.keySet()){
735 749 Collections.sort(keyMap1.get(key), new Comparator<Map<String, Object>>() {
736   -
  750 +
737 751 public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  752 + Integer a;
  753 + Integer b;
  754 + String lp1 = o1.get("lp").toString();
  755 + String lp2 = o2.get("lp").toString();
  756 + String str1 = "";
  757 + String str2 = "";
  758 + for(int i = 0; i < lp1.length(); i++){
  759 + str1 += (int)lp1.charAt(i);
  760 + }
  761 + for(int i = 0; i < lp2.length(); i++){
  762 + str2 += (int)lp2.charAt(i);
  763 + }
738 764  
739   - Integer a = Integer.valueOf(o1.get("lp").toString());
740   - Integer b = Integer.valueOf(o2.get("lp").toString());
  765 + a = Integer.valueOf(str1);
  766 + b = Integer.valueOf(str2);
741 767  
742 768 // 升序
743 769 return a.compareTo(b);
... ... @@ -757,6 +783,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
757 783 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
758 784 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
759 785  
  786 + String company = map.get("company").toString();
  787 + String subCompany = map.get("subCompany").toString();
760 788 String line = map.get("line").toString();
761 789 String startDate = map.get("startDate").toString();
762 790 String endDate = map.get("endDate").toString();
... ... @@ -774,7 +802,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
774 802 times = "06:00-07:00";
775 803 }
776 804  
777   - list = getSchedule(line, startDate, endDate, model, times);
  805 + list = getSchedule(company, subCompany, line, startDate, endDate, model, times);
778 806  
779 807 String[] date1 = startDate.split("-");
780 808 String[] date2 = endDate.split("-");
... ... @@ -807,12 +835,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
807 835 qcbc = 0, qclc = 0, kxbc = 0, kxlc = 0,
808 836 qhbc = 0, qhlc = 0, wybc = 0, wylc = 0;
809 837 int qtbc = 0, qtlc = 0;
810   - String company = "", subCompany = "";
  838 + String companyName = "", subCompanyName = "";
811 839 for(ScheduleRealInfo schedule : keyMap.get(key)){
812   - if(schedule.getGsName() != null && company.length() == 0)
813   - company = schedule.getGsName();
814   - if(schedule.getFgsName() != null && subCompany.length() == 0)
815   - subCompany = schedule.getFgsName();
  840 + if(schedule.getGsName() != null && companyName.length() == 0)
  841 + companyName = schedule.getGsName();
  842 + if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  843 + subCompanyName = schedule.getFgsName();
816 844 jhbc++;
817 845 if(schedule.getJhlc() != null)
818 846 jhlc += schedule.getJhlc();
... ... @@ -861,8 +889,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
861 889 tempMap.put("date", startDate);
862 890 else
863 891 tempMap.put("date", startDate + "--" + endDate);
864   - tempMap.put("company", company);
865   - tempMap.put("subCompany", subCompany);
  892 + tempMap.put("company", companyName);
  893 + tempMap.put("subCompany", subCompanyName);
866 894 tempMap.put("times", times);
867 895 tempMap.put("line", key);
868 896 tempMap.put("jhbc", jhbc);
... ... @@ -919,6 +947,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
919 947 Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>();
920 948 Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>();
921 949  
  950 + String company = map.get("company").toString();
  951 + String subCompany = map.get("subCompany").toString();
922 952 String line = map.get("line").toString();
923 953 String startDate = map.get("startDate").toString();
924 954 String endDate = map.get("endDate").toString();
... ... @@ -941,6 +971,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
941 971 String[] split = times.split("-");
942 972 sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'";
943 973 }
  974 + if(company.length() != 0){
  975 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  976 + }
944 977 sql += " and bc_type = 'normal'";
945 978  
946 979 list =jdbcTemplate.query(sql,
... ...
src/main/java/com/bsth/service/schedule/PeopleCarPlanService.java
... ... @@ -5,15 +5,15 @@ import java.util.Map;
5 5  
6 6 public interface PeopleCarPlanService {
7 7  
8   - List<Map<String, Object>> queryPeopleCar(String line, String date, String type);
  8 + List<Map<String, Object>> queryPeopleCar(Map<String, Object> map);
9 9  
10   - List<Map<String, Object>> workDaily(String line, String date, String type);
  10 + List<Map<String, Object>> workDaily(Map<String, Object> map);
11 11  
12   - Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type);
  12 + Map<String, Object> scheduleAnaly(Map<String, Object> map);
13 13  
14   - List<Map<String, Object>> getModel(String line, String startDate, String endDate);
  14 + List<Map<String, Object>> getModel(Map<String, Object> map);
15 15  
16   - List<Map<String, Object>> firstAndLastBus(String line, String date, String type);
  16 + List<Map<String, Object>> firstAndLastBus(Map<String, Object> map);
17 17  
18   - List<Map<String, Object>> commandState(String line, String date, String code);
  18 + List<Map<String, Object>> commandState(Map<String, Object> map);
19 19 }
... ...
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
... ... @@ -23,10 +23,8 @@ import org.springframework.stereotype.Service;
23 23  
24 24 import com.bsth.entity.realcontrol.ScheduleRealInfo;
25 25 import com.bsth.entity.schedule.SchedulePlanInfo;
26   -import com.bsth.entity.schedule.TTInfoDetail;
27 26 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
28 27 import com.bsth.util.ReportUtils;
29   -import com.ibm.wsdl.util.xml.DOM2Writer;
30 28  
31 29 @Service
32 30 public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
... ... @@ -37,14 +35,74 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
37 35 @Autowired
38 36 private JdbcTemplate jdbcTemplate;
39 37  
  38 + public List<ScheduleRealInfo> getSchedule(String company, String subCompany, String line, String date){
  39 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  40 +
  41 + try {
  42 + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'";
  43 +
  44 + if(line.length() != 0)
  45 + sql += " and xl_bm = '"+line+"'";
  46 + if(company.length() != 0)
  47 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  48 +
  49 + list =jdbcTemplate.query(sql,
  50 + new RowMapper<ScheduleRealInfo>(){
  51 + @Override
  52 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  53 + ScheduleRealInfo schedule = new ScheduleRealInfo();
  54 + schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
  55 + schedule.setRealExecDate(rs.getString("real_exec_date"));
  56 + schedule.setXlName(rs.getString("xl_name"));
  57 + schedule.setLpName(rs.getString("lp_name"));
  58 + schedule.setBcType(rs.getString("bc_type"));
  59 + schedule.setBcs(rs.getInt("bcs"));
  60 + schedule.setBcsj(rs.getInt("bcsj"));
  61 + schedule.setJhlc(rs.getDouble("jhlc"));
  62 + schedule.setDfsj(rs.getString("dfsj"));
  63 + schedule.setFcsj(rs.getString("fcsj"));
  64 + schedule.setFcsjActual(rs.getString("fcsj_actual"));
  65 + schedule.setZdsj(rs.getString("zdsj"));
  66 + schedule.setZdsjActual(rs.getString("zdsj_actual"));
  67 + schedule.setQdzName(rs.getString("qdz_name"));
  68 + schedule.setZdzName(rs.getString("zdz_name"));
  69 + schedule.setXlDir(rs.getString("xl_dir"));
  70 + schedule.setStatus(rs.getInt("status"));
  71 + schedule.setRemarks(rs.getString("remarks"));
  72 + schedule.setGsName(rs.getString("gs_name"));
  73 + schedule.setFgsName(rs.getString("fgs_name"));
  74 + schedule.setClZbh(rs.getString("cl_zbh"));
  75 + schedule.setjGh(rs.getString("j_gh"));
  76 + schedule.setjName(rs.getString("j_name"));
  77 + schedule.setsGh(rs.getString("s_gh"));
  78 + schedule.setsName(rs.getString("s_name"));
  79 + schedule.setSpId(rs.getLong("sp_id"));
  80 + return schedule;
  81 + }
  82 + });
  83 +
  84 + } catch (Exception e) {
  85 + // TODO: handle exception
  86 + e.printStackTrace();
  87 + }
  88 +
  89 + return list;
  90 + }
  91 +
40 92 @Override
41   - public List<Map<String, Object>> queryPeopleCar(String line, String date, String type) {
  93 + public List<Map<String, Object>> queryPeopleCar(Map<String, Object> map) {
42 94 Map<String, List<SchedulePlanInfo>> keyMap = new HashMap<String, List<SchedulePlanInfo>>();
43 95 Map<String, List<Map<String, Object>>> temp = new HashMap<String, List<Map<String, Object>>>();
44 96 List<SchedulePlanInfo> list = new ArrayList<SchedulePlanInfo>();
45 97 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
46 98 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
47 99  
  100 + String company = map.get("company").toString();
  101 + String subCompany = map.get("subCompany").toString();
  102 + String line = map.get("line").toString();
  103 + String date = map.get("date").toString();
  104 + String type = map.get("type").toString();
  105 +
48 106 if(date.length() == 0){
49 107 date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
50 108 }
... ... @@ -55,6 +113,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
55 113 if(line.length() != 0){
56 114 sql += " and xl_bm = '"+line+"'";
57 115 }
  116 + if(company.length() != 0){
  117 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  118 + }
58 119  
59 120 list =jdbcTemplate.query(sql,
60 121 new RowMapper<SchedulePlanInfo>(){
... ... @@ -69,6 +130,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
69 130 schedule.setjName(rs.getString("j_name"));
70 131 schedule.setsName(rs.getString("s_name"));
71 132 schedule.setJhlc(rs.getDouble("jhlc"));
  133 + schedule.setGsName(rs.getString("gs_name"));
  134 + schedule.setFgsName(rs.getString("fgs_name"));
72 135 return schedule;
73 136 }
74 137 });
... ... @@ -90,7 +153,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
90 153 for(String key : keyMap.keySet()){
91 154 Map<String, Object> tempMap = new HashMap<String, Object>();
92 155 BigDecimal jhlc = new BigDecimal(0);
  156 + String companyName = "", subCompanyName = "";
93 157 for(SchedulePlanInfo schedule : keyMap.get(key)){
  158 + if(schedule.getGsName() != null && companyName.length() == 0)
  159 + companyName = schedule.getGsName();
  160 + if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  161 + subCompanyName = schedule.getFgsName();
94 162 if(schedule.getJhlc() != null)
95 163 jhlc = jhlc.add(new BigDecimal(schedule.getJhlc()));
96 164 }
... ... @@ -101,6 +169,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
101 169 tempMap.put("clzbh", split[2]);
102 170 tempMap.put("jName", split[3]);
103 171 tempMap.put("sName", split[4]);
  172 + tempMap.put("company", companyName);
  173 + tempMap.put("subCompany", subCompanyName);
104 174 if(split[4].equals("null"))
105 175 tempMap.put("sName", "/");
106 176 tempMap.put("jhlc", jhlc.setScale(2, BigDecimal.ROUND_UP));
... ... @@ -117,7 +187,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
117 187 Map<Integer, List<Map<String, Object>>> tempList = new HashMap<Integer, List<Map<String,Object>>>();
118 188 List<Integer> keyList = new ArrayList<Integer>();
119 189 for(Map<String, Object> m : temp.get(key)){
120   - int i = Integer.valueOf(m.get("lp").toString());
  190 + String lp = m.get("lp").toString();
  191 + String str = "";
  192 + for(int i = 0; i < lp.length(); i++){
  193 + str += (int)lp.charAt(i);
  194 + }
  195 + int i = Integer.valueOf(str);
121 196 if(!tempList.containsKey(i))
122 197 tempList.put(i, new ArrayList<Map<String, Object>>());
123 198 tempList.get(i).add(m);
... ... @@ -135,12 +210,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
135 210 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
136 211 sdfSimple = new SimpleDateFormat("yyyyMMdd");
137 212 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
138   - Map<String,Object> map = new HashMap<String, Object>();
  213 + Map<String,Object> m = new HashMap<String, Object>();
139 214 ReportUtils ee = new ReportUtils();
140 215 try {
141 216 listI.add(resList.iterator());
142 217 String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
143   - ee.excelReplace(listI, new Object[] { map }, path+"mould\\peoCarPlan.xls",
  218 + ee.excelReplace(listI, new Object[] { m }, path+"mould\\peoCarPlan.xls",
144 219 path+"export\\计划车辆班次人员" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
145 220 } catch (Exception e) {
146 221 // TODO: handle exception
... ... @@ -152,17 +227,22 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
152 227 }
153 228  
154 229 @Override
155   - public List<Map<String, Object>> workDaily(String line, String date, String type) {
  230 + public List<Map<String, Object>> workDaily(Map<String, Object> map) {
156 231 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
157 232 DecimalFormat df = new DecimalFormat("###0.##");
  233 +
  234 + String company = map.get("company").toString();
  235 + String subCompany = map.get("subCompany").toString();
  236 + String line = map.get("line").toString();
  237 + String date = map.get("date").toString();
  238 + String type = map.get("type").toString();
  239 +
158 240 if(date.length() == 0){
159 241 date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
160 242 }
161   - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
162   - if(line.length() != 0)
163   - list = scheduleRealInfoRepository.scheduleDaily(line, date);
164   - else
165   - list = scheduleRealInfoRepository.findByDate(date);
  243 +
  244 + List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date);
  245 +
166 246 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
167 247 for(ScheduleRealInfo schedule : list){
168 248 String key = schedule.getXlName();
... ... @@ -179,10 +259,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
179 259 Long wgfEnd = 0l;
180 260 try {
181 261 //早晚高峰时段
182   - zgfBegin = sdf.parse(date + "07:30").getTime();
183   - zgfEnd = sdf.parse(date + "09:30").getTime();
184   - wgfBegin = sdf.parse(date + "16:30").getTime();
185   - wgfEnd = sdf.parse(date + "18:30").getTime();
  262 + zgfBegin = sdf.parse(date + "06:30").getTime();
  263 + zgfEnd = sdf.parse(date + "08:30").getTime();
  264 + wgfBegin = sdf.parse(date + "16:00").getTime();
  265 + wgfEnd = sdf.parse(date + "18:00").getTime();
186 266 } catch (ParseException e) {
187 267 // TODO Auto-generated catch block
188 268 e.printStackTrace();
... ... @@ -190,26 +270,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
190 270 for(String key : keyMap.keySet()){
191 271 Map<String, Object> tempMap = new HashMap<String, Object>();
192 272 Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>();
193   - int jhbc = 0;
194   - int dftz = 0;
195   - int jhcc = 0;
196   - int sjcc = 0;
197   - int upfk = 0;
198   - int updk = 0;
199   - int dnfk = 0;
200   - int dndk = 0;
201   - int upfm = 0;
202   - int updm = 0;
203   - int dnfm = 0;
204   - int dndm = 0;
205   - int jhsb = 0;
206   - int sjsb = 0;
207   - int jhmb = 0;
208   - int sjmb = 0;
209   - int jhzgf = 0;
210   - int sjzgf = 0;
211   - int jhwgf = 0;
212   - int sjwgf = 0;
  273 + int jhbc = 0, dftz = 0, jhcc = 0, sjcc = 0;
  274 + int upfk = 0, updk = 0, dnfk = 0, dndk = 0;
  275 + int upfm = 0, updm = 0, dnfm = 0, dndm = 0;
  276 + int jhsb = 0, sjsb = 0, jhmb = 0, sjmb = 0;
  277 + int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0;
213 278 for(ScheduleRealInfo schedule : keyMap.get(key)){
214 279 schedule.setFcsjAll(schedule.getFcsj());
215 280  
... ... @@ -334,12 +399,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
334 399 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
335 400 sdfSimple = new SimpleDateFormat("yyyyMMdd");
336 401 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
337   - Map<String,Object> map = new HashMap<String, Object>();
  402 + Map<String,Object> m = new HashMap<String, Object>();
338 403 ReportUtils ee = new ReportUtils();
339 404 try {
340 405 listI.add(resList.iterator());
341 406 String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
342   - ee.excelReplace(listI, new Object[] { map }, path+"mould\\workDaily.xls",
  407 + ee.excelReplace(listI, new Object[] { m }, path+"mould\\workDaily.xls",
343 408 path+"export\\营运服务日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
344 409 } catch (Exception e) {
345 410 // TODO: handle exception
... ... @@ -351,15 +416,25 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
351 416 }
352 417  
353 418 @Override
354   - public Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type) {
  419 + public Map<String, Object> scheduleAnaly(Map<String, Object> map) {
355 420 DecimalFormat df = new DecimalFormat("00");
356   - List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>();
  421 +// List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>();
  422 + List<Long> ttList = new ArrayList<Long>();
357 423 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
358 424 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
359 425 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
360 426 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
361 427 Map<String, Object> modelMap = new HashMap<String, Object>();
362 428  
  429 + String company = map.get("company").toString();
  430 + String subCompany = map.get("subCompany").toString();
  431 + String page = map.get("page").toString();
  432 + String line = map.get("line").toString();
  433 + String startDate = map.get("startDate").toString();
  434 + String endDate = map.get("endDate").toString();
  435 + String model = map.get("model").toString();
  436 + String type = map.get("type").toString();
  437 +
363 438 if(startDate.length() == 0){
364 439 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
365 440 }
... ... @@ -372,6 +447,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
372 447 if(line.length() != 0){
373 448 sql += " and xl_bm = '"+line+"'";
374 449 }
  450 + if(company.length() != 0){
  451 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  452 + }
375 453 sql += " and bc_type = 'normal'";
376 454  
377 455 list =jdbcTemplate.query(sql,
... ... @@ -390,27 +468,24 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
390 468 schedule.setZdsjActual(rs.getString("zdsj_actual"));
391 469 schedule.setBcsj(rs.getInt("bcsj"));
392 470 schedule.setQdzName(rs.getString("qdz_name"));
  471 + schedule.setSpId(rs.getLong("sp_id"));
393 472 return schedule;
394 473 }
395 474 });
396 475  
397 476 if(model.length() != 0){
398   - sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'";
399   - }
  477 +// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'";
  478 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type = 'normal'";
400 479  
401   - ttList =jdbcTemplate.query(sql,
402   - new RowMapper<TTInfoDetail>(){
403   - @Override
404   - public TTInfoDetail mapRow(ResultSet rs, int rowNum) throws SQLException {
405   - TTInfoDetail ttInfo = new TTInfoDetail();
406   - ttInfo.setBcType(rs.getString("bc_type"));
407   - ttInfo.setBcs(rs.getInt("bcs"));
408   - ttInfo.setFcno(rs.getInt("fcno"));
409   - ttInfo.setFcsj(rs.getString("fcsj"));
410   - ttInfo.setBcsj(rs.getInt("bcsj"));
411   - return ttInfo;
412   - }
413   - });
  480 + ttList = jdbcTemplate.query(sql,
  481 + new RowMapper<Long>(){
  482 + @Override
  483 + public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
  484 + return rs.getLong("id");
  485 + }
  486 + });
  487 +
  488 + }
414 489  
415 490 } catch (Exception e) {
416 491 // TODO Auto-generated catch block
... ... @@ -421,9 +496,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
421 496 for(ScheduleRealInfo schedule : list){
422 497 DO:{
423 498 if(model.length() != 0){
424   - for(TTInfoDetail tt : ttList){
425   - if(tt.getBcs() == schedule.getBcs() && tt.getFcno() == schedule.getFcno()
426   - && tt.getFcsj().equals(schedule.getFcsj()) && tt.getBcsj() == schedule.getBcsj()){
  499 + for(Long tt : ttList){
  500 + if(tt == schedule.getSpId()){
427 501 String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
428 502 if(!keyMap.containsKey(key))
429 503 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
... ... @@ -534,16 +608,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
534 608 }
535 609 Collections.sort(keyList);
536 610 for(Integer Int : keyList){
537   - Map<String, Object> map = tempMap.get(Int);
538   - String str = map.get("line").toString();
  611 + Map<String, Object> m = tempMap.get(Int);
  612 + String str = m.get("line").toString();
539 613 if(!listMap2.containsKey(str))
540 614 listMap2.put(str, new ArrayList<Map<String, Object>>());
541   - listMap2.get(str).add(map);
  615 + listMap2.get(str).add(m);
542 616 }
543 617 }
544 618 for(String str : listMap2.keySet()){
545   - for(Map<String, Object> map : listMap2.get(str)){
546   - resList.add(map);
  619 + for(Map<String, Object> m : listMap2.get(str)){
  620 + resList.add(m);
547 621 }
548 622 }
549 623  
... ... @@ -561,12 +635,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
561 635 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
562 636 sdfSimple = new SimpleDateFormat("yyyyMMdd");
563 637 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
564   - Map<String,Object> map = new HashMap<String, Object>();
  638 + Map<String,Object> m = new HashMap<String, Object>();
565 639 ReportUtils ee = new ReportUtils();
566 640 try {
567 641 listI.add(resList.iterator());
568 642 String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
569   - ee.excelReplace(listI, new Object[] { map }, path+"mould\\scheduleAnaly.xls",
  643 + ee.excelReplace(listI, new Object[] { m }, path+"mould\\scheduleAnaly.xls",
570 644 path+"export\\时刻表分析" + sdfSimple.format(sdfMonth.parse(startDate)) + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
571 645 } catch (Exception e) {
572 646 // TODO: handle exception
... ... @@ -578,12 +652,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
578 652 }
579 653  
580 654 @Override
581   - public List<Map<String, Object>> getModel(String line, String startDate, String endDate) {
  655 + public List<Map<String, Object>> getModel(Map<String, Object> map) {
582 656 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
583 657 List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
584 658 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
585 659 SimpleDateFormat sdfEE = new SimpleDateFormat("EEEE");
586 660  
  661 + String line = map.get("line").toString();
  662 + String startDate = map.get("startDate").toString();
  663 + String endDate = map.get("endDate").toString();
  664 +
587 665 if(startDate.length() == 0){
588 666 startDate = sdf.format(new Date());
589 667 }
... ... @@ -650,13 +728,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
650 728 ruleDays1.add(6);
651 729 specialDays1.add(sdf.format(tempDate));
652 730 }
653   - for(Map<String, Object> map : list){
654   - String[] ruleDays = map.get("ruleDays").toString().split(",");
655   - String[] specialDays = map.get("specialDays").toString().split(",");
  731 + for(Map<String, Object> m : list){
  732 + String[] ruleDays = m.get("ruleDays").toString().split(",");
  733 + String[] specialDays = m.get("specialDays").toString().split(",");
656 734 boolean flag = false;
657 735 DO:{
658 736 try {
659   - long qyrq = sdf.parse(map.get("qyrq").toString()).getTime();
  737 + long qyrq = sdf.parse(m.get("qyrq").toString()).getTime();
660 738 if(qyrq > date2.getTime())
661 739 break;
662 740 } catch (ParseException e) {
... ... @@ -681,24 +759,27 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
681 759 }
682 760 }
683 761 if(flag)
684   - resList.add(map);
  762 + resList.add(m);
685 763 }
686 764  
687 765 return resList;
688 766 }
689 767  
690 768 @Override
691   - public List<Map<String, Object>> firstAndLastBus(String line, String date, String type) {
692   - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  769 + public List<Map<String, Object>> firstAndLastBus(Map<String, Object> map) {
693 770 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
694 771 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
695 772  
  773 + String company = map.get("company").toString();
  774 + String subCompany = map.get("subCompany").toString();
  775 + String line = map.get("line").toString();
  776 + String date = map.get("date").toString();
  777 + String type = map.get("type").toString();
  778 +
696 779 if(date.length() == 0)
697 780 date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
698   - if(line.length() != 0)
699   - list = scheduleRealInfoRepository.scheduleDaily(line, date);
700   - else
701   - list = scheduleRealInfoRepository.findByDate(date);
  781 +
  782 + List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date);
702 783  
703 784 for(ScheduleRealInfo schedule : list){
704 785 if(!schedule.getBcType().equals("normal"))
... ... @@ -714,12 +795,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
714 795 List<Long> longList0 = new ArrayList<Long>();
715 796 Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>();
716 797 List<Long> longList1 = new ArrayList<Long>();
717   - String company = "", subCompany = "";
  798 + String companyName = "", subCompanyName = "";
718 799 for(ScheduleRealInfo schedule : keyMap.get(key)){
719   - if(schedule.getGsName() != null && company.length() == 0)
720   - company = schedule.getGsName();
721   - if(schedule.getFgsName() != null && subCompany.length() == 0)
722   - subCompany = schedule.getFgsName();
  800 + if(schedule.getGsName() != null && companyName.length() == 0)
  801 + companyName = schedule.getGsName();
  802 + if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  803 + subCompanyName = schedule.getFgsName();
723 804 String[] split = schedule.getFcsj().split(":");
724 805 long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
725 806 schedule.setFcsjT(min);
... ... @@ -738,8 +819,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
738 819 ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));
739 820 ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1));
740 821 tempMap.put("date", date);
741   - tempMap.put("company", company);
742   - tempMap.put("subCompany", subCompany);
  822 + tempMap.put("company", companyName);
  823 + tempMap.put("subCompany", subCompanyName);
743 824 tempMap.put("line", key);
744 825 tempMap.put("qdzFirst0", shouban0.getQdzName());
745 826 tempMap.put("jhfcFirst0", shouban0.getFcsj());
... ... @@ -808,12 +889,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
808 889 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
809 890 sdfSimple = new SimpleDateFormat("yyyyMMdd");
810 891 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
811   - Map<String,Object> map = new HashMap<String, Object>();
  892 + Map<String,Object> m = new HashMap<String, Object>();
812 893 ReportUtils ee = new ReportUtils();
813 894 try {
814 895 listI.add(resList.iterator());
815 896 String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
816   - ee.excelReplace(listI, new Object[] { map }, path+"mould\\firstAndLastBus.xls",
  897 + ee.excelReplace(listI, new Object[] { m }, path+"mould\\firstAndLastBus.xls",
817 898 path+"export\\线路首末班" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
818 899 } catch (Exception e) {
819 900 // TODO: handle exception
... ... @@ -825,18 +906,25 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
825 906 }
826 907  
827 908 @Override
828   - public List<Map<String, Object>> commandState(String line, String date, String code) {
  909 + public List<Map<String, Object>> commandState(Map<String, Object> map) {
829 910 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
830 911 List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
831 912 Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>();
832 913 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
  914 +
  915 + String company = map.get("company").toString();
  916 + String subCompany = map.get("subCompany").toString();
  917 + String line = map.get("line").toString();
  918 + String date = map.get("date").toString();
  919 + String code = map.get("code").toString();
833 920  
834 921 if(date.length() == 0)
835 922 date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
836 923  
837 924 try {
838 925  
839   - String sql = "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " +
  926 + String sql =
  927 + "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time, r.gs_name, r.fgs_name " +
840 928 "FROM bsth_c_s_sp_info_real as r left join bsth_v_directive_60 as d on r.id = d.sch and d.is_dispatch = 1 where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'";
841 929 if(line.length() != 0){
842 930 sql += " and xl_bm = '"+line+"'";
... ... @@ -844,8 +932,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
844 932 if(code.length() != 0){
845 933 sql += " and cl_zbh = '"+code+"'";
846 934 }
  935 + if(company.length() != 0){
  936 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  937 + }
847 938 sql += " union " +
848   - "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " +
  939 + "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time, r.gs_name, r.fgs_name " +
849 940 "FROM bsth_c_s_sp_info_real as r right join bsth_v_directive_60 as d on r.id = d.sch where d.is_dispatch = 1 and DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'";
850 941 if(line.length() != 0){
851 942 sql += " and xl_bm = '"+line+"'";
... ... @@ -853,6 +944,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
853 944 if(code.length() != 0){
854 945 sql += " and cl_zbh = '"+code+"'";
855 946 }
  947 + if(company.length() != 0){
  948 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  949 + }
856 950 sql += " order by fcsj";
857 951  
858 952 list = jdbcTemplate.query(sql,
... ... @@ -872,6 +966,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
872 966 map.put("reply47", rs.getString("reply47"));
873 967 map.put("reply46time", rs.getString("reply46time"));
874 968 map.put("reply47time", rs.getString("reply47time"));
  969 + map.put("company", rs.getObject("gs_name"));
  970 + map.put("subCompany", rs.getObject("fgs_name"));
875 971 return map;
876 972 }
877 973 });
... ... @@ -881,38 +977,45 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
881 977 e.printStackTrace();
882 978 }
883 979  
884   - for(Map<String, Object> map : list){
885   - String key = map.get("line") + "/" + map.get("clZbh") + "/" + map.get("jGh") + "/" + map.get("jName");
  980 + for(Map<String, Object> m : list){
  981 + String key = m.get("line") + "/" + m.get("clZbh") + "/" + m.get("jGh") + "/" + m.get("jName");
886 982 if(!keyMap.containsKey(key))
887 983 keyMap.put(key, new ArrayList<Map<String, Object>>());
888   - keyMap.get(key).add(map);
  984 + keyMap.get(key).add(m);
889 985 }
890 986 for(String key : keyMap.keySet()){
891 987 Map<String, Object> tempMap = new HashMap<String, Object>();
892 988 Set<String> tempSet = new HashSet<String>();
893 989 int sjf = 0;
894 990 int wqr = 0;
895   - for(Map<String, Object> map : keyMap.get(key)){
896   - tempSet.add(map.get("id").toString());
897   - if(map.get("timestamp") != null){
  991 + String companyName = "", subCompanyName = "";
  992 + for(Map<String, Object> m : keyMap.get(key)){
  993 + if(m.containsKey("company") && m.get("company").toString().length()!=0 && companyName.length()==0)
  994 + companyName = m.get("company").toString();
  995 + if(m.containsKey("subCompany") && m.get("subCompany").toString().length()!=0 && subCompanyName.length()==0)
  996 + subCompanyName = m.get("subCompany").toString();
  997 + tempSet.add(m.get("id").toString());
  998 + if(m.get("timestamp") != null){
898 999 sjf++;
899   - if(map.get("reply47").toString().equals("-1"))
  1000 + if(m.get("reply47").toString().equals("-1"))
900 1001 wqr++;
901   - map.put("time", sdf.format(new Date(Long.valueOf(map.get("timestamp").toString()))));
  1002 + m.put("time", sdf.format(new Date(Long.valueOf(m.get("timestamp").toString()))));
902 1003 } else
903   - map.put("time", "/");
  1004 + m.put("time", "/");
904 1005  
905   - if(map.get("reply46time") != null)
906   - map.put("time46", sdf.format(new Date(Long.valueOf(map.get("reply46time").toString()))));
  1006 + if(m.get("reply46time") != null)
  1007 + m.put("time46", sdf.format(new Date(Long.valueOf(m.get("reply46time").toString()))));
907 1008 else
908   - map.put("time46", "/");
  1009 + m.put("time46", "/");
909 1010  
910   - if(map.get("reply47time") != null)
911   - map.put("time47", sdf.format(new Date(Long.valueOf(map.get("reply47time").toString()))));
  1011 + if(m.get("reply47time") != null)
  1012 + m.put("time47", sdf.format(new Date(Long.valueOf(m.get("reply47time").toString()))));
912 1013 else
913   - map.put("time47", "/");
  1014 + m.put("time47", "/");
914 1015  
915 1016 }
  1017 + tempMap.put("company", companyName);
  1018 + tempMap.put("subCompany", subCompanyName);
916 1019 String[] split = key.split("/");
917 1020 tempMap.put("date", date);
918 1021 tempMap.put("line", split[0]);
... ...
src/main/resources/static/pages/forms/statement/busInterval.html
... ... @@ -128,13 +128,13 @@
128 128 var year = d.getFullYear();
129 129 var month = d.getMonth() + 1;
130 130 var day = d.getDate();
131   - if(month > 9){
132   - $("#startDate").val(year + "-" + month + "-" + day);
133   - $("#endDate").val(year + "-" + month + "-" + day);
134   - } else {
135   - $("#startDate").val(year + "-0" + month + "-" + day);
136   - $("#endDate").val(year + "-0" + month + "-" + day);
137   - }
  131 + if(month < 10)
  132 + month = "0" + month;
  133 + if(day < 10)
  134 + day = "0" + day;
  135 + $("#startDate").val(year + "-" + month + "-" + day);
  136 + $("#endDate").val(year + "-" + month + "-" + day);
  137 +
138 138 $("#times1").val("06:00");
139 139 $("#times2").val("07:00");
140 140  
... ... @@ -227,6 +227,8 @@
227 227 var endDate = $("#endDate").val();
228 228 var model = $("#model").val();
229 229 var times = $("#times1").val() + "-" + $("#times2").val();
  230 + var company = $("#company").val();
  231 + var subCompany = $("#subCompany").val();
230 232 function jsDoQuery(pagination){
231 233 var params = {};
232 234 // line = $("#line").val();
... ... @@ -234,11 +236,15 @@
234 236 endDate = $("#endDate").val();
235 237 model = $("#model").val();
236 238 times = $("#times1").val() + "-" + $("#times2").val();
  239 + company = $("#company").val();
  240 + subCompany = $("#subCompany").val();
237 241 params['line'] = line;
238 242 params['startDate'] = startDate;
239 243 params['endDate'] = endDate;
240 244 params['model'] = model;
241 245 params['times'] = times;
  246 + params['company'] = company;
  247 + params['subCompany'] = subCompany;
242 248 params['type'] = "query";
243 249 $(".hidden").removeClass("hidden");
244 250 $get('/busInterval/interval', params, function(result){
... ...
src/main/resources/static/pages/forms/statement/commandState.html
... ... @@ -60,6 +60,8 @@
60 60 <thead>
61 61 <tr class="hidden">
62 62 <th>日期</th>
  63 + <th>公司</th>
  64 + <th>分公司</th>
63 65 <th>线路</th>
64 66 <th>车辆</th>
65 67 <th>人员</th>
... ... @@ -125,18 +127,20 @@
125 127 var year = d.getFullYear();
126 128 var month = d.getMonth() + 1;
127 129 var day = d.getDate();
128   - if(month > 9){
129   - $("#date").val(year + "-" + month + "-" + day);
130   - } else {
131   - $("#date").val(year + "-0" + month + "-" + day);
132   - }
  130 + if(month < 10)
  131 + month = "0" + month;
  132 + if(day < 10)
  133 + day = "0" + day;
  134 + $("#date").val(year + "-" + month + "-" + day);
133 135  
134 136 $.get('/basic/lineCode2Name',function(result){
135 137 var data=[];
136 138  
  139 + data.push({id: "", text: "全部线路"});
137 140 for(var code in result){
138 141 data.push({id: code, text: result[code]});
139 142 }
  143 +
140 144 console.log(data);
141 145 initPinYinSelect2('#line',data,'');
142 146 })
... ... @@ -215,9 +219,14 @@
215 219  
216 220 function jsDoQuery(pagination){
217 221 var params = {};
218   - params['line'] = $("#line").val();
  222 + var line = $("#line").val();
  223 + if(line = " ")
  224 + line = "";
  225 + params['line'] = line;
219 226 params['date'] = $("#date").val();
220 227 params['code'] = $("#code").val();
  228 + params['company'] = $("#company").val();
  229 + params['subCompany'] = $("#subCompany").val();
221 230 $("#forms .hidden").removeClass("hidden");
222 231 $get('/pcpc/commandState', params, function(result){
223 232 // 把数据填充到模版中
... ... @@ -260,6 +269,8 @@
260 269 {{each list as obj i}}
261 270 <tr>
262 271 <td>{{obj.date}}</td>
  272 + <td>{{obj.company}}</td>
  273 + <td>{{obj.subCompany}}</td>
263 274 <td>{{obj.line}}</td>
264 275 <td>{{obj.clZbh}}</td>
265 276 <td><a id="jsy">{{obj.jsy}}</a></td>
... ... @@ -270,7 +281,7 @@
270 281 {{/each}}
271 282 {{if list.length == 0}}
272 283 <tr>
273   - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  284 + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td>
274 285 </tr>
275 286 {{/if}}
276 287 </script>
... ...
src/main/resources/static/pages/forms/statement/correctStatis.html
... ... @@ -101,7 +101,6 @@
101 101 <script>
102 102 $(function(){
103 103  
104   -
105 104 // 关闭左侧栏
106 105 if (!$('body').hasClass('page-sidebar-closed'))
107 106 $('.menu-toggler.sidebar-toggler').click();
... ... @@ -127,13 +126,13 @@
127 126 var year = d.getFullYear();
128 127 var month = d.getMonth() + 1;
129 128 var day = d.getDate();
130   - if(month > 9){
131   - $("#startDate").val(year + "-" + month + "-" + day);
132   - $("#endDate").val(year + "-" + month + "-" + day);
133   - } else {
134   - $("#startDate").val(year + "-0" + month + "-" + day);
135   - $("#endDate").val(year + "-0" + month + "-" + day);
136   - }
  129 + if(month < 10)
  130 + month = "0" + month;
  131 + if(day < 10)
  132 + day = "0" + day;
  133 + $("#startDate").val(year + "-" + month + "-" + day);
  134 + $("#endDate").val(year + "-" + month + "-" + day);
  135 +
137 136 $("#times1").val("06:00");
138 137 $("#times2").val("07:00");
139 138  
... ... @@ -184,8 +183,8 @@
184 183  
185 184 $("#query").on("click",jsDoQuery);
186 185  
187   - var company;
188   - var subCompany;
  186 + var company = $("#company").val();
  187 + var subCompany = $("#subCompany").val();
189 188 var lines;
190 189 var line = $("#line").val();
191 190 var startDate = $("#startDate").val();
... ... @@ -197,10 +196,14 @@
197 196 startDate = $("#startDate").val();
198 197 endDate = $("#endDate").val();
199 198 times = $("#times1").val() + "-" + $("#times2").val();
  199 + company = $("#company").val();
  200 + subCompany = $("#subCompany").val();
200 201 params['line'] = line;
201 202 params['startDate'] = startDate;
202 203 params['endDate'] = endDate;
203 204 params['times'] = times;
  205 + params['company'] = company;
  206 + params['subCompany'] = subCompany;
204 207 params['type'] = "query";
205 208 // $(".hidden").removeClass("hidden");
206 209 $get('/busInterval/correctStatis', params, function(result){
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
... ... @@ -111,15 +111,16 @@
111 111 var year = d.getFullYear();
112 112 var month = d.getMonth() + 1;
113 113 var day = d.getDate();
114   - if(month > 9){
115   - $("#date").val(year + "-" + month + "-" + day);
116   - } else {
117   - $("#date").val(year + "-0" + month + "-" + day);
118   - }
  114 + if(month < 10)
  115 + month = "0" + month;
  116 + if(day < 10)
  117 + day = "0" + day;
  118 + $("#date").val(year + "-" + month + "-" + day);
119 119  
120 120 $.get('/basic/lineCode2Name',function(result){
121 121 var data=[];
122 122  
  123 + data.push({id: " ", text: "全部线路"});
123 124 for(var code in result){
124 125 data.push({id: code, text: result[code]});
125 126 }
... ... @@ -160,12 +161,21 @@
160 161  
161 162 $("#query").on("click",jsDoQuery);
162 163  
  164 + var company = $("#company").val();
  165 + var subCompany = $("#subCompany").val();
163 166 var line = $("#line").val();
164 167 var date = $("#date").val();
165 168 function jsDoQuery(pagination){
166 169 var params = {};
  170 + company = $("#company").val();
  171 + subCompany = $("#subCompany").val();
167 172 line = $("#line").val();
168 173 date = $("#date").val();
  174 + if(line == " ")
  175 + line = "";
  176 + params['company'] = company;
  177 + params['subCompany'] = subCompany;
  178 + params['line'] = line;
169 179 params['line'] = line;
170 180 params['date'] = date;
171 181 params['type'] = "query";
... ...
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
... ... @@ -134,13 +134,13 @@
134 134 var year = d.getFullYear();
135 135 var month = d.getMonth() + 1;
136 136 var day = d.getDate();
137   - if(month > 9){
138   - $("#startDate").val(year + "-" + month + "-" + day);
139   - $("#endDate").val(year + "-" + month + "-" + day);
140   - } else {
141   - $("#startDate").val(year + "-0" + month + "-" + day);
142   - $("#endDate").val(year + "-0" + month + "-" + day);
143   - }
  137 + if(month < 10)
  138 + month = "0" + month;
  139 + if(day < 10)
  140 + day = "0" + day;
  141 + $("#startDate").val(year + "-" + month + "-" + day);
  142 + $("#endDate").val(year + "-" + month + "-" + day);
  143 +
144 144 $("#times1").val("06:00");
145 145 $("#times2").val("07:00");
146 146  
... ... @@ -222,6 +222,8 @@
222 222 var endDate = $("#endDate").val();
223 223 var model = $("#model").val();
224 224 var times = $("#times1").val() + "-" + $("#times2").val();
  225 + var company = $("#company").val();
  226 + var subCompany = $("#subCompany").val();
225 227 function jsDoQuery(pagination){
226 228 var reason = $("input[name='reason']");
227 229 var params = {};
... ... @@ -230,11 +232,15 @@
230 232 endDate = $("#endDate").val();
231 233 model = $("#model").val();
232 234 times = $("#times1").val() + "-" + $("#times2").val();
  235 + company = $("#company").val();
  236 + subCompany = $("#subCompany").val();
233 237 params['line'] = line;
234 238 params['startDate'] = startDate;
235 239 params['endDate'] = endDate;
236 240 params['model'] = model;
237 241 params['times'] = times;
  242 + params['company'] = company;
  243 + params['subCompany'] = subCompany;
238 244 params['type'] = "query";
239 245 // $(".hidden").removeClass("hidden");
240 246 $get('/busInterval/lbStatuAnaly', params, function(result){
... ...
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
... ... @@ -192,13 +192,13 @@
192 192 var year = d.getFullYear();
193 193 var month = d.getMonth() + 1;
194 194 var day = d.getDate();
195   - if(month > 9){
196   - $("#startDate").val(year + "-" + month + "-" + day);
197   - $("#endDate").val(year + "-" + month + "-" + day);
198   - } else {
199   - $("#startDate").val(year + "-0" + month + "-" + day);
200   - $("#endDate").val(year + "-0" + month + "-" + day);
201   - }
  195 + if(month < 10)
  196 + month = "0" + month;
  197 + if(day < 10)
  198 + day = "0" + day;
  199 + $("#startDate").val(year + "-" + month + "-" + day);
  200 + $("#endDate").val(year + "-" + month + "-" + day);
  201 +
202 202 $("#times1").val("06:00");
203 203 $("#times2").val("07:00");
204 204  
... ... @@ -267,6 +267,8 @@
267 267 var model = $("#model").val();
268 268 var times = $("#times1").val() + "-" + $("#times2").val();
269 269 var upDown = $("#upDown").val();
  270 + var company = $("#company").val();
  271 + var subCompany = $("#subCompany").val();
270 272 function jsDoQuery(pagination){
271 273 var params = {};
272 274 // line = $("#line").val();
... ... @@ -275,12 +277,16 @@
275 277 model = $("#model").val();
276 278 times = $("#times1").val() + "-" + $("#times2").val();
277 279 upDown = $("#upDown").val();
  280 + company = $("#company").val();
  281 + subCompany = $("#subCompany").val();
278 282 params['line'] = line;
279 283 params['startDate'] = startDate;
280 284 params['endDate'] = endDate;
281 285 params['model'] = model;
282 286 params['times'] = times;
283 287 params['upDown'] = upDown;
  288 + params['company'] = company;
  289 + params['subCompany'] = subCompany;
284 290 params['type'] = "query";
285 291 $("#forms .hidden").removeClass("hidden");
286 292 $get('/busInterval/lineTimeAnaliy', params, function(result){
... ...
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
... ... @@ -55,6 +55,8 @@
55 55 <thead>
56 56 <tr class="hidden">
57 57 <th>日期</th>
  58 + <th>公司</th>
  59 + <th>分公司</th>
58 60 <th>线路</th>
59 61 <th>路牌</th>
60 62 <th>车辆</th>
... ... @@ -92,11 +94,11 @@
92 94 var year = d.getFullYear();
93 95 var month = d.getMonth() + 1;
94 96 var day = d.getDate();
95   - if(month > 9){
96   - $("#date").val(year + "-" + month + "-" + day);
97   - } else {
98   - $("#date").val(year + "-0" + month + "-" + day);
99   - }
  97 + if(month < 10)
  98 + month = "0" + month;
  99 + if(day < 10)
  100 + day = "0" + day;
  101 + $("#date").val(year + "-" + month + "-" + day);
100 102  
101 103 $.get('/basic/lineCode2Name',function(result){
102 104 var data=[];
... ... @@ -144,12 +146,18 @@
144 146  
145 147 var line = $("#line").val();
146 148 var date = $("#date").val();
  149 + var company = $("#company").val();
  150 + var subCompany = $("#subCompany").val();
147 151 function jsDoQuery(pagination){
148 152 var params = {};
  153 + company = $("#company").val();
  154 + subCompany = $("#subCompany").val();
149 155 line = $("#line").val();
150 156 date = $("#date").val();
151 157 if(line == " ")
152 158 line = "";
  159 + params['company'] = company;
  160 + params['subCompany'] = subCompany;
153 161 params['line'] = line;
154 162 params['date'] = date;
155 163 params['type'] = "query";
... ... @@ -177,6 +185,8 @@
177 185 {{each list as obj i}}
178 186 <tr>
179 187 <td>{{obj.date}}</td>
  188 + <td>{{obj.company}}</td>
  189 + <td>{{obj.subCompany}}</td>
180 190 <td>{{obj.line}}</td>
181 191 <td>{{obj.lp}}</td>
182 192 <td>{{obj.clzbh}}</td>
... ... @@ -187,7 +197,7 @@
187 197 {{/each}}
188 198 {{if list.length == 0}}
189 199 <tr>
190   - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  200 + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td>
191 201 </tr>
192 202 {{/if}}
193 203 </script>
194 204 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -114,13 +114,12 @@
114 114 var year = d.getFullYear();
115 115 var month = d.getMonth() + 1;
116 116 var day = d.getDate();
117   - if(month > 9){
118   - $("#startDate").val(year + "-" + month + "-" + day);
119   - $("#endDate").val(year + "-" + month + "-" + day);
120   - } else {
121   - $("#startDate").val(year + "-0" + month + "-" + day);
122   - $("#endDate").val(year + "-0" + month + "-" + day);
123   - }
  117 + if(month < 10)
  118 + month = "0" + month;
  119 + if(day < 10)
  120 + day = "0" + day;
  121 + $("#startDate").val(year + "-" + month + "-" + day);
  122 + $("#endDate").val(year + "-" + month + "-" + day);
124 123  
125 124 $.get('/basic/lineCode2Name',function(result){
126 125 var data=[];
... ... @@ -176,17 +175,23 @@
176 175 var startDate = $("#startDate").val();
177 176 var endDate = $("#endDate").val();
178 177 var model = $("#model").val();
  178 + var company = $("#company").val();
  179 + var subCompany = $("#subCompany").val();
179 180 function jsDoQuery(pagination){
180 181 var params = {};
181 182 // line = $("#line").val();
182 183 startDate = $("#startDate").val();
183 184 endDate = $("#endDate").val();
184 185 model = $("#model").val();
  186 + company = $("#company").val();
  187 + subCompany = $("#subCompany").val();
185 188 params['page'] = page;
186 189 params['line'] = line;
187 190 params['startDate'] = startDate;
188 191 params['endDate'] = endDate;
189 192 params['model'] = model;
  193 + params['company'] = company;
  194 + params['subCompany'] = subCompany;
190 195 params['type'] = "query";
191 196 $(".hidden").removeClass("hidden");
192 197 $get('/pcpc/scheduleAnaly', params, function(result){
... ... @@ -199,8 +204,12 @@
199 204 //重新分页
200 205 initPagination = true;
201 206 showPagination(result);
  207 +
  208 + $('#pagination').show();
  209 + } else if(result.dataList.length == 0){
  210 + $('#pagination').hide();
202 211 }
203   - });
  212 + });
204 213 }
205 214  
206 215 $("#export").on("click",function(){
... ...
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
... ... @@ -136,13 +136,13 @@
136 136 var year = d.getFullYear();
137 137 var month = d.getMonth() + 1;
138 138 var day = d.getDate();
139   - if(month > 9){
140   - $("#startDate").val(year + "-" + month + "-" + day);
141   - $("#endDate").val(year + "-" + month + "-" + day);
142   - } else {
143   - $("#startDate").val(year + "-0" + month + "-" + day);
144   - $("#endDate").val(year + "-0" + month + "-" + day);
145   - }
  139 + if(month < 10)
  140 + month = "0" + month;
  141 + if(day < 10)
  142 + day = "0" + day;
  143 + $("#startDate").val(year + "-" + month + "-" + day);
  144 + $("#endDate").val(year + "-" + month + "-" + day);
  145 +
146 146 $("#times1").val("06:00");
147 147 $("#times2").val("07:00");
148 148  
... ... @@ -211,6 +211,8 @@
211 211 var model = $("#model").val();
212 212 var times = $("#times1").val() + "-" + $("#times2").val();
213 213 var upDown = $("#upDown").val();
  214 + var company = $("#company").val();
  215 + var subCompany = $("#subCompany").val();
214 216 function jsDoQuery(pagination){
215 217 var params = {};
216 218 // line = $("#line").val();
... ... @@ -219,12 +221,16 @@
219 221 model = $("#model").val();
220 222 times = $("#times1").val() + "-" + $("#times2").val();
221 223 upDown = $("#upDown").val();
  224 + company = $("#company").val();
  225 + subCompany = $("#subCompany").val();
222 226 params['line'] = line;
223 227 params['startDate'] = startDate;
224 228 params['endDate'] = endDate;
225 229 params['model'] = model;
226 230 params['times'] = times;
227 231 params['upDown'] = upDown;
  232 + params['company'] = company;
  233 + params['subCompany'] = subCompany;
228 234 params['type'] = "query";
229 235 $(".hidden").removeClass("hidden");
230 236 $get('/busInterval/timeAndSpeed', params, function(result){
... ...
src/main/resources/static/pages/forms/statement/workDaily.html
... ... @@ -102,15 +102,16 @@
102 102 var year = d.getFullYear();
103 103 var month = d.getMonth() + 1;
104 104 var day = d.getDate();
105   - if(month > 9){
106   - $("#date").val(year + "-" + month + "-" + day);
107   - } else {
108   - $("#date").val(year + "-0" + month + "-" + day);
109   - }
  105 + if(month < 10)
  106 + month = "0" + month;
  107 + if(day < 10)
  108 + day = "0" + day;
  109 + $("#date").val(year + "-" + month + "-" + day);
110 110  
111 111 $.get('/basic/lineCode2Name',function(result){
112 112 var data=[];
113 113  
  114 + data.push({id: " ", text: "全部线路"});
114 115 for(var code in result){
115 116 data.push({id: code, text: result[code]});
116 117 }
... ... @@ -153,13 +154,21 @@
153 154  
154 155 var line = $("#line").val();
155 156 var date = $("#date").val();
  157 + var company = $("#company").val();
  158 + var subCompany = $("#subCompany").val();
156 159 function jsDoQuery(pagination){
157 160 var params = {};
158 161 line = $("#line").val();
159 162 date = $("#date").val();
  163 + company = $("#company").val();
  164 + subCompany = $("#subCompany").val();
  165 + if(line == " ")
  166 + line = "";
160 167 params['line'] = line;
161 168 params['date'] = date;
162 169 params['type'] = "query";
  170 + params['company'] = company;
  171 + params['subCompany'] = subCompany;
163 172 $(".hidden").removeClass("hidden");
164 173 $get('/pcpc/workDaily', params, function(result){
165 174 // 把数据填充到模版中
... ...