Commit 30422e3dc068f0358c0d91037af6452611d5162b
1 parent
e860984a
1.成都加入客流信息
Showing
30 changed files
with
1439 additions
and
254 deletions
src/main/java/com/bsth/config/RabbitConfig.java
| @@ -15,7 +15,12 @@ public class RabbitConfig { | @@ -15,7 +15,12 @@ public class RabbitConfig { | ||
| 15 | /** | 15 | /** |
| 16 | * 报警队列名(调度系统) | 16 | * 报警队列名(调度系统) |
| 17 | */ | 17 | */ |
| 18 | - public final static String QUEUE_ALARM_SCHEDULE = "schedule"; | 18 | + public final static String QUEUE_ALARM_SCHEDULE = "alarm.schedule"; |
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 客流队列名(调度系统) | ||
| 22 | + */ | ||
| 23 | + public final static String QUEUE_PASSENGER_FLOW_SCHEDULE = "passenger-flow.schedule"; | ||
| 19 | 24 | ||
| 20 | @Bean | 25 | @Bean |
| 21 | public MessageConverter messageConverter(){ | 26 | public MessageConverter messageConverter(){ |
src/main/java/com/bsth/controller/LsStationRouteController.java
| @@ -5,12 +5,15 @@ import com.bsth.entity.LsSectionRoute; | @@ -5,12 +5,15 @@ import com.bsth.entity.LsSectionRoute; | ||
| 5 | import com.bsth.entity.LsStationRoute; | 5 | import com.bsth.entity.LsStationRoute; |
| 6 | import com.bsth.service.LsStationRouteService; | 6 | import com.bsth.service.LsStationRouteService; |
| 7 | import com.fasterxml.jackson.databind.ObjectMapper; | 7 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 8 | +import org.joda.time.format.DateTimeFormat; | ||
| 9 | +import org.joda.time.format.DateTimeFormatter; | ||
| 8 | import org.slf4j.Logger; | 10 | import org.slf4j.Logger; |
| 9 | import org.slf4j.LoggerFactory; | 11 | import org.slf4j.LoggerFactory; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.data.domain.Page; | 13 | import org.springframework.data.domain.Page; |
| 12 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| 13 | 15 | ||
| 16 | +import java.text.DateFormat; | ||
| 14 | import java.util.*; | 17 | import java.util.*; |
| 15 | 18 | ||
| 16 | /** | 19 | /** |
| @@ -286,4 +289,25 @@ public class LsStationRouteController extends BaseController<LsStationRoute, Int | @@ -286,4 +289,25 @@ public class LsStationRouteController extends BaseController<LsStationRoute, Int | ||
| 286 | 289 | ||
| 287 | return result; | 290 | return result; |
| 288 | } | 291 | } |
| 292 | + | ||
| 293 | + @RequestMapping(value = "/findByLineDirectionDate", method = RequestMethod.GET) | ||
| 294 | + public Map<String, Object> findByLineDirectionDate(@RequestParam Map<String, Object> params) { | ||
| 295 | + Map<String, Object> result = new HashMap<>(); | ||
| 296 | + try { | ||
| 297 | + Object lineId = params.get("line"), direction = params.get("direction"), begin = params.get("rqBegin"), end = params.get("rqEnd"); | ||
| 298 | + if (lineId == null || direction == null || begin == null || end == null) { | ||
| 299 | + throw new RuntimeException("参数异常"); | ||
| 300 | + } | ||
| 301 | + DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyyMMddHH"); | ||
| 302 | + List<LsStationRoute> list = lsStationRouteService.findByLineDirectionDate(Integer.valueOf(lineId.toString()), Integer.valueOf(direction.toString()), formatter.parseDateTime(begin.toString()).toDate(), formatter.parseDateTime(end.toString()).toDate()); | ||
| 303 | + result.put("data", list); | ||
| 304 | + result.put("status", ResponseCode.SUCCESS); | ||
| 305 | + } catch (Exception e) { | ||
| 306 | + result.put("status", ResponseCode.ERROR); | ||
| 307 | + result.put("msg", e.getMessage()); | ||
| 308 | + log.error("", e); | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + return result; | ||
| 312 | + } | ||
| 289 | } | 313 | } |
src/main/java/com/bsth/controller/report/PassengerStatisticController.java
0 → 100644
| 1 | +package com.bsth.controller.report; | ||
| 2 | + | ||
| 3 | +import com.bsth.controller.BaseController; | ||
| 4 | +import com.bsth.entity.report.PassengerStatistic; | ||
| 5 | +import com.bsth.service.report.PassengerStatisticService; | ||
| 6 | +import com.bsth.service.report.ReportService; | ||
| 7 | +import com.bsth.util.ReportUtils; | ||
| 8 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 13 | +import org.springframework.web.bind.annotation.RestController; | ||
| 14 | + | ||
| 15 | +import java.text.SimpleDateFormat; | ||
| 16 | +import java.util.*; | ||
| 17 | + | ||
| 18 | +@RestController | ||
| 19 | +@RequestMapping("/api/passenger-statistic") | ||
| 20 | +public class PassengerStatisticController extends BaseController<PassengerStatistic, Integer> { | ||
| 21 | + | ||
| 22 | + @Autowired | ||
| 23 | + private PassengerStatisticService passengerStatisticService; | ||
| 24 | + | ||
| 25 | + private ObjectMapper mapper = new ObjectMapper(); | ||
| 26 | + | ||
| 27 | + @RequestMapping(value = "/groupByStation",method = RequestMethod.GET) | ||
| 28 | + public List<PassengerStatistic> groupByStation(PassengerStatistic passengerStatistic) { | ||
| 29 | + return passengerStatisticService.groupByStation(passengerStatistic); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + @RequestMapping(value = "/groupByStation/export",method = RequestMethod.GET) | ||
| 33 | + public Map<String, Object> groupByStationExport(PassengerStatistic passengerStatistic) { | ||
| 34 | + List<Iterator<?>> iterators = new ArrayList<>(); | ||
| 35 | + ReportUtils reportUtils = new ReportUtils(); | ||
| 36 | + List<PassengerStatistic> list = passengerStatisticService.groupByStation(passengerStatistic); | ||
| 37 | + List<Map<String, Object>> maps = new ArrayList<>(); | ||
| 38 | + int count = 1; | ||
| 39 | + for (PassengerStatistic ps : list) { | ||
| 40 | + Map<String, Object> map = mapper.convertValue(ps, Map.class); | ||
| 41 | + map.put("i", count++); | ||
| 42 | + maps.add(map); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + try { | ||
| 46 | + iterators.add(maps.iterator()); | ||
| 47 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms"; | ||
| 48 | + reportUtils.excelReplace(iterators, new Object[] { new HashMap<>() }, String.format("%s/mould/passenger-statistic-station.xls", path), | ||
| 49 | + String.format("%s/export/%s至%s-客流统计(站点).xls", path, passengerStatistic.getRqBegin(), passengerStatistic.getRqEnd())); | ||
| 50 | + } catch (Exception e) { | ||
| 51 | + e.printStackTrace(); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + return new HashMap<>(); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @RequestMapping(value = "/groupByVehicle",method = RequestMethod.GET) | ||
| 58 | + public List<PassengerStatistic> groupByVehicle(PassengerStatistic passengerStatistic) { | ||
| 59 | + return passengerStatisticService.groupByVehicle(passengerStatistic); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @RequestMapping(value = "/groupByVehicle/export",method = RequestMethod.GET) | ||
| 63 | + public Map<String, Object> groupByVehicleExport(PassengerStatistic passengerStatistic) { | ||
| 64 | + List<Iterator<?>> iterators = new ArrayList<>(); | ||
| 65 | + ReportUtils reportUtils = new ReportUtils(); | ||
| 66 | + List<PassengerStatistic> list = passengerStatisticService.groupByVehicle(passengerStatistic); | ||
| 67 | + List<Map<String, Object>> maps = new ArrayList<>(); | ||
| 68 | + int count = 1; | ||
| 69 | + for (PassengerStatistic ps : list) { | ||
| 70 | + Map<String, Object> map = mapper.convertValue(ps, Map.class); | ||
| 71 | + map.put("i", count++); | ||
| 72 | + maps.add(map); | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + try { | ||
| 76 | + iterators.add(maps.iterator()); | ||
| 77 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms"; | ||
| 78 | + reportUtils.excelReplace(iterators, new Object[] { new HashMap<>() }, String.format("%s/mould/passenger-statistic-vehicle.xls", path), | ||
| 79 | + String.format("%s/export/%s至%s-客流统计(车辆).xls", path, passengerStatistic.getRqBegin(), passengerStatistic.getRqEnd())); | ||
| 80 | + } catch (Exception e) { | ||
| 81 | + e.printStackTrace(); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + return new HashMap<>(); | ||
| 85 | + } | ||
| 86 | +} |
src/main/java/com/bsth/data/BasicData.java
| @@ -88,7 +88,7 @@ public class BasicData { | @@ -88,7 +88,7 @@ public class BasicData { | ||
| 88 | public static Map<Integer, String> lineId2ShangHaiCodeMap; | 88 | public static Map<Integer, String> lineId2ShangHaiCodeMap; |
| 89 | 89 | ||
| 90 | //线路Code和shangHaiLinecode 对照 | 90 | //线路Code和shangHaiLinecode 对照 |
| 91 | - public static Map<String, String> lineCode2ShangHaiCodeMap; | 91 | + public static BiMap<String, String> lineCode2ShangHaiCodeMap; |
| 92 | 92 | ||
| 93 | /*//驾驶员工号 和 personnel 对象映射 | 93 | /*//驾驶员工号 和 personnel 对象映射 |
| 94 | public static Map<String, Personnel> jsyMap; | 94 | public static Map<String, Personnel> jsyMap; |
| @@ -340,7 +340,7 @@ public class BasicData { | @@ -340,7 +340,7 @@ public class BasicData { | ||
| 340 | Map<String, String> code2name = new HashMap<>(); | 340 | Map<String, String> code2name = new HashMap<>(); |
| 341 | Map<String, String> name2code = new HashMap<>(); | 341 | Map<String, String> name2code = new HashMap<>(); |
| 342 | Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); | 342 | Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); |
| 343 | - Map<String, String> code2SHcode = new HashMap<String, String>(); | 343 | + BiMap<String, String> code2SHcode = HashBiMap.create(); |
| 344 | Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); | 344 | Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); |
| 345 | 345 | ||
| 346 | /** | 346 | /** |
src/main/java/com/bsth/data/gpsdata_v2/GpsRealData.java
| @@ -3,6 +3,7 @@ package com.bsth.data.gpsdata_v2; | @@ -3,6 +3,7 @@ package com.bsth.data.gpsdata_v2; | ||
| 3 | import com.bsth.data.BasicData; | 3 | import com.bsth.data.BasicData; |
| 4 | import com.bsth.data.forecast.ForecastRealServer; | 4 | import com.bsth.data.forecast.ForecastRealServer; |
| 5 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; | 5 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; |
| 6 | +import com.bsth.data.passenger_flow.PassengerFlowCenter; | ||
| 6 | import com.bsth.data.schedule.DayOfSchedule; | 7 | import com.bsth.data.schedule.DayOfSchedule; |
| 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 8 | import com.bsth.message.buffer.CarEnergyBuffer; | 9 | import com.bsth.message.buffer.CarEnergyBuffer; |
| @@ -40,6 +41,9 @@ public class GpsRealData { | @@ -40,6 +41,9 @@ public class GpsRealData { | ||
| 40 | @Autowired | 41 | @Autowired |
| 41 | ForecastRealServer forecastRealServer; | 42 | ForecastRealServer forecastRealServer; |
| 42 | 43 | ||
| 44 | + @Autowired | ||
| 45 | + private PassengerFlowCenter passengerFlowCenter; | ||
| 46 | + | ||
| 43 | /** | 47 | /** |
| 44 | * 构造函数 | 48 | * 构造函数 |
| 45 | */ | 49 | */ |
| @@ -90,6 +94,8 @@ public class GpsRealData { | @@ -90,6 +94,8 @@ public class GpsRealData { | ||
| 90 | 94 | ||
| 91 | // 设置车辆的电量 | 95 | // 设置车辆的电量 |
| 92 | //gps.setEnergy(CarEnergyBuffer.getCarEnergy(gps.getNbbm())); | 96 | //gps.setEnergy(CarEnergyBuffer.getCarEnergy(gps.getNbbm())); |
| 97 | + // 设置车辆乘客数 | ||
| 98 | + gps.setPassengerNum(passengerFlowCenter.getNumByVehicle(nbbm)); | ||
| 93 | } catch (Exception e) { | 99 | } catch (Exception e) { |
| 94 | logger.error("", e); | 100 | logger.error("", e); |
| 95 | } | 101 | } |
src/main/java/com/bsth/data/gpsdata_v2/entity/GpsEntity.java
| @@ -128,6 +128,11 @@ public class GpsEntity implements Cloneable{ | @@ -128,6 +128,11 @@ public class GpsEntity implements Cloneable{ | ||
| 128 | */ | 128 | */ |
| 129 | private String sim; | 129 | private String sim; |
| 130 | 130 | ||
| 131 | + /** | ||
| 132 | + * 当前乘客数 | ||
| 133 | + */ | ||
| 134 | + private int passengerNum; | ||
| 135 | + | ||
| 131 | public Object clone() { | 136 | public Object clone() { |
| 132 | try { | 137 | try { |
| 133 | return super.clone(); | 138 | return super.clone(); |
| @@ -444,4 +449,12 @@ public class GpsEntity implements Cloneable{ | @@ -444,4 +449,12 @@ public class GpsEntity implements Cloneable{ | ||
| 444 | public void setSim(String sim) { | 449 | public void setSim(String sim) { |
| 445 | this.sim = sim; | 450 | this.sim = sim; |
| 446 | } | 451 | } |
| 452 | + | ||
| 453 | + public int getPassengerNum() { | ||
| 454 | + return passengerNum; | ||
| 455 | + } | ||
| 456 | + | ||
| 457 | + public void setPassengerNum(int passengerNum) { | ||
| 458 | + this.passengerNum = passengerNum; | ||
| 459 | + } | ||
| 447 | } | 460 | } |
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
| @@ -10,6 +10,7 @@ import com.bsth.data.gpsdata_v2.rfid.handle.RfidDataHandler; | @@ -10,6 +10,7 @@ import com.bsth.data.gpsdata_v2.rfid.handle.RfidDataHandler; | ||
| 10 | import com.bsth.data.gpsdata_v2.status_manager.GpsStatusManager; | 10 | import com.bsth.data.gpsdata_v2.status_manager.GpsStatusManager; |
| 11 | import com.bsth.data.gpsdata_v2.utils.GeoUtils; | 11 | import com.bsth.data.gpsdata_v2.utils.GeoUtils; |
| 12 | import com.bsth.data.msg_queue.DirectivePushQueue; | 12 | import com.bsth.data.msg_queue.DirectivePushQueue; |
| 13 | +import com.bsth.data.passenger_flow.PassengerFlowCenter; | ||
| 13 | import com.bsth.data.schedule.DayOfSchedule; | 14 | import com.bsth.data.schedule.DayOfSchedule; |
| 14 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; | 15 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; |
| 15 | import com.bsth.entity.realcontrol.LineConfig; | 16 | import com.bsth.entity.realcontrol.LineConfig; |
| @@ -42,6 +43,9 @@ public class InStationProcess { | @@ -42,6 +43,9 @@ public class InStationProcess { | ||
| 42 | @Autowired | 43 | @Autowired |
| 43 | GpsStatusManager gpsStatusManager; | 44 | GpsStatusManager gpsStatusManager; |
| 44 | 45 | ||
| 46 | + @Autowired | ||
| 47 | + private PassengerFlowCenter passengerFlowCenter; | ||
| 48 | + | ||
| 45 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 49 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 46 | 50 | ||
| 47 | public void process(GpsEntity gps) { | 51 | public void process(GpsEntity gps) { |
| @@ -105,13 +109,16 @@ public class InStationProcess { | @@ -105,13 +109,16 @@ public class InStationProcess { | ||
| 105 | if (flow && null != sch && | 109 | if (flow && null != sch && |
| 106 | ((sch.getZdzCode().equals(gps.getStopNo()) && gps.getInstation() > 0) || sch.getZdzCode().equals(gps.getCarparkNo()))) { | 110 | ((sch.getZdzCode().equals(gps.getStopNo()) && gps.getInstation() > 0) || sch.getZdzCode().equals(gps.getCarparkNo()))) { |
| 107 | inEndStation(sch, gps); | 111 | inEndStation(sch, gps); |
| 108 | - isEnd = true; | 112 | + if (sch.getZdsjActualTime() != null) { |
| 113 | + isEnd = true; | ||
| 114 | + } | ||
| 109 | } | 115 | } |
| 110 | 116 | ||
| 111 | - //进起点 rfid状态复位 | 117 | + //进起点 rfid状态复位 乘客数复位 |
| 112 | if (!isEnd && null != sch && | 118 | if (!isEnd && null != sch && |
| 113 | ((sch.getQdzCode().equals(gps.getStopNo()) && gps.getInstation() > 0) || sch.getQdzCode().equals(gps.getCarparkNo()))) { | 119 | ((sch.getQdzCode().equals(gps.getStopNo()) && gps.getInstation() > 0) || sch.getQdzCode().equals(gps.getCarparkNo()))) { |
| 114 | resetRfid(sch); | 120 | resetRfid(sch); |
| 121 | + passengerFlowCenter.clearByVehicle(gps.getNbbm()); | ||
| 115 | } | 122 | } |
| 116 | 123 | ||
| 117 | GpsCacheData.in(gps, isEnd); | 124 | GpsCacheData.in(gps, isEnd); |
src/main/java/com/bsth/data/passenger_flow/PassengerFlowCenter.java
0 → 100644
| 1 | +package com.bsth.data.passenger_flow; | ||
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | +import com.bsth.data.alarm.AlarmCenter; | ||
| 5 | +import com.bsth.data.gpsdata_v2.cache.GeoCacheData; | ||
| 6 | +import com.bsth.data.gpsdata_v2.entity.StationRoute; | ||
| 7 | +import com.bsth.message.entity.PassengerFlow; | ||
| 8 | +import com.bsth.repository.realcontrol.PassengerFlowRepository; | ||
| 9 | +import com.google.common.collect.BiMap; | ||
| 10 | +import org.slf4j.Logger; | ||
| 11 | +import org.slf4j.LoggerFactory; | ||
| 12 | +import org.springframework.beans.factory.InitializingBean; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.stereotype.Component; | ||
| 15 | + | ||
| 16 | +import java.util.ArrayList; | ||
| 17 | +import java.util.List; | ||
| 18 | +import java.util.Map; | ||
| 19 | +import java.util.concurrent.ConcurrentHashMap; | ||
| 20 | + | ||
| 21 | +@Component | ||
| 22 | +public class PassengerFlowCenter implements InitializingBean { | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 车辆当前乘客数 | ||
| 26 | + */ | ||
| 27 | + private Map<String, Integer> vehicle2num = new ConcurrentHashMap<>(); | ||
| 28 | + | ||
| 29 | + private static Logger log = LoggerFactory.getLogger(AlarmCenter.class); | ||
| 30 | + | ||
| 31 | + private volatile boolean initialized = false; | ||
| 32 | + | ||
| 33 | + private List<PassengerFlow> cache = new ArrayList<>(); | ||
| 34 | + | ||
| 35 | + @Autowired | ||
| 36 | + private PassengerFlowRepository passengerFlowRepository; | ||
| 37 | + | ||
| 38 | + public void put(List<PassengerFlow> passengerFlows) { | ||
| 39 | + if (!initialized) { | ||
| 40 | + cache.addAll(passengerFlows); | ||
| 41 | + } | ||
| 42 | + if (cache.size() > 0) { | ||
| 43 | + calc(cache); | ||
| 44 | + cache.clear(); | ||
| 45 | + } | ||
| 46 | + calc(passengerFlows); | ||
| 47 | + try { | ||
| 48 | + BiMap<String, String> shangHaiCode2LineCode = BasicData.lineCode2ShangHaiCodeMap.inverse(); | ||
| 49 | + for (PassengerFlow passengerFlow : passengerFlows) { | ||
| 50 | + String line = shangHaiCode2LineCode.get(passengerFlow.getLine()); | ||
| 51 | + if (line == null) { | ||
| 52 | + log.warn("没有匹配的线路,line= {}", passengerFlow.getLine()); | ||
| 53 | + continue; | ||
| 54 | + } | ||
| 55 | + passengerFlow.setLine(line); | ||
| 56 | + StationRoute stationRoute = GeoCacheData.getStationRoute(passengerFlow.getLine(), passengerFlow.getDirection()).get(passengerFlow.getStationSeq() - 1); | ||
| 57 | + passengerFlow.setLineName(BasicData.lineCode2NameMap.get(passengerFlow.getLine())); | ||
| 58 | + passengerFlow.setStationCode(stationRoute.getCode()); | ||
| 59 | + passengerFlow.setStationName(stationRoute.getName()); | ||
| 60 | + passengerFlow.setStationRouteCode(stationRoute.getRouteSort()); | ||
| 61 | + } | ||
| 62 | + passengerFlowRepository.saveAll(passengerFlows); | ||
| 63 | + } catch (Exception e) { | ||
| 64 | + log.error("保存客流信息失败,data={}", passengerFlows, e); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + private void calc(List<PassengerFlow> passengerFlows) { | ||
| 69 | + for (PassengerFlow passengerFlow : passengerFlows) { | ||
| 70 | + Integer num = vehicle2num.get(passengerFlow.getInsideCode()); | ||
| 71 | + if (num == null) { | ||
| 72 | + num = 0; | ||
| 73 | + } | ||
| 74 | + num = num + passengerFlow.getUpNum() - passengerFlow.getDownNum(); | ||
| 75 | + num = num < 0 ? 0 : num; | ||
| 76 | + vehicle2num.put(passengerFlow.getInsideCode(), num); | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public Integer getNumByVehicle(String vehicle) { | ||
| 81 | + Integer num = vehicle2num.get(vehicle); | ||
| 82 | + | ||
| 83 | + return num == null ? 0 : num; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + public void clearByVehicle(String vehicle) { | ||
| 87 | + vehicle2num.remove(vehicle); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + public void clear(){ | ||
| 91 | + vehicle2num.clear(); | ||
| 92 | + log.info("清除车辆乘客数据..."); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + @Override | ||
| 96 | + public void afterPropertiesSet() throws Exception { | ||
| 97 | + // 暂不做故障恢复 | ||
| 98 | + initialized = true; | ||
| 99 | + } | ||
| 100 | +} |
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java
| @@ -5,6 +5,7 @@ import com.bsth.data.directive.DayOfDirectives; | @@ -5,6 +5,7 @@ import com.bsth.data.directive.DayOfDirectives; | ||
| 5 | import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess; | 5 | import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess; |
| 6 | import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread; | 6 | import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread; |
| 7 | import com.bsth.data.maintenance_plan.MtPlanCenter; | 7 | import com.bsth.data.maintenance_plan.MtPlanCenter; |
| 8 | +import com.bsth.data.passenger_flow.PassengerFlowCenter; | ||
| 8 | import com.bsth.service.calc.CalcWaybillService; | 9 | import com.bsth.service.calc.CalcWaybillService; |
| 9 | import com.bsth.service.forms.BudgetService; | 10 | import com.bsth.service.forms.BudgetService; |
| 10 | import com.bsth.service.oil.DlbService; | 11 | import com.bsth.service.oil.DlbService; |
| @@ -42,6 +43,9 @@ public class CalcOilThread extends Thread{ | @@ -42,6 +43,9 @@ public class CalcOilThread extends Thread{ | ||
| 42 | @Autowired | 43 | @Autowired |
| 43 | BudgetService budgetService; | 44 | BudgetService budgetService; |
| 44 | 45 | ||
| 46 | + @Autowired | ||
| 47 | + private PassengerFlowCenter passengerFlowCenter; | ||
| 48 | + | ||
| 45 | @Override | 49 | @Override |
| 46 | public void run() { | 50 | public void run() { |
| 47 | logger.info("开始计算油量平衡表...."); | 51 | logger.info("开始计算油量平衡表...."); |
| @@ -87,6 +91,8 @@ public class CalcOilThread extends Thread{ | @@ -87,6 +91,8 @@ public class CalcOilThread extends Thread{ | ||
| 87 | SafeDrivCenter.clear(); | 91 | SafeDrivCenter.clear(); |
| 88 | //清除报警数据 | 92 | //清除报警数据 |
| 89 | AlarmCenter.clear(); | 93 | AlarmCenter.clear(); |
| 94 | + //清除客流数据 | ||
| 95 | + passengerFlowCenter.clear(); | ||
| 90 | //清除保养计划数据 | 96 | //清除保养计划数据 |
| 91 | MtPlanCenter.clear(); | 97 | MtPlanCenter.clear(); |
| 92 | //清除超速缓存数据 | 98 | //清除超速缓存数据 |
src/main/java/com/bsth/entity/report/PassengerStatistic.java
0 → 100644
| 1 | +package com.bsth.entity.report; | ||
| 2 | + | ||
| 3 | +import javax.persistence.*; | ||
| 4 | +import java.util.Date; | ||
| 5 | + | ||
| 6 | +@Entity | ||
| 7 | +@Table(name = "bsth_c_passenger_statistic") | ||
| 8 | +public class PassengerStatistic { | ||
| 9 | + | ||
| 10 | + @Id | ||
| 11 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 12 | + private Integer id; | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 日期 yyyyMMdd | ||
| 16 | + */ | ||
| 17 | + private String rq; | ||
| 18 | + | ||
| 19 | + @Transient | ||
| 20 | + private String rqBegin; | ||
| 21 | + | ||
| 22 | + @Transient | ||
| 23 | + private String rqEnd; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 线路代码 | ||
| 27 | + */ | ||
| 28 | + private String line; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 线路名称 | ||
| 32 | + */ | ||
| 33 | + private String lineName; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 车辆内部编码 | ||
| 37 | + */ | ||
| 38 | + private String insideCode; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 上下行 | ||
| 42 | + */ | ||
| 43 | + private int direction; | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 站名 | ||
| 47 | + */ | ||
| 48 | + private String stationName; | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 站点编码 | ||
| 52 | + */ | ||
| 53 | + private String stationCode; | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 站序 | ||
| 57 | + */ | ||
| 58 | + private String stationRouteCode; | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 上车人数 | ||
| 62 | + */ | ||
| 63 | + private int upNum; | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 下车人数 | ||
| 67 | + */ | ||
| 68 | + private int downNum; | ||
| 69 | + | ||
| 70 | + @Transient | ||
| 71 | + private int statistic; | ||
| 72 | + | ||
| 73 | + public Integer getId() { | ||
| 74 | + return id; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public void setId(Integer id) { | ||
| 78 | + this.id = id; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + public String getRq() { | ||
| 82 | + return rq; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + public void setRq(String rq) { | ||
| 86 | + this.rq = rq; | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + public String getRqBegin() { | ||
| 90 | + return rqBegin; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public void setRqBegin(String rqBegin) { | ||
| 94 | + this.rqBegin = rqBegin; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public String getRqEnd() { | ||
| 98 | + return rqEnd; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + public void setRqEnd(String rqEnd) { | ||
| 102 | + this.rqEnd = rqEnd; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public String getLine() { | ||
| 106 | + return line; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + public void setLine(String line) { | ||
| 110 | + this.line = line; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public String getLineName() { | ||
| 114 | + return lineName; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + public void setLineName(String lineName) { | ||
| 118 | + this.lineName = lineName; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + public String getInsideCode() { | ||
| 122 | + return insideCode; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + public void setInsideCode(String insideCode) { | ||
| 126 | + this.insideCode = insideCode; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + public int getDirection() { | ||
| 130 | + return direction; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + public void setDirection(int direction) { | ||
| 134 | + this.direction = direction; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + public String getDirectionStr() { | ||
| 138 | + return direction == 0 ? "上行" : "下行"; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + public String getStationName() { | ||
| 142 | + return stationName; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + public void setStationName(String stationName) { | ||
| 146 | + this.stationName = stationName; | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + public String getStationCode() { | ||
| 150 | + return stationCode; | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + public void setStationCode(String stationCode) { | ||
| 154 | + this.stationCode = stationCode; | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + public String getStationRouteCode() { | ||
| 158 | + return stationRouteCode; | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + public void setStationRouteCode(String stationRouteCode) { | ||
| 162 | + this.stationRouteCode = stationRouteCode; | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + public int getUpNum() { | ||
| 166 | + return upNum; | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + public void setUpNum(int upNum) { | ||
| 170 | + this.upNum = upNum; | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + public int getDownNum() { | ||
| 174 | + return downNum; | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + public void setDownNum(int downNum) { | ||
| 178 | + this.downNum = downNum; | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + public int getStatistic() { | ||
| 182 | + return statistic; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + public void setStatistic(int statistic) { | ||
| 186 | + this.statistic = statistic; | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + @Override | ||
| 190 | + public String toString() { | ||
| 191 | + return "PassengerStatistic{" + | ||
| 192 | + "id=" + id + | ||
| 193 | + ", rq='" + rq + '\'' + | ||
| 194 | + ", rqBegin='" + rqBegin + '\'' + | ||
| 195 | + ", rqEnd='" + rqEnd + '\'' + | ||
| 196 | + ", line='" + line + '\'' + | ||
| 197 | + ", lineName='" + lineName + '\'' + | ||
| 198 | + ", insideCode='" + insideCode + '\'' + | ||
| 199 | + ", direction=" + direction + | ||
| 200 | + ", stationName='" + stationName + '\'' + | ||
| 201 | + ", stationCode='" + stationCode + '\'' + | ||
| 202 | + ", stationRouteCode='" + stationRouteCode + '\'' + | ||
| 203 | + ", upNum=" + upNum + | ||
| 204 | + ", downNum=" + downNum + | ||
| 205 | + ", statistic=" + statistic + | ||
| 206 | + '}'; | ||
| 207 | + } | ||
| 208 | +} |
src/main/java/com/bsth/message/entity/PassengerFlow.java
0 → 100644
| 1 | +package com.bsth.message.entity; | ||
| 2 | + | ||
| 3 | +import javax.persistence.*; | ||
| 4 | +import java.util.Date; | ||
| 5 | + | ||
| 6 | +@Entity | ||
| 7 | +@Table(name = "bsth_c_passenger_flow") | ||
| 8 | +public class PassengerFlow { | ||
| 9 | + | ||
| 10 | + @Id | ||
| 11 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 12 | + private Long id; | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 线路 | ||
| 16 | + */ | ||
| 17 | + private String line; | ||
| 18 | + | ||
| 19 | + private String lineName; | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 上下行 | ||
| 23 | + */ | ||
| 24 | + private int direction; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 车辆编码 | ||
| 28 | + */ | ||
| 29 | + private String insideCode; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 日期(yyyyMMddHH) | ||
| 33 | + */ | ||
| 34 | + private String rq; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 站点序号 | ||
| 38 | + */ | ||
| 39 | + @Transient | ||
| 40 | + private int stationSeq; | ||
| 41 | + | ||
| 42 | + private String stationCode; | ||
| 43 | + | ||
| 44 | + private String stationName; | ||
| 45 | + | ||
| 46 | + private int stationRouteCode; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 车门编码 | ||
| 50 | + */ | ||
| 51 | + private int doorCode; | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * 上客人数 | ||
| 55 | + */ | ||
| 56 | + private int upNum; | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 下客人数 | ||
| 60 | + */ | ||
| 61 | + private int downNum; | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * 数据产生时间 | ||
| 65 | + */ | ||
| 66 | + private Date createDate; | ||
| 67 | + | ||
| 68 | + public Long getId() { | ||
| 69 | + return id; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public void setId(Long id) { | ||
| 73 | + this.id = id; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public String getLine() { | ||
| 77 | + return line; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public void setLine(String line) { | ||
| 81 | + this.line = line; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public String getLineName() { | ||
| 85 | + return lineName; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public void setLineName(String lineName) { | ||
| 89 | + this.lineName = lineName; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public int getDirection() { | ||
| 93 | + return direction; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public void setDirection(int direction) { | ||
| 97 | + this.direction = direction; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + public String getInsideCode() { | ||
| 101 | + return insideCode; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public void setInsideCode(String insideCode) { | ||
| 105 | + this.insideCode = insideCode; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + public String getRq() { | ||
| 109 | + return rq; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + public void setRq(String rq) { | ||
| 113 | + this.rq = rq; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + public int getStationSeq() { | ||
| 117 | + return stationSeq; | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + public void setStationSeq(int stationSeq) { | ||
| 121 | + this.stationSeq = stationSeq; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + public String getStationCode() { | ||
| 125 | + return stationCode; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + public void setStationCode(String stationCode) { | ||
| 129 | + this.stationCode = stationCode; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + public String getStationName() { | ||
| 133 | + return stationName; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + public void setStationName(String stationName) { | ||
| 137 | + this.stationName = stationName; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + public int getStationRouteCode() { | ||
| 141 | + return stationRouteCode; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + public void setStationRouteCode(int stationRouteCode) { | ||
| 145 | + this.stationRouteCode = stationRouteCode; | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + public int getDoorCode() { | ||
| 149 | + return doorCode; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + public void setDoorCode(int doorCode) { | ||
| 153 | + this.doorCode = doorCode; | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + public int getUpNum() { | ||
| 157 | + return upNum; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + public void setUpNum(int upNum) { | ||
| 161 | + this.upNum = upNum; | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + public int getDownNum() { | ||
| 165 | + return downNum; | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + public void setDownNum(int downNum) { | ||
| 169 | + this.downNum = downNum; | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + public Date getCreateDate() { | ||
| 173 | + return createDate; | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + public void setCreateDate(Date createDate) { | ||
| 177 | + this.createDate = createDate; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + @Override | ||
| 181 | + public String toString() { | ||
| 182 | + return "PassengerFlow{" + | ||
| 183 | + "id=" + id + | ||
| 184 | + ", line='" + line + '\'' + | ||
| 185 | + ", lineName='" + lineName + '\'' + | ||
| 186 | + ", direction=" + direction + | ||
| 187 | + ", insideCode='" + insideCode + '\'' + | ||
| 188 | + ", rq='" + rq + '\'' + | ||
| 189 | + ", stationSeq=" + stationSeq + | ||
| 190 | + ", stationCode='" + stationCode + '\'' + | ||
| 191 | + ", stationName='" + stationName + '\'' + | ||
| 192 | + ", stationRouteCode='" + stationRouteCode + '\'' + | ||
| 193 | + ", doorCode=" + doorCode + | ||
| 194 | + ", upNum=" + upNum + | ||
| 195 | + ", downNum=" + downNum + | ||
| 196 | + ", createDate=" + createDate + | ||
| 197 | + '}'; | ||
| 198 | + } | ||
| 199 | +} |
src/main/java/com/bsth/message/handler/RabbitMessageHandler.java
| @@ -4,6 +4,7 @@ import com.bsth.config.RabbitConfig; | @@ -4,6 +4,7 @@ import com.bsth.config.RabbitConfig; | ||
| 4 | import com.bsth.data.alarm.AlarmCenter; | 4 | import com.bsth.data.alarm.AlarmCenter; |
| 5 | import com.bsth.data.gpsdata_v2.GpsRealData; | 5 | import com.bsth.data.gpsdata_v2.GpsRealData; |
| 6 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; | 6 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; |
| 7 | +import com.bsth.data.passenger_flow.PassengerFlowCenter; | ||
| 7 | import com.bsth.message.entity.*; | 8 | import com.bsth.message.entity.*; |
| 8 | import com.fasterxml.jackson.databind.ObjectMapper; | 9 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 9 | import org.slf4j.Logger; | 10 | import org.slf4j.Logger; |
| @@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | @@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
| 15 | import org.springframework.stereotype.Component; | 16 | import org.springframework.stereotype.Component; |
| 16 | 17 | ||
| 17 | import java.util.HashMap; | 18 | import java.util.HashMap; |
| 19 | +import java.util.List; | ||
| 18 | import java.util.Map; | 20 | import java.util.Map; |
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| @@ -32,6 +34,9 @@ public class RabbitMessageHandler { | @@ -32,6 +34,9 @@ public class RabbitMessageHandler { | ||
| 32 | @Autowired | 34 | @Autowired |
| 33 | GpsRealData gpsRealData; | 35 | GpsRealData gpsRealData; |
| 34 | 36 | ||
| 37 | + @Autowired | ||
| 38 | + private PassengerFlowCenter passengerFlowCenter; | ||
| 39 | + | ||
| 35 | @RabbitHandler | 40 | @RabbitHandler |
| 36 | @RabbitListener(queues = RabbitConfig.QUEUE_ALARM_SCHEDULE) | 41 | @RabbitListener(queues = RabbitConfig.QUEUE_ALARM_SCHEDULE) |
| 37 | public void onAlarmScheduleMessage(String message) { | 42 | public void onAlarmScheduleMessage(String message) { |
| @@ -64,4 +69,15 @@ public class RabbitMessageHandler { | @@ -64,4 +69,15 @@ public class RabbitMessageHandler { | ||
| 64 | log.error("报警监听异常,message: {}", message, e); | 69 | log.error("报警监听异常,message: {}", message, e); |
| 65 | } | 70 | } |
| 66 | } | 71 | } |
| 72 | + | ||
| 73 | + @RabbitHandler | ||
| 74 | + @RabbitListener(queues = RabbitConfig.QUEUE_PASSENGER_FLOW_SCHEDULE) | ||
| 75 | + public void onPassengerFlowScheduleMessage(String message) { | ||
| 76 | + try { | ||
| 77 | + List<PassengerFlow> passengerFlows = mapper.readValue(message, mapper.getTypeFactory().constructParametricType(List.class, PassengerFlow.class)); | ||
| 78 | + passengerFlowCenter.put(passengerFlows); | ||
| 79 | + } catch (Exception e) { | ||
| 80 | + log.error("客流监听异常,message: {}", message, e); | ||
| 81 | + } | ||
| 82 | + } | ||
| 67 | } | 83 | } |
src/main/java/com/bsth/repository/LsStationRouteRepository.java
| 1 | package com.bsth.repository; | 1 | package com.bsth.repository; |
| 2 | 2 | ||
| 3 | +import java.util.Date; | ||
| 3 | import java.util.List; | 4 | import java.util.List; |
| 4 | import java.util.Map; | 5 | import java.util.Map; |
| 5 | 6 | ||
| @@ -172,4 +173,15 @@ public interface LsStationRouteRepository extends BaseRepository<LsStationRoute, | @@ -172,4 +173,15 @@ public interface LsStationRouteRepository extends BaseRepository<LsStationRoute, | ||
| 172 | */ | 173 | */ |
| 173 | @Query("select r from LsStationRoute r where r.line.id=?1 and r.versions=?2 and r.directions=?3 and r.destroy=0 order by r.stationRouteCode") | 174 | @Query("select r from LsStationRoute r where r.line.id=?1 and r.versions=?2 and r.directions=?3 and r.destroy=0 order by r.stationRouteCode") |
| 174 | List<LsStationRoute> findByLineVersion(Integer lineId, Integer version, Integer direction, Integer stationRouteCode); | 175 | List<LsStationRoute> findByLineVersion(Integer lineId, Integer version, Integer direction, Integer stationRouteCode); |
| 176 | + | ||
| 177 | + /** | ||
| 178 | + * | ||
| 179 | + * @param lineId | ||
| 180 | + * @param direction | ||
| 181 | + * @param begin | ||
| 182 | + * @param end | ||
| 183 | + * @return | ||
| 184 | + */ | ||
| 185 | + @Query(value = "SELECT * FROM bsth_c_ls_stationroute WHERE line = :#{#lineId} AND directions = :#{#direction} AND versions IN (SELECT versions FROM bsth_c_line_versions WHERE line = :#{#lineId} AND (:#{#begin} BETWEEN start_date AND end_date OR :#{#end} BETWEEN start_date AND end_date)) ORDER BY versions,station_route_code", nativeQuery = true) | ||
| 186 | + List<LsStationRoute> findByLineDirectionDate(Integer lineId, Integer direction, Date begin, Date end); | ||
| 175 | } | 187 | } |
src/main/java/com/bsth/repository/realcontrol/PassengerFlowRepository.java
0 → 100644
| 1 | +package com.bsth.repository.realcontrol; | ||
| 2 | + | ||
| 3 | +import com.bsth.message.entity.PassengerFlow; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.stereotype.Repository; | ||
| 6 | + | ||
| 7 | +@Repository | ||
| 8 | +public interface PassengerFlowRepository extends BaseRepository<PassengerFlow, Long> { | ||
| 9 | +} |
src/main/java/com/bsth/repository/report/PassengerStatisticRepository.java
0 → 100644
| 1 | +package com.bsth.repository.report; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.report.PassengerStatistic; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.data.jpa.repository.Query; | ||
| 6 | +import org.springframework.stereotype.Repository; | ||
| 7 | + | ||
| 8 | +import java.util.Date; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +@Repository | ||
| 12 | +public interface PassengerStatisticRepository extends BaseRepository<PassengerStatistic, Integer> { | ||
| 13 | + | ||
| 14 | + @Query(value = "SELECT line_name,direction,station_name,sum(up_num) up_num,sum(down_num) down_num FROM bsth_c_passenger_statistic WHERE rq BETWEEN :#{#statistic.rqBegin} AND :#{#statistic.rqEnd} AND line = :#{#statistic.line} AND direction = :#{#statistic.direction} AND CASE WHEN ISNULL(:#{#statistic.stationCode}) THEN 1 = 1 ELSE station_code = :#{#statistic.stationCode} END GROUP BY line_name,direction,station_name,station_route_code ORDER BY line_name,direction,station_name,station_route_code", nativeQuery = true) | ||
| 15 | + List<Object[]> groupByStation(PassengerStatistic statistic); | ||
| 16 | + | ||
| 17 | + @Query(value = "SELECT line_name,inside_code,sum(up_num) up_num FROM bsth_c_passenger_statistic WHERE rq BETWEEN :#{#statistic.rqBegin} AND :#{#statistic.rqEnd} AND line = :#{#statistic.line} AND CASE WHEN ISNULL(:#{#statistic.insideCode}) THEN 1 = 1 ELSE inside_code = :#{#statistic.insideCode} END GROUP BY line_name,inside_code ORDER BY line_name,inside_code", nativeQuery = true) | ||
| 18 | + List<Object[]> groupByVehicle(PassengerStatistic statistic); | ||
| 19 | +} |
src/main/java/com/bsth/service/LsStationRouteService.java
| @@ -3,6 +3,7 @@ package com.bsth.service; | @@ -3,6 +3,7 @@ package com.bsth.service; | ||
| 3 | import com.bsth.entity.LsSectionRoute; | 3 | import com.bsth.entity.LsSectionRoute; |
| 4 | import com.bsth.entity.LsStationRoute; | 4 | import com.bsth.entity.LsStationRoute; |
| 5 | 5 | ||
| 6 | +import java.util.Date; | ||
| 6 | import java.util.List; | 7 | import java.util.List; |
| 7 | import java.util.Map; | 8 | import java.util.Map; |
| 8 | 9 | ||
| @@ -109,4 +110,14 @@ public interface LsStationRouteService extends BaseService<LsStationRoute, Integ | @@ -109,4 +110,14 @@ public interface LsStationRouteService extends BaseService<LsStationRoute, Integ | ||
| 109 | * @param direction | 110 | * @param direction |
| 110 | */ | 111 | */ |
| 111 | Map<String, Object> analyzeRoutes(Integer lineId, Integer version, Integer direction); | 112 | Map<String, Object> analyzeRoutes(Integer lineId, Integer version, Integer direction); |
| 113 | + | ||
| 114 | + /** | ||
| 115 | + * 根据线路、上下行、日期区间查询对应时间段内多版本站点路由信息 | ||
| 116 | + * @param lineId | ||
| 117 | + * @param direction | ||
| 118 | + * @param begin | ||
| 119 | + * @param end | ||
| 120 | + * @return | ||
| 121 | + */ | ||
| 122 | + List<LsStationRoute> findByLineDirectionDate(Integer lineId, Integer direction, Date begin, Date end); | ||
| 112 | } | 123 | } |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -501,7 +501,7 @@ public class GpsServiceImpl implements GpsService { | @@ -501,7 +501,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 501 | try{ | 501 | try{ |
| 502 | 502 | ||
| 503 | //JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); | 503 | //JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 504 | - dcs = jdbcTemplate.query("select cl_zbh as nbbm,new_device_no as device,old_device_no as old_device,UNIX_TIMESTAMP(qyrq) * 1000 as st from bsth_c_car_device where is_cancel=0 and cl_zbh='"+nbbm+"' order by qyrq" | 504 | + dcs = jdbcTemplate.query("select cl_zbh as nbbm,new_device_no as device,old_device_no as old_device,UNIX_TIMESTAMP(qyrq) * 1000 as st from bsth_c_car_device where cl_zbh='"+nbbm+"' order by qyrq" |
| 505 | , BeanPropertyRowMapper.newInstance(DeviceChange.class)); | 505 | , BeanPropertyRowMapper.newInstance(DeviceChange.class)); |
| 506 | 506 | ||
| 507 | 507 |
src/main/java/com/bsth/service/impl/LsStationRouteServiceImpl.java
| @@ -457,7 +457,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -457,7 +457,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 457 | 457 | ||
| 458 | @Override | 458 | @Override |
| 459 | public Map<String, Object> analyzeRoutes(Integer lineId, Integer version, Integer direction) { | 459 | public Map<String, Object> analyzeRoutes(Integer lineId, Integer version, Integer direction) { |
| 460 | - Map<String, Object> result = new HashMap<>(), params = new HashMap<>(); | 460 | + Map<String, Object> result = new HashMap<>(), params = new HashMap<>(); |
| 461 | params.put("line.id_eq", lineId); | 461 | params.put("line.id_eq", lineId); |
| 462 | params.put("versions_eq", version); | 462 | params.put("versions_eq", version); |
| 463 | params.put("directions_eq", direction); | 463 | params.put("directions_eq", direction); |
| @@ -477,7 +477,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -477,7 +477,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 477 | } | 477 | } |
| 478 | for (LsSectionRoute sectionRoute : sectionRoutes) { | 478 | for (LsSectionRoute sectionRoute : sectionRoutes) { |
| 479 | LineString lineString = sectionRoute.getSection().getGsectionVector(); | 479 | LineString lineString = sectionRoute.getSection().getGsectionVector(); |
| 480 | - for (int i = 0;i < lineString.getNumPositions() - 1;i++) { | 480 | + for (int i = 0; i < lineString.getNumPositions() - 1; i++) { |
| 481 | List<Point> points = new ArrayList<>(); | 481 | List<Point> points = new ArrayList<>(); |
| 482 | Position start = lineString.getPositionN(i), end = lineString.getPositionN(i + 1); | 482 | Position start = lineString.getPositionN(i), end = lineString.getPositionN(i + 1); |
| 483 | Point point1 = new Point(start.getCoordinate(0), start.getCoordinate(1)); | 483 | Point point1 = new Point(start.getCoordinate(0), start.getCoordinate(1)); |
| @@ -487,14 +487,14 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -487,14 +487,14 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 487 | if (size > 1) { | 487 | if (size > 1) { |
| 488 | double offsetLon = (point2.getLon() - point1.getLon()) / size; | 488 | double offsetLon = (point2.getLon() - point1.getLon()) / size; |
| 489 | double offsetLat = (point2.getLat() - point1.getLat()) / size; | 489 | double offsetLat = (point2.getLat() - point1.getLat()) / size; |
| 490 | - for (int j = 1;j < size;j++) { | 490 | + for (int j = 1; j < size; j++) { |
| 491 | Point mid = new Point(point1.getLon() + offsetLon * j, point1.getLat() + offsetLat * j); | 491 | Point mid = new Point(point1.getLon() + offsetLon * j, point1.getLat() + offsetLat * j); |
| 492 | points.add(mid); | 492 | points.add(mid); |
| 493 | } | 493 | } |
| 494 | } | 494 | } |
| 495 | points.add(point2); | 495 | points.add(point2); |
| 496 | for (Point p : points) { | 496 | for (Point p : points) { |
| 497 | - for (int j = 0;j < stationRoutes.size();j++) { | 497 | + for (int j = 0; j < stationRoutes.size(); j++) { |
| 498 | LsStationRoute stationRoute = stationRoutes.get(j); | 498 | LsStationRoute stationRoute = stationRoutes.get(j); |
| 499 | if ("r".equals(stationRoute.getShapedType())) { | 499 | if ("r".equals(stationRoute.getShapedType())) { |
| 500 | org.geolatte.geom.Point center = stationRoute.getStation().getCenterPointWgs(); | 500 | org.geolatte.geom.Point center = stationRoute.getStation().getCenterPointWgs(); |
| @@ -506,7 +506,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -506,7 +506,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 506 | } else { | 506 | } else { |
| 507 | Polygon polygon = stationRoute.getBufferPolygonWgs(); | 507 | Polygon polygon = stationRoute.getBufferPolygonWgs(); |
| 508 | List<com.bsth.util.Geo.Point> polygonPoint = new ArrayList<>(); | 508 | List<com.bsth.util.Geo.Point> polygonPoint = new ArrayList<>(); |
| 509 | - for (int k = 0;k < polygon.getNumPositions();k++) { | 509 | + for (int k = 0; k < polygon.getNumPositions(); k++) { |
| 510 | polygonPoint.add(new Point(polygon.getPositionN(k).getCoordinate(0), polygon.getPositionN(k).getCoordinate(1))); | 510 | polygonPoint.add(new Point(polygon.getPositionN(k).getCoordinate(0), polygon.getPositionN(k).getCoordinate(1))); |
| 511 | } | 511 | } |
| 512 | com.bsth.util.Geo.Polygon polygon1 = new com.bsth.util.Geo.Polygon(polygonPoint); | 512 | com.bsth.util.Geo.Polygon polygon1 = new com.bsth.util.Geo.Polygon(polygonPoint); |
| @@ -522,13 +522,13 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -522,13 +522,13 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 522 | } | 522 | } |
| 523 | Set<String> specialStations = new LinkedHashSet<>(); | 523 | Set<String> specialStations = new LinkedHashSet<>(); |
| 524 | result.put("data", specialStations); | 524 | result.put("data", specialStations); |
| 525 | - for (int i = 0;i < stationRoutes.size();) { | 525 | + for (int i = 0; i < stationRoutes.size(); ) { |
| 526 | if (indexes.size() == 0) { | 526 | if (indexes.size() == 0) { |
| 527 | break; | 527 | break; |
| 528 | } | 528 | } |
| 529 | String lastMatch = null; | 529 | String lastMatch = null; |
| 530 | int j = 0; | 530 | int j = 0; |
| 531 | - for (;j < indexes.size();j++) { | 531 | + for (; j < indexes.size(); j++) { |
| 532 | String index = indexes.get(j), suffix = String.format("-%d", i); | 532 | String index = indexes.get(j), suffix = String.format("-%d", i); |
| 533 | if (index.endsWith(suffix) || isCircularRoute && i == stationRoutes.size() - 1 && index.endsWith("-0")) { | 533 | if (index.endsWith(suffix) || isCircularRoute && i == stationRoutes.size() - 1 && index.endsWith("-0")) { |
| 534 | lastMatch = index; | 534 | lastMatch = index; |
| @@ -547,6 +547,10 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -547,6 +547,10 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 547 | return result; | 547 | return result; |
| 548 | } | 548 | } |
| 549 | 549 | ||
| 550 | + public List<LsStationRoute> findByLineDirectionDate(Integer lineId, Integer direction, Date begin, Date end) { | ||
| 551 | + return lsStationRouteRepository.findByLineDirectionDate(lineId, direction, begin, end); | ||
| 552 | + } | ||
| 553 | + | ||
| 550 | protected void centerPoint(Station station) { | 554 | protected void centerPoint(Station station) { |
| 551 | // 中心点坐标信息 | 555 | // 中心点坐标信息 |
| 552 | String wkt = station.getCenterPointWkt(); | 556 | String wkt = station.getCenterPointWkt(); |
src/main/java/com/bsth/service/report/PassengerStatisticService.java
0 → 100644
| 1 | +package com.bsth.service.report; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.report.PassengerStatistic; | ||
| 4 | +import com.bsth.entity.sheet.CalcSheet; | ||
| 5 | +import com.bsth.entity.sheet.Sheet; | ||
| 6 | +import com.bsth.service.BaseService; | ||
| 7 | + | ||
| 8 | +import java.util.Date; | ||
| 9 | +import java.util.List; | ||
| 10 | +import java.util.Map; | ||
| 11 | + | ||
| 12 | +public interface PassengerStatisticService extends BaseService<PassengerStatistic, Integer>{ | ||
| 13 | + | ||
| 14 | + List<PassengerStatistic> groupByStation(PassengerStatistic passengerStatistic); | ||
| 15 | + | ||
| 16 | + List<PassengerStatistic> groupByVehicle(PassengerStatistic passengerStatistic); | ||
| 17 | +} | ||
| 0 | \ No newline at end of file | 18 | \ No newline at end of file |
src/main/java/com/bsth/service/report/impl/PassengerStatisticServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.report.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.report.PassengerStatistic; | ||
| 4 | +import com.bsth.repository.report.PassengerStatisticRepository; | ||
| 5 | +import com.bsth.service.impl.BaseServiceImpl; | ||
| 6 | +import com.bsth.service.report.PassengerStatisticService; | ||
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | +import org.springframework.stereotype.Service; | ||
| 9 | + | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | +import java.util.ArrayList; | ||
| 12 | +import java.util.Collections; | ||
| 13 | +import java.util.Date; | ||
| 14 | +import java.util.List; | ||
| 15 | + | ||
| 16 | +@Service | ||
| 17 | +public class PassengerStatisticServiceImpl extends BaseServiceImpl<PassengerStatistic, Integer> implements PassengerStatisticService { | ||
| 18 | + | ||
| 19 | + @Autowired | ||
| 20 | + private PassengerStatisticRepository passengerStatisticRepository; | ||
| 21 | + | ||
| 22 | + @Override | ||
| 23 | + public List<PassengerStatistic> groupByStation(PassengerStatistic passengerStatistic) { | ||
| 24 | + List<PassengerStatistic> result = new ArrayList<>(); | ||
| 25 | + List<Object[]> list = passengerStatisticRepository.groupByStation(passengerStatistic); | ||
| 26 | + for (Object[] o : list) { | ||
| 27 | + PassengerStatistic ps = new PassengerStatistic(); | ||
| 28 | + ps.setLineName((String) o[0]); | ||
| 29 | + ps.setDirection((Integer) o[1]); | ||
| 30 | + ps.setStationName((String) o[2]); | ||
| 31 | + ps.setUpNum(((BigDecimal) o[3]).intValue()); | ||
| 32 | + ps.setDownNum(((BigDecimal) o[4]).intValue()); | ||
| 33 | + | ||
| 34 | + result.add(ps); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + return result; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + public List<PassengerStatistic> groupByVehicle(PassengerStatistic passengerStatistic) { | ||
| 42 | + List<PassengerStatistic> result = new ArrayList<>(); | ||
| 43 | + List<Object[]> list = passengerStatisticRepository.groupByVehicle(passengerStatistic); | ||
| 44 | + for (Object[] o : list) { | ||
| 45 | + PassengerStatistic ps = new PassengerStatistic(); | ||
| 46 | + ps.setLineName((String) o[0]); | ||
| 47 | + ps.setInsideCode((String) o[1]); | ||
| 48 | + ps.setUpNum(((BigDecimal) o[2]).intValue()); | ||
| 49 | + | ||
| 50 | + result.add(ps); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + return result; | ||
| 54 | + } | ||
| 55 | +} | ||
| 0 | \ No newline at end of file | 56 | \ No newline at end of file |
src/main/resources/static/pages/base/line/list.html
| @@ -98,7 +98,7 @@ | @@ -98,7 +98,7 @@ | ||
| 98 | </td> | 98 | </td> |
| 99 | <td> | 99 | <td> |
| 100 | <!-- 这里没使用字典表,暂时写在页面上 --> | 100 | <!-- 这里没使用字典表,暂时写在页面上 --> |
| 101 | - <select name="nature_like" class="form-control" id="natureSelect"> | 101 | + <select name="nature_eq" class="form-control" id="natureSelect"> |
| 102 | <option value="">请选择...</option> | 102 | <option value="">请选择...</option> |
| 103 | <option value="lj">路救</option> | 103 | <option value="lj">路救</option> |
| 104 | <option value="bc">备车</option> | 104 | <option value="bc">备车</option> |
src/main/resources/static/pages/forms/mould/passenger-statistic-station.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/passenger-statistic-vehicle.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/permission/authorize_all/user_auth.html
| @@ -36,6 +36,7 @@ | @@ -36,6 +36,7 @@ | ||
| 36 | <li><label><input class="uk-checkbox" type="checkbox" data-event="cache_data_manage"> 缓存数据管理</label></li> | 36 | <li><label><input class="uk-checkbox" type="checkbox" data-event="cache_data_manage"> 缓存数据管理</label></li> |
| 37 | <li><label><input class="uk-checkbox" type="checkbox" data-event="history_sch_maintain"> 历史路单维护</label></li> | 37 | <li><label><input class="uk-checkbox" type="checkbox" data-event="history_sch_maintain"> 历史路单维护</label></li> |
| 38 | <li><label><input class="uk-checkbox" type="checkbox" data-event="sch_edit_info"> 班次修正日志</label></li> | 38 | <li><label><input class="uk-checkbox" type="checkbox" data-event="sch_edit_info"> 班次修正日志</label></li> |
| 39 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="passenger_flow_statistic"> 客流统计</label></li> | ||
| 39 | </ul> | 40 | </ul> |
| 40 | </div> | 41 | </div> |
| 41 | 42 |
src/main/resources/static/pages/report/passenger-statistic.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 class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block; margin-left: 10px;"> | ||
| 31 | + 统计: | ||
| 32 | + <input type="radio" checked name="statistic" value="0"/> 按站点 | ||
| 33 | + <input type="radio" name="statistic" value="1"/> 按车辆 | ||
| 34 | + </div> | ||
| 35 | + <div style="display: inline-block; margin-left: 10px;" id="gsdmDiv"> | ||
| 36 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 37 | + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 38 | + </div> | ||
| 39 | + <div style="display: inline-block; margin-left: 10px;" id="fgsdmDiv"> | ||
| 40 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 41 | + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> | ||
| 42 | + </div> | ||
| 43 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 44 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 45 | + <select class="form-control station-change" name="line" id="line" style="width: 180px;"></select> | ||
| 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 station-change" type="text" id="rqBegin" name="rqBegin" style="width: 180px;"/> 至 | ||
| 50 | + <input class="form-control station-change" type="text" id="rqEnd" name="rqEnd" style="width: 180px;"/> | ||
| 51 | + </div> | ||
| 52 | + <div style="margin-top: 10px"></div> | ||
| 53 | + <div class="group" style="display: inline-block;"> | ||
| 54 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 55 | + <span class="item-label" style="width: 80px;">上下行: </span> | ||
| 56 | + <select class="form-control station-change" name="direction" style="width: 180px;"> | ||
| 57 | + <option value="0">上行</option> | ||
| 58 | + <option value="1">下行</option> | ||
| 59 | + </select> | ||
| 60 | + </div> | ||
| 61 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 62 | + <span class="item-label" style="width: 80px;">站点: </span> | ||
| 63 | + <select class="form-control" id="stationCode" name="stationCode" style="width: 180px;"></select> | ||
| 64 | + </div> | ||
| 65 | + </div> | ||
| 66 | + <div class="group" style="display: none;"> | ||
| 67 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 68 | + <span class="item-label" style="width: 80px;">车辆: </span> | ||
| 69 | + <select class="form-control" id="insideCode" style="width: 180px;"></select> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + <div class="form-group"> | ||
| 73 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | ||
| 74 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 75 | + </div> | ||
| 76 | + </form> | ||
| 77 | + </div> | ||
| 78 | + <div class="portlet-body"> | ||
| 79 | + <div class="row"> | ||
| 80 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;"> | ||
| 81 | + <table class="table table-bordered table-checkable" id="forms0"> | ||
| 82 | + <thead> | ||
| 83 | + <tr> | ||
| 84 | + <td width="5%">序号</td> | ||
| 85 | + <td width="19%">线路</td> | ||
| 86 | + <td width="19%">上下行</td> | ||
| 87 | + <td width="19%">站点名称</td> | ||
| 88 | + <td width="19%">上客人数</td> | ||
| 89 | + <td width="19%">下客人数</td> | ||
| 90 | + </tr> | ||
| 91 | + </thead> | ||
| 92 | + <tbody class="passenger_statistic_tbody"> | ||
| 93 | + | ||
| 94 | + </tbody> | ||
| 95 | + </table> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | + <div class="portlet-body" style="display: none;"> | ||
| 100 | + <div class="row"> | ||
| 101 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;"> | ||
| 102 | + <table class="table table-bordered table-checkable" id="forms1"> | ||
| 103 | + <thead> | ||
| 104 | + <tr> | ||
| 105 | + <td width="10%"></td> | ||
| 106 | + <td width="30%">线路</td> | ||
| 107 | + <td width="30%">车辆编码</td> | ||
| 108 | + <td width="30%">上客人数</td> | ||
| 109 | + </tr> | ||
| 110 | + </thead> | ||
| 111 | + <tbody class="passenger_statistic_tbody"> | ||
| 112 | + | ||
| 113 | + </tbody> | ||
| 114 | + </table> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + </div> | ||
| 119 | + </div> | ||
| 120 | +</div> | ||
| 121 | + | ||
| 122 | +<script> | ||
| 123 | + $(function(){ | ||
| 124 | + if ($('.form-page-content').length) { | ||
| 125 | + $('.table-container').css('margin-top', '60px'); | ||
| 126 | + } | ||
| 127 | + $('input[name="statistic"]').on('change', function() { | ||
| 128 | + $('.group').css('display', 'none').eq($(this).val()).css('display', 'inline-block'); | ||
| 129 | + $('.portlet-body').css('display', 'none').eq($(this).val()).css('display', ''); | ||
| 130 | + }) | ||
| 131 | + // 关闭左侧栏 | ||
| 132 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 133 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 134 | + | ||
| 135 | + $("#rqBegin").datetimepicker({ | ||
| 136 | + format : 'YYYYMMDDHH', | ||
| 137 | + locale : 'zh-cn' | ||
| 138 | + }); | ||
| 139 | + | ||
| 140 | + $("#rqEnd").datetimepicker({ | ||
| 141 | + format : 'YYYYMMDDHH', | ||
| 142 | + locale : 'zh-cn' | ||
| 143 | + }); | ||
| 144 | + | ||
| 145 | + var dt = moment().format('YYYYMMDD'); | ||
| 146 | + $('#rqBegin').val(dt + '00'); | ||
| 147 | + $('#rqEnd').val(dt + '23'); | ||
| 148 | + | ||
| 149 | + var obj = []; | ||
| 150 | + var xlList; | ||
| 151 | + $.get('/report/lineList',function(result){ | ||
| 152 | + xlList=result; | ||
| 153 | + | ||
| 154 | + $.get('/user/companyData', function(result){ | ||
| 155 | + obj = result; | ||
| 156 | + var options = ''; | ||
| 157 | + for(var i = 0; i < obj.length; i++){ | ||
| 158 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + if(obj.length ==0){ | ||
| 162 | + $("#gsdmDiv").css('display','none'); | ||
| 163 | + }else if(obj.length ==1){ | ||
| 164 | + $("#gsdmDiv").css('display','none'); | ||
| 165 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 166 | + $('#fgsdmDiv').css('display','none'); | ||
| 167 | + } | ||
| 168 | + $('#gsdm').html(options); | ||
| 169 | + | ||
| 170 | + updateCompany(); | ||
| 171 | + }); | ||
| 172 | + }); | ||
| 173 | + | ||
| 174 | + $("#gsdm").on("change",updateCompany); | ||
| 175 | + function updateCompany(){ | ||
| 176 | + var company = $('#gsdm').val(); | ||
| 177 | + var options = ''; | ||
| 178 | + for(var i = 0; i < obj.length; i++){ | ||
| 179 | + if(obj[i].companyCode == company){ | ||
| 180 | + var children = obj[i].children; | ||
| 181 | + for(var j = 0; j < children.length; j++){ | ||
| 182 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + $('#fgsdm').html(options); | ||
| 187 | + initCl(); | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + | ||
| 191 | + var tempData = {}; | ||
| 192 | + $.get('/report/lineList',function(xlList){ | ||
| 193 | + var data = []; | ||
| 194 | + $.get('/user/companyData', function(result){ | ||
| 195 | + for(var i = 0; i < result.length; i++){ | ||
| 196 | + var companyCode = result[i].companyCode; | ||
| 197 | + var children = result[i].children; | ||
| 198 | + for(var j = 0; j < children.length; j++){ | ||
| 199 | + var code = children[j].code; | ||
| 200 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 201 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 202 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 203 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + } | ||
| 208 | + initPinYinSelect2('#line',data,''); | ||
| 209 | + }); | ||
| 210 | + }); | ||
| 211 | + | ||
| 212 | + $("#line").on("change", function(){ | ||
| 213 | + if($("#line").val() == " "){ | ||
| 214 | + $("#gsdm").attr("disabled", false); | ||
| 215 | + $("#fgsdm").attr("disabled", false); | ||
| 216 | + } else { | ||
| 217 | + var temp = (tempData[$("#line").val()] ? tempData[$("#line").val()] : " : ").split(":"); | ||
| 218 | + $("#gsdm").val(temp[0]); | ||
| 219 | + updateCompany(); | ||
| 220 | + $("#fgsdm").val(temp[1]); | ||
| 221 | + $("#gsdm").attr("disabled", true); | ||
| 222 | + $("#fgsdm").attr("disabled", true); | ||
| 223 | + } | ||
| 224 | + }); | ||
| 225 | + | ||
| 226 | + | ||
| 227 | + $("#query").on("click",function(){ | ||
| 228 | + var param = $('.form-inline').serializeJSON(); | ||
| 229 | + if (param.stationCode === '-1') { | ||
| 230 | + delete param.stationCode; | ||
| 231 | + } | ||
| 232 | + if (!param.line) { | ||
| 233 | + layer.msg("请选择线路"); | ||
| 234 | + } else if (!param.rqBegin || !param.rqEnd){ | ||
| 235 | + layer.msg("请选择起止时间"); | ||
| 236 | + } else { | ||
| 237 | + $get('/api/passenger-statistic' + (param.statistic === '0' ? '/groupByStation' : '/groupByVehicle'), param, function(result){ | ||
| 238 | + var html = template('passenger_statistic_template' + param.statistic,{list:result}); | ||
| 239 | + $('#forms' + param.statistic + ' .passenger_statistic_tbody').html(html); | ||
| 240 | + }); | ||
| 241 | + } | ||
| 242 | + }); | ||
| 243 | + | ||
| 244 | + $("#line").on("change",initCl); | ||
| 245 | + function initCl(){ | ||
| 246 | + $('#insideCode').select2({ | ||
| 247 | + placeholder: '搜索车辆...', | ||
| 248 | + allowClear: true, | ||
| 249 | + ajax: { | ||
| 250 | + url: '/report/carListByHistory', | ||
| 251 | + dataType: 'json', | ||
| 252 | + delay: 150, | ||
| 253 | + data: function(params){ | ||
| 254 | + return{nbbm: params.term, | ||
| 255 | + gsbm:$('#gsdm').val(), | ||
| 256 | + fgsbm:$('#fgsdm').val(), | ||
| 257 | + xlbm:$('#line').val()}; | ||
| 258 | + }, | ||
| 259 | + processResults: function (data) { | ||
| 260 | + return { | ||
| 261 | + results: data | ||
| 262 | + }; | ||
| 263 | + }, | ||
| 264 | + cache: true | ||
| 265 | + }, | ||
| 266 | + templateResult: function(repo){ | ||
| 267 | + if (repo.loading) return repo.text; | ||
| 268 | + var h = '<span>'+repo.text+'</span>'; | ||
| 269 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 270 | + return h; | ||
| 271 | + }, | ||
| 272 | + escapeMarkup: function (markup) { return markup; }, | ||
| 273 | + minimumInputLength: 1, | ||
| 274 | + templateSelection: function(repo){ | ||
| 275 | + return repo.text; | ||
| 276 | + }, | ||
| 277 | + language: { | ||
| 278 | + noResults: function(){ | ||
| 279 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 280 | + }, | ||
| 281 | + inputTooShort : function(e) { | ||
| 282 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 283 | + }, | ||
| 284 | + searching : function() { | ||
| 285 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 286 | + } | ||
| 287 | + } | ||
| 288 | + }); | ||
| 289 | + }; | ||
| 290 | + | ||
| 291 | + | ||
| 292 | + $(".station-change").on("change",initZd); | ||
| 293 | + $("#rqBegin,#rqEnd").on("blur",initZd); | ||
| 294 | + var status=false; | ||
| 295 | + | ||
| 296 | + function initZd(){ | ||
| 297 | + var param = $('.form-inline').serializeJSON(); | ||
| 298 | + if (!param.line || !param.direction || !param.rqBegin || !param.rqEnd) { | ||
| 299 | + } else { | ||
| 300 | + $.get('/api/lsstationroute/findByLineDirectionDate', param, function(result){ | ||
| 301 | + var zdList=result.data; | ||
| 302 | + if(status){ | ||
| 303 | + $("#stationCode").select2("destroy").html(''); | ||
| 304 | + } | ||
| 305 | + var datas=[]; | ||
| 306 | + datas.push({id:"-1",text:"请选择..."}); | ||
| 307 | + for(var i=0;i<zdList.length;i++){ | ||
| 308 | + datas.push({id: zdList[i]["stationCode"], text: zdList[i]["stationName"] + '(v' + zdList[i]['versions'] + ')'}); | ||
| 309 | + } | ||
| 310 | + initPinYinSelect2('#stationCode',datas); | ||
| 311 | + status=true; | ||
| 312 | + }) | ||
| 313 | + } | ||
| 314 | + } | ||
| 315 | + | ||
| 316 | + $("#export").on("click",function(){ | ||
| 317 | + var param = $('.form-inline').serializeJSON(); | ||
| 318 | + if (param.stationCode === '-1') { | ||
| 319 | + delete param.stationCode; | ||
| 320 | + } | ||
| 321 | + if (!param.line) { | ||
| 322 | + layer.msg("请选择线路"); | ||
| 323 | + } else if (!param.rqBegin || !param.rqEnd){ | ||
| 324 | + layer.msg("请选择起止时间"); | ||
| 325 | + } else { | ||
| 326 | + $get('/api/passenger-statistic' + (param.statistic === '0' ? '/groupByStation/export' : '/groupByVehicle/export'), param, function(result){ | ||
| 327 | + window.open('/downloadFile/download?fileName=' + param.rqBegin + '至' + param.rqEnd + '-客流统计(' + (param.statistic === '0' ? '站点' : '车辆') + ')'); | ||
| 328 | + }); | ||
| 329 | + } | ||
| 330 | + }); | ||
| 331 | + }); | ||
| 332 | + | ||
| 333 | +</script> | ||
| 334 | +<script type="text/html" id="passenger_statistic_template0"> | ||
| 335 | + {{each list as obj i}} | ||
| 336 | + <tr> | ||
| 337 | + <td>{{i+1}}</td> | ||
| 338 | + <td>{{obj.lineName}}</td> | ||
| 339 | + <td> | ||
| 340 | + {{if obj.direction==0}} | ||
| 341 | + 上行 | ||
| 342 | + {{else}} | ||
| 343 | + 下行 | ||
| 344 | + {{/if}} | ||
| 345 | + </td> | ||
| 346 | + <td>{{obj.stationName}}</td> | ||
| 347 | + <td>{{obj.upNum}}</td> | ||
| 348 | + <td>{{obj.downNum}}</td> | ||
| 349 | + </tr> | ||
| 350 | + {{/each}} | ||
| 351 | + {{if list.length == 0}} | ||
| 352 | + <tr> | ||
| 353 | + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 354 | + </tr> | ||
| 355 | + {{/if}} | ||
| 356 | +</script> | ||
| 357 | +<script type="text/html" id="passenger_statistic_template1"> | ||
| 358 | + {{each list as obj i}} | ||
| 359 | + <tr> | ||
| 360 | + <td>{{i+1}}</td> | ||
| 361 | + <td>{{obj.lineName}}</td> | ||
| 362 | + <td>{{obj.insideCode}}</td> | ||
| 363 | + <td>{{obj.upNum}}</td> | ||
| 364 | + </tr> | ||
| 365 | + {{/each}} | ||
| 366 | + {{if list.length == 0}} | ||
| 367 | + <tr> | ||
| 368 | + <td colspan="4"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 369 | + </tr> | ||
| 370 | + {{/if}} | ||
| 371 | +</script> |
src/main/resources/static/real_control_v2/fragments/home/tooltip.html
| @@ -30,6 +30,9 @@ | @@ -30,6 +30,9 @@ | ||
| 30 | <div> | 30 | <div> |
| 31 | <span class="field">设备:</span>{{deviceId}} | 31 | <span class="field">设备:</span>{{deviceId}} |
| 32 | </div> | 32 | </div> |
| 33 | + <div> | ||
| 34 | + <span class="field">乘客数:</span>{{passengerNum}} | ||
| 35 | + </div> | ||
| 33 | <!--<div> | 36 | <!--<div> |
| 34 | <span class="field">坐标:</span>{{lon}} {{lat}} | 37 | <span class="field">坐标:</span>{{lon}} {{lat}} |
| 35 | </div>--> | 38 | </div>--> |
| @@ -88,6 +91,9 @@ | @@ -88,6 +91,9 @@ | ||
| 88 | <div> | 91 | <div> |
| 89 | <span class="field">设备:</span>{{gps.deviceId}} | 92 | <span class="field">设备:</span>{{gps.deviceId}} |
| 90 | </div> | 93 | </div> |
| 94 | + <div> | ||
| 95 | + <span class="field">乘客数:</span>{{gps.passengerNum}} | ||
| 96 | + </div> | ||
| 91 | <div style="color: #747272;"> | 97 | <div style="color: #747272;"> |
| 92 | {{gps.dateStr}} | 98 | {{gps.dateStr}} |
| 93 | </div> | 99 | </div> |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
| @@ -3,31 +3,36 @@ | @@ -3,31 +3,36 @@ | ||
| 3 | "id": 1, | 3 | "id": 1, |
| 4 | "text": "数据&统计", | 4 | "text": "数据&统计", |
| 5 | "children": [ | 5 | "children": [ |
| 6 | - { | ||
| 7 | - "id": 1.1, | ||
| 8 | - "text": "数据管理", | ||
| 9 | - "header": 1 | ||
| 10 | - }, | ||
| 11 | - { | ||
| 12 | - "id": 1.2, | ||
| 13 | - "text": "当日计划排班", | ||
| 14 | - "event": "curr_date_schedule" | ||
| 15 | - }, | ||
| 16 | - { | ||
| 17 | - "id": 1.3, | ||
| 18 | - "text": "缓存数据管理", | ||
| 19 | - "event": "cache_data_manage" | ||
| 20 | - }, | ||
| 21 | - { | ||
| 22 | - "id": 1.4, | ||
| 23 | - "text": "历史路单维护", | ||
| 24 | - "event": "history_sch_maintain" | ||
| 25 | - }, | ||
| 26 | - { | ||
| 27 | - "id": 1.41, | ||
| 28 | - "text": "班次修正日志", | ||
| 29 | - "event": "sch_edit_info" | ||
| 30 | - } | 6 | + { |
| 7 | + "id": 1.1, | ||
| 8 | + "text": "数据管理", | ||
| 9 | + "header": 1 | ||
| 10 | + }, | ||
| 11 | + { | ||
| 12 | + "id": 1.2, | ||
| 13 | + "text": "当日计划排班", | ||
| 14 | + "event": "curr_date_schedule" | ||
| 15 | + }, | ||
| 16 | + { | ||
| 17 | + "id": 1.3, | ||
| 18 | + "text": "缓存数据管理", | ||
| 19 | + "event": "cache_data_manage" | ||
| 20 | + }, | ||
| 21 | + { | ||
| 22 | + "id": 1.4, | ||
| 23 | + "text": "历史路单维护", | ||
| 24 | + "event": "history_sch_maintain" | ||
| 25 | + }, | ||
| 26 | + { | ||
| 27 | + "id": 1.41, | ||
| 28 | + "text": "班次修正日志", | ||
| 29 | + "event": "sch_edit_info" | ||
| 30 | + } , | ||
| 31 | + { | ||
| 32 | + "id": 1.5, | ||
| 33 | + "text": "客流统计", | ||
| 34 | + "event": "passenger_flow_statistic" | ||
| 35 | + } | ||
| 31 | ] | 36 | ] |
| 32 | }, | 37 | }, |
| 33 | { | 38 | { |
src/main/resources/static/real_control_v2/js/forms/wrap.html
| 1 | -<html> | ||
| 2 | -<head> | ||
| 3 | - <!-- Bootstrap style --> | ||
| 4 | - <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/> | ||
| 5 | - <!-- METRONIC style --> | ||
| 6 | - <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" rel="stylesheet" type="text/css" id="style_color"/> | ||
| 7 | - <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" type="text/css"/> | ||
| 8 | - <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" type="text/css"/> | ||
| 9 | - <link href="/metronic_v4.5.4/layout4/css/layout.min.css" rel="stylesheet" type="text/css"/> | ||
| 10 | - <!-- select2 下拉框插件 --> | ||
| 11 | - <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css"/> | ||
| 12 | - <link href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css"/> | ||
| 13 | - <!-- iCheck 单选框和复选框 --> | ||
| 14 | - <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" rel="stylesheet" type="text/css"/> | ||
| 15 | - <!-- 日期控件 --> | ||
| 16 | - <link href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | ||
| 17 | - rel="stylesheet" type="text/css"/> | ||
| 18 | - <!-- layer 弹层 插件 --> | ||
| 19 | - <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | ||
| 20 | - rel="stylesheet" type="text/css" /> | ||
| 21 | - | ||
| 22 | - <!-- jQuery --> | ||
| 23 | - <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | ||
| 24 | - <script src="/assets/plugins/pinyin.js"></script> | ||
| 25 | - <!-- select2 下拉框 --> | ||
| 26 | - <script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | ||
| 27 | - <!-- moment.js 日期处理类库 --> | ||
| 28 | - <script src="/assets/plugins/moment-with-locales.js"></script> | ||
| 29 | - <!-- 日期控件 --> | ||
| 30 | - <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | ||
| 31 | - <!-- art-template 模版引擎 --> | ||
| 32 | - <script src="/assets/plugins/template.js"></script> | ||
| 33 | - <script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | ||
| 34 | - <!-- layer 弹层 --> | ||
| 35 | - <script src="/assets/plugins/layer-v2.4/layer/layer.js" ></script> | ||
| 36 | - <!-- jquery.pageinator 分页 --> | ||
| 37 | - <script src="/assets/plugins/jqPaginator.min.js"></script> | ||
| 38 | - | ||
| 39 | - <style> | ||
| 40 | - body{ | ||
| 41 | - background: #fff; | ||
| 42 | - } | ||
| 43 | - .form-page-content>.page-head{ | ||
| 44 | - display: none !important; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - .form-page-content .portlet{ | ||
| 48 | - margin-bottom: 0px !important; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - .row{ | ||
| 52 | - margin-left: 0 !important; | ||
| 53 | - margin-right: 0 !important; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - .row .col-md-12{ | ||
| 57 | - padding-left: 0 !important; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - .portlet{ | ||
| 61 | - padding-top: 0 !important; | ||
| 62 | - padding-left: 0 !important; | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - .form-page-content .portlet>.portlet-title{ | ||
| 66 | - position: fixed; | ||
| 67 | - width: 100%; | ||
| 68 | - background: #ffffff; | ||
| 69 | - z-index: 9; | ||
| 70 | - padding-top: 12px; | ||
| 71 | - margin-top: -2px; | ||
| 72 | - box-shadow: 0px 4px 2px 0 rgba(225, 225, 225, 0.2), 0px 4px 9px 0 rgba(139, 135, 135, 0.19); | ||
| 73 | - border-bottom: 1px solid #dbdbdb; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - .form-page-content .portlet.light .portlet-body{ | ||
| 77 | - padding-top: 8px; | ||
| 78 | - margin-top: 55px; | ||
| 79 | - } | ||
| 80 | - </style> | ||
| 81 | -</head> | ||
| 82 | -<body> | ||
| 83 | - | ||
| 84 | -<div class="form-page-content"> | ||
| 85 | -</div> | ||
| 86 | - | ||
| 87 | -<script> | ||
| 88 | - (function () { | ||
| 89 | - var storage = window.localStorage; | ||
| 90 | - var key = 'real_control_form_embed_pageUrl'; | ||
| 91 | - //加载表单片段 | ||
| 92 | - var pageUrl = storage.getItem(key); | ||
| 93 | - if (!pageUrl) { | ||
| 94 | - alert('失败,缺少片段路径!'); | ||
| 95 | - return; | ||
| 96 | - } | ||
| 97 | - storage.removeItem(key); | ||
| 98 | - $('.form-page-content').load(pageUrl, function () { | ||
| 99 | - //限制日期 | ||
| 100 | - var d = moment(top.gb_second_timer.now()), | ||
| 101 | - f='YYYY-MM-DD'; | ||
| 102 | - //ed=d.format(f), | ||
| 103 | - //sd=d.subtract(3, 'days').format(f); | ||
| 104 | - | ||
| 105 | - try{ | ||
| 106 | - $('#date', '.form-page-content').data('DateTimePicker') | ||
| 107 | - .defaultDate(d.format(f)); | ||
| 108 | - //.maxDate(ed).minDate(sd); | ||
| 109 | - }catch (e){ | ||
| 110 | - console.log(e); | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - if($("#ddrbBody").length > 0){ | ||
| 114 | - $("#ddrbBody").height("620px"); | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - //去掉公司和分公司选项 | ||
| 118 | - var company = $('select[name=company]', '.form-page-content'); | ||
| 119 | - var subCompany = $('select[name=subCompany]', '.form-page-content'); | ||
| 120 | - if(company.length > 0){ | ||
| 121 | - company.parent().remove(); | ||
| 122 | - } | ||
| 123 | - if(subCompany.length > 0){ | ||
| 124 | - subCompany.parent().remove(); | ||
| 125 | - } | ||
| 126 | - | ||
| 127 | - //重新构造线路下拉框 | ||
| 128 | - //var lineSelect = $('select[name=line]', '.form-page-content'); | ||
| 129 | - //lineSelect.select2('destory').html(''); | ||
| 130 | - //initPinYinSelect2(lineSelect); | ||
| 131 | - }); | ||
| 132 | - | ||
| 133 | - //iframe 自适应高度 | ||
| 134 | -/* var iframeHeight; | ||
| 135 | - var ifm = top.document.getElementById("formFragmentModalIframe"); | ||
| 136 | - | ||
| 137 | - function changeFrameHeight() { | ||
| 138 | - iframeHeight = $('.form-page-content').height() | ||
| 139 | - ifm.height = iframeHeight + 'px'; | ||
| 140 | - } | ||
| 141 | - | ||
| 142 | - document.body.onload = function () { | ||
| 143 | - setTimeout(changeFrameHeight, 500); | ||
| 144 | - }; | ||
| 145 | - //定时重置iframe高度,在片段内容不可控的情况下。 这是目前能想到的最好办法了 | ||
| 146 | - window.setInterval(function () { | ||
| 147 | - var h = $('.form-page-content').height(); | ||
| 148 | - if (iframeHeight != h) | ||
| 149 | - ifm.height = h + 'px'; | ||
| 150 | - }, 600);*/ | ||
| 151 | - | ||
| 152 | - })(); | ||
| 153 | - | ||
| 154 | - function initPinYinSelect2(selector, data, cb) { | ||
| 155 | - //过滤线路选择框数据 | ||
| 156 | - /*if(selector === '#line'){ | ||
| 157 | - var idx = ',' + top.gb_data_basic.line_idx + ','; | ||
| 158 | - var newData = []; | ||
| 159 | - $.each(data, function () { | ||
| 160 | - if(idx.indexOf(',' + this.id + ',') != -1) | ||
| 161 | - newData.push(this); | ||
| 162 | - }); | ||
| 163 | - data = newData; | ||
| 164 | - }*/ | ||
| 165 | - | ||
| 166 | - if(selector === '#line'){ | ||
| 167 | - //写死线路下拉框 | ||
| 168 | - data = []; | ||
| 169 | - $.each(top.gb_data_basic.activeLines, function () { | ||
| 170 | - data.push({ | ||
| 171 | - id: this.lineCode, | ||
| 172 | - text: this.name | ||
| 173 | - }); | ||
| 174 | - }); | ||
| 175 | - } | ||
| 176 | - $.each(data, function () { | ||
| 177 | - this.fullChars = pinyin.getFullChars(this.text).toUpperCase(); | ||
| 178 | - this.camelChars = pinyin.getCamelChars(this.text); | ||
| 179 | - }); | ||
| 180 | - | ||
| 181 | - $.fn.select2.amd.require(['select2/compat/matcher'], function (oldMatcher) { | ||
| 182 | - $(selector).select2({ | ||
| 183 | - data: data, | ||
| 184 | - matcher: oldMatcher(function (term, text, item) { | ||
| 185 | - if (!item.id) | ||
| 186 | - return; | ||
| 187 | - var upTerm = term.toUpperCase(); | ||
| 188 | - if (item.fullChars.indexOf(upTerm) != -1 | ||
| 189 | - || item.camelChars.indexOf(upTerm) != -1) | ||
| 190 | - return true; | ||
| 191 | - | ||
| 192 | - return text.indexOf(term) != -1; | ||
| 193 | - }) | ||
| 194 | - }); | ||
| 195 | - | ||
| 196 | - cb && cb($(selector)); | ||
| 197 | - | ||
| 198 | - if(selector === '#line') { | ||
| 199 | - setTimeout(function () { | ||
| 200 | - $('#line', '.form-page-content').trigger('change'); | ||
| 201 | - }, 500); | ||
| 202 | - } | ||
| 203 | - }); | ||
| 204 | - | ||
| 205 | - return $(selector); | ||
| 206 | - } | ||
| 207 | - | ||
| 208 | - var $get = top.gb_common.$get; | ||
| 209 | - var $post = top.gb_common.$post; | ||
| 210 | -</script> | ||
| 211 | -</body> | 1 | +<html> |
| 2 | +<head> | ||
| 3 | + <!-- Bootstrap style --> | ||
| 4 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/> | ||
| 5 | + <!-- METRONIC style --> | ||
| 6 | + <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" rel="stylesheet" type="text/css" id="style_color"/> | ||
| 7 | + <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" type="text/css"/> | ||
| 8 | + <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" type="text/css"/> | ||
| 9 | + <link href="/metronic_v4.5.4/layout4/css/layout.min.css" rel="stylesheet" type="text/css"/> | ||
| 10 | + <!-- select2 下拉框插件 --> | ||
| 11 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css"/> | ||
| 12 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css"/> | ||
| 13 | + <!-- iCheck 单选框和复选框 --> | ||
| 14 | + <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" rel="stylesheet" type="text/css"/> | ||
| 15 | + <!-- 日期控件 --> | ||
| 16 | + <link href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | ||
| 17 | + rel="stylesheet" type="text/css"/> | ||
| 18 | + <!-- layer 弹层 插件 --> | ||
| 19 | + <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | ||
| 20 | + rel="stylesheet" type="text/css" /> | ||
| 21 | + | ||
| 22 | + <!-- jQuery --> | ||
| 23 | + <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | ||
| 24 | + <!-- jquery.serializejson JSON序列化插件 --> | ||
| 25 | + <script src="/assets/plugins/jquery.serializejson.js"></script> | ||
| 26 | + <script src="/assets/plugins/pinyin.js"></script> | ||
| 27 | + <!-- select2 下拉框 --> | ||
| 28 | + <script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | ||
| 29 | + <!-- moment.js 日期处理类库 --> | ||
| 30 | + <script src="/assets/plugins/moment-with-locales.js"></script> | ||
| 31 | + <!-- 日期控件 --> | ||
| 32 | + <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | ||
| 33 | + <!-- art-template 模版引擎 --> | ||
| 34 | + <script src="/assets/plugins/template.js"></script> | ||
| 35 | + <script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | ||
| 36 | + <!-- layer 弹层 --> | ||
| 37 | + <script src="/assets/plugins/layer-v2.4/layer/layer.js" ></script> | ||
| 38 | + <!-- jquery.pageinator 分页 --> | ||
| 39 | + <script src="/assets/plugins/jqPaginator.min.js"></script> | ||
| 40 | + | ||
| 41 | + <style> | ||
| 42 | + body{ | ||
| 43 | + background: #fff; | ||
| 44 | + } | ||
| 45 | + .form-page-content>.page-head{ | ||
| 46 | + display: none !important; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + .form-page-content .portlet{ | ||
| 50 | + margin-bottom: 0px !important; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + .row{ | ||
| 54 | + margin-left: 0 !important; | ||
| 55 | + margin-right: 0 !important; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + .row .col-md-12{ | ||
| 59 | + padding-left: 0 !important; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + .portlet{ | ||
| 63 | + padding-top: 0 !important; | ||
| 64 | + padding-left: 0 !important; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + .form-page-content .portlet>.portlet-title{ | ||
| 68 | + position: fixed; | ||
| 69 | + width: 100%; | ||
| 70 | + background: #ffffff; | ||
| 71 | + z-index: 9; | ||
| 72 | + padding-top: 12px; | ||
| 73 | + margin-top: -2px; | ||
| 74 | + box-shadow: 0px 4px 2px 0 rgba(225, 225, 225, 0.2), 0px 4px 9px 0 rgba(139, 135, 135, 0.19); | ||
| 75 | + border-bottom: 1px solid #dbdbdb; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + .form-page-content .portlet.light .portlet-body{ | ||
| 79 | + padding-top: 8px; | ||
| 80 | + margin-top: 55px; | ||
| 81 | + } | ||
| 82 | + </style> | ||
| 83 | +</head> | ||
| 84 | +<body> | ||
| 85 | + | ||
| 86 | +<div class="form-page-content"> | ||
| 87 | +</div> | ||
| 88 | + | ||
| 89 | +<script> | ||
| 90 | + (function () { | ||
| 91 | + var storage = window.localStorage; | ||
| 92 | + var key = 'real_control_form_embed_pageUrl'; | ||
| 93 | + //加载表单片段 | ||
| 94 | + var pageUrl = storage.getItem(key); | ||
| 95 | + if (!pageUrl) { | ||
| 96 | + alert('失败,缺少片段路径!'); | ||
| 97 | + return; | ||
| 98 | + } | ||
| 99 | + storage.removeItem(key); | ||
| 100 | + $('.form-page-content').load(pageUrl, function () { | ||
| 101 | + //限制日期 | ||
| 102 | + var d = moment(top.gb_second_timer.now()), | ||
| 103 | + f='YYYY-MM-DD'; | ||
| 104 | + //ed=d.format(f), | ||
| 105 | + //sd=d.subtract(3, 'days').format(f); | ||
| 106 | + | ||
| 107 | + try{ | ||
| 108 | + $('#date', '.form-page-content').data('DateTimePicker') | ||
| 109 | + .defaultDate(d.format(f)); | ||
| 110 | + //.maxDate(ed).minDate(sd); | ||
| 111 | + }catch (e){ | ||
| 112 | + console.log(e); | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + if($("#ddrbBody").length > 0){ | ||
| 116 | + $("#ddrbBody").height("620px"); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + //去掉公司和分公司选项 | ||
| 120 | + var company = $('select[name=company]', '.form-page-content'); | ||
| 121 | + var subCompany = $('select[name=subCompany]', '.form-page-content'); | ||
| 122 | + if(company.length > 0){ | ||
| 123 | + company.parent().remove(); | ||
| 124 | + } | ||
| 125 | + if(subCompany.length > 0){ | ||
| 126 | + subCompany.parent().remove(); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + //重新构造线路下拉框 | ||
| 130 | + //var lineSelect = $('select[name=line]', '.form-page-content'); | ||
| 131 | + //lineSelect.select2('destory').html(''); | ||
| 132 | + //initPinYinSelect2(lineSelect); | ||
| 133 | + }); | ||
| 134 | + | ||
| 135 | + //iframe 自适应高度 | ||
| 136 | +/* var iframeHeight; | ||
| 137 | + var ifm = top.document.getElementById("formFragmentModalIframe"); | ||
| 138 | + | ||
| 139 | + function changeFrameHeight() { | ||
| 140 | + iframeHeight = $('.form-page-content').height() | ||
| 141 | + ifm.height = iframeHeight + 'px'; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + document.body.onload = function () { | ||
| 145 | + setTimeout(changeFrameHeight, 500); | ||
| 146 | + }; | ||
| 147 | + //定时重置iframe高度,在片段内容不可控的情况下。 这是目前能想到的最好办法了 | ||
| 148 | + window.setInterval(function () { | ||
| 149 | + var h = $('.form-page-content').height(); | ||
| 150 | + if (iframeHeight != h) | ||
| 151 | + ifm.height = h + 'px'; | ||
| 152 | + }, 600);*/ | ||
| 153 | + | ||
| 154 | + })(); | ||
| 155 | + | ||
| 156 | + function initPinYinSelect2(selector, data, cb) { | ||
| 157 | + //过滤线路选择框数据 | ||
| 158 | + /*if(selector === '#line'){ | ||
| 159 | + var idx = ',' + top.gb_data_basic.line_idx + ','; | ||
| 160 | + var newData = []; | ||
| 161 | + $.each(data, function () { | ||
| 162 | + if(idx.indexOf(',' + this.id + ',') != -1) | ||
| 163 | + newData.push(this); | ||
| 164 | + }); | ||
| 165 | + data = newData; | ||
| 166 | + }*/ | ||
| 167 | + | ||
| 168 | + if(selector === '#line'){ | ||
| 169 | + //写死线路下拉框 | ||
| 170 | + data = []; | ||
| 171 | + $.each(top.gb_data_basic.activeLines, function () { | ||
| 172 | + data.push({ | ||
| 173 | + id: this.lineCode, | ||
| 174 | + text: this.name | ||
| 175 | + }); | ||
| 176 | + }); | ||
| 177 | + } | ||
| 178 | + $.each(data, function () { | ||
| 179 | + this.fullChars = pinyin.getFullChars(this.text).toUpperCase(); | ||
| 180 | + this.camelChars = pinyin.getCamelChars(this.text); | ||
| 181 | + }); | ||
| 182 | + | ||
| 183 | + $.fn.select2.amd.require(['select2/compat/matcher'], function (oldMatcher) { | ||
| 184 | + $(selector).select2({ | ||
| 185 | + data: data, | ||
| 186 | + matcher: oldMatcher(function (term, text, item) { | ||
| 187 | + if (!item.id) | ||
| 188 | + return; | ||
| 189 | + var upTerm = term.toUpperCase(); | ||
| 190 | + if (item.fullChars.indexOf(upTerm) != -1 | ||
| 191 | + || item.camelChars.indexOf(upTerm) != -1) | ||
| 192 | + return true; | ||
| 193 | + | ||
| 194 | + return text.indexOf(term) != -1; | ||
| 195 | + }) | ||
| 196 | + }); | ||
| 197 | + | ||
| 198 | + cb && cb($(selector)); | ||
| 199 | + | ||
| 200 | + if(selector === '#line') { | ||
| 201 | + setTimeout(function () { | ||
| 202 | + $('#line', '.form-page-content').trigger('change'); | ||
| 203 | + }, 500); | ||
| 204 | + } | ||
| 205 | + }); | ||
| 206 | + | ||
| 207 | + return $(selector); | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + var $get = top.gb_common.$get; | ||
| 211 | + var $post = top.gb_common.$post; | ||
| 212 | +</script> | ||
| 213 | +</body> | ||
| 212 | </html> | 214 | </html> |
| 213 | \ No newline at end of file | 215 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| @@ -247,6 +247,9 @@ var gb_northToolbar = (function () { | @@ -247,6 +247,9 @@ var gb_northToolbar = (function () { | ||
| 247 | sch_edit_info: function () { | 247 | sch_edit_info: function () { |
| 248 | open_modal('/real_control_v2/fragments/north/nav/sch_edit_info/list.html', {}, modal_opts); | 248 | open_modal('/real_control_v2/fragments/north/nav/sch_edit_info/list.html', {}, modal_opts); |
| 249 | }, | 249 | }, |
| 250 | + passenger_flow_statistic: function() { | ||
| 251 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/report/passenger-statistic.html', '客流统计'); | ||
| 252 | + }, | ||
| 250 | form_shifday: function () { | 253 | form_shifday: function () { |
| 251 | gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/shifdays/shifday.html', '班次车辆人员日统计'); | 254 | gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/shifdays/shifday.html', '班次车辆人员日统计'); |
| 252 | }, | 255 | }, |
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_infowindow.html
| @@ -47,10 +47,10 @@ | @@ -47,10 +47,10 @@ | ||
| 47 | <p>角度:{{direction}}</p> | 47 | <p>角度:{{direction}}</p> |
| 48 | <p>经度:{{lon}}</p> | 48 | <p>经度:{{lon}}</p> |
| 49 | <p>纬度:{{lat}}</p> | 49 | <p>纬度:{{lat}}</p> |
| 50 | - {{if num !=null}} | ||
| 51 | - <p>人数:{{num}}</p> | 50 | + {{if passengerNum != null}} |
| 51 | + <p>乘客数:{{passengerNum}}</p> | ||
| 52 | {{/if}} | 52 | {{/if}} |
| 53 | - {{if num !=null && num <= 5}} | 53 | + <!--{{if num !=null && num <= 5}} |
| 54 | <p>状态:<a href="javascript:;" style="color:green" onclick="javascript:gb_map_play_back.showPhoto('{{photo}}');">舒适</a></p> | 54 | <p>状态:<a href="javascript:;" style="color:green" onclick="javascript:gb_map_play_back.showPhoto('{{photo}}');">舒适</a></p> |
| 55 | {{/if}} | 55 | {{/if}} |
| 56 | {{if num > 5 && num <= 10}} | 56 | {{if num > 5 && num <= 10}} |
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | {{/if}} | 58 | {{/if}} |
| 59 | {{if num > 10}} | 59 | {{if num > 10}} |
| 60 | <p>状态:<a href="javascript:;" style="color:red" onclick="javascript:gb_map_play_back.showPhoto('{{photo}}');">拥挤</a></p> | 60 | <p>状态:<a href="javascript:;" style="color:red" onclick="javascript:gb_map_play_back.showPhoto('{{photo}}');">拥挤</a></p> |
| 61 | - {{/if}} | 61 | + {{/if}}--> |
| 62 | {{if energy == 0}} | 62 | {{if energy == 0}} |
| 63 | <div><span class="field">电量:</span><span style="color: red;">{{energy}}% (异常)</span></div> | 63 | <div><span class="field">电量:</span><span style="color: red;">{{energy}}% (异常)</span></div> |
| 64 | {{/if}} | 64 | {{/if}} |