Commit 08fe766e60ff9b4d8ef41e10bccde585570d8797

Authored by 徐烜
2 parents ce2acf08 5b87aef8

Update

src/main/java/com/bsth/controller/schedule/PeopleCarPlanController.java
@@ -33,6 +33,11 @@ public class PeopleCarPlanController { @@ -33,6 +33,11 @@ public class PeopleCarPlanController {
33 public Map<String, Object> scheduleAnaly(@RequestParam Map<String, Object> map){ 33 public Map<String, Object> scheduleAnaly(@RequestParam Map<String, Object> map){
34 return peopleCarPlanService.scheduleAnaly(map); 34 return peopleCarPlanService.scheduleAnaly(map);
35 } 35 }
  36 +
  37 + @RequestMapping(value="/scheduleAnaly_sum", method = RequestMethod.GET)
  38 + public Map<String, Object> scheduleAnaly_sum(@RequestParam Map<String, Object> map){
  39 + return peopleCarPlanService.scheduleAnaly_sum(map);
  40 + }
36 41
37 @RequestMapping(value="/getModel", method = RequestMethod.GET) 42 @RequestMapping(value="/getModel", method = RequestMethod.GET)
38 public List<Map<String,Object>> getModel(@RequestParam Map<String, Object> map){ 43 public List<Map<String,Object>> getModel(@RequestParam Map<String, Object> map){
@@ -44,6 +49,11 @@ public class PeopleCarPlanController { @@ -44,6 +49,11 @@ public class PeopleCarPlanController {
44 return peopleCarPlanService.firstAndLastBus(map); 49 return peopleCarPlanService.firstAndLastBus(map);
45 } 50 }
46 51
  52 + @RequestMapping(value="/firstAndLastBus_sum", method = RequestMethod.GET)
  53 + public List<Map<String,Object>> firstAndLastBus_sum(@RequestParam Map<String, Object> map){
  54 + return peopleCarPlanService.firstAndLastBus_sum(map);
  55 + }
  56 +
47 @RequestMapping(value="/commandState", method = RequestMethod.GET) 57 @RequestMapping(value="/commandState", method = RequestMethod.GET)
48 public List<Map<String,Object>> commandState(@RequestParam Map<String, Object> map){ 58 public List<Map<String,Object>> commandState(@RequestParam Map<String, Object> map){
49 return peopleCarPlanService.commandState(map); 59 return peopleCarPlanService.commandState(map);
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -79,6 +79,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -79,6 +79,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
79 @Override 79 @Override
80 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { 80 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
81 ScheduleRealInfo schedule = new ScheduleRealInfo(); 81 ScheduleRealInfo schedule = new ScheduleRealInfo();
  82 + schedule.setId(rs.getLong("id"));
82 schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); 83 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
83 schedule.setRealExecDate(rs.getString("real_exec_date")); 84 schedule.setRealExecDate(rs.getString("real_exec_date"));
84 schedule.setXlBm(rs.getString("xl_bm")); 85 schedule.setXlBm(rs.getString("xl_bm"));
@@ -98,6 +99,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -98,6 +99,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
98 schedule.setZdzName(rs.getString("zdz_name")); 99 schedule.setZdzName(rs.getString("zdz_name"));
99 schedule.setXlDir(rs.getString("xl_dir")); 100 schedule.setXlDir(rs.getString("xl_dir"));
100 schedule.setStatus(rs.getInt("status")); 101 schedule.setStatus(rs.getInt("status"));
  102 + schedule.setAdjustExps(rs.getString("adjust_exps"));
  103 + schedule.setJhlcOrig(rs.getDouble("jhlc_orig"));
101 schedule.setRemarks(rs.getString("remarks")); 104 schedule.setRemarks(rs.getString("remarks"));
102 schedule.setGsName(rs.getString("gs_name")); 105 schedule.setGsName(rs.getString("gs_name"));
103 schedule.setFgsName(rs.getString("fgs_name")); 106 schedule.setFgsName(rs.getString("fgs_name"));
@@ -1557,47 +1560,52 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1557,47 +1560,52 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1557 companyName = schedule.getGsName(); 1560 companyName = schedule.getGsName();
1558 if(schedule.getFgsName() != null && subCompanyName.length() == 0) 1561 if(schedule.getFgsName() != null && subCompanyName.length() == 0)
1559 subCompanyName = schedule.getFgsName(); 1562 subCompanyName = schedule.getFgsName();
  1563 + double lc = 0d;
  1564 + if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){
  1565 + lc = schedule.getJhlcOrig();
  1566 + } else {
  1567 + lc = schedule.getJhlc();
  1568 + }
  1569 +
1560 jhbc++; 1570 jhbc++;
1561 - if(schedule.getJhlc() != null)  
1562 - jhlc += schedule.getJhlc(); 1571 + jhlc += lc;
1563 if(schedule.getStatus() == 2){ 1572 if(schedule.getStatus() == 2){
1564 sjbc++; 1573 sjbc++;
1565 - if(schedule.getJhlc() != null)  
1566 - sjlc += schedule.getJhlc(); 1574 + sjlc += lc;
1567 } else if(schedule.getStatus() == -1){ 1575 } else if(schedule.getStatus() == -1){
1568 - if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("路阻") != -1){ 1576 + if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){
1569 lzbc++; 1577 lzbc++;
1570 - lzlc += schedule.getJhlc();  
1571 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("吊慢") != -1){ 1578 + lzlc += lc;
  1579 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){
1572 dmbc++; 1580 dmbc++;
1573 - dmlc += schedule.getJhlc();  
1574 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("故障") != -1){ 1581 + dmlc += lc;
  1582 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){
1575 gzbc++; 1583 gzbc++;
1576 - gzlc += schedule.getJhlc();  
1577 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("纠纷") != -1){ 1584 + gzlc += lc;
  1585 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){
1578 jfbc++; 1586 jfbc++;
1579 - jflc += schedule.getJhlc();  
1580 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("肇事") != -1){ 1587 + jflc += lc;
  1588 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){
1581 zsbc++; 1589 zsbc++;
1582 - zslc += schedule.getJhlc();  
1583 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺人") != -1){ 1590 + zslc += lc;
  1591 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){
1584 qrbc++; 1592 qrbc++;
1585 - qrlc += schedule.getJhlc();  
1586 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺车") != -1){ 1593 + qrlc += lc;
  1594 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){
1587 qcbc++; 1595 qcbc++;
1588 - qclc += schedule.getJhlc();  
1589 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("客稀") != -1){ 1596 + qclc += lc;
  1597 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){
1590 kxbc++; 1598 kxbc++;
1591 - kxlc += schedule.getJhlc();  
1592 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("气候") != -1){ 1599 + kxlc += lc;
  1600 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){
1593 qhbc++; 1601 qhbc++;
1594 - qhlc += schedule.getJhlc();  
1595 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("外援") != -1){ 1602 + qhlc += lc;
  1603 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("外援") != -1){
1596 wybc++; 1604 wybc++;
1597 - wylc += schedule.getJhlc(); 1605 + wylc += lc;
1598 } else { 1606 } else {
1599 qtbc++; 1607 qtbc++;
1600 - qtlc += schedule.getJhlc(); 1608 + qtlc += lc;
1601 } 1609 }
1602 } 1610 }
1603 } 1611 }
src/main/java/com/bsth/service/schedule/PeopleCarPlanService.java
@@ -11,9 +11,13 @@ public interface PeopleCarPlanService { @@ -11,9 +11,13 @@ public interface PeopleCarPlanService {
11 11
12 Map<String, Object> scheduleAnaly(Map<String, Object> map); 12 Map<String, Object> scheduleAnaly(Map<String, Object> map);
13 13
  14 + Map<String, Object> scheduleAnaly_sum(Map<String, Object> map);
  15 +
14 List<Map<String, Object>> getModel(Map<String, Object> map); 16 List<Map<String, Object>> getModel(Map<String, Object> map);
15 17
16 List<Map<String, Object>> firstAndLastBus(Map<String, Object> map); 18 List<Map<String, Object>> firstAndLastBus(Map<String, Object> map);
17 19
  20 + List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map);
  21 +
18 List<Map<String, Object>> commandState(Map<String, Object> map); 22 List<Map<String, Object>> commandState(Map<String, Object> map);
19 } 23 }
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java renamed to src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
1 -package com.bsth.service.schedule; 1 +package com.bsth.service.schedule.impl;
2 2
3 import com.bsth.entity.realcontrol.ScheduleRealInfo; 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
4 import com.bsth.entity.schedule.SchedulePlanInfo; 4 import com.bsth.entity.schedule.SchedulePlanInfo;
@@ -18,6 +18,18 @@ import java.text.ParseException; @@ -18,6 +18,18 @@ import java.text.ParseException;
18 import java.text.SimpleDateFormat; 18 import java.text.SimpleDateFormat;
19 import java.util.*; 19 import java.util.*;
20 20
  21 +
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.jdbc.core.JdbcTemplate;
  24 +import org.springframework.jdbc.core.RowMapper;
  25 +import org.springframework.stereotype.Service;
  26 +
  27 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  28 +import com.bsth.entity.schedule.SchedulePlanInfo;
  29 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  30 +import com.bsth.service.schedule.PeopleCarPlanService;
  31 +import com.bsth.util.ReportUtils;
  32 +
21 @Service 33 @Service
22 public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { 34 public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
23 35
@@ -1131,6 +1143,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1131,6 +1143,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1131 for(ScheduleRealInfo schedule : list){ 1143 for(ScheduleRealInfo schedule : list){
1132 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) 1144 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
1133 continue; 1145 continue;
  1146 + if(schedule.getStatus() == -1){
  1147 + continue;
  1148 + }
1134 String key = schedule.getXlName(); 1149 String key = schedule.getXlName();
1135 if(key == null || key.trim().length() == 0) 1150 if(key == null || key.trim().length() == 0)
1136 continue; 1151 continue;
@@ -1164,9 +1179,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1164,9 +1179,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1164 longList1.add(min); 1179 longList1.add(min);
1165 } 1180 }
1166 } 1181 }
1167 - if(longList0.size() == 0 || longList1.size() == 0){  
1168 - continue;  
1169 - } 1182 +
1170 if(longList0.size() != 0){ 1183 if(longList0.size() != 0){
1171 Collections.sort(longList0); 1184 Collections.sort(longList0);
1172 ScheduleRealInfo shouban0 = temp0.get(longList0.get(0)); 1185 ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
@@ -1286,6 +1299,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1286,6 +1299,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1286 1299
1287 // @Override 1300 // @Override
1288 public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) { 1301 public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) {
  1302 + NumberFormat nf = NumberFormat.getNumberInstance();
  1303 + nf.setMinimumFractionDigits(2);
1289 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 1304 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
1290 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); 1305 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
1291 1306
@@ -1303,6 +1318,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1303,6 +1318,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1303 for(ScheduleRealInfo schedule : list){ 1318 for(ScheduleRealInfo schedule : list){
1304 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) 1319 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
1305 continue; 1320 continue;
  1321 + if(schedule.getStatus() == -1){
  1322 + continue;
  1323 + }
1306 String key = schedule.getXlName(); 1324 String key = schedule.getXlName();
1307 if(key == null || key.trim().length() == 0) 1325 if(key == null || key.trim().length() == 0)
1308 continue; 1326 continue;
@@ -1336,80 +1354,68 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1336,80 +1354,68 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1336 longList1.add(min); 1354 longList1.add(min);
1337 } 1355 }
1338 } 1356 }
1339 - if(longList0.size() == 0 || longList1.size() == 0){  
1340 - continue; 1357 +
  1358 + int jhbc = 0;
  1359 + int sjbc = 0;
  1360 +
  1361 + if(longList0.size() != 0){
  1362 + Collections.sort(longList0);
  1363 + ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
  1364 + ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));
  1365 + if(shouban0.getFcsjActual() != null){
  1366 + jhbc++;
  1367 + String[] split = shouban0.getFcsjActual().split(":");
  1368 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1369 + long delay = shouban0.getFcsjT() - min;
  1370 + if(delay >= -3 && delay <= 1){
  1371 + sjbc++;
  1372 + }
  1373 + }
  1374 +
  1375 + if(moban0.getFcsjActual() != null){
  1376 + jhbc++;
  1377 + String[] split = moban0.getFcsjActual().split(":");
  1378 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1379 + long delay = moban0.getFcsjT() - min;
  1380 + if(delay >= -3 && delay <= 1){
  1381 + sjbc++;
  1382 + }
  1383 + }
  1384 + }
  1385 +
  1386 + if(longList1.size() != 0){
  1387 + Collections.sort(longList1);
  1388 + ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));
  1389 + ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1));
  1390 + if(shouban1.getFcsjActual() != null){
  1391 + jhbc++;
  1392 + String[] split = shouban1.getFcsjActual().split(":");
  1393 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1394 + long delay = shouban1.getFcsjT() - min;
  1395 + if(delay >= -3 && delay <= 1){
  1396 + sjbc++;
  1397 + }
  1398 + }
  1399 + if(moban1.getFcsjActual() != null){
  1400 + jhbc++;
  1401 + String[] split = moban1.getFcsjActual().split(":");
  1402 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1403 + long delay = moban1.getFcsjT() - min;
  1404 + if(delay >= -3 && delay <= 1){
  1405 + sjbc++;
  1406 + }
  1407 + }
1341 } 1408 }
1342 - Collections.sort(longList0);  
1343 - Collections.sort(longList1);  
1344 - ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));  
1345 - ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));  
1346 - ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));  
1347 - ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); 1409 +
  1410 + tempMap.put("jhbc", jhbc);
  1411 + tempMap.put("sjbc", sjbc);
  1412 + tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%");
1348 tempMap.put("date", date); 1413 tempMap.put("date", date);
1349 tempMap.put("company", companyName); 1414 tempMap.put("company", companyName);
1350 tempMap.put("subCompany", subCompanyName); 1415 tempMap.put("subCompany", subCompanyName);
1351 tempMap.put("line", key); 1416 tempMap.put("line", key);
1352 - tempMap.put("qdzFirst0", shouban0.getQdzName());  
1353 - tempMap.put("jhfcFirst0", shouban0.getFcsj());  
1354 - tempMap.put("qdzLast0", moban0.getQdzName());  
1355 - tempMap.put("jhfcLast0", moban0.getFcsj());  
1356 - tempMap.put("qdzFirst1", shouban1.getQdzName());  
1357 - tempMap.put("jhfcFirst1", shouban1.getFcsj());  
1358 - tempMap.put("qdzLast1", moban1.getQdzName());  
1359 - tempMap.put("jhfcLast1", moban1.getFcsj());  
1360 - if(shouban0.getFcsjActual() != null){  
1361 - String[] split = shouban0.getFcsjActual().split(":");  
1362 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1363 - long delay = shouban0.getFcsjT() - min;  
1364 - tempMap.put("sjfcFirst0", shouban0.getFcsjActual());  
1365 - if(delay > 0)  
1366 - tempMap.put("delayFirst0", "+" + delay);  
1367 - else  
1368 - tempMap.put("delayFirst0", delay);  
1369 - } else {  
1370 - tempMap.put("sjfcFirst0", "/");  
1371 - tempMap.put("delayFirst0", "/");  
1372 - }  
1373 - if(moban0.getFcsjActual() != null){  
1374 - String[] split = moban0.getFcsjActual().split(":");  
1375 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1376 - long delay = moban0.getFcsjT() - min;  
1377 - tempMap.put("sjfcLast0", moban0.getFcsjActual());  
1378 - if(delay > 0)  
1379 - tempMap.put("delayLast0", "+" + delay);  
1380 - else  
1381 - tempMap.put("delayLast0", delay);  
1382 - } else {  
1383 - tempMap.put("sjfcLast0", "/");  
1384 - tempMap.put("delayLast0", "/");  
1385 - }  
1386 - if(shouban1.getFcsjActual() != null){  
1387 - String[] split = shouban1.getFcsjActual().split(":");  
1388 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1389 - long delay = shouban1.getFcsjT() - min;  
1390 - tempMap.put("sjfcFirst1", shouban1.getFcsjActual());  
1391 - if(delay > 0)  
1392 - tempMap.put("delayFirst1", "+" + delay);  
1393 - else  
1394 - tempMap.put("delayFirst1", delay);  
1395 - } else {  
1396 - tempMap.put("sjfcFirst1", "/");  
1397 - tempMap.put("delayFirst1", "/");  
1398 - }  
1399 - if(moban1.getFcsjActual() != null){  
1400 - String[] split = moban1.getFcsjActual().split(":");  
1401 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1402 - long delay = moban1.getFcsjT() - min;  
1403 - tempMap.put("sjfcLast1", moban1.getFcsjActual());  
1404 - if(delay > 0)  
1405 - tempMap.put("delayLast1", "+" + delay);  
1406 - else  
1407 - tempMap.put("delayLast1", delay);  
1408 - } else {  
1409 - tempMap.put("sjfcLast1", "/");  
1410 - tempMap.put("delayLast1", "/");  
1411 - }  
1412 resList.add(tempMap); 1417 resList.add(tempMap);
  1418 + System.out.println(tempMap);
1413 } 1419 }
1414 1420
1415 if(type.equals("export")){ 1421 if(type.equals("export")){
src/main/resources/static/pages/forms/mould/scheduleAnaly_sum.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
@@ -64,6 +64,7 @@ @@ -64,6 +64,7 @@
64 <th colspan="4">下行末发</th> 64 <th colspan="4">下行末发</th>
65 </tr> 65 </tr>
66 <tr class="hidden"> 66 <tr class="hidden">
  67 + <th style="display: none;"></th>
67 <th>站点</th> 68 <th>站点</th>
68 <th>计发</th> 69 <th>计发</th>
69 <th>实发</th> 70 <th>实发</th>
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>线路首末班准点率</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;margin-left: 10px;" id="company1">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 10px;" id="subCompany1">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 10px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  41 + </div>
  42 + <div style="display: inline-block;margin-left: 10px;">
  43 + <span class="item-label" style="width: 80px;">时间: </span>
  44 + <input class="form-control" type="text" id="date" style="width: 160px;"/>
  45 + </div>
  46 + <div class="form-group">
  47 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  48 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  49 + </div>
  50 + </form>
  51 + </div>
  52 + <div class="portlet-body">
  53 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  54 + <table class="table table-bordered table-hover table-checkable" id="forms">
  55 + <thead>
  56 + <tr class="hidden">
  57 + <th>日期</th>
  58 + <th>公司</th>
  59 + <th>分公司</th>
  60 + <th>线路</th>
  61 + <th>计划首末班次数</th>
  62 + <th>实际准点首末班次数</th>
  63 + <th>首末班准点率</th>
  64 + </tr>
  65 + </thead>
  66 + <tbody>
  67 +
  68 + </tbody>
  69 + </table>
  70 + <div style="text-align: right;">
  71 + <ul id="pagination" class="pagination"></ul>
  72 + </div>
  73 + </div>
  74 + </div>
  75 + </div>
  76 + </div>
  77 +</div>
  78 +
  79 +<script>
  80 + $(function(){
  81 + $('#export').attr('disabled', "true");
  82 +
  83 + // 关闭左侧栏
  84 + if (!$('body').hasClass('page-sidebar-closed'))
  85 + $('.menu-toggler.sidebar-toggler').click();
  86 +
  87 + $("#date").datetimepicker({
  88 + format : 'YYYY-MM-DD',
  89 + locale : 'zh-cn'
  90 + });
  91 +
  92 + var d = new Date();
  93 + var year = d.getFullYear();
  94 + var month = d.getMonth() + 1;
  95 + var day = d.getDate();
  96 + if(month < 10)
  97 + month = "0" + month;
  98 + if(day < 10)
  99 + day = "0" + day;
  100 + $("#date").val(year + "-" + month + "-" + day);
  101 +
  102 + var fage=false;
  103 + var xlList;
  104 + var obj = [];
  105 +
  106 + $.get('/report/lineList',function(result){
  107 + xlList=result;
  108 + $.get('/user/companyData', function(result){
  109 + obj = result;
  110 + var options = '';
  111 + for(var i = 0; i < obj.length; i++){
  112 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  113 + }
  114 +
  115 + if(obj.length ==0){
  116 + $("#company1").css('display','none');
  117 + }else if(obj.length ==1){
  118 + $("#company1").css('display','none');
  119 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  120 + $('#subCompany1').css('display','none');
  121 + }
  122 + $('#company').html(options);
  123 + updateCompany();
  124 + });
  125 + })
  126 + $("#company").on("change",updateCompany);
  127 + function updateCompany(){
  128 + var company = $('#company').val();
  129 + var options = '';
  130 + for(var i = 0; i < obj.length; i++){
  131 + if(obj[i].companyCode == company){
  132 + var children = obj[i].children;
  133 + for(var j = 0; j < children.length; j++){
  134 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  135 + }
  136 + }
  137 + }
  138 + $('#subCompany').html(options);
  139 + initXl();
  140 + }
  141 +
  142 + $("#subCompany").on("change",initXl);
  143 + function initXl(){
  144 + var data=[];
  145 + if(fage){
  146 + $("#line").select2("destroy").html('');
  147 + }
  148 + var fgs=$('#subCompany').val();
  149 + var gs=$('#company').val();
  150 + data.push({id: " ", text: "全部线路"});
  151 + for(var i=0;i<xlList.length;i++){
  152 + if(gs!=""){
  153 + if(fgs!=""){
  154 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  155 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  156 + }
  157 + }else{
  158 + if(xlList[i]["gsbm"]==gs){
  159 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  160 + }
  161 + }
  162 + }
  163 + }
  164 + initPinYinSelect2('#line',data,'');
  165 + fage=true;
  166 + }
  167 +
  168 +
  169 + $("#query").on("click",jsDoQuery);
  170 +
  171 + var company = $("#company").val();
  172 + var subCompany = $("#subCompany").val();
  173 + var line = $("#line").val();
  174 + var date = $("#date").val();
  175 + function jsDoQuery(pagination){
  176 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  177 + layer.msg("请选择时间!");
  178 + return;
  179 + }
  180 + var params = {};
  181 + company = $("#company").val();
  182 + subCompany = $("#subCompany").val();
  183 + line = $("#line").val();
  184 + date = $("#date").val();
  185 + if(line == " ")
  186 + line = "";
  187 + params['company'] = company;
  188 + params['subCompany'] = subCompany;
  189 + params['line'] = line;
  190 + params['line'] = line;
  191 + params['date'] = date;
  192 + params['type'] = "query";
  193 + $(".hidden").removeClass("hidden");
  194 + $get('/pcpc/firstAndLastBus_sum', params, function(result){
  195 + // 把数据填充到模版中
  196 + var tbodyHtml = template('list_firstAndLastBus',{list:result});
  197 + // 把渲染好的模版html文本追加到表格中
  198 + $('#forms tbody').html(tbodyHtml);
  199 +
  200 + if(result.length == 0)
  201 + $("#export").attr('disabled',"true");
  202 + else
  203 + $("#export").removeAttr("disabled");
  204 + });
  205 + }
  206 +
  207 + $("#export").on("click",function(){
  208 + var params = {};
  209 + params['company'] = company;
  210 + params['subCompany'] = subCompany;
  211 + params['line'] = line;
  212 + params['line'] = line;
  213 + params['date'] = date;
  214 + params['type'] = "export";
  215 + $get('/pcpc/firstAndLastBus', params, function(result){
  216 + window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
  217 + });
  218 + });
  219 +
  220 +
  221 + });
  222 +
  223 +</script>
  224 +<script type="text/html" id="list_firstAndLastBus">
  225 + {{each list as obj i}}
  226 + <tr>
  227 + <td>{{obj.date}}</td>
  228 + <td>{{obj.company}}</td>
  229 + <td>{{obj.subCompany}}</td>
  230 + <td>{{obj.line}}</td>
  231 + <td>{{obj.jhbc}}</td>
  232 + <td>{{obj.sjbc}}</td>
  233 + <td>{{obj.zdl}}</td>
  234 + </tr>
  235 + {{/each}}
  236 + {{if list.length == 0}}
  237 + <tr>
  238 + <td colspan="20"><h6 class="muted">没有找到相关数据</h6></td>
  239 + </tr>
  240 + {{/if}}
  241 +</script>
0 \ No newline at end of file 242 \ No newline at end of file
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>时刻表分析</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;margin-left: 38px;" id="company1">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 24px;" id="subCompany1">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 15px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  41 + </div>
  42 + <div style="margin-top: 10px"></div>
  43 + <div style="display: inline-block;margin-left: 10px;">
  44 + <span class="item-label" style="width: 80px;">开始时间: </span>
  45 + <input class="form-control" type="text" id="startDate" style="width: 160px;"/>
  46 + </div>
  47 + <div style="display: inline-block;margin-left: 10px;">
  48 + <span class="item-label" style="width: 80px;">结束时间: </span>
  49 + <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
  50 + </div>
  51 + <div style="display: inline-block;margin-left: 15px;">
  52 + <span class="item-label" style="width: 80px;">车辆: </span>
  53 + <select class="form-control" id="nbbm" style="width: 160px;"></select>
  54 + </div>
  55 +<!-- <div style="display: inline-block;margin-left: 10px;"> -->
  56 +<!-- <span class="item-label" style="width: 80px;">模板类型: </span> -->
  57 +<!-- <select class="form-control" name="model" id="model" style="width: 160px;"> -->
  58 +<!-- <option value="">请选择...</option> -->
  59 +<!-- </select> -->
  60 +<!-- </div> -->
  61 + <div class="form-group">
  62 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  63 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  64 + </div>
  65 + </form>
  66 + </div>
  67 + <div class="portlet-body">
  68 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  69 + <table class="table table-bordered table-hover table-checkable" id="forms">
  70 + <thead>
  71 + <tr class="hidden">
  72 + <th style="display: none;"></th>
  73 + <th>时间段</th>
  74 + <th>上行班次</th>
  75 + <th>下行班次</th>
  76 + <th>上行平均运送</th>
  77 + <th>下行平均运送</th>
  78 + <th>平均运送</th>
  79 + </tr>
  80 + </thead>
  81 + <tbody>
  82 +
  83 + </tbody>
  84 + </table>
  85 + <div style="text-align: right;">
  86 + <ul id="pagination" class="pagination"></ul>
  87 + </div>
  88 + </div>
  89 + </div>
  90 + </div>
  91 + </div>
  92 +</div>
  93 +
  94 +<script>
  95 + $(function(){
  96 + var page = 0, initPagination;
  97 + $('#export').attr('disabled', "true");
  98 +
  99 + // 关闭左侧栏
  100 + if (!$('body').hasClass('page-sidebar-closed'))
  101 + $('.menu-toggler.sidebar-toggler').click();
  102 +
  103 + $("#startDate").datetimepicker({
  104 + format : 'YYYY-MM-DD',
  105 + locale : 'zh-cn'
  106 + });
  107 +
  108 + $("#endDate").datetimepicker({
  109 + format : 'YYYY-MM-DD',
  110 + locale : 'zh-cn'
  111 + });
  112 +
  113 + var d = new Date();
  114 + var year = d.getFullYear();
  115 + var month = d.getMonth() + 1;
  116 + var day = d.getDate();
  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);
  123 +
  124 + var fage=false;
  125 + var xlList;
  126 + var obj = [];
  127 +
  128 + $.get('/report/lineList',function(result){
  129 + xlList=result;
  130 + $.get('/user/companyData', function(result){
  131 + obj = result;
  132 + var options = '';
  133 + for(var i = 0; i < obj.length; i++){
  134 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  135 + }
  136 +
  137 + if(obj.length ==0){
  138 + $("#company1").css('display','none');
  139 + }else if(obj.length ==1){
  140 + $("#company1").css('display','none');
  141 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  142 + $('#subCompany1').css('display','none');
  143 + }
  144 + $('#company').html(options);
  145 + updateCompany();
  146 + });
  147 + })
  148 + $("#company").on("change",updateCompany);
  149 + function updateCompany(){
  150 + var company = $('#company').val();
  151 + var options = '';
  152 + for(var i = 0; i < obj.length; i++){
  153 + if(obj[i].companyCode == company){
  154 + var children = obj[i].children;
  155 + for(var j = 0; j < children.length; j++){
  156 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  157 + }
  158 + }
  159 + }
  160 + $('#subCompany').html(options);
  161 + initXl();
  162 + }
  163 +
  164 + $("#subCompany").on("change",initXl);
  165 + function initXl(){
  166 + var data=[];
  167 + if(fage){
  168 + $("#line").select2("destroy").html('');
  169 + }
  170 + var fgs=$('#subCompany').val();
  171 + var gs=$('#company').val();
  172 + for(var i=0;i<xlList.length;i++){
  173 + if(gs!=""){
  174 + if(fgs!=""){
  175 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  176 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  177 + }
  178 + }else{
  179 + if(xlList[i]["gsbm"]==gs){
  180 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  181 + }
  182 + }
  183 + }
  184 + }
  185 + initPinYinSelect2('#line',data,'');
  186 + line = data[0].id;
  187 + updateModel();
  188 + initCl();
  189 +
  190 + fage=true;
  191 + }
  192 +
  193 +
  194 + $("#query").on("click", function(){
  195 + page = 0;
  196 + jsDoQuery(true);
  197 + });
  198 +
  199 + var line = $("#line").val();
  200 + var startDate = $("#startDate").val();
  201 + var endDate = $("#endDate").val();
  202 + var model = $("#model").val();
  203 + var nbbm = "";
  204 + var company = $("#company").val();
  205 + var subCompany = $("#subCompany").val();
  206 + function jsDoQuery(pagination){
  207 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  208 + layer.msg("请选择时间范围!");
  209 + return;
  210 + }
  211 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  212 + layer.msg("请选择时间范围!");
  213 + return;
  214 + }
  215 + var params = {};
  216 +// line = $("#line").val();
  217 + startDate = $("#startDate").val();
  218 + endDate = $("#endDate").val();
  219 +// model = $("#model").val();
  220 + nbbm = $("#nbbm").val()!=null?$("#nbbm").val():"";
  221 + company = $("#company").val();
  222 + subCompany = $("#subCompany").val();
  223 + params['page'] = page;
  224 + params['line'] = line;
  225 + params['startDate'] = startDate;
  226 + params['endDate'] = endDate;
  227 +// params['model'] = model;
  228 + params['company'] = company;
  229 + params['subCompany'] = subCompany;
  230 + params['nbbm'] = nbbm;
  231 + params['type'] = "query";
  232 + $(".hidden").removeClass("hidden");
  233 + $get('/pcpc/scheduleAnaly_sum', params, function(result){
  234 + // 把数据填充到模版中
  235 + var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList});
  236 + // 把渲染好的模版html文本追加到表格中
  237 + $('#forms tbody').html(tbodyHtml);
  238 +
  239 + if(result.dataList.length == 0)
  240 + $("#export").attr('disabled',"true");
  241 + else
  242 + $("#export").removeAttr("disabled");
  243 +
  244 + });
  245 + }
  246 +
  247 + $("#export").on("click",function(){
  248 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  249 + layer.msg("请选择时间范围!");
  250 + return;
  251 + }
  252 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  253 + layer.msg("请选择时间范围!");
  254 + return;
  255 + }
  256 + var params = {};
  257 + params['page'] = page;
  258 + params['line'] = line;
  259 + params['startDate'] = startDate;
  260 + params['endDate'] = endDate;
  261 +// params['model'] = model;
  262 + params['company'] = company;
  263 + params['subCompany'] = subCompany;
  264 + params['nbbm'] = nbbm;
  265 + params['type'] = "export";
  266 + $get('/pcpc/scheduleAnaly_sum', params, function(result){
  267 + window.open("/downloadFile/download?fileName=时刻表分析(汇总)"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  268 + });
  269 + });
  270 +
  271 +
  272 + $("#line").on("change", function(){
  273 + line = $("#line").val();
  274 + if(line == " ")
  275 + line = "";
  276 + updateModel();
  277 + });
  278 + $('#startDate').on("blur", function(){
  279 + startDate = $("#startDate").val();
  280 + endDate = $("#endDate").val();
  281 + updateModel();
  282 + });
  283 + $('#endDate').on("blur", function(){
  284 + startDate = $("#startDate").val();
  285 + endDate = $("#endDate").val();
  286 + updateModel();
  287 + });
  288 +
  289 + var flag = 0;
  290 + function updateModel(){
  291 + if(flag == 1)
  292 + return;
  293 + flag = 1;
  294 + var treeData = [];
  295 + var params = {};
  296 + params['line'] = line;
  297 + params['startDate'] = startDate;
  298 + params['endDate'] = endDate;
  299 + $get('/pcpc/getModel', params, function(result){
  300 + treeData = createTreeData(result);
  301 + var options = '<option value="">请选择...</option>';
  302 + var size = 0;
  303 + $.each(treeData, function(i, g){
  304 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  305 + size++;
  306 + });
  307 + $('#model').html(options)/* .select2() */;
  308 + flag = 0;
  309 + });
  310 + }
  311 +
  312 + function initCl(){
  313 + $('#nbbm').select2({
  314 + placeholder: '搜索车辆...',
  315 + ajax: {
  316 + url: '/report/carList',
  317 + dataType: 'json',
  318 + delay: 150,
  319 + data: function(params){
  320 + return{nbbm: params.term,
  321 + gsbm:$('#gsdm').val(),
  322 + fgsbm:$('#fgsdm').val(),
  323 + xlbm:$('#line').val()};
  324 + },
  325 + processResults: function (data) {
  326 + return {
  327 + results: data
  328 + };
  329 + },
  330 + cache: true
  331 + },
  332 + templateResult: function(repo){
  333 + if (repo.loading) return repo.text;
  334 + var h = '<span>'+repo.text+'</span>';
  335 + h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
  336 + return h;
  337 + },
  338 + escapeMarkup: function (markup) { return markup; },
  339 + minimumInputLength: 1,
  340 + templateSelection: function(repo){
  341 + return repo.text;
  342 + },
  343 + language: {
  344 + noResults: function(){
  345 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  346 + },
  347 + inputTooShort : function(e) {
  348 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  349 + },
  350 + searching : function() {
  351 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  352 + }
  353 + }
  354 + });
  355 + };
  356 +
  357 +
  358 + });
  359 +
  360 +</script>
  361 +<script type="text/html" id="list_scheduleAnaly">
  362 + {{each list as obj i}}
  363 + <tr>
  364 + <th style="display: none;"></th>
  365 + <td>{{obj.time}}</td>
  366 + <td>{{obj.upbc}}</td>
  367 + <td>{{obj.dnbc}}</td>
  368 + <td>{{obj.upys}}</td>
  369 + <td>{{obj.dnys}}</td>
  370 + <td>{{obj.pjys}}</td>
  371 + </tr>
  372 + {{/each}}
  373 + {{if list.length == 0}}
  374 + <tr>
  375 + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
  376 + </tr>
  377 + {{/if}}
  378 +</script>
0 \ No newline at end of file 379 \ No newline at end of file