Commit 707496419c57f2293d2a91c27cd277503ebc3589

Authored by panzhaov5
2 parents 469daeb5 81ddfc23

Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control into pudong

# Conflicts:
#	src/main/java/com/bsth/data/schedule/e_state_check/ScheduleStationCodeChecker.java
Showing 31 changed files with 11568 additions and 11022 deletions
src/main/java/com/bsth/controller/calc/CalcWaybillController.java
... ... @@ -151,6 +151,39 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer>
151 151 return calcWaybillService.calcStatisticsDaily(gsdm,fgsdm,line,date,date2,xlName,type);
152 152 }
153 153  
  154 + @RequestMapping(value="/calcStatisticsDaily2")
  155 + public List<Map<String, Object>> calcStatisticsDaily2(@RequestParam Map<String, Object> map){
  156 + String gsdm="";
  157 + if(map.get("gsdm")!=null){
  158 + gsdm=map.get("gsdm").toString().trim();
  159 + }
  160 + String fgsdm="";
  161 + if(map.get("fgsdm")!=null){
  162 + fgsdm=map.get("fgsdm").toString().trim();
  163 + }
  164 + String line="";
  165 + if(map.get("line")!=null){
  166 + line=map.get("line").toString().trim();
  167 + }
  168 + String date="";
  169 + if(map.get("date")!=null){
  170 + date=map.get("date").toString().trim();
  171 + }
  172 + String date2="";
  173 + if(map.get("date2")!=null){
  174 + date2=map.get("date2").toString().trim();
  175 + }
  176 + String xlName="";
  177 + if(map.get("xlName")!=null){
  178 + xlName=map.get("xlName").toString().trim();
  179 + }
  180 + String type="";
  181 + if(map.get("type")!=null){
  182 + type=map.get("type").toString().trim();
  183 + }
  184 + return calcWaybillService.calcStatisticsDaily2(gsdm,fgsdm,line,date,date2,xlName,type);
  185 + }
  186 +
154 187 @RequestMapping(value="/generateLineMileage")
155 188 public Map<String, Object> generateLineMileage(@RequestParam Map<String, Object> map) throws Exception{
156 189 Map<String, Object> m = new HashMap<String, Object>();
... ...
src/main/java/com/bsth/controller/realcontrol/AdminUtilsController.java
1   -package com.bsth.controller.realcontrol;
2   -
3   -import com.bsth.data.directive.DayOfDirectives;
4   -import com.bsth.data.directive.DirectivesPstThread;
5   -import com.bsth.data.gpsdata_v2.cache.GeoCacheData;
6   -import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
7   -import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
8   -import com.bsth.data.msg_queue.DirectivePushQueue;
9   -import com.bsth.data.msg_queue.WebSocketPushQueue;
10   -import com.bsth.data.pilot80.PilotReport;
11   -import com.bsth.data.schedule.DayOfSchedule;
12   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
13   -import com.bsth.websocket.handler.SendUtils;
14   -import org.slf4j.Logger;
15   -import org.slf4j.LoggerFactory;
16   -import org.springframework.beans.factory.annotation.Autowired;
17   -import org.springframework.web.bind.annotation.RequestMapping;
18   -import org.springframework.web.bind.annotation.RequestParam;
19   -import org.springframework.web.bind.annotation.RestController;
20   -
21   -import java.util.HashMap;
22   -import java.util.List;
23   -import java.util.Map;
24   -
25   -/**
26   - * Created by panzhao on 2017/4/14.
27   - */
28   -@RestController
29   -@RequestMapping("adminUtils")
30   -public class AdminUtilsController {
31   -
32   -
33   - Logger logger = LoggerFactory.getLogger(this.getClass());
34   -
35   - @Autowired
36   - DayOfSchedule dayOfSchedule;
37   -
38   - @Autowired
39   - GeoCacheData geoCacheData;
40   -
41   - @Autowired
42   - DayOfDirectives dayOfDirectives;
43   -
44   - @Autowired
45   - SendUtils sendUtils;
46   -
47   - @Autowired
48   - PilotReport pilotReport;
49   -
50   - /**
51   - * 出现重复班次的车辆
52   - * @param
53   -
54   - @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)
55   - public void schRepeat(@RequestParam String nbbm){
56   - logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");
57   - List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);
58   - logger.info("检测前,车辆班次数量:" + list.size());
59   -
60   - Map<Long, ScheduleRealInfo> map = new HashMap<>();
61   - for(ScheduleRealInfo sch : list){
62   - if(map.containsKey(sch.getId())){
63   - logger.info("检测到重复ID: " + sch.getId());
64   - }
65   - map.put(sch.getId(), sch);
66   - }
67   -
68   - logger.info("检测后,车辆班次数量:" + list.size());
69   - if(map.values().size() > 0){
70   - dayOfSchedule.replaceByNbbm(nbbm, map.values());
71   - }
72   - }*/
73   -
74   -/* @RequestMapping(value = "/directivePushQueue")
75   - public void directivePushQueue(){
76   - DirectivePushQueue.start();
77   - }*/
78   -
79   - @RequestMapping(value = "/directiveQueueSize")
80   - public void directiveQueueSize(){
81   - DirectivePushQueue.size();
82   - }
83   -
84   - /*@RequestMapping(value = "/webSocketPushQueue")
85   - public void webSocketPushQueue(){
86   - WebSocketPushQueue.start();
87   - }*/
88   -
89   - @RequestMapping(value = "/webSocketQueueSize")
90   - public void webSocketQueueSize(){
91   - WebSocketPushQueue.size();
92   - }
93   -
94   - @RequestMapping(value = "/setHttpFlag")
95   - public void setHttpFlag(@RequestParam int flag){
96   - if(flag != 0 && flag != -1)
97   - return;
98   - GpsDataLoaderThread.setFlag(flag);
99   - }
100   -
101   - @RequestMapping(value = "/updateCacheBuff")
102   - public void updateCacheBuff(){
103   - geoCacheData.loadData();
104   - }
105   -
106   - @RequestMapping(value = "/reCalcLpSch")
107   - public void reCalcLpSch(){
108   - dayOfSchedule._test_reCalcLpSch();
109   - }
110   -
111   - @RequestMapping(value = "/findSchByLpName")
112   - public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName){
113   - return dayOfSchedule.getLpScheduleMap().get(lpName);
114   - }
115   -
116   - @RequestMapping(value = "/findSchByNbbm")
117   - public List<ScheduleRealInfo> findSchByNbbm(@RequestParam String nbbm){
118   - return dayOfSchedule.findByNbbm(nbbm);
119   - }
120   -
121   - @RequestMapping(value = "/removeExecPlan")
122   - public int removeExecPlan(@RequestParam String nbbm){
123   - dayOfSchedule.removeExecPlan(nbbm);
124   - return 1;
125   - }
126   -
127   - @RequestMapping(value = "/sch_re_calc_id_maps")
128   - public int reCalcIdMaps(){
129   - return dayOfSchedule.reCalcIdMaps();
130   - }
131   -
132   - @RequestMapping(value = "/sch_size_string")
133   - public String schSizeString(){
134   - return dayOfSchedule.sizeString();
135   - }
136   -
137   - @RequestMapping(value = "/containerSize")
138   - public Map<String, Integer> containerSize(){
139   - Map<String, Integer> rs = new HashMap<>();
140   - rs.put("60_size", dayOfDirectives.all60().size());
141   - rs.put("80_size", pilotReport.findAll().size());
142   - rs.put("nbbm_sch_size", dayOfSchedule.findAll().size());
143   - rs.put("lp_sch_size", dayOfSchedule.findAllByLpContainer().size());
144   - rs.put("id_sch_size", dayOfSchedule.findAllByIdContainer().size());
145   - rs.put("pst_sch_size", dayOfSchedule.getPstSize());
146   - rs.put("speeds_size", OverspeedProcess.size());
147   - return rs;
148   - }
149   -
150   - @RequestMapping(value = "/websocketRadioText")
151   - public int radioText(String t, String lineCode){
152   - sendUtils.sendRadioText(t, lineCode);
153   - return 0;
154   - }
155   -
156   - @Autowired
157   - DirectivesPstThread directivesPstThread;
158   -
159   - @RequestMapping(value = "/_sd_60_pst")
160   - public void sd_60_pst(){
161   - logger.info("手动入库指令....");
162   - directivesPstThread.run();
163   - }
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.data.directive.DayOfDirectives;
  4 +import com.bsth.data.directive.DirectivesPstThread;
  5 +import com.bsth.data.gpsdata_v2.cache.GeoCacheData;
  6 +import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
  7 +import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
  8 +import com.bsth.data.msg_queue.DirectivePushQueue;
  9 +import com.bsth.data.msg_queue.WebSocketPushQueue;
  10 +import com.bsth.data.pilot80.PilotReport;
  11 +import com.bsth.data.schedule.DayOfSchedule;
  12 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  13 +import com.bsth.websocket.handler.SendUtils;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.web.bind.annotation.RequestMapping;
  18 +import org.springframework.web.bind.annotation.RequestParam;
  19 +import org.springframework.web.bind.annotation.RestController;
  20 +
  21 +import java.util.HashMap;
  22 +import java.util.List;
  23 +import java.util.Map;
  24 +
  25 +/**
  26 + * Created by panzhao on 2017/4/14.
  27 + */
  28 +@RestController
  29 +@RequestMapping("adminUtils")
  30 +public class AdminUtilsController {
  31 +
  32 +
  33 + Logger logger = LoggerFactory.getLogger(this.getClass());
  34 +
  35 + @Autowired
  36 + DayOfSchedule dayOfSchedule;
  37 +
  38 + @Autowired
  39 + GeoCacheData geoCacheData;
  40 +
  41 + @Autowired
  42 + DayOfDirectives dayOfDirectives;
  43 +
  44 + @Autowired
  45 + SendUtils sendUtils;
  46 +
  47 + @Autowired
  48 + PilotReport pilotReport;
  49 +
  50 + /**
  51 + * 出现重复班次的车辆
  52 + * @param
  53 +
  54 + @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)
  55 + public void schRepeat(@RequestParam String nbbm){
  56 + logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");
  57 + List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);
  58 + logger.info("检测前,车辆班次数量:" + list.size());
  59 +
  60 + Map<Long, ScheduleRealInfo> map = new HashMap<>();
  61 + for(ScheduleRealInfo sch : list){
  62 + if(map.containsKey(sch.getId())){
  63 + logger.info("检测到重复ID: " + sch.getId());
  64 + }
  65 + map.put(sch.getId(), sch);
  66 + }
  67 +
  68 + logger.info("检测后,车辆班次数量:" + list.size());
  69 + if(map.values().size() > 0){
  70 + dayOfSchedule.replaceByNbbm(nbbm, map.values());
  71 + }
  72 + }*/
  73 +
  74 +/* @RequestMapping(value = "/directivePushQueue")
  75 + public void directivePushQueue(){
  76 + DirectivePushQueue.start();
  77 + }*/
  78 +
  79 + @RequestMapping(value = "/directiveQueueSize")
  80 + public void directiveQueueSize(){
  81 + DirectivePushQueue.size();
  82 + }
  83 +
  84 + /*@RequestMapping(value = "/webSocketPushQueue")
  85 + public void webSocketPushQueue(){
  86 + WebSocketPushQueue.start();
  87 + }*/
  88 +
  89 + @RequestMapping(value = "/webSocketQueueSize")
  90 + public void webSocketQueueSize(){
  91 + WebSocketPushQueue.size();
  92 + }
  93 +
  94 + @RequestMapping(value = "/setHttpFlag")
  95 + public void setHttpFlag(@RequestParam int flag){
  96 + if(flag != 0 && flag != -1)
  97 + return;
  98 + GpsDataLoaderThread.setFlag(flag);
  99 + }
  100 +
  101 + @RequestMapping(value = "/updateCacheBuff")
  102 + public void updateCacheBuff(){
  103 + geoCacheData.loadData();
  104 + }
  105 +
  106 + @RequestMapping(value = "/reCalcLpSch")
  107 + public void reCalcLpSch(){
  108 + dayOfSchedule._test_reCalcLpSch();
  109 + }
  110 +
  111 + @RequestMapping(value = "/findSchByLpName")
  112 + public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName){
  113 + return dayOfSchedule.getLpScheduleMap().get(lpName);
  114 + }
  115 +
  116 + @RequestMapping(value = "/findSchByNbbm")
  117 + public List<ScheduleRealInfo> findSchByNbbm(@RequestParam String nbbm){
  118 + return dayOfSchedule.findByNbbm(nbbm);
  119 + }
  120 +
  121 + @RequestMapping(value = "/removeExecPlan")
  122 + public int removeExecPlan(@RequestParam String nbbm){
  123 + dayOfSchedule.removeExecPlan(nbbm);
  124 + return 1;
  125 + }
  126 +
  127 + @RequestMapping(value = "/sch_re_calc_id_maps")
  128 + public int reCalcIdMaps(){
  129 + return dayOfSchedule.reCalcIdMaps();
  130 + }
  131 +
  132 + @RequestMapping(value = "/sch_size_string")
  133 + public String schSizeString(){
  134 + return dayOfSchedule.sizeString();
  135 + }
  136 +
  137 + @RequestMapping(value = "/containerSize")
  138 + public Map<String, Integer> containerSize(){
  139 + Map<String, Integer> rs = new HashMap<>();
  140 + rs.put("60_size", dayOfDirectives.all60().size());
  141 + rs.put("80_size", pilotReport.findAll().size());
  142 + rs.put("nbbm_sch_size", dayOfSchedule.findAll().size());
  143 + rs.put("lp_sch_size", dayOfSchedule.findAllByLpContainer().size());
  144 + rs.put("id_sch_size", dayOfSchedule.findAllByIdContainer().size());
  145 + rs.put("pst_sch_size", dayOfSchedule.getPstSize());
  146 + rs.put("speeds_size", OverspeedProcess.size());
  147 + return rs;
  148 + }
  149 +
  150 + @RequestMapping(value = "/websocketRadioText")
  151 + public int radioText(String t, String lineCode){
  152 + sendUtils.sendRadioText(t, lineCode);
  153 + return 0;
  154 + }
  155 +
  156 + @Autowired
  157 + DirectivesPstThread directivesPstThread;
  158 +
  159 + @RequestMapping(value = "/_sd_60_pst")
  160 + public void sd_60_pst(){
  161 + logger.info("手动入库指令....");
  162 + directivesPstThread.run();
  163 + }
164 164 }
165 165 \ No newline at end of file
... ...
src/main/java/com/bsth/controller/realcontrol/dto/DftzAndDestroy.java
1   -package com.bsth.controller.realcontrol.dto;
2   -
3   -/**
4   - * Created by panzhao on 2018/3/22.
5   - */
6   -public class DftzAndDestroy {
7   -
8   - /**
9   - * 要调整待发的出场班次ID
10   - */
11   - private Long dftzId;
12   -
13   - /**
14   - * 要设置的待发时间
15   - */
16   - private String newTimeStr;
17   -
18   - /**
19   - * 要烂掉的班次的 班次id ,号分割多个
20   - */
21   - private String destroyIdx;
22   -
23   - /**
24   - * 备注
25   - */
26   - private String remarks;
27   -
28   - private String reason;
29   -
30   - /**
31   - * 调派工号
32   - */
33   - private String userId;
34   -
35   - public String getNewTimeStr() {
36   - return newTimeStr;
37   - }
38   -
39   - public void setNewTimeStr(String newTimeStr) {
40   - this.newTimeStr = newTimeStr;
41   - }
42   -
43   - public String getDestroyIdx() {
44   - return destroyIdx;
45   - }
46   -
47   - public void setDestroyIdx(String destroyIdx) {
48   - this.destroyIdx = destroyIdx;
49   - }
50   -
51   - public String getRemarks() {
52   - return remarks;
53   - }
54   -
55   - public void setRemarks(String remarks) {
56   - this.remarks = remarks;
57   - }
58   -
59   - public Long getDftzId() {
60   - return dftzId;
61   - }
62   -
63   - public void setDftzId(Long dftzId) {
64   - this.dftzId = dftzId;
65   - }
66   -
67   - public String getReason() {
68   - return reason;
69   - }
70   -
71   - public void setReason(String reason) {
72   - this.reason = reason;
73   - }
74   -
75   - public String getUserId() {
76   - return userId;
77   - }
78   -
79   - public void setUserId(String userId) {
80   - this.userId = userId;
81   - }
82   -}
  1 +package com.bsth.controller.realcontrol.dto;
  2 +
  3 +/**
  4 + * Created by panzhao on 2018/3/22.
  5 + */
  6 +public class DftzAndDestroy {
  7 +
  8 + /**
  9 + * 要调整待发的出场班次ID
  10 + */
  11 + private Long dftzId;
  12 +
  13 + /**
  14 + * 要设置的待发时间
  15 + */
  16 + private String newTimeStr;
  17 +
  18 + /**
  19 + * 要烂掉的班次的 班次id ,号分割多个
  20 + */
  21 + private String destroyIdx;
  22 +
  23 + /**
  24 + * 备注
  25 + */
  26 + private String remarks;
  27 +
  28 + private String reason;
  29 +
  30 + /**
  31 + * 调派工号
  32 + */
  33 + private String userId;
  34 +
  35 + public String getNewTimeStr() {
  36 + return newTimeStr;
  37 + }
  38 +
  39 + public void setNewTimeStr(String newTimeStr) {
  40 + this.newTimeStr = newTimeStr;
  41 + }
  42 +
  43 + public String getDestroyIdx() {
  44 + return destroyIdx;
  45 + }
  46 +
  47 + public void setDestroyIdx(String destroyIdx) {
  48 + this.destroyIdx = destroyIdx;
  49 + }
  50 +
  51 + public String getRemarks() {
  52 + return remarks;
  53 + }
  54 +
  55 + public void setRemarks(String remarks) {
  56 + this.remarks = remarks;
  57 + }
  58 +
  59 + public Long getDftzId() {
  60 + return dftzId;
  61 + }
  62 +
  63 + public void setDftzId(Long dftzId) {
  64 + this.dftzId = dftzId;
  65 + }
  66 +
  67 + public String getReason() {
  68 + return reason;
  69 + }
  70 +
  71 + public void setReason(String reason) {
  72 + this.reason = reason;
  73 + }
  74 +
  75 + public String getUserId() {
  76 + return userId;
  77 + }
  78 +
  79 + public void setUserId(String userId) {
  80 + this.userId = userId;
  81 + }
  82 +}
... ...
src/main/java/com/bsth/data/schedule/e_state_check/ScheduleStationCodeChecker.java
... ... @@ -148,4 +148,4 @@ public class ScheduleStationCodeChecker {
148 148  
149 149 return realMap;
150 150 }
151 151 -}
  152 +}
152 153 \ No newline at end of file
... ...
src/main/java/com/bsth/data/schedule/e_state_check/entity/SCodeInfo.java
1   -package com.bsth.data.schedule.e_state_check.entity;
2   -
3   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
4   -
5   -/**
6   - * Created by panzhao on 2018/4/2.
7   - */
8   -public class SCodeInfo {
9   -
10   - /**
11   - * 线路编码
12   - */
13   - private String lineCode;
14   -
15   - /**
16   - * 上下行
17   - */
18   - private int upDown;
19   -
20   - /**
21   - * 站点编码
22   - */
23   - private String stationCode;
24   -
25   - /**
26   - * 站点名称
27   - */
28   - private String stationName;
29   -
30   - /**
31   - * 实际站点编码
32   - */
33   - private String realStationCode;
34   -
35   - public String getLineCode() {
36   - return lineCode;
37   - }
38   -
39   - public void setLineCode(String lineCode) {
40   - this.lineCode = lineCode;
41   - }
42   -
43   - public int getUpDown() {
44   - return upDown;
45   - }
46   -
47   - public void setUpDown(int upDown) {
48   - this.upDown = upDown;
49   - }
50   -
51   - public String getStationCode() {
52   - return stationCode;
53   - }
54   -
55   - public void setStationCode(String stationCode) {
56   - this.stationCode = stationCode;
57   - }
58   -
59   - public String getStationName() {
60   - return stationName;
61   - }
62   -
63   - public void setStationName(String stationName) {
64   - this.stationName = stationName;
65   - }
66   -
67   - public String getRealStationCode() {
68   - return realStationCode;
69   - }
70   -
71   - public void setRealStationCode(String realStationCode) {
72   - this.realStationCode = realStationCode;
73   - }
74   -
75   - public static SCodeInfo getUpInstance(ScheduleRealInfo sch) {
76   - SCodeInfo sci = new SCodeInfo();
77   - sci.setLineCode(sch.getXlBm());
78   - sci.setUpDown(Integer.parseInt(sch.getXlDir()));
79   - sci.setStationName(sch.getQdzName());
80   - sci.setStationCode(sch.getQdzCode());
81   - return sci;
82   - }
83   -
84   - public static SCodeInfo geDownInstance(ScheduleRealInfo sch) {
85   - SCodeInfo sci = new SCodeInfo();
86   - sci.setLineCode(sch.getXlBm());
87   - sci.setUpDown(Integer.parseInt(sch.getXlDir()));
88   - sci.setStationName(sch.getZdzName());
89   - sci.setStationCode(sch.getZdzCode());
90   - return sci;
91   - }
92   -
93   - public static SCodeInfo getInstance(ScheduleRealInfo sch, String qdOrZd) {
94   - return qdOrZd.equals("qd")?getUpInstance(sch):geDownInstance(sch);
95   - }
96   -}
  1 +package com.bsth.data.schedule.e_state_check.entity;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +
  5 +/**
  6 + * Created by panzhao on 2018/4/2.
  7 + */
  8 +public class SCodeInfo {
  9 +
  10 + /**
  11 + * 线路编码
  12 + */
  13 + private String lineCode;
  14 +
  15 + /**
  16 + * 上下行
  17 + */
  18 + private int upDown;
  19 +
  20 + /**
  21 + * 站点编码
  22 + */
  23 + private String stationCode;
  24 +
  25 + /**
  26 + * 站点名称
  27 + */
  28 + private String stationName;
  29 +
  30 + /**
  31 + * 实际站点编码
  32 + */
  33 + private String realStationCode;
  34 +
  35 + public String getLineCode() {
  36 + return lineCode;
  37 + }
  38 +
  39 + public void setLineCode(String lineCode) {
  40 + this.lineCode = lineCode;
  41 + }
  42 +
  43 + public int getUpDown() {
  44 + return upDown;
  45 + }
  46 +
  47 + public void setUpDown(int upDown) {
  48 + this.upDown = upDown;
  49 + }
  50 +
  51 + public String getStationCode() {
  52 + return stationCode;
  53 + }
  54 +
  55 + public void setStationCode(String stationCode) {
  56 + this.stationCode = stationCode;
  57 + }
  58 +
  59 + public String getStationName() {
  60 + return stationName;
  61 + }
  62 +
  63 + public void setStationName(String stationName) {
  64 + this.stationName = stationName;
  65 + }
  66 +
  67 + public String getRealStationCode() {
  68 + return realStationCode;
  69 + }
  70 +
  71 + public void setRealStationCode(String realStationCode) {
  72 + this.realStationCode = realStationCode;
  73 + }
  74 +
  75 + public static SCodeInfo getUpInstance(ScheduleRealInfo sch) {
  76 + SCodeInfo sci = new SCodeInfo();
  77 + sci.setLineCode(sch.getXlBm());
  78 + sci.setUpDown(Integer.parseInt(sch.getXlDir()));
  79 + sci.setStationName(sch.getQdzName());
  80 + sci.setStationCode(sch.getQdzCode());
  81 + return sci;
  82 + }
  83 +
  84 + public static SCodeInfo geDownInstance(ScheduleRealInfo sch) {
  85 + SCodeInfo sci = new SCodeInfo();
  86 + sci.setLineCode(sch.getXlBm());
  87 + sci.setUpDown(Integer.parseInt(sch.getXlDir()));
  88 + sci.setStationName(sch.getZdzName());
  89 + sci.setStationCode(sch.getZdzCode());
  90 + return sci;
  91 + }
  92 +
  93 + public static SCodeInfo getInstance(ScheduleRealInfo sch, String qdOrZd) {
  94 + return qdOrZd.equals("qd")?getUpInstance(sch):geDownInstance(sch);
  95 + }
  96 +}
... ...
src/main/java/com/bsth/data/schedule/e_state_check/thread/FixedCheckStationCodeThread.java
1   -package com.bsth.data.schedule.e_state_check.thread;
2   -
3   -import com.bsth.data.schedule.e_state_check.ScheduleStationCodeChecker;
4   -import org.slf4j.Logger;
5   -import org.slf4j.LoggerFactory;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.stereotype.Component;
8   -
9   -/**
10   - * 定时检查班次站点编码线程
11   - * Created by panzhao on 2018/4/2.
12   - */
13   -@Component
14   -public class FixedCheckStationCodeThread extends Thread {
15   -
16   - @Autowired
17   - ScheduleStationCodeChecker scheduleStationCodeChecker;
18   -
19   - Logger logger = LoggerFactory.getLogger(this.getClass());
20   -
21   - @Override
22   - public void run() {
23   - try {
24   - scheduleStationCodeChecker.checkAll();
25   - } catch (Exception e) {
26   - logger.error("", e);
27   - }
28   - }
29   -}
  1 +package com.bsth.data.schedule.e_state_check.thread;
  2 +
  3 +import com.bsth.data.schedule.e_state_check.ScheduleStationCodeChecker;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +/**
  10 + * 定时检查班次站点编码线程
  11 + * Created by panzhao on 2018/4/2.
  12 + */
  13 +@Component
  14 +public class FixedCheckStationCodeThread extends Thread {
  15 +
  16 + @Autowired
  17 + ScheduleStationCodeChecker scheduleStationCodeChecker;
  18 +
  19 + Logger logger = LoggerFactory.getLogger(this.getClass());
  20 +
  21 + @Override
  22 + public void run() {
  23 + try {
  24 + scheduleStationCodeChecker.checkAll();
  25 + } catch (Exception e) {
  26 + logger.error("", e);
  27 + }
  28 + }
  29 +}
... ...
src/main/java/com/bsth/data/schedule/external/TccExternalService.java
1   -package com.bsth.data.schedule.external;
2   -
3   -import com.bsth.common.ResponseCode;
4   -import com.bsth.controller.realcontrol.dto.ChangePersonCar;
5   -import com.bsth.controller.realcontrol.dto.DftzAndDestroy;
6   -import com.bsth.data.schedule.DayOfSchedule;
7   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
8   -import com.bsth.service.realcontrol.ScheduleRealInfoService;
9   -import com.bsth.websocket.handler.SendUtils;
10   -import org.apache.commons.lang3.StringUtils;
11   -import org.slf4j.Logger;
12   -import org.slf4j.LoggerFactory;
13   -import org.springframework.beans.factory.annotation.Autowired;
14   -import org.springframework.stereotype.Component;
15   -
16   -import java.util.*;
17   -
18   -/**
19   - * 对停车场开放的班次调度服务
20   - * Created by panzhao on 2018/3/22.
21   - */
22   -@Component
23   -public class TccExternalService {
24   -
25   - Logger logger = LoggerFactory.getLogger(TccExternalService.class);
26   -
27   - @Autowired
28   - DayOfSchedule dayOfSchedule;
29   -
30   - @Autowired
31   - ScheduleRealInfoService scheduleRealInfoService;
32   -
33   - @Autowired
34   - SendUtils sendUtils;
35   -
36   - /**
37   - * 待发调整
38   - *
39   - * @param dad
40   - * @return
41   - */
42   - public Map<String, Object> dftz(DftzAndDestroy dad) {
43   - Map<String, Object> rs = new HashMap();
44   - rs.put("status", ResponseCode.ERROR);
45   - try {
46   - List<ScheduleRealInfo> updateList = new ArrayList<>();//要刷新的班次
47   - ScheduleRealInfo sch = dayOfSchedule.get(dad.getDftzId());
48   - if (null == sch) {
49   - rs.put("msg", "班次已经不存在了!");
50   - return rs;
51   - }
52   -
53   - if (!sch.getBcType().equals("out")) {
54   - rs.put("msg", "只能操作出场班次!");
55   - return rs;
56   - }
57   -
58   - //调整待发时间
59   - scheduleRealInfoService.outgoAdjust(sch.getId(), dad.getRemarks(), dad.getNewTimeStr(), sch.getBcType(), "4", dad.getUserId());
60   - updateList.add(sch);
61   -
62   - //需要烂班的班次
63   - if (StringUtils.isNotEmpty(dad.getDestroyIdx())) {
64   - Map<String, Object> dMap =
65   - scheduleRealInfoService.destroy(dad.getDestroyIdx(), dad.getRemarks(), dad.getReason(), dad.getUserId());
66   -
67   -
68   - updateList.addAll((Collection<? extends ScheduleRealInfo>) dMap.get("ts"));
69   - }
70   -
71   - //通知调度客户端更新班次信息
72   - sendUpdate2Page(updateList);
73   -
74   - rs.put("status", ResponseCode.SUCCESS);
75   - rs.put("t", sch);
76   - } catch (Exception e) {
77   - rs.put("msg", "内部调度服务接口出现异常!");
78   - logger.error("", e);
79   - }
80   - return rs;
81   - }
82   -
83   - /**
84   - * 换人换车
85   - *
86   - * @param cpcs
87   - * @return
88   - */
89   - public Map<String, Object> hrhc(List<ChangePersonCar> cpcs,String tccCode, String userId) {
90   - Map<String, Object> rs = new HashMap();
91   - rs.put("status", ResponseCode.ERROR);
92   - try {
93   - rs = scheduleRealInfoService.multi_tzrc(cpcs, userId);
94   -
95   - //通知调度客户端更新班次信息
96   - sendUpdate2Page(new ArrayList<ScheduleRealInfo>((Set)rs.get("ts")));
97   -
98   - //返回更新结果集中指定停车场的进出场班次
99   - Set<ScheduleRealInfo> ts = (Set<ScheduleRealInfo>) rs.get("ts");
100   - List<ScheduleRealInfo> list = new ArrayList<>();
101   - for(ScheduleRealInfo sch : ts){
102   - if((sch.getBcType().equals("out") && sch.getQdzCode().equals(tccCode))
103   - || (sch.getBcType().equals("in") && sch.getZdzCode().equals(tccCode)))
104   - list.add(sch);
105   - }
106   - rs.put("list", list);
107   - rs.remove("ts");
108   - } catch (Exception e) {
109   - rs.put("msg", "服务器出现异常!");
110   - logger.error("", e);
111   - }
112   - return rs;
113   - }
114   -
115   -
116   - public void sendUpdate2Page(List<ScheduleRealInfo> list) {
117   - sendUtils.refreshSch(list);
118   - }
119   -}
  1 +package com.bsth.data.schedule.external;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.realcontrol.dto.ChangePersonCar;
  5 +import com.bsth.controller.realcontrol.dto.DftzAndDestroy;
  6 +import com.bsth.data.schedule.DayOfSchedule;
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  8 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  9 +import com.bsth.websocket.handler.SendUtils;
  10 +import org.apache.commons.lang3.StringUtils;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.stereotype.Component;
  15 +
  16 +import java.util.*;
  17 +
  18 +/**
  19 + * 对停车场开放的班次调度服务
  20 + * Created by panzhao on 2018/3/22.
  21 + */
  22 +@Component
  23 +public class TccExternalService {
  24 +
  25 + Logger logger = LoggerFactory.getLogger(TccExternalService.class);
  26 +
  27 + @Autowired
  28 + DayOfSchedule dayOfSchedule;
  29 +
  30 + @Autowired
  31 + ScheduleRealInfoService scheduleRealInfoService;
  32 +
  33 + @Autowired
  34 + SendUtils sendUtils;
  35 +
  36 + /**
  37 + * 待发调整
  38 + *
  39 + * @param dad
  40 + * @return
  41 + */
  42 + public Map<String, Object> dftz(DftzAndDestroy dad) {
  43 + Map<String, Object> rs = new HashMap();
  44 + rs.put("status", ResponseCode.ERROR);
  45 + try {
  46 + List<ScheduleRealInfo> updateList = new ArrayList<>();//要刷新的班次
  47 + ScheduleRealInfo sch = dayOfSchedule.get(dad.getDftzId());
  48 + if (null == sch) {
  49 + rs.put("msg", "班次已经不存在了!");
  50 + return rs;
  51 + }
  52 +
  53 + if (!sch.getBcType().equals("out")) {
  54 + rs.put("msg", "只能操作出场班次!");
  55 + return rs;
  56 + }
  57 +
  58 + //调整待发时间
  59 + scheduleRealInfoService.outgoAdjust(sch.getId(), dad.getRemarks(), dad.getNewTimeStr(), sch.getBcType(), "4", dad.getUserId());
  60 + updateList.add(sch);
  61 +
  62 + //需要烂班的班次
  63 + if (StringUtils.isNotEmpty(dad.getDestroyIdx())) {
  64 + Map<String, Object> dMap =
  65 + scheduleRealInfoService.destroy(dad.getDestroyIdx(), dad.getRemarks(), dad.getReason(), dad.getUserId());
  66 +
  67 +
  68 + updateList.addAll((Collection<? extends ScheduleRealInfo>) dMap.get("ts"));
  69 + }
  70 +
  71 + //通知调度客户端更新班次信息
  72 + sendUpdate2Page(updateList);
  73 +
  74 + rs.put("status", ResponseCode.SUCCESS);
  75 + rs.put("t", sch);
  76 + } catch (Exception e) {
  77 + rs.put("msg", "内部调度服务接口出现异常!");
  78 + logger.error("", e);
  79 + }
  80 + return rs;
  81 + }
  82 +
  83 + /**
  84 + * 换人换车
  85 + *
  86 + * @param cpcs
  87 + * @return
  88 + */
  89 + public Map<String, Object> hrhc(List<ChangePersonCar> cpcs,String tccCode, String userId) {
  90 + Map<String, Object> rs = new HashMap();
  91 + rs.put("status", ResponseCode.ERROR);
  92 + try {
  93 + rs = scheduleRealInfoService.multi_tzrc(cpcs, userId);
  94 +
  95 + //通知调度客户端更新班次信息
  96 + sendUpdate2Page(new ArrayList<ScheduleRealInfo>((Set)rs.get("ts")));
  97 +
  98 + //返回更新结果集中指定停车场的进出场班次
  99 + Set<ScheduleRealInfo> ts = (Set<ScheduleRealInfo>) rs.get("ts");
  100 + List<ScheduleRealInfo> list = new ArrayList<>();
  101 + for(ScheduleRealInfo sch : ts){
  102 + if((sch.getBcType().equals("out") && sch.getQdzCode().equals(tccCode))
  103 + || (sch.getBcType().equals("in") && sch.getZdzCode().equals(tccCode)))
  104 + list.add(sch);
  105 + }
  106 + rs.put("list", list);
  107 + rs.remove("ts");
  108 + } catch (Exception e) {
  109 + rs.put("msg", "服务器出现异常!");
  110 + logger.error("", e);
  111 + }
  112 + return rs;
  113 + }
  114 +
  115 +
  116 + public void sendUpdate2Page(List<ScheduleRealInfo> list) {
  117 + sendUtils.refreshSch(list);
  118 + }
  119 +}
... ...
src/main/java/com/bsth/service/calc/CalcWaybillService.java
... ... @@ -32,6 +32,8 @@ public interface CalcWaybillService extends BaseService&lt;CalcWaybill, Integer&gt; {
32 32  
33 33 List<CalcStatistics> calcStatisticsDaily(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
34 34  
  35 + List<Map<String, Object>> calcStatisticsDaily2(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
  36 +
35 37 Map<String, Object> calcLineMileage(String date, String line);
36 38  
37 39 Map<String, Object> calcBusMileage(String date, String line);
... ...
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.calc.impl;
2 2  
3 3 import java.sql.ResultSet;
4 4 import java.sql.SQLException;
  5 +import java.text.ParseException;
5 6 import java.text.SimpleDateFormat;
6 7 import java.util.ArrayList;
7 8 import java.util.Calendar;
... ... @@ -37,6 +38,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
37 38 import com.bsth.service.calc.CalcToolService;
38 39 import com.bsth.service.calc.CalcWaybillService;
39 40 import com.bsth.service.impl.BaseServiceImpl;
  41 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
40 42 import com.bsth.service.report.CulateMileageService;
41 43 import com.bsth.service.report.ReportService;
42 44 import com.bsth.util.Arith;
... ... @@ -81,6 +83,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
81 83 private CulateMileageService culateService;
82 84  
83 85 @Autowired
  86 + private ScheduleRealInfoService scheduleRealInfoService;
  87 +
  88 + @Autowired
84 89 private ScheduleRealInfoRepository scheduleRealInfoRepository;
85 90  
86 91 @Autowired
... ... @@ -850,6 +855,360 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
850 855  
851 856 return resList;
852 857 }
  858 +
  859 + @Override
  860 + public List<Map<String, Object>> calcStatisticsDaily2(String gsdm, String fgsdm,
  861 + String line, String date, String date2, String xlName, String type) {
  862 + // TODO Auto-generated method stub
  863 + SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd");
  864 + Date beginDate = new Date();
  865 + Calendar calendar = Calendar.getInstance();
  866 + calendar.setTime(beginDate);
  867 + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 4);
  868 + String d2 = dft.format(calendar.getTime()); //当前日期前4天
  869 + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) +1);
  870 + String d3= dft.format(calendar.getTime()); //当前日期前3天
  871 +
  872 + String d1="";
  873 + String d4="";
  874 + try {
  875 + long t3 = dft.parse(d2).getTime();
  876 + long t1=dft.parse(date).getTime();
  877 + long t2=dft.parse(date2).getTime();
  878 +
  879 + if(t1<=t3 && t2>t3){
  880 + //所选日期区间区间既有实时数据也有历史数据
  881 + d1=date;
  882 + d4=date2;
  883 + } else if (t1>t3&&t2>t3){
  884 + d1=date;
  885 + d2=date2;
  886 + d3=date;
  887 + d4=date2;
  888 + }else{
  889 + d1=date;
  890 + d2=date2;
  891 + //实时数据无需
  892 + d3="";
  893 + d4="";
  894 + }
  895 + } catch (ParseException e1) {
  896 + // TODO Auto-generated catch block
  897 + e1.printStackTrace();
  898 + }
  899 +
  900 +
  901 + List<CalcStatistics> list = new ArrayList<CalcStatistics>();
  902 + if(line.length() > 0){
  903 + list = calcStatisticsRepository.selectByDateAndLineTj2(line, d1, d2);
  904 + } else {
  905 + list = calcStatisticsRepository.selectByDateAndLineTj(line, d1, d2, gsdm, fgsdm);
  906 + }
  907 +
  908 + List<CalcStatistics> resList = new ArrayList<CalcStatistics>();
  909 + Map<String, List<CalcStatistics>> keyMap = new HashMap<String, List<CalcStatistics>>();
  910 + List<String> keyList = new ArrayList<String>();
  911 +
  912 + for(CalcStatistics s : list){
  913 + try {
  914 + String key = PinyinHelper.convertToPinyinString(s.getXlName(), "" , PinyinFormat.WITHOUT_TONE);
  915 + if(!keyMap.containsKey(key)){
  916 + keyMap.put(key, new ArrayList<CalcStatistics>());
  917 + keyList.add(key);
  918 + }
  919 + keyMap.get(key).add(s);
  920 + } catch (PinyinException e) {
  921 + // TODO Auto-generated catch block
  922 + e.printStackTrace();
  923 + }
  924 + }
  925 + Collections.sort(keyList, new AccountXlbmStr());
  926 +
  927 + for(String key : keyList){
  928 + if(keyMap.get(key).size() > 0){
  929 + CalcStatistics s = keyMap.get(key).get(0);
  930 + if(keyMap.get(key).size() > 1)
  931 + for(int i = 1; i < keyMap.get(key).size(); i++){
  932 + CalcStatistics s_ = keyMap.get(key).get(i);
  933 + s = addStatistics(s, s_);
  934 + }
  935 + resList.add(s);
  936 + }
  937 + }
  938 +
  939 + if(resList.size() > 0){
  940 + CalcStatistics temp = new CalcStatistics();
  941 + temp.setXlName("合计");
  942 + temp.setXl("hj");
  943 + for(CalcStatistics s : resList){
  944 + temp = addStatistics(temp, s);
  945 + }
  946 + resList.add(temp);
  947 + }
  948 + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
  949 + for(CalcStatistics c : resList){
  950 + Map<String, Object> m = new HashMap<String, Object>();
  951 + m.put("xlBm", c.getXl());
  952 + m.put("xlName", c.getXlName());
  953 + m.put("jhzlc", c.getJhzlc());
  954 + m.put("jhlc", c.getJhyylc());
  955 + m.put("jcclc", c.getJhkslc());
  956 + m.put("sjzgl", c.getSjzlc());
  957 + m.put("sjgl", c.getSjyylc());
  958 + m.put("sjksgl", c.getSjkslc());
  959 + m.put("ssgl", c.getSslc());
  960 + m.put("ssbc", c.getSsbc());
  961 + m.put("ssgl_lz", c.getLzlc());
  962 + m.put("ssgl_dm", c.getDmlc());
  963 + m.put("ssgl_gz", c.getGzlc());
  964 + m.put("ssgl_jf", c.getJflc());
  965 + m.put("ssgl_zs", c.getZslc());
  966 + m.put("ssgl_qr", c.getQrlc());
  967 + m.put("ssgl_qc", c.getQclc());
  968 + m.put("ssgl_kx", c.getKxlc());
  969 + m.put("ssgl_qh", c.getQhlc());
  970 + m.put("ssgl_yw", c.getYwlc());
  971 + m.put("ssgl_other", c.getQtlc());
  972 + m.put("ljgl", c.getLjlc());
  973 + m.put("jhbc", c.getJhbcq());
  974 + m.put("jhbc_m", c.getJhbcz());
  975 + m.put("jhbc_a", c.getJhbcw());
  976 + m.put("sjbc", c.getSjbcq());
  977 + m.put("sjbc_m", c.getSjbcz());
  978 + m.put("sjbc_a", c.getSjbcw());
  979 + m.put("ljbc", c.getLjbcq());
  980 + m.put("ljbc_m", c.getLjbcz());
  981 + m.put("ljbc_a", c.getLjbcw());
  982 + m.put("fzbc", c.getFzbcq());
  983 + m.put("fzbc_m", c.getFzbcz());
  984 + m.put("fzbc_a", c.getFzbcw());
  985 + m.put("dtbc", c.getDtbcq());
  986 + m.put("dtbc_m", c.getDtbcz());
  987 + m.put("dtbc_a", c.getDtbcw());
  988 + m.put("djg", c.getDjgq());
  989 + m.put("djg_m", c.getDjgz());
  990 + m.put("djg_a", c.getDjgw());
  991 + m.put("djg_time", c.getDjgsj());
  992 + double jl = Arith.sub(Arith.add(m.get("jhlc"), m.get("ljgl")), m.get("ssgl"));
  993 + if (jl == Double.parseDouble(m.get("sjgl").toString())) {
  994 + m.put("zt", 0);
  995 + } else {
  996 + m.put("zt", 1);
  997 + }
  998 + mapList.add(m);
  999 + }
  1000 +
  1001 + List<Map<String, Object>> tjlist=new ArrayList<Map<String, Object>>();
  1002 + if(!d4.equals("")){
  1003 + tjlist= scheduleRealInfoService.statisticsDailyTjHb(gsdm, fgsdm, line, d3, d4, xlName, type);
  1004 + }
  1005 + List<Map<String, Object>> mapListHj = new ArrayList<Map<String, Object>>();
  1006 +
  1007 + if(mapList.size()>0){
  1008 + if(tjlist.size()>0){
  1009 + for ( int i=0;i<tjlist.size();i++) {
  1010 + Map<String, Object> tjMap =tjlist.get(i);
  1011 + boolean fage=true;
  1012 + for(int j=0;j<mapList.size();j++){
  1013 + Map<String, Object> lsMap=mapList.get(j);
  1014 + if(lsMap.get("xlBm").toString().equals(tjMap.get("xlBm").toString())){
  1015 + Map<String, Object> hjMap=new HashMap<String,Object>();
  1016 + hjMap.put("xlBm", tjMap.get("xlBm"));
  1017 + hjMap.put("xlName", tjMap.get("xlName"));
  1018 + hjMap.put("jhzlc", Arith.add(lsMap.get("jhzlc"), tjMap.get("jhzlc")));
  1019 + hjMap.put("jhlc", Arith.add(lsMap.get("jhlc"), tjMap.get("jhlc")));
  1020 + hjMap.put("jcclc",Arith.add(lsMap.get("jcclc"), tjMap.get("jcclc")));
  1021 + hjMap.put("sjzgl",Arith.add(lsMap.get("sjzgl"), tjMap.get("sjzgl")));
  1022 + hjMap.put("sjgl", Arith.add(lsMap.get("sjgl"), tjMap.get("sjgl")));
  1023 + hjMap.put("sjksgl", Arith.add(lsMap.get("sjksgl"), tjMap.get("sjksgl")));
  1024 + hjMap.put("ssgl", Arith.add(lsMap.get("ssgl"), tjMap.get("ssgl")));
  1025 + hjMap.put("ssbc", Integer.parseInt(lsMap.get("ssbc").toString())+Integer.parseInt(tjMap.get("ssbc").toString()));
  1026 + hjMap.put("ssgl_lz", Arith.add(lsMap.get("ssgl_lz"), tjMap.get("ssgl_lz")));
  1027 + hjMap.put("ssgl_dm", Arith.add(lsMap.get("ssgl_dm"), tjMap.get("ssgl_dm")));
  1028 + hjMap.put("ssgl_gz", Arith.add(lsMap.get("ssgl_gz"), tjMap.get("ssgl_gz")));
  1029 + hjMap.put("ssgl_jf", Arith.add(lsMap.get("ssgl_jf"), tjMap.get("ssgl_jf")));
  1030 + hjMap.put("ssgl_zs", Arith.add(lsMap.get("ssgl_zs"), tjMap.get("ssgl_zs")));
  1031 + hjMap.put("ssgl_qr", Arith.add(lsMap.get("ssgl_qr"), tjMap.get("ssgl_qr")));
  1032 + hjMap.put("ssgl_qc", Arith.add(lsMap.get("ssgl_qc"), tjMap.get("ssgl_qc")));
  1033 + hjMap.put("ssgl_kx", Arith.add(lsMap.get("ssgl_kx"), tjMap.get("ssgl_kx")));
  1034 + hjMap.put("ssgl_qh", Arith.add(lsMap.get("ssgl_qh"), tjMap.get("ssgl_qh")));
  1035 + hjMap.put("ssgl_yw", Arith.add(lsMap.get("ssgl_yw"), tjMap.get("ssgl_yw")));
  1036 + hjMap.put("ssgl_other", Arith.add(lsMap.get("ssgl_other"), tjMap.get("ssgl_other")));
  1037 + hjMap.put("ljgl", Arith.add(lsMap.get("ljgl"), tjMap.get("ljgl")));
  1038 + hjMap.put("jhbc", Integer.parseInt(lsMap.get("jhbc").toString())+ Integer.parseInt(tjMap.get("jhbc").toString()));
  1039 + hjMap.put("jhbc_m", Integer.parseInt(lsMap.get("jhbc_m").toString())+Integer.parseInt(tjMap.get("jhbc_m").toString()));
  1040 + hjMap.put("jhbc_a", Integer.parseInt(lsMap.get("jhbc_a").toString())+ Integer.parseInt(tjMap.get("jhbc_a").toString()));
  1041 + hjMap.put("sjbc", Integer.parseInt(lsMap.get("sjbc").toString())+ Integer.parseInt(tjMap.get("sjbc").toString()));
  1042 + hjMap.put("sjbc_m",Integer.parseInt(lsMap.get("sjbc_m").toString())+ Integer.parseInt(tjMap.get("sjbc_m").toString()));
  1043 + hjMap.put("sjbc_a", Integer.parseInt(lsMap.get("sjbc_a").toString())+ Integer.parseInt(tjMap.get("sjbc_a").toString()));
  1044 + hjMap.put("ljbc", Integer.parseInt(lsMap.get("ljbc").toString())+ Integer.parseInt(tjMap.get("ljbc").toString()));
  1045 + hjMap.put("ljbc_m", Integer.parseInt(lsMap.get("ljbc_m").toString())+ Integer.parseInt(tjMap.get("ljbc_m").toString()));
  1046 + hjMap.put("ljbc_a", Integer.parseInt(lsMap.get("ljbc_a").toString())+Integer.parseInt( tjMap.get("ljbc_a").toString()));
  1047 + hjMap.put("fzbc", Integer.parseInt(lsMap.get("fzbc").toString())+ Integer.parseInt(tjMap.get("fzbc").toString()));
  1048 + hjMap.put("fzbc_m",Integer.parseInt(lsMap.get("fzbc_m").toString())+ Integer.parseInt(tjMap.get("fzbc_m").toString()));
  1049 + hjMap.put("fzbc_a",Integer.parseInt(lsMap.get("fzbc_a").toString())+ Integer.parseInt(tjMap.get("fzbc_a").toString()));
  1050 + hjMap.put("dtbc", Integer.parseInt(lsMap.get("dtbc").toString())+ Integer.parseInt(tjMap.get("dtbc").toString()));
  1051 + hjMap.put("dtbc_m", Integer.parseInt(lsMap.get("dtbc_m").toString())+ Integer.parseInt(tjMap.get("dtbc_m").toString()));
  1052 + hjMap.put("dtbc_a", Integer.parseInt(lsMap.get("dtbc_a").toString())+ Integer.parseInt(tjMap.get("dtbc_a").toString()));
  1053 + hjMap.put("djg", Integer.parseInt(lsMap.get("djg").toString())+ Integer.parseInt(tjMap.get("djg").toString()));
  1054 + hjMap.put("djg_m", Integer.parseInt(lsMap.get("djg_m").toString())+ Integer.parseInt(tjMap.get("djg_m").toString()));
  1055 + hjMap.put("djg_a", Integer.parseInt(lsMap.get("djg_a").toString())+ Integer.parseInt(tjMap.get("djg_a").toString()));
  1056 + if(Arith.add(lsMap.get("djg_time"),0)>Arith.add(tjMap.get("djg_time"), 0)){
  1057 + hjMap.put("djg_time", lsMap.get("djg_time"));
  1058 + }else{
  1059 + hjMap.put("djg_time",tjMap.get("djg_time"));
  1060 + }
  1061 +
  1062 + double jl = Arith.sub(Arith.add(hjMap.get("jhlc"), hjMap.get("ljgl")), hjMap.get("ssgl"));
  1063 + if (jl == Double.parseDouble(hjMap.get("sjgl").toString())) {
  1064 + hjMap.put("zt", 0);
  1065 + } else {
  1066 + hjMap.put("zt", 1);
  1067 + }
  1068 + mapListHj.add(hjMap);
  1069 + fage=false;
  1070 + }
  1071 + }
  1072 +
  1073 + if(fage){
  1074 + Map<String, Object> m = new HashMap<String, Object>();
  1075 + m.put("xlBm", tjMap.get("xlBm"));
  1076 + m.put("xlName", tjMap.get("xlName"));
  1077 + m.put("jhzlc", tjMap.get("jhzlc"));
  1078 + m.put("jhlc", tjMap.get("jhlc"));
  1079 + m.put("jcclc", tjMap.get("jcclc"));
  1080 + m.put("sjzgl",tjMap.get("sjzgl"));
  1081 + m.put("sjgl", tjMap.get("sjgl"));
  1082 + m.put("sjksgl", tjMap.get("sjksgl"));
  1083 + m.put("ssgl", tjMap.get("ssgl"));
  1084 + m.put("ssbc", tjMap.get("ssbc"));
  1085 + m.put("ssgl_lz", tjMap.get("ssgl_lz"));
  1086 + m.put("ssgl_dm", tjMap.get("ssgl_dm"));
  1087 + m.put("ssgl_gz", tjMap.get("ssgl_gz"));
  1088 + m.put("ssgl_jf", tjMap.get("ssgl_jf"));
  1089 + m.put("ssgl_zs", tjMap.get("ssgl_zs"));
  1090 + m.put("ssgl_qr", tjMap.get("ssgl_qr"));
  1091 + m.put("ssgl_qc", tjMap.get("ssgl_qc"));
  1092 + m.put("ssgl_kx", tjMap.get("ssgl_kx"));
  1093 + m.put("ssgl_qh", tjMap.get("ssgl_qh"));
  1094 + m.put("ssgl_yw", tjMap.get("ssgl_yw"));
  1095 + m.put("ssgl_other", tjMap.get("ssgl_other"));
  1096 + m.put("ljgl", tjMap.get("ljgl"));
  1097 + m.put("jhbc", tjMap.get("jhbc"));
  1098 + m.put("jhbc_m", tjMap.get("jhbc_m"));
  1099 + m.put("jhbc_a", tjMap.get("jhbc_a"));
  1100 + m.put("sjbc", tjMap.get("sjbc"));
  1101 + m.put("sjbc_m",tjMap.get("sjbc_m"));
  1102 + m.put("sjbc_a", tjMap.get("sjbc_a"));
  1103 + m.put("ljbc", tjMap.get("ljbc"));
  1104 + m.put("ljbc_m", tjMap.get("ljbc_m"));
  1105 + m.put("ljbc_a",tjMap.get("ljbc_a"));
  1106 + m.put("fzbc", tjMap.get("fzbc"));
  1107 + m.put("fzbc_m", tjMap.get("fzbc_m"));
  1108 + m.put("fzbc_a",tjMap.get("fzbc_a"));
  1109 + m.put("dtbc", tjMap.get("dtbc"));
  1110 + m.put("dtbc_m", tjMap.get("dtbc_m"));
  1111 + m.put("dtbc_a", tjMap.get("dtbc_a"));
  1112 + m.put("djg", tjMap.get("djg"));
  1113 + m.put("djg_m", tjMap.get("djg_m"));
  1114 + m.put("djg_a", tjMap.get("djg_a"));
  1115 + m.put("djg_time", tjMap.get("djg_time"));
  1116 + double jl = Arith.sub(Arith.add(m.get("jhlc"), m.get("ljgl")), m.get("ssgl"));
  1117 + if (jl == Double.parseDouble(m.get("sjgl").toString())) {
  1118 + m.put("zt", 0);
  1119 + } else {
  1120 + m.put("zt", 1);
  1121 + }
  1122 + mapListHj.add(m);
  1123 + }
  1124 + }
  1125 + }else{
  1126 + mapListHj.addAll(mapList);
  1127 + }
  1128 + }else{
  1129 + for (int i=0;i<tjlist.size();i++) {
  1130 + Map<String, Object> tjMap =tjlist.get(i);
  1131 + Map<String, Object> m = new HashMap<String, Object>();
  1132 + m.put("xlBm", tjMap.get("xlBm"));
  1133 + m.put("xlName", tjMap.get("xlName"));
  1134 + m.put("jhzlc", tjMap.get("jhzlc"));
  1135 + m.put("jhlc", tjMap.get("jhlc"));
  1136 + m.put("jcclc", tjMap.get("jcclc"));
  1137 + m.put("sjzgl",tjMap.get("sjzgl"));
  1138 + m.put("sjgl", tjMap.get("sjgl"));
  1139 + m.put("sjksgl", tjMap.get("sjksgl"));
  1140 + m.put("ssgl", tjMap.get("ssgl"));
  1141 + m.put("ssbc", tjMap.get("ssbc"));
  1142 + m.put("ssgl_lz", tjMap.get("ssgl_lz"));
  1143 + m.put("ssgl_dm", tjMap.get("ssgl_dm"));
  1144 + m.put("ssgl_gz", tjMap.get("ssgl_gz"));
  1145 + m.put("ssgl_jf", tjMap.get("ssgl_jf"));
  1146 + m.put("ssgl_zs", tjMap.get("ssgl_zs"));
  1147 + m.put("ssgl_qr", tjMap.get("ssgl_qr"));
  1148 + m.put("ssgl_qc", tjMap.get("ssgl_qc"));
  1149 + m.put("ssgl_kx", tjMap.get("ssgl_kx"));
  1150 + m.put("ssgl_qh", tjMap.get("ssgl_qh"));
  1151 + m.put("ssgl_yw", tjMap.get("ssgl_yw"));
  1152 + m.put("ssgl_other", tjMap.get("ssgl_other"));
  1153 + m.put("ljgl", tjMap.get("ljgl"));
  1154 + m.put("jhbc", tjMap.get("jhbc"));
  1155 + m.put("jhbc_m", tjMap.get("jhbc_m"));
  1156 + m.put("jhbc_a", tjMap.get("jhbc_a"));
  1157 + m.put("sjbc", tjMap.get("sjbc"));
  1158 + m.put("sjbc_m",tjMap.get("sjbc_m"));
  1159 + m.put("sjbc_a", tjMap.get("sjbc_a"));
  1160 + m.put("ljbc", tjMap.get("ljbc"));
  1161 + m.put("ljbc_m", tjMap.get("ljbc_m"));
  1162 + m.put("ljbc_a",tjMap.get("ljbc_a"));
  1163 + m.put("fzbc", tjMap.get("fzbc"));
  1164 + m.put("fzbc_m", tjMap.get("fzbc_m"));
  1165 + m.put("fzbc_a",tjMap.get("fzbc_a"));
  1166 + m.put("dtbc", tjMap.get("dtbc"));
  1167 + m.put("dtbc_m", tjMap.get("dtbc_m"));
  1168 + m.put("dtbc_a", tjMap.get("dtbc_a"));
  1169 + m.put("djg", tjMap.get("djg"));
  1170 + m.put("djg_m", tjMap.get("djg_m"));
  1171 + m.put("djg_a", tjMap.get("djg_a"));
  1172 + m.put("djg_time", tjMap.get("djg_time"));
  1173 + double jl = Arith.sub(Arith.add(m.get("jhlc"), m.get("ljgl")), m.get("ssgl"));
  1174 + if (jl == Double.parseDouble(m.get("sjgl").toString())) {
  1175 + m.put("zt", 0);
  1176 + } else {
  1177 + m.put("zt", 1);
  1178 + }
  1179 + mapListHj.add(m);
  1180 +
  1181 + }
  1182 + }
  1183 +
  1184 + if (type != null && type.length() != 0 && type.equals("export")) {
  1185 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  1186 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  1187 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1188 + Map<String, Object> m = new HashMap<String, Object>();
  1189 + m.put("date", date+"至"+date2);
  1190 + ReportUtils ee = new ReportUtils();
  1191 + try {
  1192 + String dateTime = "";
  1193 + if(date.equals(date2)){
  1194 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  1195 + } else {
  1196 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  1197 + +"-"+sdfSimple.format(sdfMonth.parse(date2));
  1198 + }
  1199 + listI.add(mapListHj.iterator());
  1200 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1201 + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
  1202 + path + "export/" + dateTime + "-" + xlName + "-统计日报.xls");
  1203 + } catch (Exception e) {
  1204 + // TODO: handle exception
  1205 + //e.printStackTrace();
  1206 + logger.info("" , e);
  1207 + }
  1208 + }
  1209 +
  1210 + return mapListHj;
  1211 + }
853 1212  
854 1213 public CalcStatistics addStatistics(CalcStatistics s, CalcStatistics s_){
855 1214 s.setJhzlc(Arith.add(s.getJhzlc()!=null?s.getJhzlc():0, s_.getJhzlc()));
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -119,6 +119,9 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
119 119  
120 120 List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type);
121 121  
  122 + //用于实时数据与统计数据合并查询
  123 + List<Map<String,Object>> statisticsDailyTjHb(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type);
  124 +
122 125 //List<Object> scheduleDaily(String line,String date);
123 126  
124 127 int countByLineCodeAndDate(String xlBm, String schDate);
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -2666,6 +2666,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2666 2666 }
2667 2667 Map<String, Object> map = new HashMap<String, Object>();
2668 2668 if (list.size() > 0) {
  2669 + map.put("xlBm", list.get(0).getXlBm());
2669 2670 map.put("xlName", list.get(0).getXlName());
2670 2671 try {
2671 2672 map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getXlName(), "", PinyinFormat.WITHOUT_TONE));
... ... @@ -2914,6 +2915,148 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2914 2915 }
2915 2916  
2916 2917 @Override
  2918 + public List<Map<String, Object>> statisticsDailyTjHb(String gsdm, String fgsdm, String line, String date, String date2,
  2919 + String xlName, String type) {
  2920 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2921 + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
  2922 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  2923 + line = line.trim();
  2924 + if (line.equals("")) {
  2925 + //查询所有线路
  2926 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  2927 + } else {
  2928 + //查询单条线路
  2929 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
  2930 + }
  2931 + for (int i = 0; i < list.size(); i++) {
  2932 + ScheduleRealInfo s = list.get(i);
  2933 + Set<ChildTaskPlan> cts = s.getcTasks();
  2934 + if (cts != null && cts.size() > 0) {
  2935 + list_s.add(s);
  2936 + } else {
  2937 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  2938 + list_s.add(s);
  2939 + }
  2940 + }
  2941 + }
  2942 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2943 + for (int i = 0; i < list.size(); i++) {
  2944 + if (i < list.size() - 1) {
  2945 + if (list.get(i + 1).getXlBm().equals(list.get(i).getXlBm())) {
  2946 + lists.add(list.get(i));
  2947 + } else {
  2948 + lists.add(list.get(i));
  2949 + Map<String, Object> map = staticTj(lists);
  2950 + lMap.add(map);
  2951 + lists = new ArrayList<ScheduleRealInfo>();
  2952 + }
  2953 + } else {
  2954 + if (list.get(i).getXlBm().equals(list.get(i - 1).getXlBm())) {
  2955 + lists.add(list.get(i));
  2956 + Map<String, Object> map = staticTj(lists);
  2957 + lMap.add(map);
  2958 + } else {
  2959 + lists = new ArrayList<ScheduleRealInfo>();
  2960 + lists.add(list.get(i));
  2961 + Map<String, Object> map = staticTj(lists);
  2962 + lMap.add(map);
  2963 + }
  2964 + }
  2965 + }
  2966 +
  2967 + Collections.sort(lMap, new AccountXlbm());
  2968 + Map<String, Object> map = new HashMap<String, Object>();
  2969 + map.put("xlBm", "hj");
  2970 + map.put("xlName", "合计");
  2971 + double jhyygl = culateService.culateJhgl(list);//计划营运公里
  2972 + double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2973 + map.put("jhlc", jhyygl);
  2974 + map.put("jcclc", jhjcclc);
  2975 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
  2976 +
  2977 + double ljgl = culateService.culateLjgl(list_s);
  2978 + double sjyygl = culateService.culateSjgl(list_s);
  2979 + double zyygl = Arith.add(sjyygl, ljgl);
  2980 +
  2981 + double sjjccgl = culateService.culateJccgl(list_s);
  2982 + double sjksgl = culateService.culateKsgl(list_s);
  2983 + double zksgl = Arith.add(sjjccgl, sjksgl);
  2984 + map.put("sjzgl", Arith.add(zyygl, zksgl));
  2985 + map.put("sjgl", zyygl);
  2986 + map.put("sjksgl", zksgl);
  2987 +
  2988 + double ssgl = culateService.culateLbgl(list);
  2989 + map.put("ssgl", ssgl);
  2990 + //计划+临加-少驶=实驶
  2991 + double jl = Arith.sub(Arith.add(jhyygl, ljgl), ssgl);
  2992 + if (jl == zyygl) {
  2993 + map.put("zt", 0);
  2994 + } else {
  2995 + map.put("zt", 1);
  2996 + }
  2997 + map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
  2998 + map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
  2999 + map.put("ssgl_gz", culateService.culateCJLC(list, "故障"));
  3000 + map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷"));
  3001 + map.put("ssgl_zs", culateService.culateCJLC(list, "肇事"));
  3002 + map.put("ssgl_qr", culateService.culateCJLC(list, "缺人"));
  3003 + map.put("ssgl_qc", culateService.culateCJLC(list, "缺车"));
  3004 + map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
  3005 + map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
  3006 + map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
  3007 + double ssgl_pc = culateService.culateCJLC(list, "配车");
  3008 + double ssgl_by = culateService.culateCJLC(list, "保养");
  3009 + double ssgl_cj = culateService.culateCJLC(list, "抽减");
  3010 + double ssgl_qt = culateService.culateCJLC(list, "其他");
  3011 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
  3012 +
  3013 + map.put("ssbc", culateService.culateLbbc(list));
  3014 + map.put("ljgl", ljgl);
  3015 + map.put("jhbc", culateService.culateJhbc(list, ""));
  3016 + map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
  3017 + map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
  3018 + map.put("sjbc", culateService.culateSjbc(list_s, ""));
  3019 + map.put("sjbc_m", culateService.culateSjbc(list_s, "zgf"));
  3020 + map.put("sjbc_a", culateService.culateSjbc(list_s, "wgf"));
  3021 + map.put("ljbc", culateService.culateLjbc(list_s, ""));
  3022 + map.put("ljbc_m", culateService.culateLjbc(list_s, "zgf"));
  3023 + map.put("ljbc_a", culateService.culateLjbc(list_s, "wgf"));
  3024 + map.put("fzbc", culateService.culateFzbc(list_s, ""));
  3025 + map.put("fzbc_m", culateService.culateFzbc(list_s, "zgf"));
  3026 + map.put("fzbc_a", culateService.culateFzbc(list_s, "wgf"));
  3027 + map.put("dtbc", 0);
  3028 + map.put("dtbc_m", 0);
  3029 + map.put("dtbc_a", 0);
  3030 + if (list.size() > 0) {
  3031 + int djg = 0, djg_m = 0, djg_a = 0, djg_time = 0;
  3032 + for (Map<String, Object> m : lMap) {
  3033 + if (m.containsKey("djg") && m.get("djg") != null)
  3034 + djg += Integer.valueOf(m.get("djg").toString());
  3035 + if (m.containsKey("djg_m") && m.get("djg_m") != null)
  3036 + djg_m += Integer.valueOf(m.get("djg_m").toString());
  3037 + if (m.containsKey("djg_a") && m.get("djg_a") != null)
  3038 + djg_a += Integer.valueOf(m.get("djg_a").toString());
  3039 + if (m.containsKey("djg_time") && m.get("djg_time") != null) {
  3040 + int t = Integer.valueOf(m.get("djg_time").toString());
  3041 + if (t > djg_time)
  3042 + djg_time = t;
  3043 + }
  3044 + }
  3045 + map.put("djg", djg);
  3046 + map.put("djg_m", djg_m);
  3047 + map.put("djg_a", djg_a);
  3048 + map.put("djg_time", djg_time);
  3049 + } else {
  3050 + map.put("djg", "0");
  3051 + map.put("djg_m", "0");
  3052 + map.put("djg_a", "0");
  3053 + map.put("djg_time", "0");
  3054 + }
  3055 + lMap.add(map);
  3056 + return lMap;
  3057 + }
  3058 +
  3059 + @Override
2917 3060 public Map<String, Object> scheduleDaily(String line, String date) {
2918 3061 Map<String, String> tempMap = null;
2919 3062 List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
... ...
src/main/java/com/bsth/service/schedule/datatools/Excel2003PoiOperator.java
1   -package com.bsth.service.schedule.datatools;
2   -
3   -import org.apache.poi.hssf.usermodel.*;
4   -import org.apache.poi.ss.usermodel.*;
5   -import org.apache.poi.ss.util.WorkbookUtil;
6   -import org.apache.poi.xssf.usermodel.XSSFColor;
7   -
8   -import java.awt.Color;
9   -import java.io.File;
10   -import java.io.FileOutputStream;
11   -import java.util.Date;
12   -
13   -/**
14   - * Excel2003表格Poi操作类。
15   - * TODO:2003里面还有很多和2007不通的样式设定方式,以后再改
16   - */
17   -public class Excel2003PoiOperator implements ExcelPoiOperator {
18   - @Override
19   - public Cell createCell(
20   - Workbook workbook, Row row, short columnIndex,
21   - Object value, int valueType,
22   - HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
23   - BorderStyle borderStyle, Color borderColor,
24   - short fontSize, Color fontColor, String fontName,
25   - Color backgroudColor, FillPatternType fillPatternType) {
26   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
27   - HSSFRow hssfRow = (HSSFRow) row;
28   -
29   - CreationHelper creationHelper = hssfWorkbook.getCreationHelper();
30   -
31   - // 1、创建单元格对象
32   - HSSFCell hssfCell = hssfRow.createCell((int) columnIndex);
33   -
34   - // 2、设定样式
35   - HSSFCellStyle hssfCellStyle = hssfWorkbook.createCellStyle();
36   -
37   - // 设定值及数据格式
38   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
39   - if (valueType == HSSFCell.CELL_TYPE_STRING) {
40   - hssfCellStyle.setDataFormat(dataFormat.getFormat("@"));
41   - hssfCell.setCellValue(creationHelper.createRichTextString(String.valueOf(value)));
42   - } else if (valueType == HSSFCell.CELL_TYPE_NUMERIC) {
43   - if (value instanceof Date) { // 日期
44   - hssfCellStyle.setDataFormat(dataFormat.getFormat("yyyy-mm-dd"));
45   - hssfCell.setCellValue((Date) value);
46   - } else if (value instanceof Double) {
47   - hssfCellStyle.setDataFormat(dataFormat.getFormat("0.00"));
48   - hssfCell.setCellValue((Double) value);
49   - } else if (value instanceof Integer) {
50   - hssfCellStyle.setDataFormat(dataFormat.getFormat("0"));
51   - hssfCell.setCellValue(Double.valueOf(value.toString()));
52   - } else {
53   - throw new RuntimeException("Excel2003 只支持 String Date Double Integer 单元格类型");
54   - }
55   - } else if (valueType == HSSFCell.CELL_TYPE_BLANK) {
56   - hssfCell.setCellType(HSSFCell.CELL_TYPE_BLANK);
57   - } else {
58   - throw new RuntimeException("暂时不支持字符串、日期、数字以外的类型");
59   - }
60   -
61   - // 对齐方式
62   - hssfCellStyle.setAlignment((short) horizontalAlignment.ordinal());
63   - hssfCellStyle.setVerticalAlignment((short) verticalAlignment.ordinal());
64   -
65   - // 边框样式
66   - hssfCellStyle.setBorderTop((short) borderStyle.ordinal());
67   - hssfCellStyle.setTopBorderColor(new XSSFColor(borderColor).getIndexed());
68   - hssfCellStyle.setBorderBottom((short) borderStyle.ordinal());
69   - hssfCellStyle.setBottomBorderColor(new XSSFColor(borderColor).getIndexed());
70   - hssfCellStyle.setBorderLeft((short) borderStyle.ordinal());
71   - hssfCellStyle.setLeftBorderColor(new XSSFColor(borderColor).getIndexed());
72   - hssfCellStyle.setBorderRight((short) borderStyle.ordinal());
73   - hssfCellStyle.setRightBorderColor(new XSSFColor(borderColor).getIndexed());
74   -
75   - // 字体颜色
76   -// HSSFFont font = hssfWorkbook.createFont();
77   -// font.setColor(new XSSFColor(fontColor).getIndexed());
78   -// font.setFontHeightInPoints(fontSize);
79   -// font.setFontName(fontName);
80   -// hssfCellStyle.setFont(font);
81   -
82   -
83   - // 单元背景色
84   - hssfCellStyle.setFillForegroundColor(new XSSFColor(backgroudColor).getIndexed());
85   -// hssfCellStyle.setFillPattern((short) fillPatternType.ordinal());
86   -
87   - // TODO
88   -
89   - hssfCell.setCellStyle(hssfCellStyle);
90   - return hssfCell;
91   - }
92   -
93   - @Override
94   - public Cell createStringCell(
95   - Workbook workbook, Row row, short columnIndex,
96   - String value) {
97   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
98   - HSSFRow hssfRow = (HSSFRow) row;
99   -
100   - HSSFCell hssfCell = (HSSFCell) createCell(
101   - hssfWorkbook, hssfRow, columnIndex,
102   - value, HSSFCell.CELL_TYPE_STRING,
103   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
104   - BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
105   - (short) 13, new java.awt.Color(0x2765A7), "宋体",
106   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
107   - );
108   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
109   - hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
110   - return hssfCell;
111   - }
112   -
113   - @Override
114   - public Cell createStringCell(
115   - Workbook workbook, Row row, short columnIndex,
116   - String value,
117   - Color backgroudColor) {
118   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
119   - HSSFRow hssfRow = (HSSFRow) row;
120   -
121   - HSSFCell hssfCell = (HSSFCell) createCell(
122   - hssfWorkbook, hssfRow, columnIndex,
123   - value, HSSFCell.CELL_TYPE_STRING,
124   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
125   - BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
126   - (short) 13, new java.awt.Color(0x2765A7), "宋体",
127   - backgroudColor, FillPatternType.SOLID_FOREGROUND
128   - );
129   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
130   - hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
131   - return hssfCell;
132   - }
133   -
134   - @Override
135   - public Cell createIntegerCell(
136   - Workbook workbook, Row row, short columnIndex,
137   - Integer value) {
138   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
139   - HSSFRow hssfRow = (HSSFRow) row;
140   -
141   - HSSFCell hssfCell = (HSSFCell) createCell(
142   - hssfWorkbook, hssfRow, columnIndex,
143   - value, HSSFCell.CELL_TYPE_NUMERIC,
144   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
145   - BorderStyle.MEDIUM, new Color(0xdedede),
146   - (short) 13, new Color(0x2765A7), "宋体",
147   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
148   - );
149   -
150   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
151   - hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
152   - return hssfCell;
153   - }
154   -
155   - @Override
156   - public Cell createIntegerCell(
157   - Workbook workbook, Row row, short columnIndex,
158   - Integer value,
159   - Color backgroudColor) {
160   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
161   - HSSFRow hssfRow = (HSSFRow) row;
162   -
163   - HSSFCell hssfCell = (HSSFCell) createCell(
164   - hssfWorkbook, hssfRow, columnIndex,
165   - value, HSSFCell.CELL_TYPE_NUMERIC,
166   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
167   - BorderStyle.MEDIUM, new Color(0xdedede),
168   - (short) 13, new Color(0x2765A7), "宋体",
169   - backgroudColor, FillPatternType.SOLID_FOREGROUND
170   - );
171   -
172   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
173   - hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
174   - return hssfCell;
175   - }
176   -
177   - @Override
178   - public Cell createDoubleCell(
179   - Workbook workbook, Row row, short columnIndex,
180   - Double value) {
181   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
182   - HSSFRow hssfRow = (HSSFRow) row;
183   -
184   - HSSFCell hssfCell = (HSSFCell) createCell(
185   - hssfWorkbook, hssfRow, columnIndex,
186   - value, HSSFCell.CELL_TYPE_NUMERIC,
187   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
188   - BorderStyle.MEDIUM, new Color(0xdedede),
189   - (short) 13, new Color(0x2765A7), "宋体",
190   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
191   - );
192   -
193   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
194   - hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
195   - return hssfCell;
196   - }
197   -
198   - @Override
199   - public Cell createDoubleCell(
200   - Workbook workbook, Row row, short columnIndex,
201   - Double value,
202   - Color backgroudColor) {
203   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
204   - HSSFRow hssfRow = (HSSFRow) row;
205   -
206   - HSSFCell hssfCell = (HSSFCell) createCell(
207   - hssfWorkbook, hssfRow, columnIndex,
208   - value, HSSFCell.CELL_TYPE_NUMERIC,
209   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
210   - BorderStyle.MEDIUM, new Color(0xdedede),
211   - (short) 13, new Color(0x2765A7), "宋体",
212   - backgroudColor, FillPatternType.SOLID_FOREGROUND
213   - );
214   -
215   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
216   - hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
217   - return hssfCell;
218   - }
219   -
220   - @Override
221   - public Cell createBlankCell(Workbook workbook, Row row, short columnIndex) {
222   - return createCell(
223   - workbook, row, columnIndex,
224   - null, HSSFCell.CELL_TYPE_BLANK,
225   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
226   - BorderStyle.MEDIUM, new Color(0xdedede),
227   - (short) 13, new Color(0x2765A7), "宋体",
228   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
229   - );
230   - }
231   -
232   - @Override
233   - public Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt) {
234   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
235   - DataFormat dataFormat = hssfWorkbook.createDataFormat();
236   - cell.getCellStyle().setDataFormat(dataFormat.getFormat("fmt"));
237   - return cell;
238   - }
239   -
240   - @Override
241   - public Cell setCellBackground(Cell cell, Color color) {
242   - HSSFCell hssfCell = (HSSFCell) cell;
243   - hssfCell.getCellStyle().setFillForegroundColor(new XSSFColor(color).getIndexed());
244   - return cell;
245   - }
246   -
247   - @Override
248   - public Workbook createWorkBook() {
249   - return new HSSFWorkbook();
250   - }
251   -
252   - @Override
253   - public Sheet createWorkBookSheet(Workbook workbook, String sheetName) {
254   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
255   - return hssfWorkbook.createSheet(WorkbookUtil.createSafeSheetName(sheetName));
256   - }
257   -
258   - @Override
259   - public Row createSheetRow(Sheet sheet, int rowIndex) {
260   - HSSFSheet hssfSheet = (HSSFSheet) sheet;
261   - return hssfSheet.createRow(rowIndex);
262   - }
263   -
264   - @Override
265   - public void writeExcel(File excelFile, Workbook workbook) {
266   - try {
267   - HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
268   - FileOutputStream fileOutputStream = new FileOutputStream(excelFile);
269   - hssfWorkbook.write(fileOutputStream);
270   - } catch (Exception exp) {
271   - throw new RuntimeException(exp);
272   - }
273   - }
274   -}
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import org.apache.poi.hssf.usermodel.*;
  4 +import org.apache.poi.ss.usermodel.*;
  5 +import org.apache.poi.ss.util.WorkbookUtil;
  6 +import org.apache.poi.xssf.usermodel.XSSFColor;
  7 +
  8 +import java.awt.Color;
  9 +import java.io.File;
  10 +import java.io.FileOutputStream;
  11 +import java.util.Date;
  12 +
  13 +/**
  14 + * Excel2003表格Poi操作类。
  15 + * TODO:2003里面还有很多和2007不通的样式设定方式,以后再改
  16 + */
  17 +public class Excel2003PoiOperator implements ExcelPoiOperator {
  18 + @Override
  19 + public Cell createCell(
  20 + Workbook workbook, Row row, short columnIndex,
  21 + Object value, int valueType,
  22 + HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
  23 + BorderStyle borderStyle, Color borderColor,
  24 + short fontSize, Color fontColor, String fontName,
  25 + Color backgroudColor, FillPatternType fillPatternType) {
  26 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  27 + HSSFRow hssfRow = (HSSFRow) row;
  28 +
  29 + CreationHelper creationHelper = hssfWorkbook.getCreationHelper();
  30 +
  31 + // 1、创建单元格对象
  32 + HSSFCell hssfCell = hssfRow.createCell((int) columnIndex);
  33 +
  34 + // 2、设定样式
  35 + HSSFCellStyle hssfCellStyle = hssfWorkbook.createCellStyle();
  36 +
  37 + // 设定值及数据格式
  38 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  39 + if (valueType == HSSFCell.CELL_TYPE_STRING) {
  40 + hssfCellStyle.setDataFormat(dataFormat.getFormat("@"));
  41 + hssfCell.setCellValue(creationHelper.createRichTextString(String.valueOf(value)));
  42 + } else if (valueType == HSSFCell.CELL_TYPE_NUMERIC) {
  43 + if (value instanceof Date) { // 日期
  44 + hssfCellStyle.setDataFormat(dataFormat.getFormat("yyyy-mm-dd"));
  45 + hssfCell.setCellValue((Date) value);
  46 + } else if (value instanceof Double) {
  47 + hssfCellStyle.setDataFormat(dataFormat.getFormat("0.00"));
  48 + hssfCell.setCellValue((Double) value);
  49 + } else if (value instanceof Integer) {
  50 + hssfCellStyle.setDataFormat(dataFormat.getFormat("0"));
  51 + hssfCell.setCellValue(Double.valueOf(value.toString()));
  52 + } else {
  53 + throw new RuntimeException("Excel2003 只支持 String Date Double Integer 单元格类型");
  54 + }
  55 + } else if (valueType == HSSFCell.CELL_TYPE_BLANK) {
  56 + hssfCell.setCellType(HSSFCell.CELL_TYPE_BLANK);
  57 + } else {
  58 + throw new RuntimeException("暂时不支持字符串、日期、数字以外的类型");
  59 + }
  60 +
  61 + // 对齐方式
  62 + hssfCellStyle.setAlignment((short) horizontalAlignment.ordinal());
  63 + hssfCellStyle.setVerticalAlignment((short) verticalAlignment.ordinal());
  64 +
  65 + // 边框样式
  66 + hssfCellStyle.setBorderTop((short) borderStyle.ordinal());
  67 + hssfCellStyle.setTopBorderColor(new XSSFColor(borderColor).getIndexed());
  68 + hssfCellStyle.setBorderBottom((short) borderStyle.ordinal());
  69 + hssfCellStyle.setBottomBorderColor(new XSSFColor(borderColor).getIndexed());
  70 + hssfCellStyle.setBorderLeft((short) borderStyle.ordinal());
  71 + hssfCellStyle.setLeftBorderColor(new XSSFColor(borderColor).getIndexed());
  72 + hssfCellStyle.setBorderRight((short) borderStyle.ordinal());
  73 + hssfCellStyle.setRightBorderColor(new XSSFColor(borderColor).getIndexed());
  74 +
  75 + // 字体颜色
  76 +// HSSFFont font = hssfWorkbook.createFont();
  77 +// font.setColor(new XSSFColor(fontColor).getIndexed());
  78 +// font.setFontHeightInPoints(fontSize);
  79 +// font.setFontName(fontName);
  80 +// hssfCellStyle.setFont(font);
  81 +
  82 +
  83 + // 单元背景色
  84 + hssfCellStyle.setFillForegroundColor(new XSSFColor(backgroudColor).getIndexed());
  85 +// hssfCellStyle.setFillPattern((short) fillPatternType.ordinal());
  86 +
  87 + // TODO
  88 +
  89 + hssfCell.setCellStyle(hssfCellStyle);
  90 + return hssfCell;
  91 + }
  92 +
  93 + @Override
  94 + public Cell createStringCell(
  95 + Workbook workbook, Row row, short columnIndex,
  96 + String value) {
  97 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  98 + HSSFRow hssfRow = (HSSFRow) row;
  99 +
  100 + HSSFCell hssfCell = (HSSFCell) createCell(
  101 + hssfWorkbook, hssfRow, columnIndex,
  102 + value, HSSFCell.CELL_TYPE_STRING,
  103 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  104 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  105 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  106 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  107 + );
  108 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  109 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  110 + return hssfCell;
  111 + }
  112 +
  113 + @Override
  114 + public Cell createStringCell(
  115 + Workbook workbook, Row row, short columnIndex,
  116 + String value,
  117 + Color backgroudColor) {
  118 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  119 + HSSFRow hssfRow = (HSSFRow) row;
  120 +
  121 + HSSFCell hssfCell = (HSSFCell) createCell(
  122 + hssfWorkbook, hssfRow, columnIndex,
  123 + value, HSSFCell.CELL_TYPE_STRING,
  124 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  125 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  126 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  127 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  128 + );
  129 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  130 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  131 + return hssfCell;
  132 + }
  133 +
  134 + @Override
  135 + public Cell createIntegerCell(
  136 + Workbook workbook, Row row, short columnIndex,
  137 + Integer value) {
  138 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  139 + HSSFRow hssfRow = (HSSFRow) row;
  140 +
  141 + HSSFCell hssfCell = (HSSFCell) createCell(
  142 + hssfWorkbook, hssfRow, columnIndex,
  143 + value, HSSFCell.CELL_TYPE_NUMERIC,
  144 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  145 + BorderStyle.MEDIUM, new Color(0xdedede),
  146 + (short) 13, new Color(0x2765A7), "宋体",
  147 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  148 + );
  149 +
  150 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  151 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  152 + return hssfCell;
  153 + }
  154 +
  155 + @Override
  156 + public Cell createIntegerCell(
  157 + Workbook workbook, Row row, short columnIndex,
  158 + Integer value,
  159 + Color backgroudColor) {
  160 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  161 + HSSFRow hssfRow = (HSSFRow) row;
  162 +
  163 + HSSFCell hssfCell = (HSSFCell) createCell(
  164 + hssfWorkbook, hssfRow, columnIndex,
  165 + value, HSSFCell.CELL_TYPE_NUMERIC,
  166 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  167 + BorderStyle.MEDIUM, new Color(0xdedede),
  168 + (short) 13, new Color(0x2765A7), "宋体",
  169 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  170 + );
  171 +
  172 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  173 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  174 + return hssfCell;
  175 + }
  176 +
  177 + @Override
  178 + public Cell createDoubleCell(
  179 + Workbook workbook, Row row, short columnIndex,
  180 + Double value) {
  181 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  182 + HSSFRow hssfRow = (HSSFRow) row;
  183 +
  184 + HSSFCell hssfCell = (HSSFCell) createCell(
  185 + hssfWorkbook, hssfRow, columnIndex,
  186 + value, HSSFCell.CELL_TYPE_NUMERIC,
  187 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  188 + BorderStyle.MEDIUM, new Color(0xdedede),
  189 + (short) 13, new Color(0x2765A7), "宋体",
  190 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  191 + );
  192 +
  193 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  194 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  195 + return hssfCell;
  196 + }
  197 +
  198 + @Override
  199 + public Cell createDoubleCell(
  200 + Workbook workbook, Row row, short columnIndex,
  201 + Double value,
  202 + Color backgroudColor) {
  203 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  204 + HSSFRow hssfRow = (HSSFRow) row;
  205 +
  206 + HSSFCell hssfCell = (HSSFCell) createCell(
  207 + hssfWorkbook, hssfRow, columnIndex,
  208 + value, HSSFCell.CELL_TYPE_NUMERIC,
  209 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  210 + BorderStyle.MEDIUM, new Color(0xdedede),
  211 + (short) 13, new Color(0x2765A7), "宋体",
  212 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  213 + );
  214 +
  215 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  216 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  217 + return hssfCell;
  218 + }
  219 +
  220 + @Override
  221 + public Cell createBlankCell(Workbook workbook, Row row, short columnIndex) {
  222 + return createCell(
  223 + workbook, row, columnIndex,
  224 + null, HSSFCell.CELL_TYPE_BLANK,
  225 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  226 + BorderStyle.MEDIUM, new Color(0xdedede),
  227 + (short) 13, new Color(0x2765A7), "宋体",
  228 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  229 + );
  230 + }
  231 +
  232 + @Override
  233 + public Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt) {
  234 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  235 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  236 + cell.getCellStyle().setDataFormat(dataFormat.getFormat("fmt"));
  237 + return cell;
  238 + }
  239 +
  240 + @Override
  241 + public Cell setCellBackground(Cell cell, Color color) {
  242 + HSSFCell hssfCell = (HSSFCell) cell;
  243 + hssfCell.getCellStyle().setFillForegroundColor(new XSSFColor(color).getIndexed());
  244 + return cell;
  245 + }
  246 +
  247 + @Override
  248 + public Workbook createWorkBook() {
  249 + return new HSSFWorkbook();
  250 + }
  251 +
  252 + @Override
  253 + public Sheet createWorkBookSheet(Workbook workbook, String sheetName) {
  254 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  255 + return hssfWorkbook.createSheet(WorkbookUtil.createSafeSheetName(sheetName));
  256 + }
  257 +
  258 + @Override
  259 + public Row createSheetRow(Sheet sheet, int rowIndex) {
  260 + HSSFSheet hssfSheet = (HSSFSheet) sheet;
  261 + return hssfSheet.createRow(rowIndex);
  262 + }
  263 +
  264 + @Override
  265 + public void writeExcel(File excelFile, Workbook workbook) {
  266 + try {
  267 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  268 + FileOutputStream fileOutputStream = new FileOutputStream(excelFile);
  269 + hssfWorkbook.write(fileOutputStream);
  270 + } catch (Exception exp) {
  271 + throw new RuntimeException(exp);
  272 + }
  273 + }
  274 +}
... ...
src/main/java/com/bsth/service/schedule/datatools/Excel2007PoiOperator.java
1   -package com.bsth.service.schedule.datatools;
2   -
3   -import org.apache.poi.ss.usermodel.*;
4   -import org.apache.poi.ss.util.WorkbookUtil;
5   -import org.apache.poi.xssf.usermodel.*;
6   -
7   -import java.awt.Color;
8   -import java.io.File;
9   -import java.io.FileOutputStream;
10   -import java.util.Date;
11   -
12   -/**
13   - * Excel2007表格Poi操作类。
14   - * TODO:以后测style需要重用
15   - */
16   -public class Excel2007PoiOperator implements ExcelPoiOperator {
17   - @Override
18   - public Cell createCell(
19   - Workbook workbook, Row row, short columnIndex,
20   - Object value, int valueType,
21   - HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
22   - BorderStyle borderStyle, java.awt.Color borderColor,
23   - short fontSize, java.awt.Color fontColor, String fontName,
24   - java.awt.Color backgroudColor, FillPatternType fillPatternType) {
25   -
26   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
27   - XSSFRow xssfRow = (XSSFRow) row;
28   -
29   - CreationHelper creationHelper = xssfWorkbook.getCreationHelper();
30   -
31   - // 1、创建单元格对象
32   - XSSFCell xssfCell = xssfRow.createCell(columnIndex);
33   -
34   - // 2、设定样式
35   - XSSFCellStyle xssfCellStyle = xssfWorkbook.createCellStyle();
36   -
37   - // 设定值及数据格式
38   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
39   - if (valueType == XSSFCell.CELL_TYPE_STRING) {
40   - xssfCellStyle.setDataFormat(dataFormat.getFormat("@"));
41   - xssfCell.setCellValue(creationHelper.createRichTextString(String.valueOf(value)));
42   - } else if (valueType == XSSFCell.CELL_TYPE_NUMERIC) {
43   - if (value instanceof Date) { // 日期
44   - xssfCellStyle.setDataFormat(dataFormat.getFormat("yyyy-mm-dd"));
45   - xssfCell.setCellValue((Date) value);
46   - } else if (value instanceof Double) {
47   - xssfCellStyle.setDataFormat(dataFormat.getFormat("0.00"));
48   - xssfCell.setCellValue((Double) value);
49   - } else if (value instanceof Integer) {
50   - xssfCellStyle.setDataFormat(dataFormat.getFormat("0"));
51   - xssfCell.setCellValue(Double.valueOf(value.toString()));
52   - } else {
53   - throw new RuntimeException("Excel2007 只支持 String Date Double Integer 单元格类型");
54   - }
55   - } else if (valueType == XSSFCell.CELL_TYPE_BLANK) {
56   - xssfCell.setCellType(Cell.CELL_TYPE_BLANK);
57   - } else {
58   - throw new RuntimeException("暂时不支持字符串、日期、数字以外的类型");
59   - }
60   -
61   - // 对齐方式
62   - xssfCellStyle.setAlignment(horizontalAlignment);
63   - xssfCellStyle.setVerticalAlignment(verticalAlignment);
64   -
65   - // 边框样式
66   - xssfCellStyle.setBorderTop(borderStyle);
67   - xssfCellStyle.setTopBorderColor(new XSSFColor(borderColor));
68   - xssfCellStyle.setBorderBottom(borderStyle);
69   - xssfCellStyle.setBottomBorderColor(new XSSFColor(borderColor));
70   - xssfCellStyle.setBorderLeft(borderStyle);
71   - xssfCellStyle.setLeftBorderColor(new XSSFColor(borderColor));
72   - xssfCellStyle.setBorderRight(borderStyle);
73   - xssfCellStyle.setRightBorderColor(new XSSFColor(borderColor));
74   -
75   - // 字体颜色
76   - XSSFFont font = xssfWorkbook.createFont();
77   - font.setColor(new XSSFColor(fontColor));
78   - font.setFontHeightInPoints(fontSize);
79   - font.setFontName(fontName);
80   - xssfCellStyle.setFont(font);
81   -
82   -
83   - // 单元背景色
84   - xssfCellStyle.setFillForegroundColor(new XSSFColor(backgroudColor));
85   - xssfCellStyle.setFillPattern(fillPatternType);
86   -
87   - // TODO
88   -
89   - xssfCell.setCellStyle(xssfCellStyle);
90   - return xssfCell;
91   - }
92   -
93   - @Override
94   - public Cell createStringCell(
95   - Workbook workbook, Row row, short columnIndex,
96   - String value) {
97   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
98   - XSSFRow xssfRow = (XSSFRow) row;
99   -
100   - XSSFCell xssfCell = (XSSFCell) createCell(
101   - xssfWorkbook, xssfRow, columnIndex,
102   - value, XSSFCell.CELL_TYPE_STRING,
103   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
104   - BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
105   - (short) 13, new java.awt.Color(0x2765A7), "宋体",
106   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
107   - );
108   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
109   - xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
110   - return xssfCell;
111   - }
112   -
113   - @Override
114   - public Cell createStringCell(
115   - Workbook workbook, Row row, short columnIndex,
116   - String value,
117   - Color backgroudColor) {
118   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
119   - XSSFRow xssfRow = (XSSFRow) row;
120   -
121   - XSSFCell xssfCell = (XSSFCell) createCell(
122   - xssfWorkbook, xssfRow, columnIndex,
123   - value, XSSFCell.CELL_TYPE_STRING,
124   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
125   - BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
126   - (short) 13, new java.awt.Color(0x2765A7), "宋体",
127   - backgroudColor, FillPatternType.SOLID_FOREGROUND
128   - );
129   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
130   - xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
131   - return xssfCell;
132   - }
133   -
134   - @Override
135   - public Cell createIntegerCell(
136   - Workbook workbook, Row row, short columnIndex,
137   - Integer value) {
138   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
139   - XSSFRow xssfRow = (XSSFRow) row;
140   -
141   - XSSFCell xssfCell = (XSSFCell) createCell(
142   - xssfWorkbook, xssfRow, columnIndex,
143   - value, XSSFCell.CELL_TYPE_NUMERIC,
144   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
145   - BorderStyle.MEDIUM, new Color(0xdedede),
146   - (short) 13, new Color(0x2765A7), "宋体",
147   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
148   - );
149   -
150   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
151   - xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
152   - return xssfCell;
153   - }
154   -
155   - @Override
156   - public Cell createIntegerCell(
157   - Workbook workbook, Row row, short columnIndex,
158   - Integer value,
159   - Color backgroudColor) {
160   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
161   - XSSFRow xssfRow = (XSSFRow) row;
162   -
163   - XSSFCell xssfCell = (XSSFCell) createCell(
164   - xssfWorkbook, xssfRow, columnIndex,
165   - value, XSSFCell.CELL_TYPE_NUMERIC,
166   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
167   - BorderStyle.MEDIUM, new Color(0xdedede),
168   - (short) 13, new Color(0x2765A7), "宋体",
169   - backgroudColor, FillPatternType.SOLID_FOREGROUND
170   - );
171   -
172   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
173   - xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
174   - return xssfCell;
175   - }
176   -
177   - @Override
178   - public Cell createDoubleCell(
179   - Workbook workbook, Row row, short columnIndex,
180   - Double value) {
181   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
182   - XSSFRow xssfRow = (XSSFRow) row;
183   -
184   - XSSFCell xssfCell = (XSSFCell) createCell(
185   - xssfWorkbook, xssfRow, columnIndex,
186   - value, XSSFCell.CELL_TYPE_NUMERIC,
187   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
188   - BorderStyle.MEDIUM, new Color(0xdedede),
189   - (short) 13, new Color(0x2765A7), "宋体",
190   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
191   - );
192   -
193   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
194   - xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
195   - return xssfCell;
196   - }
197   -
198   - @Override
199   - public Cell createDoubleCell(
200   - Workbook workbook, Row row, short columnIndex,
201   - Double value,
202   - Color backgroudColor) {
203   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
204   - XSSFRow xssfRow = (XSSFRow) row;
205   -
206   - XSSFCell xssfCell = (XSSFCell) createCell(
207   - xssfWorkbook, xssfRow, columnIndex,
208   - value, XSSFCell.CELL_TYPE_NUMERIC,
209   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
210   - BorderStyle.MEDIUM, new Color(0xdedede),
211   - (short) 13, new Color(0x2765A7), "宋体",
212   - backgroudColor, FillPatternType.SOLID_FOREGROUND
213   - );
214   -
215   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
216   - xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
217   - return xssfCell;
218   - }
219   -
220   - @Override
221   - public Cell createBlankCell(
222   - Workbook workbook, Row row, short columnIndex) {
223   - return createCell(
224   - workbook, row, columnIndex,
225   - null, XSSFCell.CELL_TYPE_BLANK,
226   - HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
227   - BorderStyle.MEDIUM, new Color(0xdedede),
228   - (short) 13, new Color(0x2765A7), "宋体",
229   - new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
230   - );
231   - }
232   -
233   - @Override
234   - public Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt) {
235   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
236   - DataFormat dataFormat = xssfWorkbook.createDataFormat();
237   - cell.getCellStyle().setDataFormat(dataFormat.getFormat(fmt));
238   - return cell;
239   - }
240   -
241   - @Override
242   - public Cell setCellBackground(Cell cell, Color color) {
243   - XSSFCell xssfCell = (XSSFCell) cell;
244   - xssfCell.getCellStyle().setFillForegroundColor(new XSSFColor(color));
245   - return cell;
246   - }
247   -
248   - @Override
249   - public Workbook createWorkBook() {
250   - return new XSSFWorkbook();
251   - }
252   -
253   - @Override
254   - public Sheet createWorkBookSheet(Workbook workbook, String sheetName) {
255   - return workbook.createSheet(WorkbookUtil.createSafeSheetName(sheetName));
256   - }
257   -
258   - @Override
259   - public Row createSheetRow(Sheet sheet, int rowIndex) {
260   - XSSFSheet xssfSheet = (XSSFSheet) sheet;
261   - return xssfSheet.createRow(rowIndex);
262   - }
263   -
264   - @Override
265   - public void writeExcel(File excelFile, Workbook workbook) {
266   - try {
267   - XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
268   - FileOutputStream fileOutputStream = new FileOutputStream(excelFile);
269   - xssfWorkbook.write(fileOutputStream);
270   - } catch (Exception exp) {
271   - throw new RuntimeException(exp);
272   - }
273   -
274   - }
275   -}
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import org.apache.poi.ss.usermodel.*;
  4 +import org.apache.poi.ss.util.WorkbookUtil;
  5 +import org.apache.poi.xssf.usermodel.*;
  6 +
  7 +import java.awt.Color;
  8 +import java.io.File;
  9 +import java.io.FileOutputStream;
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * Excel2007表格Poi操作类。
  14 + * TODO:以后测style需要重用
  15 + */
  16 +public class Excel2007PoiOperator implements ExcelPoiOperator {
  17 + @Override
  18 + public Cell createCell(
  19 + Workbook workbook, Row row, short columnIndex,
  20 + Object value, int valueType,
  21 + HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
  22 + BorderStyle borderStyle, java.awt.Color borderColor,
  23 + short fontSize, java.awt.Color fontColor, String fontName,
  24 + java.awt.Color backgroudColor, FillPatternType fillPatternType) {
  25 +
  26 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  27 + XSSFRow xssfRow = (XSSFRow) row;
  28 +
  29 + CreationHelper creationHelper = xssfWorkbook.getCreationHelper();
  30 +
  31 + // 1、创建单元格对象
  32 + XSSFCell xssfCell = xssfRow.createCell(columnIndex);
  33 +
  34 + // 2、设定样式
  35 + XSSFCellStyle xssfCellStyle = xssfWorkbook.createCellStyle();
  36 +
  37 + // 设定值及数据格式
  38 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  39 + if (valueType == XSSFCell.CELL_TYPE_STRING) {
  40 + xssfCellStyle.setDataFormat(dataFormat.getFormat("@"));
  41 + xssfCell.setCellValue(creationHelper.createRichTextString(String.valueOf(value)));
  42 + } else if (valueType == XSSFCell.CELL_TYPE_NUMERIC) {
  43 + if (value instanceof Date) { // 日期
  44 + xssfCellStyle.setDataFormat(dataFormat.getFormat("yyyy-mm-dd"));
  45 + xssfCell.setCellValue((Date) value);
  46 + } else if (value instanceof Double) {
  47 + xssfCellStyle.setDataFormat(dataFormat.getFormat("0.00"));
  48 + xssfCell.setCellValue((Double) value);
  49 + } else if (value instanceof Integer) {
  50 + xssfCellStyle.setDataFormat(dataFormat.getFormat("0"));
  51 + xssfCell.setCellValue(Double.valueOf(value.toString()));
  52 + } else {
  53 + throw new RuntimeException("Excel2007 只支持 String Date Double Integer 单元格类型");
  54 + }
  55 + } else if (valueType == XSSFCell.CELL_TYPE_BLANK) {
  56 + xssfCell.setCellType(Cell.CELL_TYPE_BLANK);
  57 + } else {
  58 + throw new RuntimeException("暂时不支持字符串、日期、数字以外的类型");
  59 + }
  60 +
  61 + // 对齐方式
  62 + xssfCellStyle.setAlignment(horizontalAlignment);
  63 + xssfCellStyle.setVerticalAlignment(verticalAlignment);
  64 +
  65 + // 边框样式
  66 + xssfCellStyle.setBorderTop(borderStyle);
  67 + xssfCellStyle.setTopBorderColor(new XSSFColor(borderColor));
  68 + xssfCellStyle.setBorderBottom(borderStyle);
  69 + xssfCellStyle.setBottomBorderColor(new XSSFColor(borderColor));
  70 + xssfCellStyle.setBorderLeft(borderStyle);
  71 + xssfCellStyle.setLeftBorderColor(new XSSFColor(borderColor));
  72 + xssfCellStyle.setBorderRight(borderStyle);
  73 + xssfCellStyle.setRightBorderColor(new XSSFColor(borderColor));
  74 +
  75 + // 字体颜色
  76 + XSSFFont font = xssfWorkbook.createFont();
  77 + font.setColor(new XSSFColor(fontColor));
  78 + font.setFontHeightInPoints(fontSize);
  79 + font.setFontName(fontName);
  80 + xssfCellStyle.setFont(font);
  81 +
  82 +
  83 + // 单元背景色
  84 + xssfCellStyle.setFillForegroundColor(new XSSFColor(backgroudColor));
  85 + xssfCellStyle.setFillPattern(fillPatternType);
  86 +
  87 + // TODO
  88 +
  89 + xssfCell.setCellStyle(xssfCellStyle);
  90 + return xssfCell;
  91 + }
  92 +
  93 + @Override
  94 + public Cell createStringCell(
  95 + Workbook workbook, Row row, short columnIndex,
  96 + String value) {
  97 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  98 + XSSFRow xssfRow = (XSSFRow) row;
  99 +
  100 + XSSFCell xssfCell = (XSSFCell) createCell(
  101 + xssfWorkbook, xssfRow, columnIndex,
  102 + value, XSSFCell.CELL_TYPE_STRING,
  103 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  104 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  105 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  106 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  107 + );
  108 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  109 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  110 + return xssfCell;
  111 + }
  112 +
  113 + @Override
  114 + public Cell createStringCell(
  115 + Workbook workbook, Row row, short columnIndex,
  116 + String value,
  117 + Color backgroudColor) {
  118 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  119 + XSSFRow xssfRow = (XSSFRow) row;
  120 +
  121 + XSSFCell xssfCell = (XSSFCell) createCell(
  122 + xssfWorkbook, xssfRow, columnIndex,
  123 + value, XSSFCell.CELL_TYPE_STRING,
  124 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  125 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  126 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  127 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  128 + );
  129 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  130 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  131 + return xssfCell;
  132 + }
  133 +
  134 + @Override
  135 + public Cell createIntegerCell(
  136 + Workbook workbook, Row row, short columnIndex,
  137 + Integer value) {
  138 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  139 + XSSFRow xssfRow = (XSSFRow) row;
  140 +
  141 + XSSFCell xssfCell = (XSSFCell) createCell(
  142 + xssfWorkbook, xssfRow, columnIndex,
  143 + value, XSSFCell.CELL_TYPE_NUMERIC,
  144 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  145 + BorderStyle.MEDIUM, new Color(0xdedede),
  146 + (short) 13, new Color(0x2765A7), "宋体",
  147 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  148 + );
  149 +
  150 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  151 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  152 + return xssfCell;
  153 + }
  154 +
  155 + @Override
  156 + public Cell createIntegerCell(
  157 + Workbook workbook, Row row, short columnIndex,
  158 + Integer value,
  159 + Color backgroudColor) {
  160 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  161 + XSSFRow xssfRow = (XSSFRow) row;
  162 +
  163 + XSSFCell xssfCell = (XSSFCell) createCell(
  164 + xssfWorkbook, xssfRow, columnIndex,
  165 + value, XSSFCell.CELL_TYPE_NUMERIC,
  166 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  167 + BorderStyle.MEDIUM, new Color(0xdedede),
  168 + (short) 13, new Color(0x2765A7), "宋体",
  169 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  170 + );
  171 +
  172 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  173 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  174 + return xssfCell;
  175 + }
  176 +
  177 + @Override
  178 + public Cell createDoubleCell(
  179 + Workbook workbook, Row row, short columnIndex,
  180 + Double value) {
  181 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  182 + XSSFRow xssfRow = (XSSFRow) row;
  183 +
  184 + XSSFCell xssfCell = (XSSFCell) createCell(
  185 + xssfWorkbook, xssfRow, columnIndex,
  186 + value, XSSFCell.CELL_TYPE_NUMERIC,
  187 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  188 + BorderStyle.MEDIUM, new Color(0xdedede),
  189 + (short) 13, new Color(0x2765A7), "宋体",
  190 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  191 + );
  192 +
  193 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  194 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  195 + return xssfCell;
  196 + }
  197 +
  198 + @Override
  199 + public Cell createDoubleCell(
  200 + Workbook workbook, Row row, short columnIndex,
  201 + Double value,
  202 + Color backgroudColor) {
  203 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  204 + XSSFRow xssfRow = (XSSFRow) row;
  205 +
  206 + XSSFCell xssfCell = (XSSFCell) createCell(
  207 + xssfWorkbook, xssfRow, columnIndex,
  208 + value, XSSFCell.CELL_TYPE_NUMERIC,
  209 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  210 + BorderStyle.MEDIUM, new Color(0xdedede),
  211 + (short) 13, new Color(0x2765A7), "宋体",
  212 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  213 + );
  214 +
  215 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  216 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  217 + return xssfCell;
  218 + }
  219 +
  220 + @Override
  221 + public Cell createBlankCell(
  222 + Workbook workbook, Row row, short columnIndex) {
  223 + return createCell(
  224 + workbook, row, columnIndex,
  225 + null, XSSFCell.CELL_TYPE_BLANK,
  226 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  227 + BorderStyle.MEDIUM, new Color(0xdedede),
  228 + (short) 13, new Color(0x2765A7), "宋体",
  229 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  230 + );
  231 + }
  232 +
  233 + @Override
  234 + public Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt) {
  235 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  236 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  237 + cell.getCellStyle().setDataFormat(dataFormat.getFormat(fmt));
  238 + return cell;
  239 + }
  240 +
  241 + @Override
  242 + public Cell setCellBackground(Cell cell, Color color) {
  243 + XSSFCell xssfCell = (XSSFCell) cell;
  244 + xssfCell.getCellStyle().setFillForegroundColor(new XSSFColor(color));
  245 + return cell;
  246 + }
  247 +
  248 + @Override
  249 + public Workbook createWorkBook() {
  250 + return new XSSFWorkbook();
  251 + }
  252 +
  253 + @Override
  254 + public Sheet createWorkBookSheet(Workbook workbook, String sheetName) {
  255 + return workbook.createSheet(WorkbookUtil.createSafeSheetName(sheetName));
  256 + }
  257 +
  258 + @Override
  259 + public Row createSheetRow(Sheet sheet, int rowIndex) {
  260 + XSSFSheet xssfSheet = (XSSFSheet) sheet;
  261 + return xssfSheet.createRow(rowIndex);
  262 + }
  263 +
  264 + @Override
  265 + public void writeExcel(File excelFile, Workbook workbook) {
  266 + try {
  267 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  268 + FileOutputStream fileOutputStream = new FileOutputStream(excelFile);
  269 + xssfWorkbook.write(fileOutputStream);
  270 + } catch (Exception exp) {
  271 + throw new RuntimeException(exp);
  272 + }
  273 +
  274 + }
  275 +}
... ...
src/main/java/com/bsth/service/schedule/datatools/ExcelPoiOperator.java
1   -package com.bsth.service.schedule.datatools;
2   -
3   -import org.apache.poi.ss.usermodel.*;
4   -
5   -import java.awt.Color;
6   -import java.io.File;
7   -
8   -/**
9   - * Excel表格Poi操作接口。
10   - */
11   -public interface ExcelPoiOperator {
12   -
13   -
14   - //---------------- 创建单元格 ---------------//
15   -
16   - Cell createCell(
17   - Workbook workbook, Row row, short columnIndex,
18   - Object value, int valueType,
19   - HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
20   - BorderStyle borderStyle, java.awt.Color borderColor,
21   - short fontSize, java.awt.Color fontColor, String fontName,
22   - java.awt.Color backgroudColor, FillPatternType fillPatternType
23   - );
24   -
25   - Cell createStringCell(
26   - Workbook workbook, Row row, short columnIndex,
27   - String value
28   - );
29   -
30   - Cell createStringCell(
31   - Workbook workbook, Row row, short columnIndex,
32   - String value,
33   - java.awt.Color backgroudColor
34   - );
35   -
36   - Cell createIntegerCell(
37   - Workbook workbook, Row row, short columnIndex,
38   - Integer value
39   - );
40   -
41   - Cell createIntegerCell(
42   - Workbook workbook, Row row, short columnIndex,
43   - Integer value,
44   - java.awt.Color backgroudColor
45   - );
46   -
47   - Cell createDoubleCell(
48   - Workbook workbook, Row row, short columnIndex,
49   - Double value
50   - );
51   -
52   - Cell createDoubleCell(
53   - Workbook workbook, Row row, short columnIndex,
54   - Double value,
55   - java.awt.Color backgroudColor
56   - );
57   -
58   - Cell createBlankCell(
59   - Workbook workbook, Row row, short columnIndex
60   - );
61   -
62   - //---------------- 创建单元格数据格式 ---------------//
63   -
64   - Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt);
65   -
66   - Cell setCellBackground(Cell cell, Color color);
67   -
68   - //---------------- 创建workbook,sheet,row ---------------//
69   - Workbook createWorkBook();
70   - Sheet createWorkBookSheet(Workbook workbook, String sheetName);
71   - Row createSheetRow(Sheet sheet, int rowIndex);
72   -
73   - //---------------- 生成文件 ---------------//
74   - void writeExcel(File excelFile, Workbook workbook);
75   -}
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import org.apache.poi.ss.usermodel.*;
  4 +
  5 +import java.awt.Color;
  6 +import java.io.File;
  7 +
  8 +/**
  9 + * Excel表格Poi操作接口。
  10 + */
  11 +public interface ExcelPoiOperator {
  12 +
  13 +
  14 + //---------------- 创建单元格 ---------------//
  15 +
  16 + Cell createCell(
  17 + Workbook workbook, Row row, short columnIndex,
  18 + Object value, int valueType,
  19 + HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
  20 + BorderStyle borderStyle, java.awt.Color borderColor,
  21 + short fontSize, java.awt.Color fontColor, String fontName,
  22 + java.awt.Color backgroudColor, FillPatternType fillPatternType
  23 + );
  24 +
  25 + Cell createStringCell(
  26 + Workbook workbook, Row row, short columnIndex,
  27 + String value
  28 + );
  29 +
  30 + Cell createStringCell(
  31 + Workbook workbook, Row row, short columnIndex,
  32 + String value,
  33 + java.awt.Color backgroudColor
  34 + );
  35 +
  36 + Cell createIntegerCell(
  37 + Workbook workbook, Row row, short columnIndex,
  38 + Integer value
  39 + );
  40 +
  41 + Cell createIntegerCell(
  42 + Workbook workbook, Row row, short columnIndex,
  43 + Integer value,
  44 + java.awt.Color backgroudColor
  45 + );
  46 +
  47 + Cell createDoubleCell(
  48 + Workbook workbook, Row row, short columnIndex,
  49 + Double value
  50 + );
  51 +
  52 + Cell createDoubleCell(
  53 + Workbook workbook, Row row, short columnIndex,
  54 + Double value,
  55 + java.awt.Color backgroudColor
  56 + );
  57 +
  58 + Cell createBlankCell(
  59 + Workbook workbook, Row row, short columnIndex
  60 + );
  61 +
  62 + //---------------- 创建单元格数据格式 ---------------//
  63 +
  64 + Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt);
  65 +
  66 + Cell setCellBackground(Cell cell, Color color);
  67 +
  68 + //---------------- 创建workbook,sheet,row ---------------//
  69 + Workbook createWorkBook();
  70 + Sheet createWorkBookSheet(Workbook workbook, String sheetName);
  71 + Row createSheetRow(Sheet sheet, int rowIndex);
  72 +
  73 + //---------------- 生成文件 ---------------//
  74 + void writeExcel(File excelFile, Workbook workbook);
  75 +}
... ...
src/main/java/com/bsth/service/schedule/datatools/TTinfoDetailDynamicData.java
1   -package com.bsth.service.schedule.datatools;
2   -
3   -import com.bsth.service.schedule.exception.ScheduleException;
4   -import com.bsth.service.schedule.utils.DataToolsFile;
5   -import com.bsth.service.schedule.utils.DataToolsFileType;
6   -import com.fasterxml.jackson.annotation.JsonCreator;
7   -import com.fasterxml.jackson.annotation.JsonValue;
8   -
9   -import java.util.List;
10   -
11   -/**
12   - * 动态时刻表数据。
13   - */
14   -public interface TTinfoDetailDynamicData {
15   -
16   - //---------------------- 生成时刻表用对象(以下) ---------------------//
17   - public static enum BcType { // 班次类型枚举
18   - IN("in"), // 进场
19   - OUT("out"), // 出场
20   - BD("bd"), // 早例保
21   - LC("lc"), // 晚例保
22   - NORMAL("normal"); // 正常
23   - private String flag;
24   -
25   - @JsonCreator
26   - private BcType(String flag) {
27   - this.flag = flag;
28   - }
29   -
30   - @JsonValue
31   - public String getFlag() {
32   - return flag;
33   - }
34   -
35   - public void setFlag(String flag) {
36   - this.flag = flag;
37   - }
38   - }
39   -
40   - public static class BcObj { // 班次对象
41   - /** 班次时间 */
42   - private Integer bcsj;
43   - /** 停站时间 */
44   - private Integer ssj;
45   - /** 吃饭时间 */
46   - private Integer eatsj;
47   -
48   - /** 停车场id */
49   - private Integer tccid;
50   - /** 起点站id */
51   - private Integer qdzid;
52   - /** 终点站id */
53   - private Integer zdzid;
54   -
55   - /** 是否上行 */
56   - private Boolean isUp;
57   -
58   - /** 是否分班 */
59   - private Boolean isFb;
60   -
61   - /** 班次类型 */
62   - private BcType bcType;
63   - /** 发车时刻 */
64   - private String fcsj;
65   - /** 用于统计的发车时间描述(把进出场,保养,吃饭时间写在一起) */
66   - private String fcsjDesc;
67   -
68   - /** 第几圈(从1开始) */
69   - private Integer groupNo;
70   - /** 圈里第几个班次(1或者2) */
71   - private Integer groupBcNo;
72   -
73   - public Integer getBcsj() {
74   - return bcsj;
75   - }
76   -
77   - public void setBcsj(Integer bcsj) {
78   - this.bcsj = bcsj;
79   - }
80   -
81   - public Integer getSsj() {
82   - return ssj;
83   - }
84   -
85   - public void setSsj(Integer ssj) {
86   - this.ssj = ssj;
87   - }
88   -
89   - public Integer getEatsj() {
90   - return eatsj;
91   - }
92   -
93   - public void setEatsj(Integer eatsj) {
94   - this.eatsj = eatsj;
95   - }
96   -
97   - public Integer getTccid() {
98   - return tccid;
99   - }
100   -
101   - public void setTccid(Integer tccid) {
102   - this.tccid = tccid;
103   - }
104   -
105   - public Integer getQdzid() {
106   - return qdzid;
107   - }
108   -
109   - public void setQdzid(Integer qdzid) {
110   - this.qdzid = qdzid;
111   - }
112   -
113   - public Integer getZdzid() {
114   - return zdzid;
115   - }
116   -
117   - public void setZdzid(Integer zdzid) {
118   - this.zdzid = zdzid;
119   - }
120   -
121   - public BcType getBcType() {
122   - return bcType;
123   - }
124   -
125   - public void setBcType(BcType bcType) {
126   - this.bcType = bcType;
127   - }
128   -
129   - public String getFcsj() {
130   - return fcsj;
131   - }
132   -
133   - public void setFcsj(String fcsj) {
134   - this.fcsj = fcsj;
135   - }
136   -
137   - public Boolean getIsUp() {
138   - return isUp;
139   - }
140   -
141   - public void setIsUp(Boolean isUp) {
142   - this.isUp = isUp;
143   - }
144   -
145   - public Integer getGroupNo() {
146   - return groupNo;
147   - }
148   -
149   - public void setGroupNo(Integer groupNo) {
150   - this.groupNo = groupNo;
151   - }
152   -
153   - public Integer getGroupBcNo() {
154   - return groupBcNo;
155   - }
156   -
157   - public void setGroupBcNo(Integer groupBcNo) {
158   - this.groupBcNo = groupBcNo;
159   - }
160   -
161   - public String getFcsjDesc() {
162   - return fcsjDesc;
163   - }
164   -
165   - public void setFcsjDesc(String fcsjDesc) {
166   - this.fcsjDesc = fcsjDesc;
167   - }
168   -
169   - public Boolean getIsFb() {
170   - return isFb;
171   - }
172   -
173   - public void setIsFb(Boolean fb) {
174   - isFb = fb;
175   - }
176   - }
177   -
178   - public static class LpObj { // 路牌对象
179   - /** 路牌名字 */
180   - private String lpname;
181   - /** 每圈的第一个班次是否上行 */
182   - private Boolean isUp;
183   -
184   - /** 第一个班次起点站路由id */
185   - private Integer stationRouteId1;
186   - /** 第二个班次起点站路由id */
187   - private Integer stationRouteId2;
188   -
189   - /** 班次列表 */
190   - private List<BcObj> bcObjList;
191   - /** 总圈数 */
192   - private Integer groupCount;
193   -
194   - //---------------- 路牌统计 ---------------//
195   - /** 总里程 */
196   - private Double zlc;
197   - /** 营运里程 */
198   - private Double yylc;
199   - /** 空驶里程 */
200   - private Double kslc;
201   - /** 总工时 */
202   - private Double zgs;
203   - /** 总班次 */
204   - private Integer zbc;
205   - /** 营运工时 */
206   - private Double yygs;
207   - /** 营运班次 */
208   - private Integer yybc;
209   -
210   - public String getLpname() {
211   - return lpname;
212   - }
213   -
214   - public void setLpname(String lpname) {
215   - this.lpname = lpname;
216   - }
217   -
218   - public Boolean getIsUp() {
219   - return isUp;
220   - }
221   -
222   - public void setIsUp(Boolean isUp) {
223   - this.isUp = isUp;
224   - }
225   -
226   - public List<BcObj> getBcObjList() {
227   - return bcObjList;
228   - }
229   -
230   - public void setBcObjList(List<BcObj> bcObjList) {
231   - this.bcObjList = bcObjList;
232   - }
233   -
234   - public Integer getGroupCount() {
235   - return groupCount;
236   - }
237   -
238   - public void setGroupCount(Integer groupCount) {
239   - this.groupCount = groupCount;
240   - }
241   -
242   - public Integer getStationRouteId1() {
243   - return stationRouteId1;
244   - }
245   -
246   - public void setStationRouteId1(Integer stationRouteId1) {
247   - this.stationRouteId1 = stationRouteId1;
248   - }
249   -
250   - public Integer getStationRouteId2() {
251   - return stationRouteId2;
252   - }
253   -
254   - public void setStationRouteId2(Integer stationRouteId2) {
255   - this.stationRouteId2 = stationRouteId2;
256   - }
257   -
258   - public Boolean getUp() {
259   - return isUp;
260   - }
261   -
262   - public void setUp(Boolean up) {
263   - isUp = up;
264   - }
265   -
266   - public Double getZlc() {
267   - return zlc;
268   - }
269   -
270   - public void setZlc(Double zlc) {
271   - this.zlc = zlc;
272   - }
273   -
274   - public Double getYylc() {
275   - return yylc;
276   - }
277   -
278   - public void setYylc(Double yylc) {
279   - this.yylc = yylc;
280   - }
281   -
282   - public Double getKslc() {
283   - return kslc;
284   - }
285   -
286   - public void setKslc(Double kslc) {
287   - this.kslc = kslc;
288   - }
289   -
290   - public Double getZgs() {
291   - return zgs;
292   - }
293   -
294   - public void setZgs(Double zgs) {
295   - this.zgs = zgs;
296   - }
297   -
298   - public Integer getZbc() {
299   - return zbc;
300   - }
301   -
302   - public void setZbc(Integer zbc) {
303   - this.zbc = zbc;
304   - }
305   -
306   - public Double getYygs() {
307   - return yygs;
308   - }
309   -
310   - public void setYygs(Double yygs) {
311   - this.yygs = yygs;
312   - }
313   -
314   - public Integer getYybc() {
315   - return yybc;
316   - }
317   -
318   - public void setYybc(Integer yybc) {
319   - this.yybc = yybc;
320   - }
321   -
322   - }
323   -
324   - public static class StatInfo { // 统计数据对象
325   - /** 统计项目 */
326   - private String statItem;
327   - /** 统计值 */
328   - private Double statValue;
329   -
330   - public String getStatItem() {
331   - return statItem;
332   - }
333   -
334   - public void setStatItem(String statItem) {
335   - this.statItem = statItem;
336   - }
337   -
338   - public Double getStatValue() {
339   - return statValue;
340   - }
341   -
342   - public void setStatValue(Double statValue) {
343   - this.statValue = statValue;
344   - }
345   - }
346   -
347   - public static class DTInfos { // 所有数据信息
348   - /** 路牌班次数据列表 */
349   - private List<LpObj> lpObjList;
350   - /** 统计数据列表 */
351   - private List<StatInfo> statInfoList;
352   -
353   - public List<LpObj> getLpObjList() {
354   - return lpObjList;
355   - }
356   -
357   - public void setLpObjList(List<LpObj> lpObjList) {
358   - this.lpObjList = lpObjList;
359   - }
360   -
361   - public List<StatInfo> getStatInfoList() {
362   - return statInfoList;
363   - }
364   -
365   - public void setStatInfoList(List<StatInfo> statInfoList) {
366   - this.statInfoList = statInfoList;
367   - }
368   - }
369   -
370   - //---------------------- 生成时刻表用对象(以上) ---------------------//
371   -
372   - /**
373   - * 导出动态时刻表数据。
374   - * @param dtInfos
375   - * @return
376   - * @throws ScheduleException
377   - */
378   - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos, DataToolsFileType type) throws ScheduleException;
379   -}
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import com.bsth.service.schedule.exception.ScheduleException;
  4 +import com.bsth.service.schedule.utils.DataToolsFile;
  5 +import com.bsth.service.schedule.utils.DataToolsFileType;
  6 +import com.fasterxml.jackson.annotation.JsonCreator;
  7 +import com.fasterxml.jackson.annotation.JsonValue;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 动态时刻表数据。
  13 + */
  14 +public interface TTinfoDetailDynamicData {
  15 +
  16 + //---------------------- 生成时刻表用对象(以下) ---------------------//
  17 + public static enum BcType { // 班次类型枚举
  18 + IN("in"), // 进场
  19 + OUT("out"), // 出场
  20 + BD("bd"), // 早例保
  21 + LC("lc"), // 晚例保
  22 + NORMAL("normal"); // 正常
  23 + private String flag;
  24 +
  25 + @JsonCreator
  26 + private BcType(String flag) {
  27 + this.flag = flag;
  28 + }
  29 +
  30 + @JsonValue
  31 + public String getFlag() {
  32 + return flag;
  33 + }
  34 +
  35 + public void setFlag(String flag) {
  36 + this.flag = flag;
  37 + }
  38 + }
  39 +
  40 + public static class BcObj { // 班次对象
  41 + /** 班次时间 */
  42 + private Integer bcsj;
  43 + /** 停站时间 */
  44 + private Integer ssj;
  45 + /** 吃饭时间 */
  46 + private Integer eatsj;
  47 +
  48 + /** 停车场id */
  49 + private Integer tccid;
  50 + /** 起点站id */
  51 + private Integer qdzid;
  52 + /** 终点站id */
  53 + private Integer zdzid;
  54 +
  55 + /** 是否上行 */
  56 + private Boolean isUp;
  57 +
  58 + /** 是否分班 */
  59 + private Boolean isFb;
  60 +
  61 + /** 班次类型 */
  62 + private BcType bcType;
  63 + /** 发车时刻 */
  64 + private String fcsj;
  65 + /** 用于统计的发车时间描述(把进出场,保养,吃饭时间写在一起) */
  66 + private String fcsjDesc;
  67 +
  68 + /** 第几圈(从1开始) */
  69 + private Integer groupNo;
  70 + /** 圈里第几个班次(1或者2) */
  71 + private Integer groupBcNo;
  72 +
  73 + public Integer getBcsj() {
  74 + return bcsj;
  75 + }
  76 +
  77 + public void setBcsj(Integer bcsj) {
  78 + this.bcsj = bcsj;
  79 + }
  80 +
  81 + public Integer getSsj() {
  82 + return ssj;
  83 + }
  84 +
  85 + public void setSsj(Integer ssj) {
  86 + this.ssj = ssj;
  87 + }
  88 +
  89 + public Integer getEatsj() {
  90 + return eatsj;
  91 + }
  92 +
  93 + public void setEatsj(Integer eatsj) {
  94 + this.eatsj = eatsj;
  95 + }
  96 +
  97 + public Integer getTccid() {
  98 + return tccid;
  99 + }
  100 +
  101 + public void setTccid(Integer tccid) {
  102 + this.tccid = tccid;
  103 + }
  104 +
  105 + public Integer getQdzid() {
  106 + return qdzid;
  107 + }
  108 +
  109 + public void setQdzid(Integer qdzid) {
  110 + this.qdzid = qdzid;
  111 + }
  112 +
  113 + public Integer getZdzid() {
  114 + return zdzid;
  115 + }
  116 +
  117 + public void setZdzid(Integer zdzid) {
  118 + this.zdzid = zdzid;
  119 + }
  120 +
  121 + public BcType getBcType() {
  122 + return bcType;
  123 + }
  124 +
  125 + public void setBcType(BcType bcType) {
  126 + this.bcType = bcType;
  127 + }
  128 +
  129 + public String getFcsj() {
  130 + return fcsj;
  131 + }
  132 +
  133 + public void setFcsj(String fcsj) {
  134 + this.fcsj = fcsj;
  135 + }
  136 +
  137 + public Boolean getIsUp() {
  138 + return isUp;
  139 + }
  140 +
  141 + public void setIsUp(Boolean isUp) {
  142 + this.isUp = isUp;
  143 + }
  144 +
  145 + public Integer getGroupNo() {
  146 + return groupNo;
  147 + }
  148 +
  149 + public void setGroupNo(Integer groupNo) {
  150 + this.groupNo = groupNo;
  151 + }
  152 +
  153 + public Integer getGroupBcNo() {
  154 + return groupBcNo;
  155 + }
  156 +
  157 + public void setGroupBcNo(Integer groupBcNo) {
  158 + this.groupBcNo = groupBcNo;
  159 + }
  160 +
  161 + public String getFcsjDesc() {
  162 + return fcsjDesc;
  163 + }
  164 +
  165 + public void setFcsjDesc(String fcsjDesc) {
  166 + this.fcsjDesc = fcsjDesc;
  167 + }
  168 +
  169 + public Boolean getIsFb() {
  170 + return isFb;
  171 + }
  172 +
  173 + public void setIsFb(Boolean fb) {
  174 + isFb = fb;
  175 + }
  176 + }
  177 +
  178 + public static class LpObj { // 路牌对象
  179 + /** 路牌名字 */
  180 + private String lpname;
  181 + /** 每圈的第一个班次是否上行 */
  182 + private Boolean isUp;
  183 +
  184 + /** 第一个班次起点站路由id */
  185 + private Integer stationRouteId1;
  186 + /** 第二个班次起点站路由id */
  187 + private Integer stationRouteId2;
  188 +
  189 + /** 班次列表 */
  190 + private List<BcObj> bcObjList;
  191 + /** 总圈数 */
  192 + private Integer groupCount;
  193 +
  194 + //---------------- 路牌统计 ---------------//
  195 + /** 总里程 */
  196 + private Double zlc;
  197 + /** 营运里程 */
  198 + private Double yylc;
  199 + /** 空驶里程 */
  200 + private Double kslc;
  201 + /** 总工时 */
  202 + private Double zgs;
  203 + /** 总班次 */
  204 + private Integer zbc;
  205 + /** 营运工时 */
  206 + private Double yygs;
  207 + /** 营运班次 */
  208 + private Integer yybc;
  209 +
  210 + public String getLpname() {
  211 + return lpname;
  212 + }
  213 +
  214 + public void setLpname(String lpname) {
  215 + this.lpname = lpname;
  216 + }
  217 +
  218 + public Boolean getIsUp() {
  219 + return isUp;
  220 + }
  221 +
  222 + public void setIsUp(Boolean isUp) {
  223 + this.isUp = isUp;
  224 + }
  225 +
  226 + public List<BcObj> getBcObjList() {
  227 + return bcObjList;
  228 + }
  229 +
  230 + public void setBcObjList(List<BcObj> bcObjList) {
  231 + this.bcObjList = bcObjList;
  232 + }
  233 +
  234 + public Integer getGroupCount() {
  235 + return groupCount;
  236 + }
  237 +
  238 + public void setGroupCount(Integer groupCount) {
  239 + this.groupCount = groupCount;
  240 + }
  241 +
  242 + public Integer getStationRouteId1() {
  243 + return stationRouteId1;
  244 + }
  245 +
  246 + public void setStationRouteId1(Integer stationRouteId1) {
  247 + this.stationRouteId1 = stationRouteId1;
  248 + }
  249 +
  250 + public Integer getStationRouteId2() {
  251 + return stationRouteId2;
  252 + }
  253 +
  254 + public void setStationRouteId2(Integer stationRouteId2) {
  255 + this.stationRouteId2 = stationRouteId2;
  256 + }
  257 +
  258 + public Boolean getUp() {
  259 + return isUp;
  260 + }
  261 +
  262 + public void setUp(Boolean up) {
  263 + isUp = up;
  264 + }
  265 +
  266 + public Double getZlc() {
  267 + return zlc;
  268 + }
  269 +
  270 + public void setZlc(Double zlc) {
  271 + this.zlc = zlc;
  272 + }
  273 +
  274 + public Double getYylc() {
  275 + return yylc;
  276 + }
  277 +
  278 + public void setYylc(Double yylc) {
  279 + this.yylc = yylc;
  280 + }
  281 +
  282 + public Double getKslc() {
  283 + return kslc;
  284 + }
  285 +
  286 + public void setKslc(Double kslc) {
  287 + this.kslc = kslc;
  288 + }
  289 +
  290 + public Double getZgs() {
  291 + return zgs;
  292 + }
  293 +
  294 + public void setZgs(Double zgs) {
  295 + this.zgs = zgs;
  296 + }
  297 +
  298 + public Integer getZbc() {
  299 + return zbc;
  300 + }
  301 +
  302 + public void setZbc(Integer zbc) {
  303 + this.zbc = zbc;
  304 + }
  305 +
  306 + public Double getYygs() {
  307 + return yygs;
  308 + }
  309 +
  310 + public void setYygs(Double yygs) {
  311 + this.yygs = yygs;
  312 + }
  313 +
  314 + public Integer getYybc() {
  315 + return yybc;
  316 + }
  317 +
  318 + public void setYybc(Integer yybc) {
  319 + this.yybc = yybc;
  320 + }
  321 +
  322 + }
  323 +
  324 + public static class StatInfo { // 统计数据对象
  325 + /** 统计项目 */
  326 + private String statItem;
  327 + /** 统计值 */
  328 + private Double statValue;
  329 +
  330 + public String getStatItem() {
  331 + return statItem;
  332 + }
  333 +
  334 + public void setStatItem(String statItem) {
  335 + this.statItem = statItem;
  336 + }
  337 +
  338 + public Double getStatValue() {
  339 + return statValue;
  340 + }
  341 +
  342 + public void setStatValue(Double statValue) {
  343 + this.statValue = statValue;
  344 + }
  345 + }
  346 +
  347 + public static class DTInfos { // 所有数据信息
  348 + /** 路牌班次数据列表 */
  349 + private List<LpObj> lpObjList;
  350 + /** 统计数据列表 */
  351 + private List<StatInfo> statInfoList;
  352 +
  353 + public List<LpObj> getLpObjList() {
  354 + return lpObjList;
  355 + }
  356 +
  357 + public void setLpObjList(List<LpObj> lpObjList) {
  358 + this.lpObjList = lpObjList;
  359 + }
  360 +
  361 + public List<StatInfo> getStatInfoList() {
  362 + return statInfoList;
  363 + }
  364 +
  365 + public void setStatInfoList(List<StatInfo> statInfoList) {
  366 + this.statInfoList = statInfoList;
  367 + }
  368 + }
  369 +
  370 + //---------------------- 生成时刻表用对象(以上) ---------------------//
  371 +
  372 + /**
  373 + * 导出动态时刻表数据。
  374 + * @param dtInfos
  375 + * @return
  376 + * @throws ScheduleException
  377 + */
  378 + public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos, DataToolsFileType type) throws ScheduleException;
  379 +}
... ...
src/main/java/com/bsth/service/schedule/plan/DroolsSchedulePlan.java
1   -package com.bsth.service.schedule.plan;
2   -
3   -import com.bsth.entity.Line;
4   -import com.bsth.entity.schedule.SchedulePlan;
5   -import com.bsth.entity.schedule.SchedulePlanInfo;
6   -import com.bsth.entity.schedule.TTInfo;
7   -import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
8   -import com.bsth.repository.BusinessRepository;
9   -import com.bsth.repository.LineRepository;
10   -import com.bsth.repository.schedule.*;
11   -import com.bsth.service.schedule.rules.ScheduleRuleService;
12   -import com.bsth.service.schedule.rules.plan.PlanCalcuParam_input;
13   -import com.bsth.service.schedule.rules.plan.PlanResult;
14   -import com.bsth.service.schedule.rules.rerun.RerunRule_input;
15   -import com.bsth.service.schedule.rules.rerun.RerunRule_param;
16   -import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;
17   -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output;
18   -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;
19   -import com.bsth.service.schedule.rules.ttinfo.*;
20   -import com.bsth.service.schedule.rules.validate.ValidateParam;
21   -import com.bsth.service.schedule.rules.validate.ValidateResults_output;
22   -import org.apache.commons.lang3.StringUtils;
23   -import org.joda.time.DateTime;
24   -import org.kie.api.KieBase;
25   -import org.kie.api.runtime.KieSession;
26   -import org.slf4j.Logger;
27   -
28   -import java.util.*;
29   -
30   -/**
31   - * 排班计划(使用Drools)。
32   - */
33   -public class DroolsSchedulePlan {
34   - /** 主线路 */
35   - private Line mainLine;
36   - /** 套跑辅线路规则 */
37   - private List<RerunRule_input> rerunRule_inputs;
38   -
39   - /** 开始排班时间 */
40   - private Date from;
41   - /** 结束排班时间 */
42   - private Date to;
43   - /** 排班计划entity */
44   - private SchedulePlan schedulePlan;
45   -
46   - //-------------------- 相关的Repo,service服务 --------------------//
47   - /** 线路Repo */
48   - private LineRepository lineRepository;
49   - /** 排班规则Repo */
50   - private ScheduleRule1FlatRepository scheduleRule1FlatRepository;
51   - /** 时刻表Repo */
52   - private TTInfoRepository ttInfoRepository;
53   - /** 时刻表明细Repo */
54   - private TTInfoDetailRepository ttInfoDetailRepository;
55   - /** 车辆配置Repo */
56   - private CarConfigInfoRepository carConfigInfoRepository;
57   - /** 人员配置Repo */
58   - private EmployeeConfigInfoRepository employeeConfigInfoRepository;
59   - /** 套跑规则Repo */
60   - private RerunRuleRepository rerunRuleRepository;
61   - /** 营运状态Repo */
62   - private BusinessRepository businessRepository;
63   -
64   - /** 排班规则service */
65   - private ScheduleRuleService scheduleRuleService;
66   -
67   - //-------------------- Drools KBase实例 ------------------//
68   - /** 排班预处理KBase */
69   - private KieBase preKBase;
70   - /** 排班核心KBase */
71   - private KieBase coreKBase;
72   -
73   - //-------------------- 日志记录器 ---------------------//
74   - private Logger logger;
75   -
76   - public DroolsSchedulePlan(
77   - SchedulePlan schedulePlan,
78   - LineRepository lineRepository, ScheduleRule1FlatRepository scheduleRule1FlatRepository,
79   - TTInfoRepository ttInfoRepository, TTInfoDetailRepository ttInfoDetailRepository,
80   - CarConfigInfoRepository carConfigInfoRepository,
81   - EmployeeConfigInfoRepository employeeConfigInfoRepository,
82   - RerunRuleRepository rerunRuleRepository,
83   - BusinessRepository businessRepository,
84   - ScheduleRuleService scheduleRuleService,
85   - KieBase preKBase, KieBase coreKBase,
86   - Logger logger) {
87   -
88   - // 验证SchedulePlan实体
89   - if (schedulePlan == null) {
90   - throw new RuntimeException("排班用SchedulePlan为空!");
91   - }
92   - if (schedulePlan.getXl() == null) {
93   - throw new RuntimeException("排班线路为空!");
94   - } else {
95   - // 获取主线路
96   - this.mainLine = lineRepository.findOne(schedulePlan.getXl().getId());
97   - if (this.mainLine == null) {
98   - throw new RuntimeException("线路id=" + schedulePlan.getXl().getId() + "不存在!");
99   - }
100   - // 获取主线路套跑信息
101   - this.rerunRule_inputs = scheduleRuleService.findRerunrule(this.mainLine.getId());
102   - }
103   - if (schedulePlan.getScheduleFromTime() == null) {
104   - throw new RuntimeException("排班开始时间为空!");
105   - }
106   - if (schedulePlan.getScheduleToTime() == null) {
107   - throw new RuntimeException("排班结束时间为空!");
108   - }
109   - this.from = schedulePlan.getScheduleFromTime();
110   - this.to = schedulePlan.getScheduleToTime();
111   - if (schedulePlan.getTtInfoIds() == null) {
112   - throw new RuntimeException("排班关联的时刻表ids为空!");
113   - }
114   - if (schedulePlan.getTtInfoNames() == null) {
115   - throw new RuntimeException("排班关联的时刻表名字s为空!");
116   - }
117   - this.schedulePlan = schedulePlan;
118   -
119   - this.lineRepository = lineRepository;
120   - this.scheduleRule1FlatRepository = scheduleRule1FlatRepository;
121   - this.ttInfoRepository = ttInfoRepository;
122   - this.ttInfoDetailRepository = ttInfoDetailRepository;
123   - this.carConfigInfoRepository = carConfigInfoRepository;
124   - this.employeeConfigInfoRepository = employeeConfigInfoRepository;
125   - this.rerunRuleRepository = rerunRuleRepository;
126   - this.businessRepository = businessRepository;
127   - this.scheduleRuleService = scheduleRuleService;
128   - this.preKBase = preKBase;
129   - this.coreKBase = coreKBase;
130   -
131   - this.logger = logger;
132   -
133   - }
134   -
135   - public void generatePlan() {
136   - logger.info("<--- 排班master线路 id={}, name={}, 开始排班",
137   - this.mainLine.getId(), this.mainLine.getName());
138   -
139   - // 1、确定主线路排班(包含完全套跑路牌规则,所谓完全套跑路牌规则指整个路牌的班次都是套跑规则指定的)
140   - PlanResult planResult = this.schedulePlanWithOutRerun();
141   -
142   - // 2、确定套跑规则
143   - this.rerunPlanResult(planResult);
144   -
145   - // TODO:3-1、验证排班结果
146   - this.validPlanResult(planResult);
147   -
148   - // TODO:3-2、去除完全套跑遗漏班次(以后放到规则中执行)
149   - Iterator<SchedulePlanInfo> infoIterator = planResult.getSchedulePlanInfos().iterator();
150   - while (infoIterator.hasNext()) {
151   - SchedulePlanInfo schedulePlanInfo = infoIterator.next();
152   - if (schedulePlanInfo.getCl() == null) {
153   - infoIterator.remove();
154   - }
155   - }
156   -
157   - // 4、保存数据(jdbcTemplate 批量插入)
158   - Date start4 = new Date();
159   - this.scheduleRuleService.generateSchedulePlan(
160   - this.schedulePlan, planResult.getSchedulePlanInfos());
161   - Date end4 = new Date();
162   -
163   - this.logger.info("保存主线路数据 {} 条 耗时 {} ms --->",
164   - planResult.getSchedulePlanInfos().size(),
165   - end4.getTime() - start4.getTime());
166   - }
167   -
168   - /**
169   - * 计算规则输入。
170   - * @return
171   - */
172   - private List<ScheduleRule_input> calcuSrfList(Line line) {
173   - // 1-1、构造drools规则输入数据,输出数据
174   - // 全局计算参数
175   - SchedulePlan schedulePlan = new SchedulePlan();
176   - schedulePlan.setXl(line);
177   - schedulePlan.setScheduleFromTime(this.from);
178   - schedulePlan.setScheduleToTime(this.to);
179   - ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(schedulePlan);
180   -
181   - // 规则输出数据
182   - List<ScheduleRule_input> scheduleRule_inputs = new ArrayList<>();
183   -
184   - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
185   - // 创建session,内部配置的是stateful
186   - KieSession session = preKBase.newKieSession();
187   - // 设置gloable对象,在drl中通过别名使用
188   - session.setGlobal("sriList", scheduleRule_inputs);
189   - session.setGlobal("log", logger); // 设置日志
190   -
191   - session.setGlobal("srf", scheduleRule1FlatRepository);
192   - session.setGlobal("rrr", rerunRuleRepository);
193   - session.setGlobal("srservice", scheduleRuleService);
194   -
195   - // 载入数据
196   - session.insert(scheduleCalcuParam_input);
197   -
198   - // 执行rule
199   - session.fireAllRules();
200   -
201   - // 执行完毕销毁,有日志的也要关闭
202   - session.dispose();
203   -
204   - return scheduleRule_inputs;
205   - }
206   -
207   - /**
208   - * 时刻表选择(判定每天使用的时刻表,以及路牌数据输出)。
209   - * @return [TTInfoResults_output, LpInfoResults_output]
210   - */
211   - private Object[] ttInfoOutput(Line line) {
212   - // 获取线路的所有未作废的时刻表
213   - List<TTInfo> ttInfos = ttInfoRepository.findInCanceledByXl(line);
214   -
215   - // 1-1、构造drools规则输入数据,输出数据
216   - // 全局计算参数
217   - TTInfoCalcuParam_input ttInfoCalcuParam_input =
218   - new TTInfoCalcuParam_input(
219   - new DateTime(this.from),
220   - new DateTime(this.to),
221   - String.valueOf(line.getId())
222   - );
223   - // 规则输出数据
224   - TTInfoResults_output ttInfoResults_output = new TTInfoResults_output();
225   - LpInfoResults_output lpInfoResults_output = new LpInfoResults_output();
226   -
227   - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
228   - // 创建session,内部配置的是stateful
229   - KieSession session = coreKBase.newKieSession();
230   -
231   - // 设置gloable对象,在drl中通过别名使用
232   - session.setGlobal("results", ttInfoResults_output);
233   - session.setGlobal("lpInfoResults_output", lpInfoResults_output);
234   - session.setGlobal("log", logger); // 设置日志
235   - session.setGlobal("tTInfoDetailRepository", ttInfoDetailRepository);
236   -
237   - // 载入数据
238   - session.insert(ttInfoCalcuParam_input);
239   - for (TTInfo ttInfo : ttInfos) {
240   - TTInfo_input ttInfo_input = new TTInfo_input(ttInfo);
241   - session.insert(ttInfo_input);
242   - }
243   -
244   - // 载入数据2(计算规则最早启用时间)
245   - List<ScheduleRule1Flat> scheduleRule1Flats = scheduleRule1FlatRepository.findByXl(line);
246   -
247   - for (ScheduleRule1Flat scheduleRule1Flat: scheduleRule1Flats) {
248   - ScheduleRule_input scheduleRule_input = new ScheduleRule_input(scheduleRule1Flat);
249   - session.insert(scheduleRule_input);
250   - }
251   -
252   - // 执行rule
253   - session.fireAllRules();
254   -
255   - // 执行完毕销毁,有日志的也要关闭
256   - session.dispose();
257   -
258   - return new Object[] {ttInfoResults_output, lpInfoResults_output};
259   -
260   - }
261   -
262   - /**
263   - * 循环规则输出。
264   - * @param lpInfoResults_output 时刻表每日路牌的情况
265   - */
266   - private ScheduleResults_output loopRuleOutput(Line line, LpInfoResults_output lpInfoResults_output) {
267   - // 1-1、构造drools规则输入数据,输出数据
268   - // 全局计算参数
269   - SchedulePlan schedulePlan = new SchedulePlan();
270   - schedulePlan.setXl(line);
271   - schedulePlan.setScheduleFromTime(this.from);
272   - schedulePlan.setScheduleToTime(this.to);
273   - schedulePlan.setIsHistoryPlanFirst(this.schedulePlan.getIsHistoryPlanFirst());
274   - schedulePlan.setCreateBy(this.schedulePlan.getCreateBy());
275   - ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(schedulePlan);
276   - // 每个规则对应的输入参数
277   - List<ScheduleRule_input> scheduleRule_inputs = this.calcuSrfList(line);
278   -
279   - // 规则输出数据
280   - ScheduleResults_output scheduleResults_output = new ScheduleResults_output();
281   -
282   - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
283   - // 创建session,内部配置的是stateful
284   - KieSession session = coreKBase.newKieSession();
285   - // 设置gloable对象,在drl中通过别名使用
286   - session.setGlobal("scheduleResult", scheduleResults_output);
287   - session.setGlobal("log", logger); // 设置日志
288   - session.setGlobal("scheduleRuleService", scheduleRuleService);
289   -
290   - // 载入数据
291   - session.insert(scheduleCalcuParam_input);
292   - for (ScheduleRule_input scheduleRule_input : scheduleRule_inputs) {
293   - session.insert(scheduleRule_input);
294   - }
295   - // 每日时刻表路牌数据
296   - for (LpInfoResult_output lpInfoResult_output: lpInfoResults_output.getLpInfoResult_outputs()) {
297   - session.insert(lpInfoResult_output);
298   - }
299   - // 执行rule
300   - session.fireAllRules();
301   -
302   - // 执行完毕销毁,有日志的也要关闭
303   - session.dispose();
304   -
305   - // 保存循环规则结果数据
306   - scheduleRuleService.generateRuleResult(scheduleResults_output.getSchedulePlanRuleResults());
307   -
308   -// logger.info("循环规则输出={}", scheduleResults_output.showGuideboardDesc1());
309   -
310   - return scheduleResults_output;
311   - }
312   -
313   - /**
314   - * 排班生成。
315   - * @param scheduleResults_output loopRuleOutput方法规则输出
316   - * @param ttInfoResults_output ttInfoOutput方法规则输出
317   - * @return PlanResult
318   - */
319   - private PlanResult planResultOutput(
320   - Line line,
321   - ScheduleResults_output scheduleResults_output,
322   - TTInfoResults_output ttInfoResults_output) {
323   -
324   - SchedulePlan schedulePlan = new SchedulePlan();
325   - schedulePlan.setXl(line);
326   - schedulePlan.setScheduleFromTime(this.from);
327   - schedulePlan.setScheduleToTime(this.to);
328   - schedulePlan.setCreateBy(this.schedulePlan.getCreateBy());
329   - schedulePlan.setUpdateBy(this.schedulePlan.getUpdateBy());
330   -
331   - // 1-1、构造drools规则输入数据,输出数据
332   - PlanCalcuParam_input planCalcuParam_input = new PlanCalcuParam_input(
333   - schedulePlan,
334   - scheduleResults_output,
335   - ttInfoResults_output
336   - );
337   - // 规则输出数据
338   - PlanResult planResult = new PlanResult();
339   - planResult.setXlId(schedulePlan.getXl().getId().toString());
340   -
341   - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
342   - // 创建session,内部配置的是stateful
343   - KieSession session = this.coreKBase.newKieSession();
344   -
345   - // 设置gloable对象,在drl中通过别名使用
346   - session.setGlobal("planResult", planResult);
347   - session.setGlobal("log", this.logger); // 设置日志
348   -
349   - session.setGlobal("tTInfoDetailRepository", this.ttInfoDetailRepository);
350   - session.setGlobal("carConfigInfoRepository", this.carConfigInfoRepository);
351   - session.setGlobal("employeeConfigInfoRepository", this.employeeConfigInfoRepository);
352   - session.setGlobal("lineRepository", this.lineRepository);
353   - session.setGlobal("businessRepository", this.businessRepository);
354   -
355   - // 载入数据
356   - session.insert(planCalcuParam_input);
357   -
358   - // 执行rule
359   - session.fireAllRules();
360   -
361   - // 执行完毕销毁,有日志的也要关闭
362   - session.dispose();
363   -
364   - return planResult;
365   -
366   - }
367   -
368   - /**
369   - * 生成线路排班(不含套跑规则)。
370   - * @param schedulePlan
371   - * @return
372   - */
373   - private PlanResult schedulePlanWithOutRerun() {
374   - // 1、时刻表数据及每日路牌数据计算
375   - Date start1 = new Date();
376   - Object[] ttInfoRets = this.ttInfoOutput(this.mainLine);
377   - TTInfoResults_output ttInfoResults_output = (TTInfoResults_output) ttInfoRets[0];
378   - LpInfoResults_output lpInfoResults_output = (LpInfoResults_output) ttInfoRets[1];
379   - Date end1 = new Date();
380   - // 2、循环规则计算输出
381   - Date start2 = new Date();
382   - ScheduleResults_output scheduleResults_output = this.loopRuleOutput(
383   - this.mainLine, lpInfoResults_output);
384   - Date end2 = new Date();
385   -
386   - logger.info("规则计算结果={}", scheduleResults_output.showGuideboardDesc1());
387   -
388   - // 3、计划输出
389   - Date start3 = new Date();
390   - PlanResult planResult = planResultOutput(
391   - this.mainLine, scheduleResults_output, ttInfoResults_output);
392   - Date end3 = new Date();
393   -
394   - logger.info("drool时刻表每日路牌计算 {} ms,drool循环规则计算 {} ms,drool计划数据 {} ms",
395   - end1.getTime() - start1.getTime(),
396   - end2.getTime() - start2.getTime(),
397   - end3.getTime() - start3.getTime());
398   -
399   - // TODO:将lpInfoResults_output 也要返回
400   -
401   - return planResult;
402   - }
403   -
404   - /**
405   - * 套跑计划排班数据。
406   - * @param planResult
407   - */
408   - private void rerunPlanResult(PlanResult planResult) {
409   - logger.info("套跑数量 {} 组", this.rerunRule_inputs.size());
410   -
411   - if (this.rerunRule_inputs.size() > 0) {
412   - // 找出是对应路牌类型的线路,计算循环规则输出
413   - Set<String> dylpxlids = new HashSet<>();
414   - for (RerunRule_input rerunRule_input: rerunRule_inputs) {
415   - if ("dylp".equals(rerunRule_input.getType())) {
416   - dylpxlids.add(rerunRule_input.getS_xl()); // 参与套跑的线路
417   - }
418   - }
419   -
420   - List<ScheduleResults_output> scheduleResults_outputs = new ArrayList<>();
421   - Date start1 = new Date();
422   - for (String xlid: dylpxlids) {
423   - Line dylpline = new Line(); // 套跑的线路默认跟着主线路设定走
424   - dylpline.setId(Integer.parseInt(xlid));
425   - // 获取套跑线路的循环规则计算输出
426   - Object[] ttInfoRets = this.ttInfoOutput(dylpline);
427   - LpInfoResults_output lpInfoResults_output = (LpInfoResults_output) ttInfoRets[1];
428   - ScheduleResults_output scheduleResults_output = this.loopRuleOutput(
429   - dylpline, lpInfoResults_output);
430   - scheduleResults_outputs.add(scheduleResults_output);
431   - }
432   -
433   - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
434   - // 创建session,内部配置的是stateful
435   - KieSession session = this.coreKBase.newKieSession();
436   -
437   - // 设置gloable对象,在drl中通过别名使用
438   - session.setGlobal("planResult", planResult);
439   - session.setGlobal("log", this.logger); // 设置日志
440   -
441   - session.setGlobal("carConfigInfoRepository", this.carConfigInfoRepository);
442   - session.setGlobal("employeeConfigInfoRepository", this.employeeConfigInfoRepository);
443   -
444   - // 载入数据
445   - RerunRule_param rerunRule_param = new RerunRule_param();
446   - rerunRule_param.setMxlid(planResult.getXlId());
447   - rerunRule_param.setXlIds_dylp(dylpxlids);
448   - session.insert(rerunRule_param);
449   - for (RerunRule_input rri: this.rerunRule_inputs) {
450   - session.insert(rri);
451   - }
452   - for (SchedulePlanInfo spi: planResult.getSchedulePlanInfos()) {
453   - session.insert(spi);
454   - }
455   - for (ScheduleResults_output sro: scheduleResults_outputs) {
456   - session.insert(sro);
457   - }
458   -
459   - // 执行rule
460   - session.fireAllRules();
461   -
462   - // 执行完毕销毁,有日志的也要关闭
463   - session.dispose();
464   -
465   - Date end1 = new Date();
466   - logger.info("套跑规则计算,耗时 {} ms", end1.getTime() - start1.getTime());
467   -
468   - }
469   -
470   - }
471   -
472   - /**
473   - * 验证排班结果。
474   - * @param planResult
475   - * @param schedulePlan
476   - */
477   - public void validPlanResult(PlanResult planResult) {
478   - // 1-1、构造drools规则输入数据,输出数据
479   - ValidateParam validateParam = new ValidateParam(
480   - new DateTime(this.from), new DateTime(this.to));
481   - // 规则输出数据
482   - ValidateResults_output result = new ValidateResults_output();
483   -
484   - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
485   - // 创建session,内部配置的是stateful
486   - KieSession session = this.coreKBase.newKieSession();
487   -
488   - // 设置gloable对象,在drl中通过别名使用
489   - session.setGlobal("validResult", result);
490   - session.setGlobal("log", this.logger); // 设置日志
491   -
492   - // 载入数据
493   - session.insert(validateParam);
494   - for (SchedulePlanInfo schedulePlanInfo: planResult.getSchedulePlanInfos()) {
495   - session.insert(schedulePlanInfo);
496   - }
497   -
498   - // 执行rule
499   - session.fireAllRules();
500   -
501   - // 执行完毕销毁,有日志的也要关闭
502   - session.dispose();
503   -
504   -// logger.info("错误总数={}", result.getInfos().size());
505   -// for (ValidateResults_output.ValidInfo validInfo: result.getInfos()) {
506   -// logger.info(validInfo.getDesc());
507   -// }
508   -
509   - // 取10条错误
510   - int size = result.getInfos().size() > 10 ? 10: result.getInfos().size();
511   - List<String> desclist = new ArrayList<>();
512   - for (int i = 0; i < size; i++) {
513   - desclist.add(result.getInfos().get(i).getDesc());
514   - }
515   - if (desclist.size() > 0) {
516   - this.schedulePlan.setPlanResult(StringUtils.join(desclist, "</br>"));
517   - } else {
518   - this.schedulePlan.setPlanResult("ok");
519   - }
520   -
521   - // TODO:设定错误信息
522   - }
523   -
524   -}
  1 +package com.bsth.service.schedule.plan;
  2 +
  3 +import com.bsth.entity.Line;
  4 +import com.bsth.entity.schedule.SchedulePlan;
  5 +import com.bsth.entity.schedule.SchedulePlanInfo;
  6 +import com.bsth.entity.schedule.TTInfo;
  7 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  8 +import com.bsth.repository.BusinessRepository;
  9 +import com.bsth.repository.LineRepository;
  10 +import com.bsth.repository.schedule.*;
  11 +import com.bsth.service.schedule.rules.ScheduleRuleService;
  12 +import com.bsth.service.schedule.rules.plan.PlanCalcuParam_input;
  13 +import com.bsth.service.schedule.rules.plan.PlanResult;
  14 +import com.bsth.service.schedule.rules.rerun.RerunRule_input;
  15 +import com.bsth.service.schedule.rules.rerun.RerunRule_param;
  16 +import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;
  17 +import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output;
  18 +import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;
  19 +import com.bsth.service.schedule.rules.ttinfo.*;
  20 +import com.bsth.service.schedule.rules.validate.ValidateParam;
  21 +import com.bsth.service.schedule.rules.validate.ValidateResults_output;
  22 +import org.apache.commons.lang3.StringUtils;
  23 +import org.joda.time.DateTime;
  24 +import org.kie.api.KieBase;
  25 +import org.kie.api.runtime.KieSession;
  26 +import org.slf4j.Logger;
  27 +
  28 +import java.util.*;
  29 +
  30 +/**
  31 + * 排班计划(使用Drools)。
  32 + */
  33 +public class DroolsSchedulePlan {
  34 + /** 主线路 */
  35 + private Line mainLine;
  36 + /** 套跑辅线路规则 */
  37 + private List<RerunRule_input> rerunRule_inputs;
  38 +
  39 + /** 开始排班时间 */
  40 + private Date from;
  41 + /** 结束排班时间 */
  42 + private Date to;
  43 + /** 排班计划entity */
  44 + private SchedulePlan schedulePlan;
  45 +
  46 + //-------------------- 相关的Repo,service服务 --------------------//
  47 + /** 线路Repo */
  48 + private LineRepository lineRepository;
  49 + /** 排班规则Repo */
  50 + private ScheduleRule1FlatRepository scheduleRule1FlatRepository;
  51 + /** 时刻表Repo */
  52 + private TTInfoRepository ttInfoRepository;
  53 + /** 时刻表明细Repo */
  54 + private TTInfoDetailRepository ttInfoDetailRepository;
  55 + /** 车辆配置Repo */
  56 + private CarConfigInfoRepository carConfigInfoRepository;
  57 + /** 人员配置Repo */
  58 + private EmployeeConfigInfoRepository employeeConfigInfoRepository;
  59 + /** 套跑规则Repo */
  60 + private RerunRuleRepository rerunRuleRepository;
  61 + /** 营运状态Repo */
  62 + private BusinessRepository businessRepository;
  63 +
  64 + /** 排班规则service */
  65 + private ScheduleRuleService scheduleRuleService;
  66 +
  67 + //-------------------- Drools KBase实例 ------------------//
  68 + /** 排班预处理KBase */
  69 + private KieBase preKBase;
  70 + /** 排班核心KBase */
  71 + private KieBase coreKBase;
  72 +
  73 + //-------------------- 日志记录器 ---------------------//
  74 + private Logger logger;
  75 +
  76 + public DroolsSchedulePlan(
  77 + SchedulePlan schedulePlan,
  78 + LineRepository lineRepository, ScheduleRule1FlatRepository scheduleRule1FlatRepository,
  79 + TTInfoRepository ttInfoRepository, TTInfoDetailRepository ttInfoDetailRepository,
  80 + CarConfigInfoRepository carConfigInfoRepository,
  81 + EmployeeConfigInfoRepository employeeConfigInfoRepository,
  82 + RerunRuleRepository rerunRuleRepository,
  83 + BusinessRepository businessRepository,
  84 + ScheduleRuleService scheduleRuleService,
  85 + KieBase preKBase, KieBase coreKBase,
  86 + Logger logger) {
  87 +
  88 + // 验证SchedulePlan实体
  89 + if (schedulePlan == null) {
  90 + throw new RuntimeException("排班用SchedulePlan为空!");
  91 + }
  92 + if (schedulePlan.getXl() == null) {
  93 + throw new RuntimeException("排班线路为空!");
  94 + } else {
  95 + // 获取主线路
  96 + this.mainLine = lineRepository.findOne(schedulePlan.getXl().getId());
  97 + if (this.mainLine == null) {
  98 + throw new RuntimeException("线路id=" + schedulePlan.getXl().getId() + "不存在!");
  99 + }
  100 + // 获取主线路套跑信息
  101 + this.rerunRule_inputs = scheduleRuleService.findRerunrule(this.mainLine.getId());
  102 + }
  103 + if (schedulePlan.getScheduleFromTime() == null) {
  104 + throw new RuntimeException("排班开始时间为空!");
  105 + }
  106 + if (schedulePlan.getScheduleToTime() == null) {
  107 + throw new RuntimeException("排班结束时间为空!");
  108 + }
  109 + this.from = schedulePlan.getScheduleFromTime();
  110 + this.to = schedulePlan.getScheduleToTime();
  111 + if (schedulePlan.getTtInfoIds() == null) {
  112 + throw new RuntimeException("排班关联的时刻表ids为空!");
  113 + }
  114 + if (schedulePlan.getTtInfoNames() == null) {
  115 + throw new RuntimeException("排班关联的时刻表名字s为空!");
  116 + }
  117 + this.schedulePlan = schedulePlan;
  118 +
  119 + this.lineRepository = lineRepository;
  120 + this.scheduleRule1FlatRepository = scheduleRule1FlatRepository;
  121 + this.ttInfoRepository = ttInfoRepository;
  122 + this.ttInfoDetailRepository = ttInfoDetailRepository;
  123 + this.carConfigInfoRepository = carConfigInfoRepository;
  124 + this.employeeConfigInfoRepository = employeeConfigInfoRepository;
  125 + this.rerunRuleRepository = rerunRuleRepository;
  126 + this.businessRepository = businessRepository;
  127 + this.scheduleRuleService = scheduleRuleService;
  128 + this.preKBase = preKBase;
  129 + this.coreKBase = coreKBase;
  130 +
  131 + this.logger = logger;
  132 +
  133 + }
  134 +
  135 + public void generatePlan() {
  136 + logger.info("<--- 排班master线路 id={}, name={}, 开始排班",
  137 + this.mainLine.getId(), this.mainLine.getName());
  138 +
  139 + // 1、确定主线路排班(包含完全套跑路牌规则,所谓完全套跑路牌规则指整个路牌的班次都是套跑规则指定的)
  140 + PlanResult planResult = this.schedulePlanWithOutRerun();
  141 +
  142 + // 2、确定套跑规则
  143 + this.rerunPlanResult(planResult);
  144 +
  145 + // TODO:3-1、验证排班结果
  146 + this.validPlanResult(planResult);
  147 +
  148 + // TODO:3-2、去除完全套跑遗漏班次(以后放到规则中执行)
  149 + Iterator<SchedulePlanInfo> infoIterator = planResult.getSchedulePlanInfos().iterator();
  150 + while (infoIterator.hasNext()) {
  151 + SchedulePlanInfo schedulePlanInfo = infoIterator.next();
  152 + if (schedulePlanInfo.getCl() == null) {
  153 + infoIterator.remove();
  154 + }
  155 + }
  156 +
  157 + // 4、保存数据(jdbcTemplate 批量插入)
  158 + Date start4 = new Date();
  159 + this.scheduleRuleService.generateSchedulePlan(
  160 + this.schedulePlan, planResult.getSchedulePlanInfos());
  161 + Date end4 = new Date();
  162 +
  163 + this.logger.info("保存主线路数据 {} 条 耗时 {} ms --->",
  164 + planResult.getSchedulePlanInfos().size(),
  165 + end4.getTime() - start4.getTime());
  166 + }
  167 +
  168 + /**
  169 + * 计算规则输入。
  170 + * @return
  171 + */
  172 + private List<ScheduleRule_input> calcuSrfList(Line line) {
  173 + // 1-1、构造drools规则输入数据,输出数据
  174 + // 全局计算参数
  175 + SchedulePlan schedulePlan = new SchedulePlan();
  176 + schedulePlan.setXl(line);
  177 + schedulePlan.setScheduleFromTime(this.from);
  178 + schedulePlan.setScheduleToTime(this.to);
  179 + ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(schedulePlan);
  180 +
  181 + // 规则输出数据
  182 + List<ScheduleRule_input> scheduleRule_inputs = new ArrayList<>();
  183 +
  184 + // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
  185 + // 创建session,内部配置的是stateful
  186 + KieSession session = preKBase.newKieSession();
  187 + // 设置gloable对象,在drl中通过别名使用
  188 + session.setGlobal("sriList", scheduleRule_inputs);
  189 + session.setGlobal("log", logger); // 设置日志
  190 +
  191 + session.setGlobal("srf", scheduleRule1FlatRepository);
  192 + session.setGlobal("rrr", rerunRuleRepository);
  193 + session.setGlobal("srservice", scheduleRuleService);
  194 +
  195 + // 载入数据
  196 + session.insert(scheduleCalcuParam_input);
  197 +
  198 + // 执行rule
  199 + session.fireAllRules();
  200 +
  201 + // 执行完毕销毁,有日志的也要关闭
  202 + session.dispose();
  203 +
  204 + return scheduleRule_inputs;
  205 + }
  206 +
  207 + /**
  208 + * 时刻表选择(判定每天使用的时刻表,以及路牌数据输出)。
  209 + * @return [TTInfoResults_output, LpInfoResults_output]
  210 + */
  211 + private Object[] ttInfoOutput(Line line) {
  212 + // 获取线路的所有未作废的时刻表
  213 + List<TTInfo> ttInfos = ttInfoRepository.findInCanceledByXl(line);
  214 +
  215 + // 1-1、构造drools规则输入数据,输出数据
  216 + // 全局计算参数
  217 + TTInfoCalcuParam_input ttInfoCalcuParam_input =
  218 + new TTInfoCalcuParam_input(
  219 + new DateTime(this.from),
  220 + new DateTime(this.to),
  221 + String.valueOf(line.getId())
  222 + );
  223 + // 规则输出数据
  224 + TTInfoResults_output ttInfoResults_output = new TTInfoResults_output();
  225 + LpInfoResults_output lpInfoResults_output = new LpInfoResults_output();
  226 +
  227 + // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
  228 + // 创建session,内部配置的是stateful
  229 + KieSession session = coreKBase.newKieSession();
  230 +
  231 + // 设置gloable对象,在drl中通过别名使用
  232 + session.setGlobal("results", ttInfoResults_output);
  233 + session.setGlobal("lpInfoResults_output", lpInfoResults_output);
  234 + session.setGlobal("log", logger); // 设置日志
  235 + session.setGlobal("tTInfoDetailRepository", ttInfoDetailRepository);
  236 +
  237 + // 载入数据
  238 + session.insert(ttInfoCalcuParam_input);
  239 + for (TTInfo ttInfo : ttInfos) {
  240 + TTInfo_input ttInfo_input = new TTInfo_input(ttInfo);
  241 + session.insert(ttInfo_input);
  242 + }
  243 +
  244 + // 载入数据2(计算规则最早启用时间)
  245 + List<ScheduleRule1Flat> scheduleRule1Flats = scheduleRule1FlatRepository.findByXl(line);
  246 +
  247 + for (ScheduleRule1Flat scheduleRule1Flat: scheduleRule1Flats) {
  248 + ScheduleRule_input scheduleRule_input = new ScheduleRule_input(scheduleRule1Flat);
  249 + session.insert(scheduleRule_input);
  250 + }
  251 +
  252 + // 执行rule
  253 + session.fireAllRules();
  254 +
  255 + // 执行完毕销毁,有日志的也要关闭
  256 + session.dispose();
  257 +
  258 + return new Object[] {ttInfoResults_output, lpInfoResults_output};
  259 +
  260 + }
  261 +
  262 + /**
  263 + * 循环规则输出。
  264 + * @param lpInfoResults_output 时刻表每日路牌的情况
  265 + */
  266 + private ScheduleResults_output loopRuleOutput(Line line, LpInfoResults_output lpInfoResults_output) {
  267 + // 1-1、构造drools规则输入数据,输出数据
  268 + // 全局计算参数
  269 + SchedulePlan schedulePlan = new SchedulePlan();
  270 + schedulePlan.setXl(line);
  271 + schedulePlan.setScheduleFromTime(this.from);
  272 + schedulePlan.setScheduleToTime(this.to);
  273 + schedulePlan.setIsHistoryPlanFirst(this.schedulePlan.getIsHistoryPlanFirst());
  274 + schedulePlan.setCreateBy(this.schedulePlan.getCreateBy());
  275 + ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(schedulePlan);
  276 + // 每个规则对应的输入参数
  277 + List<ScheduleRule_input> scheduleRule_inputs = this.calcuSrfList(line);
  278 +
  279 + // 规则输出数据
  280 + ScheduleResults_output scheduleResults_output = new ScheduleResults_output();
  281 +
  282 + // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
  283 + // 创建session,内部配置的是stateful
  284 + KieSession session = coreKBase.newKieSession();
  285 + // 设置gloable对象,在drl中通过别名使用
  286 + session.setGlobal("scheduleResult", scheduleResults_output);
  287 + session.setGlobal("log", logger); // 设置日志
  288 + session.setGlobal("scheduleRuleService", scheduleRuleService);
  289 +
  290 + // 载入数据
  291 + session.insert(scheduleCalcuParam_input);
  292 + for (ScheduleRule_input scheduleRule_input : scheduleRule_inputs) {
  293 + session.insert(scheduleRule_input);
  294 + }
  295 + // 每日时刻表路牌数据
  296 + for (LpInfoResult_output lpInfoResult_output: lpInfoResults_output.getLpInfoResult_outputs()) {
  297 + session.insert(lpInfoResult_output);
  298 + }
  299 + // 执行rule
  300 + session.fireAllRules();
  301 +
  302 + // 执行完毕销毁,有日志的也要关闭
  303 + session.dispose();
  304 +
  305 + // 保存循环规则结果数据
  306 + scheduleRuleService.generateRuleResult(scheduleResults_output.getSchedulePlanRuleResults());
  307 +
  308 +// logger.info("循环规则输出={}", scheduleResults_output.showGuideboardDesc1());
  309 +
  310 + return scheduleResults_output;
  311 + }
  312 +
  313 + /**
  314 + * 排班生成。
  315 + * @param scheduleResults_output loopRuleOutput方法规则输出
  316 + * @param ttInfoResults_output ttInfoOutput方法规则输出
  317 + * @return PlanResult
  318 + */
  319 + private PlanResult planResultOutput(
  320 + Line line,
  321 + ScheduleResults_output scheduleResults_output,
  322 + TTInfoResults_output ttInfoResults_output) {
  323 +
  324 + SchedulePlan schedulePlan = new SchedulePlan();
  325 + schedulePlan.setXl(line);
  326 + schedulePlan.setScheduleFromTime(this.from);
  327 + schedulePlan.setScheduleToTime(this.to);
  328 + schedulePlan.setCreateBy(this.schedulePlan.getCreateBy());
  329 + schedulePlan.setUpdateBy(this.schedulePlan.getUpdateBy());
  330 +
  331 + // 1-1、构造drools规则输入数据,输出数据
  332 + PlanCalcuParam_input planCalcuParam_input = new PlanCalcuParam_input(
  333 + schedulePlan,
  334 + scheduleResults_output,
  335 + ttInfoResults_output
  336 + );
  337 + // 规则输出数据
  338 + PlanResult planResult = new PlanResult();
  339 + planResult.setXlId(schedulePlan.getXl().getId().toString());
  340 +
  341 + // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
  342 + // 创建session,内部配置的是stateful
  343 + KieSession session = this.coreKBase.newKieSession();
  344 +
  345 + // 设置gloable对象,在drl中通过别名使用
  346 + session.setGlobal("planResult", planResult);
  347 + session.setGlobal("log", this.logger); // 设置日志
  348 +
  349 + session.setGlobal("tTInfoDetailRepository", this.ttInfoDetailRepository);
  350 + session.setGlobal("carConfigInfoRepository", this.carConfigInfoRepository);
  351 + session.setGlobal("employeeConfigInfoRepository", this.employeeConfigInfoRepository);
  352 + session.setGlobal("lineRepository", this.lineRepository);
  353 + session.setGlobal("businessRepository", this.businessRepository);
  354 +
  355 + // 载入数据
  356 + session.insert(planCalcuParam_input);
  357 +
  358 + // 执行rule
  359 + session.fireAllRules();
  360 +
  361 + // 执行完毕销毁,有日志的也要关闭
  362 + session.dispose();
  363 +
  364 + return planResult;
  365 +
  366 + }
  367 +
  368 + /**
  369 + * 生成线路排班(不含套跑规则)。
  370 + * @param schedulePlan
  371 + * @return
  372 + */
  373 + private PlanResult schedulePlanWithOutRerun() {
  374 + // 1、时刻表数据及每日路牌数据计算
  375 + Date start1 = new Date();
  376 + Object[] ttInfoRets = this.ttInfoOutput(this.mainLine);
  377 + TTInfoResults_output ttInfoResults_output = (TTInfoResults_output) ttInfoRets[0];
  378 + LpInfoResults_output lpInfoResults_output = (LpInfoResults_output) ttInfoRets[1];
  379 + Date end1 = new Date();
  380 + // 2、循环规则计算输出
  381 + Date start2 = new Date();
  382 + ScheduleResults_output scheduleResults_output = this.loopRuleOutput(
  383 + this.mainLine, lpInfoResults_output);
  384 + Date end2 = new Date();
  385 +
  386 + logger.info("规则计算结果={}", scheduleResults_output.showGuideboardDesc1());
  387 +
  388 + // 3、计划输出
  389 + Date start3 = new Date();
  390 + PlanResult planResult = planResultOutput(
  391 + this.mainLine, scheduleResults_output, ttInfoResults_output);
  392 + Date end3 = new Date();
  393 +
  394 + logger.info("drool时刻表每日路牌计算 {} ms,drool循环规则计算 {} ms,drool计划数据 {} ms",
  395 + end1.getTime() - start1.getTime(),
  396 + end2.getTime() - start2.getTime(),
  397 + end3.getTime() - start3.getTime());
  398 +
  399 + // TODO:将lpInfoResults_output 也要返回
  400 +
  401 + return planResult;
  402 + }
  403 +
  404 + /**
  405 + * 套跑计划排班数据。
  406 + * @param planResult
  407 + */
  408 + private void rerunPlanResult(PlanResult planResult) {
  409 + logger.info("套跑数量 {} 组", this.rerunRule_inputs.size());
  410 +
  411 + if (this.rerunRule_inputs.size() > 0) {
  412 + // 找出是对应路牌类型的线路,计算循环规则输出
  413 + Set<String> dylpxlids = new HashSet<>();
  414 + for (RerunRule_input rerunRule_input: rerunRule_inputs) {
  415 + if ("dylp".equals(rerunRule_input.getType())) {
  416 + dylpxlids.add(rerunRule_input.getS_xl()); // 参与套跑的线路
  417 + }
  418 + }
  419 +
  420 + List<ScheduleResults_output> scheduleResults_outputs = new ArrayList<>();
  421 + Date start1 = new Date();
  422 + for (String xlid: dylpxlids) {
  423 + Line dylpline = new Line(); // 套跑的线路默认跟着主线路设定走
  424 + dylpline.setId(Integer.parseInt(xlid));
  425 + // 获取套跑线路的循环规则计算输出
  426 + Object[] ttInfoRets = this.ttInfoOutput(dylpline);
  427 + LpInfoResults_output lpInfoResults_output = (LpInfoResults_output) ttInfoRets[1];
  428 + ScheduleResults_output scheduleResults_output = this.loopRuleOutput(
  429 + dylpline, lpInfoResults_output);
  430 + scheduleResults_outputs.add(scheduleResults_output);
  431 + }
  432 +
  433 + // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
  434 + // 创建session,内部配置的是stateful
  435 + KieSession session = this.coreKBase.newKieSession();
  436 +
  437 + // 设置gloable对象,在drl中通过别名使用
  438 + session.setGlobal("planResult", planResult);
  439 + session.setGlobal("log", this.logger); // 设置日志
  440 +
  441 + session.setGlobal("carConfigInfoRepository", this.carConfigInfoRepository);
  442 + session.setGlobal("employeeConfigInfoRepository", this.employeeConfigInfoRepository);
  443 +
  444 + // 载入数据
  445 + RerunRule_param rerunRule_param = new RerunRule_param();
  446 + rerunRule_param.setMxlid(planResult.getXlId());
  447 + rerunRule_param.setXlIds_dylp(dylpxlids);
  448 + session.insert(rerunRule_param);
  449 + for (RerunRule_input rri: this.rerunRule_inputs) {
  450 + session.insert(rri);
  451 + }
  452 + for (SchedulePlanInfo spi: planResult.getSchedulePlanInfos()) {
  453 + session.insert(spi);
  454 + }
  455 + for (ScheduleResults_output sro: scheduleResults_outputs) {
  456 + session.insert(sro);
  457 + }
  458 +
  459 + // 执行rule
  460 + session.fireAllRules();
  461 +
  462 + // 执行完毕销毁,有日志的也要关闭
  463 + session.dispose();
  464 +
  465 + Date end1 = new Date();
  466 + logger.info("套跑规则计算,耗时 {} ms", end1.getTime() - start1.getTime());
  467 +
  468 + }
  469 +
  470 + }
  471 +
  472 + /**
  473 + * 验证排班结果。
  474 + * @param planResult
  475 + * @param schedulePlan
  476 + */
  477 + public void validPlanResult(PlanResult planResult) {
  478 + // 1-1、构造drools规则输入数据,输出数据
  479 + ValidateParam validateParam = new ValidateParam(
  480 + new DateTime(this.from), new DateTime(this.to));
  481 + // 规则输出数据
  482 + ValidateResults_output result = new ValidateResults_output();
  483 +
  484 + // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
  485 + // 创建session,内部配置的是stateful
  486 + KieSession session = this.coreKBase.newKieSession();
  487 +
  488 + // 设置gloable对象,在drl中通过别名使用
  489 + session.setGlobal("validResult", result);
  490 + session.setGlobal("log", this.logger); // 设置日志
  491 +
  492 + // 载入数据
  493 + session.insert(validateParam);
  494 + for (SchedulePlanInfo schedulePlanInfo: planResult.getSchedulePlanInfos()) {
  495 + session.insert(schedulePlanInfo);
  496 + }
  497 +
  498 + // 执行rule
  499 + session.fireAllRules();
  500 +
  501 + // 执行完毕销毁,有日志的也要关闭
  502 + session.dispose();
  503 +
  504 +// logger.info("错误总数={}", result.getInfos().size());
  505 +// for (ValidateResults_output.ValidInfo validInfo: result.getInfos()) {
  506 +// logger.info(validInfo.getDesc());
  507 +// }
  508 +
  509 + // 取10条错误
  510 + int size = result.getInfos().size() > 10 ? 10: result.getInfos().size();
  511 + List<String> desclist = new ArrayList<>();
  512 + for (int i = 0; i < size; i++) {
  513 + desclist.add(result.getInfos().get(i).getDesc());
  514 + }
  515 + if (desclist.size() > 0) {
  516 + this.schedulePlan.setPlanResult(StringUtils.join(desclist, "</br>"));
  517 + } else {
  518 + this.schedulePlan.setPlanResult("ok");
  519 + }
  520 +
  521 + // TODO:设定错误信息
  522 + }
  523 +
  524 +}
... ...
src/main/java/com/bsth/service/schedule/timetable/ExcelData.java
1   -package com.bsth.service.schedule.timetable;
2   -
3   -import com.bsth.entity.Line;
4   -import com.bsth.entity.LsStationRoute;
5   -import com.bsth.entity.schedule.GuideboardInfo;
6   -import com.bsth.service.LineService;
7   -import com.bsth.service.StationRouteService;
8   -import com.bsth.service.schedule.GuideboardInfoService;
9   -import com.bsth.service.schedule.exception.ScheduleException;
10   -import com.bsth.service.schedule.utils.DataToolsFile;
11   -import com.bsth.service.schedule.utils.DataToolsFileType;
12   -import com.bsth.service.schedule.utils.PoiUtils;
13   -import org.apache.commons.lang3.StringUtils;
14   -import org.apache.poi.ss.usermodel.Cell;
15   -import org.apache.poi.ss.usermodel.Row;
16   -import org.apache.poi.ss.usermodel.Sheet;
17   -import org.apache.poi.ss.usermodel.Workbook;
18   -import org.springframework.util.CollectionUtils;
19   -
20   -import java.io.File;
21   -import java.util.ArrayList;
22   -import java.util.HashMap;
23   -import java.util.List;
24   -import java.util.Map;
25   -import java.util.regex.Matcher;
26   -import java.util.regex.Pattern;
27   -
28   -/**
29   - * 时刻表Excel数据类。
30   - */
31   -public class ExcelData {
32   -
33   - /** 导入后的Excel文件对象 */
34   - private DataToolsFile dataToolsFile;
35   - /** 数据sheet名 */
36   - private String sheetName;
37   - /** 线路 */
38   - private Line line;
39   - /** 线路路由列表(包含上下行的起终点站) */
40   - private List<LsStationRoute> lsStationRouteList;
41   - /** 路牌列表 */
42   - private List<GuideboardInfo> guideboardInfoList;
43   - /** excel数据格式 */
44   - private ExcelFormatType excelFormatType;
45   -
46   - public DataToolsFile getDataToolsFile() {
47   - return dataToolsFile;
48   - }
49   -
50   - public void setDataToolsFile(DataToolsFile dataToolsFile) {
51   - this.dataToolsFile = dataToolsFile;
52   - }
53   -
54   - public String getSheetName() {
55   - return sheetName;
56   - }
57   -
58   - public void setSheetName(String sheetName) {
59   - this.sheetName = sheetName;
60   - }
61   -
62   - public Line getLine() {
63   - return line;
64   - }
65   -
66   - public void setLine(Line line) {
67   - this.line = line;
68   - }
69   -
70   - public List<LsStationRoute> getLsStationRouteList() {
71   - return lsStationRouteList;
72   - }
73   -
74   - public void setLsStationRouteList(List<LsStationRoute> lsStationRouteList) {
75   - this.lsStationRouteList = lsStationRouteList;
76   - }
77   -
78   - public List<GuideboardInfo> getGuideboardInfoList() {
79   - return guideboardInfoList;
80   - }
81   -
82   - public void setGuideboardInfoList(List<GuideboardInfo> guideboardInfoList) {
83   - this.guideboardInfoList = guideboardInfoList;
84   - }
85   -
86   - public ExcelFormatType getExcelFormatType() {
87   - return excelFormatType;
88   - }
89   -
90   - public void setExcelFormatType(ExcelFormatType excelFormatType) {
91   - this.excelFormatType = excelFormatType;
92   - }
93   -
94   - /**
95   - * 构造函数
96   - * @param filePath 文件路径
97   - * @param sheetName sheet名字
98   - * @param lineId 线路Id
99   - * @param lineService LineServiceImpl
100   - * @param guideboardInfoService GuideboardInfoServiceImpl
101   - * @param lineRouteVersion 线路路由版本
102   - * @param stationRouteService StationRouteServiceImpl
103   - * @param excelFormatType excel数据格式
104   - * @throws ScheduleException
105   - * @see com.bsth.service.impl.LineServiceImpl
106   - * @see com.bsth.service.schedule.impl.GuideboardInfoServiceImpl
107   - * @see com.bsth.service.impl.StationRouteServiceImpl
108   - */
109   - public ExcelData(
110   - String filePath, String sheetName,
111   - Integer lineId, LineService lineService, GuideboardInfoService guideboardInfoService,
112   - Integer lineRouteVersion, StationRouteService stationRouteService,
113   - ExcelFormatType excelFormatType) throws ScheduleException {
114   - // 获取Excel文件对象,类型
115   - File file = new File(filePath);
116   - this.dataToolsFile = new DataToolsFile();
117   - this.dataToolsFile.setFile(file);
118   - if (DataToolsFileType.XLS.isThisType(file)) {
119   - this.dataToolsFile.setFileType(DataToolsFileType.XLS);
120   - } else if (DataToolsFileType.XLSX.isThisType(file)) {
121   - this.dataToolsFile.setFileType(DataToolsFileType.XLSX);
122   - } else {
123   - throw new ScheduleException("不是xls xlsx文件!");
124   - }
125   -
126   - // sheet名字
127   - this.sheetName = sheetName;
128   - // 线路
129   - this.line = lineService.findById(lineId);
130   - // 线路路由列表
131   - Map<String, Object> p1 = new HashMap<>();
132   - p1.put("line.id_eq", lineId);
133   - p1.put("stationMark_in", "B,E"); // 起点站
134   - p1.put("destroy_eq", 0); // 未撤销
135   - p1.put("versions_eq", lineRouteVersion); // 带线路版本
136   - lsStationRouteList = (List<LsStationRoute>) stationRouteService.list_ls(p1);
137   - // 路牌列表
138   - p1.clear();
139   - p1.put("xl.id_eq", lineId);
140   - p1.put("isCancel_eq", false);
141   - guideboardInfoList = guideboardInfoService.list(p1);
142   -
143   - // excel数据格式
144   - this.excelFormatType = excelFormatType;
145   - }
146   -
147   - /**
148   - * 验证路由名字。
149   - * @param colNum 列标号(从0开始)
150   - * @param routeName 路由名字
151   - * @throws ScheduleException
152   - */
153   - private void validateRouteName(int colNum, String routeName) throws ScheduleException {
154   - List<LsStationRoute> lsStationRoutes = new ArrayList<>();
155   - for (LsStationRoute lsStationRoute : this.lsStationRouteList) {
156   - if ("B".equals(lsStationRoute.getStationMark()) && routeName.equals(lsStationRoute.getStationName())) {
157   - lsStationRoutes.add(lsStationRoute);
158   - }
159   - }
160   -
161   - if (CollectionUtils.isEmpty(lsStationRoutes)) {
162   - throw new ScheduleException(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站",
163   - colNum + 1, routeName, this.line.getName()));
164   - } else if (lsStationRoutes.size() > 1) {
165   - throw new ScheduleException(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站",
166   - colNum + 1, routeName, this.line.getName()));
167   - } else if (StringUtils.isEmpty(lsStationRoutes.get(0).getStationCode())) {
168   - throw new ScheduleException(String.format("第1行,第%d列数据%s在%s站点路由中没有站点编码",
169   - colNum + 1, routeName, this.line.getName()));
170   - }
171   -
172   - }
173   -
174   - /**
175   - * 验证路牌名字。
176   - * @param colNum excelSheet 列index
177   - * @param guideboardName 路牌名字
178   - * @throws ScheduleException
179   - */
180   - private void validateGuideboardName(int colNum, String guideboardName) throws ScheduleException {
181   - List<GuideboardInfo> guideboardInfos = new ArrayList<>();
182   - for (GuideboardInfo guideboardInfo : this.guideboardInfoList) {
183   - if (guideboardName.equals(guideboardInfo.getLpName())) {
184   - guideboardInfos.add(guideboardInfo);
185   - }
186   - }
187   -
188   - if (CollectionUtils.isEmpty(guideboardInfos)) {
189   - throw new ScheduleException(String.format("第%d行,第1列的路牌在%s中不存在",
190   - colNum + 1, this.line.getName()));
191   - } else if (guideboardInfos.size() > 1) {
192   - throw new ScheduleException(String.format("第%d行,第1列的路牌在%s中重复",
193   - colNum + 1, this.line.getName()));
194   - }
195   - }
196   -
197   - /**
198   - * 验证发车时间内容。
199   - * @param rowNum excelSheet 行index
200   - * @param colNum excelSheet 列index
201   - * @param fcsjContent 发车时间内容
202   - * @throws ScheduleException
203   - */
204   - private void validateFcsjContent(int rowNum, int colNum, String fcsjContent) throws ScheduleException {
205   - if (this.excelFormatType == ExcelFormatType.Normal) {
206   - // 班次时间验证,正则表达式,格式hh:mm或者hhmm
207   - String rex1 = "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"; // hh:mm格式
208   - String rex2 = "^([01]?[0-9]|2[0-3]),[0-5][0-9]$"; // hh,mm格式
209   - String rex3 = "^([01]?[0-9]|2[0-3])[0-5][0-9]$"; // hhmm格式
210   - Pattern p1 = Pattern.compile(rex1);
211   - Pattern p2 = Pattern.compile(rex2);
212   - Pattern p3 = Pattern.compile(rex3);
213   -
214   - Matcher m1 = p1.matcher(fcsjContent.trim());
215   - Matcher m2 = p2.matcher(fcsjContent.trim());
216   - Matcher m3 = p3.matcher(fcsjContent.trim());
217   - if ((!m1.matches()) && (!m2.matches()) && (!m3.matches())) {
218   - throw new ScheduleException(String.format("第%d行,第%d列的发车时间格式不正确,格式应为hh:mm或hh,mm或hhmm",
219   - rowNum + 1, colNum + 1));
220   - }
221   - } else if (this.excelFormatType == ExcelFormatType.Dynamic) {
222   - String rex1 = "^(\u62a5|\u51fa)?([01]?[0-9]|2[0-3]):[0-5][0-9]$"; // (报|出)hh:mm格式
223   - String rex2 = "^([01]?[0-9]|2[0-3]):[0-5][0-9](X|\u203b)?$"; // hh:mm(X|※)格式
224   - Pattern p1 = Pattern.compile(rex1);
225   - Pattern p2 = Pattern.compile(rex2);
226   - Matcher m1 = p1.matcher(fcsjContent.trim());
227   - Matcher m2 = p2.matcher(fcsjContent.trim());
228   - if ((!m1.matches()) && (!m2.matches())) {
229   - throw new ScheduleException(String.format(
230   - "第%d行,第%d列的发车时间格式不正确,格式应为(报|出)hh:mm或hh:mm(X|※)",
231   - rowNum + 1, colNum + 1));
232   - }
233   - } else {
234   - throw new ScheduleException("未知ExcelFormatType");
235   - }
236   -
237   - }
238   -
239   - private List<Integer> calcuExcelSheetColIndexList(Workbook workbook) throws ScheduleException {
240   - // 有些列不需要参与计算,找出参与计算的列
241   - List<Integer> colIndexList = new ArrayList<>();
242   - Sheet sheet = workbook.getSheet(this.sheetName);
243   - Row firstRow = sheet.getRow(0); // 获取第一行数据列
244   - for (int i = 0; i < firstRow.getLastCellNum(); i++) {
245   - if (excelFormatType == ExcelFormatType.Normal) {
246   - colIndexList.add(i);
247   - } else if (excelFormatType == ExcelFormatType.Dynamic) {
248   - String cell_con = StringUtils.trimToEmpty(
249   - PoiUtils.getStringValueFromCell(firstRow.getCell(i))); // trimToEmpty
250   - if ("报到".equals(cell_con) ||
251   - "到场".equals(cell_con) ||
252   - "离场".equals(cell_con) ||
253   - "总公里".equals(cell_con) ||
254   - "营业公里".equals(cell_con) ||
255   - "空驶公里".equals(cell_con) ||
256   - "总工时".equals(cell_con) ||
257   - "营业工时".equals(cell_con) ||
258   - "营运班次".equals(cell_con)) {
259   - // 这些列全部祛除
260   - continue;
261   - } else {
262   - colIndexList.add(i);
263   - }
264   - } else {
265   - throw new ScheduleException("未知excelFormatType");
266   - }
267   - }
268   - return colIndexList;
269   - }
270   -
271   - /**
272   - * 验证老系统ExcelSheet格式。
273   - * @throws ScheduleException
274   - */
275   - public void validateExcelSheet() throws ScheduleException {
276   - try {
277   - Workbook workbook = this.dataToolsFile.getFileType().getWorkBook(
278   - this.dataToolsFile.getFile()
279   - );
280   -
281   - Sheet sheet = workbook.getSheet(this.sheetName);
282   - int rowNums = sheet.getLastRowNum() + 1; // 基于0 base的,长度加1
283   - int colNums = sheet.getRow(0).getLastCellNum(); // 不需要加1,就是长度
284   -
285   - if (rowNums == 0 || colNums == 0) { // 工作区是否为空
286   - throw new Exception(String.format("%s 工作区没有数据!", this.sheetName));
287   - } else {
288   - if (rowNums <= 1 || rowNums <= 1) {
289   - throw new Exception(String.format("工作区至少包含2行2列的数据"));
290   - } else {
291   - List<Integer> colIndexList = this.calcuExcelSheetColIndexList(workbook);
292   - Row firstRow = sheet.getRow(0); // 获取第一行数据列
293   - for (int n = 0; n < colIndexList.size(); n++) {
294   - int i = colIndexList.get(n);
295   - String cell_con = StringUtils.trimToEmpty(
296   - PoiUtils.getStringValueFromCell(firstRow.getCell(i))); // trimToEmpty
297   -
298   - if (StringUtils.isEmpty(cell_con)) {
299   - throw new Exception(String.format("第1行,第%d列数据不能为空", i + 1));
300   - } else {
301   - // 正则表达式去除右侧数字
302   -// cell_con = cell_con.replaceAll("[\\d+]", "");
303   -// cell_con = cell_con.replaceAll("(\\d+)$", "");
304   -
305   - // 如果站名中有类似->{数字},使用正则表达式过滤掉
306   - cell_con = cell_con.replaceAll("(->\\d+)", "");
307   -
308   - if (i == 0) { // 第一列必须是路牌2个字
309   - if (!"路牌".equals(cell_con.trim())) {
310   - throw new Exception("第1行,第1列数据必须是路牌2个字");
311   - }
312   - } else { // 排除出场,进场,其余内容到站点路由里查询,以各个方向的起点站为查询依据
313   - if ((!"出场".equals(cell_con.trim())) &&
314   - (!"进场".equals(cell_con.trim()))) {
315   - validateRouteName(i, cell_con.trim()); // 验证路由名字
316   - }
317   -
318   - }
319   - }
320   - }
321   -
322   - // 验证路牌内容
323   - Map<String, Integer> gbindexmap = new HashMap<>(); // 记录每个路牌在第几行
324   - for (int i = 1; i < rowNums; i++) { // 从第2行开始验证数据
325   - Cell cell = sheet.getRow(i).getCell(0); // 获取第1列
326   - String bcell_con = StringUtils.trimToEmpty(
327   - PoiUtils.getStringValueFromCell(cell)); // trimToEmpty
328   - if (StringUtils.isEmpty(bcell_con)) {
329   - throw new Exception(String.format("第%d行,第1列路牌无数据", i + 1));
330   - } else if (gbindexmap.get(bcell_con.trim()) != null) {
331   - throw new Exception(String.format("第%d行,第1列的路牌数据与第%d行,第1列数据重复",
332   - i + 1,
333   - gbindexmap.get(bcell_con.trim())));
334   - } else {
335   - validateGuideboardName(i, bcell_con.trim()); // 验证路牌名字
336   - gbindexmap.put(bcell_con.trim(), i + 1);
337   - }
338   - }
339   -
340   - // 验证发车时间格式
341   - for (int i = 1; i < rowNums; i++) { // 从第2行开始验证数据
342   - Row row = sheet.getRow(i);
343   - for (int n = 1; n < colIndexList.size(); n++) { // 从第2列开始
344   - int j = colIndexList.get(n);
345   - String bcell_con = StringUtils.trimToEmpty(
346   - PoiUtils.getStringValueFromCell(
347   - row.getCell(j))).replaceAll("\\s*", ""); // trimToEmpty
348   - if (StringUtils.isNotEmpty(bcell_con)) {
349   - validateFcsjContent(i, j, bcell_con);
350   - }
351   - }
352   - }
353   - }
354   -
355   - }
356   -
357   - } catch (Exception exp) {
358   - exp.printStackTrace();
359   - throw new ScheduleException(exp.getMessage());
360   - }
361   - }
362   -
363   -}
  1 +package com.bsth.service.schedule.timetable;
  2 +
  3 +import com.bsth.entity.Line;
  4 +import com.bsth.entity.LsStationRoute;
  5 +import com.bsth.entity.schedule.GuideboardInfo;
  6 +import com.bsth.service.LineService;
  7 +import com.bsth.service.StationRouteService;
  8 +import com.bsth.service.schedule.GuideboardInfoService;
  9 +import com.bsth.service.schedule.exception.ScheduleException;
  10 +import com.bsth.service.schedule.utils.DataToolsFile;
  11 +import com.bsth.service.schedule.utils.DataToolsFileType;
  12 +import com.bsth.service.schedule.utils.PoiUtils;
  13 +import org.apache.commons.lang3.StringUtils;
  14 +import org.apache.poi.ss.usermodel.Cell;
  15 +import org.apache.poi.ss.usermodel.Row;
  16 +import org.apache.poi.ss.usermodel.Sheet;
  17 +import org.apache.poi.ss.usermodel.Workbook;
  18 +import org.springframework.util.CollectionUtils;
  19 +
  20 +import java.io.File;
  21 +import java.util.ArrayList;
  22 +import java.util.HashMap;
  23 +import java.util.List;
  24 +import java.util.Map;
  25 +import java.util.regex.Matcher;
  26 +import java.util.regex.Pattern;
  27 +
  28 +/**
  29 + * 时刻表Excel数据类。
  30 + */
  31 +public class ExcelData {
  32 +
  33 + /** 导入后的Excel文件对象 */
  34 + private DataToolsFile dataToolsFile;
  35 + /** 数据sheet名 */
  36 + private String sheetName;
  37 + /** 线路 */
  38 + private Line line;
  39 + /** 线路路由列表(包含上下行的起终点站) */
  40 + private List<LsStationRoute> lsStationRouteList;
  41 + /** 路牌列表 */
  42 + private List<GuideboardInfo> guideboardInfoList;
  43 + /** excel数据格式 */
  44 + private ExcelFormatType excelFormatType;
  45 +
  46 + public DataToolsFile getDataToolsFile() {
  47 + return dataToolsFile;
  48 + }
  49 +
  50 + public void setDataToolsFile(DataToolsFile dataToolsFile) {
  51 + this.dataToolsFile = dataToolsFile;
  52 + }
  53 +
  54 + public String getSheetName() {
  55 + return sheetName;
  56 + }
  57 +
  58 + public void setSheetName(String sheetName) {
  59 + this.sheetName = sheetName;
  60 + }
  61 +
  62 + public Line getLine() {
  63 + return line;
  64 + }
  65 +
  66 + public void setLine(Line line) {
  67 + this.line = line;
  68 + }
  69 +
  70 + public List<LsStationRoute> getLsStationRouteList() {
  71 + return lsStationRouteList;
  72 + }
  73 +
  74 + public void setLsStationRouteList(List<LsStationRoute> lsStationRouteList) {
  75 + this.lsStationRouteList = lsStationRouteList;
  76 + }
  77 +
  78 + public List<GuideboardInfo> getGuideboardInfoList() {
  79 + return guideboardInfoList;
  80 + }
  81 +
  82 + public void setGuideboardInfoList(List<GuideboardInfo> guideboardInfoList) {
  83 + this.guideboardInfoList = guideboardInfoList;
  84 + }
  85 +
  86 + public ExcelFormatType getExcelFormatType() {
  87 + return excelFormatType;
  88 + }
  89 +
  90 + public void setExcelFormatType(ExcelFormatType excelFormatType) {
  91 + this.excelFormatType = excelFormatType;
  92 + }
  93 +
  94 + /**
  95 + * 构造函数
  96 + * @param filePath 文件路径
  97 + * @param sheetName sheet名字
  98 + * @param lineId 线路Id
  99 + * @param lineService LineServiceImpl
  100 + * @param guideboardInfoService GuideboardInfoServiceImpl
  101 + * @param lineRouteVersion 线路路由版本
  102 + * @param stationRouteService StationRouteServiceImpl
  103 + * @param excelFormatType excel数据格式
  104 + * @throws ScheduleException
  105 + * @see com.bsth.service.impl.LineServiceImpl
  106 + * @see com.bsth.service.schedule.impl.GuideboardInfoServiceImpl
  107 + * @see com.bsth.service.impl.StationRouteServiceImpl
  108 + */
  109 + public ExcelData(
  110 + String filePath, String sheetName,
  111 + Integer lineId, LineService lineService, GuideboardInfoService guideboardInfoService,
  112 + Integer lineRouteVersion, StationRouteService stationRouteService,
  113 + ExcelFormatType excelFormatType) throws ScheduleException {
  114 + // 获取Excel文件对象,类型
  115 + File file = new File(filePath);
  116 + this.dataToolsFile = new DataToolsFile();
  117 + this.dataToolsFile.setFile(file);
  118 + if (DataToolsFileType.XLS.isThisType(file)) {
  119 + this.dataToolsFile.setFileType(DataToolsFileType.XLS);
  120 + } else if (DataToolsFileType.XLSX.isThisType(file)) {
  121 + this.dataToolsFile.setFileType(DataToolsFileType.XLSX);
  122 + } else {
  123 + throw new ScheduleException("不是xls xlsx文件!");
  124 + }
  125 +
  126 + // sheet名字
  127 + this.sheetName = sheetName;
  128 + // 线路
  129 + this.line = lineService.findById(lineId);
  130 + // 线路路由列表
  131 + Map<String, Object> p1 = new HashMap<>();
  132 + p1.put("line.id_eq", lineId);
  133 + p1.put("stationMark_in", "B,E"); // 起点站
  134 + p1.put("destroy_eq", 0); // 未撤销
  135 + p1.put("versions_eq", lineRouteVersion); // 带线路版本
  136 + lsStationRouteList = (List<LsStationRoute>) stationRouteService.list_ls(p1);
  137 + // 路牌列表
  138 + p1.clear();
  139 + p1.put("xl.id_eq", lineId);
  140 + p1.put("isCancel_eq", false);
  141 + guideboardInfoList = guideboardInfoService.list(p1);
  142 +
  143 + // excel数据格式
  144 + this.excelFormatType = excelFormatType;
  145 + }
  146 +
  147 + /**
  148 + * 验证路由名字。
  149 + * @param colNum 列标号(从0开始)
  150 + * @param routeName 路由名字
  151 + * @throws ScheduleException
  152 + */
  153 + private void validateRouteName(int colNum, String routeName) throws ScheduleException {
  154 + List<LsStationRoute> lsStationRoutes = new ArrayList<>();
  155 + for (LsStationRoute lsStationRoute : this.lsStationRouteList) {
  156 + if ("B".equals(lsStationRoute.getStationMark()) && routeName.equals(lsStationRoute.getStationName())) {
  157 + lsStationRoutes.add(lsStationRoute);
  158 + }
  159 + }
  160 +
  161 + if (CollectionUtils.isEmpty(lsStationRoutes)) {
  162 + throw new ScheduleException(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站",
  163 + colNum + 1, routeName, this.line.getName()));
  164 + } else if (lsStationRoutes.size() > 1) {
  165 + throw new ScheduleException(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站",
  166 + colNum + 1, routeName, this.line.getName()));
  167 + } else if (StringUtils.isEmpty(lsStationRoutes.get(0).getStationCode())) {
  168 + throw new ScheduleException(String.format("第1行,第%d列数据%s在%s站点路由中没有站点编码",
  169 + colNum + 1, routeName, this.line.getName()));
  170 + }
  171 +
  172 + }
  173 +
  174 + /**
  175 + * 验证路牌名字。
  176 + * @param colNum excelSheet 列index
  177 + * @param guideboardName 路牌名字
  178 + * @throws ScheduleException
  179 + */
  180 + private void validateGuideboardName(int colNum, String guideboardName) throws ScheduleException {
  181 + List<GuideboardInfo> guideboardInfos = new ArrayList<>();
  182 + for (GuideboardInfo guideboardInfo : this.guideboardInfoList) {
  183 + if (guideboardName.equals(guideboardInfo.getLpName())) {
  184 + guideboardInfos.add(guideboardInfo);
  185 + }
  186 + }
  187 +
  188 + if (CollectionUtils.isEmpty(guideboardInfos)) {
  189 + throw new ScheduleException(String.format("第%d行,第1列的路牌在%s中不存在",
  190 + colNum + 1, this.line.getName()));
  191 + } else if (guideboardInfos.size() > 1) {
  192 + throw new ScheduleException(String.format("第%d行,第1列的路牌在%s中重复",
  193 + colNum + 1, this.line.getName()));
  194 + }
  195 + }
  196 +
  197 + /**
  198 + * 验证发车时间内容。
  199 + * @param rowNum excelSheet 行index
  200 + * @param colNum excelSheet 列index
  201 + * @param fcsjContent 发车时间内容
  202 + * @throws ScheduleException
  203 + */
  204 + private void validateFcsjContent(int rowNum, int colNum, String fcsjContent) throws ScheduleException {
  205 + if (this.excelFormatType == ExcelFormatType.Normal) {
  206 + // 班次时间验证,正则表达式,格式hh:mm或者hhmm
  207 + String rex1 = "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"; // hh:mm格式
  208 + String rex2 = "^([01]?[0-9]|2[0-3]),[0-5][0-9]$"; // hh,mm格式
  209 + String rex3 = "^([01]?[0-9]|2[0-3])[0-5][0-9]$"; // hhmm格式
  210 + Pattern p1 = Pattern.compile(rex1);
  211 + Pattern p2 = Pattern.compile(rex2);
  212 + Pattern p3 = Pattern.compile(rex3);
  213 +
  214 + Matcher m1 = p1.matcher(fcsjContent.trim());
  215 + Matcher m2 = p2.matcher(fcsjContent.trim());
  216 + Matcher m3 = p3.matcher(fcsjContent.trim());
  217 + if ((!m1.matches()) && (!m2.matches()) && (!m3.matches())) {
  218 + throw new ScheduleException(String.format("第%d行,第%d列的发车时间格式不正确,格式应为hh:mm或hh,mm或hhmm",
  219 + rowNum + 1, colNum + 1));
  220 + }
  221 + } else if (this.excelFormatType == ExcelFormatType.Dynamic) {
  222 + String rex1 = "^(\u62a5|\u51fa)?([01]?[0-9]|2[0-3]):[0-5][0-9]$"; // (报|出)hh:mm格式
  223 + String rex2 = "^([01]?[0-9]|2[0-3]):[0-5][0-9](X|\u203b)?$"; // hh:mm(X|※)格式
  224 + Pattern p1 = Pattern.compile(rex1);
  225 + Pattern p2 = Pattern.compile(rex2);
  226 + Matcher m1 = p1.matcher(fcsjContent.trim());
  227 + Matcher m2 = p2.matcher(fcsjContent.trim());
  228 + if ((!m1.matches()) && (!m2.matches())) {
  229 + throw new ScheduleException(String.format(
  230 + "第%d行,第%d列的发车时间格式不正确,格式应为(报|出)hh:mm或hh:mm(X|※)",
  231 + rowNum + 1, colNum + 1));
  232 + }
  233 + } else {
  234 + throw new ScheduleException("未知ExcelFormatType");
  235 + }
  236 +
  237 + }
  238 +
  239 + private List<Integer> calcuExcelSheetColIndexList(Workbook workbook) throws ScheduleException {
  240 + // 有些列不需要参与计算,找出参与计算的列
  241 + List<Integer> colIndexList = new ArrayList<>();
  242 + Sheet sheet = workbook.getSheet(this.sheetName);
  243 + Row firstRow = sheet.getRow(0); // 获取第一行数据列
  244 + for (int i = 0; i < firstRow.getLastCellNum(); i++) {
  245 + if (excelFormatType == ExcelFormatType.Normal) {
  246 + colIndexList.add(i);
  247 + } else if (excelFormatType == ExcelFormatType.Dynamic) {
  248 + String cell_con = StringUtils.trimToEmpty(
  249 + PoiUtils.getStringValueFromCell(firstRow.getCell(i))); // trimToEmpty
  250 + if ("报到".equals(cell_con) ||
  251 + "到场".equals(cell_con) ||
  252 + "离场".equals(cell_con) ||
  253 + "总公里".equals(cell_con) ||
  254 + "营业公里".equals(cell_con) ||
  255 + "空驶公里".equals(cell_con) ||
  256 + "总工时".equals(cell_con) ||
  257 + "营业工时".equals(cell_con) ||
  258 + "营运班次".equals(cell_con)) {
  259 + // 这些列全部祛除
  260 + continue;
  261 + } else {
  262 + colIndexList.add(i);
  263 + }
  264 + } else {
  265 + throw new ScheduleException("未知excelFormatType");
  266 + }
  267 + }
  268 + return colIndexList;
  269 + }
  270 +
  271 + /**
  272 + * 验证老系统ExcelSheet格式。
  273 + * @throws ScheduleException
  274 + */
  275 + public void validateExcelSheet() throws ScheduleException {
  276 + try {
  277 + Workbook workbook = this.dataToolsFile.getFileType().getWorkBook(
  278 + this.dataToolsFile.getFile()
  279 + );
  280 +
  281 + Sheet sheet = workbook.getSheet(this.sheetName);
  282 + int rowNums = sheet.getLastRowNum() + 1; // 基于0 base的,长度加1
  283 + int colNums = sheet.getRow(0).getLastCellNum(); // 不需要加1,就是长度
  284 +
  285 + if (rowNums == 0 || colNums == 0) { // 工作区是否为空
  286 + throw new Exception(String.format("%s 工作区没有数据!", this.sheetName));
  287 + } else {
  288 + if (rowNums <= 1 || rowNums <= 1) {
  289 + throw new Exception(String.format("工作区至少包含2行2列的数据"));
  290 + } else {
  291 + List<Integer> colIndexList = this.calcuExcelSheetColIndexList(workbook);
  292 + Row firstRow = sheet.getRow(0); // 获取第一行数据列
  293 + for (int n = 0; n < colIndexList.size(); n++) {
  294 + int i = colIndexList.get(n);
  295 + String cell_con = StringUtils.trimToEmpty(
  296 + PoiUtils.getStringValueFromCell(firstRow.getCell(i))); // trimToEmpty
  297 +
  298 + if (StringUtils.isEmpty(cell_con)) {
  299 + throw new Exception(String.format("第1行,第%d列数据不能为空", i + 1));
  300 + } else {
  301 + // 正则表达式去除右侧数字
  302 +// cell_con = cell_con.replaceAll("[\\d+]", "");
  303 +// cell_con = cell_con.replaceAll("(\\d+)$", "");
  304 +
  305 + // 如果站名中有类似->{数字},使用正则表达式过滤掉
  306 + cell_con = cell_con.replaceAll("(->\\d+)", "");
  307 +
  308 + if (i == 0) { // 第一列必须是路牌2个字
  309 + if (!"路牌".equals(cell_con.trim())) {
  310 + throw new Exception("第1行,第1列数据必须是路牌2个字");
  311 + }
  312 + } else { // 排除出场,进场,其余内容到站点路由里查询,以各个方向的起点站为查询依据
  313 + if ((!"出场".equals(cell_con.trim())) &&
  314 + (!"进场".equals(cell_con.trim()))) {
  315 + validateRouteName(i, cell_con.trim()); // 验证路由名字
  316 + }
  317 +
  318 + }
  319 + }
  320 + }
  321 +
  322 + // 验证路牌内容
  323 + Map<String, Integer> gbindexmap = new HashMap<>(); // 记录每个路牌在第几行
  324 + for (int i = 1; i < rowNums; i++) { // 从第2行开始验证数据
  325 + Cell cell = sheet.getRow(i).getCell(0); // 获取第1列
  326 + String bcell_con = StringUtils.trimToEmpty(
  327 + PoiUtils.getStringValueFromCell(cell)); // trimToEmpty
  328 + if (StringUtils.isEmpty(bcell_con)) {
  329 + throw new Exception(String.format("第%d行,第1列路牌无数据", i + 1));
  330 + } else if (gbindexmap.get(bcell_con.trim()) != null) {
  331 + throw new Exception(String.format("第%d行,第1列的路牌数据与第%d行,第1列数据重复",
  332 + i + 1,
  333 + gbindexmap.get(bcell_con.trim())));
  334 + } else {
  335 + validateGuideboardName(i, bcell_con.trim()); // 验证路牌名字
  336 + gbindexmap.put(bcell_con.trim(), i + 1);
  337 + }
  338 + }
  339 +
  340 + // 验证发车时间格式
  341 + for (int i = 1; i < rowNums; i++) { // 从第2行开始验证数据
  342 + Row row = sheet.getRow(i);
  343 + for (int n = 1; n < colIndexList.size(); n++) { // 从第2列开始
  344 + int j = colIndexList.get(n);
  345 + String bcell_con = StringUtils.trimToEmpty(
  346 + PoiUtils.getStringValueFromCell(
  347 + row.getCell(j))).replaceAll("\\s*", ""); // trimToEmpty
  348 + if (StringUtils.isNotEmpty(bcell_con)) {
  349 + validateFcsjContent(i, j, bcell_con);
  350 + }
  351 + }
  352 + }
  353 + }
  354 +
  355 + }
  356 +
  357 + } catch (Exception exp) {
  358 + exp.printStackTrace();
  359 + throw new ScheduleException(exp.getMessage());
  360 + }
  361 + }
  362 +
  363 +}
... ...
src/main/java/com/bsth/service/schedule/timetable/ExcelFormatType.java
1   -package com.bsth.service.schedule.timetable;
2   -
3   -import com.fasterxml.jackson.annotation.JsonCreator;
4   -import com.fasterxml.jackson.annotation.JsonValue;
5   -
6   -/**
7   - * 导入时刻表时,excel的数据格式类型。
8   - */
9   -public enum ExcelFormatType {
10   - Normal("normal"), // 老系统格式
11   - Dynamic("dynamic"); // 自动生成的导出格式
12   -
13   - private String flag;
14   -
15   - @JsonCreator
16   - ExcelFormatType(String flag) {
17   - this.flag = flag;
18   - }
19   -
20   - @JsonValue
21   - public String getFlag() {
22   - return flag;
23   - }
24   -
25   - public void setFlag(String flag) {
26   - this.flag = flag;
27   - }
28   -
29   - public static ExcelFormatType getEnum(String str) {
30   - if ("normal".equals(str)) {
31   - return Normal;
32   - } else if ("dynamic".equals(str)) {
33   - return Dynamic;
34   - } else {
35   - throw new IllegalArgumentException("未知ExcelFormatType");
36   - }
37   - }
38   -}
  1 +package com.bsth.service.schedule.timetable;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonCreator;
  4 +import com.fasterxml.jackson.annotation.JsonValue;
  5 +
  6 +/**
  7 + * 导入时刻表时,excel的数据格式类型。
  8 + */
  9 +public enum ExcelFormatType {
  10 + Normal("normal"), // 老系统格式
  11 + Dynamic("dynamic"); // 自动生成的导出格式
  12 +
  13 + private String flag;
  14 +
  15 + @JsonCreator
  16 + ExcelFormatType(String flag) {
  17 + this.flag = flag;
  18 + }
  19 +
  20 + @JsonValue
  21 + public String getFlag() {
  22 + return flag;
  23 + }
  24 +
  25 + public void setFlag(String flag) {
  26 + this.flag = flag;
  27 + }
  28 +
  29 + public static ExcelFormatType getEnum(String str) {
  30 + if ("normal".equals(str)) {
  31 + return Normal;
  32 + } else if ("dynamic".equals(str)) {
  33 + return Dynamic;
  34 + } else {
  35 + throw new IllegalArgumentException("未知ExcelFormatType");
  36 + }
  37 + }
  38 +}
... ...
src/main/java/com/bsth/util/db/DBUtils_traffic.java
1   -package com.bsth.util.db;
2   -
3   -import com.mchange.v2.c3p0.DataSources;
4   -import org.apache.log4j.Logger;
5   -
6   -import javax.sql.DataSource;
7   -import java.io.FileNotFoundException;
8   -import java.io.IOException;
9   -import java.sql.Connection;
10   -import java.sql.ResultSet;
11   -import java.sql.SQLException;
12   -import java.sql.Statement;
13   -import java.util.HashMap;
14   -import java.util.Map;
15   -import java.util.Properties;
16   -
17   -/**
18   - * 网关ms库连接池
19   - * @author PanZhao
20   - *
21   - */
22   -//@Component
23   -public class DBUtils_traffic {
24   -
25   - private static String url = null;
26   -
27   - private static String username = null;
28   -
29   - private static String pwd = null;
30   -
31   - private static DataSource ds_pooled;
32   -
33   - static Logger logger = Logger.getLogger(DBUtils_traffic.class);
34   -
35   - static {
36   - Properties env = new Properties();
37   -
38   - try {
39   - env.load(DBUtils_traffic.class.getClassLoader().getResourceAsStream("traffic-jdbc.properties"));
40   - // 1. 加载驱动类
41   - Class.forName(env.getProperty("ms.mysql.driver"));
42   -
43   - url = env.getProperty("ms.mysql.url");
44   - username = env.getProperty("ms.mysql.username");
45   - pwd = env.getProperty("ms.mysql.password");
46   -
47   - // 设置连接数据库的配置信息
48   - DataSource ds_unpooled = DataSources.unpooledDataSource(url,
49   - username, pwd);
50   -
51   - Map<String, Object> pool_conf = new HashMap<String, Object>();
52   - // 设置最大连接数
53   - pool_conf.put("maxPoolSize", 10);
54   -
55   - pool_conf.put("testConnectionOnCheckout", false);
56   - //异步检测连接的有效性
57   - pool_conf.put("testConnectionOnCheckin", true);
58   - //30秒检测一次
59   - pool_conf.put("idleConnectionTestPeriod", 30);
60   - ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf);
61   - } catch (FileNotFoundException e) {
62   - logger.error(e.toString());
63   - e.printStackTrace();
64   - } catch (IOException e) {
65   - logger.error(e.toString());
66   - e.printStackTrace();
67   - } catch (ClassNotFoundException e) {
68   - logger.error(e.toString());
69   - e.printStackTrace();
70   - } catch (SQLException e) {
71   - logger.error(e.toString());
72   - e.printStackTrace();
73   - }
74   - }
75   -
76   - /**
77   - * 获取连接对象
78   - */
79   - public static Connection getConnection() throws SQLException {
80   - return ds_pooled.getConnection();
81   - }
82   -
83   - /**
84   - * 释放连接池资源
85   - */
86   - public static void clearup() {
87   - if (ds_pooled != null) {
88   - try {
89   - DataSources.destroy(ds_pooled);
90   - } catch (SQLException e) {
91   - logger.error(e.toString());
92   - e.printStackTrace();
93   - }
94   - }
95   - }
96   -
97   - /**
98   - * 资源关闭
99   - *
100   - * @param rs
101   - * @param stmt
102   - * @param conn
103   - */
104   - public static void close(ResultSet rs, Statement stmt, Connection conn) {
105   - if (rs != null) {
106   - try {
107   - rs.close();
108   - } catch (SQLException e) {
109   - logger.error(e.toString());
110   - e.printStackTrace();
111   - }
112   - }
113   -
114   - if (stmt != null) {
115   - try {
116   - stmt.close();
117   - } catch (SQLException e) {
118   - logger.error(e.toString());
119   - e.printStackTrace();
120   - }
121   - }
122   -
123   - if (conn != null) {
124   - try {
125   - conn.close();
126   - } catch (SQLException e) {
127   - logger.error(e.toString());
128   - e.printStackTrace();
129   - }
130   - }
131   - }
132   -
133   - public static DataSource getDataSource(){
134   - return ds_pooled;
135   - }
136   -}
  1 +package com.bsth.util.db;
  2 +
  3 +import com.mchange.v2.c3p0.DataSources;
  4 +import org.apache.log4j.Logger;
  5 +
  6 +import javax.sql.DataSource;
  7 +import java.io.FileNotFoundException;
  8 +import java.io.IOException;
  9 +import java.sql.Connection;
  10 +import java.sql.ResultSet;
  11 +import java.sql.SQLException;
  12 +import java.sql.Statement;
  13 +import java.util.HashMap;
  14 +import java.util.Map;
  15 +import java.util.Properties;
  16 +
  17 +/**
  18 + * 网关ms库连接池
  19 + * @author PanZhao
  20 + *
  21 + */
  22 +//@Component
  23 +public class DBUtils_traffic {
  24 +
  25 + private static String url = null;
  26 +
  27 + private static String username = null;
  28 +
  29 + private static String pwd = null;
  30 +
  31 + private static DataSource ds_pooled;
  32 +
  33 + static Logger logger = Logger.getLogger(DBUtils_traffic.class);
  34 +
  35 + static {
  36 + Properties env = new Properties();
  37 +
  38 + try {
  39 + env.load(DBUtils_traffic.class.getClassLoader().getResourceAsStream("traffic-jdbc.properties"));
  40 + // 1. 加载驱动类
  41 + Class.forName(env.getProperty("ms.mysql.driver"));
  42 +
  43 + url = env.getProperty("ms.mysql.url");
  44 + username = env.getProperty("ms.mysql.username");
  45 + pwd = env.getProperty("ms.mysql.password");
  46 +
  47 + // 设置连接数据库的配置信息
  48 + DataSource ds_unpooled = DataSources.unpooledDataSource(url,
  49 + username, pwd);
  50 +
  51 + Map<String, Object> pool_conf = new HashMap<String, Object>();
  52 + // 设置最大连接数
  53 + pool_conf.put("maxPoolSize", 10);
  54 +
  55 + pool_conf.put("testConnectionOnCheckout", false);
  56 + //异步检测连接的有效性
  57 + pool_conf.put("testConnectionOnCheckin", true);
  58 + //30秒检测一次
  59 + pool_conf.put("idleConnectionTestPeriod", 30);
  60 + ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf);
  61 + } catch (FileNotFoundException e) {
  62 + logger.error(e.toString());
  63 + e.printStackTrace();
  64 + } catch (IOException e) {
  65 + logger.error(e.toString());
  66 + e.printStackTrace();
  67 + } catch (ClassNotFoundException e) {
  68 + logger.error(e.toString());
  69 + e.printStackTrace();
  70 + } catch (SQLException e) {
  71 + logger.error(e.toString());
  72 + e.printStackTrace();
  73 + }
  74 + }
  75 +
  76 + /**
  77 + * 获取连接对象
  78 + */
  79 + public static Connection getConnection() throws SQLException {
  80 + return ds_pooled.getConnection();
  81 + }
  82 +
  83 + /**
  84 + * 释放连接池资源
  85 + */
  86 + public static void clearup() {
  87 + if (ds_pooled != null) {
  88 + try {
  89 + DataSources.destroy(ds_pooled);
  90 + } catch (SQLException e) {
  91 + logger.error(e.toString());
  92 + e.printStackTrace();
  93 + }
  94 + }
  95 + }
  96 +
  97 + /**
  98 + * 资源关闭
  99 + *
  100 + * @param rs
  101 + * @param stmt
  102 + * @param conn
  103 + */
  104 + public static void close(ResultSet rs, Statement stmt, Connection conn) {
  105 + if (rs != null) {
  106 + try {
  107 + rs.close();
  108 + } catch (SQLException e) {
  109 + logger.error(e.toString());
  110 + e.printStackTrace();
  111 + }
  112 + }
  113 +
  114 + if (stmt != null) {
  115 + try {
  116 + stmt.close();
  117 + } catch (SQLException e) {
  118 + logger.error(e.toString());
  119 + e.printStackTrace();
  120 + }
  121 + }
  122 +
  123 + if (conn != null) {
  124 + try {
  125 + conn.close();
  126 + } catch (SQLException e) {
  127 + logger.error(e.toString());
  128 + e.printStackTrace();
  129 + }
  130 + }
  131 + }
  132 +
  133 + public static DataSource getDataSource(){
  134 + return ds_pooled;
  135 + }
  136 +}
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput2_version_2.ktr
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<transformation>
3   - <info>
4   - <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5bfc;&#x5165;-&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;2</name>
5   - <description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</description>
6   - <extended_description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;&#xff0c;&#x4f7f;&#x7528;&#x751f;&#x6210;&#x65f6;&#x523b;&#x8868;&#x683c;&#x5f0f;</extended_description>
7   - <trans_version/>
8   - <trans_type>Normal</trans_type>
9   - <trans_status>0</trans_status>
10   - <directory>&#x2f;</directory>
11   - <parameters>
12   - </parameters>
13   - <log>
14   -<trans-log-table><connection/>
15   -<schema/>
16   -<table/>
17   -<size_limit_lines/>
18   -<interval/>
19   -<timeout_days/>
20   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
21   -<perf-log-table><connection/>
22   -<schema/>
23   -<table/>
24   -<interval/>
25   -<timeout_days/>
26   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
27   -<channel-log-table><connection/>
28   -<schema/>
29   -<table/>
30   -<timeout_days/>
31   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
32   -<step-log-table><connection/>
33   -<schema/>
34   -<table/>
35   -<timeout_days/>
36   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
37   -<metrics-log-table><connection/>
38   -<schema/>
39   -<table/>
40   -<timeout_days/>
41   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
42   - </log>
43   - <maxdate>
44   - <connection/>
45   - <table/>
46   - <field/>
47   - <offset>0.0</offset>
48   - <maxdiff>0.0</maxdiff>
49   - </maxdate>
50   - <size_rowset>10000</size_rowset>
51   - <sleep_time_empty>50</sleep_time_empty>
52   - <sleep_time_full>50</sleep_time_full>
53   - <unique_connections>N</unique_connections>
54   - <feedback_shown>Y</feedback_shown>
55   - <feedback_size>50000</feedback_size>
56   - <using_thread_priorities>Y</using_thread_priorities>
57   - <shared_objects_file/>
58   - <capture_step_performance>N</capture_step_performance>
59   - <step_performance_capturing_delay>1000</step_performance_capturing_delay>
60   - <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
61   - <dependencies>
62   - </dependencies>
63   - <partitionschemas>
64   - </partitionschemas>
65   - <slaveservers>
66   - </slaveservers>
67   - <clusterschemas>
68   - </clusterschemas>
69   - <created_user>-</created_user>
70   - <created_date>2016&#x2f;06&#x2f;30 12&#x3a;21&#x3a;57.536</created_date>
71   - <modified_user>-</modified_user>
72   - <modified_date>2016&#x2f;06&#x2f;30 12&#x3a;21&#x3a;57.536</modified_date>
73   - <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
74   - <is_key_private>N</is_key_private>
75   - </info>
76   - <notepads>
77   - <notepad>
78   - <note>&#x5b57;&#x5178;&#x8868;&#x5bf9;&#x5e94;&#xff08;&#x4ee5;&#x540e;&#x76f4;&#x63a5;&#x67e5;&#x627e;&#x8868; bsth_c_sys_dictionary&#xff09;&#xa;&#x7c7b;&#x578b; &#x4ee3;&#x7801; &#x540d;&#x79f0;&#xa;LineTrend 0 &#x4e0a;&#x884c;&#xa;LineTrend 1 &#x4e0b;&#x884c;&#xa;ScheduleType normal &#x6b63;&#x5e38;&#x73ed;&#x6b21;&#xa;ScheduleType out &#x51fa;&#x573a;&#xa;ScheduleType in &#x8fdb;&#x573a;&#xa;ScheduleType temp &#x4e34;&#x52a0;&#xa;ScheduleType region &#x533a;&#x95f4;&#xa;ScheduleType venting &#x653e;&#x7a7a;&#xa;ScheduleType major &#x653e;&#x5927;&#x7ad9;</note>
79   - <xloc>606</xloc>
80   - <yloc>129</yloc>
81   - <width>332</width>
82   - <heigth>186</heigth>
83   - <fontname>YaHei Consolas Hybrid</fontname>
84   - <fontsize>12</fontsize>
85   - <fontbold>N</fontbold>
86   - <fontitalic>N</fontitalic>
87   - <fontcolorred>0</fontcolorred>
88   - <fontcolorgreen>0</fontcolorgreen>
89   - <fontcolorblue>0</fontcolorblue>
90   - <backgroundcolorred>255</backgroundcolorred>
91   - <backgroundcolorgreen>205</backgroundcolorgreen>
92   - <backgroundcolorblue>112</backgroundcolorblue>
93   - <bordercolorred>100</bordercolorred>
94   - <bordercolorgreen>100</bordercolorgreen>
95   - <bordercolorblue>100</bordercolorblue>
96   - <drawshadow>Y</drawshadow>
97   - </notepad>
98   - <notepad>
99   - <note>&#x56e0;&#x4e3a;&#x65f6;&#x523b;&#x8868;&#x8f93;&#x5165;&#x683c;&#x5f0f;&#x4e0d;&#x786e;&#x5b9a;&#x6027;&#xff0c;&#x4e3b;&#x8981;&#x56e0;&#x4e3a;&#x8868;&#x7ed3;&#x6784;&#x662f;&#x53cd;&#x8303;&#x5f0f;&#x5316;&#x7684;&#xff0c;&#xa;&#x6240;&#x4ee5;&#x9700;&#x8981;&#x5916;&#x90e8;&#x52a8;&#x6001;&#x6307;&#x5b9a;&#x613f;&#x6570;&#x636e;&#xff0c;&#x5934;&#x4e09;&#x4e2a;step&#x52a8;&#x6001;&#x6307;&#x5b9a;&#x613f;&#x6570;&#x636e;&#xa;&#xa;</note>
100   - <xloc>24</xloc>
101   - <yloc>208</yloc>
102   - <width>346</width>
103   - <heigth>74</heigth>
104   - <fontname>YaHei Consolas Hybrid</fontname>
105   - <fontsize>12</fontsize>
106   - <fontbold>N</fontbold>
107   - <fontitalic>N</fontitalic>
108   - <fontcolorred>0</fontcolorred>
109   - <fontcolorgreen>0</fontcolorgreen>
110   - <fontcolorblue>0</fontcolorblue>
111   - <backgroundcolorred>255</backgroundcolorred>
112   - <backgroundcolorgreen>205</backgroundcolorgreen>
113   - <backgroundcolorblue>112</backgroundcolorblue>
114   - <bordercolorred>100</bordercolorred>
115   - <bordercolorgreen>100</bordercolorgreen>
116   - <bordercolorblue>100</bordercolorblue>
117   - <drawshadow>Y</drawshadow>
118   - </notepad>
119   - <notepad>
120   - <note>&#x8fd9;&#x91cc;&#x6709;&#x4e9b;&#x95ee;&#x9898;&#xa;&#x5728;window2012&#x7684;&#x73af;&#x5883;&#x4e0b;&#xff0c;&#xa;MySql&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x4e2d;&#x5982;&#x679c;&#x8fd4;&#x56de;&#x4e2d;&#x6587;&#x5185;&#x5bb9;&#x7684;&#x5b57;&#x6bb5;&#xff0c;&#x8fd9;&#x4e2a;&#x5185;&#x5bb9;&#x4e71;&#x7801;&#xa;&#x89e3;&#x51b3;&#x529e;&#x6cd5;&#xff0c;&#x5c31;&#x662f;&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x5168;&#x90e8;&#x7f13;&#x5b58;&#xff0c;&#x5c31;&#x4e0d;&#x4e71;&#x7801;&#xa;linux&#x73af;&#x5883;&#x4e0b;&#x6ca1;&#x95ee;&#x9898;</note>
121   - <xloc>721</xloc>
122   - <yloc>762</yloc>
123   - <width>333</width>
124   - <heigth>90</heigth>
125   - <fontname>YaHei Consolas Hybrid</fontname>
126   - <fontsize>12</fontsize>
127   - <fontbold>N</fontbold>
128   - <fontitalic>N</fontitalic>
129   - <fontcolorred>0</fontcolorred>
130   - <fontcolorgreen>0</fontcolorgreen>
131   - <fontcolorblue>0</fontcolorblue>
132   - <backgroundcolorred>255</backgroundcolorred>
133   - <backgroundcolorgreen>205</backgroundcolorgreen>
134   - <backgroundcolorblue>112</backgroundcolorblue>
135   - <bordercolorred>100</bordercolorred>
136   - <bordercolorgreen>100</bordercolorgreen>
137   - <bordercolorblue>100</bordercolorblue>
138   - <drawshadow>Y</drawshadow>
139   - </notepad>
140   - <notepad>
141   - <note>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#xff0c;&#x65b9;&#x5411;&#x6709;&#x65f6;&#x786e;&#x5b9a;&#x4e0d;&#x51c6;&#xff0c;&#xa;&#x7a7a;&#x7684;&#x60c5;&#x51b5;&#x4e0b;&#x8bbe;&#x5b9a;&#x4e3a;0&#xff08;&#x4e0a;&#x884c;&#xff09;</note>
142   - <xloc>104</xloc>
143   - <yloc>939</yloc>
144   - <width>178</width>
145   - <heigth>42</heigth>
146   - <fontname>YaHei Consolas Hybrid</fontname>
147   - <fontsize>12</fontsize>
148   - <fontbold>N</fontbold>
149   - <fontitalic>N</fontitalic>
150   - <fontcolorred>0</fontcolorred>
151   - <fontcolorgreen>0</fontcolorgreen>
152   - <fontcolorblue>0</fontcolorblue>
153   - <backgroundcolorred>255</backgroundcolorred>
154   - <backgroundcolorgreen>205</backgroundcolorgreen>
155   - <backgroundcolorblue>112</backgroundcolorblue>
156   - <bordercolorred>100</bordercolorred>
157   - <bordercolorgreen>100</bordercolorgreen>
158   - <bordercolorblue>100</bordercolorblue>
159   - <drawshadow>Y</drawshadow>
160   - </notepad>
161   - <notepad>
162   - <note>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#xff0c;&#x65b9;&#x5411;&#x6709;&#x65f6;&#x786e;&#x5b9a;&#x4e0d;&#x51c6;&#xff0c;&#xa;&#x7a7a;&#x7684;&#x60c5;&#x51b5;&#x4e0b;&#x8bbe;&#x5b9a;&#x4e3a;0&#xff08;&#x4e0a;&#x884c;&#xff09;</note>
163   - <xloc>578</xloc>
164   - <yloc>1084</yloc>
165   - <width>178</width>
166   - <heigth>42</heigth>
167   - <fontname>YaHei Consolas Hybrid</fontname>
168   - <fontsize>12</fontsize>
169   - <fontbold>N</fontbold>
170   - <fontitalic>N</fontitalic>
171   - <fontcolorred>0</fontcolorred>
172   - <fontcolorgreen>0</fontcolorgreen>
173   - <fontcolorblue>0</fontcolorblue>
174   - <backgroundcolorred>255</backgroundcolorred>
175   - <backgroundcolorgreen>205</backgroundcolorgreen>
176   - <backgroundcolorblue>112</backgroundcolorblue>
177   - <bordercolorred>100</bordercolorred>
178   - <bordercolorgreen>100</bordercolorgreen>
179   - <bordercolorblue>100</bordercolorblue>
180   - <drawshadow>Y</drawshadow>
181   - </notepad>
182   - </notepads>
183   - <connection>
184   - <name>192.168.168.1_jwgl_dw</name>
185   - <server>192.168.168.1</server>
186   - <type>ORACLE</type>
187   - <access>Native</access>
188   - <database>orcl</database>
189   - <port>1521</port>
190   - <username>jwgl_dw</username>
191   - <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
192   - <servername/>
193   - <data_tablespace/>
194   - <index_tablespace/>
195   - <attributes>
196   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
197   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
198   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
199   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
200   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
201   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
202   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
203   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
204   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
205   - </attributes>
206   - </connection>
207   - <connection>
208   - <name>bus_control_variable</name>
209   - <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
210   - <type>MYSQL</type>
211   - <access>Native</access>
212   - <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
213   - <port>3306</port>
214   - <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
215   - <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
216   - <servername/>
217   - <data_tablespace/>
218   - <index_tablespace/>
219   - <attributes>
220   - <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
221   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
222   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
223   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
224   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
225   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
226   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
227   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
228   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
229   - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
230   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
231   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
232   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
233   - </attributes>
234   - </connection>
235   - <connection>
236   - <name>bus_control_&#x516c;&#x53f8;_201</name>
237   - <server>localhost</server>
238   - <type>MYSQL</type>
239   - <access>Native</access>
240   - <database>control</database>
241   - <port>3306</port>
242   - <username>root</username>
243   - <password>Encrypted </password>
244   - <servername/>
245   - <data_tablespace/>
246   - <index_tablespace/>
247   - <attributes>
248   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
249   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
250   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
251   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
252   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
253   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
254   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
255   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
256   - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
257   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
258   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
259   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
260   - </attributes>
261   - </connection>
262   - <connection>
263   - <name>bus_control_&#x672c;&#x673a;</name>
264   - <server>localhost</server>
265   - <type>MYSQL</type>
266   - <access>Native</access>
267   - <database>control</database>
268   - <port>3306</port>
269   - <username>root</username>
270   - <password>Encrypted </password>
271   - <servername/>
272   - <data_tablespace/>
273   - <index_tablespace/>
274   - <attributes>
275   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
276   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
277   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
278   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
279   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
280   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
281   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
282   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
283   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
284   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
285   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
286   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
287   - </attributes>
288   - </connection>
289   - <connection>
290   - <name>NHJW_VM</name>
291   - <server>192.168.198.240</server>
292   - <type>ORACLE</type>
293   - <access>Native</access>
294   - <database>orcl</database>
295   - <port>1521</port>
296   - <username>nhjw</username>
297   - <password>Encrypted 2be98afc86aa7f2e4cb79ce10d09aa5cd</password>
298   - <servername/>
299   - <data_tablespace/>
300   - <index_tablespace/>
301   - <attributes>
302   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
303   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
304   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
305   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
306   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
307   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
308   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
309   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
310   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
311   - </attributes>
312   - </connection>
313   - <connection>
314   - <name>PDGJ_VM</name>
315   - <server>192.168.198.240</server>
316   - <type>ORACLE</type>
317   - <access>Native</access>
318   - <database>orcl</database>
319   - <port>1521</port>
320   - <username>pdgj</username>
321   - <password>Encrypted 2be98afc86aa7f2e4cb79ce10ce96a8d0</password>
322   - <servername/>
323   - <data_tablespace/>
324   - <index_tablespace/>
325   - <attributes>
326   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
327   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
328   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
329   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
330   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
331   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
332   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
333   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
334   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
335   - </attributes>
336   - </connection>
337   - <connection>
338   - <name>xlab_mysql_youle</name>
339   - <server>101.231.124.8</server>
340   - <type>MYSQL</type>
341   - <access>Native</access>
342   - <database>xlab_youle</database>
343   - <port>45687</port>
344   - <username>xlab-youle</username>
345   - <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
346   - <servername/>
347   - <data_tablespace/>
348   - <index_tablespace/>
349   - <attributes>
350   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
351   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
352   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
353   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
354   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
355   - <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
356   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
357   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
358   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
359   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
360   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
361   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
362   - </attributes>
363   - </connection>
364   - <connection>
365   - <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
366   - <server>localhost</server>
367   - <type>MYSQL</type>
368   - <access>Native</access>
369   - <database>xlab_youle</database>
370   - <port>3306</port>
371   - <username>root</username>
372   - <password>Encrypted </password>
373   - <servername/>
374   - <data_tablespace/>
375   - <index_tablespace/>
376   - <attributes>
377   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
378   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
379   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
380   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
381   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
382   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
383   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
384   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
385   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
386   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
387   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
388   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
389   - </attributes>
390   - </connection>
391   - <connection>
392   - <name>xlab_youle</name>
393   - <server/>
394   - <type>MYSQL</type>
395   - <access>JNDI</access>
396   - <database>xlab_youle</database>
397   - <port>1521</port>
398   - <username/>
399   - <password>Encrypted </password>
400   - <servername/>
401   - <data_tablespace/>
402   - <index_tablespace/>
403   - <attributes>
404   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
405   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
406   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
407   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
408   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
409   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
410   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
411   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
412   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
413   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
414   - </attributes>
415   - </connection>
416   - <order>
417   - <hop> <from>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</from><to>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</to><enabled>Y</enabled> </hop>
418   - <hop> <from>&#x6dfb;&#x52a0;&#x5bf9;&#x5e94;&#x73ed;&#x6b21;&#x6570;</from><to>&#x5904;&#x7406;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
419   - <hop> <from>&#x67e5;&#x627e;&#x65f6;&#x523b;&#x8868;&#x57fa;&#x7840;&#x4fe1;&#x606f;&#x5173;&#x8054;</from><to>&#x67e5;&#x627e;&#x8def;&#x724c;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
420   - <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x5173;&#x8054;</from><to>&#x67e5;&#x627e;&#x65f6;&#x523b;&#x8868;&#x57fa;&#x7840;&#x4fe1;&#x606f;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
421   - <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178;</from><to>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178;</to><enabled>Y</enabled> </hop>
422   - <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 2</from><to>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 2</to><enabled>Y</enabled> </hop>
423   - <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</from><to>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 3</to><enabled>Y</enabled> </hop>
424   - <hop> <from>&#x5339;&#x914d;&#x4e0a;&#x4e0b;&#x884c;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63;</to><enabled>Y</enabled> </hop>
425   - <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</from><to>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</to><enabled>Y</enabled> </hop>
426   - <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</from><to>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
427   - <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</from><to>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
428   - <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</from><to>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
429   - <hop> <from>&#x67e5;&#x627e;&#x6240;&#x6709;&#x7ebf;&#x8def;&#x4e0a;&#x4e0b;&#x884c;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x4e0a;&#x4e0b;&#x884c;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
430   - <hop> <from>&#x67e5;&#x627e;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178;</to><enabled>Y</enabled> </hop>
431   - <hop> <from>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x67e5;&#x627e;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
432   - <hop> <from>&#x6b63;&#x5e38;&#x73ed;&#x6b21;_&#x5904;&#x7406;&#x6570;&#x636e;</from><to>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop>
433   - <hop> <from>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</from><to>&#x6b63;&#x5e38;&#x73ed;&#x6b21;_&#x5904;&#x7406;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
434   - <hop> <from>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178;</from><to>&#x67e5;&#x627e;&#x6240;&#x6709;&#x7ebf;&#x8def;&#x4e0a;&#x4e0b;&#x884c;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
435   - <hop> <from>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 2</from><to>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
436   - <hop> <from>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 3</from><to>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
437   - <hop> <from>&#x8ba1;&#x7b97;&#x73ed;&#x6b21;&#x7c7b;&#x578b;</from><to>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</to><enabled>Y</enabled> </hop>
438   - <hop> <from>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</from><to>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;1</to><enabled>Y</enabled> </hop>
439   - <hop> <from>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;1</from><to>&#x51fa;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x7ec8;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</to><enabled>Y</enabled> </hop>
440   - <hop> <from>&#x51fa;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x7ec8;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</from><to>&#x67e5;&#x627e;&#x51fa;&#x573a;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop>
441   - <hop> <from>&#x67e5;&#x627e;&#x51fa;&#x573a;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 2</to><enabled>Y</enabled> </hop>
442   - <hop> <from>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</from><to>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;2</to><enabled>Y</enabled> </hop>
443   - <hop> <from>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;2</from><to>&#x8fdb;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x8d77;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</to><enabled>Y</enabled> </hop>
444   - <hop> <from>&#x8fdb;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x8d77;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ebf;&#x8def;&#x65b9;&#x5411;</to><enabled>Y</enabled> </hop>
445   - <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ebf;&#x8def;&#x65b9;&#x5411;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</to><enabled>Y</enabled> </hop>
446   - <hop> <from>&#x5206;&#x7ec4;&#x5404;&#x4e2a;&#x8def;&#x724c;&#x7684;&#x7ad9;</from><to>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
447   - <hop> <from>&#x589e;&#x52a0;&#x65f6;&#x523b;&#x8868;&#x540d;&#x5b57;&#xff0c;&#x7ebf;&#x8def;&#x540d;&#x5b57;&#xff0c;&#x505c;&#x8f66;&#x573a;&#x540d;&#x5b57;</from><to>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</to><enabled>Y</enabled> </hop>
448   - <hop> <from>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</from><to>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</to><enabled>Y</enabled> </hop>
449   - <hop> <from>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>
450   - <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</to><enabled>Y</enabled> </hop>
451   - <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop>
452   - <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</to><enabled>Y</enabled> </hop>
453   - <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
454   - <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
455   - <hop> <from>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</to><enabled>Y</enabled> </hop>
456   - <hop> <from>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</to><enabled>Y</enabled> </hop>
457   - <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</to><enabled>Y</enabled> </hop>
458   - <hop> <from>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</to><enabled>Y</enabled> </hop>
459   - <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</to><enabled>Y</enabled> </hop>
460   - <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</to><enabled>Y</enabled> </hop>
461   - <hop> <from>&#x67e5;&#x627e;&#x8def;&#x724c;&#x5173;&#x8054;</from><to>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</to><enabled>Y</enabled> </hop>
462   - <hop> <from>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</from><to>&#x8ba1;&#x7b97;&#x73ed;&#x6b21;&#x7c7b;&#x578b;</to><enabled>Y</enabled> </hop>
463   - <hop> <from>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</from><to>&#x66f4;&#x65b0;&#x65f6;&#x523b;&#x8868;&#x4e3b;&#x8868;&#x7248;&#x672c;</to><enabled>Y</enabled> </hop>
464   - <hop> <from>&#x6dfb;&#x52a0;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;</from><to>&#x6dfb;&#x52a0;&#x5bf9;&#x5e94;&#x73ed;&#x6b21;&#x6570;</to><enabled>Y</enabled> </hop>
465   - <hop> <from>&#x5904;&#x7406;&#x6570;&#x636e;</from><to>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;&#xff08;&#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x4e3a;&#x7a7a;&#xff09;</to><enabled>Y</enabled> </hop>
466   - <hop> <from>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;&#xff08;&#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x4e3a;&#x7a7a;&#xff09;</from><to>&#x5206;&#x7ec4;&#x5404;&#x4e2a;&#x8def;&#x724c;&#x7684;&#x7ad9;</to><enabled>Y</enabled> </hop>
467   - <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>&#x6dfb;&#x52a0;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;</to><enabled>Y</enabled> </hop>
468   - </order>
469   - <step>
470   - <name>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</name>
471   - <type>IfNull</type>
472   - <description/>
473   - <distribute>Y</distribute>
474   - <custom_distribution/>
475   - <copies>1</copies>
476   - <partitioning>
477   - <method>none</method>
478   - <schema_name/>
479   - </partitioning>
480   - <replaceAllByValue/>
481   - <replaceAllMask/>
482   - <selectFields>Y</selectFields>
483   - <selectValuesType>N</selectValuesType>
484   - <setEmptyStringAll>N</setEmptyStringAll>
485   - <valuetypes>
486   - </valuetypes>
487   - <fields>
488   - <field>
489   - <name>sxx</name>
490   - <value>0</value>
491   - <mask/>
492   - <set_empty_string>N</set_empty_string>
493   - </field>
494   - </fields>
495   - <cluster_schema/>
496   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
497   - <xloc>335</xloc>
498   - <yloc>938</yloc>
499   - <draw>Y</draw>
500   - </GUI>
501   - </step>
502   -
503   - <step>
504   - <name>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</name>
505   - <type>IfNull</type>
506   - <description/>
507   - <distribute>Y</distribute>
508   - <custom_distribution/>
509   - <copies>1</copies>
510   - <partitioning>
511   - <method>none</method>
512   - <schema_name/>
513   - </partitioning>
514   - <replaceAllByValue/>
515   - <replaceAllMask/>
516   - <selectFields>Y</selectFields>
517   - <selectValuesType>N</selectValuesType>
518   - <setEmptyStringAll>N</setEmptyStringAll>
519   - <valuetypes>
520   - </valuetypes>
521   - <fields>
522   - <field>
523   - <name>sxx2</name>
524   - <value>0</value>
525   - <mask/>
526   - <set_empty_string>N</set_empty_string>
527   - </field>
528   - </fields>
529   - <cluster_schema/>
530   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
531   - <xloc>804</xloc>
532   - <yloc>1081</yloc>
533   - <draw>Y</draw>
534   - </GUI>
535   - </step>
536   -
537   - <step>
538   - <name>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178;</name>
539   - <type>ValueMapper</type>
540   - <description/>
541   - <distribute>Y</distribute>
542   - <custom_distribution/>
543   - <copies>1</copies>
544   - <partitioning>
545   - <method>none</method>
546   - <schema_name/>
547   - </partitioning>
548   - <field_to_use>sxx</field_to_use>
549   - <target_field>sxx_desc</target_field>
550   - <non_match_default/>
551   - <fields>
552   - <field>
553   - <source_value>0</source_value>
554   - <target_value>&#x4e0a;&#x884c;</target_value>
555   - </field>
556   - <field>
557   - <source_value>1</source_value>
558   - <target_value>&#x4e0b;&#x884c;</target_value>
559   - </field>
560   - </fields>
561   - <cluster_schema/>
562   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
563   - <xloc>147</xloc>
564   - <yloc>403</yloc>
565   - <draw>Y</draw>
566   - </GUI>
567   - </step>
568   -
569   - <step>
570   - <name>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 2</name>
571   - <type>ValueMapper</type>
572   - <description/>
573   - <distribute>Y</distribute>
574   - <custom_distribution/>
575   - <copies>1</copies>
576   - <partitioning>
577   - <method>none</method>
578   - <schema_name/>
579   - </partitioning>
580   - <field_to_use>sxx</field_to_use>
581   - <target_field>sxx_desc</target_field>
582   - <non_match_default/>
583   - <fields>
584   - <field>
585   - <source_value>0</source_value>
586   - <target_value>&#x4e0a;&#x884c;</target_value>
587   - </field>
588   - <field>
589   - <source_value>1</source_value>
590   - <target_value>&#x4e0b;&#x884c;</target_value>
591   - </field>
592   - </fields>
593   - <cluster_schema/>
594   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
595   - <xloc>331</xloc>
596   - <yloc>598</yloc>
597   - <draw>Y</draw>
598   - </GUI>
599   - </step>
600   -
601   - <step>
602   - <name>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</name>
603   - <type>ValueMapper</type>
604   - <description/>
605   - <distribute>Y</distribute>
606   - <custom_distribution/>
607   - <copies>1</copies>
608   - <partitioning>
609   - <method>none</method>
610   - <schema_name/>
611   - </partitioning>
612   - <field_to_use>sxx</field_to_use>
613   - <target_field>sxx_desc</target_field>
614   - <non_match_default/>
615   - <fields>
616   - <field>
617   - <source_value>0</source_value>
618   - <target_value>&#x4e0a;&#x884c;</target_value>
619   - </field>
620   - <field>
621   - <source_value>1</source_value>
622   - <target_value>&#x4e0b;&#x884c;</target_value>
623   - </field>
624   - </fields>
625   - <cluster_schema/>
626   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
627   - <xloc>553</xloc>
628   - <yloc>859</yloc>
629   - <draw>Y</draw>
630   - </GUI>
631   - </step>
632   -
633   - <step>
634   - <name>&#x51fa;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x7ec8;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</name>
635   - <type>ScriptValueMod</type>
636   - <description/>
637   - <distribute>Y</distribute>
638   - <custom_distribution/>
639   - <copies>1</copies>
640   - <partitioning>
641   - <method>none</method>
642   - <schema_name/>
643   - </partitioning>
644   - <compatible>N</compatible>
645   - <optimizationLevel>9</optimizationLevel>
646   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
647   - <jsScript_name>Script 1</jsScript_name>
648   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var zdzname &#x3d; cc_groups&#x5b;gno&#x5d;&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#x662f;&#x4e0b;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x59cb;&#x7ad9;&#xa;var endZdtype &#x3d; &#x27;B&#x27;&#x3b;&#xa;&#x2f;&#x2f; var endZdtype &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
649   - </jsScript> </jsScripts> <fields> <field> <name>zdzname</name>
650   - <rename>zdzname</rename>
651   - <type>String</type>
652   - <length>-1</length>
653   - <precision>-1</precision>
654   - <replace>N</replace>
655   - </field> <field> <name>endZdtype</name>
656   - <rename>endZdtype</rename>
657   - <type>String</type>
658   - <length>-1</length>
659   - <precision>-1</precision>
660   - <replace>N</replace>
661   - </field> <field> <name>destory</name>
662   - <rename>destory</rename>
663   - <type>Integer</type>
664   - <length>-1</length>
665   - <precision>-1</precision>
666   - <replace>N</replace>
667   - </field> </fields> <cluster_schema/>
668   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
669   - <xloc>575</xloc>
670   - <yloc>502</yloc>
671   - <draw>Y</draw>
672   - </GUI>
673   - </step>
674   -
675   - <step>
676   - <name>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</name>
677   - <type>Dummy</type>
678   - <description/>
679   - <distribute>Y</distribute>
680   - <custom_distribution/>
681   - <copies>1</copies>
682   - <partitioning>
683   - <method>none</method>
684   - <schema_name/>
685   - </partitioning>
686   - <cluster_schema/>
687   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
688   - <xloc>869</xloc>
689   - <yloc>504</yloc>
690   - <draw>Y</draw>
691   - </GUI>
692   - </step>
693   -
694   - <step>
695   - <name>&#x5206;&#x7ec4;&#x5404;&#x4e2a;&#x8def;&#x724c;&#x7684;&#x7ad9;</name>
696   - <type>GroupBy</type>
697   - <description/>
698   - <distribute>Y</distribute>
699   - <custom_distribution/>
700   - <copies>1</copies>
701   - <partitioning>
702   - <method>none</method>
703   - <schema_name/>
704   - </partitioning>
705   - <all_rows>Y</all_rows>
706   - <ignore_aggregate>N</ignore_aggregate>
707   - <field_ignore/>
708   - <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
709   - <prefix>grp</prefix>
710   - <add_linenr>Y</add_linenr>
711   - <linenr_fieldname>gno</linenr_fieldname>
712   - <give_back_row>N</give_back_row>
713   - <group>
714   - <field>
715   - <name>lp</name>
716   - </field>
717   - </group>
718   - <fields>
719   - <field>
720   - <aggregate>qdzgroups</aggregate>
721   - <subject>qdzname</subject>
722   - <type>CONCAT_STRING</type>
723   - <valuefield>,</valuefield>
724   - </field>
725   - </fields>
726   - <cluster_schema/>
727   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
728   - <xloc>892</xloc>
729   - <yloc>44</yloc>
730   - <draw>Y</draw>
731   - </GUI>
732   - </step>
733   -
734   - <step>
735   - <name>&#x5339;&#x914d;&#x4e0a;&#x4e0b;&#x884c;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
736   - <type>ScriptValueMod</type>
737   - <description/>
738   - <distribute>Y</distribute>
739   - <custom_distribution/>
740   - <copies>1</copies>
741   - <partitioning>
742   - <method>none</method>
743   - <schema_name/>
744   - </partitioning>
745   - <compatible>N</compatible>
746   - <optimizationLevel>9</optimizationLevel>
747   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
748   - <jsScript_name>Script 1</jsScript_name>
749   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var jhlc&#x3b; &#x2f;&#x2f; &#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var bcsj&#x3b; &#x2f;&#x2f; &#x73ed;&#x6b21;&#x65f6;&#x95f4;&#xa;&#xa;&#x2f;&#x2f; &#x65f6;&#x95f4;&#x8303;&#x56f4;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#xa;var timeRex &#x3d; &#x2f;&#x5e;&#x28;&#x5b;01&#x5d;&#x3f;&#x5b;0-9&#x5d;&#x7c;2&#x5b;0-3&#x5d;&#x29;&#x3a;&#x5b;0-5&#x5d;&#x5b;0-9&#x5d;&#x24;&#x2f;&#x3b;&#xa;&#x2f;&#x2f; &#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x8f6c;&#x6362;&#x6210;&#x65e5;&#x671f;&#xa;var fcsj_hour &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_min &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_date &#x3d; new Date&#x28;2000,1,1,fcsj_hour,fcsj_min,0&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x65e9;&#x9ad8;&#x5cf0;&#xa;var isZgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;early_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;early_end_time&#x29; &#x26;&#x26; early_up_time &#x21;&#x3d; null &#x26;&#x26; early_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var early_s_hour &#x3d; str2num&#x28;early_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_min &#x3d; str2num&#x28;early_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_date &#x3d; new Date&#x28;2000,1,1,early_s_hour,early_s_min,0&#x29;&#x3b;&#xa;&#xa; var early_e_hour &#x3d; str2num&#x28;early_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_min &#x3d; str2num&#x28;early_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_date &#x3d; new Date&#x28;2000,1,1,early_e_hour,early_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; early_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; early_e_date&#x29; &#x7b;&#xa; isZgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;var isWgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;late_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;late_end_time&#x29; &#x26;&#x26; late_up_time &#x21;&#x3d; null &#x26;&#x26; late_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var late_s_hour &#x3d; str2num&#x28;late_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_min &#x3d; str2num&#x28;late_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_date &#x3d; new Date&#x28;2000,1,1,late_s_hour,late_s_min,0&#x29;&#x3b;&#xa;&#xa; var late_e_hour &#x3d; str2num&#x28;late_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_min &#x3d; str2num&#x28;late_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_date &#x3d; new Date&#x28;2000,1,1,late_e_hour,late_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; late_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; late_e_date&#x29; &#x7b;&#xa; isWgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; early_up_time &#x21;&#x3d; 0 &#x3f; early_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; late_up_time &#x21;&#x3d; 0 &#x3f; late_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; up_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; early_down_time &#x21;&#x3d; 0 &#x3f; early_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; late_down_time &#x21;&#x3d; 0 &#x3f; late_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; down_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d;</jsScript_script>
750   - </jsScript> </jsScripts> <fields> <field> <name>jhlc</name>
751   - <rename>jhlc</rename>
752   - <type>String</type>
753   - <length>-1</length>
754   - <precision>-1</precision>
755   - <replace>N</replace>
756   - </field> <field> <name>bcsj</name>
757   - <rename>bcsj</rename>
758   - <type>String</type>
759   - <length>-1</length>
760   - <precision>-1</precision>
761   - <replace>N</replace>
762   - </field> </fields> <cluster_schema/>
763   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
764   - <xloc>148</xloc>
765   - <yloc>674</yloc>
766   - <draw>Y</draw>
767   - </GUI>
768   - </step>
769   -
770   - <step>
771   - <name>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
772   - <type>ScriptValueMod</type>
773   - <description/>
774   - <distribute>Y</distribute>
775   - <custom_distribution/>
776   - <copies>1</copies>
777   - <partitioning>
778   - <method>none</method>
779   - <schema_name/>
780   - </partitioning>
781   - <compatible>N</compatible>
782   - <optimizationLevel>9</optimizationLevel>
783   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
784   - <jsScript_name>Script 1</jsScript_name>
785   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var out_mileage&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var out_time&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x8ba1;&#x5212;&#x65f6;&#x95f4;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; out_mileage &#x3d; up_out_mileage&#x3b;&#xa; out_time &#x3d; up_out_timer&#x3b;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; out_mileage &#x3d; down_out_mileage&#x3b;&#xa; out_time &#x3d; down_out_timer&#x3b;&#xa;&#x7d;&#xa;&#xa;&#xa;&#xa;</jsScript_script>
786   - </jsScript> </jsScripts> <fields> <field> <name>out_mileage</name>
787   - <rename>out_mileage</rename>
788   - <type>String</type>
789   - <length>-1</length>
790   - <precision>-1</precision>
791   - <replace>N</replace>
792   - </field> <field> <name>out_time</name>
793   - <rename>out_time</rename>
794   - <type>String</type>
795   - <length>-1</length>
796   - <precision>-1</precision>
797   - <replace>N</replace>
798   - </field> </fields> <cluster_schema/>
799   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
800   - <xloc>336</xloc>
801   - <yloc>862</yloc>
802   - <draw>Y</draw>
803   - </GUI>
804   - </step>
805   -
806   - <step>
807   - <name>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
808   - <type>ScriptValueMod</type>
809   - <description/>
810   - <distribute>Y</distribute>
811   - <custom_distribution/>
812   - <copies>1</copies>
813   - <partitioning>
814   - <method>none</method>
815   - <schema_name/>
816   - </partitioning>
817   - <compatible>N</compatible>
818   - <optimizationLevel>9</optimizationLevel>
819   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
820   - <jsScript_name>Script 1</jsScript_name>
821   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var parade_mileage&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var parade_time&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x8ba1;&#x5212;&#x65f6;&#x95f4;&#xa;&#xa;if &#x28;sxx2 &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; parade_mileage &#x3d; up_in_mileage&#x3b;&#xa; parade_time &#x3d; up_in_timer&#x3b;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; parade_mileage &#x3d; down_in_mileage&#x3b;&#xa; parade_time &#x3d; down_in_timer&#x3b;&#xa;&#x7d;&#xa;&#xa;&#xa;&#xa;</jsScript_script>
822   - </jsScript> </jsScripts> <fields> <field> <name>parade_mileage</name>
823   - <rename>parade_mileage</rename>
824   - <type>String</type>
825   - <length>-1</length>
826   - <precision>-1</precision>
827   - <replace>N</replace>
828   - </field> <field> <name>parade_time</name>
829   - <rename>parade_time</rename>
830   - <type>String</type>
831   - <length>-1</length>
832   - <precision>-1</precision>
833   - <replace>N</replace>
834   - </field> </fields> <cluster_schema/>
835   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
836   - <xloc>726</xloc>
837   - <yloc>1005</yloc>
838   - <draw>Y</draw>
839   - </GUI>
840   - </step>
841   -
842   - <step>
843   - <name>&#x589e;&#x52a0;&#x65f6;&#x523b;&#x8868;&#x540d;&#x5b57;&#xff0c;&#x7ebf;&#x8def;&#x540d;&#x5b57;&#xff0c;&#x505c;&#x8f66;&#x573a;&#x540d;&#x5b57;</name>
844   - <type>DataGrid</type>
845   - <description/>
846   - <distribute>Y</distribute>
847   - <custom_distribution/>
848   - <copies>1</copies>
849   - <partitioning>
850   - <method>none</method>
851   - <schema_name/>
852   - </partitioning>
853   - <fields>
854   - </fields>
855   - <data>
856   - <line> </line>
857   - </data>
858   - <cluster_schema/>
859   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
860   - <xloc>110</xloc>
861   - <yloc>133</yloc>
862   - <draw>Y</draw>
863   - </GUI>
864   - </step>
865   -
866   - <step>
867   - <name>&#x5904;&#x7406;&#x6570;&#x636e;</name>
868   - <type>ScriptValueMod</type>
869   - <description/>
870   - <distribute>Y</distribute>
871   - <custom_distribution/>
872   - <copies>1</copies>
873   - <partitioning>
874   - <method>none</method>
875   - <schema_name/>
876   - </partitioning>
877   - <compatible>N</compatible>
878   - <optimizationLevel>9</optimizationLevel>
879   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
880   - <jsScript_name>Script 1</jsScript_name>
881   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x751f;&#x6210;&#x65f6;&#x523b;&#x8868;&#x7684;&#x683c;&#x5f0f;&#x6570;&#x636e;&#x5904;&#x7406;&#xa;&#x2f;&#x2f; &#x5df2;&#x7ecf;&#x8fc7;&#x6ee4;&#x4e86; &#x62a5;&#x5230;&#xff0c;&#x5230;&#x573a;&#xff0c;&#x79bb;&#x573a;&#xff0c;&#x603b;&#x516c;&#x91cc;&#xff0c;&#x8425;&#x4e1a;&#x516c;&#x91cc;&#xff0c;&#x7a7a;&#x9a76;&#x516c;&#x91cc;&#xff0c;&#x603b;&#x5de5;&#x65f6;&#xff0c;&#x8425;&#x4e1a;&#x5de5;&#x65f6;&#xff0c;&#x8425;&#x8fd0;&#x73ed;&#x6b21; &#x6570;&#x636e;&#xa;&#x2f;&#x2f; sendtime&#x9700;&#x8981;&#x5904;&#x7406; &#x28;&#x62a5;&#x7c;&#x51fa;&#x29;hh&#x3a;mm&#x683c;&#x5f0f; hh&#x3a;mm&#x28;X&#x7c;&#x203b;&#x29;&#x683c;&#x5f0f;&#xa;&#xa;&#x2f;&#x2f; &#x5982;&#x679c;&#x7ad9;&#x540d;&#x4e2d;&#x6709;&#x7c7b;&#x4f3c;-&#x3e;&#x7b;&#x6570;&#x5b57;&#x7d;&#xff0c;&#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x8fc7;&#x6ee4;&#x6389;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;-&#x3e;&#x5c;d&#x2b;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;qdzname &#x3d;&#x3d; &#x22;&#x62a5;&#x5230;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x5230;&#x573a;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x79bb;&#x573a;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x603b;&#x516c;&#x91cc;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x8425;&#x4e1a;&#x516c;&#x91cc;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x7a7a;&#x9a76;&#x516c;&#x91cc;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x603b;&#x5de5;&#x65f6;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x8425;&#x4e1a;&#x5de5;&#x65f6;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x8425;&#x8fd0;&#x73ed;&#x6b21;&#x22;&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; null&#x3b;&#xa;&#x7d; else &#x7b;&#xa; if &#x28;sendtime &#x3d;&#x3d; null&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; null&#x3b;&#xa; &#x7d; else &#x7b;&#xa; sendtime_calcu &#x3d; sendtime.replace&#x28;&#x2f;&#x5c;s&#x2f;g, &#x22;&#x22;&#x29;&#x3b;&#xa; if &#x28;sendtime_calcu.indexOf&#x28;&#x22;&#x62a5;&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5206;&#x73ed;&#x62a5;&#x5230;&#x73ed;&#x6b21;&#x795b;&#x9664;&#xa; sendtime_calcu &#x3d; null&#x3b;&#xa; &#x7d; else &#x7b;&#xa; if &#x28;sendtime_calcu.indexOf&#x28;&#x22;X&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x73ed;&#x6b21;&#xa; qdzname &#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x3b;&#xa; sendtime_calcu &#x3d; sendtime_calcu.substr&#x28;0, sendtime_calcu.indexOf&#x28;&#x22;X&#x22;&#x29;&#x29;&#x3b;&#xa; &#x7d; else if &#x28;sendtime_calcu.indexOf&#x28;&#x22;&#x51fa;&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5206;&#x73ed;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#xa; qdzname &#x3d; &#x22;&#x51fa;&#x573a;&#x22;&#x3b;&#xa; sendtime_calcu &#x3d; sendtime_calcu.substr&#x28;1&#x29;&#x3b;&#xa; &#x7d; else if &#x28;sendtime_calcu.indexOf&#x28;&#x22;&#x203b;&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x505c;&#x9a76;&#x73ed;&#x6b21;&#xa; sendtime_calcu &#x3d; sendtime_calcu.substr&#x28;0, sendtime_calcu.indexOf&#x28;&#x22;X&#x22;&#x29;&#x29;&#x3b;&#xa; &#x7d; else &#x7b;&#xa; &#x2f;&#x2f; &#x6b63;&#x5e38;&#x73ed;&#x6b21;&#xa; &#x7d;&#xa;&#xa; &#x2f;&#x2f; &#x5904;&#x7406;&#x65f6;&#x95f4;&#x683c;&#x5f0f;&#xa; &#x2f;&#x2f; &#x56e0;&#x4e3a;&#x683c;&#x5f0f;&#x53ea;&#x652f;&#x6301; &#x3a; &#x5206;&#x9694;&#xff0c;&#x6240;&#x4ee5;&#x8865;0&#x5c31;&#x53ef;&#x4ee5;&#x4e86;&#xa; if &#x28;sendtime_calcu.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa; &#x7d; &#xa; &#x7d;&#xa;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
882   - </jsScript> </jsScripts> <fields> <field> <name>qdzname</name>
883   - <rename>qdzname</rename>
884   - <type>String</type>
885   - <length>-1</length>
886   - <precision>-1</precision>
887   - <replace>Y</replace>
888   - </field> <field> <name>isfb</name>
889   - <rename>isfb</rename>
890   - <type>Integer</type>
891   - <length>-1</length>
892   - <precision>-1</precision>
893   - <replace>N</replace>
894   - </field> <field> <name>iscanceled</name>
895   - <rename>iscanceled</rename>
896   - <type>Integer</type>
897   - <length>-1</length>
898   - <precision>-1</precision>
899   - <replace>N</replace>
900   - </field> <field> <name>sendtime_calcu</name>
901   - <rename>sendtime_calcu</rename>
902   - <type>String</type>
903   - <length>-1</length>
904   - <precision>-1</precision>
905   - <replace>N</replace>
906   - </field> <field> <name>ists</name>
907   - <rename>ists</rename>
908   - <type>Integer</type>
909   - <length>-1</length>
910   - <precision>-1</precision>
911   - <replace>N</replace>
912   - </field> </fields> <cluster_schema/>
913   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
914   - <xloc>654</xloc>
915   - <yloc>45</yloc>
916   - <draw>Y</draw>
917   - </GUI>
918   - </step>
919   -
920   - <step>
921   - <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
922   - <type>SelectValues</type>
923   - <description/>
924   - <distribute>Y</distribute>
925   - <custom_distribution/>
926   - <copies>1</copies>
927   - <partitioning>
928   - <method>none</method>
929   - <schema_name/>
930   - </partitioning>
931   - <fields> <field> <name>&#x8def;&#x724c;</name>
932   - <rename>lp</rename>
933   - <length>-2</length>
934   - <precision>-2</precision>
935   - </field> <field> <name>&#x7ad9;&#x70b9;&#x540d;&#x79f0;</name>
936   - <rename>qdzname</rename>
937   - <length>-2</length>
938   - <precision>-2</precision>
939   - </field> <field> <name>&#x53d1;&#x8f66;&#x65f6;&#x95f4;</name>
940   - <rename>sendtime</rename>
941   - <length>-2</length>
942   - <precision>-2</precision>
943   - </field> <select_unspecified>Y</select_unspecified>
944   - </fields> <cluster_schema/>
945   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
946   - <xloc>441</xloc>
947   - <yloc>133</yloc>
948   - <draw>Y</draw>
949   - </GUI>
950   - </step>
951   -
952   - <step>
953   - <name>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</name>
954   - <type>FilterRows</type>
955   - <description/>
956   - <distribute>Y</distribute>
957   - <custom_distribution/>
958   - <copies>1</copies>
959   - <partitioning>
960   - <method>none</method>
961   - <schema_name/>
962   - </partitioning>
963   -<send_true_to>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</send_true_to>
964   -<send_false_to>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</send_false_to>
965   - <compare>
966   -<condition>
967   - <negated>N</negated>
968   - <leftvalue>bctype</leftvalue>
969   - <function>&#x3d;</function>
970   - <rightvalue/>
971   - <value><name>constant</name><type>String</type><text>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition>
972   - </compare>
973   - <cluster_schema/>
974   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
975   - <xloc>860</xloc>
976   - <yloc>401</yloc>
977   - <draw>Y</draw>
978   - </GUI>
979   - </step>
980   -
981   - <step>
982   - <name>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</name>
983   - <type>FilterRows</type>
984   - <description/>
985   - <distribute>Y</distribute>
986   - <custom_distribution/>
987   - <copies>1</copies>
988   - <partitioning>
989   - <method>none</method>
990   - <schema_name/>
991   - </partitioning>
992   -<send_true_to>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</send_true_to>
993   -<send_false_to>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</send_false_to>
994   - <compare>
995   -<condition>
996   - <negated>N</negated>
997   - <leftvalue>bctype</leftvalue>
998   - <function>&#x3d;</function>
999   - <rightvalue/>
1000   - <value><name>constant</name><type>String</type><text>&#x51fa;&#x573a;</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition>
1001   - </compare>
1002   - <cluster_schema/>
1003   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1004   - <xloc>995</xloc>
1005   - <yloc>503</yloc>
1006   - <draw>Y</draw>
1007   - </GUI>
1008   - </step>
1009   -
1010   - <step>
1011   - <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</name>
1012   - <type>InsertUpdate</type>
1013   - <description/>
1014   - <distribute>Y</distribute>
1015   - <custom_distribution/>
1016   - <copies>1</copies>
1017   - <partitioning>
1018   - <method>none</method>
1019   - <schema_name/>
1020   - </partitioning>
1021   - <connection>bus_control_variable</connection>
1022   - <commit>100</commit>
1023   - <update_bypassed>N</update_bypassed>
1024   - <lookup>
1025   - <schema/>
1026   - <table>bsth_c_s_ttinfo_detail</table>
1027   - <key>
1028   - <name>xlid</name>
1029   - <field>xl</field>
1030   - <condition>&#x3d;</condition>
1031   - <name2/>
1032   - </key>
1033   - <key>
1034   - <name>ttid</name>
1035   - <field>ttinfo</field>
1036   - <condition>&#x3d;</condition>
1037   - <name2/>
1038   - </key>
1039   - <key>
1040   - <name>lpid</name>
1041   - <field>lp</field>
1042   - <condition>&#x3d;</condition>
1043   - <name2/>
1044   - </key>
1045   - <key>
1046   - <name>fcno</name>
1047   - <field>fcno</field>
1048   - <condition>&#x3d;</condition>
1049   - <name2/>
1050   - </key>
1051   - <key>
1052   - <name>bcs</name>
1053   - <field>bcs</field>
1054   - <condition>&#x3d;</condition>
1055   - <name2/>
1056   - </key>
1057   - <value>
1058   - <name>lp</name>
1059   - <rename>lpid</rename>
1060   - <update>Y</update>
1061   - </value>
1062   - <value>
1063   - <name>bc_type</name>
1064   - <rename>bctype_code</rename>
1065   - <update>Y</update>
1066   - </value>
1067   - <value>
1068   - <name>bcs</name>
1069   - <rename>bcs</rename>
1070   - <update>Y</update>
1071   - </value>
1072   - <value>
1073   - <name>bcsj</name>
1074   - <rename>bcsj</rename>
1075   - <update>Y</update>
1076   - </value>
1077   - <value>
1078   - <name>fcno</name>
1079   - <rename>fcno</rename>
1080   - <update>Y</update>
1081   - </value>
1082   - <value>
1083   - <name>jhlc</name>
1084   - <rename>jhlc</rename>
1085   - <update>Y</update>
1086   - </value>
1087   - <value>
1088   - <name>fcsj</name>
1089   - <rename>sendtime_calcu</rename>
1090   - <update>Y</update>
1091   - </value>
1092   - <value>
1093   - <name>ttinfo</name>
1094   - <rename>ttid</rename>
1095   - <update>Y</update>
1096   - </value>
1097   - <value>
1098   - <name>xl</name>
1099   - <rename>xlid</rename>
1100   - <update>Y</update>
1101   - </value>
1102   - <value>
1103   - <name>qdz</name>
1104   - <rename>qdzid</rename>
1105   - <update>Y</update>
1106   - </value>
1107   - <value>
1108   - <name>zdz</name>
1109   - <rename>zdzid</rename>
1110   - <update>Y</update>
1111   - </value>
1112   - <value>
1113   - <name>xl_dir</name>
1114   - <rename>sxx</rename>
1115   - <update>Y</update>
1116   - </value>
1117   - <value>
1118   - <name>isfb</name>
1119   - <rename>isfb</rename>
1120   - <update>Y</update>
1121   - </value>
1122   - <value>
1123   - <name>qdz_code</name>
1124   - <rename>qdzcode</rename>
1125   - <update>Y</update>
1126   - </value>
1127   - <value>
1128   - <name>qdz_name</name>
1129   - <rename>qdzname_</rename>
1130   - <update>Y</update>
1131   - </value>
1132   - <value>
1133   - <name>zdz_code</name>
1134   - <rename>zdzcode</rename>
1135   - <update>Y</update>
1136   - </value>
1137   - <value>
1138   - <name>zdz_name</name>
1139   - <rename>zdzname</rename>
1140   - <update>Y</update>
1141   - </value>
1142   - <value>
1143   - <name>ists</name>
1144   - <rename>ists</rename>
1145   - <update>Y</update>
1146   - </value>
1147   - <value>
1148   - <name>line_version</name>
1149   - <rename>version</rename>
1150   - <update>Y</update>
1151   - </value>
1152   - </lookup>
1153   - <cluster_schema/>
1154   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1155   - <xloc>143</xloc>
1156   - <yloc>860</yloc>
1157   - <draw>Y</draw>
1158   - </GUI>
1159   - </step>
1160   -
1161   - <step>
1162   - <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</name>
1163   - <type>InsertUpdate</type>
1164   - <description/>
1165   - <distribute>Y</distribute>
1166   - <custom_distribution/>
1167   - <copies>1</copies>
1168   - <partitioning>
1169   - <method>none</method>
1170   - <schema_name/>
1171   - </partitioning>
1172   - <connection>bus_control_variable</connection>
1173   - <commit>100</commit>
1174   - <update_bypassed>N</update_bypassed>
1175   - <lookup>
1176   - <schema/>
1177   - <table>bsth_c_s_ttinfo_detail</table>
1178   - <key>
1179   - <name>xlid</name>
1180   - <field>xl</field>
1181   - <condition>&#x3d;</condition>
1182   - <name2/>
1183   - </key>
1184   - <key>
1185   - <name>ttid</name>
1186   - <field>ttinfo</field>
1187   - <condition>&#x3d;</condition>
1188   - <name2/>
1189   - </key>
1190   - <key>
1191   - <name>lpid</name>
1192   - <field>lp</field>
1193   - <condition>&#x3d;</condition>
1194   - <name2/>
1195   - </key>
1196   - <key>
1197   - <name>fcno</name>
1198   - <field>fcno</field>
1199   - <condition>&#x3d;</condition>
1200   - <name2/>
1201   - </key>
1202   - <key>
1203   - <name>bcs</name>
1204   - <field>bcs</field>
1205   - <condition>&#x3d;</condition>
1206   - <name2/>
1207   - </key>
1208   - <value>
1209   - <name>tcc</name>
1210   - <rename>qdzid</rename>
1211   - <update>Y</update>
1212   - </value>
1213   - <value>
1214   - <name>zdz</name>
1215   - <rename>zdzid</rename>
1216   - <update>Y</update>
1217   - </value>
1218   - <value>
1219   - <name>xl</name>
1220   - <rename>xlid</rename>
1221   - <update>Y</update>
1222   - </value>
1223   - <value>
1224   - <name>ttinfo</name>
1225   - <rename>ttid</rename>
1226   - <update>Y</update>
1227   - </value>
1228   - <value>
1229   - <name>xl_dir</name>
1230   - <rename>sxx</rename>
1231   - <update>Y</update>
1232   - </value>
1233   - <value>
1234   - <name>lp</name>
1235   - <rename>lpid</rename>
1236   - <update>Y</update>
1237   - </value>
1238   - <value>
1239   - <name>jhlc</name>
1240   - <rename>out_mileage</rename>
1241   - <update>Y</update>
1242   - </value>
1243   - <value>
1244   - <name>fcsj</name>
1245   - <rename>sendtime_calcu</rename>
1246   - <update>Y</update>
1247   - </value>
1248   - <value>
1249   - <name>bcsj</name>
1250   - <rename>out_time</rename>
1251   - <update>Y</update>
1252   - </value>
1253   - <value>
1254   - <name>bcs</name>
1255   - <rename>bcs</rename>
1256   - <update>Y</update>
1257   - </value>
1258   - <value>
1259   - <name>fcno</name>
1260   - <rename>fcno</rename>
1261   - <update>Y</update>
1262   - </value>
1263   - <value>
1264   - <name>bc_type</name>
1265   - <rename>bctype_code</rename>
1266   - <update>Y</update>
1267   - </value>
1268   - <value>
1269   - <name>isfb</name>
1270   - <rename>isfb</rename>
1271   - <update>Y</update>
1272   - </value>
1273   - <value>
1274   - <name>qdz_code</name>
1275   - <rename>qdzcode</rename>
1276   - <update>Y</update>
1277   - </value>
1278   - <value>
1279   - <name>qdz_name</name>
1280   - <rename>tn</rename>
1281   - <update>Y</update>
1282   - </value>
1283   - <value>
1284   - <name>zdz_code</name>
1285   - <rename>zdzcode</rename>
1286   - <update>Y</update>
1287   - </value>
1288   - <value>
1289   - <name>zdz_name</name>
1290   - <rename>zdzname_</rename>
1291   - <update>Y</update>
1292   - </value>
1293   - <value>
1294   - <name>ists</name>
1295   - <rename>ists</rename>
1296   - <update>Y</update>
1297   - </value>
1298   - <value>
1299   - <name>line_version</name>
1300   - <rename>version</rename>
1301   - <update>Y</update>
1302   - </value>
1303   - </lookup>
1304   - <cluster_schema/>
1305   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1306   - <xloc>340</xloc>
1307   - <yloc>1087</yloc>
1308   - <draw>Y</draw>
1309   - </GUI>
1310   - </step>
1311   -
1312   - <step>
1313   - <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</name>
1314   - <type>InsertUpdate</type>
1315   - <description/>
1316   - <distribute>Y</distribute>
1317   - <custom_distribution/>
1318   - <copies>1</copies>
1319   - <partitioning>
1320   - <method>none</method>
1321   - <schema_name/>
1322   - </partitioning>
1323   - <connection>bus_control_variable</connection>
1324   - <commit>100</commit>
1325   - <update_bypassed>N</update_bypassed>
1326   - <lookup>
1327   - <schema/>
1328   - <table>bsth_c_s_ttinfo_detail</table>
1329   - <key>
1330   - <name>xlid</name>
1331   - <field>xl</field>
1332   - <condition>&#x3d;</condition>
1333   - <name2/>
1334   - </key>
1335   - <key>
1336   - <name>ttid</name>
1337   - <field>ttinfo</field>
1338   - <condition>&#x3d;</condition>
1339   - <name2/>
1340   - </key>
1341   - <key>
1342   - <name>lpid</name>
1343   - <field>lp</field>
1344   - <condition>&#x3d;</condition>
1345   - <name2/>
1346   - </key>
1347   - <key>
1348   - <name>fcno</name>
1349   - <field>fcno</field>
1350   - <condition>&#x3d;</condition>
1351   - <name2/>
1352   - </key>
1353   - <key>
1354   - <name>bcs</name>
1355   - <field>bcs</field>
1356   - <condition>&#x3d;</condition>
1357   - <name2/>
1358   - </key>
1359   - <value>
1360   - <name>fcno</name>
1361   - <rename>fcno</rename>
1362   - <update>Y</update>
1363   - </value>
1364   - <value>
1365   - <name>bcs</name>
1366   - <rename>bcs</rename>
1367   - <update>Y</update>
1368   - </value>
1369   - <value>
1370   - <name>xl</name>
1371   - <rename>xlid</rename>
1372   - <update>Y</update>
1373   - </value>
1374   - <value>
1375   - <name>ttinfo</name>
1376   - <rename>ttid</rename>
1377   - <update>Y</update>
1378   - </value>
1379   - <value>
1380   - <name>lp</name>
1381   - <rename>lpid</rename>
1382   - <update>Y</update>
1383   - </value>
1384   - <value>
1385   - <name>bc_type</name>
1386   - <rename>bctype_code</rename>
1387   - <update>Y</update>
1388   - </value>
1389   - <value>
1390   - <name>bcsj</name>
1391   - <rename>parade_time</rename>
1392   - <update>Y</update>
1393   - </value>
1394   - <value>
1395   - <name>jhlc</name>
1396   - <rename>parade_mileage</rename>
1397   - <update>Y</update>
1398   - </value>
1399   - <value>
1400   - <name>fcsj</name>
1401   - <rename>sendtime_calcu</rename>
1402   - <update>Y</update>
1403   - </value>
1404   - <value>
1405   - <name>xl_dir</name>
1406   - <rename>sxx2</rename>
1407   - <update>Y</update>
1408   - </value>
1409   - <value>
1410   - <name>qdz</name>
1411   - <rename>qdzid</rename>
1412   - <update>Y</update>
1413   - </value>
1414   - <value>
1415   - <name>tcc</name>
1416   - <rename>zdzid</rename>
1417   - <update>Y</update>
1418   - </value>
1419   - <value>
1420   - <name>isfb</name>
1421   - <rename>isfb</rename>
1422   - <update>Y</update>
1423   - </value>
1424   - <value>
1425   - <name>qdz_code</name>
1426   - <rename>qdzcode</rename>
1427   - <update>Y</update>
1428   - </value>
1429   - <value>
1430   - <name>qdz_name</name>
1431   - <rename>qname</rename>
1432   - <update>Y</update>
1433   - </value>
1434   - <value>
1435   - <name>zdz_code</name>
1436   - <rename>zdzcode</rename>
1437   - <update>Y</update>
1438   - </value>
1439   - <value>
1440   - <name>zdz_name</name>
1441   - <rename>tn</rename>
1442   - <update>Y</update>
1443   - </value>
1444   - <value>
1445   - <name>ists</name>
1446   - <rename>ists</rename>
1447   - <update>Y</update>
1448   - </value>
1449   - <value>
1450   - <name>line_version</name>
1451   - <rename>version</rename>
1452   - <update>Y</update>
1453   - </value>
1454   - </lookup>
1455   - <cluster_schema/>
1456   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1457   - <xloc>845</xloc>
1458   - <yloc>899</yloc>
1459   - <draw>Y</draw>
1460   - </GUI>
1461   - </step>
1462   -
1463   - <step>
1464   - <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</name>
1465   - <type>ExcelInput</type>
1466   - <description/>
1467   - <distribute>N</distribute>
1468   - <custom_distribution/>
1469   - <copies>1</copies>
1470   - <partitioning>
1471   - <method>none</method>
1472   - <schema_name/>
1473   - </partitioning>
1474   - <header>Y</header>
1475   - <noempty>Y</noempty>
1476   - <stoponempty>N</stoponempty>
1477   - <filefield/>
1478   - <sheetfield/>
1479   - <sheetrownumfield/>
1480   - <rownumfield/>
1481   - <sheetfield/>
1482   - <filefield/>
1483   - <limit>0</limit>
1484   - <encoding/>
1485   - <add_to_result_filenames>Y</add_to_result_filenames>
1486   - <accept_filenames>N</accept_filenames>
1487   - <accept_field/>
1488   - <accept_stepname/>
1489   - <file>
1490   - <name/>
1491   - <filemask/>
1492   - <exclude_filemask/>
1493   - <file_required>N</file_required>
1494   - <include_subfolders>N</include_subfolders>
1495   - </file>
1496   - <fields>
1497   - </fields>
1498   - <sheets>
1499   - <sheet>
1500   - <name/>
1501   - <startrow>0</startrow>
1502   - <startcol>0</startcol>
1503   - </sheet>
1504   - </sheets>
1505   - <strict_types>N</strict_types>
1506   - <error_ignored>N</error_ignored>
1507   - <error_line_skipped>N</error_line_skipped>
1508   - <bad_line_files_destination_directory/>
1509   - <bad_line_files_extension>warning</bad_line_files_extension>
1510   - <error_line_files_destination_directory/>
1511   - <error_line_files_extension>error</error_line_files_extension>
1512   - <line_number_files_destination_directory/>
1513   - <line_number_files_extension>line</line_number_files_extension>
1514   - <shortFileFieldName/>
1515   - <pathFieldName/>
1516   - <hiddenFieldName/>
1517   - <lastModificationTimeFieldName/>
1518   - <uriNameFieldName/>
1519   - <rootUriNameFieldName/>
1520   - <extensionFieldName/>
1521   - <sizeFieldName/>
1522   - <spreadsheet_type>JXL</spreadsheet_type>
1523   - <cluster_schema/>
1524   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1525   - <xloc>112</xloc>
1526   - <yloc>44</yloc>
1527   - <draw>Y</draw>
1528   - </GUI>
1529   - </step>
1530   -
1531   - <step>
1532   - <name>&#x66f4;&#x65b0;&#x65f6;&#x523b;&#x8868;&#x4e3b;&#x8868;&#x7248;&#x672c;</name>
1533   - <type>Update</type>
1534   - <description/>
1535   - <distribute>Y</distribute>
1536   - <custom_distribution/>
1537   - <copies>1</copies>
1538   - <partitioning>
1539   - <method>none</method>
1540   - <schema_name/>
1541   - </partitioning>
1542   - <connection>bus_control_variable</connection>
1543   - <skip_lookup>N</skip_lookup>
1544   - <commit>100</commit>
1545   - <use_batch>N</use_batch>
1546   - <error_ignored>N</error_ignored>
1547   - <ignore_flag_field/>
1548   - <lookup>
1549   - <schema/>
1550   - <table>bsth_c_s_ttinfo</table>
1551   - <key>
1552   - <name>ttid</name>
1553   - <field>id</field>
1554   - <condition>&#x3d;</condition>
1555   - <name2/>
1556   - </key>
1557   - <value>
1558   - <name>line_version</name>
1559   - <rename>version</rename>
1560   - </value>
1561   - </lookup>
1562   - <cluster_schema/>
1563   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1564   - <xloc>863</xloc>
1565   - <yloc>338</yloc>
1566   - <draw>Y</draw>
1567   - </GUI>
1568   - </step>
1569   -
1570   - <step>
1571   - <name>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;1</name>
1572   - <type>DBLookup</type>
1573   - <description/>
1574   - <distribute>Y</distribute>
1575   - <custom_distribution/>
1576   - <copies>1</copies>
1577   - <partitioning>
1578   - <method>none</method>
1579   - <schema_name/>
1580   - </partitioning>
1581   - <connection>bus_control_variable</connection>
1582   - <cache>N</cache>
1583   - <cache_load_all>N</cache_load_all>
1584   - <cache_size>0</cache_size>
1585   - <lookup>
1586   - <schema/>
1587   - <table>bsth_c_car_park</table>
1588   - <orderby/>
1589   - <fail_on_multiple>N</fail_on_multiple>
1590   - <eat_row_on_failure>N</eat_row_on_failure>
1591   - <key>
1592   - <name>tccname_</name>
1593   - <field>park_name</field>
1594   - <condition>&#x3d;</condition>
1595   - <name2/>
1596   - </key>
1597   - <value>
1598   - <name>id</name>
1599   - <rename>qdzid</rename>
1600   - <default/>
1601   - <type>Integer</type>
1602   - </value>
1603   - <value>
1604   - <name>park_code</name>
1605   - <rename>qdzcode</rename>
1606   - <default/>
1607   - <type>String</type>
1608   - </value>
1609   - <value>
1610   - <name>park_name</name>
1611   - <rename>tn</rename>
1612   - <default/>
1613   - <type>String</type>
1614   - </value>
1615   - </lookup>
1616   - <cluster_schema/>
1617   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1618   - <xloc>755</xloc>
1619   - <yloc>504</yloc>
1620   - <draw>Y</draw>
1621   - </GUI>
1622   - </step>
1623   -
1624   - <step>
1625   - <name>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;2</name>
1626   - <type>DBLookup</type>
1627   - <description/>
1628   - <distribute>Y</distribute>
1629   - <custom_distribution/>
1630   - <copies>1</copies>
1631   - <partitioning>
1632   - <method>none</method>
1633   - <schema_name/>
1634   - </partitioning>
1635   - <connection>bus_control_variable</connection>
1636   - <cache>N</cache>
1637   - <cache_load_all>N</cache_load_all>
1638   - <cache_size>0</cache_size>
1639   - <lookup>
1640   - <schema/>
1641   - <table>bsth_c_car_park</table>
1642   - <orderby/>
1643   - <fail_on_multiple>N</fail_on_multiple>
1644   - <eat_row_on_failure>N</eat_row_on_failure>
1645   - <key>
1646   - <name>tccname_</name>
1647   - <field>park_name</field>
1648   - <condition>&#x3d;</condition>
1649   - <name2/>
1650   - </key>
1651   - <value>
1652   - <name>id</name>
1653   - <rename>zdzid</rename>
1654   - <default/>
1655   - <type>Integer</type>
1656   - </value>
1657   - <value>
1658   - <name>park_code</name>
1659   - <rename>zdzcode</rename>
1660   - <default/>
1661   - <type>String</type>
1662   - </value>
1663   - <value>
1664   - <name>park_name</name>
1665   - <rename>tn</rename>
1666   - <default/>
1667   - <type>String</type>
1668   - </value>
1669   - </lookup>
1670   - <cluster_schema/>
1671   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1672   - <xloc>887</xloc>
1673   - <yloc>608</yloc>
1674   - <draw>Y</draw>
1675   - </GUI>
1676   - </step>
1677   -
1678   - <step>
1679   - <name>&#x67e5;&#x627e;&#x51fa;&#x573a;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</name>
1680   - <type>DBLookup</type>
1681   - <description/>
1682   - <distribute>Y</distribute>
1683   - <custom_distribution/>
1684   - <copies>1</copies>
1685   - <partitioning>
1686   - <method>none</method>
1687   - <schema_name/>
1688   - </partitioning>
1689   - <connection>bus_control_variable</connection>
1690   - <cache>N</cache>
1691   - <cache_load_all>N</cache_load_all>
1692   - <cache_size>0</cache_size>
1693   - <lookup>
1694   - <schema/>
1695   - <table>bsth_c_ls_stationroute</table>
1696   - <orderby/>
1697   - <fail_on_multiple>N</fail_on_multiple>
1698   - <eat_row_on_failure>N</eat_row_on_failure>
1699   - <key>
1700   - <name>xlid</name>
1701   - <field>line</field>
1702   - <condition>&#x3d;</condition>
1703   - <name2/>
1704   - </key>
1705   - <key>
1706   - <name>version</name>
1707   - <field>versions</field>
1708   - <condition>&#x3d;</condition>
1709   - <name2/>
1710   - </key>
1711   - <key>
1712   - <name>zdzname</name>
1713   - <field>station_name</field>
1714   - <condition>LIKE</condition>
1715   - <name2/>
1716   - </key>
1717   - <key>
1718   - <name>endZdtype</name>
1719   - <field>station_mark</field>
1720   - <condition>&#x3d;</condition>
1721   - <name2/>
1722   - </key>
1723   - <key>
1724   - <name>destory</name>
1725   - <field>destroy</field>
1726   - <condition>&#x3d;</condition>
1727   - <name2/>
1728   - </key>
1729   - <value>
1730   - <name>station</name>
1731   - <rename>zdzid</rename>
1732   - <default/>
1733   - <type>Integer</type>
1734   - </value>
1735   - <value>
1736   - <name>directions</name>
1737   - <rename>sxx</rename>
1738   - <default/>
1739   - <type>Integer</type>
1740   - </value>
1741   - <value>
1742   - <name>station_code</name>
1743   - <rename>zdzcode</rename>
1744   - <default/>
1745   - <type>String</type>
1746   - </value>
1747   - <value>
1748   - <name>station_name</name>
1749   - <rename>zdzname_</rename>
1750   - <default/>
1751   - <type>String</type>
1752   - </value>
1753   - </lookup>
1754   - <cluster_schema/>
1755   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1756   - <xloc>329</xloc>
1757   - <yloc>505</yloc>
1758   - <draw>Y</draw>
1759   - </GUI>
1760   - </step>
1761   -
1762   - <step>
1763   - <name>&#x67e5;&#x627e;&#x6240;&#x6709;&#x7ebf;&#x8def;&#x4e0a;&#x4e0b;&#x884c;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
1764   - <type>DBLookup</type>
1765   - <description/>
1766   - <distribute>Y</distribute>
1767   - <custom_distribution/>
1768   - <copies>1</copies>
1769   - <partitioning>
1770   - <method>none</method>
1771   - <schema_name/>
1772   - </partitioning>
1773   - <connection>bus_control_variable</connection>
1774   - <cache>N</cache>
1775   - <cache_load_all>N</cache_load_all>
1776   - <cache_size>0</cache_size>
1777   - <lookup>
1778   - <schema/>
1779   - <table>bsth_c_line_information</table>
1780   - <orderby/>
1781   - <fail_on_multiple>N</fail_on_multiple>
1782   - <eat_row_on_failure>N</eat_row_on_failure>
1783   - <key>
1784   - <name>xlid</name>
1785   - <field>line</field>
1786   - <condition>&#x3d;</condition>
1787   - <name2/>
1788   - </key>
1789   - <value>
1790   - <name>up_mileage</name>
1791   - <rename>up_mileage</rename>
1792   - <default/>
1793   - <type>Number</type>
1794   - </value>
1795   - <value>
1796   - <name>down_mileage</name>
1797   - <rename>down_mileage</rename>
1798   - <default/>
1799   - <type>Number</type>
1800   - </value>
1801   - <value>
1802   - <name>up_travel_time</name>
1803   - <rename>up_travel_time</rename>
1804   - <default/>
1805   - <type>Number</type>
1806   - </value>
1807   - <value>
1808   - <name>down_travel_time</name>
1809   - <rename>down_travel_time</rename>
1810   - <default/>
1811   - <type>Number</type>
1812   - </value>
1813   - <value>
1814   - <name>early_start_time</name>
1815   - <rename>early_start_time</rename>
1816   - <default/>
1817   - <type>String</type>
1818   - </value>
1819   - <value>
1820   - <name>early_end_time</name>
1821   - <rename>early_end_time</rename>
1822   - <default/>
1823   - <type>String</type>
1824   - </value>
1825   - <value>
1826   - <name>early_up_time</name>
1827   - <rename>early_up_time</rename>
1828   - <default/>
1829   - <type>Number</type>
1830   - </value>
1831   - <value>
1832   - <name>early_down_time</name>
1833   - <rename>early_down_time</rename>
1834   - <default/>
1835   - <type>Number</type>
1836   - </value>
1837   - <value>
1838   - <name>late_start_time</name>
1839   - <rename>late_start_time</rename>
1840   - <default/>
1841   - <type>String</type>
1842   - </value>
1843   - <value>
1844   - <name>late_end_time</name>
1845   - <rename>late_end_time</rename>
1846   - <default/>
1847   - <type>String</type>
1848   - </value>
1849   - <value>
1850   - <name>late_up_time</name>
1851   - <rename>late_up_time</rename>
1852   - <default/>
1853   - <type>Number</type>
1854   - </value>
1855   - <value>
1856   - <name>late_down_time</name>
1857   - <rename>late_down_time</rename>
1858   - <default/>
1859   - <type>Number</type>
1860   - </value>
1861   - </lookup>
1862   - <cluster_schema/>
1863   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1864   - <xloc>149</xloc>
1865   - <yloc>581</yloc>
1866   - <draw>Y</draw>
1867   - </GUI>
1868   - </step>
1869   -
1870   - <step>
1871   - <name>&#x67e5;&#x627e;&#x65f6;&#x523b;&#x8868;&#x57fa;&#x7840;&#x4fe1;&#x606f;&#x5173;&#x8054;</name>
1872   - <type>DBLookup</type>
1873   - <description/>
1874   - <distribute>Y</distribute>
1875   - <custom_distribution/>
1876   - <copies>1</copies>
1877   - <partitioning>
1878   - <method>none</method>
1879   - <schema_name/>
1880   - </partitioning>
1881   - <connection>bus_control_variable</connection>
1882   - <cache>N</cache>
1883   - <cache_load_all>N</cache_load_all>
1884   - <cache_size>0</cache_size>
1885   - <lookup>
1886   - <schema/>
1887   - <table>bsth_c_s_ttinfo</table>
1888   - <orderby/>
1889   - <fail_on_multiple>N</fail_on_multiple>
1890   - <eat_row_on_failure>N</eat_row_on_failure>
1891   - <key>
1892   - <name>xlid</name>
1893   - <field>xl</field>
1894   - <condition>&#x3d;</condition>
1895   - <name2/>
1896   - </key>
1897   - <key>
1898   - <name>ttinfoname_</name>
1899   - <field>name</field>
1900   - <condition>&#x3d;</condition>
1901   - <name2/>
1902   - </key>
1903   - <key>
1904   - <name>iscanceled</name>
1905   - <field>is_cancel</field>
1906   - <condition>&#x3d;</condition>
1907   - <name2/>
1908   - </key>
1909   - <value>
1910   - <name>id</name>
1911   - <rename>ttid</rename>
1912   - <default/>
1913   - <type>Integer</type>
1914   - </value>
1915   - </lookup>
1916   - <cluster_schema/>
1917   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1918   - <xloc>1011</xloc>
1919   - <yloc>134</yloc>
1920   - <draw>Y</draw>
1921   - </GUI>
1922   - </step>
1923   -
1924   - <step>
1925   - <name>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x5173;&#x8054;</name>
1926   - <type>DBLookup</type>
1927   - <description/>
1928   - <distribute>Y</distribute>
1929   - <custom_distribution/>
1930   - <copies>1</copies>
1931   - <partitioning>
1932   - <method>none</method>
1933   - <schema_name/>
1934   - </partitioning>
1935   - <connection>bus_control_variable</connection>
1936   - <cache>N</cache>
1937   - <cache_load_all>N</cache_load_all>
1938   - <cache_size>0</cache_size>
1939   - <lookup>
1940   - <schema/>
1941   - <table>bsth_c_line</table>
1942   - <orderby/>
1943   - <fail_on_multiple>N</fail_on_multiple>
1944   - <eat_row_on_failure>N</eat_row_on_failure>
1945   - <key>
1946   - <name>xlname_</name>
1947   - <field>name</field>
1948   - <condition>&#x3d;</condition>
1949   - <name2/>
1950   - </key>
1951   - <key>
1952   - <name>iscanceled</name>
1953   - <field>destroy</field>
1954   - <condition>&#x3d;</condition>
1955   - <name2/>
1956   - </key>
1957   - <value>
1958   - <name>id</name>
1959   - <rename>xlid</rename>
1960   - <default/>
1961   - <type>Integer</type>
1962   - </value>
1963   - </lookup>
1964   - <cluster_schema/>
1965   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1966   - <xloc>1007</xloc>
1967   - <yloc>43</yloc>
1968   - <draw>Y</draw>
1969   - </GUI>
1970   - </step>
1971   -
1972   - <step>
1973   - <name>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
1974   - <type>DBLookup</type>
1975   - <description/>
1976   - <distribute>Y</distribute>
1977   - <custom_distribution/>
1978   - <copies>1</copies>
1979   - <partitioning>
1980   - <method>none</method>
1981   - <schema_name/>
1982   - </partitioning>
1983   - <connection>bus_control_variable</connection>
1984   - <cache>N</cache>
1985   - <cache_load_all>N</cache_load_all>
1986   - <cache_size>0</cache_size>
1987   - <lookup>
1988   - <schema/>
1989   - <table>bsth_c_line_information</table>
1990   - <orderby/>
1991   - <fail_on_multiple>N</fail_on_multiple>
1992   - <eat_row_on_failure>N</eat_row_on_failure>
1993   - <key>
1994   - <name>xlid</name>
1995   - <field>line</field>
1996   - <condition>&#x3d;</condition>
1997   - <name2/>
1998   - </key>
1999   - <value>
2000   - <name>up_out_timer</name>
2001   - <rename>up_out_timer</rename>
2002   - <default/>
2003   - <type>Number</type>
2004   - </value>
2005   - <value>
2006   - <name>up_out_mileage</name>
2007   - <rename>up_out_mileage</rename>
2008   - <default/>
2009   - <type>Number</type>
2010   - </value>
2011   - <value>
2012   - <name>down_out_timer</name>
2013   - <rename>down_out_timer</rename>
2014   - <default/>
2015   - <type>Number</type>
2016   - </value>
2017   - <value>
2018   - <name>down_out_mileage</name>
2019   - <rename>down_out_mileage</rename>
2020   - <default/>
2021   - <type>Number</type>
2022   - </value>
2023   - </lookup>
2024   - <cluster_schema/>
2025   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2026   - <xloc>335</xloc>
2027   - <yloc>763</yloc>
2028   - <draw>Y</draw>
2029   - </GUI>
2030   - </step>
2031   -
2032   - <step>
2033   - <name>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
2034   - <type>DBLookup</type>
2035   - <description/>
2036   - <distribute>Y</distribute>
2037   - <custom_distribution/>
2038   - <copies>1</copies>
2039   - <partitioning>
2040   - <method>none</method>
2041   - <schema_name/>
2042   - </partitioning>
2043   - <connection>bus_control_variable</connection>
2044   - <cache>N</cache>
2045   - <cache_load_all>N</cache_load_all>
2046   - <cache_size>0</cache_size>
2047   - <lookup>
2048   - <schema/>
2049   - <table>bsth_c_line_information</table>
2050   - <orderby/>
2051   - <fail_on_multiple>N</fail_on_multiple>
2052   - <eat_row_on_failure>N</eat_row_on_failure>
2053   - <key>
2054   - <name>xlid</name>
2055   - <field>line</field>
2056   - <condition>&#x3d;</condition>
2057   - <name2/>
2058   - </key>
2059   - <value>
2060   - <name>up_in_mileage</name>
2061   - <rename>up_in_mileage</rename>
2062   - <default/>
2063   - <type>Number</type>
2064   - </value>
2065   - <value>
2066   - <name>up_in_timer</name>
2067   - <rename>up_in_timer</rename>
2068   - <default/>
2069   - <type>Number</type>
2070   - </value>
2071   - <value>
2072   - <name>down_in_mileage</name>
2073   - <rename>down_in_mileage</rename>
2074   - <default/>
2075   - <type>Number</type>
2076   - </value>
2077   - <value>
2078   - <name>down_in_timer</name>
2079   - <rename>down_in_timer</rename>
2080   - <default/>
2081   - <type>Number</type>
2082   - </value>
2083   - </lookup>
2084   - <cluster_schema/>
2085   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2086   - <xloc>553</xloc>
2087   - <yloc>1004</yloc>
2088   - <draw>Y</draw>
2089   - </GUI>
2090   - </step>
2091   -
2092   - <step>
2093   - <name>&#x67e5;&#x627e;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;</name>
2094   - <type>DBLookup</type>
2095   - <description/>
2096   - <distribute>Y</distribute>
2097   - <custom_distribution/>
2098   - <copies>1</copies>
2099   - <partitioning>
2100   - <method>none</method>
2101   - <schema_name/>
2102   - </partitioning>
2103   - <connection>bus_control_variable</connection>
2104   - <cache>N</cache>
2105   - <cache_load_all>N</cache_load_all>
2106   - <cache_size>0</cache_size>
2107   - <lookup>
2108   - <schema/>
2109   - <table>bsth_c_ls_stationroute</table>
2110   - <orderby/>
2111   - <fail_on_multiple>N</fail_on_multiple>
2112   - <eat_row_on_failure>N</eat_row_on_failure>
2113   - <key>
2114   - <name>xlid</name>
2115   - <field>line</field>
2116   - <condition>&#x3d;</condition>
2117   - <name2/>
2118   - </key>
2119   - <key>
2120   - <name>version</name>
2121   - <field>versions</field>
2122   - <condition>&#x3d;</condition>
2123   - <name2/>
2124   - </key>
2125   - <key>
2126   - <name>sxx</name>
2127   - <field>directions</field>
2128   - <condition>&#x3d;</condition>
2129   - <name2/>
2130   - </key>
2131   - <key>
2132   - <name>endZdtype</name>
2133   - <field>station_mark</field>
2134   - <condition>&#x3d;</condition>
2135   - <name2/>
2136   - </key>
2137   - <key>
2138   - <name>destory</name>
2139   - <field>destroy</field>
2140   - <condition>&#x3d;</condition>
2141   - <name2/>
2142   - </key>
2143   - <value>
2144   - <name>station_name</name>
2145   - <rename>zdzname</rename>
2146   - <default/>
2147   - <type>String</type>
2148   - </value>
2149   - <value>
2150   - <name>station</name>
2151   - <rename>zdzid</rename>
2152   - <default/>
2153   - <type>Integer</type>
2154   - </value>
2155   - <value>
2156   - <name>station_code</name>
2157   - <rename>zdzcode</rename>
2158   - <default/>
2159   - <type>String</type>
2160   - </value>
2161   - </lookup>
2162   - <cluster_schema/>
2163   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2164   - <xloc>280</xloc>
2165   - <yloc>404</yloc>
2166   - <draw>Y</draw>
2167   - </GUI>
2168   - </step>
2169   -
2170   - <step>
2171   - <name>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</name>
2172   - <type>DBLookup</type>
2173   - <description/>
2174   - <distribute>Y</distribute>
2175   - <custom_distribution/>
2176   - <copies>1</copies>
2177   - <partitioning>
2178   - <method>none</method>
2179   - <schema_name/>
2180   - </partitioning>
2181   - <connection>bus_control_variable</connection>
2182   - <cache>N</cache>
2183   - <cache_load_all>N</cache_load_all>
2184   - <cache_size>0</cache_size>
2185   - <lookup>
2186   - <schema/>
2187   - <table>bsth_c_ls_stationroute</table>
2188   - <orderby/>
2189   - <fail_on_multiple>N</fail_on_multiple>
2190   - <eat_row_on_failure>N</eat_row_on_failure>
2191   - <key>
2192   - <name>xlid</name>
2193   - <field>line</field>
2194   - <condition>&#x3d;</condition>
2195   - <name2/>
2196   - </key>
2197   - <key>
2198   - <name>version</name>
2199   - <field>versions</field>
2200   - <condition>&#x3d;</condition>
2201   - <name2/>
2202   - </key>
2203   - <key>
2204   - <name>qdzname</name>
2205   - <field>station_name</field>
2206   - <condition>LIKE</condition>
2207   - <name2/>
2208   - </key>
2209   - <key>
2210   - <name>sendZdtype</name>
2211   - <field>station_mark</field>
2212   - <condition>&#x3d;</condition>
2213   - <name2/>
2214   - </key>
2215   - <key>
2216   - <name>destory</name>
2217   - <field>destroy</field>
2218   - <condition>&#x3d;</condition>
2219   - <name2/>
2220   - </key>
2221   - <value>
2222   - <name>station</name>
2223   - <rename>qdzid</rename>
2224   - <default/>
2225   - <type>Integer</type>
2226   - </value>
2227   - <value>
2228   - <name>directions</name>
2229   - <rename>sxx</rename>
2230   - <default/>
2231   - <type>Integer</type>
2232   - </value>
2233   - <value>
2234   - <name>station_code</name>
2235   - <rename>qdzcode</rename>
2236   - <default/>
2237   - <type>String</type>
2238   - </value>
2239   - <value>
2240   - <name>station_name</name>
2241   - <rename>qdzname_</rename>
2242   - <default/>
2243   - <type>String</type>
2244   - </value>
2245   - </lookup>
2246   - <cluster_schema/>
2247   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2248   - <xloc>430</xloc>
2249   - <yloc>403</yloc>
2250   - <draw>Y</draw>
2251   - </GUI>
2252   - </step>
2253   -
2254   - <step>
2255   - <name>&#x67e5;&#x627e;&#x8def;&#x724c;&#x5173;&#x8054;</name>
2256   - <type>DBLookup</type>
2257   - <description/>
2258   - <distribute>Y</distribute>
2259   - <custom_distribution/>
2260   - <copies>1</copies>
2261   - <partitioning>
2262   - <method>none</method>
2263   - <schema_name/>
2264   - </partitioning>
2265   - <connection>bus_control_variable</connection>
2266   - <cache>N</cache>
2267   - <cache_load_all>N</cache_load_all>
2268   - <cache_size>0</cache_size>
2269   - <lookup>
2270   - <schema/>
2271   - <table>bsth_c_s_gbi</table>
2272   - <orderby/>
2273   - <fail_on_multiple>N</fail_on_multiple>
2274   - <eat_row_on_failure>N</eat_row_on_failure>
2275   - <key>
2276   - <name>xlid</name>
2277   - <field>xl</field>
2278   - <condition>&#x3d;</condition>
2279   - <name2/>
2280   - </key>
2281   - <key>
2282   - <name>lp</name>
2283   - <field>lp_name</field>
2284   - <condition>&#x3d;</condition>
2285   - <name2/>
2286   - </key>
2287   - <key>
2288   - <name>iscanceled</name>
2289   - <field>is_cancel</field>
2290   - <condition>&#x3d;</condition>
2291   - <name2/>
2292   - </key>
2293   - <value>
2294   - <name>id</name>
2295   - <rename>lpid</rename>
2296   - <default/>
2297   - <type>Integer</type>
2298   - </value>
2299   - </lookup>
2300   - <cluster_schema/>
2301   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2302   - <xloc>1013</xloc>
2303   - <yloc>221</yloc>
2304   - <draw>Y</draw>
2305   - </GUI>
2306   - </step>
2307   -
2308   - <step>
2309   - <name>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ebf;&#x8def;&#x65b9;&#x5411;</name>
2310   - <type>DBLookup</type>
2311   - <description/>
2312   - <distribute>Y</distribute>
2313   - <custom_distribution/>
2314   - <copies>1</copies>
2315   - <partitioning>
2316   - <method>none</method>
2317   - <schema_name/>
2318   - </partitioning>
2319   - <connection>bus_control_variable</connection>
2320   - <cache>N</cache>
2321   - <cache_load_all>N</cache_load_all>
2322   - <cache_size>0</cache_size>
2323   - <lookup>
2324   - <schema/>
2325   - <table>bsth_c_ls_stationroute</table>
2326   - <orderby/>
2327   - <fail_on_multiple>N</fail_on_multiple>
2328   - <eat_row_on_failure>N</eat_row_on_failure>
2329   - <key>
2330   - <name>xlid</name>
2331   - <field>line</field>
2332   - <condition>&#x3d;</condition>
2333   - <name2/>
2334   - </key>
2335   - <key>
2336   - <name>version</name>
2337   - <field>versions</field>
2338   - <condition>&#x3d;</condition>
2339   - <name2/>
2340   - </key>
2341   - <key>
2342   - <name>startZdtype_calcu</name>
2343   - <field>station_mark</field>
2344   - <condition>&#x3d;</condition>
2345   - <name2/>
2346   - </key>
2347   - <key>
2348   - <name>qdzname_calcu</name>
2349   - <field>station_name</field>
2350   - <condition>LIKE</condition>
2351   - <name2/>
2352   - </key>
2353   - <key>
2354   - <name>destory</name>
2355   - <field>destroy</field>
2356   - <condition>&#x3d;</condition>
2357   - <name2/>
2358   - </key>
2359   - <value>
2360   - <name>directions</name>
2361   - <rename>sxx</rename>
2362   - <default/>
2363   - <type>String</type>
2364   - </value>
2365   - </lookup>
2366   - <cluster_schema/>
2367   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2368   - <xloc>548</xloc>
2369   - <yloc>610</yloc>
2370   - <draw>Y</draw>
2371   - </GUI>
2372   - </step>
2373   -
2374   - <step>
2375   - <name>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</name>
2376   - <type>DBLookup</type>
2377   - <description/>
2378   - <distribute>Y</distribute>
2379   - <custom_distribution/>
2380   - <copies>1</copies>
2381   - <partitioning>
2382   - <method>none</method>
2383   - <schema_name/>
2384   - </partitioning>
2385   - <connection>bus_control_variable</connection>
2386   - <cache>N</cache>
2387   - <cache_load_all>Y</cache_load_all>
2388   - <cache_size>0</cache_size>
2389   - <lookup>
2390   - <schema/>
2391   - <table>bsth_c_ls_stationroute</table>
2392   - <orderby/>
2393   - <fail_on_multiple>N</fail_on_multiple>
2394   - <eat_row_on_failure>N</eat_row_on_failure>
2395   - <key>
2396   - <name>xlid</name>
2397   - <field>line</field>
2398   - <condition>&#x3d;</condition>
2399   - <name2/>
2400   - </key>
2401   - <key>
2402   - <name>version</name>
2403   - <field>versions</field>
2404   - <condition>&#x3d;</condition>
2405   - <name2/>
2406   - </key>
2407   - <key>
2408   - <name>endZdtype_calcu</name>
2409   - <field>station_mark</field>
2410   - <condition>&#x3d;</condition>
2411   - <name2/>
2412   - </key>
2413   - <key>
2414   - <name>sxx</name>
2415   - <field>directions</field>
2416   - <condition>&#x3d;</condition>
2417   - <name2/>
2418   - </key>
2419   - <key>
2420   - <name>destory</name>
2421   - <field>destroy</field>
2422   - <condition>&#x3d;</condition>
2423   - <name2/>
2424   - </key>
2425   - <value>
2426   - <name>station_name</name>
2427   - <rename>zdzname_calcu</rename>
2428   - <default/>
2429   - <type>Integer</type>
2430   - </value>
2431   - </lookup>
2432   - <cluster_schema/>
2433   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2434   - <xloc>550</xloc>
2435   - <yloc>701</yloc>
2436   - <draw>Y</draw>
2437   - </GUI>
2438   - </step>
2439   -
2440   - <step>
2441   - <name>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</name>
2442   - <type>DBLookup</type>
2443   - <description/>
2444   - <distribute>Y</distribute>
2445   - <custom_distribution/>
2446   - <copies>1</copies>
2447   - <partitioning>
2448   - <method>none</method>
2449   - <schema_name/>
2450   - </partitioning>
2451   - <connection>bus_control_variable</connection>
2452   - <cache>N</cache>
2453   - <cache_load_all>N</cache_load_all>
2454   - <cache_size>0</cache_size>
2455   - <lookup>
2456   - <schema/>
2457   - <table>bsth_c_ls_stationroute</table>
2458   - <orderby/>
2459   - <fail_on_multiple>N</fail_on_multiple>
2460   - <eat_row_on_failure>N</eat_row_on_failure>
2461   - <key>
2462   - <name>xlid</name>
2463   - <field>line</field>
2464   - <condition>&#x3d;</condition>
2465   - <name2/>
2466   - </key>
2467   - <key>
2468   - <name>version</name>
2469   - <field>versions</field>
2470   - <condition>&#x3d;</condition>
2471   - <name2/>
2472   - </key>
2473   - <key>
2474   - <name>zdzname_calcu</name>
2475   - <field>station_name</field>
2476   - <condition>&#x3d;</condition>
2477   - <name2/>
2478   - </key>
2479   - <key>
2480   - <name>startZdtype_calcu</name>
2481   - <field>station_mark</field>
2482   - <condition>&#x3d;</condition>
2483   - <name2/>
2484   - </key>
2485   - <key>
2486   - <name>destory</name>
2487   - <field>destroy</field>
2488   - <condition>&#x3d;</condition>
2489   - <name2/>
2490   - </key>
2491   - <value>
2492   - <name>directions</name>
2493   - <rename>sxx2</rename>
2494   - <default/>
2495   - <type>Integer</type>
2496   - </value>
2497   - <value>
2498   - <name>station</name>
2499   - <rename>qdzid</rename>
2500   - <default/>
2501   - <type>Integer</type>
2502   - </value>
2503   - <value>
2504   - <name>station_code</name>
2505   - <rename>qdzcode</rename>
2506   - <default/>
2507   - <type>String</type>
2508   - </value>
2509   - <value>
2510   - <name>station_name</name>
2511   - <rename>qname</rename>
2512   - <default/>
2513   - <type>String</type>
2514   - </value>
2515   - </lookup>
2516   - <cluster_schema/>
2517   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2518   - <xloc>551</xloc>
2519   - <yloc>782</yloc>
2520   - <draw>Y</draw>
2521   - </GUI>
2522   - </step>
2523   -
2524   - <step>
2525   - <name>&#x6b63;&#x5e38;&#x73ed;&#x6b21;_&#x5904;&#x7406;&#x6570;&#x636e;</name>
2526   - <type>ScriptValueMod</type>
2527   - <description/>
2528   - <distribute>Y</distribute>
2529   - <custom_distribution/>
2530   - <copies>1</copies>
2531   - <partitioning>
2532   - <method>none</method>
2533   - <schema_name/>
2534   - </partitioning>
2535   - <compatible>N</compatible>
2536   - <optimizationLevel>9</optimizationLevel>
2537   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
2538   - <jsScript_name>Script 1</jsScript_name>
2539   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var sendZdtype &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
2540   - </jsScript> </jsScripts> <fields> <field> <name>sendZdtype</name>
2541   - <rename>sendZdtype</rename>
2542   - <type>String</type>
2543   - <length>-1</length>
2544   - <precision>-1</precision>
2545   - <replace>N</replace>
2546   - </field> <field> <name>endZdtype</name>
2547   - <rename>endZdtype</rename>
2548   - <type>String</type>
2549   - <length>-1</length>
2550   - <precision>-1</precision>
2551   - <replace>N</replace>
2552   - </field> <field> <name>destory</name>
2553   - <rename>destory</rename>
2554   - <type>Integer</type>
2555   - <length>-1</length>
2556   - <precision>-1</precision>
2557   - <replace>N</replace>
2558   - </field> </fields> <cluster_schema/>
2559   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2560   - <xloc>588</xloc>
2561   - <yloc>403</yloc>
2562   - <draw>Y</draw>
2563   - </GUI>
2564   - </step>
2565   -
2566   - <step>
2567   - <name>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</name>
2568   - <type>Dummy</type>
2569   - <description/>
2570   - <distribute>Y</distribute>
2571   - <custom_distribution/>
2572   - <copies>1</copies>
2573   - <partitioning>
2574   - <method>none</method>
2575   - <schema_name/>
2576   - </partitioning>
2577   - <cluster_schema/>
2578   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2579   - <xloc>725</xloc>
2580   - <yloc>404</yloc>
2581   - <draw>Y</draw>
2582   - </GUI>
2583   - </step>
2584   -
2585   - <step>
2586   - <name>&#x6dfb;&#x52a0;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;</name>
2587   - <type>GroupBy</type>
2588   - <description/>
2589   - <distribute>Y</distribute>
2590   - <custom_distribution/>
2591   - <copies>1</copies>
2592   - <partitioning>
2593   - <method>none</method>
2594   - <schema_name/>
2595   - </partitioning>
2596   - <all_rows>Y</all_rows>
2597   - <ignore_aggregate>N</ignore_aggregate>
2598   - <field_ignore/>
2599   - <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
2600   - <prefix>grp</prefix>
2601   - <add_linenr>Y</add_linenr>
2602   - <linenr_fieldname>fcno</linenr_fieldname>
2603   - <give_back_row>N</give_back_row>
2604   - <group>
2605   - <field>
2606   - <name>lp</name>
2607   - </field>
2608   - </group>
2609   - <fields>
2610   - </fields>
2611   - <cluster_schema/>
2612   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2613   - <xloc>442</xloc>
2614   - <yloc>44</yloc>
2615   - <draw>Y</draw>
2616   - </GUI>
2617   - </step>
2618   -
2619   - <step>
2620   - <name>&#x6dfb;&#x52a0;&#x5bf9;&#x5e94;&#x73ed;&#x6b21;&#x6570;</name>
2621   - <type>GroupBy</type>
2622   - <description/>
2623   - <distribute>Y</distribute>
2624   - <custom_distribution/>
2625   - <copies>1</copies>
2626   - <partitioning>
2627   - <method>none</method>
2628   - <schema_name/>
2629   - </partitioning>
2630   - <all_rows>Y</all_rows>
2631   - <ignore_aggregate>N</ignore_aggregate>
2632   - <field_ignore/>
2633   - <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
2634   - <prefix>grp</prefix>
2635   - <add_linenr>Y</add_linenr>
2636   - <linenr_fieldname>bcs</linenr_fieldname>
2637   - <give_back_row>N</give_back_row>
2638   - <group>
2639   - </group>
2640   - <fields>
2641   - </fields>
2642   - <cluster_schema/>
2643   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2644   - <xloc>553</xloc>
2645   - <yloc>44</yloc>
2646   - <draw>Y</draw>
2647   - </GUI>
2648   - </step>
2649   -
2650   - <step>
2651   - <name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</name>
2652   - <type>Normaliser</type>
2653   - <description/>
2654   - <distribute>Y</distribute>
2655   - <custom_distribution/>
2656   - <copies>1</copies>
2657   - <partitioning>
2658   - <method>none</method>
2659   - <schema_name/>
2660   - </partitioning>
2661   - <typefield>&#x7ad9;&#x70b9;&#x540d;&#x79f0;</typefield>
2662   - <fields> </fields> <cluster_schema/>
2663   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2664   - <xloc>248</xloc>
2665   - <yloc>44</yloc>
2666   - <draw>Y</draw>
2667   - </GUI>
2668   - </step>
2669   -
2670   - <step>
2671   - <name>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178;</name>
2672   - <type>ValueMapper</type>
2673   - <description/>
2674   - <distribute>Y</distribute>
2675   - <custom_distribution/>
2676   - <copies>1</copies>
2677   - <partitioning>
2678   - <method>none</method>
2679   - <schema_name/>
2680   - </partitioning>
2681   - <field_to_use>bctype</field_to_use>
2682   - <target_field>bctype_code</target_field>
2683   - <non_match_default>&#x672a;&#x77e5;&#x7c7b;&#x578b;</non_match_default>
2684   - <fields>
2685   - <field>
2686   - <source_value>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</source_value>
2687   - <target_value>normal</target_value>
2688   - </field>
2689   - <field>
2690   - <source_value>&#x51fa;&#x573a;</source_value>
2691   - <target_value>out</target_value>
2692   - </field>
2693   - <field>
2694   - <source_value>&#x8fdb;&#x573a;</source_value>
2695   - <target_value>in</target_value>
2696   - </field>
2697   - <field>
2698   - <source_value>&#x52a0;&#x6cb9;</source_value>
2699   - <target_value>oil</target_value>
2700   - </field>
2701   - <field>
2702   - <source_value>&#x4e34;&#x52a0;</source_value>
2703   - <target_value>temp</target_value>
2704   - </field>
2705   - <field>
2706   - <source_value>&#x533a;&#x95f4;</source_value>
2707   - <target_value>region</target_value>
2708   - </field>
2709   - <field>
2710   - <source_value>&#x653e;&#x7a7a;</source_value>
2711   - <target_value>venting</target_value>
2712   - </field>
2713   - <field>
2714   - <source_value>&#x653e;&#x5927;&#x7ad9;</source_value>
2715   - <target_value>major</target_value>
2716   - </field>
2717   - </fields>
2718   - <cluster_schema/>
2719   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2720   - <xloc>149</xloc>
2721   - <yloc>491</yloc>
2722   - <draw>Y</draw>
2723   - </GUI>
2724   - </step>
2725   -
2726   - <step>
2727   - <name>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 2</name>
2728   - <type>ValueMapper</type>
2729   - <description/>
2730   - <distribute>Y</distribute>
2731   - <custom_distribution/>
2732   - <copies>1</copies>
2733   - <partitioning>
2734   - <method>none</method>
2735   - <schema_name/>
2736   - </partitioning>
2737   - <field_to_use>bctype</field_to_use>
2738   - <target_field>bctype_code</target_field>
2739   - <non_match_default>&#x672a;&#x77e5;&#x7c7b;&#x578b;</non_match_default>
2740   - <fields>
2741   - <field>
2742   - <source_value>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</source_value>
2743   - <target_value>normal</target_value>
2744   - </field>
2745   - <field>
2746   - <source_value>&#x51fa;&#x573a;</source_value>
2747   - <target_value>out</target_value>
2748   - </field>
2749   - <field>
2750   - <source_value>&#x8fdb;&#x573a;</source_value>
2751   - <target_value>in</target_value>
2752   - </field>
2753   - <field>
2754   - <source_value>&#x52a0;&#x6cb9;</source_value>
2755   - <target_value>oil</target_value>
2756   - </field>
2757   - <field>
2758   - <source_value>&#x4e34;&#x52a0;</source_value>
2759   - <target_value>temp</target_value>
2760   - </field>
2761   - <field>
2762   - <source_value>&#x533a;&#x95f4;</source_value>
2763   - <target_value>region</target_value>
2764   - </field>
2765   - <field>
2766   - <source_value>&#x653e;&#x7a7a;</source_value>
2767   - <target_value>venting</target_value>
2768   - </field>
2769   - <field>
2770   - <source_value>&#x653e;&#x5927;&#x7ad9;</source_value>
2771   - <target_value>major</target_value>
2772   - </field>
2773   - </fields>
2774   - <cluster_schema/>
2775   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2776   - <xloc>333</xloc>
2777   - <yloc>681</yloc>
2778   - <draw>Y</draw>
2779   - </GUI>
2780   - </step>
2781   -
2782   - <step>
2783   - <name>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 3</name>
2784   - <type>ValueMapper</type>
2785   - <description/>
2786   - <distribute>Y</distribute>
2787   - <custom_distribution/>
2788   - <copies>1</copies>
2789   - <partitioning>
2790   - <method>none</method>
2791   - <schema_name/>
2792   - </partitioning>
2793   - <field_to_use>bctype</field_to_use>
2794   - <target_field>bctype_code</target_field>
2795   - <non_match_default>&#x672a;&#x77e5;&#x7c7b;&#x578b;</non_match_default>
2796   - <fields>
2797   - <field>
2798   - <source_value>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</source_value>
2799   - <target_value>normal</target_value>
2800   - </field>
2801   - <field>
2802   - <source_value>&#x51fa;&#x573a;</source_value>
2803   - <target_value>out</target_value>
2804   - </field>
2805   - <field>
2806   - <source_value>&#x8fdb;&#x573a;</source_value>
2807   - <target_value>in</target_value>
2808   - </field>
2809   - <field>
2810   - <source_value>&#x52a0;&#x6cb9;</source_value>
2811   - <target_value>oil</target_value>
2812   - </field>
2813   - <field>
2814   - <source_value>&#x4e34;&#x52a0;</source_value>
2815   - <target_value>temp</target_value>
2816   - </field>
2817   - <field>
2818   - <source_value>&#x533a;&#x95f4;</source_value>
2819   - <target_value>region</target_value>
2820   - </field>
2821   - <field>
2822   - <source_value>&#x653e;&#x7a7a;</source_value>
2823   - <target_value>venting</target_value>
2824   - </field>
2825   - <field>
2826   - <source_value>&#x653e;&#x5927;&#x7ad9;</source_value>
2827   - <target_value>major</target_value>
2828   - </field>
2829   - </fields>
2830   - <cluster_schema/>
2831   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2832   - <xloc>551</xloc>
2833   - <yloc>928</yloc>
2834   - <draw>Y</draw>
2835   - </GUI>
2836   - </step>
2837   -
2838   - <step>
2839   - <name>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</name>
2840   - <type>SelectValues</type>
2841   - <description/>
2842   - <distribute>N</distribute>
2843   - <custom_distribution/>
2844   - <copies>1</copies>
2845   - <partitioning>
2846   - <method>none</method>
2847   - <schema_name/>
2848   - </partitioning>
2849   - <fields> <select_unspecified>Y</select_unspecified>
2850   - <meta> <name>zdlyversion_</name>
2851   - <rename>version</rename>
2852   - <type>Integer</type>
2853   - <length>-2</length>
2854   - <precision>-2</precision>
2855   - <conversion_mask/>
2856   - <date_format_lenient>false</date_format_lenient>
2857   - <date_format_locale/>
2858   - <date_format_timezone/>
2859   - <lenient_string_to_number>false</lenient_string_to_number>
2860   - <encoding/>
2861   - <decimal_symbol/>
2862   - <grouping_symbol/>
2863   - <currency_symbol/>
2864   - <storage_type/>
2865   - </meta> </fields> <cluster_schema/>
2866   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2867   - <xloc>1016</xloc>
2868   - <yloc>305</yloc>
2869   - <draw>Y</draw>
2870   - </GUI>
2871   - </step>
2872   -
2873   - <step>
2874   - <name>&#x7c7b;&#x578b;&#x4fee;&#x6b63;</name>
2875   - <type>SelectValues</type>
2876   - <description/>
2877   - <distribute>Y</distribute>
2878   - <custom_distribution/>
2879   - <copies>1</copies>
2880   - <partitioning>
2881   - <method>none</method>
2882   - <schema_name/>
2883   - </partitioning>
2884   - <fields> <select_unspecified>N</select_unspecified>
2885   - <meta> <name>jhlc</name>
2886   - <rename>jhlc</rename>
2887   - <type>Number</type>
2888   - <length>-2</length>
2889   - <precision>-2</precision>
2890   - <conversion_mask/>
2891   - <date_format_lenient>false</date_format_lenient>
2892   - <date_format_locale/>
2893   - <date_format_timezone/>
2894   - <lenient_string_to_number>false</lenient_string_to_number>
2895   - <encoding/>
2896   - <decimal_symbol/>
2897   - <grouping_symbol/>
2898   - <currency_symbol/>
2899   - <storage_type/>
2900   - </meta> <meta> <name>bcsj</name>
2901   - <rename>bcsj</rename>
2902   - <type>Integer</type>
2903   - <length>-2</length>
2904   - <precision>-2</precision>
2905   - <conversion_mask/>
2906   - <date_format_lenient>false</date_format_lenient>
2907   - <date_format_locale/>
2908   - <date_format_timezone/>
2909   - <lenient_string_to_number>false</lenient_string_to_number>
2910   - <encoding/>
2911   - <decimal_symbol/>
2912   - <grouping_symbol/>
2913   - <currency_symbol/>
2914   - <storage_type/>
2915   - </meta> </fields> <cluster_schema/>
2916   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2917   - <xloc>146</xloc>
2918   - <yloc>768</yloc>
2919   - <draw>Y</draw>
2920   - </GUI>
2921   - </step>
2922   -
2923   - <step>
2924   - <name>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</name>
2925   - <type>SelectValues</type>
2926   - <description/>
2927   - <distribute>Y</distribute>
2928   - <custom_distribution/>
2929   - <copies>1</copies>
2930   - <partitioning>
2931   - <method>none</method>
2932   - <schema_name/>
2933   - </partitioning>
2934   - <fields> <select_unspecified>N</select_unspecified>
2935   - <meta> <name>out_mileage</name>
2936   - <rename>out_mileage</rename>
2937   - <type>Number</type>
2938   - <length>-2</length>
2939   - <precision>-2</precision>
2940   - <conversion_mask/>
2941   - <date_format_lenient>false</date_format_lenient>
2942   - <date_format_locale/>
2943   - <date_format_timezone/>
2944   - <lenient_string_to_number>false</lenient_string_to_number>
2945   - <encoding/>
2946   - <decimal_symbol/>
2947   - <grouping_symbol/>
2948   - <currency_symbol/>
2949   - <storage_type/>
2950   - </meta> <meta> <name>out_time</name>
2951   - <rename>out_time</rename>
2952   - <type>Integer</type>
2953   - <length>-2</length>
2954   - <precision>-2</precision>
2955   - <conversion_mask/>
2956   - <date_format_lenient>false</date_format_lenient>
2957   - <date_format_locale/>
2958   - <date_format_timezone/>
2959   - <lenient_string_to_number>false</lenient_string_to_number>
2960   - <encoding/>
2961   - <decimal_symbol/>
2962   - <grouping_symbol/>
2963   - <currency_symbol/>
2964   - <storage_type/>
2965   - </meta> <meta> <name>sxx</name>
2966   - <rename>sxx</rename>
2967   - <type>Integer</type>
2968   - <length>-2</length>
2969   - <precision>-2</precision>
2970   - <conversion_mask/>
2971   - <date_format_lenient>false</date_format_lenient>
2972   - <date_format_locale/>
2973   - <date_format_timezone/>
2974   - <lenient_string_to_number>false</lenient_string_to_number>
2975   - <encoding/>
2976   - <decimal_symbol/>
2977   - <grouping_symbol/>
2978   - <currency_symbol/>
2979   - <storage_type/>
2980   - </meta> </fields> <cluster_schema/>
2981   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2982   - <xloc>338</xloc>
2983   - <yloc>1008</yloc>
2984   - <draw>Y</draw>
2985   - </GUI>
2986   - </step>
2987   -
2988   - <step>
2989   - <name>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</name>
2990   - <type>SelectValues</type>
2991   - <description/>
2992   - <distribute>Y</distribute>
2993   - <custom_distribution/>
2994   - <copies>1</copies>
2995   - <partitioning>
2996   - <method>none</method>
2997   - <schema_name/>
2998   - </partitioning>
2999   - <fields> <select_unspecified>N</select_unspecified>
3000   - <meta> <name>parade_mileage</name>
3001   - <rename>parade_mileage</rename>
3002   - <type>Number</type>
3003   - <length>-2</length>
3004   - <precision>-2</precision>
3005   - <conversion_mask/>
3006   - <date_format_lenient>false</date_format_lenient>
3007   - <date_format_locale/>
3008   - <date_format_timezone/>
3009   - <lenient_string_to_number>false</lenient_string_to_number>
3010   - <encoding/>
3011   - <decimal_symbol/>
3012   - <grouping_symbol/>
3013   - <currency_symbol/>
3014   - <storage_type/>
3015   - </meta> <meta> <name>parade_time</name>
3016   - <rename>parade_time</rename>
3017   - <type>Integer</type>
3018   - <length>-2</length>
3019   - <precision>-2</precision>
3020   - <conversion_mask/>
3021   - <date_format_lenient>false</date_format_lenient>
3022   - <date_format_locale/>
3023   - <date_format_timezone/>
3024   - <lenient_string_to_number>false</lenient_string_to_number>
3025   - <encoding/>
3026   - <decimal_symbol/>
3027   - <grouping_symbol/>
3028   - <currency_symbol/>
3029   - <storage_type/>
3030   - </meta> <meta> <name>sxx2</name>
3031   - <rename>sxx2</rename>
3032   - <type>Integer</type>
3033   - <length>-2</length>
3034   - <precision>-2</precision>
3035   - <conversion_mask/>
3036   - <date_format_lenient>false</date_format_lenient>
3037   - <date_format_locale/>
3038   - <date_format_timezone/>
3039   - <lenient_string_to_number>false</lenient_string_to_number>
3040   - <encoding/>
3041   - <decimal_symbol/>
3042   - <grouping_symbol/>
3043   - <currency_symbol/>
3044   - <storage_type/>
3045   - </meta> </fields> <cluster_schema/>
3046   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
3047   - <xloc>847</xloc>
3048   - <yloc>1003</yloc>
3049   - <draw>Y</draw>
3050   - </GUI>
3051   - </step>
3052   -
3053   - <step>
3054   - <name>&#x8ba1;&#x7b97;&#x73ed;&#x6b21;&#x7c7b;&#x578b;</name>
3055   - <type>ValueMapper</type>
3056   - <description/>
3057   - <distribute>Y</distribute>
3058   - <custom_distribution/>
3059   - <copies>1</copies>
3060   - <partitioning>
3061   - <method>none</method>
3062   - <schema_name/>
3063   - </partitioning>
3064   - <field_to_use>qdzname</field_to_use>
3065   - <target_field>bctype</target_field>
3066   - <non_match_default>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</non_match_default>
3067   - <fields>
3068   - <field>
3069   - <source_value>&#x51fa;&#x573a;</source_value>
3070   - <target_value>&#x51fa;&#x573a;</target_value>
3071   - </field>
3072   - <field>
3073   - <source_value>&#x8fdb;&#x573a;</source_value>
3074   - <target_value>&#x8fdb;&#x573a;</target_value>
3075   - </field>
3076   - </fields>
3077   - <cluster_schema/>
3078   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
3079   - <xloc>1014</xloc>
3080   - <yloc>401</yloc>
3081   - <draw>Y</draw>
3082   - </GUI>
3083   - </step>
3084   -
3085   - <step>
3086   - <name>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</name>
3087   - <type>JoinRows</type>
3088   - <description/>
3089   - <distribute>Y</distribute>
3090   - <custom_distribution/>
3091   - <copies>1</copies>
3092   - <partitioning>
3093   - <method>none</method>
3094   - <schema_name/>
3095   - </partitioning>
3096   - <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
3097   - <prefix>out</prefix>
3098   - <cache_size>500</cache_size>
3099   - <main/>
3100   - <compare>
3101   -<condition>
3102   - <negated>N</negated>
3103   - <leftvalue/>
3104   - <function>&#x3d;</function>
3105   - <rightvalue/>
3106   - </condition>
3107   - </compare>
3108   - <cluster_schema/>
3109   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
3110   - <xloc>310</xloc>
3111   - <yloc>133</yloc>
3112   - <draw>Y</draw>
3113   - </GUI>
3114   - </step>
3115   -
3116   - <step>
3117   - <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;&#xff08;&#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x4e3a;&#x7a7a;&#xff09;</name>
3118   - <type>FilterRows</type>
3119   - <description/>
3120   - <distribute>Y</distribute>
3121   - <custom_distribution/>
3122   - <copies>1</copies>
3123   - <partitioning>
3124   - <method>none</method>
3125   - <schema_name/>
3126   - </partitioning>
3127   -<send_true_to/>
3128   -<send_false_to/>
3129   - <compare>
3130   -<condition>
3131   - <negated>N</negated>
3132   - <leftvalue>sendtime_calcu</leftvalue>
3133   - <function>IS NOT NULL</function>
3134   - <rightvalue/>
3135   - </condition>
3136   - </compare>
3137   - <cluster_schema/>
3138   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
3139   - <xloc>768</xloc>
3140   - <yloc>44</yloc>
3141   - <draw>Y</draw>
3142   - </GUI>
3143   - </step>
3144   -
3145   - <step>
3146   - <name>&#x8fdb;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x8d77;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</name>
3147   - <type>ScriptValueMod</type>
3148   - <description/>
3149   - <distribute>Y</distribute>
3150   - <custom_distribution/>
3151   - <copies>1</copies>
3152   - <partitioning>
3153   - <method>none</method>
3154   - <schema_name/>
3155   - </partitioning>
3156   - <compatible>N</compatible>
3157   - <optimizationLevel>9</optimizationLevel>
3158   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
3159   - <jsScript_name>Script 1</jsScript_name>
3160   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var qdzname_calcu &#x3d; cc_groups&#x5b;gno - 2&#x5d;&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#x662f;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x8fd9;&#x91cc;&#x53ea;&#x6709;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#xff0c;&#x8fd8;&#x9700;&#x8981;&#x8ba1;&#x7b97;&#xa;var startZdtype_calcu &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype_calcu &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
3161   - </jsScript> </jsScripts> <fields> <field> <name>qdzname_calcu</name>
3162   - <rename>qdzname_calcu</rename>
3163   - <type>String</type>
3164   - <length>-1</length>
3165   - <precision>-1</precision>
3166   - <replace>N</replace>
3167   - </field> <field> <name>startZdtype_calcu</name>
3168   - <rename>startZdtype_calcu</rename>
3169   - <type>String</type>
3170   - <length>-1</length>
3171   - <precision>-1</precision>
3172   - <replace>N</replace>
3173   - </field> <field> <name>endZdtype_calcu</name>
3174   - <rename>endZdtype_calcu</rename>
3175   - <type>String</type>
3176   - <length>-1</length>
3177   - <precision>-1</precision>
3178   - <replace>N</replace>
3179   - </field> <field> <name>destory</name>
3180   - <rename>destory</rename>
3181   - <type>Integer</type>
3182   - <length>-1</length>
3183   - <precision>-1</precision>
3184   - <replace>N</replace>
3185   - </field> </fields> <cluster_schema/>
3186   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
3187   - <xloc>754</xloc>
3188   - <yloc>610</yloc>
3189   - <draw>Y</draw>
3190   - </GUI>
3191   - </step>
3192   -
3193   - <step>
3194   - <name>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</name>
3195   - <type>Dummy</type>
3196   - <description/>
3197   - <distribute>Y</distribute>
3198   - <custom_distribution/>
3199   - <copies>1</copies>
3200   - <partitioning>
3201   - <method>none</method>
3202   - <schema_name/>
3203   - </partitioning>
3204   - <cluster_schema/>
3205   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
3206   - <xloc>997</xloc>
3207   - <yloc>606</yloc>
3208   - <draw>Y</draw>
3209   - </GUI>
3210   - </step>
3211   -
3212   - <step_error_handling>
3213   - <error>
3214   - <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</source_step>
3215   - <target_step>Excel&#x8f93;&#x51fa;</target_step>
3216   - <is_enabled>Y</is_enabled>
3217   - <nr_valuename>c1</nr_valuename>
3218   - <descriptions_valuename>c2</descriptions_valuename>
3219   - <fields_valuename>c3</fields_valuename>
3220   - <codes_valuename>c4</codes_valuename>
3221   - <max_errors/>
3222   - <max_pct_errors/>
3223   - <min_pct_rows/>
3224   - </error>
3225   - <error>
3226   - <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</source_step>
3227   - <target_step>Excel&#x8f93;&#x51fa; 2</target_step>
3228   - <is_enabled>Y</is_enabled>
3229   - <nr_valuename/>
3230   - <descriptions_valuename/>
3231   - <fields_valuename/>
3232   - <codes_valuename/>
3233   - <max_errors/>
3234   - <max_pct_errors/>
3235   - <min_pct_rows/>
3236   - </error>
3237   - <error>
3238   - <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</source_step>
3239   - <target_step>Excel&#x8f93;&#x51fa; 3</target_step>
3240   - <is_enabled>Y</is_enabled>
3241   - <nr_valuename/>
3242   - <descriptions_valuename/>
3243   - <fields_valuename/>
3244   - <codes_valuename/>
3245   - <max_errors/>
3246   - <max_pct_errors/>
3247   - <min_pct_rows/>
3248   - </error>
3249   - </step_error_handling>
3250   - <slave-step-copy-partition-distribution>
3251   -</slave-step-copy-partition-distribution>
3252   - <slave_transformation>N</slave_transformation>
3253   -
3254   -</transformation>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<transformation>
  3 + <info>
  4 + <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5bfc;&#x5165;-&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;2</name>
  5 + <description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</description>
  6 + <extended_description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;&#xff0c;&#x4f7f;&#x7528;&#x751f;&#x6210;&#x65f6;&#x523b;&#x8868;&#x683c;&#x5f0f;</extended_description>
  7 + <trans_version/>
  8 + <trans_type>Normal</trans_type>
  9 + <trans_status>0</trans_status>
  10 + <directory>&#x2f;</directory>
  11 + <parameters>
  12 + </parameters>
  13 + <log>
  14 +<trans-log-table><connection/>
  15 +<schema/>
  16 +<table/>
  17 +<size_limit_lines/>
  18 +<interval/>
  19 +<timeout_days/>
  20 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
  21 +<perf-log-table><connection/>
  22 +<schema/>
  23 +<table/>
  24 +<interval/>
  25 +<timeout_days/>
  26 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
  27 +<channel-log-table><connection/>
  28 +<schema/>
  29 +<table/>
  30 +<timeout_days/>
  31 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
  32 +<step-log-table><connection/>
  33 +<schema/>
  34 +<table/>
  35 +<timeout_days/>
  36 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
  37 +<metrics-log-table><connection/>
  38 +<schema/>
  39 +<table/>
  40 +<timeout_days/>
  41 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
  42 + </log>
  43 + <maxdate>
  44 + <connection/>
  45 + <table/>
  46 + <field/>
  47 + <offset>0.0</offset>
  48 + <maxdiff>0.0</maxdiff>
  49 + </maxdate>
  50 + <size_rowset>10000</size_rowset>
  51 + <sleep_time_empty>50</sleep_time_empty>
  52 + <sleep_time_full>50</sleep_time_full>
  53 + <unique_connections>N</unique_connections>
  54 + <feedback_shown>Y</feedback_shown>
  55 + <feedback_size>50000</feedback_size>
  56 + <using_thread_priorities>Y</using_thread_priorities>
  57 + <shared_objects_file/>
  58 + <capture_step_performance>N</capture_step_performance>
  59 + <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  60 + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  61 + <dependencies>
  62 + </dependencies>
  63 + <partitionschemas>
  64 + </partitionschemas>
  65 + <slaveservers>
  66 + </slaveservers>
  67 + <clusterschemas>
  68 + </clusterschemas>
  69 + <created_user>-</created_user>
  70 + <created_date>2016&#x2f;06&#x2f;30 12&#x3a;21&#x3a;57.536</created_date>
  71 + <modified_user>-</modified_user>
  72 + <modified_date>2016&#x2f;06&#x2f;30 12&#x3a;21&#x3a;57.536</modified_date>
  73 + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
  74 + <is_key_private>N</is_key_private>
  75 + </info>
  76 + <notepads>
  77 + <notepad>
  78 + <note>&#x5b57;&#x5178;&#x8868;&#x5bf9;&#x5e94;&#xff08;&#x4ee5;&#x540e;&#x76f4;&#x63a5;&#x67e5;&#x627e;&#x8868; bsth_c_sys_dictionary&#xff09;&#xa;&#x7c7b;&#x578b; &#x4ee3;&#x7801; &#x540d;&#x79f0;&#xa;LineTrend 0 &#x4e0a;&#x884c;&#xa;LineTrend 1 &#x4e0b;&#x884c;&#xa;ScheduleType normal &#x6b63;&#x5e38;&#x73ed;&#x6b21;&#xa;ScheduleType out &#x51fa;&#x573a;&#xa;ScheduleType in &#x8fdb;&#x573a;&#xa;ScheduleType temp &#x4e34;&#x52a0;&#xa;ScheduleType region &#x533a;&#x95f4;&#xa;ScheduleType venting &#x653e;&#x7a7a;&#xa;ScheduleType major &#x653e;&#x5927;&#x7ad9;</note>
  79 + <xloc>606</xloc>
  80 + <yloc>129</yloc>
  81 + <width>332</width>
  82 + <heigth>186</heigth>
  83 + <fontname>YaHei Consolas Hybrid</fontname>
  84 + <fontsize>12</fontsize>
  85 + <fontbold>N</fontbold>
  86 + <fontitalic>N</fontitalic>
  87 + <fontcolorred>0</fontcolorred>
  88 + <fontcolorgreen>0</fontcolorgreen>
  89 + <fontcolorblue>0</fontcolorblue>
  90 + <backgroundcolorred>255</backgroundcolorred>
  91 + <backgroundcolorgreen>205</backgroundcolorgreen>
  92 + <backgroundcolorblue>112</backgroundcolorblue>
  93 + <bordercolorred>100</bordercolorred>
  94 + <bordercolorgreen>100</bordercolorgreen>
  95 + <bordercolorblue>100</bordercolorblue>
  96 + <drawshadow>Y</drawshadow>
  97 + </notepad>
  98 + <notepad>
  99 + <note>&#x56e0;&#x4e3a;&#x65f6;&#x523b;&#x8868;&#x8f93;&#x5165;&#x683c;&#x5f0f;&#x4e0d;&#x786e;&#x5b9a;&#x6027;&#xff0c;&#x4e3b;&#x8981;&#x56e0;&#x4e3a;&#x8868;&#x7ed3;&#x6784;&#x662f;&#x53cd;&#x8303;&#x5f0f;&#x5316;&#x7684;&#xff0c;&#xa;&#x6240;&#x4ee5;&#x9700;&#x8981;&#x5916;&#x90e8;&#x52a8;&#x6001;&#x6307;&#x5b9a;&#x613f;&#x6570;&#x636e;&#xff0c;&#x5934;&#x4e09;&#x4e2a;step&#x52a8;&#x6001;&#x6307;&#x5b9a;&#x613f;&#x6570;&#x636e;&#xa;&#xa;</note>
  100 + <xloc>24</xloc>
  101 + <yloc>208</yloc>
  102 + <width>346</width>
  103 + <heigth>74</heigth>
  104 + <fontname>YaHei Consolas Hybrid</fontname>
  105 + <fontsize>12</fontsize>
  106 + <fontbold>N</fontbold>
  107 + <fontitalic>N</fontitalic>
  108 + <fontcolorred>0</fontcolorred>
  109 + <fontcolorgreen>0</fontcolorgreen>
  110 + <fontcolorblue>0</fontcolorblue>
  111 + <backgroundcolorred>255</backgroundcolorred>
  112 + <backgroundcolorgreen>205</backgroundcolorgreen>
  113 + <backgroundcolorblue>112</backgroundcolorblue>
  114 + <bordercolorred>100</bordercolorred>
  115 + <bordercolorgreen>100</bordercolorgreen>
  116 + <bordercolorblue>100</bordercolorblue>
  117 + <drawshadow>Y</drawshadow>
  118 + </notepad>
  119 + <notepad>
  120 + <note>&#x8fd9;&#x91cc;&#x6709;&#x4e9b;&#x95ee;&#x9898;&#xa;&#x5728;window2012&#x7684;&#x73af;&#x5883;&#x4e0b;&#xff0c;&#xa;MySql&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x4e2d;&#x5982;&#x679c;&#x8fd4;&#x56de;&#x4e2d;&#x6587;&#x5185;&#x5bb9;&#x7684;&#x5b57;&#x6bb5;&#xff0c;&#x8fd9;&#x4e2a;&#x5185;&#x5bb9;&#x4e71;&#x7801;&#xa;&#x89e3;&#x51b3;&#x529e;&#x6cd5;&#xff0c;&#x5c31;&#x662f;&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x5168;&#x90e8;&#x7f13;&#x5b58;&#xff0c;&#x5c31;&#x4e0d;&#x4e71;&#x7801;&#xa;linux&#x73af;&#x5883;&#x4e0b;&#x6ca1;&#x95ee;&#x9898;</note>
  121 + <xloc>721</xloc>
  122 + <yloc>762</yloc>
  123 + <width>333</width>
  124 + <heigth>90</heigth>
  125 + <fontname>YaHei Consolas Hybrid</fontname>
  126 + <fontsize>12</fontsize>
  127 + <fontbold>N</fontbold>
  128 + <fontitalic>N</fontitalic>
  129 + <fontcolorred>0</fontcolorred>
  130 + <fontcolorgreen>0</fontcolorgreen>
  131 + <fontcolorblue>0</fontcolorblue>
  132 + <backgroundcolorred>255</backgroundcolorred>
  133 + <backgroundcolorgreen>205</backgroundcolorgreen>
  134 + <backgroundcolorblue>112</backgroundcolorblue>
  135 + <bordercolorred>100</bordercolorred>
  136 + <bordercolorgreen>100</bordercolorgreen>
  137 + <bordercolorblue>100</bordercolorblue>
  138 + <drawshadow>Y</drawshadow>
  139 + </notepad>
  140 + <notepad>
  141 + <note>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#xff0c;&#x65b9;&#x5411;&#x6709;&#x65f6;&#x786e;&#x5b9a;&#x4e0d;&#x51c6;&#xff0c;&#xa;&#x7a7a;&#x7684;&#x60c5;&#x51b5;&#x4e0b;&#x8bbe;&#x5b9a;&#x4e3a;0&#xff08;&#x4e0a;&#x884c;&#xff09;</note>
  142 + <xloc>104</xloc>
  143 + <yloc>939</yloc>
  144 + <width>178</width>
  145 + <heigth>42</heigth>
  146 + <fontname>YaHei Consolas Hybrid</fontname>
  147 + <fontsize>12</fontsize>
  148 + <fontbold>N</fontbold>
  149 + <fontitalic>N</fontitalic>
  150 + <fontcolorred>0</fontcolorred>
  151 + <fontcolorgreen>0</fontcolorgreen>
  152 + <fontcolorblue>0</fontcolorblue>
  153 + <backgroundcolorred>255</backgroundcolorred>
  154 + <backgroundcolorgreen>205</backgroundcolorgreen>
  155 + <backgroundcolorblue>112</backgroundcolorblue>
  156 + <bordercolorred>100</bordercolorred>
  157 + <bordercolorgreen>100</bordercolorgreen>
  158 + <bordercolorblue>100</bordercolorblue>
  159 + <drawshadow>Y</drawshadow>
  160 + </notepad>
  161 + <notepad>
  162 + <note>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#xff0c;&#x65b9;&#x5411;&#x6709;&#x65f6;&#x786e;&#x5b9a;&#x4e0d;&#x51c6;&#xff0c;&#xa;&#x7a7a;&#x7684;&#x60c5;&#x51b5;&#x4e0b;&#x8bbe;&#x5b9a;&#x4e3a;0&#xff08;&#x4e0a;&#x884c;&#xff09;</note>
  163 + <xloc>578</xloc>
  164 + <yloc>1084</yloc>
  165 + <width>178</width>
  166 + <heigth>42</heigth>
  167 + <fontname>YaHei Consolas Hybrid</fontname>
  168 + <fontsize>12</fontsize>
  169 + <fontbold>N</fontbold>
  170 + <fontitalic>N</fontitalic>
  171 + <fontcolorred>0</fontcolorred>
  172 + <fontcolorgreen>0</fontcolorgreen>
  173 + <fontcolorblue>0</fontcolorblue>
  174 + <backgroundcolorred>255</backgroundcolorred>
  175 + <backgroundcolorgreen>205</backgroundcolorgreen>
  176 + <backgroundcolorblue>112</backgroundcolorblue>
  177 + <bordercolorred>100</bordercolorred>
  178 + <bordercolorgreen>100</bordercolorgreen>
  179 + <bordercolorblue>100</bordercolorblue>
  180 + <drawshadow>Y</drawshadow>
  181 + </notepad>
  182 + </notepads>
  183 + <connection>
  184 + <name>192.168.168.1_jwgl_dw</name>
  185 + <server>192.168.168.1</server>
  186 + <type>ORACLE</type>
  187 + <access>Native</access>
  188 + <database>orcl</database>
  189 + <port>1521</port>
  190 + <username>jwgl_dw</username>
  191 + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
  192 + <servername/>
  193 + <data_tablespace/>
  194 + <index_tablespace/>
  195 + <attributes>
  196 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  197 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  198 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  199 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  200 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  201 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  202 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  203 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  204 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  205 + </attributes>
  206 + </connection>
  207 + <connection>
  208 + <name>bus_control_variable</name>
  209 + <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
  210 + <type>MYSQL</type>
  211 + <access>Native</access>
  212 + <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
  213 + <port>3306</port>
  214 + <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
  215 + <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
  216 + <servername/>
  217 + <data_tablespace/>
  218 + <index_tablespace/>
  219 + <attributes>
  220 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
  221 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  222 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  223 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  224 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  225 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  226 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  227 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  228 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  229 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  230 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  231 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  232 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  233 + </attributes>
  234 + </connection>
  235 + <connection>
  236 + <name>bus_control_&#x516c;&#x53f8;_201</name>
  237 + <server>localhost</server>
  238 + <type>MYSQL</type>
  239 + <access>Native</access>
  240 + <database>control</database>
  241 + <port>3306</port>
  242 + <username>root</username>
  243 + <password>Encrypted </password>
  244 + <servername/>
  245 + <data_tablespace/>
  246 + <index_tablespace/>
  247 + <attributes>
  248 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  249 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  250 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  251 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  252 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  253 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  254 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  255 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  256 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  257 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  258 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  259 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  260 + </attributes>
  261 + </connection>
  262 + <connection>
  263 + <name>bus_control_&#x672c;&#x673a;</name>
  264 + <server>localhost</server>
  265 + <type>MYSQL</type>
  266 + <access>Native</access>
  267 + <database>control</database>
  268 + <port>3306</port>
  269 + <username>root</username>
  270 + <password>Encrypted </password>
  271 + <servername/>
  272 + <data_tablespace/>
  273 + <index_tablespace/>
  274 + <attributes>
  275 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  276 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  277 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  278 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  279 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  280 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  281 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  282 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  283 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  284 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  285 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  286 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  287 + </attributes>
  288 + </connection>
  289 + <connection>
  290 + <name>NHJW_VM</name>
  291 + <server>192.168.198.240</server>
  292 + <type>ORACLE</type>
  293 + <access>Native</access>
  294 + <database>orcl</database>
  295 + <port>1521</port>
  296 + <username>nhjw</username>
  297 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10d09aa5cd</password>
  298 + <servername/>
  299 + <data_tablespace/>
  300 + <index_tablespace/>
  301 + <attributes>
  302 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  303 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  304 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  305 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  306 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  307 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  308 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  309 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  310 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  311 + </attributes>
  312 + </connection>
  313 + <connection>
  314 + <name>PDGJ_VM</name>
  315 + <server>192.168.198.240</server>
  316 + <type>ORACLE</type>
  317 + <access>Native</access>
  318 + <database>orcl</database>
  319 + <port>1521</port>
  320 + <username>pdgj</username>
  321 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10ce96a8d0</password>
  322 + <servername/>
  323 + <data_tablespace/>
  324 + <index_tablespace/>
  325 + <attributes>
  326 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  327 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  328 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  329 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  330 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  331 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  332 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  333 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  334 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  335 + </attributes>
  336 + </connection>
  337 + <connection>
  338 + <name>xlab_mysql_youle</name>
  339 + <server>101.231.124.8</server>
  340 + <type>MYSQL</type>
  341 + <access>Native</access>
  342 + <database>xlab_youle</database>
  343 + <port>45687</port>
  344 + <username>xlab-youle</username>
  345 + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
  346 + <servername/>
  347 + <data_tablespace/>
  348 + <index_tablespace/>
  349 + <attributes>
  350 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  351 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  352 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  353 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  354 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  355 + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
  356 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  357 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  358 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  359 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  360 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  361 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  362 + </attributes>
  363 + </connection>
  364 + <connection>
  365 + <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
  366 + <server>localhost</server>
  367 + <type>MYSQL</type>
  368 + <access>Native</access>
  369 + <database>xlab_youle</database>
  370 + <port>3306</port>
  371 + <username>root</username>
  372 + <password>Encrypted </password>
  373 + <servername/>
  374 + <data_tablespace/>
  375 + <index_tablespace/>
  376 + <attributes>
  377 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  378 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  379 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  380 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  381 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  382 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  383 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  384 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  385 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  386 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  387 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  388 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  389 + </attributes>
  390 + </connection>
  391 + <connection>
  392 + <name>xlab_youle</name>
  393 + <server/>
  394 + <type>MYSQL</type>
  395 + <access>JNDI</access>
  396 + <database>xlab_youle</database>
  397 + <port>1521</port>
  398 + <username/>
  399 + <password>Encrypted </password>
  400 + <servername/>
  401 + <data_tablespace/>
  402 + <index_tablespace/>
  403 + <attributes>
  404 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  405 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  406 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  407 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  408 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  409 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  410 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  411 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  412 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  413 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  414 + </attributes>
  415 + </connection>
  416 + <order>
  417 + <hop> <from>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</from><to>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</to><enabled>Y</enabled> </hop>
  418 + <hop> <from>&#x6dfb;&#x52a0;&#x5bf9;&#x5e94;&#x73ed;&#x6b21;&#x6570;</from><to>&#x5904;&#x7406;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
  419 + <hop> <from>&#x67e5;&#x627e;&#x65f6;&#x523b;&#x8868;&#x57fa;&#x7840;&#x4fe1;&#x606f;&#x5173;&#x8054;</from><to>&#x67e5;&#x627e;&#x8def;&#x724c;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
  420 + <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x5173;&#x8054;</from><to>&#x67e5;&#x627e;&#x65f6;&#x523b;&#x8868;&#x57fa;&#x7840;&#x4fe1;&#x606f;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
  421 + <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178;</from><to>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178;</to><enabled>Y</enabled> </hop>
  422 + <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 2</from><to>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 2</to><enabled>Y</enabled> </hop>
  423 + <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</from><to>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 3</to><enabled>Y</enabled> </hop>
  424 + <hop> <from>&#x5339;&#x914d;&#x4e0a;&#x4e0b;&#x884c;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63;</to><enabled>Y</enabled> </hop>
  425 + <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</from><to>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</to><enabled>Y</enabled> </hop>
  426 + <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</from><to>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
  427 + <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</from><to>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
  428 + <hop> <from>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</from><to>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
  429 + <hop> <from>&#x67e5;&#x627e;&#x6240;&#x6709;&#x7ebf;&#x8def;&#x4e0a;&#x4e0b;&#x884c;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x4e0a;&#x4e0b;&#x884c;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
  430 + <hop> <from>&#x67e5;&#x627e;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178;</to><enabled>Y</enabled> </hop>
  431 + <hop> <from>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x67e5;&#x627e;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
  432 + <hop> <from>&#x6b63;&#x5e38;&#x73ed;&#x6b21;_&#x5904;&#x7406;&#x6570;&#x636e;</from><to>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop>
  433 + <hop> <from>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</from><to>&#x6b63;&#x5e38;&#x73ed;&#x6b21;_&#x5904;&#x7406;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
  434 + <hop> <from>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178;</from><to>&#x67e5;&#x627e;&#x6240;&#x6709;&#x7ebf;&#x8def;&#x4e0a;&#x4e0b;&#x884c;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
  435 + <hop> <from>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 2</from><to>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
  436 + <hop> <from>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 3</from><to>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
  437 + <hop> <from>&#x8ba1;&#x7b97;&#x73ed;&#x6b21;&#x7c7b;&#x578b;</from><to>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</to><enabled>Y</enabled> </hop>
  438 + <hop> <from>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</from><to>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;1</to><enabled>Y</enabled> </hop>
  439 + <hop> <from>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;1</from><to>&#x51fa;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x7ec8;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</to><enabled>Y</enabled> </hop>
  440 + <hop> <from>&#x51fa;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x7ec8;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</from><to>&#x67e5;&#x627e;&#x51fa;&#x573a;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop>
  441 + <hop> <from>&#x67e5;&#x627e;&#x51fa;&#x573a;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 2</to><enabled>Y</enabled> </hop>
  442 + <hop> <from>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</from><to>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;2</to><enabled>Y</enabled> </hop>
  443 + <hop> <from>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;2</from><to>&#x8fdb;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x8d77;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</to><enabled>Y</enabled> </hop>
  444 + <hop> <from>&#x8fdb;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x8d77;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ebf;&#x8def;&#x65b9;&#x5411;</to><enabled>Y</enabled> </hop>
  445 + <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ebf;&#x8def;&#x65b9;&#x5411;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</to><enabled>Y</enabled> </hop>
  446 + <hop> <from>&#x5206;&#x7ec4;&#x5404;&#x4e2a;&#x8def;&#x724c;&#x7684;&#x7ad9;</from><to>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x5173;&#x8054;</to><enabled>Y</enabled> </hop>
  447 + <hop> <from>&#x589e;&#x52a0;&#x65f6;&#x523b;&#x8868;&#x540d;&#x5b57;&#xff0c;&#x7ebf;&#x8def;&#x540d;&#x5b57;&#xff0c;&#x505c;&#x8f66;&#x573a;&#x540d;&#x5b57;</from><to>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</to><enabled>Y</enabled> </hop>
  448 + <hop> <from>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</from><to>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</to><enabled>Y</enabled> </hop>
  449 + <hop> <from>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>
  450 + <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</to><enabled>Y</enabled> </hop>
  451 + <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop>
  452 + <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</to><enabled>Y</enabled> </hop>
  453 + <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
  454 + <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
  455 + <hop> <from>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</to><enabled>Y</enabled> </hop>
  456 + <hop> <from>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</to><enabled>Y</enabled> </hop>
  457 + <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</to><enabled>Y</enabled> </hop>
  458 + <hop> <from>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</to><enabled>Y</enabled> </hop>
  459 + <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</to><enabled>Y</enabled> </hop>
  460 + <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</to><enabled>Y</enabled> </hop>
  461 + <hop> <from>&#x67e5;&#x627e;&#x8def;&#x724c;&#x5173;&#x8054;</from><to>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</to><enabled>Y</enabled> </hop>
  462 + <hop> <from>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</from><to>&#x8ba1;&#x7b97;&#x73ed;&#x6b21;&#x7c7b;&#x578b;</to><enabled>Y</enabled> </hop>
  463 + <hop> <from>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</from><to>&#x66f4;&#x65b0;&#x65f6;&#x523b;&#x8868;&#x4e3b;&#x8868;&#x7248;&#x672c;</to><enabled>Y</enabled> </hop>
  464 + <hop> <from>&#x6dfb;&#x52a0;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;</from><to>&#x6dfb;&#x52a0;&#x5bf9;&#x5e94;&#x73ed;&#x6b21;&#x6570;</to><enabled>Y</enabled> </hop>
  465 + <hop> <from>&#x5904;&#x7406;&#x6570;&#x636e;</from><to>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;&#xff08;&#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x4e3a;&#x7a7a;&#xff09;</to><enabled>Y</enabled> </hop>
  466 + <hop> <from>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;&#xff08;&#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x4e3a;&#x7a7a;&#xff09;</from><to>&#x5206;&#x7ec4;&#x5404;&#x4e2a;&#x8def;&#x724c;&#x7684;&#x7ad9;</to><enabled>Y</enabled> </hop>
  467 + <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>&#x6dfb;&#x52a0;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;</to><enabled>Y</enabled> </hop>
  468 + </order>
  469 + <step>
  470 + <name>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</name>
  471 + <type>IfNull</type>
  472 + <description/>
  473 + <distribute>Y</distribute>
  474 + <custom_distribution/>
  475 + <copies>1</copies>
  476 + <partitioning>
  477 + <method>none</method>
  478 + <schema_name/>
  479 + </partitioning>
  480 + <replaceAllByValue/>
  481 + <replaceAllMask/>
  482 + <selectFields>Y</selectFields>
  483 + <selectValuesType>N</selectValuesType>
  484 + <setEmptyStringAll>N</setEmptyStringAll>
  485 + <valuetypes>
  486 + </valuetypes>
  487 + <fields>
  488 + <field>
  489 + <name>sxx</name>
  490 + <value>0</value>
  491 + <mask/>
  492 + <set_empty_string>N</set_empty_string>
  493 + </field>
  494 + </fields>
  495 + <cluster_schema/>
  496 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  497 + <xloc>335</xloc>
  498 + <yloc>938</yloc>
  499 + <draw>Y</draw>
  500 + </GUI>
  501 + </step>
  502 +
  503 + <step>
  504 + <name>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</name>
  505 + <type>IfNull</type>
  506 + <description/>
  507 + <distribute>Y</distribute>
  508 + <custom_distribution/>
  509 + <copies>1</copies>
  510 + <partitioning>
  511 + <method>none</method>
  512 + <schema_name/>
  513 + </partitioning>
  514 + <replaceAllByValue/>
  515 + <replaceAllMask/>
  516 + <selectFields>Y</selectFields>
  517 + <selectValuesType>N</selectValuesType>
  518 + <setEmptyStringAll>N</setEmptyStringAll>
  519 + <valuetypes>
  520 + </valuetypes>
  521 + <fields>
  522 + <field>
  523 + <name>sxx2</name>
  524 + <value>0</value>
  525 + <mask/>
  526 + <set_empty_string>N</set_empty_string>
  527 + </field>
  528 + </fields>
  529 + <cluster_schema/>
  530 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  531 + <xloc>804</xloc>
  532 + <yloc>1081</yloc>
  533 + <draw>Y</draw>
  534 + </GUI>
  535 + </step>
  536 +
  537 + <step>
  538 + <name>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178;</name>
  539 + <type>ValueMapper</type>
  540 + <description/>
  541 + <distribute>Y</distribute>
  542 + <custom_distribution/>
  543 + <copies>1</copies>
  544 + <partitioning>
  545 + <method>none</method>
  546 + <schema_name/>
  547 + </partitioning>
  548 + <field_to_use>sxx</field_to_use>
  549 + <target_field>sxx_desc</target_field>
  550 + <non_match_default/>
  551 + <fields>
  552 + <field>
  553 + <source_value>0</source_value>
  554 + <target_value>&#x4e0a;&#x884c;</target_value>
  555 + </field>
  556 + <field>
  557 + <source_value>1</source_value>
  558 + <target_value>&#x4e0b;&#x884c;</target_value>
  559 + </field>
  560 + </fields>
  561 + <cluster_schema/>
  562 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  563 + <xloc>147</xloc>
  564 + <yloc>403</yloc>
  565 + <draw>Y</draw>
  566 + </GUI>
  567 + </step>
  568 +
  569 + <step>
  570 + <name>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 2</name>
  571 + <type>ValueMapper</type>
  572 + <description/>
  573 + <distribute>Y</distribute>
  574 + <custom_distribution/>
  575 + <copies>1</copies>
  576 + <partitioning>
  577 + <method>none</method>
  578 + <schema_name/>
  579 + </partitioning>
  580 + <field_to_use>sxx</field_to_use>
  581 + <target_field>sxx_desc</target_field>
  582 + <non_match_default/>
  583 + <fields>
  584 + <field>
  585 + <source_value>0</source_value>
  586 + <target_value>&#x4e0a;&#x884c;</target_value>
  587 + </field>
  588 + <field>
  589 + <source_value>1</source_value>
  590 + <target_value>&#x4e0b;&#x884c;</target_value>
  591 + </field>
  592 + </fields>
  593 + <cluster_schema/>
  594 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  595 + <xloc>331</xloc>
  596 + <yloc>598</yloc>
  597 + <draw>Y</draw>
  598 + </GUI>
  599 + </step>
  600 +
  601 + <step>
  602 + <name>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</name>
  603 + <type>ValueMapper</type>
  604 + <description/>
  605 + <distribute>Y</distribute>
  606 + <custom_distribution/>
  607 + <copies>1</copies>
  608 + <partitioning>
  609 + <method>none</method>
  610 + <schema_name/>
  611 + </partitioning>
  612 + <field_to_use>sxx</field_to_use>
  613 + <target_field>sxx_desc</target_field>
  614 + <non_match_default/>
  615 + <fields>
  616 + <field>
  617 + <source_value>0</source_value>
  618 + <target_value>&#x4e0a;&#x884c;</target_value>
  619 + </field>
  620 + <field>
  621 + <source_value>1</source_value>
  622 + <target_value>&#x4e0b;&#x884c;</target_value>
  623 + </field>
  624 + </fields>
  625 + <cluster_schema/>
  626 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  627 + <xloc>553</xloc>
  628 + <yloc>859</yloc>
  629 + <draw>Y</draw>
  630 + </GUI>
  631 + </step>
  632 +
  633 + <step>
  634 + <name>&#x51fa;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x7ec8;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</name>
  635 + <type>ScriptValueMod</type>
  636 + <description/>
  637 + <distribute>Y</distribute>
  638 + <custom_distribution/>
  639 + <copies>1</copies>
  640 + <partitioning>
  641 + <method>none</method>
  642 + <schema_name/>
  643 + </partitioning>
  644 + <compatible>N</compatible>
  645 + <optimizationLevel>9</optimizationLevel>
  646 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  647 + <jsScript_name>Script 1</jsScript_name>
  648 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var zdzname &#x3d; cc_groups&#x5b;gno&#x5d;&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#x662f;&#x4e0b;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x59cb;&#x7ad9;&#xa;var endZdtype &#x3d; &#x27;B&#x27;&#x3b;&#xa;&#x2f;&#x2f; var endZdtype &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
  649 + </jsScript> </jsScripts> <fields> <field> <name>zdzname</name>
  650 + <rename>zdzname</rename>
  651 + <type>String</type>
  652 + <length>-1</length>
  653 + <precision>-1</precision>
  654 + <replace>N</replace>
  655 + </field> <field> <name>endZdtype</name>
  656 + <rename>endZdtype</rename>
  657 + <type>String</type>
  658 + <length>-1</length>
  659 + <precision>-1</precision>
  660 + <replace>N</replace>
  661 + </field> <field> <name>destory</name>
  662 + <rename>destory</rename>
  663 + <type>Integer</type>
  664 + <length>-1</length>
  665 + <precision>-1</precision>
  666 + <replace>N</replace>
  667 + </field> </fields> <cluster_schema/>
  668 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  669 + <xloc>575</xloc>
  670 + <yloc>502</yloc>
  671 + <draw>Y</draw>
  672 + </GUI>
  673 + </step>
  674 +
  675 + <step>
  676 + <name>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</name>
  677 + <type>Dummy</type>
  678 + <description/>
  679 + <distribute>Y</distribute>
  680 + <custom_distribution/>
  681 + <copies>1</copies>
  682 + <partitioning>
  683 + <method>none</method>
  684 + <schema_name/>
  685 + </partitioning>
  686 + <cluster_schema/>
  687 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  688 + <xloc>869</xloc>
  689 + <yloc>504</yloc>
  690 + <draw>Y</draw>
  691 + </GUI>
  692 + </step>
  693 +
  694 + <step>
  695 + <name>&#x5206;&#x7ec4;&#x5404;&#x4e2a;&#x8def;&#x724c;&#x7684;&#x7ad9;</name>
  696 + <type>GroupBy</type>
  697 + <description/>
  698 + <distribute>Y</distribute>
  699 + <custom_distribution/>
  700 + <copies>1</copies>
  701 + <partitioning>
  702 + <method>none</method>
  703 + <schema_name/>
  704 + </partitioning>
  705 + <all_rows>Y</all_rows>
  706 + <ignore_aggregate>N</ignore_aggregate>
  707 + <field_ignore/>
  708 + <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
  709 + <prefix>grp</prefix>
  710 + <add_linenr>Y</add_linenr>
  711 + <linenr_fieldname>gno</linenr_fieldname>
  712 + <give_back_row>N</give_back_row>
  713 + <group>
  714 + <field>
  715 + <name>lp</name>
  716 + </field>
  717 + </group>
  718 + <fields>
  719 + <field>
  720 + <aggregate>qdzgroups</aggregate>
  721 + <subject>qdzname</subject>
  722 + <type>CONCAT_STRING</type>
  723 + <valuefield>,</valuefield>
  724 + </field>
  725 + </fields>
  726 + <cluster_schema/>
  727 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  728 + <xloc>892</xloc>
  729 + <yloc>44</yloc>
  730 + <draw>Y</draw>
  731 + </GUI>
  732 + </step>
  733 +
  734 + <step>
  735 + <name>&#x5339;&#x914d;&#x4e0a;&#x4e0b;&#x884c;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
  736 + <type>ScriptValueMod</type>
  737 + <description/>
  738 + <distribute>Y</distribute>
  739 + <custom_distribution/>
  740 + <copies>1</copies>
  741 + <partitioning>
  742 + <method>none</method>
  743 + <schema_name/>
  744 + </partitioning>
  745 + <compatible>N</compatible>
  746 + <optimizationLevel>9</optimizationLevel>
  747 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  748 + <jsScript_name>Script 1</jsScript_name>
  749 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var jhlc&#x3b; &#x2f;&#x2f; &#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var bcsj&#x3b; &#x2f;&#x2f; &#x73ed;&#x6b21;&#x65f6;&#x95f4;&#xa;&#xa;&#x2f;&#x2f; &#x65f6;&#x95f4;&#x8303;&#x56f4;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#xa;var timeRex &#x3d; &#x2f;&#x5e;&#x28;&#x5b;01&#x5d;&#x3f;&#x5b;0-9&#x5d;&#x7c;2&#x5b;0-3&#x5d;&#x29;&#x3a;&#x5b;0-5&#x5d;&#x5b;0-9&#x5d;&#x24;&#x2f;&#x3b;&#xa;&#x2f;&#x2f; &#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x8f6c;&#x6362;&#x6210;&#x65e5;&#x671f;&#xa;var fcsj_hour &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_min &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_date &#x3d; new Date&#x28;2000,1,1,fcsj_hour,fcsj_min,0&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x65e9;&#x9ad8;&#x5cf0;&#xa;var isZgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;early_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;early_end_time&#x29; &#x26;&#x26; early_up_time &#x21;&#x3d; null &#x26;&#x26; early_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var early_s_hour &#x3d; str2num&#x28;early_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_min &#x3d; str2num&#x28;early_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_date &#x3d; new Date&#x28;2000,1,1,early_s_hour,early_s_min,0&#x29;&#x3b;&#xa;&#xa; var early_e_hour &#x3d; str2num&#x28;early_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_min &#x3d; str2num&#x28;early_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_date &#x3d; new Date&#x28;2000,1,1,early_e_hour,early_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; early_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; early_e_date&#x29; &#x7b;&#xa; isZgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;var isWgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;late_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;late_end_time&#x29; &#x26;&#x26; late_up_time &#x21;&#x3d; null &#x26;&#x26; late_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var late_s_hour &#x3d; str2num&#x28;late_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_min &#x3d; str2num&#x28;late_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_date &#x3d; new Date&#x28;2000,1,1,late_s_hour,late_s_min,0&#x29;&#x3b;&#xa;&#xa; var late_e_hour &#x3d; str2num&#x28;late_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_min &#x3d; str2num&#x28;late_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_date &#x3d; new Date&#x28;2000,1,1,late_e_hour,late_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; late_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; late_e_date&#x29; &#x7b;&#xa; isWgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; early_up_time &#x21;&#x3d; 0 &#x3f; early_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; late_up_time &#x21;&#x3d; 0 &#x3f; late_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; up_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; early_down_time &#x21;&#x3d; 0 &#x3f; early_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; late_down_time &#x21;&#x3d; 0 &#x3f; late_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; down_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d;</jsScript_script>
  750 + </jsScript> </jsScripts> <fields> <field> <name>jhlc</name>
  751 + <rename>jhlc</rename>
  752 + <type>String</type>
  753 + <length>-1</length>
  754 + <precision>-1</precision>
  755 + <replace>N</replace>
  756 + </field> <field> <name>bcsj</name>
  757 + <rename>bcsj</rename>
  758 + <type>String</type>
  759 + <length>-1</length>
  760 + <precision>-1</precision>
  761 + <replace>N</replace>
  762 + </field> </fields> <cluster_schema/>
  763 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  764 + <xloc>148</xloc>
  765 + <yloc>674</yloc>
  766 + <draw>Y</draw>
  767 + </GUI>
  768 + </step>
  769 +
  770 + <step>
  771 + <name>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
  772 + <type>ScriptValueMod</type>
  773 + <description/>
  774 + <distribute>Y</distribute>
  775 + <custom_distribution/>
  776 + <copies>1</copies>
  777 + <partitioning>
  778 + <method>none</method>
  779 + <schema_name/>
  780 + </partitioning>
  781 + <compatible>N</compatible>
  782 + <optimizationLevel>9</optimizationLevel>
  783 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  784 + <jsScript_name>Script 1</jsScript_name>
  785 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var out_mileage&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var out_time&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x8ba1;&#x5212;&#x65f6;&#x95f4;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; out_mileage &#x3d; up_out_mileage&#x3b;&#xa; out_time &#x3d; up_out_timer&#x3b;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; out_mileage &#x3d; down_out_mileage&#x3b;&#xa; out_time &#x3d; down_out_timer&#x3b;&#xa;&#x7d;&#xa;&#xa;&#xa;&#xa;</jsScript_script>
  786 + </jsScript> </jsScripts> <fields> <field> <name>out_mileage</name>
  787 + <rename>out_mileage</rename>
  788 + <type>String</type>
  789 + <length>-1</length>
  790 + <precision>-1</precision>
  791 + <replace>N</replace>
  792 + </field> <field> <name>out_time</name>
  793 + <rename>out_time</rename>
  794 + <type>String</type>
  795 + <length>-1</length>
  796 + <precision>-1</precision>
  797 + <replace>N</replace>
  798 + </field> </fields> <cluster_schema/>
  799 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  800 + <xloc>336</xloc>
  801 + <yloc>862</yloc>
  802 + <draw>Y</draw>
  803 + </GUI>
  804 + </step>
  805 +
  806 + <step>
  807 + <name>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
  808 + <type>ScriptValueMod</type>
  809 + <description/>
  810 + <distribute>Y</distribute>
  811 + <custom_distribution/>
  812 + <copies>1</copies>
  813 + <partitioning>
  814 + <method>none</method>
  815 + <schema_name/>
  816 + </partitioning>
  817 + <compatible>N</compatible>
  818 + <optimizationLevel>9</optimizationLevel>
  819 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  820 + <jsScript_name>Script 1</jsScript_name>
  821 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var parade_mileage&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var parade_time&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x8ba1;&#x5212;&#x65f6;&#x95f4;&#xa;&#xa;if &#x28;sxx2 &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; parade_mileage &#x3d; up_in_mileage&#x3b;&#xa; parade_time &#x3d; up_in_timer&#x3b;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; parade_mileage &#x3d; down_in_mileage&#x3b;&#xa; parade_time &#x3d; down_in_timer&#x3b;&#xa;&#x7d;&#xa;&#xa;&#xa;&#xa;</jsScript_script>
  822 + </jsScript> </jsScripts> <fields> <field> <name>parade_mileage</name>
  823 + <rename>parade_mileage</rename>
  824 + <type>String</type>
  825 + <length>-1</length>
  826 + <precision>-1</precision>
  827 + <replace>N</replace>
  828 + </field> <field> <name>parade_time</name>
  829 + <rename>parade_time</rename>
  830 + <type>String</type>
  831 + <length>-1</length>
  832 + <precision>-1</precision>
  833 + <replace>N</replace>
  834 + </field> </fields> <cluster_schema/>
  835 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  836 + <xloc>726</xloc>
  837 + <yloc>1005</yloc>
  838 + <draw>Y</draw>
  839 + </GUI>
  840 + </step>
  841 +
  842 + <step>
  843 + <name>&#x589e;&#x52a0;&#x65f6;&#x523b;&#x8868;&#x540d;&#x5b57;&#xff0c;&#x7ebf;&#x8def;&#x540d;&#x5b57;&#xff0c;&#x505c;&#x8f66;&#x573a;&#x540d;&#x5b57;</name>
  844 + <type>DataGrid</type>
  845 + <description/>
  846 + <distribute>Y</distribute>
  847 + <custom_distribution/>
  848 + <copies>1</copies>
  849 + <partitioning>
  850 + <method>none</method>
  851 + <schema_name/>
  852 + </partitioning>
  853 + <fields>
  854 + </fields>
  855 + <data>
  856 + <line> </line>
  857 + </data>
  858 + <cluster_schema/>
  859 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  860 + <xloc>110</xloc>
  861 + <yloc>133</yloc>
  862 + <draw>Y</draw>
  863 + </GUI>
  864 + </step>
  865 +
  866 + <step>
  867 + <name>&#x5904;&#x7406;&#x6570;&#x636e;</name>
  868 + <type>ScriptValueMod</type>
  869 + <description/>
  870 + <distribute>Y</distribute>
  871 + <custom_distribution/>
  872 + <copies>1</copies>
  873 + <partitioning>
  874 + <method>none</method>
  875 + <schema_name/>
  876 + </partitioning>
  877 + <compatible>N</compatible>
  878 + <optimizationLevel>9</optimizationLevel>
  879 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  880 + <jsScript_name>Script 1</jsScript_name>
  881 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x751f;&#x6210;&#x65f6;&#x523b;&#x8868;&#x7684;&#x683c;&#x5f0f;&#x6570;&#x636e;&#x5904;&#x7406;&#xa;&#x2f;&#x2f; &#x5df2;&#x7ecf;&#x8fc7;&#x6ee4;&#x4e86; &#x62a5;&#x5230;&#xff0c;&#x5230;&#x573a;&#xff0c;&#x79bb;&#x573a;&#xff0c;&#x603b;&#x516c;&#x91cc;&#xff0c;&#x8425;&#x4e1a;&#x516c;&#x91cc;&#xff0c;&#x7a7a;&#x9a76;&#x516c;&#x91cc;&#xff0c;&#x603b;&#x5de5;&#x65f6;&#xff0c;&#x8425;&#x4e1a;&#x5de5;&#x65f6;&#xff0c;&#x8425;&#x8fd0;&#x73ed;&#x6b21; &#x6570;&#x636e;&#xa;&#x2f;&#x2f; sendtime&#x9700;&#x8981;&#x5904;&#x7406; &#x28;&#x62a5;&#x7c;&#x51fa;&#x29;hh&#x3a;mm&#x683c;&#x5f0f; hh&#x3a;mm&#x28;X&#x7c;&#x203b;&#x29;&#x683c;&#x5f0f;&#xa;&#xa;&#x2f;&#x2f; &#x5982;&#x679c;&#x7ad9;&#x540d;&#x4e2d;&#x6709;&#x7c7b;&#x4f3c;-&#x3e;&#x7b;&#x6570;&#x5b57;&#x7d;&#xff0c;&#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x8fc7;&#x6ee4;&#x6389;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;-&#x3e;&#x5c;d&#x2b;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;qdzname &#x3d;&#x3d; &#x22;&#x62a5;&#x5230;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x5230;&#x573a;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x79bb;&#x573a;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x603b;&#x516c;&#x91cc;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x8425;&#x4e1a;&#x516c;&#x91cc;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x7a7a;&#x9a76;&#x516c;&#x91cc;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x603b;&#x5de5;&#x65f6;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x8425;&#x4e1a;&#x5de5;&#x65f6;&#x22; &#x7c;&#x7c; &#xa; qdzname &#x3d;&#x3d; &#x22;&#x8425;&#x8fd0;&#x73ed;&#x6b21;&#x22;&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; null&#x3b;&#xa;&#x7d; else &#x7b;&#xa; if &#x28;sendtime &#x3d;&#x3d; null&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; null&#x3b;&#xa; &#x7d; else &#x7b;&#xa; sendtime_calcu &#x3d; sendtime.replace&#x28;&#x2f;&#x5c;s&#x2f;g, &#x22;&#x22;&#x29;&#x3b;&#xa; if &#x28;sendtime_calcu.indexOf&#x28;&#x22;&#x62a5;&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5206;&#x73ed;&#x62a5;&#x5230;&#x73ed;&#x6b21;&#x795b;&#x9664;&#xa; sendtime_calcu &#x3d; null&#x3b;&#xa; &#x7d; else &#x7b;&#xa; if &#x28;sendtime_calcu.indexOf&#x28;&#x22;X&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x73ed;&#x6b21;&#xa; qdzname &#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x3b;&#xa; sendtime_calcu &#x3d; sendtime_calcu.substr&#x28;0, sendtime_calcu.indexOf&#x28;&#x22;X&#x22;&#x29;&#x29;&#x3b;&#xa; &#x7d; else if &#x28;sendtime_calcu.indexOf&#x28;&#x22;&#x51fa;&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5206;&#x73ed;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#xa; qdzname &#x3d; &#x22;&#x51fa;&#x573a;&#x22;&#x3b;&#xa; sendtime_calcu &#x3d; sendtime_calcu.substr&#x28;1&#x29;&#x3b;&#xa; &#x7d; else if &#x28;sendtime_calcu.indexOf&#x28;&#x22;&#x203b;&#x22;&#x29; &#x3e;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x505c;&#x9a76;&#x73ed;&#x6b21;&#xa; sendtime_calcu &#x3d; sendtime_calcu.substr&#x28;0, sendtime_calcu.indexOf&#x28;&#x22;X&#x22;&#x29;&#x29;&#x3b;&#xa; &#x7d; else &#x7b;&#xa; &#x2f;&#x2f; &#x6b63;&#x5e38;&#x73ed;&#x6b21;&#xa; &#x7d;&#xa;&#xa; &#x2f;&#x2f; &#x5904;&#x7406;&#x65f6;&#x95f4;&#x683c;&#x5f0f;&#xa; &#x2f;&#x2f; &#x56e0;&#x4e3a;&#x683c;&#x5f0f;&#x53ea;&#x652f;&#x6301; &#x3a; &#x5206;&#x9694;&#xff0c;&#x6240;&#x4ee5;&#x8865;0&#x5c31;&#x53ef;&#x4ee5;&#x4e86;&#xa; if &#x28;sendtime_calcu.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa; &#x7d; &#xa; &#x7d;&#xa;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
  882 + </jsScript> </jsScripts> <fields> <field> <name>qdzname</name>
  883 + <rename>qdzname</rename>
  884 + <type>String</type>
  885 + <length>-1</length>
  886 + <precision>-1</precision>
  887 + <replace>Y</replace>
  888 + </field> <field> <name>isfb</name>
  889 + <rename>isfb</rename>
  890 + <type>Integer</type>
  891 + <length>-1</length>
  892 + <precision>-1</precision>
  893 + <replace>N</replace>
  894 + </field> <field> <name>iscanceled</name>
  895 + <rename>iscanceled</rename>
  896 + <type>Integer</type>
  897 + <length>-1</length>
  898 + <precision>-1</precision>
  899 + <replace>N</replace>
  900 + </field> <field> <name>sendtime_calcu</name>
  901 + <rename>sendtime_calcu</rename>
  902 + <type>String</type>
  903 + <length>-1</length>
  904 + <precision>-1</precision>
  905 + <replace>N</replace>
  906 + </field> <field> <name>ists</name>
  907 + <rename>ists</rename>
  908 + <type>Integer</type>
  909 + <length>-1</length>
  910 + <precision>-1</precision>
  911 + <replace>N</replace>
  912 + </field> </fields> <cluster_schema/>
  913 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  914 + <xloc>654</xloc>
  915 + <yloc>45</yloc>
  916 + <draw>Y</draw>
  917 + </GUI>
  918 + </step>
  919 +
  920 + <step>
  921 + <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
  922 + <type>SelectValues</type>
  923 + <description/>
  924 + <distribute>Y</distribute>
  925 + <custom_distribution/>
  926 + <copies>1</copies>
  927 + <partitioning>
  928 + <method>none</method>
  929 + <schema_name/>
  930 + </partitioning>
  931 + <fields> <field> <name>&#x8def;&#x724c;</name>
  932 + <rename>lp</rename>
  933 + <length>-2</length>
  934 + <precision>-2</precision>
  935 + </field> <field> <name>&#x7ad9;&#x70b9;&#x540d;&#x79f0;</name>
  936 + <rename>qdzname</rename>
  937 + <length>-2</length>
  938 + <precision>-2</precision>
  939 + </field> <field> <name>&#x53d1;&#x8f66;&#x65f6;&#x95f4;</name>
  940 + <rename>sendtime</rename>
  941 + <length>-2</length>
  942 + <precision>-2</precision>
  943 + </field> <select_unspecified>Y</select_unspecified>
  944 + </fields> <cluster_schema/>
  945 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  946 + <xloc>441</xloc>
  947 + <yloc>133</yloc>
  948 + <draw>Y</draw>
  949 + </GUI>
  950 + </step>
  951 +
  952 + <step>
  953 + <name>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;1</name>
  954 + <type>FilterRows</type>
  955 + <description/>
  956 + <distribute>Y</distribute>
  957 + <custom_distribution/>
  958 + <copies>1</copies>
  959 + <partitioning>
  960 + <method>none</method>
  961 + <schema_name/>
  962 + </partitioning>
  963 +<send_true_to>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</send_true_to>
  964 +<send_false_to>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</send_false_to>
  965 + <compare>
  966 +<condition>
  967 + <negated>N</negated>
  968 + <leftvalue>bctype</leftvalue>
  969 + <function>&#x3d;</function>
  970 + <rightvalue/>
  971 + <value><name>constant</name><type>String</type><text>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition>
  972 + </compare>
  973 + <cluster_schema/>
  974 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  975 + <xloc>860</xloc>
  976 + <yloc>401</yloc>
  977 + <draw>Y</draw>
  978 + </GUI>
  979 + </step>
  980 +
  981 + <step>
  982 + <name>&#x6309;&#x7167;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x8fc7;&#x6ee4;&#x6570;&#x636e;2</name>
  983 + <type>FilterRows</type>
  984 + <description/>
  985 + <distribute>Y</distribute>
  986 + <custom_distribution/>
  987 + <copies>1</copies>
  988 + <partitioning>
  989 + <method>none</method>
  990 + <schema_name/>
  991 + </partitioning>
  992 +<send_true_to>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</send_true_to>
  993 +<send_false_to>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</send_false_to>
  994 + <compare>
  995 +<condition>
  996 + <negated>N</negated>
  997 + <leftvalue>bctype</leftvalue>
  998 + <function>&#x3d;</function>
  999 + <rightvalue/>
  1000 + <value><name>constant</name><type>String</type><text>&#x51fa;&#x573a;</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition>
  1001 + </compare>
  1002 + <cluster_schema/>
  1003 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1004 + <xloc>995</xloc>
  1005 + <yloc>503</yloc>
  1006 + <draw>Y</draw>
  1007 + </GUI>
  1008 + </step>
  1009 +
  1010 + <step>
  1011 + <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</name>
  1012 + <type>InsertUpdate</type>
  1013 + <description/>
  1014 + <distribute>Y</distribute>
  1015 + <custom_distribution/>
  1016 + <copies>1</copies>
  1017 + <partitioning>
  1018 + <method>none</method>
  1019 + <schema_name/>
  1020 + </partitioning>
  1021 + <connection>bus_control_variable</connection>
  1022 + <commit>100</commit>
  1023 + <update_bypassed>N</update_bypassed>
  1024 + <lookup>
  1025 + <schema/>
  1026 + <table>bsth_c_s_ttinfo_detail</table>
  1027 + <key>
  1028 + <name>xlid</name>
  1029 + <field>xl</field>
  1030 + <condition>&#x3d;</condition>
  1031 + <name2/>
  1032 + </key>
  1033 + <key>
  1034 + <name>ttid</name>
  1035 + <field>ttinfo</field>
  1036 + <condition>&#x3d;</condition>
  1037 + <name2/>
  1038 + </key>
  1039 + <key>
  1040 + <name>lpid</name>
  1041 + <field>lp</field>
  1042 + <condition>&#x3d;</condition>
  1043 + <name2/>
  1044 + </key>
  1045 + <key>
  1046 + <name>fcno</name>
  1047 + <field>fcno</field>
  1048 + <condition>&#x3d;</condition>
  1049 + <name2/>
  1050 + </key>
  1051 + <key>
  1052 + <name>bcs</name>
  1053 + <field>bcs</field>
  1054 + <condition>&#x3d;</condition>
  1055 + <name2/>
  1056 + </key>
  1057 + <value>
  1058 + <name>lp</name>
  1059 + <rename>lpid</rename>
  1060 + <update>Y</update>
  1061 + </value>
  1062 + <value>
  1063 + <name>bc_type</name>
  1064 + <rename>bctype_code</rename>
  1065 + <update>Y</update>
  1066 + </value>
  1067 + <value>
  1068 + <name>bcs</name>
  1069 + <rename>bcs</rename>
  1070 + <update>Y</update>
  1071 + </value>
  1072 + <value>
  1073 + <name>bcsj</name>
  1074 + <rename>bcsj</rename>
  1075 + <update>Y</update>
  1076 + </value>
  1077 + <value>
  1078 + <name>fcno</name>
  1079 + <rename>fcno</rename>
  1080 + <update>Y</update>
  1081 + </value>
  1082 + <value>
  1083 + <name>jhlc</name>
  1084 + <rename>jhlc</rename>
  1085 + <update>Y</update>
  1086 + </value>
  1087 + <value>
  1088 + <name>fcsj</name>
  1089 + <rename>sendtime_calcu</rename>
  1090 + <update>Y</update>
  1091 + </value>
  1092 + <value>
  1093 + <name>ttinfo</name>
  1094 + <rename>ttid</rename>
  1095 + <update>Y</update>
  1096 + </value>
  1097 + <value>
  1098 + <name>xl</name>
  1099 + <rename>xlid</rename>
  1100 + <update>Y</update>
  1101 + </value>
  1102 + <value>
  1103 + <name>qdz</name>
  1104 + <rename>qdzid</rename>
  1105 + <update>Y</update>
  1106 + </value>
  1107 + <value>
  1108 + <name>zdz</name>
  1109 + <rename>zdzid</rename>
  1110 + <update>Y</update>
  1111 + </value>
  1112 + <value>
  1113 + <name>xl_dir</name>
  1114 + <rename>sxx</rename>
  1115 + <update>Y</update>
  1116 + </value>
  1117 + <value>
  1118 + <name>isfb</name>
  1119 + <rename>isfb</rename>
  1120 + <update>Y</update>
  1121 + </value>
  1122 + <value>
  1123 + <name>qdz_code</name>
  1124 + <rename>qdzcode</rename>
  1125 + <update>Y</update>
  1126 + </value>
  1127 + <value>
  1128 + <name>qdz_name</name>
  1129 + <rename>qdzname_</rename>
  1130 + <update>Y</update>
  1131 + </value>
  1132 + <value>
  1133 + <name>zdz_code</name>
  1134 + <rename>zdzcode</rename>
  1135 + <update>Y</update>
  1136 + </value>
  1137 + <value>
  1138 + <name>zdz_name</name>
  1139 + <rename>zdzname</rename>
  1140 + <update>Y</update>
  1141 + </value>
  1142 + <value>
  1143 + <name>ists</name>
  1144 + <rename>ists</rename>
  1145 + <update>Y</update>
  1146 + </value>
  1147 + <value>
  1148 + <name>line_version</name>
  1149 + <rename>version</rename>
  1150 + <update>Y</update>
  1151 + </value>
  1152 + </lookup>
  1153 + <cluster_schema/>
  1154 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1155 + <xloc>143</xloc>
  1156 + <yloc>860</yloc>
  1157 + <draw>Y</draw>
  1158 + </GUI>
  1159 + </step>
  1160 +
  1161 + <step>
  1162 + <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</name>
  1163 + <type>InsertUpdate</type>
  1164 + <description/>
  1165 + <distribute>Y</distribute>
  1166 + <custom_distribution/>
  1167 + <copies>1</copies>
  1168 + <partitioning>
  1169 + <method>none</method>
  1170 + <schema_name/>
  1171 + </partitioning>
  1172 + <connection>bus_control_variable</connection>
  1173 + <commit>100</commit>
  1174 + <update_bypassed>N</update_bypassed>
  1175 + <lookup>
  1176 + <schema/>
  1177 + <table>bsth_c_s_ttinfo_detail</table>
  1178 + <key>
  1179 + <name>xlid</name>
  1180 + <field>xl</field>
  1181 + <condition>&#x3d;</condition>
  1182 + <name2/>
  1183 + </key>
  1184 + <key>
  1185 + <name>ttid</name>
  1186 + <field>ttinfo</field>
  1187 + <condition>&#x3d;</condition>
  1188 + <name2/>
  1189 + </key>
  1190 + <key>
  1191 + <name>lpid</name>
  1192 + <field>lp</field>
  1193 + <condition>&#x3d;</condition>
  1194 + <name2/>
  1195 + </key>
  1196 + <key>
  1197 + <name>fcno</name>
  1198 + <field>fcno</field>
  1199 + <condition>&#x3d;</condition>
  1200 + <name2/>
  1201 + </key>
  1202 + <key>
  1203 + <name>bcs</name>
  1204 + <field>bcs</field>
  1205 + <condition>&#x3d;</condition>
  1206 + <name2/>
  1207 + </key>
  1208 + <value>
  1209 + <name>tcc</name>
  1210 + <rename>qdzid</rename>
  1211 + <update>Y</update>
  1212 + </value>
  1213 + <value>
  1214 + <name>zdz</name>
  1215 + <rename>zdzid</rename>
  1216 + <update>Y</update>
  1217 + </value>
  1218 + <value>
  1219 + <name>xl</name>
  1220 + <rename>xlid</rename>
  1221 + <update>Y</update>
  1222 + </value>
  1223 + <value>
  1224 + <name>ttinfo</name>
  1225 + <rename>ttid</rename>
  1226 + <update>Y</update>
  1227 + </value>
  1228 + <value>
  1229 + <name>xl_dir</name>
  1230 + <rename>sxx</rename>
  1231 + <update>Y</update>
  1232 + </value>
  1233 + <value>
  1234 + <name>lp</name>
  1235 + <rename>lpid</rename>
  1236 + <update>Y</update>
  1237 + </value>
  1238 + <value>
  1239 + <name>jhlc</name>
  1240 + <rename>out_mileage</rename>
  1241 + <update>Y</update>
  1242 + </value>
  1243 + <value>
  1244 + <name>fcsj</name>
  1245 + <rename>sendtime_calcu</rename>
  1246 + <update>Y</update>
  1247 + </value>
  1248 + <value>
  1249 + <name>bcsj</name>
  1250 + <rename>out_time</rename>
  1251 + <update>Y</update>
  1252 + </value>
  1253 + <value>
  1254 + <name>bcs</name>
  1255 + <rename>bcs</rename>
  1256 + <update>Y</update>
  1257 + </value>
  1258 + <value>
  1259 + <name>fcno</name>
  1260 + <rename>fcno</rename>
  1261 + <update>Y</update>
  1262 + </value>
  1263 + <value>
  1264 + <name>bc_type</name>
  1265 + <rename>bctype_code</rename>
  1266 + <update>Y</update>
  1267 + </value>
  1268 + <value>
  1269 + <name>isfb</name>
  1270 + <rename>isfb</rename>
  1271 + <update>Y</update>
  1272 + </value>
  1273 + <value>
  1274 + <name>qdz_code</name>
  1275 + <rename>qdzcode</rename>
  1276 + <update>Y</update>
  1277 + </value>
  1278 + <value>
  1279 + <name>qdz_name</name>
  1280 + <rename>tn</rename>
  1281 + <update>Y</update>
  1282 + </value>
  1283 + <value>
  1284 + <name>zdz_code</name>
  1285 + <rename>zdzcode</rename>
  1286 + <update>Y</update>
  1287 + </value>
  1288 + <value>
  1289 + <name>zdz_name</name>
  1290 + <rename>zdzname_</rename>
  1291 + <update>Y</update>
  1292 + </value>
  1293 + <value>
  1294 + <name>ists</name>
  1295 + <rename>ists</rename>
  1296 + <update>Y</update>
  1297 + </value>
  1298 + <value>
  1299 + <name>line_version</name>
  1300 + <rename>version</rename>
  1301 + <update>Y</update>
  1302 + </value>
  1303 + </lookup>
  1304 + <cluster_schema/>
  1305 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1306 + <xloc>340</xloc>
  1307 + <yloc>1087</yloc>
  1308 + <draw>Y</draw>
  1309 + </GUI>
  1310 + </step>
  1311 +
  1312 + <step>
  1313 + <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</name>
  1314 + <type>InsertUpdate</type>
  1315 + <description/>
  1316 + <distribute>Y</distribute>
  1317 + <custom_distribution/>
  1318 + <copies>1</copies>
  1319 + <partitioning>
  1320 + <method>none</method>
  1321 + <schema_name/>
  1322 + </partitioning>
  1323 + <connection>bus_control_variable</connection>
  1324 + <commit>100</commit>
  1325 + <update_bypassed>N</update_bypassed>
  1326 + <lookup>
  1327 + <schema/>
  1328 + <table>bsth_c_s_ttinfo_detail</table>
  1329 + <key>
  1330 + <name>xlid</name>
  1331 + <field>xl</field>
  1332 + <condition>&#x3d;</condition>
  1333 + <name2/>
  1334 + </key>
  1335 + <key>
  1336 + <name>ttid</name>
  1337 + <field>ttinfo</field>
  1338 + <condition>&#x3d;</condition>
  1339 + <name2/>
  1340 + </key>
  1341 + <key>
  1342 + <name>lpid</name>
  1343 + <field>lp</field>
  1344 + <condition>&#x3d;</condition>
  1345 + <name2/>
  1346 + </key>
  1347 + <key>
  1348 + <name>fcno</name>
  1349 + <field>fcno</field>
  1350 + <condition>&#x3d;</condition>
  1351 + <name2/>
  1352 + </key>
  1353 + <key>
  1354 + <name>bcs</name>
  1355 + <field>bcs</field>
  1356 + <condition>&#x3d;</condition>
  1357 + <name2/>
  1358 + </key>
  1359 + <value>
  1360 + <name>fcno</name>
  1361 + <rename>fcno</rename>
  1362 + <update>Y</update>
  1363 + </value>
  1364 + <value>
  1365 + <name>bcs</name>
  1366 + <rename>bcs</rename>
  1367 + <update>Y</update>
  1368 + </value>
  1369 + <value>
  1370 + <name>xl</name>
  1371 + <rename>xlid</rename>
  1372 + <update>Y</update>
  1373 + </value>
  1374 + <value>
  1375 + <name>ttinfo</name>
  1376 + <rename>ttid</rename>
  1377 + <update>Y</update>
  1378 + </value>
  1379 + <value>
  1380 + <name>lp</name>
  1381 + <rename>lpid</rename>
  1382 + <update>Y</update>
  1383 + </value>
  1384 + <value>
  1385 + <name>bc_type</name>
  1386 + <rename>bctype_code</rename>
  1387 + <update>Y</update>
  1388 + </value>
  1389 + <value>
  1390 + <name>bcsj</name>
  1391 + <rename>parade_time</rename>
  1392 + <update>Y</update>
  1393 + </value>
  1394 + <value>
  1395 + <name>jhlc</name>
  1396 + <rename>parade_mileage</rename>
  1397 + <update>Y</update>
  1398 + </value>
  1399 + <value>
  1400 + <name>fcsj</name>
  1401 + <rename>sendtime_calcu</rename>
  1402 + <update>Y</update>
  1403 + </value>
  1404 + <value>
  1405 + <name>xl_dir</name>
  1406 + <rename>sxx2</rename>
  1407 + <update>Y</update>
  1408 + </value>
  1409 + <value>
  1410 + <name>qdz</name>
  1411 + <rename>qdzid</rename>
  1412 + <update>Y</update>
  1413 + </value>
  1414 + <value>
  1415 + <name>tcc</name>
  1416 + <rename>zdzid</rename>
  1417 + <update>Y</update>
  1418 + </value>
  1419 + <value>
  1420 + <name>isfb</name>
  1421 + <rename>isfb</rename>
  1422 + <update>Y</update>
  1423 + </value>
  1424 + <value>
  1425 + <name>qdz_code</name>
  1426 + <rename>qdzcode</rename>
  1427 + <update>Y</update>
  1428 + </value>
  1429 + <value>
  1430 + <name>qdz_name</name>
  1431 + <rename>qname</rename>
  1432 + <update>Y</update>
  1433 + </value>
  1434 + <value>
  1435 + <name>zdz_code</name>
  1436 + <rename>zdzcode</rename>
  1437 + <update>Y</update>
  1438 + </value>
  1439 + <value>
  1440 + <name>zdz_name</name>
  1441 + <rename>tn</rename>
  1442 + <update>Y</update>
  1443 + </value>
  1444 + <value>
  1445 + <name>ists</name>
  1446 + <rename>ists</rename>
  1447 + <update>Y</update>
  1448 + </value>
  1449 + <value>
  1450 + <name>line_version</name>
  1451 + <rename>version</rename>
  1452 + <update>Y</update>
  1453 + </value>
  1454 + </lookup>
  1455 + <cluster_schema/>
  1456 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1457 + <xloc>845</xloc>
  1458 + <yloc>899</yloc>
  1459 + <draw>Y</draw>
  1460 + </GUI>
  1461 + </step>
  1462 +
  1463 + <step>
  1464 + <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</name>
  1465 + <type>ExcelInput</type>
  1466 + <description/>
  1467 + <distribute>N</distribute>
  1468 + <custom_distribution/>
  1469 + <copies>1</copies>
  1470 + <partitioning>
  1471 + <method>none</method>
  1472 + <schema_name/>
  1473 + </partitioning>
  1474 + <header>Y</header>
  1475 + <noempty>Y</noempty>
  1476 + <stoponempty>N</stoponempty>
  1477 + <filefield/>
  1478 + <sheetfield/>
  1479 + <sheetrownumfield/>
  1480 + <rownumfield/>
  1481 + <sheetfield/>
  1482 + <filefield/>
  1483 + <limit>0</limit>
  1484 + <encoding/>
  1485 + <add_to_result_filenames>Y</add_to_result_filenames>
  1486 + <accept_filenames>N</accept_filenames>
  1487 + <accept_field/>
  1488 + <accept_stepname/>
  1489 + <file>
  1490 + <name/>
  1491 + <filemask/>
  1492 + <exclude_filemask/>
  1493 + <file_required>N</file_required>
  1494 + <include_subfolders>N</include_subfolders>
  1495 + </file>
  1496 + <fields>
  1497 + </fields>
  1498 + <sheets>
  1499 + <sheet>
  1500 + <name/>
  1501 + <startrow>0</startrow>
  1502 + <startcol>0</startcol>
  1503 + </sheet>
  1504 + </sheets>
  1505 + <strict_types>N</strict_types>
  1506 + <error_ignored>N</error_ignored>
  1507 + <error_line_skipped>N</error_line_skipped>
  1508 + <bad_line_files_destination_directory/>
  1509 + <bad_line_files_extension>warning</bad_line_files_extension>
  1510 + <error_line_files_destination_directory/>
  1511 + <error_line_files_extension>error</error_line_files_extension>
  1512 + <line_number_files_destination_directory/>
  1513 + <line_number_files_extension>line</line_number_files_extension>
  1514 + <shortFileFieldName/>
  1515 + <pathFieldName/>
  1516 + <hiddenFieldName/>
  1517 + <lastModificationTimeFieldName/>
  1518 + <uriNameFieldName/>
  1519 + <rootUriNameFieldName/>
  1520 + <extensionFieldName/>
  1521 + <sizeFieldName/>
  1522 + <spreadsheet_type>JXL</spreadsheet_type>
  1523 + <cluster_schema/>
  1524 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1525 + <xloc>112</xloc>
  1526 + <yloc>44</yloc>
  1527 + <draw>Y</draw>
  1528 + </GUI>
  1529 + </step>
  1530 +
  1531 + <step>
  1532 + <name>&#x66f4;&#x65b0;&#x65f6;&#x523b;&#x8868;&#x4e3b;&#x8868;&#x7248;&#x672c;</name>
  1533 + <type>Update</type>
  1534 + <description/>
  1535 + <distribute>Y</distribute>
  1536 + <custom_distribution/>
  1537 + <copies>1</copies>
  1538 + <partitioning>
  1539 + <method>none</method>
  1540 + <schema_name/>
  1541 + </partitioning>
  1542 + <connection>bus_control_variable</connection>
  1543 + <skip_lookup>N</skip_lookup>
  1544 + <commit>100</commit>
  1545 + <use_batch>N</use_batch>
  1546 + <error_ignored>N</error_ignored>
  1547 + <ignore_flag_field/>
  1548 + <lookup>
  1549 + <schema/>
  1550 + <table>bsth_c_s_ttinfo</table>
  1551 + <key>
  1552 + <name>ttid</name>
  1553 + <field>id</field>
  1554 + <condition>&#x3d;</condition>
  1555 + <name2/>
  1556 + </key>
  1557 + <value>
  1558 + <name>line_version</name>
  1559 + <rename>version</rename>
  1560 + </value>
  1561 + </lookup>
  1562 + <cluster_schema/>
  1563 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1564 + <xloc>863</xloc>
  1565 + <yloc>338</yloc>
  1566 + <draw>Y</draw>
  1567 + </GUI>
  1568 + </step>
  1569 +
  1570 + <step>
  1571 + <name>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;1</name>
  1572 + <type>DBLookup</type>
  1573 + <description/>
  1574 + <distribute>Y</distribute>
  1575 + <custom_distribution/>
  1576 + <copies>1</copies>
  1577 + <partitioning>
  1578 + <method>none</method>
  1579 + <schema_name/>
  1580 + </partitioning>
  1581 + <connection>bus_control_variable</connection>
  1582 + <cache>N</cache>
  1583 + <cache_load_all>N</cache_load_all>
  1584 + <cache_size>0</cache_size>
  1585 + <lookup>
  1586 + <schema/>
  1587 + <table>bsth_c_car_park</table>
  1588 + <orderby/>
  1589 + <fail_on_multiple>N</fail_on_multiple>
  1590 + <eat_row_on_failure>N</eat_row_on_failure>
  1591 + <key>
  1592 + <name>tccname_</name>
  1593 + <field>park_name</field>
  1594 + <condition>&#x3d;</condition>
  1595 + <name2/>
  1596 + </key>
  1597 + <value>
  1598 + <name>id</name>
  1599 + <rename>qdzid</rename>
  1600 + <default/>
  1601 + <type>Integer</type>
  1602 + </value>
  1603 + <value>
  1604 + <name>park_code</name>
  1605 + <rename>qdzcode</rename>
  1606 + <default/>
  1607 + <type>String</type>
  1608 + </value>
  1609 + <value>
  1610 + <name>park_name</name>
  1611 + <rename>tn</rename>
  1612 + <default/>
  1613 + <type>String</type>
  1614 + </value>
  1615 + </lookup>
  1616 + <cluster_schema/>
  1617 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1618 + <xloc>755</xloc>
  1619 + <yloc>504</yloc>
  1620 + <draw>Y</draw>
  1621 + </GUI>
  1622 + </step>
  1623 +
  1624 + <step>
  1625 + <name>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;2</name>
  1626 + <type>DBLookup</type>
  1627 + <description/>
  1628 + <distribute>Y</distribute>
  1629 + <custom_distribution/>
  1630 + <copies>1</copies>
  1631 + <partitioning>
  1632 + <method>none</method>
  1633 + <schema_name/>
  1634 + </partitioning>
  1635 + <connection>bus_control_variable</connection>
  1636 + <cache>N</cache>
  1637 + <cache_load_all>N</cache_load_all>
  1638 + <cache_size>0</cache_size>
  1639 + <lookup>
  1640 + <schema/>
  1641 + <table>bsth_c_car_park</table>
  1642 + <orderby/>
  1643 + <fail_on_multiple>N</fail_on_multiple>
  1644 + <eat_row_on_failure>N</eat_row_on_failure>
  1645 + <key>
  1646 + <name>tccname_</name>
  1647 + <field>park_name</field>
  1648 + <condition>&#x3d;</condition>
  1649 + <name2/>
  1650 + </key>
  1651 + <value>
  1652 + <name>id</name>
  1653 + <rename>zdzid</rename>
  1654 + <default/>
  1655 + <type>Integer</type>
  1656 + </value>
  1657 + <value>
  1658 + <name>park_code</name>
  1659 + <rename>zdzcode</rename>
  1660 + <default/>
  1661 + <type>String</type>
  1662 + </value>
  1663 + <value>
  1664 + <name>park_name</name>
  1665 + <rename>tn</rename>
  1666 + <default/>
  1667 + <type>String</type>
  1668 + </value>
  1669 + </lookup>
  1670 + <cluster_schema/>
  1671 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1672 + <xloc>887</xloc>
  1673 + <yloc>608</yloc>
  1674 + <draw>Y</draw>
  1675 + </GUI>
  1676 + </step>
  1677 +
  1678 + <step>
  1679 + <name>&#x67e5;&#x627e;&#x51fa;&#x573a;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</name>
  1680 + <type>DBLookup</type>
  1681 + <description/>
  1682 + <distribute>Y</distribute>
  1683 + <custom_distribution/>
  1684 + <copies>1</copies>
  1685 + <partitioning>
  1686 + <method>none</method>
  1687 + <schema_name/>
  1688 + </partitioning>
  1689 + <connection>bus_control_variable</connection>
  1690 + <cache>N</cache>
  1691 + <cache_load_all>N</cache_load_all>
  1692 + <cache_size>0</cache_size>
  1693 + <lookup>
  1694 + <schema/>
  1695 + <table>bsth_c_ls_stationroute</table>
  1696 + <orderby/>
  1697 + <fail_on_multiple>N</fail_on_multiple>
  1698 + <eat_row_on_failure>N</eat_row_on_failure>
  1699 + <key>
  1700 + <name>xlid</name>
  1701 + <field>line</field>
  1702 + <condition>&#x3d;</condition>
  1703 + <name2/>
  1704 + </key>
  1705 + <key>
  1706 + <name>version</name>
  1707 + <field>versions</field>
  1708 + <condition>&#x3d;</condition>
  1709 + <name2/>
  1710 + </key>
  1711 + <key>
  1712 + <name>zdzname</name>
  1713 + <field>station_name</field>
  1714 + <condition>LIKE</condition>
  1715 + <name2/>
  1716 + </key>
  1717 + <key>
  1718 + <name>endZdtype</name>
  1719 + <field>station_mark</field>
  1720 + <condition>&#x3d;</condition>
  1721 + <name2/>
  1722 + </key>
  1723 + <key>
  1724 + <name>destory</name>
  1725 + <field>destroy</field>
  1726 + <condition>&#x3d;</condition>
  1727 + <name2/>
  1728 + </key>
  1729 + <value>
  1730 + <name>station</name>
  1731 + <rename>zdzid</rename>
  1732 + <default/>
  1733 + <type>Integer</type>
  1734 + </value>
  1735 + <value>
  1736 + <name>directions</name>
  1737 + <rename>sxx</rename>
  1738 + <default/>
  1739 + <type>Integer</type>
  1740 + </value>
  1741 + <value>
  1742 + <name>station_code</name>
  1743 + <rename>zdzcode</rename>
  1744 + <default/>
  1745 + <type>String</type>
  1746 + </value>
  1747 + <value>
  1748 + <name>station_name</name>
  1749 + <rename>zdzname_</rename>
  1750 + <default/>
  1751 + <type>String</type>
  1752 + </value>
  1753 + </lookup>
  1754 + <cluster_schema/>
  1755 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1756 + <xloc>329</xloc>
  1757 + <yloc>505</yloc>
  1758 + <draw>Y</draw>
  1759 + </GUI>
  1760 + </step>
  1761 +
  1762 + <step>
  1763 + <name>&#x67e5;&#x627e;&#x6240;&#x6709;&#x7ebf;&#x8def;&#x4e0a;&#x4e0b;&#x884c;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
  1764 + <type>DBLookup</type>
  1765 + <description/>
  1766 + <distribute>Y</distribute>
  1767 + <custom_distribution/>
  1768 + <copies>1</copies>
  1769 + <partitioning>
  1770 + <method>none</method>
  1771 + <schema_name/>
  1772 + </partitioning>
  1773 + <connection>bus_control_variable</connection>
  1774 + <cache>N</cache>
  1775 + <cache_load_all>N</cache_load_all>
  1776 + <cache_size>0</cache_size>
  1777 + <lookup>
  1778 + <schema/>
  1779 + <table>bsth_c_line_information</table>
  1780 + <orderby/>
  1781 + <fail_on_multiple>N</fail_on_multiple>
  1782 + <eat_row_on_failure>N</eat_row_on_failure>
  1783 + <key>
  1784 + <name>xlid</name>
  1785 + <field>line</field>
  1786 + <condition>&#x3d;</condition>
  1787 + <name2/>
  1788 + </key>
  1789 + <value>
  1790 + <name>up_mileage</name>
  1791 + <rename>up_mileage</rename>
  1792 + <default/>
  1793 + <type>Number</type>
  1794 + </value>
  1795 + <value>
  1796 + <name>down_mileage</name>
  1797 + <rename>down_mileage</rename>
  1798 + <default/>
  1799 + <type>Number</type>
  1800 + </value>
  1801 + <value>
  1802 + <name>up_travel_time</name>
  1803 + <rename>up_travel_time</rename>
  1804 + <default/>
  1805 + <type>Number</type>
  1806 + </value>
  1807 + <value>
  1808 + <name>down_travel_time</name>
  1809 + <rename>down_travel_time</rename>
  1810 + <default/>
  1811 + <type>Number</type>
  1812 + </value>
  1813 + <value>
  1814 + <name>early_start_time</name>
  1815 + <rename>early_start_time</rename>
  1816 + <default/>
  1817 + <type>String</type>
  1818 + </value>
  1819 + <value>
  1820 + <name>early_end_time</name>
  1821 + <rename>early_end_time</rename>
  1822 + <default/>
  1823 + <type>String</type>
  1824 + </value>
  1825 + <value>
  1826 + <name>early_up_time</name>
  1827 + <rename>early_up_time</rename>
  1828 + <default/>
  1829 + <type>Number</type>
  1830 + </value>
  1831 + <value>
  1832 + <name>early_down_time</name>
  1833 + <rename>early_down_time</rename>
  1834 + <default/>
  1835 + <type>Number</type>
  1836 + </value>
  1837 + <value>
  1838 + <name>late_start_time</name>
  1839 + <rename>late_start_time</rename>
  1840 + <default/>
  1841 + <type>String</type>
  1842 + </value>
  1843 + <value>
  1844 + <name>late_end_time</name>
  1845 + <rename>late_end_time</rename>
  1846 + <default/>
  1847 + <type>String</type>
  1848 + </value>
  1849 + <value>
  1850 + <name>late_up_time</name>
  1851 + <rename>late_up_time</rename>
  1852 + <default/>
  1853 + <type>Number</type>
  1854 + </value>
  1855 + <value>
  1856 + <name>late_down_time</name>
  1857 + <rename>late_down_time</rename>
  1858 + <default/>
  1859 + <type>Number</type>
  1860 + </value>
  1861 + </lookup>
  1862 + <cluster_schema/>
  1863 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1864 + <xloc>149</xloc>
  1865 + <yloc>581</yloc>
  1866 + <draw>Y</draw>
  1867 + </GUI>
  1868 + </step>
  1869 +
  1870 + <step>
  1871 + <name>&#x67e5;&#x627e;&#x65f6;&#x523b;&#x8868;&#x57fa;&#x7840;&#x4fe1;&#x606f;&#x5173;&#x8054;</name>
  1872 + <type>DBLookup</type>
  1873 + <description/>
  1874 + <distribute>Y</distribute>
  1875 + <custom_distribution/>
  1876 + <copies>1</copies>
  1877 + <partitioning>
  1878 + <method>none</method>
  1879 + <schema_name/>
  1880 + </partitioning>
  1881 + <connection>bus_control_variable</connection>
  1882 + <cache>N</cache>
  1883 + <cache_load_all>N</cache_load_all>
  1884 + <cache_size>0</cache_size>
  1885 + <lookup>
  1886 + <schema/>
  1887 + <table>bsth_c_s_ttinfo</table>
  1888 + <orderby/>
  1889 + <fail_on_multiple>N</fail_on_multiple>
  1890 + <eat_row_on_failure>N</eat_row_on_failure>
  1891 + <key>
  1892 + <name>xlid</name>
  1893 + <field>xl</field>
  1894 + <condition>&#x3d;</condition>
  1895 + <name2/>
  1896 + </key>
  1897 + <key>
  1898 + <name>ttinfoname_</name>
  1899 + <field>name</field>
  1900 + <condition>&#x3d;</condition>
  1901 + <name2/>
  1902 + </key>
  1903 + <key>
  1904 + <name>iscanceled</name>
  1905 + <field>is_cancel</field>
  1906 + <condition>&#x3d;</condition>
  1907 + <name2/>
  1908 + </key>
  1909 + <value>
  1910 + <name>id</name>
  1911 + <rename>ttid</rename>
  1912 + <default/>
  1913 + <type>Integer</type>
  1914 + </value>
  1915 + </lookup>
  1916 + <cluster_schema/>
  1917 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1918 + <xloc>1011</xloc>
  1919 + <yloc>134</yloc>
  1920 + <draw>Y</draw>
  1921 + </GUI>
  1922 + </step>
  1923 +
  1924 + <step>
  1925 + <name>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x5173;&#x8054;</name>
  1926 + <type>DBLookup</type>
  1927 + <description/>
  1928 + <distribute>Y</distribute>
  1929 + <custom_distribution/>
  1930 + <copies>1</copies>
  1931 + <partitioning>
  1932 + <method>none</method>
  1933 + <schema_name/>
  1934 + </partitioning>
  1935 + <connection>bus_control_variable</connection>
  1936 + <cache>N</cache>
  1937 + <cache_load_all>N</cache_load_all>
  1938 + <cache_size>0</cache_size>
  1939 + <lookup>
  1940 + <schema/>
  1941 + <table>bsth_c_line</table>
  1942 + <orderby/>
  1943 + <fail_on_multiple>N</fail_on_multiple>
  1944 + <eat_row_on_failure>N</eat_row_on_failure>
  1945 + <key>
  1946 + <name>xlname_</name>
  1947 + <field>name</field>
  1948 + <condition>&#x3d;</condition>
  1949 + <name2/>
  1950 + </key>
  1951 + <key>
  1952 + <name>iscanceled</name>
  1953 + <field>destroy</field>
  1954 + <condition>&#x3d;</condition>
  1955 + <name2/>
  1956 + </key>
  1957 + <value>
  1958 + <name>id</name>
  1959 + <rename>xlid</rename>
  1960 + <default/>
  1961 + <type>Integer</type>
  1962 + </value>
  1963 + </lookup>
  1964 + <cluster_schema/>
  1965 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1966 + <xloc>1007</xloc>
  1967 + <yloc>43</yloc>
  1968 + <draw>Y</draw>
  1969 + </GUI>
  1970 + </step>
  1971 +
  1972 + <step>
  1973 + <name>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
  1974 + <type>DBLookup</type>
  1975 + <description/>
  1976 + <distribute>Y</distribute>
  1977 + <custom_distribution/>
  1978 + <copies>1</copies>
  1979 + <partitioning>
  1980 + <method>none</method>
  1981 + <schema_name/>
  1982 + </partitioning>
  1983 + <connection>bus_control_variable</connection>
  1984 + <cache>N</cache>
  1985 + <cache_load_all>N</cache_load_all>
  1986 + <cache_size>0</cache_size>
  1987 + <lookup>
  1988 + <schema/>
  1989 + <table>bsth_c_line_information</table>
  1990 + <orderby/>
  1991 + <fail_on_multiple>N</fail_on_multiple>
  1992 + <eat_row_on_failure>N</eat_row_on_failure>
  1993 + <key>
  1994 + <name>xlid</name>
  1995 + <field>line</field>
  1996 + <condition>&#x3d;</condition>
  1997 + <name2/>
  1998 + </key>
  1999 + <value>
  2000 + <name>up_out_timer</name>
  2001 + <rename>up_out_timer</rename>
  2002 + <default/>
  2003 + <type>Number</type>
  2004 + </value>
  2005 + <value>
  2006 + <name>up_out_mileage</name>
  2007 + <rename>up_out_mileage</rename>
  2008 + <default/>
  2009 + <type>Number</type>
  2010 + </value>
  2011 + <value>
  2012 + <name>down_out_timer</name>
  2013 + <rename>down_out_timer</rename>
  2014 + <default/>
  2015 + <type>Number</type>
  2016 + </value>
  2017 + <value>
  2018 + <name>down_out_mileage</name>
  2019 + <rename>down_out_mileage</rename>
  2020 + <default/>
  2021 + <type>Number</type>
  2022 + </value>
  2023 + </lookup>
  2024 + <cluster_schema/>
  2025 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2026 + <xloc>335</xloc>
  2027 + <yloc>763</yloc>
  2028 + <draw>Y</draw>
  2029 + </GUI>
  2030 + </step>
  2031 +
  2032 + <step>
  2033 + <name>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</name>
  2034 + <type>DBLookup</type>
  2035 + <description/>
  2036 + <distribute>Y</distribute>
  2037 + <custom_distribution/>
  2038 + <copies>1</copies>
  2039 + <partitioning>
  2040 + <method>none</method>
  2041 + <schema_name/>
  2042 + </partitioning>
  2043 + <connection>bus_control_variable</connection>
  2044 + <cache>N</cache>
  2045 + <cache_load_all>N</cache_load_all>
  2046 + <cache_size>0</cache_size>
  2047 + <lookup>
  2048 + <schema/>
  2049 + <table>bsth_c_line_information</table>
  2050 + <orderby/>
  2051 + <fail_on_multiple>N</fail_on_multiple>
  2052 + <eat_row_on_failure>N</eat_row_on_failure>
  2053 + <key>
  2054 + <name>xlid</name>
  2055 + <field>line</field>
  2056 + <condition>&#x3d;</condition>
  2057 + <name2/>
  2058 + </key>
  2059 + <value>
  2060 + <name>up_in_mileage</name>
  2061 + <rename>up_in_mileage</rename>
  2062 + <default/>
  2063 + <type>Number</type>
  2064 + </value>
  2065 + <value>
  2066 + <name>up_in_timer</name>
  2067 + <rename>up_in_timer</rename>
  2068 + <default/>
  2069 + <type>Number</type>
  2070 + </value>
  2071 + <value>
  2072 + <name>down_in_mileage</name>
  2073 + <rename>down_in_mileage</rename>
  2074 + <default/>
  2075 + <type>Number</type>
  2076 + </value>
  2077 + <value>
  2078 + <name>down_in_timer</name>
  2079 + <rename>down_in_timer</rename>
  2080 + <default/>
  2081 + <type>Number</type>
  2082 + </value>
  2083 + </lookup>
  2084 + <cluster_schema/>
  2085 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2086 + <xloc>553</xloc>
  2087 + <yloc>1004</yloc>
  2088 + <draw>Y</draw>
  2089 + </GUI>
  2090 + </step>
  2091 +
  2092 + <step>
  2093 + <name>&#x67e5;&#x627e;&#x7ec8;&#x70b9;&#x7ad9;&#x5173;&#x8054;</name>
  2094 + <type>DBLookup</type>
  2095 + <description/>
  2096 + <distribute>Y</distribute>
  2097 + <custom_distribution/>
  2098 + <copies>1</copies>
  2099 + <partitioning>
  2100 + <method>none</method>
  2101 + <schema_name/>
  2102 + </partitioning>
  2103 + <connection>bus_control_variable</connection>
  2104 + <cache>N</cache>
  2105 + <cache_load_all>N</cache_load_all>
  2106 + <cache_size>0</cache_size>
  2107 + <lookup>
  2108 + <schema/>
  2109 + <table>bsth_c_ls_stationroute</table>
  2110 + <orderby/>
  2111 + <fail_on_multiple>N</fail_on_multiple>
  2112 + <eat_row_on_failure>N</eat_row_on_failure>
  2113 + <key>
  2114 + <name>xlid</name>
  2115 + <field>line</field>
  2116 + <condition>&#x3d;</condition>
  2117 + <name2/>
  2118 + </key>
  2119 + <key>
  2120 + <name>version</name>
  2121 + <field>versions</field>
  2122 + <condition>&#x3d;</condition>
  2123 + <name2/>
  2124 + </key>
  2125 + <key>
  2126 + <name>sxx</name>
  2127 + <field>directions</field>
  2128 + <condition>&#x3d;</condition>
  2129 + <name2/>
  2130 + </key>
  2131 + <key>
  2132 + <name>endZdtype</name>
  2133 + <field>station_mark</field>
  2134 + <condition>&#x3d;</condition>
  2135 + <name2/>
  2136 + </key>
  2137 + <key>
  2138 + <name>destory</name>
  2139 + <field>destroy</field>
  2140 + <condition>&#x3d;</condition>
  2141 + <name2/>
  2142 + </key>
  2143 + <value>
  2144 + <name>station_name</name>
  2145 + <rename>zdzname</rename>
  2146 + <default/>
  2147 + <type>String</type>
  2148 + </value>
  2149 + <value>
  2150 + <name>station</name>
  2151 + <rename>zdzid</rename>
  2152 + <default/>
  2153 + <type>Integer</type>
  2154 + </value>
  2155 + <value>
  2156 + <name>station_code</name>
  2157 + <rename>zdzcode</rename>
  2158 + <default/>
  2159 + <type>String</type>
  2160 + </value>
  2161 + </lookup>
  2162 + <cluster_schema/>
  2163 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2164 + <xloc>280</xloc>
  2165 + <yloc>404</yloc>
  2166 + <draw>Y</draw>
  2167 + </GUI>
  2168 + </step>
  2169 +
  2170 + <step>
  2171 + <name>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x5e76;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</name>
  2172 + <type>DBLookup</type>
  2173 + <description/>
  2174 + <distribute>Y</distribute>
  2175 + <custom_distribution/>
  2176 + <copies>1</copies>
  2177 + <partitioning>
  2178 + <method>none</method>
  2179 + <schema_name/>
  2180 + </partitioning>
  2181 + <connection>bus_control_variable</connection>
  2182 + <cache>N</cache>
  2183 + <cache_load_all>N</cache_load_all>
  2184 + <cache_size>0</cache_size>
  2185 + <lookup>
  2186 + <schema/>
  2187 + <table>bsth_c_ls_stationroute</table>
  2188 + <orderby/>
  2189 + <fail_on_multiple>N</fail_on_multiple>
  2190 + <eat_row_on_failure>N</eat_row_on_failure>
  2191 + <key>
  2192 + <name>xlid</name>
  2193 + <field>line</field>
  2194 + <condition>&#x3d;</condition>
  2195 + <name2/>
  2196 + </key>
  2197 + <key>
  2198 + <name>version</name>
  2199 + <field>versions</field>
  2200 + <condition>&#x3d;</condition>
  2201 + <name2/>
  2202 + </key>
  2203 + <key>
  2204 + <name>qdzname</name>
  2205 + <field>station_name</field>
  2206 + <condition>LIKE</condition>
  2207 + <name2/>
  2208 + </key>
  2209 + <key>
  2210 + <name>sendZdtype</name>
  2211 + <field>station_mark</field>
  2212 + <condition>&#x3d;</condition>
  2213 + <name2/>
  2214 + </key>
  2215 + <key>
  2216 + <name>destory</name>
  2217 + <field>destroy</field>
  2218 + <condition>&#x3d;</condition>
  2219 + <name2/>
  2220 + </key>
  2221 + <value>
  2222 + <name>station</name>
  2223 + <rename>qdzid</rename>
  2224 + <default/>
  2225 + <type>Integer</type>
  2226 + </value>
  2227 + <value>
  2228 + <name>directions</name>
  2229 + <rename>sxx</rename>
  2230 + <default/>
  2231 + <type>Integer</type>
  2232 + </value>
  2233 + <value>
  2234 + <name>station_code</name>
  2235 + <rename>qdzcode</rename>
  2236 + <default/>
  2237 + <type>String</type>
  2238 + </value>
  2239 + <value>
  2240 + <name>station_name</name>
  2241 + <rename>qdzname_</rename>
  2242 + <default/>
  2243 + <type>String</type>
  2244 + </value>
  2245 + </lookup>
  2246 + <cluster_schema/>
  2247 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2248 + <xloc>430</xloc>
  2249 + <yloc>403</yloc>
  2250 + <draw>Y</draw>
  2251 + </GUI>
  2252 + </step>
  2253 +
  2254 + <step>
  2255 + <name>&#x67e5;&#x627e;&#x8def;&#x724c;&#x5173;&#x8054;</name>
  2256 + <type>DBLookup</type>
  2257 + <description/>
  2258 + <distribute>Y</distribute>
  2259 + <custom_distribution/>
  2260 + <copies>1</copies>
  2261 + <partitioning>
  2262 + <method>none</method>
  2263 + <schema_name/>
  2264 + </partitioning>
  2265 + <connection>bus_control_variable</connection>
  2266 + <cache>N</cache>
  2267 + <cache_load_all>N</cache_load_all>
  2268 + <cache_size>0</cache_size>
  2269 + <lookup>
  2270 + <schema/>
  2271 + <table>bsth_c_s_gbi</table>
  2272 + <orderby/>
  2273 + <fail_on_multiple>N</fail_on_multiple>
  2274 + <eat_row_on_failure>N</eat_row_on_failure>
  2275 + <key>
  2276 + <name>xlid</name>
  2277 + <field>xl</field>
  2278 + <condition>&#x3d;</condition>
  2279 + <name2/>
  2280 + </key>
  2281 + <key>
  2282 + <name>lp</name>
  2283 + <field>lp_name</field>
  2284 + <condition>&#x3d;</condition>
  2285 + <name2/>
  2286 + </key>
  2287 + <key>
  2288 + <name>iscanceled</name>
  2289 + <field>is_cancel</field>
  2290 + <condition>&#x3d;</condition>
  2291 + <name2/>
  2292 + </key>
  2293 + <value>
  2294 + <name>id</name>
  2295 + <rename>lpid</rename>
  2296 + <default/>
  2297 + <type>Integer</type>
  2298 + </value>
  2299 + </lookup>
  2300 + <cluster_schema/>
  2301 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2302 + <xloc>1013</xloc>
  2303 + <yloc>221</yloc>
  2304 + <draw>Y</draw>
  2305 + </GUI>
  2306 + </step>
  2307 +
  2308 + <step>
  2309 + <name>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ebf;&#x8def;&#x65b9;&#x5411;</name>
  2310 + <type>DBLookup</type>
  2311 + <description/>
  2312 + <distribute>Y</distribute>
  2313 + <custom_distribution/>
  2314 + <copies>1</copies>
  2315 + <partitioning>
  2316 + <method>none</method>
  2317 + <schema_name/>
  2318 + </partitioning>
  2319 + <connection>bus_control_variable</connection>
  2320 + <cache>N</cache>
  2321 + <cache_load_all>N</cache_load_all>
  2322 + <cache_size>0</cache_size>
  2323 + <lookup>
  2324 + <schema/>
  2325 + <table>bsth_c_ls_stationroute</table>
  2326 + <orderby/>
  2327 + <fail_on_multiple>N</fail_on_multiple>
  2328 + <eat_row_on_failure>N</eat_row_on_failure>
  2329 + <key>
  2330 + <name>xlid</name>
  2331 + <field>line</field>
  2332 + <condition>&#x3d;</condition>
  2333 + <name2/>
  2334 + </key>
  2335 + <key>
  2336 + <name>version</name>
  2337 + <field>versions</field>
  2338 + <condition>&#x3d;</condition>
  2339 + <name2/>
  2340 + </key>
  2341 + <key>
  2342 + <name>startZdtype_calcu</name>
  2343 + <field>station_mark</field>
  2344 + <condition>&#x3d;</condition>
  2345 + <name2/>
  2346 + </key>
  2347 + <key>
  2348 + <name>qdzname_calcu</name>
  2349 + <field>station_name</field>
  2350 + <condition>LIKE</condition>
  2351 + <name2/>
  2352 + </key>
  2353 + <key>
  2354 + <name>destory</name>
  2355 + <field>destroy</field>
  2356 + <condition>&#x3d;</condition>
  2357 + <name2/>
  2358 + </key>
  2359 + <value>
  2360 + <name>directions</name>
  2361 + <rename>sxx</rename>
  2362 + <default/>
  2363 + <type>String</type>
  2364 + </value>
  2365 + </lookup>
  2366 + <cluster_schema/>
  2367 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2368 + <xloc>548</xloc>
  2369 + <yloc>610</yloc>
  2370 + <draw>Y</draw>
  2371 + </GUI>
  2372 + </step>
  2373 +
  2374 + <step>
  2375 + <name>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</name>
  2376 + <type>DBLookup</type>
  2377 + <description/>
  2378 + <distribute>Y</distribute>
  2379 + <custom_distribution/>
  2380 + <copies>1</copies>
  2381 + <partitioning>
  2382 + <method>none</method>
  2383 + <schema_name/>
  2384 + </partitioning>
  2385 + <connection>bus_control_variable</connection>
  2386 + <cache>N</cache>
  2387 + <cache_load_all>Y</cache_load_all>
  2388 + <cache_size>0</cache_size>
  2389 + <lookup>
  2390 + <schema/>
  2391 + <table>bsth_c_ls_stationroute</table>
  2392 + <orderby/>
  2393 + <fail_on_multiple>N</fail_on_multiple>
  2394 + <eat_row_on_failure>N</eat_row_on_failure>
  2395 + <key>
  2396 + <name>xlid</name>
  2397 + <field>line</field>
  2398 + <condition>&#x3d;</condition>
  2399 + <name2/>
  2400 + </key>
  2401 + <key>
  2402 + <name>version</name>
  2403 + <field>versions</field>
  2404 + <condition>&#x3d;</condition>
  2405 + <name2/>
  2406 + </key>
  2407 + <key>
  2408 + <name>endZdtype_calcu</name>
  2409 + <field>station_mark</field>
  2410 + <condition>&#x3d;</condition>
  2411 + <name2/>
  2412 + </key>
  2413 + <key>
  2414 + <name>sxx</name>
  2415 + <field>directions</field>
  2416 + <condition>&#x3d;</condition>
  2417 + <name2/>
  2418 + </key>
  2419 + <key>
  2420 + <name>destory</name>
  2421 + <field>destroy</field>
  2422 + <condition>&#x3d;</condition>
  2423 + <name2/>
  2424 + </key>
  2425 + <value>
  2426 + <name>station_name</name>
  2427 + <rename>zdzname_calcu</rename>
  2428 + <default/>
  2429 + <type>Integer</type>
  2430 + </value>
  2431 + </lookup>
  2432 + <cluster_schema/>
  2433 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2434 + <xloc>550</xloc>
  2435 + <yloc>701</yloc>
  2436 + <draw>Y</draw>
  2437 + </GUI>
  2438 + </step>
  2439 +
  2440 + <step>
  2441 + <name>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</name>
  2442 + <type>DBLookup</type>
  2443 + <description/>
  2444 + <distribute>Y</distribute>
  2445 + <custom_distribution/>
  2446 + <copies>1</copies>
  2447 + <partitioning>
  2448 + <method>none</method>
  2449 + <schema_name/>
  2450 + </partitioning>
  2451 + <connection>bus_control_variable</connection>
  2452 + <cache>N</cache>
  2453 + <cache_load_all>N</cache_load_all>
  2454 + <cache_size>0</cache_size>
  2455 + <lookup>
  2456 + <schema/>
  2457 + <table>bsth_c_ls_stationroute</table>
  2458 + <orderby/>
  2459 + <fail_on_multiple>N</fail_on_multiple>
  2460 + <eat_row_on_failure>N</eat_row_on_failure>
  2461 + <key>
  2462 + <name>xlid</name>
  2463 + <field>line</field>
  2464 + <condition>&#x3d;</condition>
  2465 + <name2/>
  2466 + </key>
  2467 + <key>
  2468 + <name>version</name>
  2469 + <field>versions</field>
  2470 + <condition>&#x3d;</condition>
  2471 + <name2/>
  2472 + </key>
  2473 + <key>
  2474 + <name>zdzname_calcu</name>
  2475 + <field>station_name</field>
  2476 + <condition>&#x3d;</condition>
  2477 + <name2/>
  2478 + </key>
  2479 + <key>
  2480 + <name>startZdtype_calcu</name>
  2481 + <field>station_mark</field>
  2482 + <condition>&#x3d;</condition>
  2483 + <name2/>
  2484 + </key>
  2485 + <key>
  2486 + <name>destory</name>
  2487 + <field>destroy</field>
  2488 + <condition>&#x3d;</condition>
  2489 + <name2/>
  2490 + </key>
  2491 + <value>
  2492 + <name>directions</name>
  2493 + <rename>sxx2</rename>
  2494 + <default/>
  2495 + <type>Integer</type>
  2496 + </value>
  2497 + <value>
  2498 + <name>station</name>
  2499 + <rename>qdzid</rename>
  2500 + <default/>
  2501 + <type>Integer</type>
  2502 + </value>
  2503 + <value>
  2504 + <name>station_code</name>
  2505 + <rename>qdzcode</rename>
  2506 + <default/>
  2507 + <type>String</type>
  2508 + </value>
  2509 + <value>
  2510 + <name>station_name</name>
  2511 + <rename>qname</rename>
  2512 + <default/>
  2513 + <type>String</type>
  2514 + </value>
  2515 + </lookup>
  2516 + <cluster_schema/>
  2517 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2518 + <xloc>551</xloc>
  2519 + <yloc>782</yloc>
  2520 + <draw>Y</draw>
  2521 + </GUI>
  2522 + </step>
  2523 +
  2524 + <step>
  2525 + <name>&#x6b63;&#x5e38;&#x73ed;&#x6b21;_&#x5904;&#x7406;&#x6570;&#x636e;</name>
  2526 + <type>ScriptValueMod</type>
  2527 + <description/>
  2528 + <distribute>Y</distribute>
  2529 + <custom_distribution/>
  2530 + <copies>1</copies>
  2531 + <partitioning>
  2532 + <method>none</method>
  2533 + <schema_name/>
  2534 + </partitioning>
  2535 + <compatible>N</compatible>
  2536 + <optimizationLevel>9</optimizationLevel>
  2537 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  2538 + <jsScript_name>Script 1</jsScript_name>
  2539 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var sendZdtype &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
  2540 + </jsScript> </jsScripts> <fields> <field> <name>sendZdtype</name>
  2541 + <rename>sendZdtype</rename>
  2542 + <type>String</type>
  2543 + <length>-1</length>
  2544 + <precision>-1</precision>
  2545 + <replace>N</replace>
  2546 + </field> <field> <name>endZdtype</name>
  2547 + <rename>endZdtype</rename>
  2548 + <type>String</type>
  2549 + <length>-1</length>
  2550 + <precision>-1</precision>
  2551 + <replace>N</replace>
  2552 + </field> <field> <name>destory</name>
  2553 + <rename>destory</rename>
  2554 + <type>Integer</type>
  2555 + <length>-1</length>
  2556 + <precision>-1</precision>
  2557 + <replace>N</replace>
  2558 + </field> </fields> <cluster_schema/>
  2559 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2560 + <xloc>588</xloc>
  2561 + <yloc>403</yloc>
  2562 + <draw>Y</draw>
  2563 + </GUI>
  2564 + </step>
  2565 +
  2566 + <step>
  2567 + <name>&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6570;&#x636e;</name>
  2568 + <type>Dummy</type>
  2569 + <description/>
  2570 + <distribute>Y</distribute>
  2571 + <custom_distribution/>
  2572 + <copies>1</copies>
  2573 + <partitioning>
  2574 + <method>none</method>
  2575 + <schema_name/>
  2576 + </partitioning>
  2577 + <cluster_schema/>
  2578 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2579 + <xloc>725</xloc>
  2580 + <yloc>404</yloc>
  2581 + <draw>Y</draw>
  2582 + </GUI>
  2583 + </step>
  2584 +
  2585 + <step>
  2586 + <name>&#x6dfb;&#x52a0;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;</name>
  2587 + <type>GroupBy</type>
  2588 + <description/>
  2589 + <distribute>Y</distribute>
  2590 + <custom_distribution/>
  2591 + <copies>1</copies>
  2592 + <partitioning>
  2593 + <method>none</method>
  2594 + <schema_name/>
  2595 + </partitioning>
  2596 + <all_rows>Y</all_rows>
  2597 + <ignore_aggregate>N</ignore_aggregate>
  2598 + <field_ignore/>
  2599 + <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
  2600 + <prefix>grp</prefix>
  2601 + <add_linenr>Y</add_linenr>
  2602 + <linenr_fieldname>fcno</linenr_fieldname>
  2603 + <give_back_row>N</give_back_row>
  2604 + <group>
  2605 + <field>
  2606 + <name>lp</name>
  2607 + </field>
  2608 + </group>
  2609 + <fields>
  2610 + </fields>
  2611 + <cluster_schema/>
  2612 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2613 + <xloc>442</xloc>
  2614 + <yloc>44</yloc>
  2615 + <draw>Y</draw>
  2616 + </GUI>
  2617 + </step>
  2618 +
  2619 + <step>
  2620 + <name>&#x6dfb;&#x52a0;&#x5bf9;&#x5e94;&#x73ed;&#x6b21;&#x6570;</name>
  2621 + <type>GroupBy</type>
  2622 + <description/>
  2623 + <distribute>Y</distribute>
  2624 + <custom_distribution/>
  2625 + <copies>1</copies>
  2626 + <partitioning>
  2627 + <method>none</method>
  2628 + <schema_name/>
  2629 + </partitioning>
  2630 + <all_rows>Y</all_rows>
  2631 + <ignore_aggregate>N</ignore_aggregate>
  2632 + <field_ignore/>
  2633 + <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
  2634 + <prefix>grp</prefix>
  2635 + <add_linenr>Y</add_linenr>
  2636 + <linenr_fieldname>bcs</linenr_fieldname>
  2637 + <give_back_row>N</give_back_row>
  2638 + <group>
  2639 + </group>
  2640 + <fields>
  2641 + </fields>
  2642 + <cluster_schema/>
  2643 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2644 + <xloc>553</xloc>
  2645 + <yloc>44</yloc>
  2646 + <draw>Y</draw>
  2647 + </GUI>
  2648 + </step>
  2649 +
  2650 + <step>
  2651 + <name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</name>
  2652 + <type>Normaliser</type>
  2653 + <description/>
  2654 + <distribute>Y</distribute>
  2655 + <custom_distribution/>
  2656 + <copies>1</copies>
  2657 + <partitioning>
  2658 + <method>none</method>
  2659 + <schema_name/>
  2660 + </partitioning>
  2661 + <typefield>&#x7ad9;&#x70b9;&#x540d;&#x79f0;</typefield>
  2662 + <fields> </fields> <cluster_schema/>
  2663 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2664 + <xloc>248</xloc>
  2665 + <yloc>44</yloc>
  2666 + <draw>Y</draw>
  2667 + </GUI>
  2668 + </step>
  2669 +
  2670 + <step>
  2671 + <name>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178;</name>
  2672 + <type>ValueMapper</type>
  2673 + <description/>
  2674 + <distribute>Y</distribute>
  2675 + <custom_distribution/>
  2676 + <copies>1</copies>
  2677 + <partitioning>
  2678 + <method>none</method>
  2679 + <schema_name/>
  2680 + </partitioning>
  2681 + <field_to_use>bctype</field_to_use>
  2682 + <target_field>bctype_code</target_field>
  2683 + <non_match_default>&#x672a;&#x77e5;&#x7c7b;&#x578b;</non_match_default>
  2684 + <fields>
  2685 + <field>
  2686 + <source_value>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</source_value>
  2687 + <target_value>normal</target_value>
  2688 + </field>
  2689 + <field>
  2690 + <source_value>&#x51fa;&#x573a;</source_value>
  2691 + <target_value>out</target_value>
  2692 + </field>
  2693 + <field>
  2694 + <source_value>&#x8fdb;&#x573a;</source_value>
  2695 + <target_value>in</target_value>
  2696 + </field>
  2697 + <field>
  2698 + <source_value>&#x52a0;&#x6cb9;</source_value>
  2699 + <target_value>oil</target_value>
  2700 + </field>
  2701 + <field>
  2702 + <source_value>&#x4e34;&#x52a0;</source_value>
  2703 + <target_value>temp</target_value>
  2704 + </field>
  2705 + <field>
  2706 + <source_value>&#x533a;&#x95f4;</source_value>
  2707 + <target_value>region</target_value>
  2708 + </field>
  2709 + <field>
  2710 + <source_value>&#x653e;&#x7a7a;</source_value>
  2711 + <target_value>venting</target_value>
  2712 + </field>
  2713 + <field>
  2714 + <source_value>&#x653e;&#x5927;&#x7ad9;</source_value>
  2715 + <target_value>major</target_value>
  2716 + </field>
  2717 + </fields>
  2718 + <cluster_schema/>
  2719 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2720 + <xloc>149</xloc>
  2721 + <yloc>491</yloc>
  2722 + <draw>Y</draw>
  2723 + </GUI>
  2724 + </step>
  2725 +
  2726 + <step>
  2727 + <name>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 2</name>
  2728 + <type>ValueMapper</type>
  2729 + <description/>
  2730 + <distribute>Y</distribute>
  2731 + <custom_distribution/>
  2732 + <copies>1</copies>
  2733 + <partitioning>
  2734 + <method>none</method>
  2735 + <schema_name/>
  2736 + </partitioning>
  2737 + <field_to_use>bctype</field_to_use>
  2738 + <target_field>bctype_code</target_field>
  2739 + <non_match_default>&#x672a;&#x77e5;&#x7c7b;&#x578b;</non_match_default>
  2740 + <fields>
  2741 + <field>
  2742 + <source_value>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</source_value>
  2743 + <target_value>normal</target_value>
  2744 + </field>
  2745 + <field>
  2746 + <source_value>&#x51fa;&#x573a;</source_value>
  2747 + <target_value>out</target_value>
  2748 + </field>
  2749 + <field>
  2750 + <source_value>&#x8fdb;&#x573a;</source_value>
  2751 + <target_value>in</target_value>
  2752 + </field>
  2753 + <field>
  2754 + <source_value>&#x52a0;&#x6cb9;</source_value>
  2755 + <target_value>oil</target_value>
  2756 + </field>
  2757 + <field>
  2758 + <source_value>&#x4e34;&#x52a0;</source_value>
  2759 + <target_value>temp</target_value>
  2760 + </field>
  2761 + <field>
  2762 + <source_value>&#x533a;&#x95f4;</source_value>
  2763 + <target_value>region</target_value>
  2764 + </field>
  2765 + <field>
  2766 + <source_value>&#x653e;&#x7a7a;</source_value>
  2767 + <target_value>venting</target_value>
  2768 + </field>
  2769 + <field>
  2770 + <source_value>&#x653e;&#x5927;&#x7ad9;</source_value>
  2771 + <target_value>major</target_value>
  2772 + </field>
  2773 + </fields>
  2774 + <cluster_schema/>
  2775 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2776 + <xloc>333</xloc>
  2777 + <yloc>681</yloc>
  2778 + <draw>Y</draw>
  2779 + </GUI>
  2780 + </step>
  2781 +
  2782 + <step>
  2783 + <name>&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5b57;&#x5178; 3</name>
  2784 + <type>ValueMapper</type>
  2785 + <description/>
  2786 + <distribute>Y</distribute>
  2787 + <custom_distribution/>
  2788 + <copies>1</copies>
  2789 + <partitioning>
  2790 + <method>none</method>
  2791 + <schema_name/>
  2792 + </partitioning>
  2793 + <field_to_use>bctype</field_to_use>
  2794 + <target_field>bctype_code</target_field>
  2795 + <non_match_default>&#x672a;&#x77e5;&#x7c7b;&#x578b;</non_match_default>
  2796 + <fields>
  2797 + <field>
  2798 + <source_value>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</source_value>
  2799 + <target_value>normal</target_value>
  2800 + </field>
  2801 + <field>
  2802 + <source_value>&#x51fa;&#x573a;</source_value>
  2803 + <target_value>out</target_value>
  2804 + </field>
  2805 + <field>
  2806 + <source_value>&#x8fdb;&#x573a;</source_value>
  2807 + <target_value>in</target_value>
  2808 + </field>
  2809 + <field>
  2810 + <source_value>&#x52a0;&#x6cb9;</source_value>
  2811 + <target_value>oil</target_value>
  2812 + </field>
  2813 + <field>
  2814 + <source_value>&#x4e34;&#x52a0;</source_value>
  2815 + <target_value>temp</target_value>
  2816 + </field>
  2817 + <field>
  2818 + <source_value>&#x533a;&#x95f4;</source_value>
  2819 + <target_value>region</target_value>
  2820 + </field>
  2821 + <field>
  2822 + <source_value>&#x653e;&#x7a7a;</source_value>
  2823 + <target_value>venting</target_value>
  2824 + </field>
  2825 + <field>
  2826 + <source_value>&#x653e;&#x5927;&#x7ad9;</source_value>
  2827 + <target_value>major</target_value>
  2828 + </field>
  2829 + </fields>
  2830 + <cluster_schema/>
  2831 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2832 + <xloc>551</xloc>
  2833 + <yloc>928</yloc>
  2834 + <draw>Y</draw>
  2835 + </GUI>
  2836 + </step>
  2837 +
  2838 + <step>
  2839 + <name>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</name>
  2840 + <type>SelectValues</type>
  2841 + <description/>
  2842 + <distribute>N</distribute>
  2843 + <custom_distribution/>
  2844 + <copies>1</copies>
  2845 + <partitioning>
  2846 + <method>none</method>
  2847 + <schema_name/>
  2848 + </partitioning>
  2849 + <fields> <select_unspecified>Y</select_unspecified>
  2850 + <meta> <name>zdlyversion_</name>
  2851 + <rename>version</rename>
  2852 + <type>Integer</type>
  2853 + <length>-2</length>
  2854 + <precision>-2</precision>
  2855 + <conversion_mask/>
  2856 + <date_format_lenient>false</date_format_lenient>
  2857 + <date_format_locale/>
  2858 + <date_format_timezone/>
  2859 + <lenient_string_to_number>false</lenient_string_to_number>
  2860 + <encoding/>
  2861 + <decimal_symbol/>
  2862 + <grouping_symbol/>
  2863 + <currency_symbol/>
  2864 + <storage_type/>
  2865 + </meta> </fields> <cluster_schema/>
  2866 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2867 + <xloc>1016</xloc>
  2868 + <yloc>305</yloc>
  2869 + <draw>Y</draw>
  2870 + </GUI>
  2871 + </step>
  2872 +
  2873 + <step>
  2874 + <name>&#x7c7b;&#x578b;&#x4fee;&#x6b63;</name>
  2875 + <type>SelectValues</type>
  2876 + <description/>
  2877 + <distribute>Y</distribute>
  2878 + <custom_distribution/>
  2879 + <copies>1</copies>
  2880 + <partitioning>
  2881 + <method>none</method>
  2882 + <schema_name/>
  2883 + </partitioning>
  2884 + <fields> <select_unspecified>N</select_unspecified>
  2885 + <meta> <name>jhlc</name>
  2886 + <rename>jhlc</rename>
  2887 + <type>Number</type>
  2888 + <length>-2</length>
  2889 + <precision>-2</precision>
  2890 + <conversion_mask/>
  2891 + <date_format_lenient>false</date_format_lenient>
  2892 + <date_format_locale/>
  2893 + <date_format_timezone/>
  2894 + <lenient_string_to_number>false</lenient_string_to_number>
  2895 + <encoding/>
  2896 + <decimal_symbol/>
  2897 + <grouping_symbol/>
  2898 + <currency_symbol/>
  2899 + <storage_type/>
  2900 + </meta> <meta> <name>bcsj</name>
  2901 + <rename>bcsj</rename>
  2902 + <type>Integer</type>
  2903 + <length>-2</length>
  2904 + <precision>-2</precision>
  2905 + <conversion_mask/>
  2906 + <date_format_lenient>false</date_format_lenient>
  2907 + <date_format_locale/>
  2908 + <date_format_timezone/>
  2909 + <lenient_string_to_number>false</lenient_string_to_number>
  2910 + <encoding/>
  2911 + <decimal_symbol/>
  2912 + <grouping_symbol/>
  2913 + <currency_symbol/>
  2914 + <storage_type/>
  2915 + </meta> </fields> <cluster_schema/>
  2916 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2917 + <xloc>146</xloc>
  2918 + <yloc>768</yloc>
  2919 + <draw>Y</draw>
  2920 + </GUI>
  2921 + </step>
  2922 +
  2923 + <step>
  2924 + <name>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</name>
  2925 + <type>SelectValues</type>
  2926 + <description/>
  2927 + <distribute>Y</distribute>
  2928 + <custom_distribution/>
  2929 + <copies>1</copies>
  2930 + <partitioning>
  2931 + <method>none</method>
  2932 + <schema_name/>
  2933 + </partitioning>
  2934 + <fields> <select_unspecified>N</select_unspecified>
  2935 + <meta> <name>out_mileage</name>
  2936 + <rename>out_mileage</rename>
  2937 + <type>Number</type>
  2938 + <length>-2</length>
  2939 + <precision>-2</precision>
  2940 + <conversion_mask/>
  2941 + <date_format_lenient>false</date_format_lenient>
  2942 + <date_format_locale/>
  2943 + <date_format_timezone/>
  2944 + <lenient_string_to_number>false</lenient_string_to_number>
  2945 + <encoding/>
  2946 + <decimal_symbol/>
  2947 + <grouping_symbol/>
  2948 + <currency_symbol/>
  2949 + <storage_type/>
  2950 + </meta> <meta> <name>out_time</name>
  2951 + <rename>out_time</rename>
  2952 + <type>Integer</type>
  2953 + <length>-2</length>
  2954 + <precision>-2</precision>
  2955 + <conversion_mask/>
  2956 + <date_format_lenient>false</date_format_lenient>
  2957 + <date_format_locale/>
  2958 + <date_format_timezone/>
  2959 + <lenient_string_to_number>false</lenient_string_to_number>
  2960 + <encoding/>
  2961 + <decimal_symbol/>
  2962 + <grouping_symbol/>
  2963 + <currency_symbol/>
  2964 + <storage_type/>
  2965 + </meta> <meta> <name>sxx</name>
  2966 + <rename>sxx</rename>
  2967 + <type>Integer</type>
  2968 + <length>-2</length>
  2969 + <precision>-2</precision>
  2970 + <conversion_mask/>
  2971 + <date_format_lenient>false</date_format_lenient>
  2972 + <date_format_locale/>
  2973 + <date_format_timezone/>
  2974 + <lenient_string_to_number>false</lenient_string_to_number>
  2975 + <encoding/>
  2976 + <decimal_symbol/>
  2977 + <grouping_symbol/>
  2978 + <currency_symbol/>
  2979 + <storage_type/>
  2980 + </meta> </fields> <cluster_schema/>
  2981 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2982 + <xloc>338</xloc>
  2983 + <yloc>1008</yloc>
  2984 + <draw>Y</draw>
  2985 + </GUI>
  2986 + </step>
  2987 +
  2988 + <step>
  2989 + <name>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</name>
  2990 + <type>SelectValues</type>
  2991 + <description/>
  2992 + <distribute>Y</distribute>
  2993 + <custom_distribution/>
  2994 + <copies>1</copies>
  2995 + <partitioning>
  2996 + <method>none</method>
  2997 + <schema_name/>
  2998 + </partitioning>
  2999 + <fields> <select_unspecified>N</select_unspecified>
  3000 + <meta> <name>parade_mileage</name>
  3001 + <rename>parade_mileage</rename>
  3002 + <type>Number</type>
  3003 + <length>-2</length>
  3004 + <precision>-2</precision>
  3005 + <conversion_mask/>
  3006 + <date_format_lenient>false</date_format_lenient>
  3007 + <date_format_locale/>
  3008 + <date_format_timezone/>
  3009 + <lenient_string_to_number>false</lenient_string_to_number>
  3010 + <encoding/>
  3011 + <decimal_symbol/>
  3012 + <grouping_symbol/>
  3013 + <currency_symbol/>
  3014 + <storage_type/>
  3015 + </meta> <meta> <name>parade_time</name>
  3016 + <rename>parade_time</rename>
  3017 + <type>Integer</type>
  3018 + <length>-2</length>
  3019 + <precision>-2</precision>
  3020 + <conversion_mask/>
  3021 + <date_format_lenient>false</date_format_lenient>
  3022 + <date_format_locale/>
  3023 + <date_format_timezone/>
  3024 + <lenient_string_to_number>false</lenient_string_to_number>
  3025 + <encoding/>
  3026 + <decimal_symbol/>
  3027 + <grouping_symbol/>
  3028 + <currency_symbol/>
  3029 + <storage_type/>
  3030 + </meta> <meta> <name>sxx2</name>
  3031 + <rename>sxx2</rename>
  3032 + <type>Integer</type>
  3033 + <length>-2</length>
  3034 + <precision>-2</precision>
  3035 + <conversion_mask/>
  3036 + <date_format_lenient>false</date_format_lenient>
  3037 + <date_format_locale/>
  3038 + <date_format_timezone/>
  3039 + <lenient_string_to_number>false</lenient_string_to_number>
  3040 + <encoding/>
  3041 + <decimal_symbol/>
  3042 + <grouping_symbol/>
  3043 + <currency_symbol/>
  3044 + <storage_type/>
  3045 + </meta> </fields> <cluster_schema/>
  3046 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  3047 + <xloc>847</xloc>
  3048 + <yloc>1003</yloc>
  3049 + <draw>Y</draw>
  3050 + </GUI>
  3051 + </step>
  3052 +
  3053 + <step>
  3054 + <name>&#x8ba1;&#x7b97;&#x73ed;&#x6b21;&#x7c7b;&#x578b;</name>
  3055 + <type>ValueMapper</type>
  3056 + <description/>
  3057 + <distribute>Y</distribute>
  3058 + <custom_distribution/>
  3059 + <copies>1</copies>
  3060 + <partitioning>
  3061 + <method>none</method>
  3062 + <schema_name/>
  3063 + </partitioning>
  3064 + <field_to_use>qdzname</field_to_use>
  3065 + <target_field>bctype</target_field>
  3066 + <non_match_default>&#x6b63;&#x5e38;&#x73ed;&#x6b21;</non_match_default>
  3067 + <fields>
  3068 + <field>
  3069 + <source_value>&#x51fa;&#x573a;</source_value>
  3070 + <target_value>&#x51fa;&#x573a;</target_value>
  3071 + </field>
  3072 + <field>
  3073 + <source_value>&#x8fdb;&#x573a;</source_value>
  3074 + <target_value>&#x8fdb;&#x573a;</target_value>
  3075 + </field>
  3076 + </fields>
  3077 + <cluster_schema/>
  3078 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  3079 + <xloc>1014</xloc>
  3080 + <yloc>401</yloc>
  3081 + <draw>Y</draw>
  3082 + </GUI>
  3083 + </step>
  3084 +
  3085 + <step>
  3086 + <name>&#x8bb0;&#x5f55;&#x5173;&#x8054; &#x28;&#x7b1b;&#x5361;&#x5c14;&#x8f93;&#x51fa;&#x29;</name>
  3087 + <type>JoinRows</type>
  3088 + <description/>
  3089 + <distribute>Y</distribute>
  3090 + <custom_distribution/>
  3091 + <copies>1</copies>
  3092 + <partitioning>
  3093 + <method>none</method>
  3094 + <schema_name/>
  3095 + </partitioning>
  3096 + <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
  3097 + <prefix>out</prefix>
  3098 + <cache_size>500</cache_size>
  3099 + <main/>
  3100 + <compare>
  3101 +<condition>
  3102 + <negated>N</negated>
  3103 + <leftvalue/>
  3104 + <function>&#x3d;</function>
  3105 + <rightvalue/>
  3106 + </condition>
  3107 + </compare>
  3108 + <cluster_schema/>
  3109 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  3110 + <xloc>310</xloc>
  3111 + <yloc>133</yloc>
  3112 + <draw>Y</draw>
  3113 + </GUI>
  3114 + </step>
  3115 +
  3116 + <step>
  3117 + <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;&#xff08;&#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x4e3a;&#x7a7a;&#xff09;</name>
  3118 + <type>FilterRows</type>
  3119 + <description/>
  3120 + <distribute>Y</distribute>
  3121 + <custom_distribution/>
  3122 + <copies>1</copies>
  3123 + <partitioning>
  3124 + <method>none</method>
  3125 + <schema_name/>
  3126 + </partitioning>
  3127 +<send_true_to/>
  3128 +<send_false_to/>
  3129 + <compare>
  3130 +<condition>
  3131 + <negated>N</negated>
  3132 + <leftvalue>sendtime_calcu</leftvalue>
  3133 + <function>IS NOT NULL</function>
  3134 + <rightvalue/>
  3135 + </condition>
  3136 + </compare>
  3137 + <cluster_schema/>
  3138 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  3139 + <xloc>768</xloc>
  3140 + <yloc>44</yloc>
  3141 + <draw>Y</draw>
  3142 + </GUI>
  3143 + </step>
  3144 +
  3145 + <step>
  3146 + <name>&#x8fdb;&#x573a;&#x73ed;&#x6b21;_&#x786e;&#x5b9a;&#x8d77;&#x70b9;&#x7ad9;&#x540d;&#x5b57;</name>
  3147 + <type>ScriptValueMod</type>
  3148 + <description/>
  3149 + <distribute>Y</distribute>
  3150 + <custom_distribution/>
  3151 + <copies>1</copies>
  3152 + <partitioning>
  3153 + <method>none</method>
  3154 + <schema_name/>
  3155 + </partitioning>
  3156 + <compatible>N</compatible>
  3157 + <optimizationLevel>9</optimizationLevel>
  3158 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  3159 + <jsScript_name>Script 1</jsScript_name>
  3160 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var qdzname_calcu &#x3d; cc_groups&#x5b;gno - 2&#x5d;&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#x662f;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x8fd9;&#x91cc;&#x53ea;&#x6709;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#xff0c;&#x8fd8;&#x9700;&#x8981;&#x8ba1;&#x7b97;&#xa;var startZdtype_calcu &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype_calcu &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
  3161 + </jsScript> </jsScripts> <fields> <field> <name>qdzname_calcu</name>
  3162 + <rename>qdzname_calcu</rename>
  3163 + <type>String</type>
  3164 + <length>-1</length>
  3165 + <precision>-1</precision>
  3166 + <replace>N</replace>
  3167 + </field> <field> <name>startZdtype_calcu</name>
  3168 + <rename>startZdtype_calcu</rename>
  3169 + <type>String</type>
  3170 + <length>-1</length>
  3171 + <precision>-1</precision>
  3172 + <replace>N</replace>
  3173 + </field> <field> <name>endZdtype_calcu</name>
  3174 + <rename>endZdtype_calcu</rename>
  3175 + <type>String</type>
  3176 + <length>-1</length>
  3177 + <precision>-1</precision>
  3178 + <replace>N</replace>
  3179 + </field> <field> <name>destory</name>
  3180 + <rename>destory</rename>
  3181 + <type>Integer</type>
  3182 + <length>-1</length>
  3183 + <precision>-1</precision>
  3184 + <replace>N</replace>
  3185 + </field> </fields> <cluster_schema/>
  3186 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  3187 + <xloc>754</xloc>
  3188 + <yloc>610</yloc>
  3189 + <draw>Y</draw>
  3190 + </GUI>
  3191 + </step>
  3192 +
  3193 + <step>
  3194 + <name>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x6570;&#x636e;</name>
  3195 + <type>Dummy</type>
  3196 + <description/>
  3197 + <distribute>Y</distribute>
  3198 + <custom_distribution/>
  3199 + <copies>1</copies>
  3200 + <partitioning>
  3201 + <method>none</method>
  3202 + <schema_name/>
  3203 + </partitioning>
  3204 + <cluster_schema/>
  3205 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  3206 + <xloc>997</xloc>
  3207 + <yloc>606</yloc>
  3208 + <draw>Y</draw>
  3209 + </GUI>
  3210 + </step>
  3211 +
  3212 + <step_error_handling>
  3213 + <error>
  3214 + <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</source_step>
  3215 + <target_step>Excel&#x8f93;&#x51fa;</target_step>
  3216 + <is_enabled>Y</is_enabled>
  3217 + <nr_valuename>c1</nr_valuename>
  3218 + <descriptions_valuename>c2</descriptions_valuename>
  3219 + <fields_valuename>c3</fields_valuename>
  3220 + <codes_valuename>c4</codes_valuename>
  3221 + <max_errors/>
  3222 + <max_pct_errors/>
  3223 + <min_pct_rows/>
  3224 + </error>
  3225 + <error>
  3226 + <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</source_step>
  3227 + <target_step>Excel&#x8f93;&#x51fa; 2</target_step>
  3228 + <is_enabled>Y</is_enabled>
  3229 + <nr_valuename/>
  3230 + <descriptions_valuename/>
  3231 + <fields_valuename/>
  3232 + <codes_valuename/>
  3233 + <max_errors/>
  3234 + <max_pct_errors/>
  3235 + <min_pct_rows/>
  3236 + </error>
  3237 + <error>
  3238 + <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</source_step>
  3239 + <target_step>Excel&#x8f93;&#x51fa; 3</target_step>
  3240 + <is_enabled>Y</is_enabled>
  3241 + <nr_valuename/>
  3242 + <descriptions_valuename/>
  3243 + <fields_valuename/>
  3244 + <codes_valuename/>
  3245 + <max_errors/>
  3246 + <max_pct_errors/>
  3247 + <min_pct_rows/>
  3248 + </error>
  3249 + </step_error_handling>
  3250 + <slave-step-copy-partition-distribution>
  3251 +</slave-step-copy-partition-distribution>
  3252 + <slave_transformation>N</slave_transformation>
  3253 +
  3254 +</transformation>
... ...
src/main/resources/fatso/package.json
1   -{
2   - "name": "fatso",
3   - "version": "1.0.0",
4   - "description": "子页面js检查、合并、压缩等处理",
5   - "main": "start.js",
6   - "scripts": {
7   - "test": "echo \"Error: no test specified\" && exit 1"
8   - },
9   - "author": "panzhaov5",
10   - "license": "ISC",
11   - "dependencies": {
12   - "cheerio": "^0.20.0",
13   - "clean-css": "^4.0.12",
14   - "colors": "^1.1.2",
15   - "eventproxy": "^0.3.4",
16   - "uglify-js": "^2.6.2"
17   - }
  1 +{
  2 + "name": "fatso",
  3 + "version": "1.0.0",
  4 + "description": "子页面js检查、合并、压缩等处理",
  5 + "main": "start.js",
  6 + "scripts": {
  7 + "test": "echo \"Error: no test specified\" && exit 1"
  8 + },
  9 + "author": "panzhaov5",
  10 + "license": "ISC",
  11 + "dependencies": {
  12 + "cheerio": "^0.20.0",
  13 + "clean-css": "^4.0.12",
  14 + "colors": "^1.1.2",
  15 + "eventproxy": "^0.3.4",
  16 + "uglify-js": "^2.6.2"
  17 + }
18 18 }
19 19 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalScheduleObj.js
1   -/**
2   - * 内部行车计划对象。
3   - * @constructor
4   - */
5   -var InternalScheduleObj = function(paramObj, lpArray, factory) {
6   - // 参数对象
7   - var _paramObj = paramObj;
8   - // 外部的路牌数组
9   - var _lpArray = lpArray;
10   - // 工厂对象
11   - var _factory = factory;
12   -
13   - //------------------ 初始化方法1,以及计算关联的内部变量 -----------------//
14   - var _qIsUp; // 每一圈是上行开始还是下行开始
15   - var _qCount = 0; // 总的圈数
16   - var _internalLpArray = []; // 内部对象数组
17   - var _aBxDesc = [ // 各种班型描述(班型名称,平均工时,平均需要的班次数,平均工时)
18   - {'sType':'六工一休', 'fHoursV':6.66, 'fBcCount': 0, 'fAverTime': 0},
19   - {'sType':'五工一休', 'fHoursV':6.85, 'fBcCount': 0, 'fAverTime': 0},
20   - {'sType':'四工一休', 'fHoursV':7.14, 'fBcCount': 0, 'fAverTime': 0},
21   - {'sType':'三工一休', 'fHoursV':7.61, 'fBcCount': 0, 'fAverTime': 0},
22   - {'sType':'二工一休', 'fHoursV':8.57, 'fBcCount': 0, 'fAverTime': 0},
23   - {'sType':'一工一休', 'fHoursV':11.42, 'fBcCount': 0, 'fAverTime': 0},
24   - {'sType':'五工二休', 'fHoursV':7.99, 'fBcCount': 0, 'fAverTime': 0},
25   - {'sType':'无工休', 'fHoursV':5.43, 'fBcCount': 0, 'fAverTime': 0}
26   - ];
27   -
28   - var _fnInitFun1 = function() { // 初始化方法1
29   - console.log("//---------------- 行车计划,初始化方法1 start ----------------//");
30   -
31   - //----------------------- 1、确定上标线的方向,圈的方向 -------------------//
32   -
33   - // 确定_qIsUp,哪个方向的首班车晚就用哪个
34   - _qIsUp = _paramObj.getUpFirstDTimeObj().isBefore(
35   - _paramObj.getDownFirstDTimeObj()) ? false : true;
36   - // 上标线开始时间,就是方向的首班车时间
37   - var st = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
38   - // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
39   - var et;
40   - var et_IsUp;
41   - if (_paramObj.getUpLastDtimeObj().isBefore(
42   - _paramObj.getDownLastDTimeObj())) {
43   - et = _paramObj.getDownLastDTimeObj();
44   - et_IsUp = false;
45   - } else {
46   - et = _paramObj.getUpLastDtimeObj();
47   - et_IsUp = true;
48   - }
49   -
50   - //------------------------ 2、计算总共有多少圈 ------------------------//
51   -
52   - // 以开始时间,结束时间,构造上标线用连班班次发车时间
53   - var bcFcsjArrays = []; // 班次发车时间对象数组
54   - var bcArsjArrays = []; // 班次到达时间对象数组
55   - var isUp = _qIsUp; // 方向
56   - var bcCount = 1; // 班次数
57   -
58   - var _kssj = st; // 开始时间
59   - var _bcsj = paramObj.calcuTravelTime(_kssj, isUp); // 班次历时
60   - var _arrsj = paramObj.addMinute(_kssj, _bcsj); // 到达时间
61   - var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj); // 停站时间
62   -
63   - do {
64   - bcFcsjArrays.push(_kssj);
65   - bcArsjArrays.push(_arrsj);
66   -
67   - _kssj = paramObj.addMinute(_kssj, _bcsj + _stoptime);
68   - _bcsj = paramObj.calcuTravelTime(_kssj, isUp);
69   - _arrsj = paramObj.addMinute(_kssj, _bcsj);
70   - _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);
71   -
72   - bcCount ++;
73   - isUp = !isUp;
74   - } while(_kssj.isBefore(et));
75   - bcCount--; // 因为先做do,所以总的班次要减1
76   - //if (bcCount > 0 && bcArsjArrays[bcCount - 1].isAfter(et)) {
77   - // // 如果最后一个班次的到达时间超过结束时间,也要去除
78   - // bcFcsjArrays.splice(bcCount - 1, 1);
79   - // bcArsjArrays.splice(bcCount - 1, 1);
80   - // bcCount--;
81   - //}
82   - var _qCount_p1 = Math.floor(bcCount / 2); // 2个班次一圈
83   - var _qCount_p2 = bcCount % 2; // 余下的1个班次也算一圈
84   -
85   - // 利用连班数组计算圈数
86   - _qCount = 1; // 前面加1圈,补中标线的班次
87   - _qCount += _qCount_p1;
88   - _qCount += _qCount_p2;
89   -
90   - // 计算最后是不是还要补一圈
91   - if (_qCount > 1) { // 总的圈数就1圈,没必要加了(其实是不可能的,除非参数里问题)
92   - if (_qCount_p2 == 0) { // 没有余下班次,整数圈数
93   - // 最后一个班次的方向一定和开始的方向相反,如:上-下,上-下,上-下,一共三圈,最后一个班次为下行
94   - // 判定最后一个班次的方向和上标线判定结束时间的班次方向是否一致
95   - if (!_qIsUp == et_IsUp) {
96   - // 一致不用加圈数
97   - } else {
98   - // 不一致需要加圈补最后一个结束时间班次
99   - _qCount ++;
100   - }
101   - } else {
102   - // 有余下的圈数,最后要不补的班次不管上行,下行都在这一圈里
103   - // 不需要在补圈数了
104   - }
105   - }
106   -
107   - //------------------------ 3、根据路牌数,圈数创建路牌对象 ----------------------//
108   -
109   - // 创建内部的路牌数组,并把之前的连班路牌添加进上标线路牌中
110   - var i;
111   - for (i = 0; i < _lpArray.length; i++) {
112   - _internalLpArray.push(new InternalLpObj(_lpArray[i], _qCount, _qIsUp));
113   - }
114   - // 初始化上标线,从第1圈开始
115   - _internalLpArray[0].initDataFromTimeToTime(bcFcsjArrays[0], et, _qIsUp, 1, _paramObj, _factory);
116   -
117   - // 以上标线为基础,计算各种班型工时对应的圈数、班次数
118   - var aBcArray = _internalLpArray[0].getBcArray();
119   - aBcArray[0].fnSetIsFirstBc(true); // 设置首班班次标识
120   -
121   - if (aBcArray.length % 2 != 0) { // 不能整除2,去除一个班次计算
122   - aBcArray.splice(aBcArray.length - 1, 1);
123   - }
124   -
125   - // 午饭吃饭时间
126   - var iLTime = _paramObj.fnGetLunchTime();
127   - // 晚饭吃饭时间
128   - var iDTime = _paramObj.fnGetDinnerTime();
129   - // 出场时间
130   - var iOutTime = _qIsUp ? _paramObj.getUpOutTime() : _paramObj.getDownOutTime();
131   - // 进场时间
132   - var iInTime = _qIsUp ? _paramObj.getDownInTime() : _paramObj.getUpInTime();
133   - // 例保时间
134   - var iBTime = _paramObj.getLbTime();
135   -
136   - var sum = 0; // 总班次时间
137   - for (i = 0; i < aBcArray.length; i++) {
138   - sum += aBcArray[i].getBcTime() + aBcArray[i].getStopTime();
139   - }
140   - sum += iLTime; // 加午饭时间
141   - sum += iDTime; // 加晚饭时间
142   - for (i = 0; i < _aBxDesc.length; i++) {
143   - _aBxDesc[i].fAverTime = sum / (aBcArray.length / 2); // 平均周转时间不算进出场,例保时间
144   -
145   - // 计算5休2的班次数(双进出场,4个例保)
146   - if (i == 6) {
147   - _aBxDesc[i].fQCount =
148   - (_aBxDesc[i].fHoursV * 60 - iOutTime * 2 - iInTime * 2 - iBTime * 4) /
149   - _aBxDesc[i].fAverTime;
150   - _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
151   - } else { // 进出场,2个例保
152   - _aBxDesc[i].fQCount =
153   - (_aBxDesc[i].fHoursV * 60 - iOutTime - iInTime - iBTime * 2) /
154   - _aBxDesc[i].fAverTime;
155   - _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
156   - }
157   - }
158   -
159   -
160   - // 在第一个班次之前再添加一个模拟班次,用于中标线的作用
161   - // 那一圈必定是低谷,而且圈索引0,班次索引1,暂时标记,最后删除
162   - var iFirstStopTime =
163   - _paramObj.fnCalcuFixedStopNumber(
164   - _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -10),
165   - _qIsUp
166   - );
167   - var iXXTime = _qIsUp ? _paramObj.getDownTroughTime() : _paramObj.getUpTroughTime();
168   - var oFlagBc = _factory.createBcObj( // 标记班次
169   - _internalLpArray[0],
170   - "normal",
171   - !_qIsUp,
172   - 1,
173   - _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -(iFirstStopTime + iXXTime)),
174   - _paramObj
175   - );
176   - oFlagBc.fnSetDelFlag(true); // 标记了删除记号
177   -
178   - _internalLpArray[0].setBc(0, 1, oFlagBc);
179   -
180   - // 在最后一圈也补上一个或者2个模拟班次,暂时标记,最后需要删除
181   - var aMaxBcIndex = _internalLpArray[0].getMaxBcObjPosition();
182   - if (aMaxBcIndex[0] == _qCount - 1) { // 可能加半圈
183   - oFlagBc = _factory.createBcObj( // 标记班次
184   - _internalLpArray[0],
185   - "normal",
186   - !_qIsUp,
187   - 1,
188   - _paramObj.addMinute(
189   - _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),
190   - _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),
191   - _paramObj
192   - );
193   - oFlagBc.fnSetDelFlag(true); // 标记了删除记号
194   - _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);
195   -
196   - } else { // 加完整的一圈
197   - oFlagBc = _factory.createBcObj( // 标记班次
198   - _internalLpArray[0],
199   - "normal",
200   - _qIsUp,
201   - 1,
202   - _paramObj.addMinute(
203   - _internalLpArray[0].getBc(_qCount - 2, 1).getArrTimeObj(),
204   - _internalLpArray[0].getBc(_qCount - 2, 1).getStopTime()),
205   - _paramObj
206   - );
207   - oFlagBc.fnSetDelFlag(true); // 标记了删除记号
208   - _internalLpArray[0].setBc(_qCount - 1, 0, oFlagBc);
209   -
210   - oFlagBc = _factory.createBcObj( // 标记班次
211   - _internalLpArray[0],
212   - "normal",
213   - !_qIsUp,
214   - 1,
215   - _paramObj.addMinute(
216   - _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),
217   - _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),
218   - _paramObj
219   - );
220   - oFlagBc.fnSetDelFlag(true); // 标记了删除记号
221   - _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);
222   -
223   - }
224   -
225   - console.log("上行首班车时间:" + _paramObj.getUpFirstDTimeObj().format("HH:mm") +
226   - "上行末班车时间:" + _paramObj.getUpLastDtimeObj().format("HH:mm"));
227   - console.log("下行首班车时间:" + _paramObj.getDownFirstDTimeObj().format("HH:mm") +
228   - "下行末班车时间:" + _paramObj.getDownLastDTimeObj().format("HH:mm"));
229   - console.log("总共计算的圈数:" + _qCount);
230   - console.log("圈的方向isUP:" + _qIsUp);
231   - console.log("班型描述(以下):");
232   - console.log(_aBxDesc);
233   - console.log("所有路牌间隔描述(以下):");
234   - for (i = 0; i < _internalLpArray.length; i++) {
235   - console.log(_internalLpArray[i]._$_aVerticalIntervalTime);
236   - }
237   - console.log("//---------------- 行车计划,初始化方法1 end ----------------//");
238   -
239   - };
240   -
241   - //------------------ 初始化方法2,以及计算关联的内部变量 ----------------//
242   - var _approximate_zgfQIndex; // 预估早高峰车辆从第几圈开始全部发出
243   - var _approximate_zgfBIndex; // 预估早高峰车辆从第几圈第几个班次开始全部发出(上行或下行)
244   - var _approximate_wgfQIndex; // 预估晚高峰车辆从第几圈开始全部发出
245   - var _approximate_wgfBIndex; // 预估晚高峰车辆从第几圈第几个班次开始全部发出(上行或下行)
246   -
247   - var _fnInitFun2 = function() { // 初始化方法2
248   - console.log("//---------------- 行车计划,初始化方法2 start ----------------//");
249   -
250   - //------------------------ 1、计算车辆总数 ------------------------//
251   - // 是用高峰上行周转时间除以高峰平均间隔得到的
252   - // 这样算还算合理,车辆不多不少,待以后有新的算法再修正
253   - var iClCount = _paramObj.calcuClzx();
254   -
255   - //------------------------ 2、计算所有路牌的发车在各个圈中的间隔 --------------------//
256   - var i;
257   - var j;
258   - var iBindex = 1;
259   - var iZzsj;
260   - var oLp;
261   - var iC1;
262   - var iC2;
263   -
264   - for (i = 0; i < _qCount - 1; i++) {
265   - while (iBindex <= 1) {
266   - // 每圈每个方向的周转时间不一致,以上标线为主
267   - oLp = _internalLpArray[0];
268   - iZzsj = oLp.getBc(i + 1, iBindex).getFcTimeObj().diff(
269   - oLp.getBc(i, iBindex).getFcTimeObj(), "m"
270   - );
271   -
272   - iC1 = Math.floor(iZzsj / iClCount);
273   - iC2 = iZzsj % iClCount;
274   -
275   - for (j = 0; j < iClCount - iC2; j++) {
276   - oLp = _internalLpArray[j];
277   - oLp.fnSetVerticalIntervalTime(i, iBindex, iC1);
278   - }
279   -
280   - for (j = 0; j < iC2; j++) {
281   - oLp = _internalLpArray[iClCount - iC2 + j];
282   - oLp.fnSetVerticalIntervalTime(i, iBindex, iC1 + 1);
283   - }
284   -
285   - iBindex ++;
286   -
287   - }
288   - iBindex = 0;
289   - }
290   - // 最后一圈没有下一圈的参照,周转时间没发获取,由于都是低谷,所以使用倒数第二圈的间隔最为最后一圈的间隔
291   - for (i = 0; i < _internalLpArray.length; i++) {
292   - oLp = _internalLpArray[i];
293   - oLp.fnSetVerticalIntervalTime(_qCount - 1, 0, oLp.fnGetVerticalIntervalTime(_qCount - 2, 0));
294   - oLp.fnSetVerticalIntervalTime(_qCount - 1, 1, oLp.fnGetVerticalIntervalTime(_qCount - 2, 1));
295   - }
296   -
297   - //------------------------ 3、预估早高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//
298   -
299   - // 以上标线为标准,查找离早高峰开始时间最近的班次作为早高峰开始班次
300   - // 以这个班次为早高峰起点,全部出车策略
301   - var qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(
302   - _paramObj.getMPeakStartTimeObj(), true, true);
303   - var qIndex = qbcIndexArray[0]; // 第几圈
304   - var bIndex = qbcIndexArray[1]; // 第几个班次
305   -
306   - for (i = 1; i < _internalLpArray.length; i++) {
307   - _fnGenerateBcAndSetBc(i, qIndex, bIndex);
308   - }
309   -
310   - _approximate_zgfQIndex = qIndex;
311   - _approximate_zgfBIndex = bIndex;
312   -
313   - //------------------------ 4、预估晚高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//
314   -
315   - // 以上标线为标准,查找离晚高峰开始时间最近的班次作为晚高峰开始班次
316   - // 以这个班次为早高峰起点,全部出车策略
317   - qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(
318   - _paramObj.getEPeakStartTimeObj(), true, true);
319   - qIndex = qbcIndexArray[0]; // 第几圈
320   - bIndex = qbcIndexArray[1]; // 第几个班次
321   -
322   - for (i = 1; i < _internalLpArray.length; i++) {
323   - _fnGenerateBcAndSetBc(i, qIndex, bIndex);
324   - }
325   -
326   - _approximate_wgfQIndex = qIndex;
327   - _approximate_wgfBIndex = bIndex;
328   -
329   - console.log("早高峰周转时间(固定最大停战时间):" + _paramObj.calcuPeakZzsj() + "分钟");
330   - console.log("早高峰发车时间范围:" + _paramObj.getMPeakMinFcjx() + "分钟 --- " + _paramObj.getMPeakMaxFcjx() + "分钟");
331   - console.log("预估早高峰第" + _approximate_zgfQIndex + "(index)圈,第" + _approximate_zgfBIndex + "(index)班次车辆全部发出");
332   - console.log("预估晚高峰第" + _approximate_wgfQIndex + "(index)圈,第" + _approximate_wgfBIndex + "(index)班次车辆全部发出");
333   - console.log("//---------------- 行车计划,初始化方法2 end ----------------//");
334   - };
335   -
336   - //----------------------- 初始化方法3,计算连班分班的路牌分布 ----------------//
337   - var _iBx_lb_lpcount; // 连班路牌数
338   - var _iBx_5_2_fb_lpcount; // 5休2分班路牌数
339   - var _iBx_other_fb_lpcount; // 其他分班路牌数
340   -
341   - var _fnInitFun3 = function() { // 初始化方法3
342   - console.log("//---------------- 行车计划,初始化方法3 start ----------------//");
343   -
344   - //--------------------- 1、计算分班连班班型车辆分布数 --------------------//
345   - // 总共车辆数(高峰最大车辆数)
346   - var iCls = _paramObj.calcuClzx();
347   - // 低谷最少配车(连班车数量)
348   - var iDgminpc = Math.round(_paramObj.calcuTroughZzsj() / _paramObj.getTroughMaxFcjx());
349   - // 加班车路牌数(做5休2的路牌数)
350   - var i_5_2_lpes = _paramObj.getJBLpes();
351   -
352   - // 做些简单的验证
353   - if (iCls < iDgminpc) {
354   - alert("总配车数小于低谷最小配车");
355   - throw "总配车数小于低谷最小配车";
356   - }
357   -
358   - if (iDgminpc < 2) {
359   - // alert("连班路牌小于2,办不到啊");
360   - // throw "连班路牌小于2,办不到啊";
361   - console.log("连班路牌小于2,则5休2之外的车辆数则为连班车辆数");
362   - iDgminpc = iCls - i_5_2_lpes;
363   - }
364   - if (iCls - iDgminpc < i_5_2_lpes) {
365   - // alert("总分班路牌数小于加班路牌数");
366   - // throw "总分班路牌数小于加班路牌数";
367   - console.log("总分班路牌数小于加班路牌数,则忽略其他分班路牌数");
368   - iDgminpc = iCls - i_5_2_lpes;
369   - }
370   -
371   - //// 修正连班路牌数,班次间隔大于20的,加1,直至班次间隔小于20
372   - //while(_paramObj.calcuPeakZzsj() / iDgminpc > 20) {
373   - // iDgminpc ++;
374   - //}
375   - _iBx_lb_lpcount = iDgminpc;
376   -
377   - _iBx_5_2_fb_lpcount = i_5_2_lpes;
378   - _iBx_other_fb_lpcount = iCls - _iBx_lb_lpcount - i_5_2_lpes;
379   -
380   - //------------------------ 2、利用间隔法计算连班路牌分布 --------------------//
381   - var i;
382   - var j;
383   - var iC1 = Math.floor(_internalLpArray.length / _iBx_lb_lpcount);
384   - var iC2 = _internalLpArray.length % _iBx_lb_lpcount;
385   - var iLpIndex;
386   -
387   - for (i = 0; i < _iBx_lb_lpcount - iC2; i++) {
388   - iLpIndex = i * iC1;
389   - _internalLpArray[iLpIndex].setBxLb(true);
390   - _internalLpArray[iLpIndex].setBxDesc("连班");
391   - }
392   - for (j = 0; j < iC2; j++) {
393   - iLpIndex = i * iC1 + j * (iC1 + 1);
394   - _internalLpArray[iLpIndex].setBxLb(true);
395   - _internalLpArray[iLpIndex].setBxDesc("连班");
396   - }
397   -
398   - //------------------------ 3、利用间隔法计算分班班型路牌分布 --------------------//
399   - // 获取分班路牌索引
400   - var aNotLbIndexes = [];
401   - for (i = 0; i < _internalLpArray.length; i++) {
402   - if (!_internalLpArray[i].isBxLb()) {
403   - aNotLbIndexes.push(i);
404   - }
405   - }
406   - // 先5休2分班
407   - iC1 = Math.floor(aNotLbIndexes.length / _iBx_5_2_fb_lpcount);
408   - iC2 = aNotLbIndexes.length % _iBx_5_2_fb_lpcount;
409   -
410   - for (i = 0; i < _iBx_5_2_fb_lpcount - iC2; i++) {
411   - iLpIndex = aNotLbIndexes[i * iC1];
412   - _internalLpArray[iLpIndex].setBxLb(false);
413   - _internalLpArray[iLpIndex].setBxFb(true);
414   - _internalLpArray[iLpIndex].setBxFb5_2(true);
415   - _internalLpArray[iLpIndex].setBxDesc("5休2分班");
416   - }
417   - for (i = 0; i < iC2; i++) {
418   - iLpIndex = aNotLbIndexes[_iBx_5_2_fb_lpcount - iC2 + i * (iC1 + 1)];
419   - _internalLpArray[iLpIndex].setBxLb(false);
420   - _internalLpArray[iLpIndex].setBxFb(true);
421   - _internalLpArray[iLpIndex].setBxFb5_2(true);
422   - _internalLpArray[iLpIndex].setBxDesc("5休2分班");
423   - }
424   - // 其他分班
425   - for (i = 0; i < aNotLbIndexes.length; i++) {
426   - iLpIndex = aNotLbIndexes[i];
427   - if (!_internalLpArray[iLpIndex].isBxFb5_2()) {
428   - _internalLpArray[iLpIndex].setBxLb(false);
429   - _internalLpArray[iLpIndex].setBxFb(true);
430   - _internalLpArray[iLpIndex].setBxFb5_2(false);
431   - _internalLpArray[iLpIndex].setBxDesc("其他分班");
432   - }
433   - }
434   -
435   - console.log("高峰周转时间:" + _paramObj.calcuPeakZzsj());
436   - console.log("连班路牌数:" + _iBx_lb_lpcount);
437   - console.log("5休2分班路牌数:" + _iBx_5_2_fb_lpcount);
438   - console.log("其他分班路牌数:" + _iBx_other_fb_lpcount);
439   - var aLbIndexes = [];
440   - for (i = 0; i < _internalLpArray.length; i++) {
441   - if (_internalLpArray[i].isBxLb()) {
442   - aLbIndexes.push(i);
443   - }
444   - }
445   - console.log("连班路牌indexes=" + aLbIndexes);
446   - var a_5_2_fbIndexes = [];
447   - for (i = 0; i < _internalLpArray.length; i++) {
448   - if (_internalLpArray[i].isBxFb() && _internalLpArray[i].isBxFb5_2()) {
449   - a_5_2_fbIndexes.push(i);
450   - }
451   - }
452   - console.log("5休2分班路牌indexes=" + a_5_2_fbIndexes);
453   - var a_other_fbIndexes = [];
454   - for (i = 0; i < _internalLpArray.length; i++) {
455   - if (_internalLpArray[i].isBxFb() && !_internalLpArray[i].isBxFb5_2()) {
456   - a_other_fbIndexes.push(i);
457   - }
458   - }
459   - console.log("其他分班路牌indexes=" + a_other_fbIndexes);
460   -
461   - console.log("//---------------- 行车计划,初始化方法3 end ----------------//");
462   - };
463   -
464   - //----------------------- 初始化方法4,计算中标线位置 -------------------------//
465   - var _iZbx_lpIndex; // 中标线对应第几个路牌
466   -
467   - var _fnInitFun4 = function() { // 初始化方法4
468   - console.log("//---------------- 行车计划,初始化方法4 start ----------------//");
469   -
470   - //---------------------------- 1、模拟一个中标线,使用临时路牌 ----------------------//
471   - // 构造中标线
472   - // 中标线开始时间,就是方向的首班车时间
473   - var oSt = !_qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
474   - // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
475   - // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
476   - var oEt;
477   - if (_paramObj.getUpLastDtimeObj().isBefore(
478   - _paramObj.getDownLastDTimeObj())) {
479   - oEt = _paramObj.getDownLastDTimeObj();
480   - } else {
481   - oEt = _paramObj.getUpLastDtimeObj();
482   - }
483   -
484   - var oTempLp = new InternalLpObj({lpNo: -999, lpName: "-999"}, _qCount, _qIsUp);
485   - oTempLp.initDataFromTimeToTime(
486   - oSt,
487   - oEt,
488   - !_qIsUp,
489   - 0,
490   - _paramObj,
491   - _factory
492   - );
493   -
494   - //------------------------ 2、找出中标线的早高峰班次,计算应该插在当前路牌数组的那个位置 ----------------//
495   - // 找出中标线对应的早高峰的班次对象
496   - var oZb_gf_bc = oTempLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);
497   - //alert(oZb_gf_bc.getFcTimeObj().format("HH:mm"));
498   -
499   - // 把所有连班路牌高峰班次重新构造成一个一个的圈数组,计算对应中标线最近的是第几个路牌
500   - // 中标线和上标线一样在连班路牌上
501   - var aTempq = [];
502   - var oTempq;
503   - var oTempb;
504   - var i;
505   - var oLp;
506   -
507   - var aLbIndexes = []; // 连班的路牌索引
508   - for (i = 0; i < _internalLpArray.length; i++) {
509   - if (_internalLpArray[i].isBxLb()) {
510   - aLbIndexes.push(i);
511   - }
512   - }
513   -
514   - for (i = 0; i < aLbIndexes.length; i++) {
515   - oLp = _internalLpArray[aLbIndexes[i]];
516   -
517   - oTempb = oLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);
518   - if (oTempb.isUp() == _qIsUp) {
519   - oTempq = new InternalGroupObj(oLp, _qIsUp, oTempb, undefined);
520   - } else {
521   - oTempq = new InternalGroupObj(oLp, _qIsUp, undefined, oTempb);
522   - }
523   - aTempq.push(oTempq);
524   -
525   - }
526   -
527   - var aTtindex = oTempLp.fnGetQBcIndexWithFcTimeFromGroupArray( // 找出最接近中标线的路牌索引
528   - oZb_gf_bc.getFcTimeObj(),
529   - aTempq,
530   - true,
531   - true
532   - );
533   -
534   - _iZbx_lpIndex = aLbIndexes[aTtindex[0]]; // 中标线放在第几个路牌
535   -
536   - oTempLp.getMinBcObj().fnSetIsFirstBc(true); // 设置首班班次标识
537   -
538   - if (_iZbx_lpIndex == 0) { // 如果中标线和上标线一致
539   - var oFirstBcIndexes = oTempLp.getMinBcObjPosition();
540   - var oFirstBc = oTempLp.getMinBcObj();
541   - oFirstBc.setLp(_internalLpArray[_iZbx_lpIndex]);
542   - oFirstBc.fnSetDelFlag(false);
543   - _internalLpArray[_iZbx_lpIndex].setBc(oFirstBcIndexes[0], oFirstBcIndexes[1], oFirstBc);
544   - } else {
545   - oTempLp.setLp(_lpArray[_iZbx_lpIndex]); // 设置原始路牌对象
546   - oTempLp._$_aVerticalIntervalTime = _internalLpArray[_iZbx_lpIndex]._$_aVerticalIntervalTime; // 设置纵向最小发车间隔
547   - oTempLp.setBxLb(_internalLpArray[_iZbx_lpIndex].isBxLb());
548   - oTempLp.setBxFb(_internalLpArray[_iZbx_lpIndex].isBxFb());
549   - oTempLp.setBxFb5_2(_internalLpArray[_iZbx_lpIndex].isBxFb5_2());
550   -
551   - // 修正除了第一个班次外,其余其他班次
552   - var iBcindex = 0;
553   - for (i = 1; i < _qCount; i++) {
554   - while (iBcindex <= 1) {
555   - if (oTempLp.getBc(i, iBcindex)) { // 替换存在的班次
556   - oTempLp.setBc(i, iBcindex, _fnGenerateBc(_iZbx_lpIndex, i, iBcindex));
557   - }
558   - iBcindex ++;
559   - }
560   - iBcindex = 0;
561   - }
562   -
563   - _internalLpArray[_iZbx_lpIndex] = oTempLp;
564   - }
565   -
566   - console.log("中标线对应第" + (_iZbx_lpIndex + 1) + "个路牌");
567   -
568   - console.log("//---------------- 行车计划,初始化方法4 end ----------------//");
569   - };
570   -
571   - //-------------------- 重要的内部方法 -----------------------//
572   - /**
573   - * 核心方法,利用路牌间隔纵向生成班次。
574   - * @param iLpindex 路牌索引
575   - * @param iQindex 圈索引
576   - * @param iBcindex 班次索引
577   - * @returns object InternalBcObj,失败 false
578   - */
579   - var _fnGenerateBc = function(iLpindex, iQindex, iBcindex) {
580   - // 以上标线为起始点,使用路牌在不同圈,班次索引的发车间隔,计算班次
581   - // 注意,发车间隔是指下一个班次应该距离当前班次间隔,是从下往上的
582   -
583   - // 1、参数验证
584   - if (iLpindex == 0) { // 上标线的班次不需要生成
585   - return false;
586   - }
587   -
588   - // 2、计算间隔
589   - var i;
590   - var oLp;
591   - var iTime = 0;
592   - for (i = 0; i < iLpindex; i++) {
593   - oLp = _internalLpArray[i];
594   - iTime += oLp.fnGetVerticalIntervalTime(iQindex, iBcindex);
595   - }
596   -
597   - // 3、生成班次
598   - var _oKsbc = _internalLpArray[0].getBc(iQindex, iBcindex);
599   - if (!_oKsbc) {
600   - return false;
601   - }
602   - var _oKssj = _paramObj.addMinute(_oKsbc.getFcTimeObj(), iTime);
603   - var _oBc = _factory.createBcObj(
604   - _internalLpArray[iLpindex],
605   - "normal", _oKsbc.isUp(),
606   - 1, _oKssj, _paramObj);
607   -
608   - return _oBc;
609   -
610   - };
611   -
612   - /**
613   - * 核心方法,在指定位置生成班次并添加到路牌指定位置中。
614   - * @param lpIndex 第几个路牌
615   - * @param qIndex 第几圈
616   - * @param bcIndex 第几个班次
617   - */
618   - var _fnGenerateBcAndSetBc = function(lpIndex, qIndex, bcIndex) {
619   - var _bcObj = _fnGenerateBc(lpIndex, qIndex, bcIndex);
620   - if (_bcObj) {
621   - _internalLpArray[lpIndex].setBc(qIndex, bcIndex, _bcObj);
622   - }
623   - };
624   -
625   - /**
626   - * 获取班次列表。
627   - * @param oIsUp 是否上行
628   - * @param oStartTime 开始时间对象
629   - * @returns [(InternalBcObj)]
630   - */
631   - var _fnGetBcList2 = function(oIsUp, oStartTime) {
632   - var i;
633   - var j;
634   - var oLp;
635   - var oBc;
636   - var aBc = [];
637   -
638   - for (j = 0; j < _qCount; j++) {
639   - for (i = 0; i < _internalLpArray.length; i++) {
640   - oLp = _internalLpArray[i];
641   - oBc = oLp.getBc(
642   - j,
643   - _qIsUp == oIsUp ? 0 : 1
644   - );
645   - if (oBc && oBc.getFcTimeObj().isAfter(oStartTime)) {
646   - aBc.push(oBc);
647   - }
648   - }
649   - }
650   -
651   - var aBcFcTime = [];
652   - for (i = 0; i < aBc.length; i++) {
653   - oBc = aBc[i];
654   - aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
655   - }
656   - console.log((oIsUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
657   -
658   - return aBc;
659   - };
660   -
661   - /**
662   - * 获取班次列表。
663   - * @param isUp boolean 是否上行
664   - * @returns [(InternalBcObj)]
665   - */
666   - var _fnGetBcList = function(isUp) {
667   - var i;
668   - var j;
669   - var oLp;
670   - var oBc;
671   - var aBc = [];
672   -
673   - for (j = 0; j < _qCount; j++) {
674   - for (i = 0; i < _internalLpArray.length; i++) {
675   - oLp = _internalLpArray[i];
676   - oBc = oLp.getBc(
677   - j,
678   - _qIsUp == isUp ? 0 : 1
679   - );
680   - if (oBc) {
681   - aBc.push(oBc);
682   - }
683   - }
684   - }
685   -
686   - var aBcFcTime = [];
687   - for (i = 0; i < aBc.length; i++) {
688   - oBc = aBc[i];
689   - aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
690   - }
691   - console.log((isUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
692   -
693   - return aBc;
694   - };
695   -
696   - /**
697   - * 查找离指定时间最近的前面的班次索引信息
698   - * @param timeObj 查找时间
699   - * @param isUp 是否上行
700   - * @returns [{路牌index},{圈index},{班次index}]
701   - */
702   - var _fnFindUpClosedBcIndexWithTime = function(timeObj, isUp) {
703   -
704   - var _lpObj;
705   - var _groupObj;
706   - var _bcObj;
707   - var _i;
708   - var _j;
709   - var timediff; // 时间差取绝对值
710   -
711   - var _lpIndex;
712   - var _up_qIndex;
713   - var _up_bIndex;
714   -
715   - for (_i = 0; _i < _qCount; _i++) {
716   - for (_j = 0; _j < _internalLpArray.length; _j++) {
717   - _lpObj = _internalLpArray[_j];
718   - _groupObj = _lpObj.getGroup(_i);
719   - _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
720   - if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
721   - _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
722   - }
723   - if (_bcObj) {
724   - if (timeObj.diff(_bcObj.getFcTimeObj()) >= 0) {
725   - if (!timediff) {
726   - timediff = timeObj.diff(_bcObj.getFcTimeObj());
727   - _lpIndex = _j;
728   - _up_qIndex = _i;
729   - _up_bIndex = isUp == _qIsUp ? 0 : 1;
730   - } else {
731   - if (timeObj.diff(_bcObj.getFcTimeObj()) < timediff) {
732   - timediff = timeObj.diff(_bcObj.getFcTimeObj());
733   - _lpIndex = _j;
734   - _up_qIndex = _i;
735   - _up_bIndex = isUp == _qIsUp ? 0 : 1;
736   - }
737   - }
738   - }
739   - }
740   - }
741   - }
742   -
743   - if (_lpIndex == undefined) {
744   - return false;
745   - }
746   -
747   - var bcindex = [];
748   - bcindex.push(_lpIndex);
749   - bcindex.push(_up_qIndex);
750   - bcindex.push(_up_bIndex);
751   -
752   - return bcindex;
753   - };
754   -
755   - /**
756   - * 查找离指定时间最近的后面的班次索引信息
757   - * @param timeObj 查找时间
758   - * @param isUp 是否上行
759   - * @returns [{路牌index},{圈index},{班次index}]
760   - */
761   - var _fnFindDownClosedBcIndexWithTime = function(timeObj, isUp) {
762   - var _lpObj;
763   - var _groupObj;
764   - var _bcObj;
765   - var _i;
766   - var _j;
767   - var timediff; // 时间差取绝对值
768   -
769   - var _lpIndex;
770   - var _down_qIndex;
771   - var _down_bIndex;
772   -
773   - var flag;
774   -
775   - for (_i = 0; _i < _qCount; _i++) {
776   - for (_j = 0; _j < _internalLpArray.length; _j++) {
777   - _lpObj = _internalLpArray[_j];
778   - _groupObj = _lpObj.getGroup(_i);
779   - // TODO:bug
780   - _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
781   - if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
782   - _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
783   - }
784   - if (_bcObj) {
785   - //console.log("timeobj -> bcobj diff flag " +
786   - // timeObj.format("HH:mm") + "->" +
787   - // _bcObj.getFcTimeObj().format("HH:mm") +
788   - // timeObj.diff(_bcObj.getFcTimeObj()) +
789   - // (timeObj.diff(_bcObj.getFcTimeObj()) <= 0)
790   - //);
791   -
792   - flag = (timeObj.diff(_bcObj.getFcTimeObj())) <= 0;
793   -
794   - if (flag) {
795   - if (!timediff) {
796   - timediff = timeObj.diff(_bcObj.getFcTimeObj());
797   - _lpIndex = _j;
798   - _down_qIndex = _i;
799   - _down_bIndex = isUp == _qIsUp ? 0 : 1;
800   - } else {
801   - if ((timeObj.diff(_bcObj.getFcTimeObj())) > timediff) {
802   - timediff = timeObj.diff(_bcObj.getFcTimeObj());
803   - _lpIndex = _j;
804   - _down_qIndex = _i;
805   - _down_bIndex = isUp == _qIsUp ? 0 : 1;
806   - }
807   - }
808   - }
809   - }
810   - }
811   - }
812   -
813   - if (_lpIndex == undefined) {
814   - return false;
815   - }
816   -
817   - var bcindex = [];
818   - bcindex.push(_lpIndex);
819   - bcindex.push(_down_qIndex);
820   - bcindex.push(_down_bIndex);
821   -
822   - return bcindex;
823   - };
824   -
825   - /**
826   - * 获取班次索引。
827   - * @param oBc 班次对象
828   - * @returns [{路牌索引},{圈索引},{班次索引}]
829   - */
830   - var _fnGetBcIndex = function(oBc) {
831   - // 路牌索引
832   - var i;
833   - var iLpIndex;
834   - for (i = 0; i < _internalLpArray.length; i++) {
835   - if (_internalLpArray[i]._$$_orign_lp_obj == oBc._$$_internal_lp_obj._$$_orign_lp_obj) {
836   - iLpIndex = i;
837   - break;
838   - }
839   - }
840   - // 圈索引
841   - var j;
842   - var iGroupIndex;
843   - var bFlag = false;
844   - for (i = 0; i < _internalLpArray.length; i++) {
845   - if (bFlag) {
846   - break;
847   - }
848   - for (j = 0; j < _qCount; j++) {
849   - if (_internalLpArray[i]._$_groupBcArray[j] == oBc._$$_internal_group_obj) {
850   - iGroupIndex = j;
851   - bFlag = true;
852   - break;
853   - }
854   - }
855   - }
856   - // 班次索引
857   - var iBcIndex = _qIsUp == oBc.isUp() ? 0 : 1;
858   -
859   - if (iLpIndex == undefined) {
860   - return null;
861   - } else {
862   - return [].concat(iLpIndex, iGroupIndex, iBcIndex);
863   - }
864   -
865   - };
866   -
867   - return {
868   - //------------- 布局初始化方法 ------------//
869   - /**
870   - * 初始化数据,使用标线初始化
871   - */
872   - fnInitDataWithBxLayout: function() {
873   - // 初始化布局1,构造上标线,计算圈数,把上标线数据放入第一个路牌中
874   - _fnInitFun1();
875   - // 初始化布局2,从上标线的某个班次开始,构造所有路牌的早高峰班次,晚高峰班次,计算路牌在各个圈中的间隔
876   - _fnInitFun2();
877   - // 初始化布局3,计算连班分班路牌分布
878   - _fnInitFun3();
879   - // 初始化布局4,计算中标线位置
880   - _fnInitFun4();
881   -
882   - },
883   -
884   - /**
885   - * 调整高峰班次,
886   - * 初始化生成早高峰,晚高峰班次并不准确,因为根据高峰时间段,并不在一个完整圈内,应该是在两个或多个圈之间
887   - * 当初始化定好布局后(上标线,中标线),然后确定每个路牌的班型(连班,分班,5休2分班)后
888   - * 然后重新计算框在高峰时间段内的班次索引,不足的添加,之前多加的删除(只删除分班路牌上的)
889   - * @param isZgf 是否早高峰
890   - * @param isUp 是否上行
891   - */
892   - fnAdjustGfbc : function(isZgf, isUp) {
893   - var oStartTime; // 开始时间
894   - var oEndTime; // 结束时间
895   - var aStartBcIndex; // 开始班次索引
896   - var aEndBcIndex; // 结束班次索引
897   -
898   - oStartTime = isZgf ? _paramObj.getMPeakStartTimeObj() : _paramObj.getEPeakStartTimeObj();
899   - oEndTime = isZgf ? _paramObj.getMPeakEndTimeObj() : _paramObj.getEPeakEndTimeObj();
900   -
901   - aStartBcIndex = _fnFindUpClosedBcIndexWithTime(oStartTime, isUp);
902   - aEndBcIndex = _fnFindDownClosedBcIndexWithTime(oEndTime, isUp);
903   -
904   - var iLpIndex;
905   - var iQIndex;
906   - var iBcIndex;
907   - var iQInternelCount; // 高峰时间段中间包含的圈数
908   - var i;
909   - var j;
910   -
911   - var oLp;
912   -
913   - if (aStartBcIndex && aEndBcIndex) {
914   - iLpIndex = aStartBcIndex[0];
915   - iQIndex = aStartBcIndex[1];
916   - iBcIndex = aStartBcIndex[2];
917   -
918   - // 处理头
919   - // 删除头部多余班次
920   - for (j = 0; j < iLpIndex; j++) {
921   - oLp = _internalLpArray[j];
922   - if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {
923   - oLp.removeBc(iQIndex, iBcIndex);
924   - }
925   - }
926   -
927   - for (j = iLpIndex; j < _internalLpArray.length; j++) {
928   - oLp = _internalLpArray[j];
929   - if (!oLp.getBc(iQIndex, iBcIndex)) {
930   - _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);
931   - }
932   - }
933   -
934   - // 处理中间
935   - iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1;
936   - for (i = 1; i <= iQInternelCount; i++) {
937   -
938   - for (j = 0; j < _internalLpArray.length; j++) {
939   - oLp = _internalLpArray[j];
940   - if (!oLp.getBc(iQIndex + i, iBcIndex)) {
941   - _fnGenerateBcAndSetBc(j, iQIndex + i, iBcIndex);
942   - }
943   - }
944   -
945   - }
946   -
947   - // 处理尾部
948   - iLpIndex = aEndBcIndex[0];
949   - iQIndex = aEndBcIndex[1];
950   - iBcIndex = aEndBcIndex[2];
951   -
952   - // 删除尾部多余的班次
953   - for (j = iLpIndex; j < _internalLpArray.length; j++) {
954   - oLp = _internalLpArray[j];
955   - if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {
956   - oLp.removeBc(iQIndex, iBcIndex);
957   - }
958   - }
959   -
960   - if (aStartBcIndex[1] != aEndBcIndex[1]) { // 指定时间范围跨圈
961   - for (j = 0; j < iLpIndex; j++) {
962   - oLp = _internalLpArray[j];
963   - if (!oLp.getBc(iQIndex, iBcIndex)) {
964   - _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);
965   - }
966   - }
967   - } else {
968   - // 不跨圈,不用处理,处理头的时候已经加了
969   - }
970   -
971   - }
972   -
973   - },
974   -
975   - /**
976   - * 按照营运时间要求补充班次,
977   - * 早高峰7:45分以前出场运营,
978   - * 晚高峰16:10分以前出场运营
979   - */
980   - fnCalcuLpBc_yy: function() {
981   - // 补班次的时候,针对的是分班班型
982   - var i;
983   - var _oLp;
984   - var _oBc;
985   - var _aMinBcIndex;
986   - var _aMaxBcIndex;
987   -
988   - var _qIndex;
989   - var _bIndex;
990   -
991   - var _zgfCDate = _paramObj.toTimeObj("7:45");
992   - var _wgfCDate = _paramObj.toTimeObj("16:10");
993   - var _ccsj;
994   -
995   - for (i = 0; i < _internalLpArray.length; i++) {
996   - _oLp = _internalLpArray[i];
997   - if (_oLp.isBxFb()) { // 分班路牌
998   - // 早高峰部分
999   - _aMinBcIndex = _oLp.getMinBcObjPosition();
1000   - _qIndex = _aMinBcIndex[0];
1001   - _bIndex = _aMinBcIndex[1];
1002   - _oBc = _oLp.getBc(_qIndex, _bIndex);
1003   - if (_qIsUp) {
1004   - _ccsj = _bIndex == 0 ?
1005   - _paramObj.getUpOutTime() :
1006   - _paramObj.getDownOutTime();
1007   - } else {
1008   - _ccsj = _bIndex == 0 ?
1009   - _paramObj.getDownOutTime() :
1010   - _paramObj.getUpOutTime();
1011   - }
1012   - if (_zgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {
1013   - _fnGenerateBcAndSetBc(
1014   - i,
1015   - _bIndex == 0 ? _qIndex - 1 : _qIndex,
1016   - _bIndex == 0 ? 1 : 0
1017   - )
1018   - }
1019   -
1020   - // 晚高峰部分
1021   - _aMaxBcIndex = _oLp.getMaxBcObjPosition();
1022   - _qIndex = _aMaxBcIndex[0];
1023   - _bIndex = _aMaxBcIndex[1];
1024   - _oBc = _oLp.getBc(
1025   - _bIndex == 0 ? _qIndex - 1 : _qIndex,
1026   - _bIndex == 0 ? 1 : 0
1027   - );
1028   - if (!_oBc) { // 前一个班次不存在,再判定加不加
1029   - _oBc = _oLp.getBc(_qIndex, _bIndex);
1030   - if (_qIsUp) {
1031   - _ccsj = _bIndex == 0 ?
1032   - _paramObj.getUpOutTime() :
1033   - _paramObj.getDownOutTime();
1034   - } else {
1035   - _ccsj = _bIndex == 0 ?
1036   - _paramObj.getDownOutTime() :
1037   - _paramObj.getUpOutTime();
1038   - }
1039   - if (_wgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {
1040   - _fnGenerateBcAndSetBc(
1041   - i,
1042   - _bIndex == 0 ? _qIndex - 1 : _qIndex,
1043   - _bIndex == 0 ? 1 : 0
1044   - )
1045   - }
1046   - }
1047   - }
1048   - }
1049   - },
1050   -
1051   - /**
1052   - * 补充做5休2的班型班次。
1053   - * 1、确认5_2班型大致多少圈(小数点过.7进位)
1054   - * 2、获取当前5_2两端车次链的信息,每段的班次数目,还差几个班次没加
1055   - * 3、如果前面的车次链班次少,则从前面的车次链开始加
1056   - * 4、如果车次链班次数一样,从从后面的车次链开始加
1057   - * 5、加班次时都是往车次链前方加
1058   - * 6、如果前面车次链不能再加班次了,从后面车次链加
1059   - */
1060   - fnCalcuLpBx_5_2: function() {
1061   - // 计算做5休2班型所需的班次数
1062   - var iBxBcount = _aBxDesc[6].fBcCount;
1063   - if (iBxBcount - Math.floor(iBxBcount) > 0.7) {
1064   - iBxBcount = Math.floor(iBxBcount) + 1;
1065   - } else {
1066   - iBxBcount = Math.floor(iBxBcount);
1067   - }
1068   -
1069   - var i;
1070   - var j;
1071   - var oLp;
1072   - var iAddBcCount;
1073   - var oBcChain1;
1074   - var oBcChain2;
1075   - var iQindex;
1076   - var iBindex;
1077   -
1078   - for (i = 0; i < _internalLpArray.length; i++) {
1079   - oLp = _internalLpArray[i];
1080   - if (oLp.isBxFb5_2()) {
1081   - iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数
1082   - for (j = 1; j <= iAddBcCount; j++) {
1083   - oBcChain1 = oLp.fnGetBcChainInfo(0);
1084   - oBcChain2 = oLp.fnGetBcChainInfo(1);
1085   -
1086   - if (oBcChain1.bcount < oBcChain2.bcount) {
1087   - iQindex = oBcChain1.s_b == 0 ? oBcChain1.s_q - 1 : oBcChain1.s_q;
1088   - iBindex = oBcChain1.s_b == 0 ? 1 : 0;
1089   - // 往车次链往前不能加,就往后加
1090   - if (_fnGenerateBc(i, iQindex, iBindex)) {
1091   - _fnGenerateBcAndSetBc(i, iQindex, iBindex);
1092   - } else {
1093   - iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;
1094   - iBindex = oBcChain1.e_b == 0 ? 1 : 0;
1095   - _fnGenerateBcAndSetBc(i, iQindex, iBindex);
1096   - }
1097   -
1098   - } else if (oBcChain1.bcount > oBcChain2.bcount) {
1099   - iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;
1100   - iBindex = oBcChain2.s_b == 0 ? 1 : 0;
1101   - _fnGenerateBcAndSetBc(i, iQindex, iBindex);
1102   - } else {
1103   - iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;
1104   - iBindex = oBcChain2.s_b == 0 ? 1 : 0;
1105   - _fnGenerateBcAndSetBc(i, iQindex, iBindex);
1106   - }
1107   - }
1108   - }
1109   - }
1110   -
1111   - },
1112   -
1113   - /**
1114   - * 补其他分班班型班次。
1115   - * 从车次链的后面开始加
1116   - */
1117   - fnCalcuLpBx_other: function() {
1118   - // TODO:根据上标线的首班时间确定班型,小于05:59的做一休一,否则做二休一
1119   - var oSt = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
1120   - var iBxIndex = 4;
1121   - if (oSt.isBefore(_paramObj.toTimeObj("05:59"))) {
1122   - iBxIndex = 5;
1123   - }
1124   - // 计算做5休2班型所需的班次数
1125   - var iQBcount = _aBxDesc[iBxIndex].fQCount;
1126   - var iBxBcount = Math.round(iQBcount) * 2;
1127   -
1128   - var i;
1129   - var j;
1130   - var oLp;
1131   - var iAddBcCount;
1132   - var oBcChain1;
1133   - var oBcChain2;
1134   - var iQindex;
1135   - var iBindex;
1136   -
1137   - for (i = 0; i < _internalLpArray.length; i++) {
1138   - oLp = _internalLpArray[i];
1139   - if (oLp.isBxFb() && !oLp.isBxFb5_2()) {
1140   - iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数
1141   - for (j = 1; j <= iAddBcCount; j++) {
1142   - oBcChain1 = oLp.fnGetBcChainInfo(0);
1143   - oBcChain2 = oLp.fnGetBcChainInfo(1);
1144   -
1145   - if (oBcChain1.bcount < oBcChain2.bcount) {
1146   - iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;
1147   - iBindex = oBcChain1.e_b == 0 ? 1 : 0;
1148   - _fnGenerateBcAndSetBc(i, iQindex, iBindex);
1149   - } else if (oBcChain1.bcount > oBcChain2.bcount) {
1150   - iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;
1151   - iBindex = oBcChain2.e_b == 0 ? 1 : 0;
1152   - _fnGenerateBcAndSetBc(i, iQindex, iBindex);
1153   - } else {
1154   - iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;
1155   - iBindex = oBcChain2.e_b == 0 ? 1 : 0;
1156   - _fnGenerateBcAndSetBc(i, iQindex, iBindex);
1157   - }
1158   - }
1159   - }
1160   - }
1161   -
1162   - },
1163   -
1164   - /**
1165   - * 补充连班路牌班次。
1166   - * 1、上标线,中标线中间的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向上标线起始班次靠拢
1167   - * 2、中标线以下的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向中标线起始班次靠拢
1168   - */
1169   - fnCalcuLpBx_lb: function() {
1170   - // 补充连班的班次,参照上标线,中标线补充不足的班次
1171   -
1172   - var aLbLpindexes = []; // 除上标线,中标线的连班路牌索引
1173   - var i;
1174   - for (i = 0; i < _internalLpArray.length; i++) {
1175   - if (_internalLpArray[i].isBxLb() && i != 0 && i != _iZbx_lpIndex) {
1176   - aLbLpindexes.push(i);
1177   - }
1178   - }
1179   -
1180   - var oEndsj = // 结束时间
1181   - _paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj()) ?
1182   - _paramObj.getDownLastDTimeObj() :
1183   - _paramObj.getUpLastDtimeObj();
1184   -
1185   - var oLp;
1186   - var aMinbcPos;
1187   - var oBc;
1188   - var j;
1189   - var iTempBcIndex;
1190   -
1191   - // 1、从最小班次开始,往后补充班次
1192   - for (i = 0; i < aLbLpindexes.length; i++) {
1193   - oLp = _internalLpArray[aLbLpindexes[i]];
1194   -
1195   - // 最小班次索引
1196   - aMinbcPos = oLp.getMinBcObjPosition();
1197   - // 使用纵向分隔补充班次,从最小班次向后补
1198   - iTempBcIndex = aMinbcPos[1] == 0 ? 1 : 0;
1199   - j = iTempBcIndex == 0 ? aMinbcPos[0] + 1 : aMinbcPos[0];
1200   -
1201   - while (j < _qCount) {
1202   - while (iTempBcIndex <= 1) {
1203   - oBc = _fnGenerateBc(aLbLpindexes[i], j, iTempBcIndex);
1204   - if (oBc &&
1205   - oBc.getFcTimeObj().isBefore(oEndsj) ) {
1206   - oLp.setBc(j, iTempBcIndex, oBc);
1207   - }
1208   - iTempBcIndex++;
1209   - }
1210   - iTempBcIndex = 0;
1211   - j++;
1212   - }
1213   -
1214   - }
1215   -
1216   - // 2、上标线中标线之间的路牌,从最小的班次往前补充班次
1217   -
1218   - // 还要补充缺失的班次,差上标线几个班次要往前补上
1219   - var iBccount;
1220   - var iQindex;
1221   - var iBindex;
1222   - // 补上标线到中标线之间的连班路牌的班次
1223   - for (i = 0; i < aLbLpindexes.length; i++) {
1224   - if (aLbLpindexes[i] > 0 && aLbLpindexes[i] < _iZbx_lpIndex) {
1225   - oLp = _internalLpArray[aLbLpindexes[i]];
1226   - aMinbcPos = oLp.getMinBcObjPosition();
1227   - iQindex = aMinbcPos[0];
1228   - iBindex = aMinbcPos[1];
1229   - iBccount = (iQindex - 1) * 2 + iBindex; // 距离上标线起始站点差几个班次
1230   - for (j = 0; j < iBccount; j++) {
1231   - if (iBindex == 0) {
1232   - iQindex --;
1233   - iBindex = 1;
1234   - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
1235   - } else if (iBindex == 1) {
1236   - iBindex --;
1237   - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
1238   - }
1239   - }
1240   -
1241   - }
1242   -
1243   - }
1244   -
1245   - // 3、中标线之后的路牌,从最小的班次往前补充班次
1246   -
1247   - // 补中标线以下的连班路牌的班次
1248   - for (i = 0; i < aLbLpindexes.length; i++) {
1249   - if (aLbLpindexes[i] > _iZbx_lpIndex) {
1250   - oLp = _internalLpArray[aLbLpindexes[i]];
1251   - aMinbcPos = oLp.getMinBcObjPosition();
1252   - iQindex = aMinbcPos[0];
1253   - iBindex = aMinbcPos[1];
1254   - iBccount = (iQindex - 0) * 2 + iBindex - 1; // 距离上标线起始站点差几个班次
1255   - for (j = 0; j < iBccount; j++) {
1256   - if (iBindex == 0) {
1257   - iQindex --;
1258   - iBindex = 1;
1259   - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
1260   - } else if (iBindex == 1) {
1261   - iBindex --;
1262   - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
1263   - }
1264   - }
1265   - }
1266   - }
1267   -
1268   - },
1269   -
1270   - /**
1271   - * 计算末班车。
1272   - * 1、将上下行拉成上下行两个班次列表(包括标记班次)
1273   - * 2、分别找出离末班车发车时间最近的班次,并替换时间
1274   - * 3、删除之后的班次
1275   - */
1276   - fnCalcuLastBc: function() {
1277   - var i;
1278   - var iTimeDiff;
1279   - var iTempTime;
1280   - var aBc;
1281   - var oLastBcTime;
1282   - var oLastBcIsUp;
1283   - var iModifyIndex;
1284   -
1285   - // 查找末班车早的末班车时间和方向
1286   - if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
1287   - oLastBcTime = _paramObj.getUpLastDtimeObj();
1288   - oLastBcIsUp = true;
1289   - } else {
1290   - oLastBcTime = _paramObj.getDownLastDTimeObj();
1291   - oLastBcIsUp = false;
1292   - }
1293   -
1294   - // 确定早的末班车时间
1295   - aBc = _fnGetBcList(oLastBcIsUp);
1296   - for (i = 0; i < aBc.length; i++) {
1297   - iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
1298   - if (iTimeDiff == undefined) {
1299   - iTimeDiff = iTempTime;
1300   - iModifyIndex = i;
1301   - } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
1302   - iTimeDiff = iTempTime;
1303   - iModifyIndex = i;
1304   - }
1305   - }
1306   - aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
1307   - aBc[iModifyIndex].fnSetDelFlag(false);
1308   - aBc[iModifyIndex].fnSetIsLastBc(true);
1309   - for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
1310   - _qIsUp == oLastBcIsUp ?
1311   - aBc[i]._$$_internal_group_obj.setBc1(undefined) :
1312   - aBc[i]._$$_internal_group_obj.setBc2(undefined);
1313   - }
1314   -
1315   - // 查找末班车晚的末班车时间和方向
1316   - if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
1317   - oLastBcTime = _paramObj.getDownLastDTimeObj();
1318   - oLastBcIsUp = false;
1319   - } else {
1320   - oLastBcTime = _paramObj.getUpLastDtimeObj();
1321   - oLastBcIsUp = true;
1322   - }
1323   - // 确定晚的末班车时间
1324   - aBc = _fnGetBcList(oLastBcIsUp);
1325   - var oBc;
1326   - var aBcIndex;
1327   - var iLpIndex;
1328   - var iQIndex;
1329   - var iBcIndex;
1330   -
1331   - iTimeDiff = undefined;
1332   - for (i = 0; i < aBc.length; i++) {
1333   - oBc = aBc[i];
1334   - aBcIndex = _fnGetBcIndex(oBc);
1335   -
1336   - iLpIndex = aBcIndex[0];
1337   - iQIndex = aBcIndex[2] == 0 ? aBcIndex[1] -1 : aBcIndex[1];
1338   - iBcIndex = aBcIndex[2] == 0 ? 1 : 0;
1339   -
1340   - if (!_internalLpArray[iLpIndex].getBc(iQIndex, iBcIndex)) {
1341   - continue;
1342   - }
1343   -
1344   - iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
1345   - if (iTimeDiff == undefined) {
1346   - iTimeDiff = iTempTime;
1347   - iModifyIndex = i;
1348   - } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
1349   - iTimeDiff = iTempTime;
1350   - iModifyIndex = i;
1351   - }
1352   - }
1353   - aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
1354   - aBc[iModifyIndex].fnSetDelFlag(false);
1355   - aBc[iModifyIndex].fnSetIsLastBc(true);
1356   - for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
1357   - _qIsUp == oLastBcIsUp ?
1358   - aBc[i]._$$_internal_group_obj.setBc1(undefined) :
1359   - aBc[i]._$$_internal_group_obj.setBc2(undefined);
1360   - }
1361   -
1362   - },
1363   -
1364   - /**
1365   - * 添加吃饭班次。
1366   - */
1367   - fnCalcuEatBc: function() {
1368   - // 吃午饭时间范围,10:15 到 12:15
1369   - // 吃晚饭时间范围,18:00 到 19:00
1370   -
1371   - if (!_paramObj.fnIsEat()) {
1372   - return;
1373   - }
1374   -
1375   - // 午饭index
1376   - var aLEIndex;
1377   - // 晚饭index
1378   - var aDEIndex;
1379   -
1380   - // 所有吃饭都默认在一个方向,两个方向暂时不考虑
1381   - if (_paramObj.fnIsUpEat()) {
1382   - aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), true, false);
1383   - aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), true, false);
1384   - } else {
1385   - aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), false, true);
1386   - aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), false, true);
1387   - }
1388   -
1389   - // 午饭第几圈,第几个班次
1390   - var iLEQIndex = aLEIndex[0];
1391   - var iLEBIndex = aLEIndex[1];
1392   - // 晚饭第几圈,第几个班次
1393   - var iDEQIndex = aDEIndex[0];
1394   - var iDEBIndex = aDEIndex[1];
1395   -
1396   - // 注意,本模型只有连班才有吃饭
1397   -
1398   - var i;
1399   - var oLp;
1400   - var aLbIndex = []; // 连班班型的路牌索引
1401   - for (i = 0; i < _internalLpArray.length; i++) {
1402   - oLp = _internalLpArray[i];
1403   - if (oLp.isBxLb()) {
1404   - aLbIndex.push(i);
1405   - }
1406   - }
1407   -
1408   - var iLTime;
1409   - var iDtime;
1410   - var j;
1411   - for (i = 0; i < aLbIndex.length; i++) {
1412   - oLp = _internalLpArray[aLbIndex[i]];
1413   -
1414   - // 午饭
1415   - iLTime = oLp.fnAddEatBc(iLEQIndex, iLEBIndex, _factory, _paramObj);
1416   - // 晚饭
1417   - iDtime = oLp.fnAddEatBc(iDEQIndex, iDEBIndex, _factory, _paramObj);
1418   -
1419   - if (i == aLbIndex.length - 1) {
1420   - for (j = aLbIndex[i]; j < _internalLpArray.length; j++) {
1421   - oLp = _internalLpArray[j];
1422   - if (oLp.isBxFb()) { // 5休2班型不调整
1423   - // 修正午饭之后路牌班次的发车时间
1424   - oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);
1425   - oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);
1426   - }
1427   - }
1428   - } else {
1429   - for (j = aLbIndex[i]; j < aLbIndex[i + 1]; j++) {
1430   - oLp = _internalLpArray[j];
1431   - if (oLp.isBxFb()) {
1432   - // 修正午饭之后路牌班次的发车时间
1433   - oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);
1434   - oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);
1435   - }
1436   - }
1437   - }
1438   - }
1439   -
1440   - },
1441   -
1442   - /**
1443   - * 补每个路牌的其他班次(进出场,例保班次)。
1444   - */
1445   - fnCalcuOtherBc_: function() {
1446   - var i;
1447   - var _lpObj;
1448   - var _minBcIndex;
1449   - var _maxBcIndex;
1450   - var _minBc;
1451   - var _maxBc;
1452   - var _otherbc = [];
1453   - var _oFbbc;
1454   -
1455   - for (i = 0; i < _internalLpArray.length; i++) {
1456   - _lpObj = _internalLpArray[i];
1457   - _minBcIndex = _lpObj.getMinBcObjPosition();
1458   - _maxBcIndex = _lpObj.getMaxBcObjPosition();
1459   - _minBc = _lpObj.getBc(_minBcIndex[0], _minBcIndex[1]);
1460   - _maxBc = _lpObj.getBc(_maxBcIndex[0], _maxBcIndex[1]);
1461   -
1462   - _otherbc = [];
1463   - _otherbc.push(_factory.createBcObj(
1464   - _lpObj, "bd", true, 1,
1465   - _minBc.getFcTimeObj(),
1466   - _paramObj
1467   - ));
1468   - _otherbc.push(_factory.createBcObj(
1469   - _lpObj, "out", true, 1,
1470   - _minBc.getFcTimeObj(),
1471   - _paramObj
1472   - ));
1473   -
1474   - _maxBc.setArrTimeObj(_paramObj.addMinute(_maxBc.getFcTimeObj(), _maxBc.getBcTime()));
1475   - _maxBc.setStopTime(0);
1476   - _otherbc.push(_factory.createBcObj(
1477   - _lpObj, "in", true, 1,
1478   - _maxBc.getArrTimeObj(),
1479   - _paramObj
1480   - ));
1481   - _otherbc.push(_factory.createBcObj(
1482   - _lpObj, "lc", true, 1,
1483   - _maxBc.getArrTimeObj(),
1484   - _paramObj
1485   - ));
1486   -
1487   - // 5休2分班出场例保班次
1488   - if (_lpObj.isBxFb5_2()) {
1489   - _oFbbc = _lpObj.getBc(
1490   - _lpObj.fnGetBcChainInfo(1)["s_q"],
1491   - _lpObj.fnGetBcChainInfo(1)["s_b"]
1492   - );
1493   -
1494   - _otherbc.push(_factory.createBcObj(
1495   - _lpObj, "bd", true, 1,
1496   - _oFbbc.getFcTimeObj(),
1497   - _paramObj
1498   - ));
1499   - _otherbc.push(_factory.createBcObj(
1500   - _lpObj, "out", true, 1,
1501   - _oFbbc.getFcTimeObj(),
1502   - _paramObj
1503   - ));
1504   - }
1505   -
1506   - _lpObj.addOtherBcArray(_otherbc);
1507   - }
1508   -
1509   - },
1510   -
1511   - /**
1512   - * 补每个路牌的其他班次(进出场,例保班次)
1513   - * 所有的车次链前后都加进出场、报道班次
1514   - */
1515   - fnCalcuOtherBc: function() {
1516   - var i;
1517   - var j;
1518   - var iBcChainCount;
1519   - var oLp;
1520   - var aOtherBc;
1521   - var oStartBc;
1522   - var oEndBc;
1523   -
1524   - for (i = 0; i < _internalLpArray.length; i++) {
1525   - aOtherBc = [];
1526   - oLp = _internalLpArray[i];
1527   - iBcChainCount = oLp.fnGetBcChainCount();
1528   -
1529   - if (iBcChainCount == 1) { // 只有一个车次链,是连班班型
1530   - // 头部要添加出场,例保班次
1531   - oStartBc = oLp.getBc(
1532   - oLp.fnGetBcChainInfo(0)["s_q"],
1533   - oLp.fnGetBcChainInfo(0)["s_b"]
1534   - );
1535   - aOtherBc.push(_factory.createBcObj(
1536   - oLp, "bd", true, 1,
1537   - oStartBc.getFcTimeObj(),
1538   - _paramObj
1539   - ));
1540   - aOtherBc.push(_factory.createBcObj(
1541   - oLp, "out", true, 1,
1542   - oStartBc.getFcTimeObj(),
1543   - _paramObj
1544   - ));
1545   -
1546   - // 尾部需添加进场,例保班次
1547   - oEndBc = oLp.getBc(
1548   - oLp.fnGetBcChainInfo(0)["e_q"],
1549   - oLp.fnGetBcChainInfo(0)["e_b"]
1550   - );
1551   - oEndBc.fnSetIsLastBc(false); // 有可能最后一个班次是吃饭班次,重置
1552   - oEndBc.fnSetEatTime(0); // 有可能最后一个班次是吃饭班次,重置
1553   - aOtherBc.push(_factory.createBcObj(
1554   - oLp, "in", true, 1,
1555   - oEndBc.getArrTimeObj(),
1556   - _paramObj
1557   - ));
1558   - aOtherBc.push(_factory.createBcObj(
1559   - oLp, "lc", true, 1,
1560   - oEndBc.getArrTimeObj(),
1561   - _paramObj
1562   - ));
1563   - } else if (iBcChainCount == 2) { // 两个车次链,是分班班型
1564   - // 第一个车次链开头有出场,报到班次,车次链结尾只有进场班次
1565   - oStartBc = oLp.getBc(
1566   - oLp.fnGetBcChainInfo(0)["s_q"],
1567   - oLp.fnGetBcChainInfo(0)["s_b"]
1568   - );
1569   - aOtherBc.push(_factory.createBcObj(
1570   - oLp, "bd", true, 1,
1571   - oStartBc.getFcTimeObj(),
1572   - _paramObj
1573   - ));
1574   - aOtherBc.push(_factory.createBcObj(
1575   - oLp, "out", true, 1,
1576   - oStartBc.getFcTimeObj(),
1577   - _paramObj
1578   - ));
1579   -
1580   - oEndBc = oLp.getBc(
1581   - oLp.fnGetBcChainInfo(0)["e_q"],
1582   - oLp.fnGetBcChainInfo(0)["e_b"]
1583   - );
1584   - aOtherBc.push(_factory.createBcObj(
1585   - oLp, "in", true, 1,
1586   - oEndBc.getArrTimeObj(),
1587   - _paramObj
1588   - ));
1589   -
1590   - // 第二个车次链开头有出场,报到班次,车次链结尾有进场,报到班次
1591   - oStartBc = oLp.getBc(
1592   - oLp.fnGetBcChainInfo(1)["s_q"],
1593   - oLp.fnGetBcChainInfo(1)["s_b"]
1594   - );
1595   - aOtherBc.push(_factory.createBcObj(
1596   - oLp, "bd", true, 1,
1597   - oStartBc.getFcTimeObj(),
1598   - _paramObj
1599   - ));
1600   - aOtherBc.push(_factory.createBcObj(
1601   - oLp, "out", true, 1,
1602   - oStartBc.getFcTimeObj(),
1603   - _paramObj
1604   - ));
1605   -
1606   - oEndBc = oLp.getBc(
1607   - oLp.fnGetBcChainInfo(1)["e_q"],
1608   - oLp.fnGetBcChainInfo(1)["e_b"]
1609   - );
1610   - aOtherBc.push(_factory.createBcObj(
1611   - oLp, "in", true, 1,
1612   - oEndBc.getArrTimeObj(),
1613   - _paramObj
1614   - ));
1615   - aOtherBc.push(_factory.createBcObj(
1616   - oLp, "lc", true, 1,
1617   - oEndBc.getArrTimeObj(),
1618   - _paramObj
1619   - ));
1620   -
1621   -
1622   - } else {
1623   - // 2个车次链以上,暂时没有此班型
1624   - }
1625   -
1626   - oLp.addOtherBcArray(aOtherBc);
1627   - }
1628   - },
1629   -
1630   - /**
1631   - * 祛除上标线开头的删除标记的班次。
1632   - */
1633   - fnRemoveDelFirstFlagBc: function() {
1634   - var oLp = _internalLpArray[0];
1635   - var aMinBcIndex = oLp.getMinBcObjPosition();
1636   - if (oLp.getBc(aMinBcIndex[0], aMinBcIndex[1]).fnIsDelFlag()) {
1637   - oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]);
1638   - }
1639   - },
1640   - /**
1641   - * 祛除上标线结尾的删除标记的班次。
1642   - */
1643   - fnRemoveDelLastFlagBc: function() {
1644   - var oLp = _internalLpArray[0];
1645   - var aMaxBcIndex = oLp.getMaxBcObjPosition();
1646   - if (oLp.getBc(aMaxBcIndex[0], aMaxBcIndex[1]).fnIsDelFlag()) {
1647   - oLp.removeBc(aMaxBcIndex[0], aMaxBcIndex[1]);
1648   - }
1649   - },
1650   -
1651   - /**
1652   - * 调整路牌班次间隔(核准周转时间,停站时间)。
1653   - * @param iFre int 迭代次数
1654   - */
1655   - fnAdjustLpBcInterval: function(iFre) {
1656   - if (iFre > 0) {
1657   - for (var i = 0; i < _internalLpArray.length; i++) {
1658   - _internalLpArray[i].fnAdjustBcInterval(
1659   - this.fnCalcuAverPeakStopTime(),
1660   - this.fnCalcuAverTroughStopTime(),
1661   - _paramObj);
1662   - }
1663   -
1664   - this.fnAdjustLpBcInterval(iFre - 1);
1665   - }
1666   - },
1667   -
1668   - /**
1669   - * 调整班次间隔。
1670   - * @param bIsUp 是否上行
1671   - * @param oStartTime 开始时间对象
1672   - * @param iFre 迭代次数
1673   - */
1674   - fnAdjustBcInterval2_: function(bIsUp, oStartTime, iFre) {
1675   - if (iFre > 0) {
1676   - var aBc = _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
1677   - aBc.sort(function(o1, o2) {
1678   - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
1679   - return -1;
1680   - } else {
1681   - return 1;
1682   - }
1683   - });
1684   - var i;
1685   - var j;
1686   -
1687   - var iBcCountOfGroup = 3; // 3个班次取一次计算
1688   - var aBcOfGroup; // 3个班次列表
1689   - var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
1690   -
1691   - for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
1692   - aBcOfGroup = [];
1693   - aBcIntervalOfGroup = [];
1694   - for (j = i; j < i + iBcCountOfGroup; j++) {
1695   - aBcOfGroup.push(aBc[j]);
1696   - }
1697   -
1698   - for (j = 0; j < aBcOfGroup.length; j++) {
1699   - if (j < aBcOfGroup.length - 1) {
1700   - aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
1701   - aBcOfGroup[j].getFcTimeObj(), "m"));
1702   - }
1703   - }
1704   -
1705   - if (aBcIntervalOfGroup[0] < 19) {
1706   - aBcOfGroup[1].addMinuteToFcsj(1);
1707   - } else if (aBcIntervalOfGroup[0] > 20) {
1708   - aBcOfGroup[1].addMinuteToFcsj(-1);
1709   - } else {
1710   - if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
1711   - //continue;
1712   - } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
1713   - aBcOfGroup[1].addMinuteToFcsj(-1);
1714   - } else {
1715   - aBcOfGroup[1].addMinuteToFcsj(1);
1716   - }
1717   - }
1718   -
1719   - }
1720   -
1721   - this.fnAdjustBcInterval2(bIsUp, oStartTime, iFre - 1);
1722   - }
1723   - },
1724   -
1725   - /**
1726   - * 调整班次间隔。
1727   - * @param boolean isUp 是否上行
1728   - * @param oStartTime 开始时间对象
1729   - * @param fre int 迭代次数
1730   - */
1731   - fnAdjustBcInterval: function(isUp, oStartTime, fre) {
1732   - if (fre > 0) {
1733   - var aBc = !oStartTime ? _fnGetBcList(isUp) : _fnGetBcList2(isUp, oStartTime); // 指定方向的班次列表
1734   -
1735   - aBc.sort(function(o1, o2) {
1736   - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
1737   - return -1;
1738   - } else {
1739   - return 1;
1740   - }
1741   - });
1742   -
1743   - var i;
1744   - var j;
1745   -
1746   - var iBcCountOfGroup = 3; // 3个班次取一次计算
1747   - var aBcOfGroup; // 3个班次列表
1748   - var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
1749   - var oBcFcTime; // 班次发车时间
1750   -
1751   - for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
1752   - aBcOfGroup = [];
1753   - aBcIntervalOfGroup = [];
1754   - for (j = i; j < i + iBcCountOfGroup; j++) {
1755   - aBcOfGroup.push(aBc[j]);
1756   - }
1757   -
1758   - for (j = 0; j < aBcOfGroup.length; j++) {
1759   - if (j < aBcOfGroup.length - 1) {
1760   - aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
1761   - aBcOfGroup[j].getFcTimeObj(), "m"));
1762   - }
1763   - }
1764   -
1765   - // 判定规则
1766   - oBcFcTime = aBcOfGroup[1].getFcTimeObj();
1767   -
1768   - // 第一个班次发车时间不动,根据间隔,调整中间一个班次
1769   - // 如果3个班次2个间隔时间差1分钟,不调整
1770   - // 如果第一个间隔大,调整第二个班次往前1分钟
1771   - // 如果第二个间隔大,调整第二个班次往后1分钟
1772   -
1773   - if (_paramObj.isTroughBc(oBcFcTime) &&
1774   - aBcIntervalOfGroup[0] > _paramObj.getTroughMaxFcjx()) {
1775   - aBcOfGroup[1].addMinuteToFcsj(-1);
1776   - }
1777   -
1778   - //else if (_paramObj.isMPeakBc(oBcFcTime) &&
1779   - // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {
1780   - // aBcOfGroup[1].addMinuteToFcsj(1);
1781   - //} else if (_paramObj.isMPeakBc(oBcFcTime) &&
1782   - // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {
1783   - // aBcOfGroup[1].addMinuteToFcsj(-1);
1784   - //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
1785   - // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {
1786   - // aBcOfGroup[1].addMinuteToFcsj(1);
1787   - //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
1788   - // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {
1789   - // aBcOfGroup[1].addMinuteToFcsj(-1);
1790   - //}
1791   -
1792   -
1793   - else {
1794   - if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
1795   - //continue;
1796   - } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
1797   - aBcOfGroup[1].addMinuteToFcsj(-1);
1798   - } else {
1799   - aBcOfGroup[1].addMinuteToFcsj(1);
1800   - }
1801   - }
1802   -
1803   - //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
1804   - // //continue;
1805   - //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
1806   - // aBcOfGroup[1].addMinuteToFcsj(-1);
1807   - //} else {
1808   - // aBcOfGroup[1].addMinuteToFcsj(1);
1809   - //}
1810   -
1811   -
1812   - }
1813   -
1814   - this.fnAdjustBcInterval(isUp, oStartTime, fre - 1);
1815   - }
1816   -
1817   - },
1818   -
1819   - /**
1820   - * 调整班次间隔(平均间隔)。
1821   - * @param bIsUp 是否上行
1822   - * @param oStartTime 开始时间对象
1823   - */
1824   - fnAdjustBcInterval2_avg: function(bIsUp, oStartTime) {
1825   - var aBc = !oStartTime ? _fnGetBcList(bIsUp) : _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
1826   - aBc.sort(function(o1, o2) {
1827   - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
1828   - return -1;
1829   - } else {
1830   - return 1;
1831   - }
1832   - });
1833   -
1834   - if (aBc.length == 0) {
1835   - return;
1836   - }
1837   -
1838   - var j;
1839   - var iCount = aBc.length - 1;
1840   - var iC1 = Math.floor(aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") / iCount);
1841   - var iC2 = aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") % iCount;
1842   - var iTempTime;
1843   -
1844   - for (j = 0; j < iCount - iC2; j++) {
1845   - iTempTime = aBc[j + 1].getFcTimeObj().diff(aBc[j].getFcTimeObj(), "m");
1846   - aBc[j + 1].addMinuteToFcsj(iC1 - iTempTime);
1847   - }
1848   - for (j = 0; j < iC2; j++) {
1849   - iTempTime = aBc[iCount - iC2 + j + 1].getFcTimeObj().diff(aBc[iCount - iC2 + j].getFcTimeObj(), "m");
1850   - aBc[iCount - iC2 + j + 1].addMinuteToFcsj(iC1 + 1 - iTempTime);
1851   - }
1852   -
1853   - },
1854   -
1855   - /**
1856   - * 计算高峰平均停站时间。
1857   - */
1858   - fnCalcuAverPeakStopTime: function() {
1859   - var i;
1860   - var j;
1861   - var aBc;
1862   - var iBcCount = 0;
1863   - var iSum = 0;
1864   - for (i = 0; i < _internalLpArray.length; i++) {
1865   - aBc = _internalLpArray[i].getBcArray();
1866   -
1867   - for (j = 0; j < aBc.length; j++) {
1868   - if (!_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
1869   - iBcCount ++;
1870   - iSum += aBc[j].getStopTime();
1871   - }
1872   - }
1873   - }
1874   -
1875   - return Math.floor(iSum / iBcCount);
1876   - },
1877   -
1878   - /**
1879   - * 计算低谷平均停站时间。
1880   - */
1881   - fnCalcuAverTroughStopTime: function() {
1882   - var i;
1883   - var j;
1884   - var aBc;
1885   - var iBcCount = 0;
1886   - var iSum = 0;
1887   - for (i = 0; i < _internalLpArray.length; i++) {
1888   - aBc = _internalLpArray[i].getBcArray();
1889   - for (j = 0; j < aBc.length; j++) {
1890   - if (_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
1891   - iBcCount ++;
1892   - iSum += aBc[j].getStopTime();
1893   - }
1894   - }
1895   - }
1896   -
1897   - return Math.floor(iSum / iBcCount);
1898   - },
1899   -
1900   - //------------- 其他方法 -------------//
1901   - /**
1902   - * 返回内部路牌数据列表。
1903   - * @returns {Array}
1904   - */
1905   - fnGetLpArray: function() {
1906   - return _internalLpArray;
1907   - },
1908   -
1909   - /**
1910   - * 内部数据转化成显示用的班次数组。
1911   - */
1912   - fnToGanttBcArray: function() {
1913   - var aAllBc = [];
1914   - var aLpBc = [];
1915   - var aEatBc = [];
1916   - var oLp;
1917   - var i;
1918   - var j;
1919   -
1920   - for (i = 0; i < _internalLpArray.length; i++) {
1921   - oLp = _internalLpArray[i];
1922   - aLpBc = [];
1923   - aLpBc = aLpBc.concat(oLp.getOtherBcArray(), oLp.getBcArray());
1924   -
1925   - aEatBc = [];
1926   - // 根据班次的吃饭时间添加吃饭班次
1927   - for (j = 0; j < aLpBc.length; j++) {
1928   - if (aLpBc[j].fnGetEatTime() > 0) {
1929   - aEatBc.push(_factory.createBcObj(
1930   - oLp,
1931   - "cf",
1932   - !aLpBc[j].isUp(), // 和上一个班次方向相反
1933   - 1,
1934   - _paramObj.addMinute(aLpBc[j].getArrTimeObj(), aLpBc[j].getStopTime()), // 使用上一个班次的到达时间作为开始时间
1935   - _paramObj
1936   - ));
1937   - }
1938   - }
1939   - aLpBc = aLpBc.concat(aEatBc);
1940   -
1941   - // 按照发车时间排序
1942   - aLpBc.sort(function(o1, o2) {
1943   - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
1944   - return -1;
1945   - } else {
1946   - return 1;
1947   - }
1948   - });
1949   -
1950   - // 重新赋值fcno
1951   - for (j = 0; j < aLpBc.length; j++) {
1952   - aLpBc[j].fnSetFcno(j + 1);
1953   - }
1954   -
1955   - aAllBc = aAllBc.concat(aLpBc);
1956   - }
1957   -
1958   - var aGanttBc = [];
1959   - for (i = 0; i < aAllBc.length; i++) {
1960   - aGanttBc.push(aAllBc[i].toGanttBcObj());
1961   - }
1962   -
1963   - return aGanttBc;
1964   - }
1965   -
1966   - };
1967   -
  1 +/**
  2 + * 内部行车计划对象。
  3 + * @constructor
  4 + */
  5 +var InternalScheduleObj = function(paramObj, lpArray, factory) {
  6 + // 参数对象
  7 + var _paramObj = paramObj;
  8 + // 外部的路牌数组
  9 + var _lpArray = lpArray;
  10 + // 工厂对象
  11 + var _factory = factory;
  12 +
  13 + //------------------ 初始化方法1,以及计算关联的内部变量 -----------------//
  14 + var _qIsUp; // 每一圈是上行开始还是下行开始
  15 + var _qCount = 0; // 总的圈数
  16 + var _internalLpArray = []; // 内部对象数组
  17 + var _aBxDesc = [ // 各种班型描述(班型名称,平均工时,平均需要的班次数,平均工时)
  18 + {'sType':'六工一休', 'fHoursV':6.66, 'fBcCount': 0, 'fAverTime': 0},
  19 + {'sType':'五工一休', 'fHoursV':6.85, 'fBcCount': 0, 'fAverTime': 0},
  20 + {'sType':'四工一休', 'fHoursV':7.14, 'fBcCount': 0, 'fAverTime': 0},
  21 + {'sType':'三工一休', 'fHoursV':7.61, 'fBcCount': 0, 'fAverTime': 0},
  22 + {'sType':'二工一休', 'fHoursV':8.57, 'fBcCount': 0, 'fAverTime': 0},
  23 + {'sType':'一工一休', 'fHoursV':11.42, 'fBcCount': 0, 'fAverTime': 0},
  24 + {'sType':'五工二休', 'fHoursV':7.99, 'fBcCount': 0, 'fAverTime': 0},
  25 + {'sType':'无工休', 'fHoursV':5.43, 'fBcCount': 0, 'fAverTime': 0}
  26 + ];
  27 +
  28 + var _fnInitFun1 = function() { // 初始化方法1
  29 + console.log("//---------------- 行车计划,初始化方法1 start ----------------//");
  30 +
  31 + //----------------------- 1、确定上标线的方向,圈的方向 -------------------//
  32 +
  33 + // 确定_qIsUp,哪个方向的首班车晚就用哪个
  34 + _qIsUp = _paramObj.getUpFirstDTimeObj().isBefore(
  35 + _paramObj.getDownFirstDTimeObj()) ? false : true;
  36 + // 上标线开始时间,就是方向的首班车时间
  37 + var st = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
  38 + // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
  39 + var et;
  40 + var et_IsUp;
  41 + if (_paramObj.getUpLastDtimeObj().isBefore(
  42 + _paramObj.getDownLastDTimeObj())) {
  43 + et = _paramObj.getDownLastDTimeObj();
  44 + et_IsUp = false;
  45 + } else {
  46 + et = _paramObj.getUpLastDtimeObj();
  47 + et_IsUp = true;
  48 + }
  49 +
  50 + //------------------------ 2、计算总共有多少圈 ------------------------//
  51 +
  52 + // 以开始时间,结束时间,构造上标线用连班班次发车时间
  53 + var bcFcsjArrays = []; // 班次发车时间对象数组
  54 + var bcArsjArrays = []; // 班次到达时间对象数组
  55 + var isUp = _qIsUp; // 方向
  56 + var bcCount = 1; // 班次数
  57 +
  58 + var _kssj = st; // 开始时间
  59 + var _bcsj = paramObj.calcuTravelTime(_kssj, isUp); // 班次历时
  60 + var _arrsj = paramObj.addMinute(_kssj, _bcsj); // 到达时间
  61 + var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj); // 停站时间
  62 +
  63 + do {
  64 + bcFcsjArrays.push(_kssj);
  65 + bcArsjArrays.push(_arrsj);
  66 +
  67 + _kssj = paramObj.addMinute(_kssj, _bcsj + _stoptime);
  68 + _bcsj = paramObj.calcuTravelTime(_kssj, isUp);
  69 + _arrsj = paramObj.addMinute(_kssj, _bcsj);
  70 + _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);
  71 +
  72 + bcCount ++;
  73 + isUp = !isUp;
  74 + } while(_kssj.isBefore(et));
  75 + bcCount--; // 因为先做do,所以总的班次要减1
  76 + //if (bcCount > 0 && bcArsjArrays[bcCount - 1].isAfter(et)) {
  77 + // // 如果最后一个班次的到达时间超过结束时间,也要去除
  78 + // bcFcsjArrays.splice(bcCount - 1, 1);
  79 + // bcArsjArrays.splice(bcCount - 1, 1);
  80 + // bcCount--;
  81 + //}
  82 + var _qCount_p1 = Math.floor(bcCount / 2); // 2个班次一圈
  83 + var _qCount_p2 = bcCount % 2; // 余下的1个班次也算一圈
  84 +
  85 + // 利用连班数组计算圈数
  86 + _qCount = 1; // 前面加1圈,补中标线的班次
  87 + _qCount += _qCount_p1;
  88 + _qCount += _qCount_p2;
  89 +
  90 + // 计算最后是不是还要补一圈
  91 + if (_qCount > 1) { // 总的圈数就1圈,没必要加了(其实是不可能的,除非参数里问题)
  92 + if (_qCount_p2 == 0) { // 没有余下班次,整数圈数
  93 + // 最后一个班次的方向一定和开始的方向相反,如:上-下,上-下,上-下,一共三圈,最后一个班次为下行
  94 + // 判定最后一个班次的方向和上标线判定结束时间的班次方向是否一致
  95 + if (!_qIsUp == et_IsUp) {
  96 + // 一致不用加圈数
  97 + } else {
  98 + // 不一致需要加圈补最后一个结束时间班次
  99 + _qCount ++;
  100 + }
  101 + } else {
  102 + // 有余下的圈数,最后要不补的班次不管上行,下行都在这一圈里
  103 + // 不需要在补圈数了
  104 + }
  105 + }
  106 +
  107 + //------------------------ 3、根据路牌数,圈数创建路牌对象 ----------------------//
  108 +
  109 + // 创建内部的路牌数组,并把之前的连班路牌添加进上标线路牌中
  110 + var i;
  111 + for (i = 0; i < _lpArray.length; i++) {
  112 + _internalLpArray.push(new InternalLpObj(_lpArray[i], _qCount, _qIsUp));
  113 + }
  114 + // 初始化上标线,从第1圈开始
  115 + _internalLpArray[0].initDataFromTimeToTime(bcFcsjArrays[0], et, _qIsUp, 1, _paramObj, _factory);
  116 +
  117 + // 以上标线为基础,计算各种班型工时对应的圈数、班次数
  118 + var aBcArray = _internalLpArray[0].getBcArray();
  119 + aBcArray[0].fnSetIsFirstBc(true); // 设置首班班次标识
  120 +
  121 + if (aBcArray.length % 2 != 0) { // 不能整除2,去除一个班次计算
  122 + aBcArray.splice(aBcArray.length - 1, 1);
  123 + }
  124 +
  125 + // 午饭吃饭时间
  126 + var iLTime = _paramObj.fnGetLunchTime();
  127 + // 晚饭吃饭时间
  128 + var iDTime = _paramObj.fnGetDinnerTime();
  129 + // 出场时间
  130 + var iOutTime = _qIsUp ? _paramObj.getUpOutTime() : _paramObj.getDownOutTime();
  131 + // 进场时间
  132 + var iInTime = _qIsUp ? _paramObj.getDownInTime() : _paramObj.getUpInTime();
  133 + // 例保时间
  134 + var iBTime = _paramObj.getLbTime();
  135 +
  136 + var sum = 0; // 总班次时间
  137 + for (i = 0; i < aBcArray.length; i++) {
  138 + sum += aBcArray[i].getBcTime() + aBcArray[i].getStopTime();
  139 + }
  140 + sum += iLTime; // 加午饭时间
  141 + sum += iDTime; // 加晚饭时间
  142 + for (i = 0; i < _aBxDesc.length; i++) {
  143 + _aBxDesc[i].fAverTime = sum / (aBcArray.length / 2); // 平均周转时间不算进出场,例保时间
  144 +
  145 + // 计算5休2的班次数(双进出场,4个例保)
  146 + if (i == 6) {
  147 + _aBxDesc[i].fQCount =
  148 + (_aBxDesc[i].fHoursV * 60 - iOutTime * 2 - iInTime * 2 - iBTime * 4) /
  149 + _aBxDesc[i].fAverTime;
  150 + _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
  151 + } else { // 进出场,2个例保
  152 + _aBxDesc[i].fQCount =
  153 + (_aBxDesc[i].fHoursV * 60 - iOutTime - iInTime - iBTime * 2) /
  154 + _aBxDesc[i].fAverTime;
  155 + _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
  156 + }
  157 + }
  158 +
  159 +
  160 + // 在第一个班次之前再添加一个模拟班次,用于中标线的作用
  161 + // 那一圈必定是低谷,而且圈索引0,班次索引1,暂时标记,最后删除
  162 + var iFirstStopTime =
  163 + _paramObj.fnCalcuFixedStopNumber(
  164 + _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -10),
  165 + _qIsUp
  166 + );
  167 + var iXXTime = _qIsUp ? _paramObj.getDownTroughTime() : _paramObj.getUpTroughTime();
  168 + var oFlagBc = _factory.createBcObj( // 标记班次
  169 + _internalLpArray[0],
  170 + "normal",
  171 + !_qIsUp,
  172 + 1,
  173 + _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -(iFirstStopTime + iXXTime)),
  174 + _paramObj
  175 + );
  176 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  177 +
  178 + _internalLpArray[0].setBc(0, 1, oFlagBc);
  179 +
  180 + // 在最后一圈也补上一个或者2个模拟班次,暂时标记,最后需要删除
  181 + var aMaxBcIndex = _internalLpArray[0].getMaxBcObjPosition();
  182 + if (aMaxBcIndex[0] == _qCount - 1) { // 可能加半圈
  183 + oFlagBc = _factory.createBcObj( // 标记班次
  184 + _internalLpArray[0],
  185 + "normal",
  186 + !_qIsUp,
  187 + 1,
  188 + _paramObj.addMinute(
  189 + _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),
  190 + _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),
  191 + _paramObj
  192 + );
  193 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  194 + _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);
  195 +
  196 + } else { // 加完整的一圈
  197 + oFlagBc = _factory.createBcObj( // 标记班次
  198 + _internalLpArray[0],
  199 + "normal",
  200 + _qIsUp,
  201 + 1,
  202 + _paramObj.addMinute(
  203 + _internalLpArray[0].getBc(_qCount - 2, 1).getArrTimeObj(),
  204 + _internalLpArray[0].getBc(_qCount - 2, 1).getStopTime()),
  205 + _paramObj
  206 + );
  207 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  208 + _internalLpArray[0].setBc(_qCount - 1, 0, oFlagBc);
  209 +
  210 + oFlagBc = _factory.createBcObj( // 标记班次
  211 + _internalLpArray[0],
  212 + "normal",
  213 + !_qIsUp,
  214 + 1,
  215 + _paramObj.addMinute(
  216 + _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),
  217 + _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),
  218 + _paramObj
  219 + );
  220 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  221 + _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);
  222 +
  223 + }
  224 +
  225 + console.log("上行首班车时间:" + _paramObj.getUpFirstDTimeObj().format("HH:mm") +
  226 + "上行末班车时间:" + _paramObj.getUpLastDtimeObj().format("HH:mm"));
  227 + console.log("下行首班车时间:" + _paramObj.getDownFirstDTimeObj().format("HH:mm") +
  228 + "下行末班车时间:" + _paramObj.getDownLastDTimeObj().format("HH:mm"));
  229 + console.log("总共计算的圈数:" + _qCount);
  230 + console.log("圈的方向isUP:" + _qIsUp);
  231 + console.log("班型描述(以下):");
  232 + console.log(_aBxDesc);
  233 + console.log("所有路牌间隔描述(以下):");
  234 + for (i = 0; i < _internalLpArray.length; i++) {
  235 + console.log(_internalLpArray[i]._$_aVerticalIntervalTime);
  236 + }
  237 + console.log("//---------------- 行车计划,初始化方法1 end ----------------//");
  238 +
  239 + };
  240 +
  241 + //------------------ 初始化方法2,以及计算关联的内部变量 ----------------//
  242 + var _approximate_zgfQIndex; // 预估早高峰车辆从第几圈开始全部发出
  243 + var _approximate_zgfBIndex; // 预估早高峰车辆从第几圈第几个班次开始全部发出(上行或下行)
  244 + var _approximate_wgfQIndex; // 预估晚高峰车辆从第几圈开始全部发出
  245 + var _approximate_wgfBIndex; // 预估晚高峰车辆从第几圈第几个班次开始全部发出(上行或下行)
  246 +
  247 + var _fnInitFun2 = function() { // 初始化方法2
  248 + console.log("//---------------- 行车计划,初始化方法2 start ----------------//");
  249 +
  250 + //------------------------ 1、计算车辆总数 ------------------------//
  251 + // 是用高峰上行周转时间除以高峰平均间隔得到的
  252 + // 这样算还算合理,车辆不多不少,待以后有新的算法再修正
  253 + var iClCount = _paramObj.calcuClzx();
  254 +
  255 + //------------------------ 2、计算所有路牌的发车在各个圈中的间隔 --------------------//
  256 + var i;
  257 + var j;
  258 + var iBindex = 1;
  259 + var iZzsj;
  260 + var oLp;
  261 + var iC1;
  262 + var iC2;
  263 +
  264 + for (i = 0; i < _qCount - 1; i++) {
  265 + while (iBindex <= 1) {
  266 + // 每圈每个方向的周转时间不一致,以上标线为主
  267 + oLp = _internalLpArray[0];
  268 + iZzsj = oLp.getBc(i + 1, iBindex).getFcTimeObj().diff(
  269 + oLp.getBc(i, iBindex).getFcTimeObj(), "m"
  270 + );
  271 +
  272 + iC1 = Math.floor(iZzsj / iClCount);
  273 + iC2 = iZzsj % iClCount;
  274 +
  275 + for (j = 0; j < iClCount - iC2; j++) {
  276 + oLp = _internalLpArray[j];
  277 + oLp.fnSetVerticalIntervalTime(i, iBindex, iC1);
  278 + }
  279 +
  280 + for (j = 0; j < iC2; j++) {
  281 + oLp = _internalLpArray[iClCount - iC2 + j];
  282 + oLp.fnSetVerticalIntervalTime(i, iBindex, iC1 + 1);
  283 + }
  284 +
  285 + iBindex ++;
  286 +
  287 + }
  288 + iBindex = 0;
  289 + }
  290 + // 最后一圈没有下一圈的参照,周转时间没发获取,由于都是低谷,所以使用倒数第二圈的间隔最为最后一圈的间隔
  291 + for (i = 0; i < _internalLpArray.length; i++) {
  292 + oLp = _internalLpArray[i];
  293 + oLp.fnSetVerticalIntervalTime(_qCount - 1, 0, oLp.fnGetVerticalIntervalTime(_qCount - 2, 0));
  294 + oLp.fnSetVerticalIntervalTime(_qCount - 1, 1, oLp.fnGetVerticalIntervalTime(_qCount - 2, 1));
  295 + }
  296 +
  297 + //------------------------ 3、预估早高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//
  298 +
  299 + // 以上标线为标准,查找离早高峰开始时间最近的班次作为早高峰开始班次
  300 + // 以这个班次为早高峰起点,全部出车策略
  301 + var qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(
  302 + _paramObj.getMPeakStartTimeObj(), true, true);
  303 + var qIndex = qbcIndexArray[0]; // 第几圈
  304 + var bIndex = qbcIndexArray[1]; // 第几个班次
  305 +
  306 + for (i = 1; i < _internalLpArray.length; i++) {
  307 + _fnGenerateBcAndSetBc(i, qIndex, bIndex);
  308 + }
  309 +
  310 + _approximate_zgfQIndex = qIndex;
  311 + _approximate_zgfBIndex = bIndex;
  312 +
  313 + //------------------------ 4、预估晚高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//
  314 +
  315 + // 以上标线为标准,查找离晚高峰开始时间最近的班次作为晚高峰开始班次
  316 + // 以这个班次为早高峰起点,全部出车策略
  317 + qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(
  318 + _paramObj.getEPeakStartTimeObj(), true, true);
  319 + qIndex = qbcIndexArray[0]; // 第几圈
  320 + bIndex = qbcIndexArray[1]; // 第几个班次
  321 +
  322 + for (i = 1; i < _internalLpArray.length; i++) {
  323 + _fnGenerateBcAndSetBc(i, qIndex, bIndex);
  324 + }
  325 +
  326 + _approximate_wgfQIndex = qIndex;
  327 + _approximate_wgfBIndex = bIndex;
  328 +
  329 + console.log("早高峰周转时间(固定最大停战时间):" + _paramObj.calcuPeakZzsj() + "分钟");
  330 + console.log("早高峰发车时间范围:" + _paramObj.getMPeakMinFcjx() + "分钟 --- " + _paramObj.getMPeakMaxFcjx() + "分钟");
  331 + console.log("预估早高峰第" + _approximate_zgfQIndex + "(index)圈,第" + _approximate_zgfBIndex + "(index)班次车辆全部发出");
  332 + console.log("预估晚高峰第" + _approximate_wgfQIndex + "(index)圈,第" + _approximate_wgfBIndex + "(index)班次车辆全部发出");
  333 + console.log("//---------------- 行车计划,初始化方法2 end ----------------//");
  334 + };
  335 +
  336 + //----------------------- 初始化方法3,计算连班分班的路牌分布 ----------------//
  337 + var _iBx_lb_lpcount; // 连班路牌数
  338 + var _iBx_5_2_fb_lpcount; // 5休2分班路牌数
  339 + var _iBx_other_fb_lpcount; // 其他分班路牌数
  340 +
  341 + var _fnInitFun3 = function() { // 初始化方法3
  342 + console.log("//---------------- 行车计划,初始化方法3 start ----------------//");
  343 +
  344 + //--------------------- 1、计算分班连班班型车辆分布数 --------------------//
  345 + // 总共车辆数(高峰最大车辆数)
  346 + var iCls = _paramObj.calcuClzx();
  347 + // 低谷最少配车(连班车数量)
  348 + var iDgminpc = Math.round(_paramObj.calcuTroughZzsj() / _paramObj.getTroughMaxFcjx());
  349 + // 加班车路牌数(做5休2的路牌数)
  350 + var i_5_2_lpes = _paramObj.getJBLpes();
  351 +
  352 + // 做些简单的验证
  353 + if (iCls < iDgminpc) {
  354 + alert("总配车数小于低谷最小配车");
  355 + throw "总配车数小于低谷最小配车";
  356 + }
  357 +
  358 + if (iDgminpc < 2) {
  359 + // alert("连班路牌小于2,办不到啊");
  360 + // throw "连班路牌小于2,办不到啊";
  361 + console.log("连班路牌小于2,则5休2之外的车辆数则为连班车辆数");
  362 + iDgminpc = iCls - i_5_2_lpes;
  363 + }
  364 + if (iCls - iDgminpc < i_5_2_lpes) {
  365 + // alert("总分班路牌数小于加班路牌数");
  366 + // throw "总分班路牌数小于加班路牌数";
  367 + console.log("总分班路牌数小于加班路牌数,则忽略其他分班路牌数");
  368 + iDgminpc = iCls - i_5_2_lpes;
  369 + }
  370 +
  371 + //// 修正连班路牌数,班次间隔大于20的,加1,直至班次间隔小于20
  372 + //while(_paramObj.calcuPeakZzsj() / iDgminpc > 20) {
  373 + // iDgminpc ++;
  374 + //}
  375 + _iBx_lb_lpcount = iDgminpc;
  376 +
  377 + _iBx_5_2_fb_lpcount = i_5_2_lpes;
  378 + _iBx_other_fb_lpcount = iCls - _iBx_lb_lpcount - i_5_2_lpes;
  379 +
  380 + //------------------------ 2、利用间隔法计算连班路牌分布 --------------------//
  381 + var i;
  382 + var j;
  383 + var iC1 = Math.floor(_internalLpArray.length / _iBx_lb_lpcount);
  384 + var iC2 = _internalLpArray.length % _iBx_lb_lpcount;
  385 + var iLpIndex;
  386 +
  387 + for (i = 0; i < _iBx_lb_lpcount - iC2; i++) {
  388 + iLpIndex = i * iC1;
  389 + _internalLpArray[iLpIndex].setBxLb(true);
  390 + _internalLpArray[iLpIndex].setBxDesc("连班");
  391 + }
  392 + for (j = 0; j < iC2; j++) {
  393 + iLpIndex = i * iC1 + j * (iC1 + 1);
  394 + _internalLpArray[iLpIndex].setBxLb(true);
  395 + _internalLpArray[iLpIndex].setBxDesc("连班");
  396 + }
  397 +
  398 + //------------------------ 3、利用间隔法计算分班班型路牌分布 --------------------//
  399 + // 获取分班路牌索引
  400 + var aNotLbIndexes = [];
  401 + for (i = 0; i < _internalLpArray.length; i++) {
  402 + if (!_internalLpArray[i].isBxLb()) {
  403 + aNotLbIndexes.push(i);
  404 + }
  405 + }
  406 + // 先5休2分班
  407 + iC1 = Math.floor(aNotLbIndexes.length / _iBx_5_2_fb_lpcount);
  408 + iC2 = aNotLbIndexes.length % _iBx_5_2_fb_lpcount;
  409 +
  410 + for (i = 0; i < _iBx_5_2_fb_lpcount - iC2; i++) {
  411 + iLpIndex = aNotLbIndexes[i * iC1];
  412 + _internalLpArray[iLpIndex].setBxLb(false);
  413 + _internalLpArray[iLpIndex].setBxFb(true);
  414 + _internalLpArray[iLpIndex].setBxFb5_2(true);
  415 + _internalLpArray[iLpIndex].setBxDesc("5休2分班");
  416 + }
  417 + for (i = 0; i < iC2; i++) {
  418 + iLpIndex = aNotLbIndexes[_iBx_5_2_fb_lpcount - iC2 + i * (iC1 + 1)];
  419 + _internalLpArray[iLpIndex].setBxLb(false);
  420 + _internalLpArray[iLpIndex].setBxFb(true);
  421 + _internalLpArray[iLpIndex].setBxFb5_2(true);
  422 + _internalLpArray[iLpIndex].setBxDesc("5休2分班");
  423 + }
  424 + // 其他分班
  425 + for (i = 0; i < aNotLbIndexes.length; i++) {
  426 + iLpIndex = aNotLbIndexes[i];
  427 + if (!_internalLpArray[iLpIndex].isBxFb5_2()) {
  428 + _internalLpArray[iLpIndex].setBxLb(false);
  429 + _internalLpArray[iLpIndex].setBxFb(true);
  430 + _internalLpArray[iLpIndex].setBxFb5_2(false);
  431 + _internalLpArray[iLpIndex].setBxDesc("其他分班");
  432 + }
  433 + }
  434 +
  435 + console.log("高峰周转时间:" + _paramObj.calcuPeakZzsj());
  436 + console.log("连班路牌数:" + _iBx_lb_lpcount);
  437 + console.log("5休2分班路牌数:" + _iBx_5_2_fb_lpcount);
  438 + console.log("其他分班路牌数:" + _iBx_other_fb_lpcount);
  439 + var aLbIndexes = [];
  440 + for (i = 0; i < _internalLpArray.length; i++) {
  441 + if (_internalLpArray[i].isBxLb()) {
  442 + aLbIndexes.push(i);
  443 + }
  444 + }
  445 + console.log("连班路牌indexes=" + aLbIndexes);
  446 + var a_5_2_fbIndexes = [];
  447 + for (i = 0; i < _internalLpArray.length; i++) {
  448 + if (_internalLpArray[i].isBxFb() && _internalLpArray[i].isBxFb5_2()) {
  449 + a_5_2_fbIndexes.push(i);
  450 + }
  451 + }
  452 + console.log("5休2分班路牌indexes=" + a_5_2_fbIndexes);
  453 + var a_other_fbIndexes = [];
  454 + for (i = 0; i < _internalLpArray.length; i++) {
  455 + if (_internalLpArray[i].isBxFb() && !_internalLpArray[i].isBxFb5_2()) {
  456 + a_other_fbIndexes.push(i);
  457 + }
  458 + }
  459 + console.log("其他分班路牌indexes=" + a_other_fbIndexes);
  460 +
  461 + console.log("//---------------- 行车计划,初始化方法3 end ----------------//");
  462 + };
  463 +
  464 + //----------------------- 初始化方法4,计算中标线位置 -------------------------//
  465 + var _iZbx_lpIndex; // 中标线对应第几个路牌
  466 +
  467 + var _fnInitFun4 = function() { // 初始化方法4
  468 + console.log("//---------------- 行车计划,初始化方法4 start ----------------//");
  469 +
  470 + //---------------------------- 1、模拟一个中标线,使用临时路牌 ----------------------//
  471 + // 构造中标线
  472 + // 中标线开始时间,就是方向的首班车时间
  473 + var oSt = !_qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
  474 + // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
  475 + // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
  476 + var oEt;
  477 + if (_paramObj.getUpLastDtimeObj().isBefore(
  478 + _paramObj.getDownLastDTimeObj())) {
  479 + oEt = _paramObj.getDownLastDTimeObj();
  480 + } else {
  481 + oEt = _paramObj.getUpLastDtimeObj();
  482 + }
  483 +
  484 + var oTempLp = new InternalLpObj({lpNo: -999, lpName: "-999"}, _qCount, _qIsUp);
  485 + oTempLp.initDataFromTimeToTime(
  486 + oSt,
  487 + oEt,
  488 + !_qIsUp,
  489 + 0,
  490 + _paramObj,
  491 + _factory
  492 + );
  493 +
  494 + //------------------------ 2、找出中标线的早高峰班次,计算应该插在当前路牌数组的那个位置 ----------------//
  495 + // 找出中标线对应的早高峰的班次对象
  496 + var oZb_gf_bc = oTempLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);
  497 + //alert(oZb_gf_bc.getFcTimeObj().format("HH:mm"));
  498 +
  499 + // 把所有连班路牌高峰班次重新构造成一个一个的圈数组,计算对应中标线最近的是第几个路牌
  500 + // 中标线和上标线一样在连班路牌上
  501 + var aTempq = [];
  502 + var oTempq;
  503 + var oTempb;
  504 + var i;
  505 + var oLp;
  506 +
  507 + var aLbIndexes = []; // 连班的路牌索引
  508 + for (i = 0; i < _internalLpArray.length; i++) {
  509 + if (_internalLpArray[i].isBxLb()) {
  510 + aLbIndexes.push(i);
  511 + }
  512 + }
  513 +
  514 + for (i = 0; i < aLbIndexes.length; i++) {
  515 + oLp = _internalLpArray[aLbIndexes[i]];
  516 +
  517 + oTempb = oLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);
  518 + if (oTempb.isUp() == _qIsUp) {
  519 + oTempq = new InternalGroupObj(oLp, _qIsUp, oTempb, undefined);
  520 + } else {
  521 + oTempq = new InternalGroupObj(oLp, _qIsUp, undefined, oTempb);
  522 + }
  523 + aTempq.push(oTempq);
  524 +
  525 + }
  526 +
  527 + var aTtindex = oTempLp.fnGetQBcIndexWithFcTimeFromGroupArray( // 找出最接近中标线的路牌索引
  528 + oZb_gf_bc.getFcTimeObj(),
  529 + aTempq,
  530 + true,
  531 + true
  532 + );
  533 +
  534 + _iZbx_lpIndex = aLbIndexes[aTtindex[0]]; // 中标线放在第几个路牌
  535 +
  536 + oTempLp.getMinBcObj().fnSetIsFirstBc(true); // 设置首班班次标识
  537 +
  538 + if (_iZbx_lpIndex == 0) { // 如果中标线和上标线一致
  539 + var oFirstBcIndexes = oTempLp.getMinBcObjPosition();
  540 + var oFirstBc = oTempLp.getMinBcObj();
  541 + oFirstBc.setLp(_internalLpArray[_iZbx_lpIndex]);
  542 + oFirstBc.fnSetDelFlag(false);
  543 + _internalLpArray[_iZbx_lpIndex].setBc(oFirstBcIndexes[0], oFirstBcIndexes[1], oFirstBc);
  544 + } else {
  545 + oTempLp.setLp(_lpArray[_iZbx_lpIndex]); // 设置原始路牌对象
  546 + oTempLp._$_aVerticalIntervalTime = _internalLpArray[_iZbx_lpIndex]._$_aVerticalIntervalTime; // 设置纵向最小发车间隔
  547 + oTempLp.setBxLb(_internalLpArray[_iZbx_lpIndex].isBxLb());
  548 + oTempLp.setBxFb(_internalLpArray[_iZbx_lpIndex].isBxFb());
  549 + oTempLp.setBxFb5_2(_internalLpArray[_iZbx_lpIndex].isBxFb5_2());
  550 +
  551 + // 修正除了第一个班次外,其余其他班次
  552 + var iBcindex = 0;
  553 + for (i = 1; i < _qCount; i++) {
  554 + while (iBcindex <= 1) {
  555 + if (oTempLp.getBc(i, iBcindex)) { // 替换存在的班次
  556 + oTempLp.setBc(i, iBcindex, _fnGenerateBc(_iZbx_lpIndex, i, iBcindex));
  557 + }
  558 + iBcindex ++;
  559 + }
  560 + iBcindex = 0;
  561 + }
  562 +
  563 + _internalLpArray[_iZbx_lpIndex] = oTempLp;
  564 + }
  565 +
  566 + console.log("中标线对应第" + (_iZbx_lpIndex + 1) + "个路牌");
  567 +
  568 + console.log("//---------------- 行车计划,初始化方法4 end ----------------//");
  569 + };
  570 +
  571 + //-------------------- 重要的内部方法 -----------------------//
  572 + /**
  573 + * 核心方法,利用路牌间隔纵向生成班次。
  574 + * @param iLpindex 路牌索引
  575 + * @param iQindex 圈索引
  576 + * @param iBcindex 班次索引
  577 + * @returns object InternalBcObj,失败 false
  578 + */
  579 + var _fnGenerateBc = function(iLpindex, iQindex, iBcindex) {
  580 + // 以上标线为起始点,使用路牌在不同圈,班次索引的发车间隔,计算班次
  581 + // 注意,发车间隔是指下一个班次应该距离当前班次间隔,是从下往上的
  582 +
  583 + // 1、参数验证
  584 + if (iLpindex == 0) { // 上标线的班次不需要生成
  585 + return false;
  586 + }
  587 +
  588 + // 2、计算间隔
  589 + var i;
  590 + var oLp;
  591 + var iTime = 0;
  592 + for (i = 0; i < iLpindex; i++) {
  593 + oLp = _internalLpArray[i];
  594 + iTime += oLp.fnGetVerticalIntervalTime(iQindex, iBcindex);
  595 + }
  596 +
  597 + // 3、生成班次
  598 + var _oKsbc = _internalLpArray[0].getBc(iQindex, iBcindex);
  599 + if (!_oKsbc) {
  600 + return false;
  601 + }
  602 + var _oKssj = _paramObj.addMinute(_oKsbc.getFcTimeObj(), iTime);
  603 + var _oBc = _factory.createBcObj(
  604 + _internalLpArray[iLpindex],
  605 + "normal", _oKsbc.isUp(),
  606 + 1, _oKssj, _paramObj);
  607 +
  608 + return _oBc;
  609 +
  610 + };
  611 +
  612 + /**
  613 + * 核心方法,在指定位置生成班次并添加到路牌指定位置中。
  614 + * @param lpIndex 第几个路牌
  615 + * @param qIndex 第几圈
  616 + * @param bcIndex 第几个班次
  617 + */
  618 + var _fnGenerateBcAndSetBc = function(lpIndex, qIndex, bcIndex) {
  619 + var _bcObj = _fnGenerateBc(lpIndex, qIndex, bcIndex);
  620 + if (_bcObj) {
  621 + _internalLpArray[lpIndex].setBc(qIndex, bcIndex, _bcObj);
  622 + }
  623 + };
  624 +
  625 + /**
  626 + * 获取班次列表。
  627 + * @param oIsUp 是否上行
  628 + * @param oStartTime 开始时间对象
  629 + * @returns [(InternalBcObj)]
  630 + */
  631 + var _fnGetBcList2 = function(oIsUp, oStartTime) {
  632 + var i;
  633 + var j;
  634 + var oLp;
  635 + var oBc;
  636 + var aBc = [];
  637 +
  638 + for (j = 0; j < _qCount; j++) {
  639 + for (i = 0; i < _internalLpArray.length; i++) {
  640 + oLp = _internalLpArray[i];
  641 + oBc = oLp.getBc(
  642 + j,
  643 + _qIsUp == oIsUp ? 0 : 1
  644 + );
  645 + if (oBc && oBc.getFcTimeObj().isAfter(oStartTime)) {
  646 + aBc.push(oBc);
  647 + }
  648 + }
  649 + }
  650 +
  651 + var aBcFcTime = [];
  652 + for (i = 0; i < aBc.length; i++) {
  653 + oBc = aBc[i];
  654 + aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
  655 + }
  656 + console.log((oIsUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
  657 +
  658 + return aBc;
  659 + };
  660 +
  661 + /**
  662 + * 获取班次列表。
  663 + * @param isUp boolean 是否上行
  664 + * @returns [(InternalBcObj)]
  665 + */
  666 + var _fnGetBcList = function(isUp) {
  667 + var i;
  668 + var j;
  669 + var oLp;
  670 + var oBc;
  671 + var aBc = [];
  672 +
  673 + for (j = 0; j < _qCount; j++) {
  674 + for (i = 0; i < _internalLpArray.length; i++) {
  675 + oLp = _internalLpArray[i];
  676 + oBc = oLp.getBc(
  677 + j,
  678 + _qIsUp == isUp ? 0 : 1
  679 + );
  680 + if (oBc) {
  681 + aBc.push(oBc);
  682 + }
  683 + }
  684 + }
  685 +
  686 + var aBcFcTime = [];
  687 + for (i = 0; i < aBc.length; i++) {
  688 + oBc = aBc[i];
  689 + aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
  690 + }
  691 + console.log((isUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
  692 +
  693 + return aBc;
  694 + };
  695 +
  696 + /**
  697 + * 查找离指定时间最近的前面的班次索引信息
  698 + * @param timeObj 查找时间
  699 + * @param isUp 是否上行
  700 + * @returns [{路牌index},{圈index},{班次index}]
  701 + */
  702 + var _fnFindUpClosedBcIndexWithTime = function(timeObj, isUp) {
  703 +
  704 + var _lpObj;
  705 + var _groupObj;
  706 + var _bcObj;
  707 + var _i;
  708 + var _j;
  709 + var timediff; // 时间差取绝对值
  710 +
  711 + var _lpIndex;
  712 + var _up_qIndex;
  713 + var _up_bIndex;
  714 +
  715 + for (_i = 0; _i < _qCount; _i++) {
  716 + for (_j = 0; _j < _internalLpArray.length; _j++) {
  717 + _lpObj = _internalLpArray[_j];
  718 + _groupObj = _lpObj.getGroup(_i);
  719 + _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
  720 + if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
  721 + _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
  722 + }
  723 + if (_bcObj) {
  724 + if (timeObj.diff(_bcObj.getFcTimeObj()) >= 0) {
  725 + if (!timediff) {
  726 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  727 + _lpIndex = _j;
  728 + _up_qIndex = _i;
  729 + _up_bIndex = isUp == _qIsUp ? 0 : 1;
  730 + } else {
  731 + if (timeObj.diff(_bcObj.getFcTimeObj()) < timediff) {
  732 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  733 + _lpIndex = _j;
  734 + _up_qIndex = _i;
  735 + _up_bIndex = isUp == _qIsUp ? 0 : 1;
  736 + }
  737 + }
  738 + }
  739 + }
  740 + }
  741 + }
  742 +
  743 + if (_lpIndex == undefined) {
  744 + return false;
  745 + }
  746 +
  747 + var bcindex = [];
  748 + bcindex.push(_lpIndex);
  749 + bcindex.push(_up_qIndex);
  750 + bcindex.push(_up_bIndex);
  751 +
  752 + return bcindex;
  753 + };
  754 +
  755 + /**
  756 + * 查找离指定时间最近的后面的班次索引信息
  757 + * @param timeObj 查找时间
  758 + * @param isUp 是否上行
  759 + * @returns [{路牌index},{圈index},{班次index}]
  760 + */
  761 + var _fnFindDownClosedBcIndexWithTime = function(timeObj, isUp) {
  762 + var _lpObj;
  763 + var _groupObj;
  764 + var _bcObj;
  765 + var _i;
  766 + var _j;
  767 + var timediff; // 时间差取绝对值
  768 +
  769 + var _lpIndex;
  770 + var _down_qIndex;
  771 + var _down_bIndex;
  772 +
  773 + var flag;
  774 +
  775 + for (_i = 0; _i < _qCount; _i++) {
  776 + for (_j = 0; _j < _internalLpArray.length; _j++) {
  777 + _lpObj = _internalLpArray[_j];
  778 + _groupObj = _lpObj.getGroup(_i);
  779 + // TODO:bug
  780 + _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
  781 + if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
  782 + _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
  783 + }
  784 + if (_bcObj) {
  785 + //console.log("timeobj -> bcobj diff flag " +
  786 + // timeObj.format("HH:mm") + "->" +
  787 + // _bcObj.getFcTimeObj().format("HH:mm") +
  788 + // timeObj.diff(_bcObj.getFcTimeObj()) +
  789 + // (timeObj.diff(_bcObj.getFcTimeObj()) <= 0)
  790 + //);
  791 +
  792 + flag = (timeObj.diff(_bcObj.getFcTimeObj())) <= 0;
  793 +
  794 + if (flag) {
  795 + if (!timediff) {
  796 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  797 + _lpIndex = _j;
  798 + _down_qIndex = _i;
  799 + _down_bIndex = isUp == _qIsUp ? 0 : 1;
  800 + } else {
  801 + if ((timeObj.diff(_bcObj.getFcTimeObj())) > timediff) {
  802 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  803 + _lpIndex = _j;
  804 + _down_qIndex = _i;
  805 + _down_bIndex = isUp == _qIsUp ? 0 : 1;
  806 + }
  807 + }
  808 + }
  809 + }
  810 + }
  811 + }
  812 +
  813 + if (_lpIndex == undefined) {
  814 + return false;
  815 + }
  816 +
  817 + var bcindex = [];
  818 + bcindex.push(_lpIndex);
  819 + bcindex.push(_down_qIndex);
  820 + bcindex.push(_down_bIndex);
  821 +
  822 + return bcindex;
  823 + };
  824 +
  825 + /**
  826 + * 获取班次索引。
  827 + * @param oBc 班次对象
  828 + * @returns [{路牌索引},{圈索引},{班次索引}]
  829 + */
  830 + var _fnGetBcIndex = function(oBc) {
  831 + // 路牌索引
  832 + var i;
  833 + var iLpIndex;
  834 + for (i = 0; i < _internalLpArray.length; i++) {
  835 + if (_internalLpArray[i]._$$_orign_lp_obj == oBc._$$_internal_lp_obj._$$_orign_lp_obj) {
  836 + iLpIndex = i;
  837 + break;
  838 + }
  839 + }
  840 + // 圈索引
  841 + var j;
  842 + var iGroupIndex;
  843 + var bFlag = false;
  844 + for (i = 0; i < _internalLpArray.length; i++) {
  845 + if (bFlag) {
  846 + break;
  847 + }
  848 + for (j = 0; j < _qCount; j++) {
  849 + if (_internalLpArray[i]._$_groupBcArray[j] == oBc._$$_internal_group_obj) {
  850 + iGroupIndex = j;
  851 + bFlag = true;
  852 + break;
  853 + }
  854 + }
  855 + }
  856 + // 班次索引
  857 + var iBcIndex = _qIsUp == oBc.isUp() ? 0 : 1;
  858 +
  859 + if (iLpIndex == undefined) {
  860 + return null;
  861 + } else {
  862 + return [].concat(iLpIndex, iGroupIndex, iBcIndex);
  863 + }
  864 +
  865 + };
  866 +
  867 + return {
  868 + //------------- 布局初始化方法 ------------//
  869 + /**
  870 + * 初始化数据,使用标线初始化
  871 + */
  872 + fnInitDataWithBxLayout: function() {
  873 + // 初始化布局1,构造上标线,计算圈数,把上标线数据放入第一个路牌中
  874 + _fnInitFun1();
  875 + // 初始化布局2,从上标线的某个班次开始,构造所有路牌的早高峰班次,晚高峰班次,计算路牌在各个圈中的间隔
  876 + _fnInitFun2();
  877 + // 初始化布局3,计算连班分班路牌分布
  878 + _fnInitFun3();
  879 + // 初始化布局4,计算中标线位置
  880 + _fnInitFun4();
  881 +
  882 + },
  883 +
  884 + /**
  885 + * 调整高峰班次,
  886 + * 初始化生成早高峰,晚高峰班次并不准确,因为根据高峰时间段,并不在一个完整圈内,应该是在两个或多个圈之间
  887 + * 当初始化定好布局后(上标线,中标线),然后确定每个路牌的班型(连班,分班,5休2分班)后
  888 + * 然后重新计算框在高峰时间段内的班次索引,不足的添加,之前多加的删除(只删除分班路牌上的)
  889 + * @param isZgf 是否早高峰
  890 + * @param isUp 是否上行
  891 + */
  892 + fnAdjustGfbc : function(isZgf, isUp) {
  893 + var oStartTime; // 开始时间
  894 + var oEndTime; // 结束时间
  895 + var aStartBcIndex; // 开始班次索引
  896 + var aEndBcIndex; // 结束班次索引
  897 +
  898 + oStartTime = isZgf ? _paramObj.getMPeakStartTimeObj() : _paramObj.getEPeakStartTimeObj();
  899 + oEndTime = isZgf ? _paramObj.getMPeakEndTimeObj() : _paramObj.getEPeakEndTimeObj();
  900 +
  901 + aStartBcIndex = _fnFindUpClosedBcIndexWithTime(oStartTime, isUp);
  902 + aEndBcIndex = _fnFindDownClosedBcIndexWithTime(oEndTime, isUp);
  903 +
  904 + var iLpIndex;
  905 + var iQIndex;
  906 + var iBcIndex;
  907 + var iQInternelCount; // 高峰时间段中间包含的圈数
  908 + var i;
  909 + var j;
  910 +
  911 + var oLp;
  912 +
  913 + if (aStartBcIndex && aEndBcIndex) {
  914 + iLpIndex = aStartBcIndex[0];
  915 + iQIndex = aStartBcIndex[1];
  916 + iBcIndex = aStartBcIndex[2];
  917 +
  918 + // 处理头
  919 + // 删除头部多余班次
  920 + for (j = 0; j < iLpIndex; j++) {
  921 + oLp = _internalLpArray[j];
  922 + if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {
  923 + oLp.removeBc(iQIndex, iBcIndex);
  924 + }
  925 + }
  926 +
  927 + for (j = iLpIndex; j < _internalLpArray.length; j++) {
  928 + oLp = _internalLpArray[j];
  929 + if (!oLp.getBc(iQIndex, iBcIndex)) {
  930 + _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);
  931 + }
  932 + }
  933 +
  934 + // 处理中间
  935 + iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1;
  936 + for (i = 1; i <= iQInternelCount; i++) {
  937 +
  938 + for (j = 0; j < _internalLpArray.length; j++) {
  939 + oLp = _internalLpArray[j];
  940 + if (!oLp.getBc(iQIndex + i, iBcIndex)) {
  941 + _fnGenerateBcAndSetBc(j, iQIndex + i, iBcIndex);
  942 + }
  943 + }
  944 +
  945 + }
  946 +
  947 + // 处理尾部
  948 + iLpIndex = aEndBcIndex[0];
  949 + iQIndex = aEndBcIndex[1];
  950 + iBcIndex = aEndBcIndex[2];
  951 +
  952 + // 删除尾部多余的班次
  953 + for (j = iLpIndex; j < _internalLpArray.length; j++) {
  954 + oLp = _internalLpArray[j];
  955 + if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {
  956 + oLp.removeBc(iQIndex, iBcIndex);
  957 + }
  958 + }
  959 +
  960 + if (aStartBcIndex[1] != aEndBcIndex[1]) { // 指定时间范围跨圈
  961 + for (j = 0; j < iLpIndex; j++) {
  962 + oLp = _internalLpArray[j];
  963 + if (!oLp.getBc(iQIndex, iBcIndex)) {
  964 + _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);
  965 + }
  966 + }
  967 + } else {
  968 + // 不跨圈,不用处理,处理头的时候已经加了
  969 + }
  970 +
  971 + }
  972 +
  973 + },
  974 +
  975 + /**
  976 + * 按照营运时间要求补充班次,
  977 + * 早高峰7:45分以前出场运营,
  978 + * 晚高峰16:10分以前出场运营
  979 + */
  980 + fnCalcuLpBc_yy: function() {
  981 + // 补班次的时候,针对的是分班班型
  982 + var i;
  983 + var _oLp;
  984 + var _oBc;
  985 + var _aMinBcIndex;
  986 + var _aMaxBcIndex;
  987 +
  988 + var _qIndex;
  989 + var _bIndex;
  990 +
  991 + var _zgfCDate = _paramObj.toTimeObj("7:45");
  992 + var _wgfCDate = _paramObj.toTimeObj("16:10");
  993 + var _ccsj;
  994 +
  995 + for (i = 0; i < _internalLpArray.length; i++) {
  996 + _oLp = _internalLpArray[i];
  997 + if (_oLp.isBxFb()) { // 分班路牌
  998 + // 早高峰部分
  999 + _aMinBcIndex = _oLp.getMinBcObjPosition();
  1000 + _qIndex = _aMinBcIndex[0];
  1001 + _bIndex = _aMinBcIndex[1];
  1002 + _oBc = _oLp.getBc(_qIndex, _bIndex);
  1003 + if (_qIsUp) {
  1004 + _ccsj = _bIndex == 0 ?
  1005 + _paramObj.getUpOutTime() :
  1006 + _paramObj.getDownOutTime();
  1007 + } else {
  1008 + _ccsj = _bIndex == 0 ?
  1009 + _paramObj.getDownOutTime() :
  1010 + _paramObj.getUpOutTime();
  1011 + }
  1012 + if (_zgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {
  1013 + _fnGenerateBcAndSetBc(
  1014 + i,
  1015 + _bIndex == 0 ? _qIndex - 1 : _qIndex,
  1016 + _bIndex == 0 ? 1 : 0
  1017 + )
  1018 + }
  1019 +
  1020 + // 晚高峰部分
  1021 + _aMaxBcIndex = _oLp.getMaxBcObjPosition();
  1022 + _qIndex = _aMaxBcIndex[0];
  1023 + _bIndex = _aMaxBcIndex[1];
  1024 + _oBc = _oLp.getBc(
  1025 + _bIndex == 0 ? _qIndex - 1 : _qIndex,
  1026 + _bIndex == 0 ? 1 : 0
  1027 + );
  1028 + if (!_oBc) { // 前一个班次不存在,再判定加不加
  1029 + _oBc = _oLp.getBc(_qIndex, _bIndex);
  1030 + if (_qIsUp) {
  1031 + _ccsj = _bIndex == 0 ?
  1032 + _paramObj.getUpOutTime() :
  1033 + _paramObj.getDownOutTime();
  1034 + } else {
  1035 + _ccsj = _bIndex == 0 ?
  1036 + _paramObj.getDownOutTime() :
  1037 + _paramObj.getUpOutTime();
  1038 + }
  1039 + if (_wgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {
  1040 + _fnGenerateBcAndSetBc(
  1041 + i,
  1042 + _bIndex == 0 ? _qIndex - 1 : _qIndex,
  1043 + _bIndex == 0 ? 1 : 0
  1044 + )
  1045 + }
  1046 + }
  1047 + }
  1048 + }
  1049 + },
  1050 +
  1051 + /**
  1052 + * 补充做5休2的班型班次。
  1053 + * 1、确认5_2班型大致多少圈(小数点过.7进位)
  1054 + * 2、获取当前5_2两端车次链的信息,每段的班次数目,还差几个班次没加
  1055 + * 3、如果前面的车次链班次少,则从前面的车次链开始加
  1056 + * 4、如果车次链班次数一样,从从后面的车次链开始加
  1057 + * 5、加班次时都是往车次链前方加
  1058 + * 6、如果前面车次链不能再加班次了,从后面车次链加
  1059 + */
  1060 + fnCalcuLpBx_5_2: function() {
  1061 + // 计算做5休2班型所需的班次数
  1062 + var iBxBcount = _aBxDesc[6].fBcCount;
  1063 + if (iBxBcount - Math.floor(iBxBcount) > 0.7) {
  1064 + iBxBcount = Math.floor(iBxBcount) + 1;
  1065 + } else {
  1066 + iBxBcount = Math.floor(iBxBcount);
  1067 + }
  1068 +
  1069 + var i;
  1070 + var j;
  1071 + var oLp;
  1072 + var iAddBcCount;
  1073 + var oBcChain1;
  1074 + var oBcChain2;
  1075 + var iQindex;
  1076 + var iBindex;
  1077 +
  1078 + for (i = 0; i < _internalLpArray.length; i++) {
  1079 + oLp = _internalLpArray[i];
  1080 + if (oLp.isBxFb5_2()) {
  1081 + iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数
  1082 + for (j = 1; j <= iAddBcCount; j++) {
  1083 + oBcChain1 = oLp.fnGetBcChainInfo(0);
  1084 + oBcChain2 = oLp.fnGetBcChainInfo(1);
  1085 +
  1086 + if (oBcChain1.bcount < oBcChain2.bcount) {
  1087 + iQindex = oBcChain1.s_b == 0 ? oBcChain1.s_q - 1 : oBcChain1.s_q;
  1088 + iBindex = oBcChain1.s_b == 0 ? 1 : 0;
  1089 + // 往车次链往前不能加,就往后加
  1090 + if (_fnGenerateBc(i, iQindex, iBindex)) {
  1091 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1092 + } else {
  1093 + iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;
  1094 + iBindex = oBcChain1.e_b == 0 ? 1 : 0;
  1095 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1096 + }
  1097 +
  1098 + } else if (oBcChain1.bcount > oBcChain2.bcount) {
  1099 + iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;
  1100 + iBindex = oBcChain2.s_b == 0 ? 1 : 0;
  1101 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1102 + } else {
  1103 + iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;
  1104 + iBindex = oBcChain2.s_b == 0 ? 1 : 0;
  1105 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1106 + }
  1107 + }
  1108 + }
  1109 + }
  1110 +
  1111 + },
  1112 +
  1113 + /**
  1114 + * 补其他分班班型班次。
  1115 + * 从车次链的后面开始加
  1116 + */
  1117 + fnCalcuLpBx_other: function() {
  1118 + // TODO:根据上标线的首班时间确定班型,小于05:59的做一休一,否则做二休一
  1119 + var oSt = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
  1120 + var iBxIndex = 4;
  1121 + if (oSt.isBefore(_paramObj.toTimeObj("05:59"))) {
  1122 + iBxIndex = 5;
  1123 + }
  1124 + // 计算做5休2班型所需的班次数
  1125 + var iQBcount = _aBxDesc[iBxIndex].fQCount;
  1126 + var iBxBcount = Math.round(iQBcount) * 2;
  1127 +
  1128 + var i;
  1129 + var j;
  1130 + var oLp;
  1131 + var iAddBcCount;
  1132 + var oBcChain1;
  1133 + var oBcChain2;
  1134 + var iQindex;
  1135 + var iBindex;
  1136 +
  1137 + for (i = 0; i < _internalLpArray.length; i++) {
  1138 + oLp = _internalLpArray[i];
  1139 + if (oLp.isBxFb() && !oLp.isBxFb5_2()) {
  1140 + iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数
  1141 + for (j = 1; j <= iAddBcCount; j++) {
  1142 + oBcChain1 = oLp.fnGetBcChainInfo(0);
  1143 + oBcChain2 = oLp.fnGetBcChainInfo(1);
  1144 +
  1145 + if (oBcChain1.bcount < oBcChain2.bcount) {
  1146 + iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;
  1147 + iBindex = oBcChain1.e_b == 0 ? 1 : 0;
  1148 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1149 + } else if (oBcChain1.bcount > oBcChain2.bcount) {
  1150 + iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;
  1151 + iBindex = oBcChain2.e_b == 0 ? 1 : 0;
  1152 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1153 + } else {
  1154 + iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;
  1155 + iBindex = oBcChain2.e_b == 0 ? 1 : 0;
  1156 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1157 + }
  1158 + }
  1159 + }
  1160 + }
  1161 +
  1162 + },
  1163 +
  1164 + /**
  1165 + * 补充连班路牌班次。
  1166 + * 1、上标线,中标线中间的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向上标线起始班次靠拢
  1167 + * 2、中标线以下的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向中标线起始班次靠拢
  1168 + */
  1169 + fnCalcuLpBx_lb: function() {
  1170 + // 补充连班的班次,参照上标线,中标线补充不足的班次
  1171 +
  1172 + var aLbLpindexes = []; // 除上标线,中标线的连班路牌索引
  1173 + var i;
  1174 + for (i = 0; i < _internalLpArray.length; i++) {
  1175 + if (_internalLpArray[i].isBxLb() && i != 0 && i != _iZbx_lpIndex) {
  1176 + aLbLpindexes.push(i);
  1177 + }
  1178 + }
  1179 +
  1180 + var oEndsj = // 结束时间
  1181 + _paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj()) ?
  1182 + _paramObj.getDownLastDTimeObj() :
  1183 + _paramObj.getUpLastDtimeObj();
  1184 +
  1185 + var oLp;
  1186 + var aMinbcPos;
  1187 + var oBc;
  1188 + var j;
  1189 + var iTempBcIndex;
  1190 +
  1191 + // 1、从最小班次开始,往后补充班次
  1192 + for (i = 0; i < aLbLpindexes.length; i++) {
  1193 + oLp = _internalLpArray[aLbLpindexes[i]];
  1194 +
  1195 + // 最小班次索引
  1196 + aMinbcPos = oLp.getMinBcObjPosition();
  1197 + // 使用纵向分隔补充班次,从最小班次向后补
  1198 + iTempBcIndex = aMinbcPos[1] == 0 ? 1 : 0;
  1199 + j = iTempBcIndex == 0 ? aMinbcPos[0] + 1 : aMinbcPos[0];
  1200 +
  1201 + while (j < _qCount) {
  1202 + while (iTempBcIndex <= 1) {
  1203 + oBc = _fnGenerateBc(aLbLpindexes[i], j, iTempBcIndex);
  1204 + if (oBc &&
  1205 + oBc.getFcTimeObj().isBefore(oEndsj) ) {
  1206 + oLp.setBc(j, iTempBcIndex, oBc);
  1207 + }
  1208 + iTempBcIndex++;
  1209 + }
  1210 + iTempBcIndex = 0;
  1211 + j++;
  1212 + }
  1213 +
  1214 + }
  1215 +
  1216 + // 2、上标线中标线之间的路牌,从最小的班次往前补充班次
  1217 +
  1218 + // 还要补充缺失的班次,差上标线几个班次要往前补上
  1219 + var iBccount;
  1220 + var iQindex;
  1221 + var iBindex;
  1222 + // 补上标线到中标线之间的连班路牌的班次
  1223 + for (i = 0; i < aLbLpindexes.length; i++) {
  1224 + if (aLbLpindexes[i] > 0 && aLbLpindexes[i] < _iZbx_lpIndex) {
  1225 + oLp = _internalLpArray[aLbLpindexes[i]];
  1226 + aMinbcPos = oLp.getMinBcObjPosition();
  1227 + iQindex = aMinbcPos[0];
  1228 + iBindex = aMinbcPos[1];
  1229 + iBccount = (iQindex - 1) * 2 + iBindex; // 距离上标线起始站点差几个班次
  1230 + for (j = 0; j < iBccount; j++) {
  1231 + if (iBindex == 0) {
  1232 + iQindex --;
  1233 + iBindex = 1;
  1234 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1235 + } else if (iBindex == 1) {
  1236 + iBindex --;
  1237 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1238 + }
  1239 + }
  1240 +
  1241 + }
  1242 +
  1243 + }
  1244 +
  1245 + // 3、中标线之后的路牌,从最小的班次往前补充班次
  1246 +
  1247 + // 补中标线以下的连班路牌的班次
  1248 + for (i = 0; i < aLbLpindexes.length; i++) {
  1249 + if (aLbLpindexes[i] > _iZbx_lpIndex) {
  1250 + oLp = _internalLpArray[aLbLpindexes[i]];
  1251 + aMinbcPos = oLp.getMinBcObjPosition();
  1252 + iQindex = aMinbcPos[0];
  1253 + iBindex = aMinbcPos[1];
  1254 + iBccount = (iQindex - 0) * 2 + iBindex - 1; // 距离上标线起始站点差几个班次
  1255 + for (j = 0; j < iBccount; j++) {
  1256 + if (iBindex == 0) {
  1257 + iQindex --;
  1258 + iBindex = 1;
  1259 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1260 + } else if (iBindex == 1) {
  1261 + iBindex --;
  1262 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1263 + }
  1264 + }
  1265 + }
  1266 + }
  1267 +
  1268 + },
  1269 +
  1270 + /**
  1271 + * 计算末班车。
  1272 + * 1、将上下行拉成上下行两个班次列表(包括标记班次)
  1273 + * 2、分别找出离末班车发车时间最近的班次,并替换时间
  1274 + * 3、删除之后的班次
  1275 + */
  1276 + fnCalcuLastBc: function() {
  1277 + var i;
  1278 + var iTimeDiff;
  1279 + var iTempTime;
  1280 + var aBc;
  1281 + var oLastBcTime;
  1282 + var oLastBcIsUp;
  1283 + var iModifyIndex;
  1284 +
  1285 + // 查找末班车早的末班车时间和方向
  1286 + if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
  1287 + oLastBcTime = _paramObj.getUpLastDtimeObj();
  1288 + oLastBcIsUp = true;
  1289 + } else {
  1290 + oLastBcTime = _paramObj.getDownLastDTimeObj();
  1291 + oLastBcIsUp = false;
  1292 + }
  1293 +
  1294 + // 确定早的末班车时间
  1295 + aBc = _fnGetBcList(oLastBcIsUp);
  1296 + for (i = 0; i < aBc.length; i++) {
  1297 + iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
  1298 + if (iTimeDiff == undefined) {
  1299 + iTimeDiff = iTempTime;
  1300 + iModifyIndex = i;
  1301 + } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
  1302 + iTimeDiff = iTempTime;
  1303 + iModifyIndex = i;
  1304 + }
  1305 + }
  1306 + aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
  1307 + aBc[iModifyIndex].fnSetDelFlag(false);
  1308 + aBc[iModifyIndex].fnSetIsLastBc(true);
  1309 + for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
  1310 + _qIsUp == oLastBcIsUp ?
  1311 + aBc[i]._$$_internal_group_obj.setBc1(undefined) :
  1312 + aBc[i]._$$_internal_group_obj.setBc2(undefined);
  1313 + }
  1314 +
  1315 + // 查找末班车晚的末班车时间和方向
  1316 + if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
  1317 + oLastBcTime = _paramObj.getDownLastDTimeObj();
  1318 + oLastBcIsUp = false;
  1319 + } else {
  1320 + oLastBcTime = _paramObj.getUpLastDtimeObj();
  1321 + oLastBcIsUp = true;
  1322 + }
  1323 + // 确定晚的末班车时间
  1324 + aBc = _fnGetBcList(oLastBcIsUp);
  1325 + var oBc;
  1326 + var aBcIndex;
  1327 + var iLpIndex;
  1328 + var iQIndex;
  1329 + var iBcIndex;
  1330 +
  1331 + iTimeDiff = undefined;
  1332 + for (i = 0; i < aBc.length; i++) {
  1333 + oBc = aBc[i];
  1334 + aBcIndex = _fnGetBcIndex(oBc);
  1335 +
  1336 + iLpIndex = aBcIndex[0];
  1337 + iQIndex = aBcIndex[2] == 0 ? aBcIndex[1] -1 : aBcIndex[1];
  1338 + iBcIndex = aBcIndex[2] == 0 ? 1 : 0;
  1339 +
  1340 + if (!_internalLpArray[iLpIndex].getBc(iQIndex, iBcIndex)) {
  1341 + continue;
  1342 + }
  1343 +
  1344 + iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
  1345 + if (iTimeDiff == undefined) {
  1346 + iTimeDiff = iTempTime;
  1347 + iModifyIndex = i;
  1348 + } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
  1349 + iTimeDiff = iTempTime;
  1350 + iModifyIndex = i;
  1351 + }
  1352 + }
  1353 + aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
  1354 + aBc[iModifyIndex].fnSetDelFlag(false);
  1355 + aBc[iModifyIndex].fnSetIsLastBc(true);
  1356 + for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
  1357 + _qIsUp == oLastBcIsUp ?
  1358 + aBc[i]._$$_internal_group_obj.setBc1(undefined) :
  1359 + aBc[i]._$$_internal_group_obj.setBc2(undefined);
  1360 + }
  1361 +
  1362 + },
  1363 +
  1364 + /**
  1365 + * 添加吃饭班次。
  1366 + */
  1367 + fnCalcuEatBc: function() {
  1368 + // 吃午饭时间范围,10:15 到 12:15
  1369 + // 吃晚饭时间范围,18:00 到 19:00
  1370 +
  1371 + if (!_paramObj.fnIsEat()) {
  1372 + return;
  1373 + }
  1374 +
  1375 + // 午饭index
  1376 + var aLEIndex;
  1377 + // 晚饭index
  1378 + var aDEIndex;
  1379 +
  1380 + // 所有吃饭都默认在一个方向,两个方向暂时不考虑
  1381 + if (_paramObj.fnIsUpEat()) {
  1382 + aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), true, false);
  1383 + aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), true, false);
  1384 + } else {
  1385 + aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), false, true);
  1386 + aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), false, true);
  1387 + }
  1388 +
  1389 + // 午饭第几圈,第几个班次
  1390 + var iLEQIndex = aLEIndex[0];
  1391 + var iLEBIndex = aLEIndex[1];
  1392 + // 晚饭第几圈,第几个班次
  1393 + var iDEQIndex = aDEIndex[0];
  1394 + var iDEBIndex = aDEIndex[1];
  1395 +
  1396 + // 注意,本模型只有连班才有吃饭
  1397 +
  1398 + var i;
  1399 + var oLp;
  1400 + var aLbIndex = []; // 连班班型的路牌索引
  1401 + for (i = 0; i < _internalLpArray.length; i++) {
  1402 + oLp = _internalLpArray[i];
  1403 + if (oLp.isBxLb()) {
  1404 + aLbIndex.push(i);
  1405 + }
  1406 + }
  1407 +
  1408 + var iLTime;
  1409 + var iDtime;
  1410 + var j;
  1411 + for (i = 0; i < aLbIndex.length; i++) {
  1412 + oLp = _internalLpArray[aLbIndex[i]];
  1413 +
  1414 + // 午饭
  1415 + iLTime = oLp.fnAddEatBc(iLEQIndex, iLEBIndex, _factory, _paramObj);
  1416 + // 晚饭
  1417 + iDtime = oLp.fnAddEatBc(iDEQIndex, iDEBIndex, _factory, _paramObj);
  1418 +
  1419 + if (i == aLbIndex.length - 1) {
  1420 + for (j = aLbIndex[i]; j < _internalLpArray.length; j++) {
  1421 + oLp = _internalLpArray[j];
  1422 + if (oLp.isBxFb()) { // 5休2班型不调整
  1423 + // 修正午饭之后路牌班次的发车时间
  1424 + oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);
  1425 + oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);
  1426 + }
  1427 + }
  1428 + } else {
  1429 + for (j = aLbIndex[i]; j < aLbIndex[i + 1]; j++) {
  1430 + oLp = _internalLpArray[j];
  1431 + if (oLp.isBxFb()) {
  1432 + // 修正午饭之后路牌班次的发车时间
  1433 + oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);
  1434 + oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);
  1435 + }
  1436 + }
  1437 + }
  1438 + }
  1439 +
  1440 + },
  1441 +
  1442 + /**
  1443 + * 补每个路牌的其他班次(进出场,例保班次)。
  1444 + */
  1445 + fnCalcuOtherBc_: function() {
  1446 + var i;
  1447 + var _lpObj;
  1448 + var _minBcIndex;
  1449 + var _maxBcIndex;
  1450 + var _minBc;
  1451 + var _maxBc;
  1452 + var _otherbc = [];
  1453 + var _oFbbc;
  1454 +
  1455 + for (i = 0; i < _internalLpArray.length; i++) {
  1456 + _lpObj = _internalLpArray[i];
  1457 + _minBcIndex = _lpObj.getMinBcObjPosition();
  1458 + _maxBcIndex = _lpObj.getMaxBcObjPosition();
  1459 + _minBc = _lpObj.getBc(_minBcIndex[0], _minBcIndex[1]);
  1460 + _maxBc = _lpObj.getBc(_maxBcIndex[0], _maxBcIndex[1]);
  1461 +
  1462 + _otherbc = [];
  1463 + _otherbc.push(_factory.createBcObj(
  1464 + _lpObj, "bd", true, 1,
  1465 + _minBc.getFcTimeObj(),
  1466 + _paramObj
  1467 + ));
  1468 + _otherbc.push(_factory.createBcObj(
  1469 + _lpObj, "out", true, 1,
  1470 + _minBc.getFcTimeObj(),
  1471 + _paramObj
  1472 + ));
  1473 +
  1474 + _maxBc.setArrTimeObj(_paramObj.addMinute(_maxBc.getFcTimeObj(), _maxBc.getBcTime()));
  1475 + _maxBc.setStopTime(0);
  1476 + _otherbc.push(_factory.createBcObj(
  1477 + _lpObj, "in", true, 1,
  1478 + _maxBc.getArrTimeObj(),
  1479 + _paramObj
  1480 + ));
  1481 + _otherbc.push(_factory.createBcObj(
  1482 + _lpObj, "lc", true, 1,
  1483 + _maxBc.getArrTimeObj(),
  1484 + _paramObj
  1485 + ));
  1486 +
  1487 + // 5休2分班出场例保班次
  1488 + if (_lpObj.isBxFb5_2()) {
  1489 + _oFbbc = _lpObj.getBc(
  1490 + _lpObj.fnGetBcChainInfo(1)["s_q"],
  1491 + _lpObj.fnGetBcChainInfo(1)["s_b"]
  1492 + );
  1493 +
  1494 + _otherbc.push(_factory.createBcObj(
  1495 + _lpObj, "bd", true, 1,
  1496 + _oFbbc.getFcTimeObj(),
  1497 + _paramObj
  1498 + ));
  1499 + _otherbc.push(_factory.createBcObj(
  1500 + _lpObj, "out", true, 1,
  1501 + _oFbbc.getFcTimeObj(),
  1502 + _paramObj
  1503 + ));
  1504 + }
  1505 +
  1506 + _lpObj.addOtherBcArray(_otherbc);
  1507 + }
  1508 +
  1509 + },
  1510 +
  1511 + /**
  1512 + * 补每个路牌的其他班次(进出场,例保班次)
  1513 + * 所有的车次链前后都加进出场、报道班次
  1514 + */
  1515 + fnCalcuOtherBc: function() {
  1516 + var i;
  1517 + var j;
  1518 + var iBcChainCount;
  1519 + var oLp;
  1520 + var aOtherBc;
  1521 + var oStartBc;
  1522 + var oEndBc;
  1523 +
  1524 + for (i = 0; i < _internalLpArray.length; i++) {
  1525 + aOtherBc = [];
  1526 + oLp = _internalLpArray[i];
  1527 + iBcChainCount = oLp.fnGetBcChainCount();
  1528 +
  1529 + if (iBcChainCount == 1) { // 只有一个车次链,是连班班型
  1530 + // 头部要添加出场,例保班次
  1531 + oStartBc = oLp.getBc(
  1532 + oLp.fnGetBcChainInfo(0)["s_q"],
  1533 + oLp.fnGetBcChainInfo(0)["s_b"]
  1534 + );
  1535 + aOtherBc.push(_factory.createBcObj(
  1536 + oLp, "bd", true, 1,
  1537 + oStartBc.getFcTimeObj(),
  1538 + _paramObj
  1539 + ));
  1540 + aOtherBc.push(_factory.createBcObj(
  1541 + oLp, "out", true, 1,
  1542 + oStartBc.getFcTimeObj(),
  1543 + _paramObj
  1544 + ));
  1545 +
  1546 + // 尾部需添加进场,例保班次
  1547 + oEndBc = oLp.getBc(
  1548 + oLp.fnGetBcChainInfo(0)["e_q"],
  1549 + oLp.fnGetBcChainInfo(0)["e_b"]
  1550 + );
  1551 + oEndBc.fnSetIsLastBc(false); // 有可能最后一个班次是吃饭班次,重置
  1552 + oEndBc.fnSetEatTime(0); // 有可能最后一个班次是吃饭班次,重置
  1553 + aOtherBc.push(_factory.createBcObj(
  1554 + oLp, "in", true, 1,
  1555 + oEndBc.getArrTimeObj(),
  1556 + _paramObj
  1557 + ));
  1558 + aOtherBc.push(_factory.createBcObj(
  1559 + oLp, "lc", true, 1,
  1560 + oEndBc.getArrTimeObj(),
  1561 + _paramObj
  1562 + ));
  1563 + } else if (iBcChainCount == 2) { // 两个车次链,是分班班型
  1564 + // 第一个车次链开头有出场,报到班次,车次链结尾只有进场班次
  1565 + oStartBc = oLp.getBc(
  1566 + oLp.fnGetBcChainInfo(0)["s_q"],
  1567 + oLp.fnGetBcChainInfo(0)["s_b"]
  1568 + );
  1569 + aOtherBc.push(_factory.createBcObj(
  1570 + oLp, "bd", true, 1,
  1571 + oStartBc.getFcTimeObj(),
  1572 + _paramObj
  1573 + ));
  1574 + aOtherBc.push(_factory.createBcObj(
  1575 + oLp, "out", true, 1,
  1576 + oStartBc.getFcTimeObj(),
  1577 + _paramObj
  1578 + ));
  1579 +
  1580 + oEndBc = oLp.getBc(
  1581 + oLp.fnGetBcChainInfo(0)["e_q"],
  1582 + oLp.fnGetBcChainInfo(0)["e_b"]
  1583 + );
  1584 + aOtherBc.push(_factory.createBcObj(
  1585 + oLp, "in", true, 1,
  1586 + oEndBc.getArrTimeObj(),
  1587 + _paramObj
  1588 + ));
  1589 +
  1590 + // 第二个车次链开头有出场,报到班次,车次链结尾有进场,报到班次
  1591 + oStartBc = oLp.getBc(
  1592 + oLp.fnGetBcChainInfo(1)["s_q"],
  1593 + oLp.fnGetBcChainInfo(1)["s_b"]
  1594 + );
  1595 + aOtherBc.push(_factory.createBcObj(
  1596 + oLp, "bd", true, 1,
  1597 + oStartBc.getFcTimeObj(),
  1598 + _paramObj
  1599 + ));
  1600 + aOtherBc.push(_factory.createBcObj(
  1601 + oLp, "out", true, 1,
  1602 + oStartBc.getFcTimeObj(),
  1603 + _paramObj
  1604 + ));
  1605 +
  1606 + oEndBc = oLp.getBc(
  1607 + oLp.fnGetBcChainInfo(1)["e_q"],
  1608 + oLp.fnGetBcChainInfo(1)["e_b"]
  1609 + );
  1610 + aOtherBc.push(_factory.createBcObj(
  1611 + oLp, "in", true, 1,
  1612 + oEndBc.getArrTimeObj(),
  1613 + _paramObj
  1614 + ));
  1615 + aOtherBc.push(_factory.createBcObj(
  1616 + oLp, "lc", true, 1,
  1617 + oEndBc.getArrTimeObj(),
  1618 + _paramObj
  1619 + ));
  1620 +
  1621 +
  1622 + } else {
  1623 + // 2个车次链以上,暂时没有此班型
  1624 + }
  1625 +
  1626 + oLp.addOtherBcArray(aOtherBc);
  1627 + }
  1628 + },
  1629 +
  1630 + /**
  1631 + * 祛除上标线开头的删除标记的班次。
  1632 + */
  1633 + fnRemoveDelFirstFlagBc: function() {
  1634 + var oLp = _internalLpArray[0];
  1635 + var aMinBcIndex = oLp.getMinBcObjPosition();
  1636 + if (oLp.getBc(aMinBcIndex[0], aMinBcIndex[1]).fnIsDelFlag()) {
  1637 + oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]);
  1638 + }
  1639 + },
  1640 + /**
  1641 + * 祛除上标线结尾的删除标记的班次。
  1642 + */
  1643 + fnRemoveDelLastFlagBc: function() {
  1644 + var oLp = _internalLpArray[0];
  1645 + var aMaxBcIndex = oLp.getMaxBcObjPosition();
  1646 + if (oLp.getBc(aMaxBcIndex[0], aMaxBcIndex[1]).fnIsDelFlag()) {
  1647 + oLp.removeBc(aMaxBcIndex[0], aMaxBcIndex[1]);
  1648 + }
  1649 + },
  1650 +
  1651 + /**
  1652 + * 调整路牌班次间隔(核准周转时间,停站时间)。
  1653 + * @param iFre int 迭代次数
  1654 + */
  1655 + fnAdjustLpBcInterval: function(iFre) {
  1656 + if (iFre > 0) {
  1657 + for (var i = 0; i < _internalLpArray.length; i++) {
  1658 + _internalLpArray[i].fnAdjustBcInterval(
  1659 + this.fnCalcuAverPeakStopTime(),
  1660 + this.fnCalcuAverTroughStopTime(),
  1661 + _paramObj);
  1662 + }
  1663 +
  1664 + this.fnAdjustLpBcInterval(iFre - 1);
  1665 + }
  1666 + },
  1667 +
  1668 + /**
  1669 + * 调整班次间隔。
  1670 + * @param bIsUp 是否上行
  1671 + * @param oStartTime 开始时间对象
  1672 + * @param iFre 迭代次数
  1673 + */
  1674 + fnAdjustBcInterval2_: function(bIsUp, oStartTime, iFre) {
  1675 + if (iFre > 0) {
  1676 + var aBc = _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
  1677 + aBc.sort(function(o1, o2) {
  1678 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1679 + return -1;
  1680 + } else {
  1681 + return 1;
  1682 + }
  1683 + });
  1684 + var i;
  1685 + var j;
  1686 +
  1687 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  1688 + var aBcOfGroup; // 3个班次列表
  1689 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  1690 +
  1691 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  1692 + aBcOfGroup = [];
  1693 + aBcIntervalOfGroup = [];
  1694 + for (j = i; j < i + iBcCountOfGroup; j++) {
  1695 + aBcOfGroup.push(aBc[j]);
  1696 + }
  1697 +
  1698 + for (j = 0; j < aBcOfGroup.length; j++) {
  1699 + if (j < aBcOfGroup.length - 1) {
  1700 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  1701 + aBcOfGroup[j].getFcTimeObj(), "m"));
  1702 + }
  1703 + }
  1704 +
  1705 + if (aBcIntervalOfGroup[0] < 19) {
  1706 + aBcOfGroup[1].addMinuteToFcsj(1);
  1707 + } else if (aBcIntervalOfGroup[0] > 20) {
  1708 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1709 + } else {
  1710 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1711 + //continue;
  1712 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1713 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1714 + } else {
  1715 + aBcOfGroup[1].addMinuteToFcsj(1);
  1716 + }
  1717 + }
  1718 +
  1719 + }
  1720 +
  1721 + this.fnAdjustBcInterval2(bIsUp, oStartTime, iFre - 1);
  1722 + }
  1723 + },
  1724 +
  1725 + /**
  1726 + * 调整班次间隔。
  1727 + * @param boolean isUp 是否上行
  1728 + * @param oStartTime 开始时间对象
  1729 + * @param fre int 迭代次数
  1730 + */
  1731 + fnAdjustBcInterval: function(isUp, oStartTime, fre) {
  1732 + if (fre > 0) {
  1733 + var aBc = !oStartTime ? _fnGetBcList(isUp) : _fnGetBcList2(isUp, oStartTime); // 指定方向的班次列表
  1734 +
  1735 + aBc.sort(function(o1, o2) {
  1736 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1737 + return -1;
  1738 + } else {
  1739 + return 1;
  1740 + }
  1741 + });
  1742 +
  1743 + var i;
  1744 + var j;
  1745 +
  1746 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  1747 + var aBcOfGroup; // 3个班次列表
  1748 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  1749 + var oBcFcTime; // 班次发车时间
  1750 +
  1751 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  1752 + aBcOfGroup = [];
  1753 + aBcIntervalOfGroup = [];
  1754 + for (j = i; j < i + iBcCountOfGroup; j++) {
  1755 + aBcOfGroup.push(aBc[j]);
  1756 + }
  1757 +
  1758 + for (j = 0; j < aBcOfGroup.length; j++) {
  1759 + if (j < aBcOfGroup.length - 1) {
  1760 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  1761 + aBcOfGroup[j].getFcTimeObj(), "m"));
  1762 + }
  1763 + }
  1764 +
  1765 + // 判定规则
  1766 + oBcFcTime = aBcOfGroup[1].getFcTimeObj();
  1767 +
  1768 + // 第一个班次发车时间不动,根据间隔,调整中间一个班次
  1769 + // 如果3个班次2个间隔时间差1分钟,不调整
  1770 + // 如果第一个间隔大,调整第二个班次往前1分钟
  1771 + // 如果第二个间隔大,调整第二个班次往后1分钟
  1772 +
  1773 + if (_paramObj.isTroughBc(oBcFcTime) &&
  1774 + aBcIntervalOfGroup[0] > _paramObj.getTroughMaxFcjx()) {
  1775 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1776 + }
  1777 +
  1778 + //else if (_paramObj.isMPeakBc(oBcFcTime) &&
  1779 + // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {
  1780 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1781 + //} else if (_paramObj.isMPeakBc(oBcFcTime) &&
  1782 + // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {
  1783 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1784 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  1785 + // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {
  1786 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1787 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  1788 + // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {
  1789 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1790 + //}
  1791 +
  1792 +
  1793 + else {
  1794 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1795 + //continue;
  1796 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1797 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1798 + } else {
  1799 + aBcOfGroup[1].addMinuteToFcsj(1);
  1800 + }
  1801 + }
  1802 +
  1803 + //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1804 + // //continue;
  1805 + //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1806 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1807 + //} else {
  1808 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1809 + //}
  1810 +
  1811 +
  1812 + }
  1813 +
  1814 + this.fnAdjustBcInterval(isUp, oStartTime, fre - 1);
  1815 + }
  1816 +
  1817 + },
  1818 +
  1819 + /**
  1820 + * 调整班次间隔(平均间隔)。
  1821 + * @param bIsUp 是否上行
  1822 + * @param oStartTime 开始时间对象
  1823 + */
  1824 + fnAdjustBcInterval2_avg: function(bIsUp, oStartTime) {
  1825 + var aBc = !oStartTime ? _fnGetBcList(bIsUp) : _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
  1826 + aBc.sort(function(o1, o2) {
  1827 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1828 + return -1;
  1829 + } else {
  1830 + return 1;
  1831 + }
  1832 + });
  1833 +
  1834 + if (aBc.length == 0) {
  1835 + return;
  1836 + }
  1837 +
  1838 + var j;
  1839 + var iCount = aBc.length - 1;
  1840 + var iC1 = Math.floor(aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") / iCount);
  1841 + var iC2 = aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") % iCount;
  1842 + var iTempTime;
  1843 +
  1844 + for (j = 0; j < iCount - iC2; j++) {
  1845 + iTempTime = aBc[j + 1].getFcTimeObj().diff(aBc[j].getFcTimeObj(), "m");
  1846 + aBc[j + 1].addMinuteToFcsj(iC1 - iTempTime);
  1847 + }
  1848 + for (j = 0; j < iC2; j++) {
  1849 + iTempTime = aBc[iCount - iC2 + j + 1].getFcTimeObj().diff(aBc[iCount - iC2 + j].getFcTimeObj(), "m");
  1850 + aBc[iCount - iC2 + j + 1].addMinuteToFcsj(iC1 + 1 - iTempTime);
  1851 + }
  1852 +
  1853 + },
  1854 +
  1855 + /**
  1856 + * 计算高峰平均停站时间。
  1857 + */
  1858 + fnCalcuAverPeakStopTime: function() {
  1859 + var i;
  1860 + var j;
  1861 + var aBc;
  1862 + var iBcCount = 0;
  1863 + var iSum = 0;
  1864 + for (i = 0; i < _internalLpArray.length; i++) {
  1865 + aBc = _internalLpArray[i].getBcArray();
  1866 +
  1867 + for (j = 0; j < aBc.length; j++) {
  1868 + if (!_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
  1869 + iBcCount ++;
  1870 + iSum += aBc[j].getStopTime();
  1871 + }
  1872 + }
  1873 + }
  1874 +
  1875 + return Math.floor(iSum / iBcCount);
  1876 + },
  1877 +
  1878 + /**
  1879 + * 计算低谷平均停站时间。
  1880 + */
  1881 + fnCalcuAverTroughStopTime: function() {
  1882 + var i;
  1883 + var j;
  1884 + var aBc;
  1885 + var iBcCount = 0;
  1886 + var iSum = 0;
  1887 + for (i = 0; i < _internalLpArray.length; i++) {
  1888 + aBc = _internalLpArray[i].getBcArray();
  1889 + for (j = 0; j < aBc.length; j++) {
  1890 + if (_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
  1891 + iBcCount ++;
  1892 + iSum += aBc[j].getStopTime();
  1893 + }
  1894 + }
  1895 + }
  1896 +
  1897 + return Math.floor(iSum / iBcCount);
  1898 + },
  1899 +
  1900 + //------------- 其他方法 -------------//
  1901 + /**
  1902 + * 返回内部路牌数据列表。
  1903 + * @returns {Array}
  1904 + */
  1905 + fnGetLpArray: function() {
  1906 + return _internalLpArray;
  1907 + },
  1908 +
  1909 + /**
  1910 + * 内部数据转化成显示用的班次数组。
  1911 + */
  1912 + fnToGanttBcArray: function() {
  1913 + var aAllBc = [];
  1914 + var aLpBc = [];
  1915 + var aEatBc = [];
  1916 + var oLp;
  1917 + var i;
  1918 + var j;
  1919 +
  1920 + for (i = 0; i < _internalLpArray.length; i++) {
  1921 + oLp = _internalLpArray[i];
  1922 + aLpBc = [];
  1923 + aLpBc = aLpBc.concat(oLp.getOtherBcArray(), oLp.getBcArray());
  1924 +
  1925 + aEatBc = [];
  1926 + // 根据班次的吃饭时间添加吃饭班次
  1927 + for (j = 0; j < aLpBc.length; j++) {
  1928 + if (aLpBc[j].fnGetEatTime() > 0) {
  1929 + aEatBc.push(_factory.createBcObj(
  1930 + oLp,
  1931 + "cf",
  1932 + !aLpBc[j].isUp(), // 和上一个班次方向相反
  1933 + 1,
  1934 + _paramObj.addMinute(aLpBc[j].getArrTimeObj(), aLpBc[j].getStopTime()), // 使用上一个班次的到达时间作为开始时间
  1935 + _paramObj
  1936 + ));
  1937 + }
  1938 + }
  1939 + aLpBc = aLpBc.concat(aEatBc);
  1940 +
  1941 + // 按照发车时间排序
  1942 + aLpBc.sort(function(o1, o2) {
  1943 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1944 + return -1;
  1945 + } else {
  1946 + return 1;
  1947 + }
  1948 + });
  1949 +
  1950 + // 重新赋值fcno
  1951 + for (j = 0; j < aLpBc.length; j++) {
  1952 + aLpBc[j].fnSetFcno(j + 1);
  1953 + }
  1954 +
  1955 + aAllBc = aAllBc.concat(aLpBc);
  1956 + }
  1957 +
  1958 + var aGanttBc = [];
  1959 + for (i = 0; i < aAllBc.length; i++) {
  1960 + aGanttBc.push(aAllBc[i].toGanttBcObj());
  1961 + }
  1962 +
  1963 + return aGanttBc;
  1964 + }
  1965 +
  1966 + };
  1967 +
1968 1968 };
1969 1969 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
1   -/**
2   - * 主类。
3   - */
4   -var Main_v2 = function() {
5   -
6   - // 内部工厂类
7   - var _factoryFun = function() {
8   - return {
9   - // 创建参数
10   - createParameterObj: function(formMap, dataMap) {
11   - var paramObj = ParameterObj();
12   - paramObj.wrap(formMap, dataMap);
13   - return paramObj;
14   - },
15   - // 创建班次对象
16   - createBcObj: function(lpObj, bcType, isUp, fcno, fcTimeObj, paramObj) {
17   - var _bclc = paramObj.calcuTravelLcNumber(isUp, bcType);
18   - var _fcsj = fcTimeObj;
19   - var _bcsj = paramObj.calcuTravelTime(_fcsj, isUp);
20   - var _arrsj = paramObj.addMinute(_fcsj, _bcsj);
21   - //var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);
22   - var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, undefined);
23   - var _tccid = paramObj.getTTinfoId();
24   - var _ttinfoid = paramObj.getTTinfoId();
25   - var _xl = paramObj.getXlId();
26   - var _qdz = isUp ? paramObj.getUpQdzObj().id : paramObj.getDownQdzObj().id;
27   - var _zdz = isUp ? paramObj.getUpZdzObj().id : paramObj.getDownZdzObj().id;
28   -
29   - if (bcType == "bd") { // 早例保,传过来的发车时间是第一个班次的发车时间
30   - if (isUp) { // 上行
31   - _fcsj = paramObj.addMinute(
32   - _fcsj,
33   - -(paramObj.getUpOutTime() + paramObj.getLbTime()));
34   - _bcsj = paramObj.getLbTime();
35   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
36   - _stoptime = 0;
37   - } else { // 下行
38   - _fcsj = paramObj.addMinute(
39   - _fcsj,
40   - -(paramObj.getDownOutTime() + paramObj.getLbTime()));
41   - _bcsj = paramObj.getLbTime();
42   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
43   - _stoptime = 0;
44   - }
45   - } else if (bcType == "lc") { // 晚例保,传过来的发车时间是最后一个班次的到达时间
46   - if (isUp) { // 上行
47   - _fcsj = paramObj.addMinute(
48   - _fcsj,
49   - paramObj.getUpInTime());
50   - _bcsj = paramObj.getLbTime();
51   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
52   - _stoptime = 0;
53   - } else { // 下行
54   - _fcsj = paramObj.addMinute(
55   - _fcsj,
56   - paramObj.getDownInTime());
57   - _bcsj = paramObj.getLbTime();
58   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
59   - _stoptime = 0;
60   - }
61   - } else if (bcType == "out") { // 出场,传过来的发车时间是第一个班次的发车时间
62   - if (isUp) { // 上行
63   - _fcsj = paramObj.addMinute(
64   - _fcsj,
65   - -paramObj.getUpOutTime());
66   - _bcsj = paramObj.getUpOutTime();
67   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
68   - _stoptime = 0;
69   - } else { // 下行
70   - _fcsj = paramObj.addMinute(
71   - _fcsj,
72   - -paramObj.getDownOutTime());
73   - _bcsj = paramObj.getDownOutTime();
74   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
75   - _stoptime = 0;
76   - }
77   - } else if (bcType == "in") { // 进场,传过来的发车时间是最后一个班次的到达时间
78   - if (isUp) { // 上行
79   - _bcsj = paramObj.getUpInTime();
80   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
81   - _stoptime = 0;
82   - } else { // 下行
83   - _bcsj = paramObj.getDownInTime();
84   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
85   - _stoptime = 0;
86   - }
87   - } else if (bcType == "cf") { // 吃饭班次
88   - // 以13:00为分界,之前的为午饭,之后的为晚饭
89   - if (fcTimeObj.isBefore(paramObj.toTimeObj("13:00"))) {
90   - _bcsj = paramObj.fnGetLunchTime();
91   - } else {
92   - _bcsj = paramObj.fnGetDinnerTime();
93   - }
94   - _arrsj = paramObj.addMinute(_fcsj, _bcsj);
95   - _stoptime = 0;
96   - }
97   -
98   - var bcParamObj = {};
99   - bcParamObj.bcType = bcType; // 班次类型(normal,in_,out, bd, lc, cf等)
100   - bcParamObj.isUp = isUp; // boolean是否上下行
101   - bcParamObj.fcno = fcno; // 发车顺序号
102   - bcParamObj.fcTimeObj = _fcsj; // 发车时间对象
103   - bcParamObj.bclc = _bclc; // 班次里程
104   - bcParamObj.bcsj = _bcsj; // 班次历时
105   - bcParamObj.arrtime = _arrsj; // 到达时间对象
106   - bcParamObj.stoptime = _stoptime; // 停站时间
107   - bcParamObj.tccid = _tccid; // 停车场id
108   - bcParamObj.ttinfoid = _ttinfoid; // 时刻表id
109   - bcParamObj.xl = _xl; // 线路id
110   - bcParamObj.qdzid = _qdz; // 起点站id
111   - bcParamObj.zdzid = _zdz; // 终点站id
112   -
113   - return new InternalBcObj(lpObj, bcParamObj);
114   - }
115   - };
116   - };
117   - var _factory = _factoryFun();
118   -
119   - // 所有的时间使用moment.js计算
120   -
121   - var _paramObj; // 参数对象
122   -
123   - var _bxDesc = [ // 班型描述
124   - {'type':'六工一休','hoursV':6.66, 'minueV':'6:40', 'qcount': 0, 'avertime': 0},
125   - {'type':'五工一休','hoursV':6.85, 'minueV':'6:51', 'qcount': 0, 'avertime': 0},
126   - {'type':'四工一休','hoursV':7.14, 'minueV':'7:08', 'qcount': 0, 'avertime': 0},
127   - {'type':'三工一休','hoursV':7.61, 'minueV':'7:37', 'qcount': 0, 'avertime': 0},
128   - {'type':'二工一休','hoursV':8.57, 'minueV':'8:34', 'qcount': 0, 'avertime': 0},
129   - {'type':'一工一休','hoursV':11.42, 'minueV':'11:25', 'qcount': 0, 'avertime': 0},
130   - {'type':'五工二休','hoursV':7.99, 'minueV':'8:00', 'qcount': 0, 'avertime': 0},
131   - {'type':'无工休', 'hoursV':5.43, 'minueV':'5:43', 'qcount': 0, 'avertime': 0}
132   - ];
133   -
134   - var _funCalcuExportData_lpObjList = function(aInternalLpObj) {
135   - // 构造路牌对象
136   - var aLpObj = [];
137   - var i;
138   - var j;
139   - var z;
140   - var oInternalLp;
141   - var oInternalBc;
142   - var oInternalBc_temp;
143   - var oLp;
144   - var iZlc;
145   - var iYylc;
146   - var iKslc;
147   - var iZbc;
148   - var iZgs;
149   - var iYygs;
150   - var iYybc;
151   - for (i = 0; i < aInternalLpObj.length; i++) {
152   - oInternalLp = aInternalLpObj[i];
153   - iZlc = 0;
154   - iYylc = 0;
155   - iKslc = 0;
156   - iZgs = 0;
157   - iZbc = 0;
158   - iYygs = 0;
159   - iYybc = 0;
160   - oLp = {
161   - "lpname": oInternalLp.getLpName(), // 路牌名字
162   - "isUp": oInternalLp.isUp(), // 每圈的第一个班次是否上行
163   - "bcObjList": [], // 班次列表
164   - "groupCount": oInternalLp.fnGetGroupCount(), // 总圈数
165   - "zlc": 0, // 总里程
166   - "yylc": 0, // 营运里程
167   - "kslc": 0, // 空驶里程
168   - "zgs": 0, // 总工时
169   - "zbc": 0, // 总班次
170   - "yygs": 0, // 营运工时
171   - "yybc": 0, // 营运班次
172   - "stationRouteId1": 0, // 第一个班次起点站路由id
173   - "stationRouteId2": 0 // 第二个班次起点站路由id
174   - };
175   -
176   - // 将报到班次,进出场班次加到班次的时间上
177   - var iBcChainCount;
178   - var oStartBc;
179   - var oEndBc;
180   - var oTempBc;
181   - var aFcsj = [];
182   -
183   - iBcChainCount = oInternalLp.fnGetBcChainCount();
184   - if (iBcChainCount == 1) { // 单一车次链,连班班型
185   - oStartBc = oInternalLp.getBc(
186   - oInternalLp.fnGetBcChainInfo(0)["s_q"],
187   - oInternalLp.fnGetBcChainInfo(0)["s_b"]
188   - );
189   - oTempBc = _factory.createBcObj(
190   - oLp, "bd", true, 1,
191   - oStartBc.getFcTimeObj(),
192   - _paramObj
193   - );
194   - aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
195   - oLp.bcObjList.push({ // 报到班次
196   - "bcsj": oTempBc.getBcTime(), // 班次时间
197   - "ssj": oTempBc.getStopTime(), // 停站时间
198   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
199   -
200   - "tccid": oTempBc._$_tccid, // 停车场id
201   - "qdzid": oTempBc._$_qdzid, // 起点站id
202   - "zdzid": oTempBc._$_zdzid, // 终点站id
203   -
204   - "isUp": oTempBc._$_isUp, // 是否上行
205   - "isFb": false, // 是否分班
206   -
207   - "bcType": oTempBc._$_bcType, // 班次类型
208   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
209   -
210   - "groupNo": -1, // 第几圈
211   - "groupBcNo": -1 // 圈里第几个班次
212   -
213   - });
214   -
215   - oTempBc = _factory.createBcObj(
216   - oLp, "out", true, 1,
217   - oStartBc.getFcTimeObj(),
218   - _paramObj
219   - );
220   - aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
221   - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
222   - oStartBc._$_fcsj_desc = aFcsj.join("");
223   -
224   - oLp.bcObjList.push({ // 出场班次
225   - "bcsj": oTempBc.getBcTime(), // 班次时间
226   - "ssj": oTempBc.getStopTime(), // 停站时间
227   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
228   -
229   - "tccid": oTempBc._$_tccid, // 停车场id
230   - "qdzid": oTempBc._$_qdzid, // 起点站id
231   - "zdzid": oTempBc._$_zdzid, // 终点站id
232   -
233   - "isUp": oTempBc._$_isUp, // 是否上行
234   - "isFb": false, // 是否分班
235   -
236   - "bcType": oTempBc._$_bcType, // 班次类型
237   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
238   -
239   - "groupNo": -1, // 第几圈
240   - "groupBcNo": -2 // 圈里第几个班次
241   -
242   - });
243   -
244   - aFcsj = [];
245   -
246   - oEndBc = oInternalLp.getBc(
247   - oInternalLp.fnGetBcChainInfo(0)["e_q"],
248   - oInternalLp.fnGetBcChainInfo(0)["e_b"]
249   - );
250   - aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
251   - oTempBc = _factory.createBcObj(
252   - oLp, "in", true, 1,
253   - oEndBc.getArrTimeObj(),
254   - _paramObj
255   - );
256   - aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
257   -
258   - oLp.bcObjList.push({ // 进场班次
259   - "bcsj": oTempBc.getBcTime(), // 班次时间
260   - "ssj": oTempBc.getStopTime(), // 停站时间
261   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
262   -
263   - "tccid": oTempBc._$_tccid, // 停车场id
264   - "qdzid": oTempBc._$_qdzid, // 起点站id
265   - "zdzid": oTempBc._$_zdzid, // 终点站id
266   -
267   - "isUp": oTempBc._$_isUp, // 是否上行
268   - "isFb": false, // 是否分班
269   -
270   - "bcType": oTempBc._$_bcType, // 班次类型
271   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
272   -
273   - "groupNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ?
274   - oInternalLp.fnGetBcChainInfo(0)["e_q"] :
275   - oInternalLp.fnGetBcChainInfo(0)["e_q"] + 1, // 第几圈
276   - "groupBcNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ? 1 : 0 // 圈里第几个班次
277   -
278   - });
279   -
280   - oTempBc = _factory.createBcObj(
281   - oLp, "lc", true, 1,
282   - oEndBc.getArrTimeObj(),
283   - _paramObj
284   - );
285   - aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
286   - oLp.bcObjList.push({ // 离场班次
287   - "bcsj": oTempBc.getBcTime(), // 班次时间
288   - "ssj": oTempBc.getStopTime(), // 停站时间
289   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
290   -
291   - "tccid": oTempBc._$_tccid, // 停车场id
292   - "qdzid": oTempBc._$_qdzid, // 起点站id
293   - "zdzid": oTempBc._$_zdzid, // 终点站id
294   -
295   - "isUp": oTempBc._$_isUp, // 是否上行
296   - "isFb": false, // 是否分班
297   -
298   - "bcType": oTempBc._$_bcType, // 班次类型
299   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
300   -
301   - "groupNo": -2, // 第几圈
302   - "groupBcNo": -4 // 圈里第几个班次
303   -
304   - });
305   -
306   - oEndBc._$_fcsj_desc = aFcsj.join("");
307   -
308   - } else if (iBcChainCount == 2) { // 两个车次链,分班班型
309   - oStartBc = oInternalLp.getBc(
310   - oInternalLp.fnGetBcChainInfo(0)["s_q"],
311   - oInternalLp.fnGetBcChainInfo(0)["s_b"]
312   - );
313   - oTempBc = _factory.createBcObj(
314   - oLp, "bd", true, 1,
315   - oStartBc.getFcTimeObj(),
316   - _paramObj
317   - );
318   - aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
319   - oLp.bcObjList.push({ // 报到班次
320   - "bcsj": oTempBc.getBcTime(), // 班次时间
321   - "ssj": oTempBc.getStopTime(), // 停站时间
322   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
323   -
324   - "tccid": oTempBc._$_tccid, // 停车场id
325   - "qdzid": oTempBc._$_qdzid, // 起点站id
326   - "zdzid": oTempBc._$_zdzid, // 终点站id
327   -
328   - "isUp": oTempBc._$_isUp, // 是否上行
329   - "isFb": false, // 是否分班
330   -
331   - "bcType": oTempBc._$_bcType, // 班次类型
332   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
333   -
334   - "groupNo": -1, // 第几圈
335   - "groupBcNo": -1 // 圈里第几个班次
336   -
337   - });
338   -
339   - oTempBc = _factory.createBcObj(
340   - oLp, "out", true, 1,
341   - oStartBc.getFcTimeObj(),
342   - _paramObj
343   - );
344   - aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
345   - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
346   - oStartBc._$_fcsj_desc = aFcsj.join("");
347   -
348   - oLp.bcObjList.push({ // 出场班次
349   - "bcsj": oTempBc.getBcTime(), // 班次时间
350   - "ssj": oTempBc.getStopTime(), // 停站时间
351   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
352   -
353   - "tccid": oTempBc._$_tccid, // 停车场id
354   - "qdzid": oTempBc._$_qdzid, // 起点站id
355   - "zdzid": oTempBc._$_zdzid, // 终点站id
356   -
357   - "isUp": oTempBc._$_isUp, // 是否上行
358   - "isFb": false, // 是否分班
359   -
360   - "bcType": oTempBc._$_bcType, // 班次类型
361   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
362   -
363   - "groupNo": -1, // 第几圈
364   - "groupBcNo": -2 // 圈里第几个班次
365   -
366   - });
367   -
368   - aFcsj = [];
369   -
370   - oEndBc = oInternalLp.getBc(
371   - oInternalLp.fnGetBcChainInfo(0)["e_q"],
372   - oInternalLp.fnGetBcChainInfo(0)["e_b"]
373   - );
374   - aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
375   - oTempBc = _factory.createBcObj(
376   - oLp, "in", true, 1,
377   - oEndBc.getArrTimeObj(),
378   - _paramObj
379   - );
380   - aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
381   - oLp.bcObjList.push({ // 进场班次
382   - "bcsj": oTempBc.getBcTime(), // 班次时间
383   - "ssj": oTempBc.getStopTime(), // 停站时间
384   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
385   -
386   - "tccid": oTempBc._$_tccid, // 停车场id
387   - "qdzid": oTempBc._$_qdzid, // 起点站id
388   - "zdzid": oTempBc._$_zdzid, // 终点站id
389   -
390   - "isUp": oTempBc._$_isUp, // 是否上行
391   - "isFb": true, // 是否分班
392   -
393   - "bcType": oTempBc._$_bcType, // 班次类型
394   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
395   -
396   - "groupNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ?
397   - oInternalLp.fnGetBcChainInfo(0)["e_q"] :
398   - oInternalLp.fnGetBcChainInfo(0)["e_q"] + 1, // 第几圈
399   - "groupBcNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ? 1 : 0 // 圈里第几个班次
400   -
401   - });
402   - oEndBc._$_fcsj_desc = aFcsj.join("");
403   -
404   - aFcsj = [];
405   -
406   - oStartBc = oInternalLp.getBc(
407   - oInternalLp.fnGetBcChainInfo(1)["s_q"],
408   - oInternalLp.fnGetBcChainInfo(1)["s_b"]
409   - );
410   - oTempBc = _factory.createBcObj(
411   - oLp, "bd", true, 1,
412   - oStartBc.getFcTimeObj(),
413   - _paramObj
414   - );
415   - aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
416   - oLp.bcObjList.push({ // 报到班次
417   - "bcsj": oTempBc.getBcTime(), // 班次时间
418   - "ssj": oTempBc.getStopTime(), // 停站时间
419   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
420   -
421   - "tccid": oTempBc._$_tccid, // 停车场id
422   - "qdzid": oTempBc._$_qdzid, // 起点站id
423   - "zdzid": oTempBc._$_zdzid, // 终点站id
424   -
425   - "isUp": oTempBc._$_isUp, // 是否上行
426   - "isFb": true, // 是否分班
427   -
428   - "bcType": oTempBc._$_bcType, // 班次类型
429   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
430   -
431   - "groupNo": oInternalLp.fnGetBcChainInfo(1)["s_q"] - 1, // 第几圈
432   - "groupBcNo": oInternalLp.fnGetBcChainInfo(1)["s_b"] // 圈里第几个班次
433   -
434   - });
435   -
436   - oTempBc = _factory.createBcObj(
437   - oLp, "out", true, 1,
438   - oStartBc.getFcTimeObj(),
439   - _paramObj
440   - );
441   - oLp.bcObjList.push({ // 出场班次
442   - "bcsj": oTempBc.getBcTime(), // 班次时间
443   - "ssj": oTempBc.getStopTime(), // 停站时间
444   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
445   -
446   - "tccid": oTempBc._$_tccid, // 停车场id
447   - "qdzid": oTempBc._$_qdzid, // 起点站id
448   - "zdzid": oTempBc._$_zdzid, // 终点站id
449   -
450   - "isUp": oTempBc._$_isUp, // 是否上行
451   - "isFb": true, // 是否分班
452   -
453   - "bcType": oTempBc._$_bcType, // 班次类型
454   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
455   -
456   - "groupNo": oInternalLp.fnGetBcChainInfo(1)["s_b"] == 0 ?
457   - oInternalLp.fnGetBcChainInfo(1)["s_q"] - 1 :
458   - oInternalLp.fnGetBcChainInfo(1)["s_q"], // 第几圈
459   - "groupBcNo": oInternalLp.fnGetBcChainInfo(1)["s_b"] == 0 ? 1 : 0 // 圈里第几个班次
460   -
461   - });
462   - aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
463   - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
464   - oStartBc._$_fcsj_desc = aFcsj.join("");
465   -
466   - aFcsj = [];
467   -
468   - oEndBc = oInternalLp.getBc(
469   - oInternalLp.fnGetBcChainInfo(1)["e_q"],
470   - oInternalLp.fnGetBcChainInfo(1)["e_b"]
471   - );
472   - aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
473   - oTempBc = _factory.createBcObj(
474   - oLp, "in", true, 1,
475   - oEndBc.getArrTimeObj(),
476   - _paramObj
477   - );
478   - aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
479   -
480   - oLp.bcObjList.push({ // 进场班次
481   - "bcsj": oTempBc.getBcTime(), // 班次时间
482   - "ssj": oTempBc.getStopTime(), // 停站时间
483   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
484   -
485   - "tccid": oTempBc._$_tccid, // 停车场id
486   - "qdzid": oTempBc._$_qdzid, // 起点站id
487   - "zdzid": oTempBc._$_zdzid, // 终点站id
488   -
489   - "isUp": oTempBc._$_isUp, // 是否上行
490   - "isFb": false, // 是否分班
491   -
492   - "bcType": oTempBc._$_bcType, // 班次类型
493   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
494   -
495   - "groupNo": oInternalLp.fnGetBcChainInfo(1)["e_b"] == 0 ?
496   - oInternalLp.fnGetBcChainInfo(1)["e_q"] :
497   - oInternalLp.fnGetBcChainInfo(1)["e_q"] + 1, // 第几圈
498   - "groupBcNo": oInternalLp.fnGetBcChainInfo(1)["e_b"] == 0 ? 1 : 0 // 圈里第几个班次
499   -
500   - });
501   -
502   - oTempBc = _factory.createBcObj(
503   - oLp, "lc", true, 1,
504   - oEndBc.getArrTimeObj(),
505   - _paramObj
506   - );
507   -
508   - oLp.bcObjList.push({ // 离场班次
509   - "bcsj": oTempBc.getBcTime(), // 班次时间
510   - "ssj": oTempBc.getStopTime(), // 停站时间
511   - "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
512   -
513   - "tccid": oTempBc._$_tccid, // 停车场id
514   - "qdzid": oTempBc._$_qdzid, // 起点站id
515   - "zdzid": oTempBc._$_zdzid, // 终点站id
516   -
517   - "isUp": oTempBc._$_isUp, // 是否上行
518   - "isFb": false, // 是否分班
519   -
520   - "bcType": oTempBc._$_bcType, // 班次类型
521   - "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
522   -
523   - "groupNo": -2, // 第几圈
524   - "groupBcNo": -4 // 圈里第几个班次
525   -
526   - });
527   -
528   - aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
529   - oEndBc._$_fcsj_desc = aFcsj.join("");
530   -
531   - }
532   -
533   - for (j = 0; j < oInternalLp.fnGetGroupCount(); j++) {
534   - for (z = 0; z < 2; z++) {
535   - oInternalBc = oInternalLp.getBc(j, z);
536   - if (oInternalBc) {
537   - if (oInternalBc.fnGetEatTime() > 0) {
538   - // 吃饭班次是下一个班次开始吃,和本班次方向相反
539   - oInternalBc_temp = oInternalLp.getBc(
540   - z == 1 ? j + 1 : j,
541   - z == 1 ? 0 : 1);
542   -
543   - oInternalBc_temp._$_fcsj_desc = "(吃" + oInternalBc_temp.getFcTimeObj().format("HH:mm") + ")";
544   - }
545   -
546   - oLp.bcObjList.push({
547   - "bcsj": oInternalBc.getBcTime(), // 班次时间
548   - "ssj": oInternalBc.getStopTime(), // 停站时间
549   - "eatsj": oInternalBc.fnGetEatTime(), // 吃饭时间
550   -
551   - "tccid": oInternalBc._$_tccid, // 停车场id
552   - "qdzid": oInternalBc._$_qdzid, // 起点站id
553   - "zdzid": oInternalBc._$_zdzid, // 终点站id
554   -
555   - "isUp": oInternalBc._$_isUp, // 是否上行
556   -
557   - "bcType": oInternalBc._$_bcType, // 班次类型
558   - "fcsj": oInternalBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
559   - "fcsjDesc" : oInternalBc._$_fcsj_desc || oInternalBc._$_fcsjObj.format("HH:mm"),
560   -
561   - "groupNo": j, // 第几圈
562   - "groupBcNo": z // 圈里第几个班次
563   -
564   - });
565   -
566   - // iZlc = 0;
567   - // iYylc = 0;
568   - // iKslc = 0;
569   - // iZgs = 0;
570   - // iZbc = 0;
571   - // iYygs = 0;
572   - // iYybc = 0;
573   -
574   - iZlc = iZlc +
575   - oInternalBc._$_bclc; // 里程
576   - iYylc = iYylc +
577   - oInternalBc._$_bclc; // 里程
578   - iYygs = iYygs +
579   - oInternalBc.getBcTime() + // 班次时间
580   - oInternalBc.getStopTime() + // 停站时间
581   - oInternalBc.fnGetEatTime(); // 吃饭时间
582   - iYybc = iYybc + 1;
583   -
584   - iZgs = iZgs +
585   - oInternalBc.getBcTime() + // 班次时间
586   - oInternalBc.getStopTime() + // 停站时间
587   - oInternalBc.fnGetEatTime(); // 吃饭时间
588   - iZbc = iZbc + 1;
589   -
590   - // 设置圈站点路由id
591   - if (oInternalBc.isUp() == oInternalLp.isUp()) { // 第一个班次
592   - if (oLp.stationRouteId1 == 0) {
593   - oLp.stationRouteId1 = oInternalBc._$_qdzid;
594   - }
595   - } else { // 第二个班次
596   - if (oLp.stationRouteId2 == 0) {
597   - oLp.stationRouteId2 = oInternalBc._$_qdzid;
598   - }
599   - }
600   -
601   - }
602   - }
603   -
604   - }
605   -
606   - for (z = 0; z < oInternalLp.getOtherBcArray().length; z++) {
607   - oInternalBc = oInternalLp.getOtherBcArray()[z];
608   - iKslc = iKslc +
609   - oInternalBc._$_bclc; // 里程
610   - iZlc = iZlc +
611   - oInternalBc._$_bclc; // 里程
612   - iZgs = iZgs +
613   - oInternalBc.getBcTime() + // 班次时间
614   - oInternalBc.getStopTime(); // 停站时间
615   - if (oInternalBc._$_bcType != "bd" &&
616   - oInternalBc._$_bcType != "lc" &&
617   - oInternalBc._$_bcType != "cf") {
618   - iZbc = iZbc + 1;
619   - }
620   - }
621   -
622   - oLp.zlc = iZlc;
623   - oLp.yylc = iYylc;
624   - oLp.kslc = iKslc;
625   - oLp.zgs = iZgs;
626   - oLp.zbc = iZbc;
627   - oLp.yygs = iYygs;
628   - oLp.yybc = iYybc;
629   - aLpObj.push(oLp);
630   - }
631   -
632   - return aLpObj;
633   - };
634   -
635   - var _funCalcuExportData_statInfoList = function(aInternalLpObj) {
636   - var countBc = 0, // 总班次
637   - serviceBc = 0, // 营运班次
638   - jcbc = 0, // 进场总班次.
639   - ccbc = 0, // 出场总班次.
640   - cfbc = 0, // 吃饭总班次.
641   - zwlbbc = 0, // 早晚例保总班次.
642   - countGs = 0.0, // 总工时
643   - servicesj = 0, // 营运班次总时间
644   - jcsj = 0.0, // 进场总时间.
645   - ccsj = 0.0, // 出场总时间.
646   - cfsj = 0.0, // 吃饭总时间.
647   - zwlbsj = 0.0, // 早晚例保总时间.
648   - ksBc = 0, // 空驶班次
649   - serviceLc = 0.0, // 营运里程
650   - ksLc = 0.0, // 空驶里程
651   - avgTzjx = 0.0, // 平均停站间隙
652   - gfServiceBc = 0, // 高峰营运班次
653   - dgServiceBc = 0, // 低谷营运班次
654   - gfAvgTzjx = 0.0, // 高峰平均停站间隙
655   - dgAvgTzjx = 0.0; // 低谷平均停站间隙
656   -
657   - var aAllBc = [];
658   - var oLp;
659   - var oBc;
660   - var i;
661   - var j;
662   -
663   - for (i = 0; i < aInternalLpObj.length; i++) {
664   - oLp = aInternalLpObj[i];
665   - for (j = 0; j < oLp.getBcArray().length; j++) {
666   - aAllBc.push(oLp.getBcArray()[j]);
667   - }
668   - for (j = 0; j < oLp.getOtherBcArray().length; j++) {
669   - aAllBc.push(oLp.getOtherBcArray()[j]);
670   - }
671   - }
672   -
673   - for (i = 0; i < aAllBc.length; i++) {
674   - oBc = aAllBc[i];
675   -
676   - if (oBc.getBcTime() > 0) {
677   - countBc = countBc + 1;
678   - countGs = countGs + oBc.getStopTime() + oBc.getBcTime();
679   - if (_paramObj.isTroughBc(oBc.getFcTimeObj())) {
680   - if (oBc._$_bcType == "normal") {
681   - dgServiceBc = dgServiceBc + 1;
682   - dgAvgTzjx = dgAvgTzjx + oBc.getStopTime();
683   - }
684   - } else {
685   - if (oBc._$_bcType == "normal") {
686   - gfServiceBc = gfServiceBc + 1;
687   - gfAvgTzjx = gfAvgTzjx + oBc.getStopTime();
688   - }
689   - }
690   -
691   - if (oBc._$_bcType == "normal") {
692   - serviceBc = serviceBc + 1;
693   - serviceLc = serviceLc + oBc._$_bclc;
694   - servicesj = servicesj + oBc.getBcTime();
695   - avgTzjx = avgTzjx + oBc.getStopTime();
696   -
697   - if (oBc.fnGetEatTime() > 0) {
698   - cfbc = cfbc + 1;
699   - cfsj = cfsj + oBc.fnGetEatTime();
700   - }
701   - } else if (oBc._$_bcType == "in") {
702   - jcbc = jcbc + 1;
703   - jcsj = jcsj + oBc.getBcTime();
704   - } else if (oBc._$_bcType == "out") {
705   - ccbc = ccbc + 1;
706   - ccsj = ccsj + oBc.getBcTime();
707   - } else if (oBc._$_bcType == "bd") {
708   - zwlbbc = zwlbbc + 1;
709   - zwlbsj = zwlbsj + oBc.getBcTime();
710   - } else if (oBc._$_bcType == "lc") {
711   - zwlbbc = zwlbbc + 1;
712   - zwlbsj = zwlbsj + oBc.getBcTime();
713   - }
714   - }
715   - }
716   -
717   - dgAvgTzjx = dgAvgTzjx / dgServiceBc;
718   - gfAvgTzjx = gfAvgTzjx / gfServiceBc;
719   - avgTzjx = avgTzjx / dgServiceBc;
720   -
721   - return [
722   - {'statItem': '总班次(包括进出场、吃饭时间、早晚例保、营运且班次时间大于零的班次)', 'statValue': countBc},
723   - {'statItem': '进场总班次(包括进场且班次时间大于零的班次)', 'statValue': jcbc},
724   - {'statItem': '出场总班次(包括进场且班次时间大于零的班次)', 'statValue': ccbc},
725   - {'statItem': '吃饭总班次(包括吃饭且班次时间大于零的班次)', 'statValue': cfbc},
726   - {'statItem': '早晚例保总班次(包括早晚例保且时间大于零的班次)', 'statValue': zwlbbc},
727   - {'statItem': '营运总班次(包括正常、区间、放大站且班次时间大于零班次)','statValue': serviceBc},
728   - {'statItem': '进场总时间(包括进场班次且班次时间大于零)', 'statValue': jcsj/60},
729   - {'statItem': '出场总时间(包括进场班次且班次时间大于零)', 'statValue': ccsj/60},
730   - {'statItem': '吃饭总时间(包括吃饭班次且班次时间大于零)', 'statValue': cfsj/60},
731   - {'statItem': '早晚例保总时间(包括早晚例保班次且时间大于零的)', 'statValue': zwlbsj/60},
732   - {'statItem': '营运班次总时间(包括正常、区间、放大站且班次时间大于零)', 'statValue': servicesj/60},
733   - {'statItem': '总工时(包括进出场、吃饭时间、早晚例保、营运班次时间)', 'statValue': countGs/60},
734   - {'statItem': '空驶班次(包括直放班次)', 'statValue': ksBc},
735   - {'statItem': '营运里程(包括正常、区间、放大站里程)', 'statValue': serviceLc},
736   - {'statItem': '空驶里程(包括直放里程)', 'statValue': ksLc},
737   - {'statItem': '平均停站时间(营运班次停站时间总和/营运总班次)', 'statValue': avgTzjx},
738   - {'statItem': '高峰营运班次(包括早晚高峰时段的正常、区间、放大站班次)', 'statValue': gfServiceBc},
739   - {'statItem': '低谷营运班次(包括低谷时段的正常、区间、放大站班次)', 'statValue': dgServiceBc},
740   - {'statItem': '高峰平均停站间隙(高峰营运班次停站时间总和/高峰营运班次总和)', 'statValue': gfAvgTzjx},
741   - {'statItem': '低谷平均停站间隙(低谷营运班次停站时间总和/低谷营运班次总和)', 'statValue': dgAvgTzjx},
742   - {'statItem': '综合评估', 'statValue': 3}
743   - ];
744   -
745   - };
746   -
747   - return {
748   - /**
749   - * 工厂对象,创建不同的对象。
750   - * @returns {{createParameterObj, createBcObj}}
751   - */
752   - getFactory: function() {
753   - return _factory;
754   - },
755   -
756   - /**
757   - * 使用发车间隔策略生成时刻表。
758   - * @param paramObj 参数对象
759   - * @param lpArray 路牌数组
760   - * @constructor
761   - */
762   - BXPplaceClassesTime03 : function(paramObj, lpArray) {
763   - // 参数对象
764   - _paramObj = paramObj;
765   -
766   - // 1、初始化行车计划
767   - var schedule = new InternalScheduleObj(_paramObj, lpArray, _factory);
768   - schedule.fnInitDataWithBxLayout();
769   - // 2、将连班路牌的班次补足
770   - schedule.fnCalcuLpBx_lb();
771   -
772   - // 3、修正针对初始化时生成的高峰班次,之前不足的补上,多余的删除
773   - schedule.fnAdjustGfbc(true, true); // 修正上行早高峰
774   - schedule.fnAdjustGfbc(true, false); // 修正下行早高峰
775   - schedule.fnAdjustGfbc(false, true); // 修正上行晚高峰
776   - schedule.fnAdjustGfbc(false, false); // 修正下行晚高峰
777   -
778   - // 6、补吃饭班次
779   - schedule.fnCalcuEatBc();
780   -
781   - // 4、按照车辆投入运营要求补充班次
782   - schedule.fnCalcuLpBc_yy();
783   -
784   - // 5、根据班型补充所有的不足班次
785   - schedule.fnCalcuLpBx_5_2();
786   - schedule.fnCalcuLpBx_other();
787   -
788   - // 7、祛除上标线开头有删除标记的班次
789   - schedule.fnRemoveDelFirstFlagBc();
790   -
791   - // TODO:8、调整路牌班次间隔
792   - schedule.fnAdjustLpBcInterval(1);
793   -
794   - // TODO:9、调整纵向班次间隔
795   - schedule.fnAdjustBcInterval(true, false, 10);
796   - schedule.fnAdjustBcInterval(false, false, 10);
797   -
798   - // 10、确定末班车
799   - schedule.fnCalcuLastBc();
800   -
801   - // 11、祛除上标线结尾有删除标记的班次
802   - schedule.fnRemoveDelLastFlagBc();
803   -
804   - // TODO:12、平均化指定时间后的班次列表间隔
805   - schedule.fnAdjustBcInterval2_avg(true, _paramObj.toTimeObj("19:50"));
806   - schedule.fnAdjustBcInterval2_avg(false, _paramObj.toTimeObj("19:50"));
807   -
808   - // 10、补进出场例保班次
809   - schedule.fnCalcuOtherBc();
810   -
811   - //-------------------- 输出ganut图上的班次,班型描述 ----------------------//
812   - // TODO:班型再议
813   - return {
814   - 'json':schedule.fnToGanttBcArray(),'bxrcgs':null,
815   - 'aInternalLpObj': schedule.fnGetLpArray()
816   - };
817   -
818   - },
819   - /**
820   - * 导出时刻表配置。
821   - * @param aInternalLpObj 内部路牌对象列表
822   - */
823   - exportDataConfig: function(aInternalLpObj) {
824   - $('.exportAddXls').on('click', function() {
825   - var aInfos = {
826   - "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表
827   - "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表
828   - };
829   -
830   - console.log(aInfos);
831   -
832   - $(".exportAdd").addClass("disabled");
833   - $(".exportAddSpan").html("正在导出...");
834   -
835   - // 提交
836   - $.ajax({
837   - type: 'POST',
838   - url: "/tidc/exportDTDFile/xls",
839   - dataType: 'binary',
840   - contentType: "application/json",
841   - data: JSON.stringify(aInfos),
842   - success: function(data){
843   - Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls");
844   -
845   - $(".exportAdd").removeClass("disabled");
846   - $(".exportAddSpan").html(" 导出数据");
847   - },
848   - error: function(xhr, type){
849   - alert('错误:TODO');
850   -
851   - $(".exportAdd").removeClass("disabled");
852   - $(".exportAddSpan").html(" 导出数据");
853   - }
854   - });
855   - });
856   -
857   - $('.exportAddXlsx').on('click', function() {
858   - var aInfos = {
859   - "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表
860   - "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表
861   - };
862   -
863   - console.log(aInfos);
864   -
865   - $(".exportAdd").addClass("disabled");
866   - $(".exportAddSpan").html("正在导出...");
867   -
868   - // 提交
869   - $.ajax({
870   - type: 'POST',
871   - url: "/tidc/exportDTDFile/xlsx",
872   - dataType: 'binary',
873   - contentType: "application/json",
874   - data: JSON.stringify(aInfos),
875   - success: function(data){
876   - Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xlsx");
877   -
878   - $(".exportAdd").removeClass("disabled");
879   - $(".exportAddSpan").html(" 导出数据");
880   - },
881   - error: function(xhr, type){
882   - alert('错误:TODO');
883   -
884   - $(".exportAdd").removeClass("disabled");
885   - $(".exportAddSpan").html(" 导出数据");
886   - }
887   - });
888   - });
889   - },
890   -
891   - downloadFile: function (data, mimeType, fileName) {
892   - var success = false;
893   - var blob = new Blob([data], { type: mimeType });
894   - try {
895   - if (navigator.msSaveBlob)
896   - navigator.msSaveBlob(blob, fileName);
897   - else {
898   - // Try using other saveBlob implementations, if available
899   - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
900   - if (saveBlob === undefined) throw "Not supported";
901   - saveBlob(blob, fileName);
902   - }
903   - success = true;
904   - } catch (ex) {
905   - console.log("saveBlob method failed with the following exception:");
906   - console.log(ex);
907   - }
908   -
909   - if (!success) {
910   - // Get the blob url creator
911   - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
912   - if (urlCreator) {
913   - // Try to use a download link
914   - var link = document.createElement('a');
915   - if ('download' in link) {
916   - // Try to simulate a click
917   - try {
918   - // Prepare a blob URL
919   - var url = urlCreator.createObjectURL(blob);
920   - link.setAttribute('href', url);
921   -
922   - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
923   - link.setAttribute("download", fileName);
924   -
925   - // Simulate clicking the download link
926   - var event = document.createEvent('MouseEvents');
927   - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
928   - link.dispatchEvent(event);
929   - success = true;
930   -
931   - } catch (ex) {
932   - console.log("Download link method with simulated click failed with the following exception:");
933   - console.log(ex);
934   - }
935   - }
936   -
937   - if (!success) {
938   - // Fallback to window.location method
939   - try {
940   - // Prepare a blob URL
941   - // Use application/octet-stream when using window.location to force download
942   - var url = urlCreator.createObjectURL(blob);
943   - window.location = url;
944   - console.log("Download link method with window.location succeeded");
945   - success = true;
946   - } catch (ex) {
947   - console.log("Download link method with window.location failed with the following exception:");
948   - console.log(ex);
949   - }
950   - }
951   - }
952   - }
953   -
954   - if (!success) {
955   - // Fallback to window.open method
956   - console.log("No methods worked for saving the arraybuffer, using last resort window.open");
957   - window.open("", '_blank', '');
958   - }
959   - }
960   -
961   - };
962   -
963   -}();
  1 +/**
  2 + * 主类。
  3 + */
  4 +var Main_v2 = function() {
  5 +
  6 + // 内部工厂类
  7 + var _factoryFun = function() {
  8 + return {
  9 + // 创建参数
  10 + createParameterObj: function(formMap, dataMap) {
  11 + var paramObj = ParameterObj();
  12 + paramObj.wrap(formMap, dataMap);
  13 + return paramObj;
  14 + },
  15 + // 创建班次对象
  16 + createBcObj: function(lpObj, bcType, isUp, fcno, fcTimeObj, paramObj) {
  17 + var _bclc = paramObj.calcuTravelLcNumber(isUp, bcType);
  18 + var _fcsj = fcTimeObj;
  19 + var _bcsj = paramObj.calcuTravelTime(_fcsj, isUp);
  20 + var _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  21 + //var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);
  22 + var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, undefined);
  23 + var _tccid = paramObj.getTTinfoId();
  24 + var _ttinfoid = paramObj.getTTinfoId();
  25 + var _xl = paramObj.getXlId();
  26 + var _qdz = isUp ? paramObj.getUpQdzObj().id : paramObj.getDownQdzObj().id;
  27 + var _zdz = isUp ? paramObj.getUpZdzObj().id : paramObj.getDownZdzObj().id;
  28 +
  29 + if (bcType == "bd") { // 早例保,传过来的发车时间是第一个班次的发车时间
  30 + if (isUp) { // 上行
  31 + _fcsj = paramObj.addMinute(
  32 + _fcsj,
  33 + -(paramObj.getUpOutTime() + paramObj.getLbTime()));
  34 + _bcsj = paramObj.getLbTime();
  35 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  36 + _stoptime = 0;
  37 + } else { // 下行
  38 + _fcsj = paramObj.addMinute(
  39 + _fcsj,
  40 + -(paramObj.getDownOutTime() + paramObj.getLbTime()));
  41 + _bcsj = paramObj.getLbTime();
  42 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  43 + _stoptime = 0;
  44 + }
  45 + } else if (bcType == "lc") { // 晚例保,传过来的发车时间是最后一个班次的到达时间
  46 + if (isUp) { // 上行
  47 + _fcsj = paramObj.addMinute(
  48 + _fcsj,
  49 + paramObj.getUpInTime());
  50 + _bcsj = paramObj.getLbTime();
  51 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  52 + _stoptime = 0;
  53 + } else { // 下行
  54 + _fcsj = paramObj.addMinute(
  55 + _fcsj,
  56 + paramObj.getDownInTime());
  57 + _bcsj = paramObj.getLbTime();
  58 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  59 + _stoptime = 0;
  60 + }
  61 + } else if (bcType == "out") { // 出场,传过来的发车时间是第一个班次的发车时间
  62 + if (isUp) { // 上行
  63 + _fcsj = paramObj.addMinute(
  64 + _fcsj,
  65 + -paramObj.getUpOutTime());
  66 + _bcsj = paramObj.getUpOutTime();
  67 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  68 + _stoptime = 0;
  69 + } else { // 下行
  70 + _fcsj = paramObj.addMinute(
  71 + _fcsj,
  72 + -paramObj.getDownOutTime());
  73 + _bcsj = paramObj.getDownOutTime();
  74 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  75 + _stoptime = 0;
  76 + }
  77 + } else if (bcType == "in") { // 进场,传过来的发车时间是最后一个班次的到达时间
  78 + if (isUp) { // 上行
  79 + _bcsj = paramObj.getUpInTime();
  80 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  81 + _stoptime = 0;
  82 + } else { // 下行
  83 + _bcsj = paramObj.getDownInTime();
  84 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  85 + _stoptime = 0;
  86 + }
  87 + } else if (bcType == "cf") { // 吃饭班次
  88 + // 以13:00为分界,之前的为午饭,之后的为晚饭
  89 + if (fcTimeObj.isBefore(paramObj.toTimeObj("13:00"))) {
  90 + _bcsj = paramObj.fnGetLunchTime();
  91 + } else {
  92 + _bcsj = paramObj.fnGetDinnerTime();
  93 + }
  94 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  95 + _stoptime = 0;
  96 + }
  97 +
  98 + var bcParamObj = {};
  99 + bcParamObj.bcType = bcType; // 班次类型(normal,in_,out, bd, lc, cf等)
  100 + bcParamObj.isUp = isUp; // boolean是否上下行
  101 + bcParamObj.fcno = fcno; // 发车顺序号
  102 + bcParamObj.fcTimeObj = _fcsj; // 发车时间对象
  103 + bcParamObj.bclc = _bclc; // 班次里程
  104 + bcParamObj.bcsj = _bcsj; // 班次历时
  105 + bcParamObj.arrtime = _arrsj; // 到达时间对象
  106 + bcParamObj.stoptime = _stoptime; // 停站时间
  107 + bcParamObj.tccid = _tccid; // 停车场id
  108 + bcParamObj.ttinfoid = _ttinfoid; // 时刻表id
  109 + bcParamObj.xl = _xl; // 线路id
  110 + bcParamObj.qdzid = _qdz; // 起点站id
  111 + bcParamObj.zdzid = _zdz; // 终点站id
  112 +
  113 + return new InternalBcObj(lpObj, bcParamObj);
  114 + }
  115 + };
  116 + };
  117 + var _factory = _factoryFun();
  118 +
  119 + // 所有的时间使用moment.js计算
  120 +
  121 + var _paramObj; // 参数对象
  122 +
  123 + var _bxDesc = [ // 班型描述
  124 + {'type':'六工一休','hoursV':6.66, 'minueV':'6:40', 'qcount': 0, 'avertime': 0},
  125 + {'type':'五工一休','hoursV':6.85, 'minueV':'6:51', 'qcount': 0, 'avertime': 0},
  126 + {'type':'四工一休','hoursV':7.14, 'minueV':'7:08', 'qcount': 0, 'avertime': 0},
  127 + {'type':'三工一休','hoursV':7.61, 'minueV':'7:37', 'qcount': 0, 'avertime': 0},
  128 + {'type':'二工一休','hoursV':8.57, 'minueV':'8:34', 'qcount': 0, 'avertime': 0},
  129 + {'type':'一工一休','hoursV':11.42, 'minueV':'11:25', 'qcount': 0, 'avertime': 0},
  130 + {'type':'五工二休','hoursV':7.99, 'minueV':'8:00', 'qcount': 0, 'avertime': 0},
  131 + {'type':'无工休', 'hoursV':5.43, 'minueV':'5:43', 'qcount': 0, 'avertime': 0}
  132 + ];
  133 +
  134 + var _funCalcuExportData_lpObjList = function(aInternalLpObj) {
  135 + // 构造路牌对象
  136 + var aLpObj = [];
  137 + var i;
  138 + var j;
  139 + var z;
  140 + var oInternalLp;
  141 + var oInternalBc;
  142 + var oInternalBc_temp;
  143 + var oLp;
  144 + var iZlc;
  145 + var iYylc;
  146 + var iKslc;
  147 + var iZbc;
  148 + var iZgs;
  149 + var iYygs;
  150 + var iYybc;
  151 + for (i = 0; i < aInternalLpObj.length; i++) {
  152 + oInternalLp = aInternalLpObj[i];
  153 + iZlc = 0;
  154 + iYylc = 0;
  155 + iKslc = 0;
  156 + iZgs = 0;
  157 + iZbc = 0;
  158 + iYygs = 0;
  159 + iYybc = 0;
  160 + oLp = {
  161 + "lpname": oInternalLp.getLpName(), // 路牌名字
  162 + "isUp": oInternalLp.isUp(), // 每圈的第一个班次是否上行
  163 + "bcObjList": [], // 班次列表
  164 + "groupCount": oInternalLp.fnGetGroupCount(), // 总圈数
  165 + "zlc": 0, // 总里程
  166 + "yylc": 0, // 营运里程
  167 + "kslc": 0, // 空驶里程
  168 + "zgs": 0, // 总工时
  169 + "zbc": 0, // 总班次
  170 + "yygs": 0, // 营运工时
  171 + "yybc": 0, // 营运班次
  172 + "stationRouteId1": 0, // 第一个班次起点站路由id
  173 + "stationRouteId2": 0 // 第二个班次起点站路由id
  174 + };
  175 +
  176 + // 将报到班次,进出场班次加到班次的时间上
  177 + var iBcChainCount;
  178 + var oStartBc;
  179 + var oEndBc;
  180 + var oTempBc;
  181 + var aFcsj = [];
  182 +
  183 + iBcChainCount = oInternalLp.fnGetBcChainCount();
  184 + if (iBcChainCount == 1) { // 单一车次链,连班班型
  185 + oStartBc = oInternalLp.getBc(
  186 + oInternalLp.fnGetBcChainInfo(0)["s_q"],
  187 + oInternalLp.fnGetBcChainInfo(0)["s_b"]
  188 + );
  189 + oTempBc = _factory.createBcObj(
  190 + oLp, "bd", true, 1,
  191 + oStartBc.getFcTimeObj(),
  192 + _paramObj
  193 + );
  194 + aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  195 + oLp.bcObjList.push({ // 报到班次
  196 + "bcsj": oTempBc.getBcTime(), // 班次时间
  197 + "ssj": oTempBc.getStopTime(), // 停站时间
  198 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  199 +
  200 + "tccid": oTempBc._$_tccid, // 停车场id
  201 + "qdzid": oTempBc._$_qdzid, // 起点站id
  202 + "zdzid": oTempBc._$_zdzid, // 终点站id
  203 +
  204 + "isUp": oTempBc._$_isUp, // 是否上行
  205 + "isFb": false, // 是否分班
  206 +
  207 + "bcType": oTempBc._$_bcType, // 班次类型
  208 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  209 +
  210 + "groupNo": -1, // 第几圈
  211 + "groupBcNo": -1 // 圈里第几个班次
  212 +
  213 + });
  214 +
  215 + oTempBc = _factory.createBcObj(
  216 + oLp, "out", true, 1,
  217 + oStartBc.getFcTimeObj(),
  218 + _paramObj
  219 + );
  220 + aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  221 + aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  222 + oStartBc._$_fcsj_desc = aFcsj.join("");
  223 +
  224 + oLp.bcObjList.push({ // 出场班次
  225 + "bcsj": oTempBc.getBcTime(), // 班次时间
  226 + "ssj": oTempBc.getStopTime(), // 停站时间
  227 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  228 +
  229 + "tccid": oTempBc._$_tccid, // 停车场id
  230 + "qdzid": oTempBc._$_qdzid, // 起点站id
  231 + "zdzid": oTempBc._$_zdzid, // 终点站id
  232 +
  233 + "isUp": oTempBc._$_isUp, // 是否上行
  234 + "isFb": false, // 是否分班
  235 +
  236 + "bcType": oTempBc._$_bcType, // 班次类型
  237 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  238 +
  239 + "groupNo": -1, // 第几圈
  240 + "groupBcNo": -2 // 圈里第几个班次
  241 +
  242 + });
  243 +
  244 + aFcsj = [];
  245 +
  246 + oEndBc = oInternalLp.getBc(
  247 + oInternalLp.fnGetBcChainInfo(0)["e_q"],
  248 + oInternalLp.fnGetBcChainInfo(0)["e_b"]
  249 + );
  250 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
  251 + oTempBc = _factory.createBcObj(
  252 + oLp, "in", true, 1,
  253 + oEndBc.getArrTimeObj(),
  254 + _paramObj
  255 + );
  256 + aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  257 +
  258 + oLp.bcObjList.push({ // 进场班次
  259 + "bcsj": oTempBc.getBcTime(), // 班次时间
  260 + "ssj": oTempBc.getStopTime(), // 停站时间
  261 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  262 +
  263 + "tccid": oTempBc._$_tccid, // 停车场id
  264 + "qdzid": oTempBc._$_qdzid, // 起点站id
  265 + "zdzid": oTempBc._$_zdzid, // 终点站id
  266 +
  267 + "isUp": oTempBc._$_isUp, // 是否上行
  268 + "isFb": false, // 是否分班
  269 +
  270 + "bcType": oTempBc._$_bcType, // 班次类型
  271 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  272 +
  273 + "groupNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ?
  274 + oInternalLp.fnGetBcChainInfo(0)["e_q"] :
  275 + oInternalLp.fnGetBcChainInfo(0)["e_q"] + 1, // 第几圈
  276 + "groupBcNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ? 1 : 0 // 圈里第几个班次
  277 +
  278 + });
  279 +
  280 + oTempBc = _factory.createBcObj(
  281 + oLp, "lc", true, 1,
  282 + oEndBc.getArrTimeObj(),
  283 + _paramObj
  284 + );
  285 + aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  286 + oLp.bcObjList.push({ // 离场班次
  287 + "bcsj": oTempBc.getBcTime(), // 班次时间
  288 + "ssj": oTempBc.getStopTime(), // 停站时间
  289 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  290 +
  291 + "tccid": oTempBc._$_tccid, // 停车场id
  292 + "qdzid": oTempBc._$_qdzid, // 起点站id
  293 + "zdzid": oTempBc._$_zdzid, // 终点站id
  294 +
  295 + "isUp": oTempBc._$_isUp, // 是否上行
  296 + "isFb": false, // 是否分班
  297 +
  298 + "bcType": oTempBc._$_bcType, // 班次类型
  299 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  300 +
  301 + "groupNo": -2, // 第几圈
  302 + "groupBcNo": -4 // 圈里第几个班次
  303 +
  304 + });
  305 +
  306 + oEndBc._$_fcsj_desc = aFcsj.join("");
  307 +
  308 + } else if (iBcChainCount == 2) { // 两个车次链,分班班型
  309 + oStartBc = oInternalLp.getBc(
  310 + oInternalLp.fnGetBcChainInfo(0)["s_q"],
  311 + oInternalLp.fnGetBcChainInfo(0)["s_b"]
  312 + );
  313 + oTempBc = _factory.createBcObj(
  314 + oLp, "bd", true, 1,
  315 + oStartBc.getFcTimeObj(),
  316 + _paramObj
  317 + );
  318 + aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  319 + oLp.bcObjList.push({ // 报到班次
  320 + "bcsj": oTempBc.getBcTime(), // 班次时间
  321 + "ssj": oTempBc.getStopTime(), // 停站时间
  322 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  323 +
  324 + "tccid": oTempBc._$_tccid, // 停车场id
  325 + "qdzid": oTempBc._$_qdzid, // 起点站id
  326 + "zdzid": oTempBc._$_zdzid, // 终点站id
  327 +
  328 + "isUp": oTempBc._$_isUp, // 是否上行
  329 + "isFb": false, // 是否分班
  330 +
  331 + "bcType": oTempBc._$_bcType, // 班次类型
  332 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  333 +
  334 + "groupNo": -1, // 第几圈
  335 + "groupBcNo": -1 // 圈里第几个班次
  336 +
  337 + });
  338 +
  339 + oTempBc = _factory.createBcObj(
  340 + oLp, "out", true, 1,
  341 + oStartBc.getFcTimeObj(),
  342 + _paramObj
  343 + );
  344 + aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  345 + aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  346 + oStartBc._$_fcsj_desc = aFcsj.join("");
  347 +
  348 + oLp.bcObjList.push({ // 出场班次
  349 + "bcsj": oTempBc.getBcTime(), // 班次时间
  350 + "ssj": oTempBc.getStopTime(), // 停站时间
  351 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  352 +
  353 + "tccid": oTempBc._$_tccid, // 停车场id
  354 + "qdzid": oTempBc._$_qdzid, // 起点站id
  355 + "zdzid": oTempBc._$_zdzid, // 终点站id
  356 +
  357 + "isUp": oTempBc._$_isUp, // 是否上行
  358 + "isFb": false, // 是否分班
  359 +
  360 + "bcType": oTempBc._$_bcType, // 班次类型
  361 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  362 +
  363 + "groupNo": -1, // 第几圈
  364 + "groupBcNo": -2 // 圈里第几个班次
  365 +
  366 + });
  367 +
  368 + aFcsj = [];
  369 +
  370 + oEndBc = oInternalLp.getBc(
  371 + oInternalLp.fnGetBcChainInfo(0)["e_q"],
  372 + oInternalLp.fnGetBcChainInfo(0)["e_b"]
  373 + );
  374 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
  375 + oTempBc = _factory.createBcObj(
  376 + oLp, "in", true, 1,
  377 + oEndBc.getArrTimeObj(),
  378 + _paramObj
  379 + );
  380 + aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  381 + oLp.bcObjList.push({ // 进场班次
  382 + "bcsj": oTempBc.getBcTime(), // 班次时间
  383 + "ssj": oTempBc.getStopTime(), // 停站时间
  384 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  385 +
  386 + "tccid": oTempBc._$_tccid, // 停车场id
  387 + "qdzid": oTempBc._$_qdzid, // 起点站id
  388 + "zdzid": oTempBc._$_zdzid, // 终点站id
  389 +
  390 + "isUp": oTempBc._$_isUp, // 是否上行
  391 + "isFb": true, // 是否分班
  392 +
  393 + "bcType": oTempBc._$_bcType, // 班次类型
  394 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  395 +
  396 + "groupNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ?
  397 + oInternalLp.fnGetBcChainInfo(0)["e_q"] :
  398 + oInternalLp.fnGetBcChainInfo(0)["e_q"] + 1, // 第几圈
  399 + "groupBcNo": oInternalLp.fnGetBcChainInfo(0)["e_b"] == 0 ? 1 : 0 // 圈里第几个班次
  400 +
  401 + });
  402 + oEndBc._$_fcsj_desc = aFcsj.join("");
  403 +
  404 + aFcsj = [];
  405 +
  406 + oStartBc = oInternalLp.getBc(
  407 + oInternalLp.fnGetBcChainInfo(1)["s_q"],
  408 + oInternalLp.fnGetBcChainInfo(1)["s_b"]
  409 + );
  410 + oTempBc = _factory.createBcObj(
  411 + oLp, "bd", true, 1,
  412 + oStartBc.getFcTimeObj(),
  413 + _paramObj
  414 + );
  415 + aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  416 + oLp.bcObjList.push({ // 报到班次
  417 + "bcsj": oTempBc.getBcTime(), // 班次时间
  418 + "ssj": oTempBc.getStopTime(), // 停站时间
  419 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  420 +
  421 + "tccid": oTempBc._$_tccid, // 停车场id
  422 + "qdzid": oTempBc._$_qdzid, // 起点站id
  423 + "zdzid": oTempBc._$_zdzid, // 终点站id
  424 +
  425 + "isUp": oTempBc._$_isUp, // 是否上行
  426 + "isFb": true, // 是否分班
  427 +
  428 + "bcType": oTempBc._$_bcType, // 班次类型
  429 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  430 +
  431 + "groupNo": oInternalLp.fnGetBcChainInfo(1)["s_q"] - 1, // 第几圈
  432 + "groupBcNo": oInternalLp.fnGetBcChainInfo(1)["s_b"] // 圈里第几个班次
  433 +
  434 + });
  435 +
  436 + oTempBc = _factory.createBcObj(
  437 + oLp, "out", true, 1,
  438 + oStartBc.getFcTimeObj(),
  439 + _paramObj
  440 + );
  441 + oLp.bcObjList.push({ // 出场班次
  442 + "bcsj": oTempBc.getBcTime(), // 班次时间
  443 + "ssj": oTempBc.getStopTime(), // 停站时间
  444 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  445 +
  446 + "tccid": oTempBc._$_tccid, // 停车场id
  447 + "qdzid": oTempBc._$_qdzid, // 起点站id
  448 + "zdzid": oTempBc._$_zdzid, // 终点站id
  449 +
  450 + "isUp": oTempBc._$_isUp, // 是否上行
  451 + "isFb": true, // 是否分班
  452 +
  453 + "bcType": oTempBc._$_bcType, // 班次类型
  454 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  455 +
  456 + "groupNo": oInternalLp.fnGetBcChainInfo(1)["s_b"] == 0 ?
  457 + oInternalLp.fnGetBcChainInfo(1)["s_q"] - 1 :
  458 + oInternalLp.fnGetBcChainInfo(1)["s_q"], // 第几圈
  459 + "groupBcNo": oInternalLp.fnGetBcChainInfo(1)["s_b"] == 0 ? 1 : 0 // 圈里第几个班次
  460 +
  461 + });
  462 + aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  463 + aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  464 + oStartBc._$_fcsj_desc = aFcsj.join("");
  465 +
  466 + aFcsj = [];
  467 +
  468 + oEndBc = oInternalLp.getBc(
  469 + oInternalLp.fnGetBcChainInfo(1)["e_q"],
  470 + oInternalLp.fnGetBcChainInfo(1)["e_b"]
  471 + );
  472 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
  473 + oTempBc = _factory.createBcObj(
  474 + oLp, "in", true, 1,
  475 + oEndBc.getArrTimeObj(),
  476 + _paramObj
  477 + );
  478 + aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  479 +
  480 + oLp.bcObjList.push({ // 进场班次
  481 + "bcsj": oTempBc.getBcTime(), // 班次时间
  482 + "ssj": oTempBc.getStopTime(), // 停站时间
  483 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  484 +
  485 + "tccid": oTempBc._$_tccid, // 停车场id
  486 + "qdzid": oTempBc._$_qdzid, // 起点站id
  487 + "zdzid": oTempBc._$_zdzid, // 终点站id
  488 +
  489 + "isUp": oTempBc._$_isUp, // 是否上行
  490 + "isFb": false, // 是否分班
  491 +
  492 + "bcType": oTempBc._$_bcType, // 班次类型
  493 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  494 +
  495 + "groupNo": oInternalLp.fnGetBcChainInfo(1)["e_b"] == 0 ?
  496 + oInternalLp.fnGetBcChainInfo(1)["e_q"] :
  497 + oInternalLp.fnGetBcChainInfo(1)["e_q"] + 1, // 第几圈
  498 + "groupBcNo": oInternalLp.fnGetBcChainInfo(1)["e_b"] == 0 ? 1 : 0 // 圈里第几个班次
  499 +
  500 + });
  501 +
  502 + oTempBc = _factory.createBcObj(
  503 + oLp, "lc", true, 1,
  504 + oEndBc.getArrTimeObj(),
  505 + _paramObj
  506 + );
  507 +
  508 + oLp.bcObjList.push({ // 离场班次
  509 + "bcsj": oTempBc.getBcTime(), // 班次时间
  510 + "ssj": oTempBc.getStopTime(), // 停站时间
  511 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  512 +
  513 + "tccid": oTempBc._$_tccid, // 停车场id
  514 + "qdzid": oTempBc._$_qdzid, // 起点站id
  515 + "zdzid": oTempBc._$_zdzid, // 终点站id
  516 +
  517 + "isUp": oTempBc._$_isUp, // 是否上行
  518 + "isFb": false, // 是否分班
  519 +
  520 + "bcType": oTempBc._$_bcType, // 班次类型
  521 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  522 +
  523 + "groupNo": -2, // 第几圈
  524 + "groupBcNo": -4 // 圈里第几个班次
  525 +
  526 + });
  527 +
  528 + aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  529 + oEndBc._$_fcsj_desc = aFcsj.join("");
  530 +
  531 + }
  532 +
  533 + for (j = 0; j < oInternalLp.fnGetGroupCount(); j++) {
  534 + for (z = 0; z < 2; z++) {
  535 + oInternalBc = oInternalLp.getBc(j, z);
  536 + if (oInternalBc) {
  537 + if (oInternalBc.fnGetEatTime() > 0) {
  538 + // 吃饭班次是下一个班次开始吃,和本班次方向相反
  539 + oInternalBc_temp = oInternalLp.getBc(
  540 + z == 1 ? j + 1 : j,
  541 + z == 1 ? 0 : 1);
  542 +
  543 + oInternalBc_temp._$_fcsj_desc = "(吃" + oInternalBc_temp.getFcTimeObj().format("HH:mm") + ")";
  544 + }
  545 +
  546 + oLp.bcObjList.push({
  547 + "bcsj": oInternalBc.getBcTime(), // 班次时间
  548 + "ssj": oInternalBc.getStopTime(), // 停站时间
  549 + "eatsj": oInternalBc.fnGetEatTime(), // 吃饭时间
  550 +
  551 + "tccid": oInternalBc._$_tccid, // 停车场id
  552 + "qdzid": oInternalBc._$_qdzid, // 起点站id
  553 + "zdzid": oInternalBc._$_zdzid, // 终点站id
  554 +
  555 + "isUp": oInternalBc._$_isUp, // 是否上行
  556 +
  557 + "bcType": oInternalBc._$_bcType, // 班次类型
  558 + "fcsj": oInternalBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  559 + "fcsjDesc" : oInternalBc._$_fcsj_desc || oInternalBc._$_fcsjObj.format("HH:mm"),
  560 +
  561 + "groupNo": j, // 第几圈
  562 + "groupBcNo": z // 圈里第几个班次
  563 +
  564 + });
  565 +
  566 + // iZlc = 0;
  567 + // iYylc = 0;
  568 + // iKslc = 0;
  569 + // iZgs = 0;
  570 + // iZbc = 0;
  571 + // iYygs = 0;
  572 + // iYybc = 0;
  573 +
  574 + iZlc = iZlc +
  575 + oInternalBc._$_bclc; // 里程
  576 + iYylc = iYylc +
  577 + oInternalBc._$_bclc; // 里程
  578 + iYygs = iYygs +
  579 + oInternalBc.getBcTime() + // 班次时间
  580 + oInternalBc.getStopTime() + // 停站时间
  581 + oInternalBc.fnGetEatTime(); // 吃饭时间
  582 + iYybc = iYybc + 1;
  583 +
  584 + iZgs = iZgs +
  585 + oInternalBc.getBcTime() + // 班次时间
  586 + oInternalBc.getStopTime() + // 停站时间
  587 + oInternalBc.fnGetEatTime(); // 吃饭时间
  588 + iZbc = iZbc + 1;
  589 +
  590 + // 设置圈站点路由id
  591 + if (oInternalBc.isUp() == oInternalLp.isUp()) { // 第一个班次
  592 + if (oLp.stationRouteId1 == 0) {
  593 + oLp.stationRouteId1 = oInternalBc._$_qdzid;
  594 + }
  595 + } else { // 第二个班次
  596 + if (oLp.stationRouteId2 == 0) {
  597 + oLp.stationRouteId2 = oInternalBc._$_qdzid;
  598 + }
  599 + }
  600 +
  601 + }
  602 + }
  603 +
  604 + }
  605 +
  606 + for (z = 0; z < oInternalLp.getOtherBcArray().length; z++) {
  607 + oInternalBc = oInternalLp.getOtherBcArray()[z];
  608 + iKslc = iKslc +
  609 + oInternalBc._$_bclc; // 里程
  610 + iZlc = iZlc +
  611 + oInternalBc._$_bclc; // 里程
  612 + iZgs = iZgs +
  613 + oInternalBc.getBcTime() + // 班次时间
  614 + oInternalBc.getStopTime(); // 停站时间
  615 + if (oInternalBc._$_bcType != "bd" &&
  616 + oInternalBc._$_bcType != "lc" &&
  617 + oInternalBc._$_bcType != "cf") {
  618 + iZbc = iZbc + 1;
  619 + }
  620 + }
  621 +
  622 + oLp.zlc = iZlc;
  623 + oLp.yylc = iYylc;
  624 + oLp.kslc = iKslc;
  625 + oLp.zgs = iZgs;
  626 + oLp.zbc = iZbc;
  627 + oLp.yygs = iYygs;
  628 + oLp.yybc = iYybc;
  629 + aLpObj.push(oLp);
  630 + }
  631 +
  632 + return aLpObj;
  633 + };
  634 +
  635 + var _funCalcuExportData_statInfoList = function(aInternalLpObj) {
  636 + var countBc = 0, // 总班次
  637 + serviceBc = 0, // 营运班次
  638 + jcbc = 0, // 进场总班次.
  639 + ccbc = 0, // 出场总班次.
  640 + cfbc = 0, // 吃饭总班次.
  641 + zwlbbc = 0, // 早晚例保总班次.
  642 + countGs = 0.0, // 总工时
  643 + servicesj = 0, // 营运班次总时间
  644 + jcsj = 0.0, // 进场总时间.
  645 + ccsj = 0.0, // 出场总时间.
  646 + cfsj = 0.0, // 吃饭总时间.
  647 + zwlbsj = 0.0, // 早晚例保总时间.
  648 + ksBc = 0, // 空驶班次
  649 + serviceLc = 0.0, // 营运里程
  650 + ksLc = 0.0, // 空驶里程
  651 + avgTzjx = 0.0, // 平均停站间隙
  652 + gfServiceBc = 0, // 高峰营运班次
  653 + dgServiceBc = 0, // 低谷营运班次
  654 + gfAvgTzjx = 0.0, // 高峰平均停站间隙
  655 + dgAvgTzjx = 0.0; // 低谷平均停站间隙
  656 +
  657 + var aAllBc = [];
  658 + var oLp;
  659 + var oBc;
  660 + var i;
  661 + var j;
  662 +
  663 + for (i = 0; i < aInternalLpObj.length; i++) {
  664 + oLp = aInternalLpObj[i];
  665 + for (j = 0; j < oLp.getBcArray().length; j++) {
  666 + aAllBc.push(oLp.getBcArray()[j]);
  667 + }
  668 + for (j = 0; j < oLp.getOtherBcArray().length; j++) {
  669 + aAllBc.push(oLp.getOtherBcArray()[j]);
  670 + }
  671 + }
  672 +
  673 + for (i = 0; i < aAllBc.length; i++) {
  674 + oBc = aAllBc[i];
  675 +
  676 + if (oBc.getBcTime() > 0) {
  677 + countBc = countBc + 1;
  678 + countGs = countGs + oBc.getStopTime() + oBc.getBcTime();
  679 + if (_paramObj.isTroughBc(oBc.getFcTimeObj())) {
  680 + if (oBc._$_bcType == "normal") {
  681 + dgServiceBc = dgServiceBc + 1;
  682 + dgAvgTzjx = dgAvgTzjx + oBc.getStopTime();
  683 + }
  684 + } else {
  685 + if (oBc._$_bcType == "normal") {
  686 + gfServiceBc = gfServiceBc + 1;
  687 + gfAvgTzjx = gfAvgTzjx + oBc.getStopTime();
  688 + }
  689 + }
  690 +
  691 + if (oBc._$_bcType == "normal") {
  692 + serviceBc = serviceBc + 1;
  693 + serviceLc = serviceLc + oBc._$_bclc;
  694 + servicesj = servicesj + oBc.getBcTime();
  695 + avgTzjx = avgTzjx + oBc.getStopTime();
  696 +
  697 + if (oBc.fnGetEatTime() > 0) {
  698 + cfbc = cfbc + 1;
  699 + cfsj = cfsj + oBc.fnGetEatTime();
  700 + }
  701 + } else if (oBc._$_bcType == "in") {
  702 + jcbc = jcbc + 1;
  703 + jcsj = jcsj + oBc.getBcTime();
  704 + } else if (oBc._$_bcType == "out") {
  705 + ccbc = ccbc + 1;
  706 + ccsj = ccsj + oBc.getBcTime();
  707 + } else if (oBc._$_bcType == "bd") {
  708 + zwlbbc = zwlbbc + 1;
  709 + zwlbsj = zwlbsj + oBc.getBcTime();
  710 + } else if (oBc._$_bcType == "lc") {
  711 + zwlbbc = zwlbbc + 1;
  712 + zwlbsj = zwlbsj + oBc.getBcTime();
  713 + }
  714 + }
  715 + }
  716 +
  717 + dgAvgTzjx = dgAvgTzjx / dgServiceBc;
  718 + gfAvgTzjx = gfAvgTzjx / gfServiceBc;
  719 + avgTzjx = avgTzjx / dgServiceBc;
  720 +
  721 + return [
  722 + {'statItem': '总班次(包括进出场、吃饭时间、早晚例保、营运且班次时间大于零的班次)', 'statValue': countBc},
  723 + {'statItem': '进场总班次(包括进场且班次时间大于零的班次)', 'statValue': jcbc},
  724 + {'statItem': '出场总班次(包括进场且班次时间大于零的班次)', 'statValue': ccbc},
  725 + {'statItem': '吃饭总班次(包括吃饭且班次时间大于零的班次)', 'statValue': cfbc},
  726 + {'statItem': '早晚例保总班次(包括早晚例保且时间大于零的班次)', 'statValue': zwlbbc},
  727 + {'statItem': '营运总班次(包括正常、区间、放大站且班次时间大于零班次)','statValue': serviceBc},
  728 + {'statItem': '进场总时间(包括进场班次且班次时间大于零)', 'statValue': jcsj/60},
  729 + {'statItem': '出场总时间(包括进场班次且班次时间大于零)', 'statValue': ccsj/60},
  730 + {'statItem': '吃饭总时间(包括吃饭班次且班次时间大于零)', 'statValue': cfsj/60},
  731 + {'statItem': '早晚例保总时间(包括早晚例保班次且时间大于零的)', 'statValue': zwlbsj/60},
  732 + {'statItem': '营运班次总时间(包括正常、区间、放大站且班次时间大于零)', 'statValue': servicesj/60},
  733 + {'statItem': '总工时(包括进出场、吃饭时间、早晚例保、营运班次时间)', 'statValue': countGs/60},
  734 + {'statItem': '空驶班次(包括直放班次)', 'statValue': ksBc},
  735 + {'statItem': '营运里程(包括正常、区间、放大站里程)', 'statValue': serviceLc},
  736 + {'statItem': '空驶里程(包括直放里程)', 'statValue': ksLc},
  737 + {'statItem': '平均停站时间(营运班次停站时间总和/营运总班次)', 'statValue': avgTzjx},
  738 + {'statItem': '高峰营运班次(包括早晚高峰时段的正常、区间、放大站班次)', 'statValue': gfServiceBc},
  739 + {'statItem': '低谷营运班次(包括低谷时段的正常、区间、放大站班次)', 'statValue': dgServiceBc},
  740 + {'statItem': '高峰平均停站间隙(高峰营运班次停站时间总和/高峰营运班次总和)', 'statValue': gfAvgTzjx},
  741 + {'statItem': '低谷平均停站间隙(低谷营运班次停站时间总和/低谷营运班次总和)', 'statValue': dgAvgTzjx},
  742 + {'statItem': '综合评估', 'statValue': 3}
  743 + ];
  744 +
  745 + };
  746 +
  747 + return {
  748 + /**
  749 + * 工厂对象,创建不同的对象。
  750 + * @returns {{createParameterObj, createBcObj}}
  751 + */
  752 + getFactory: function() {
  753 + return _factory;
  754 + },
  755 +
  756 + /**
  757 + * 使用发车间隔策略生成时刻表。
  758 + * @param paramObj 参数对象
  759 + * @param lpArray 路牌数组
  760 + * @constructor
  761 + */
  762 + BXPplaceClassesTime03 : function(paramObj, lpArray) {
  763 + // 参数对象
  764 + _paramObj = paramObj;
  765 +
  766 + // 1、初始化行车计划
  767 + var schedule = new InternalScheduleObj(_paramObj, lpArray, _factory);
  768 + schedule.fnInitDataWithBxLayout();
  769 + // 2、将连班路牌的班次补足
  770 + schedule.fnCalcuLpBx_lb();
  771 +
  772 + // 3、修正针对初始化时生成的高峰班次,之前不足的补上,多余的删除
  773 + schedule.fnAdjustGfbc(true, true); // 修正上行早高峰
  774 + schedule.fnAdjustGfbc(true, false); // 修正下行早高峰
  775 + schedule.fnAdjustGfbc(false, true); // 修正上行晚高峰
  776 + schedule.fnAdjustGfbc(false, false); // 修正下行晚高峰
  777 +
  778 + // 6、补吃饭班次
  779 + schedule.fnCalcuEatBc();
  780 +
  781 + // 4、按照车辆投入运营要求补充班次
  782 + schedule.fnCalcuLpBc_yy();
  783 +
  784 + // 5、根据班型补充所有的不足班次
  785 + schedule.fnCalcuLpBx_5_2();
  786 + schedule.fnCalcuLpBx_other();
  787 +
  788 + // 7、祛除上标线开头有删除标记的班次
  789 + schedule.fnRemoveDelFirstFlagBc();
  790 +
  791 + // TODO:8、调整路牌班次间隔
  792 + schedule.fnAdjustLpBcInterval(1);
  793 +
  794 + // TODO:9、调整纵向班次间隔
  795 + schedule.fnAdjustBcInterval(true, false, 10);
  796 + schedule.fnAdjustBcInterval(false, false, 10);
  797 +
  798 + // 10、确定末班车
  799 + schedule.fnCalcuLastBc();
  800 +
  801 + // 11、祛除上标线结尾有删除标记的班次
  802 + schedule.fnRemoveDelLastFlagBc();
  803 +
  804 + // TODO:12、平均化指定时间后的班次列表间隔
  805 + schedule.fnAdjustBcInterval2_avg(true, _paramObj.toTimeObj("19:50"));
  806 + schedule.fnAdjustBcInterval2_avg(false, _paramObj.toTimeObj("19:50"));
  807 +
  808 + // 10、补进出场例保班次
  809 + schedule.fnCalcuOtherBc();
  810 +
  811 + //-------------------- 输出ganut图上的班次,班型描述 ----------------------//
  812 + // TODO:班型再议
  813 + return {
  814 + 'json':schedule.fnToGanttBcArray(),'bxrcgs':null,
  815 + 'aInternalLpObj': schedule.fnGetLpArray()
  816 + };
  817 +
  818 + },
  819 + /**
  820 + * 导出时刻表配置。
  821 + * @param aInternalLpObj 内部路牌对象列表
  822 + */
  823 + exportDataConfig: function(aInternalLpObj) {
  824 + $('.exportAddXls').on('click', function() {
  825 + var aInfos = {
  826 + "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表
  827 + "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表
  828 + };
  829 +
  830 + console.log(aInfos);
  831 +
  832 + $(".exportAdd").addClass("disabled");
  833 + $(".exportAddSpan").html("正在导出...");
  834 +
  835 + // 提交
  836 + $.ajax({
  837 + type: 'POST',
  838 + url: "/tidc/exportDTDFile/xls",
  839 + dataType: 'binary',
  840 + contentType: "application/json",
  841 + data: JSON.stringify(aInfos),
  842 + success: function(data){
  843 + Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls");
  844 +
  845 + $(".exportAdd").removeClass("disabled");
  846 + $(".exportAddSpan").html(" 导出数据");
  847 + },
  848 + error: function(xhr, type){
  849 + alert('错误:TODO');
  850 +
  851 + $(".exportAdd").removeClass("disabled");
  852 + $(".exportAddSpan").html(" 导出数据");
  853 + }
  854 + });
  855 + });
  856 +
  857 + $('.exportAddXlsx').on('click', function() {
  858 + var aInfos = {
  859 + "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表
  860 + "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表
  861 + };
  862 +
  863 + console.log(aInfos);
  864 +
  865 + $(".exportAdd").addClass("disabled");
  866 + $(".exportAddSpan").html("正在导出...");
  867 +
  868 + // 提交
  869 + $.ajax({
  870 + type: 'POST',
  871 + url: "/tidc/exportDTDFile/xlsx",
  872 + dataType: 'binary',
  873 + contentType: "application/json",
  874 + data: JSON.stringify(aInfos),
  875 + success: function(data){
  876 + Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xlsx");
  877 +
  878 + $(".exportAdd").removeClass("disabled");
  879 + $(".exportAddSpan").html(" 导出数据");
  880 + },
  881 + error: function(xhr, type){
  882 + alert('错误:TODO');
  883 +
  884 + $(".exportAdd").removeClass("disabled");
  885 + $(".exportAddSpan").html(" 导出数据");
  886 + }
  887 + });
  888 + });
  889 + },
  890 +
  891 + downloadFile: function (data, mimeType, fileName) {
  892 + var success = false;
  893 + var blob = new Blob([data], { type: mimeType });
  894 + try {
  895 + if (navigator.msSaveBlob)
  896 + navigator.msSaveBlob(blob, fileName);
  897 + else {
  898 + // Try using other saveBlob implementations, if available
  899 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  900 + if (saveBlob === undefined) throw "Not supported";
  901 + saveBlob(blob, fileName);
  902 + }
  903 + success = true;
  904 + } catch (ex) {
  905 + console.log("saveBlob method failed with the following exception:");
  906 + console.log(ex);
  907 + }
  908 +
  909 + if (!success) {
  910 + // Get the blob url creator
  911 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  912 + if (urlCreator) {
  913 + // Try to use a download link
  914 + var link = document.createElement('a');
  915 + if ('download' in link) {
  916 + // Try to simulate a click
  917 + try {
  918 + // Prepare a blob URL
  919 + var url = urlCreator.createObjectURL(blob);
  920 + link.setAttribute('href', url);
  921 +
  922 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  923 + link.setAttribute("download", fileName);
  924 +
  925 + // Simulate clicking the download link
  926 + var event = document.createEvent('MouseEvents');
  927 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  928 + link.dispatchEvent(event);
  929 + success = true;
  930 +
  931 + } catch (ex) {
  932 + console.log("Download link method with simulated click failed with the following exception:");
  933 + console.log(ex);
  934 + }
  935 + }
  936 +
  937 + if (!success) {
  938 + // Fallback to window.location method
  939 + try {
  940 + // Prepare a blob URL
  941 + // Use application/octet-stream when using window.location to force download
  942 + var url = urlCreator.createObjectURL(blob);
  943 + window.location = url;
  944 + console.log("Download link method with window.location succeeded");
  945 + success = true;
  946 + } catch (ex) {
  947 + console.log("Download link method with window.location failed with the following exception:");
  948 + console.log(ex);
  949 + }
  950 + }
  951 + }
  952 + }
  953 +
  954 + if (!success) {
  955 + // Fallback to window.open method
  956 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  957 + window.open("", '_blank', '');
  958 + }
  959 + }
  960 +
  961 + };
  962 +
  963 +}();
... ...
src/main/resources/static/pages/base/timesmodel/paramadd.html
1   -<!-- 统计数据 -->
2   -<style>
3   - .form-control:focus {
4   - border-color: #53ced9;
5   - }
6   - .tagsDiv {
7   - border: 1px solid #c2cad8;
8   - margin-left: 15px;
9   - padding: 4px 15px 4px 15px;
10   - width: 50%;
11   - }
12   -</style>
13   -<div class="modal fade" id="paramadd_mobal" tabindex="-1" role="basic" aria-hidden="true">
14   - <div class="modal-dialog" style="margin-left: 100px;">
15   - <div class="modal-content" style="width: 1000px;">
16   - <div class="modal-header">
17   - <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
18   - <h4 class="modal-title">参数数据 </h4>
19   - </div>
20   - <div class="modal-body">
21   - <form class="form-horizontal" id="param_form" action="/" method="POST" novalidate="novalidate">
22   - <div class="form-body">
23   - <div class="alert alert-danger display-hide">
24   - <button class="close" data-close="alert"></button>
25   - 您的输入有误,请检查下面的输入项
26   - </div>
27   - <div class="alert alert-success display-none">
28   - <button class="close" data-dismiss="alert"></button>
29   - 验证成功!
30   - </div>
31   -
32   - </div>
33   -
34   - <div class="tab-pane" id="ptab">
35   -
36   - </div>
37   - </form>
38   - </div>
39   -
40   - <div class="modal-footer">
41   - <button type="button" class="btn default" data-dismiss="modal">取消</button>
42   - <button type="button" class="btn btn-primary" id="paramnext">确定</button>
43   - </div>
44   -
45   - </div>
46   - </div>
47   -</div>
48   -
49   -<script type="text/html" id = "paramAdd_temp">
50   - <div class="form-group">
51   - <div class="col-md-6">
52   - <label class="control-label col-md-5">
53   - <span class="required"> * </span> 上行首班时间 :
54   - </label>
55   - <div class="col-md-5">
56   - <input type="text" class="form-control" name="startStationFirstTime" value="{{map.startStationFirstTime}}" id="startStationFirstTime_id"
57   - placeholder="请输入起始站首班时间">
58   - </div>
59   - </div>
60   - <div class="col-md-6">
61   - <label class="control-label col-md-5">
62   - <span class="required"> * </span> 上行末班时间 :
63   - </label>
64   - <div class="col-md-5">
65   - <input type="text" class="form-control" name="startStationEndTime" value="{{map.startStationEndTime}}" id="startStationEndTime_id"
66   - placeholder="请输入起始站末班时间">
67   - </div>
68   - </div>
69   - </div>
70   -
71   - <div class="form-group">
72   - <div class="col-md-6">
73   - <label class="control-label col-md-5">
74   - <span class="required"> * </span> 下行首班时间 :
75   - </label>
76   - <div class="col-md-5">
77   - <input type="text" class="form-control" name="endStationFirstTime" value="{{map.endStationFirstTime}}" id="endStationFirstTime_id"
78   - placeholder="请输入终点站首班时间">
79   - </div>
80   - </div>
81   - <div class="col-md-6">
82   - <label class="control-label col-md-5">
83   - <span class="required"> * </span> 下行末班时间 :
84   - </label>
85   - <div class="col-md-5">
86   - <input type="text" class="form-control" name="endStationEndTime" value="{{map.endStationEndTime}}" id="endStationEndTime_id"
87   - placeholder="请输入终点站末班时间">
88   - </div>
89   - </div>
90   - </div>
91   -
92   - <div class="form-group">
93   - <div class="col-md-6">
94   - <label class="control-label col-md-5">
95   - <span class="required"> * </span> 早高峰开始时间 :
96   - </label>
97   - <div class="col-md-5">
98   - <input type="text" class="form-control" name="earlyStartTime" value="{{map.earlyStartTime}}" id="earlyStartTime_id"
99   - placeholder="请输入早高峰开始时间">
100   - </div>
101   - </div>
102   - <div class="col-md-6">
103   - <label class="control-label col-md-5">
104   - <span class="required"> * </span> 早高峰结束时间 :
105   - </label>
106   - <div class="col-md-5">
107   - <input type="text" class="form-control" name="earlyEndTime" value="{{map.earlyEndTime}}" id="earlyEndTime_id"
108   - placeholder="请输入早高峰结束时间">
109   - </div>
110   - </div>
111   - </div>
112   -
113   - <div class="form-group">
114   - <div class="col-md-6">
115   - <label class="control-label col-md-5">
116   - <span class="required"> * </span> 晚高峰开始时间 :
117   - </label>
118   - <div class="col-md-5">
119   - <input type="text" class="form-control" name="lateStartTime" value="{{map.lateStartTime}}" id="lateStartTime_id"
120   - placeholder="请输入晚高峰开始时间">
121   - </div>
122   - </div>
123   - <div class="col-md-6">
124   - <label class="control-label col-md-5">
125   - <span class="required"> * </span> 晚高峰结束时间 :
126   - </label>
127   - <div class="col-md-5">
128   - <input type="text" class="form-control" name="lateEndTime" value="{{map.lateEndTime}}" id="lateEndTime_id"
129   - placeholder="请输入晚高峰结束时间">
130   - </div>
131   - </div>
132   - </div>
133   -
134   - <div class="form-group">
135   - <div class="col-md-6">
136   - <label class="control-label col-md-5">上行进场时间  :
137   - </label>
138   - <div class="col-md-5">
139   - <input type="text" class="form-control" name="upInTimer" value="{{map.upInTimer}}" id="upInTimer_id"
140   - placeholder="请输入上行进场时间">
141   - </div>
142   - </div>
143   - <div class="col-md-6">
144   - <label class="control-label col-md-5">上行出场时间  :
145   - </label>
146   - <div class="col-md-5">
147   - <input type="text" class="form-control" name="upOutTimer" value="{{map.upOutTimer}}" id="upOutTimer_id"
148   - placeholder="请输入上行出场时间">
149   - </div>
150   - </div>
151   - </div>
152   -
153   - <div class="form-group">
154   - <div class="col-md-6">
155   - <label class="control-label col-md-5">下行进场时间  :
156   - </label>
157   - <div class="col-md-5">
158   - <input type="text" class="form-control" name="downInTimer" value="{{map.downInTimer}}" id="downInTimer_id"
159   - placeholder="请输入下行进场时间">
160   - </div>
161   - </div>
162   - <div class="col-md-6">
163   - <label class="control-label col-md-5">下行出场时间  :
164   - </label>
165   - <div class="col-md-5">
166   - <input type="text" class="form-control" name="downOutTimer" value="{{map.downOutTimer}}" id="downOutTimer_id"
167   - placeholder="请输入下行出场时间">
168   - </div>
169   - </div>
170   - </div>
171   -
172   - <div class="form-group">
173   - <div class="col-md-6">
174   - <label class="control-label col-md-5">早高峰上行时间 :</label>
175   - <div class="col-md-5">
176   - <input type="text" class="form-control" name="earlyUpTime" value="{{map.earlyUpTime}}" id="earlyUpTime_id"
177   - placeholder="请输入早高峰上行时间">
178   - </div>
179   - </div>
180   - <div class="col-md-6">
181   - <label class="control-label col-md-5">早高峰下行时间 :</label>
182   - <div class="col-md-5">
183   - <input type="text" class="form-control" name="earlyDownTime" value="{{map.earlyDownTime}}" id="earlyDownTime_id"
184   - placeholder="请输入早高峰下行时间">
185   - </div>
186   - </div>
187   - </div>
188   -
189   - <div class="form-group">
190   - <div class="col-md-6">
191   - <label class="control-label col-md-5">晚高峰上行时间 :</label>
192   - <div class="col-md-5">
193   - <input type="text" class="form-control" name="lateUpTime" value="{{map.lateUpTime}}" id="lateUpTime_id"
194   - placeholder="请输入晚高峰上行时间">
195   - </div>
196   - </div>
197   - <div class="col-md-6">
198   - <label class="control-label col-md-5">晚高峰下行时间 :</label>
199   - <div class="col-md-5">
200   - <input type="text" class="form-control" name="lateDownTime" value="{{map.lateDownTime}}" id="lateDownTime_id"
201   - placeholder="请输入晚高峰下行时间">
202   - </div>
203   - </div>
204   - </div>
205   -
206   - <div class="form-group">
207   - <div class="col-md-6">
208   - <label class="control-label col-md-5">低谷上行时间  :</label>
209   - <div class="col-md-5">
210   - <input type="text" class="form-control" name="troughUpTime" value="{{map.troughUpTime}}" id="troughUpTime_id"
211   - placeholder="请输入低谷上行时间">
212   - </div>
213   - </div>
214   - <div class="col-md-6">
215   - <label class="control-label col-md-5">低谷下行时间  :</label>
216   - <div class="col-md-5">
217   - <input type="text" class="form-control" name="troughDownTime" value="{{map.troughDownTime}}" id="troughDownTime_id"
218   - placeholder="请输入低谷下行时间">
219   - </div>
220   - </div>
221   - </div>
222   -
223   - <div class="form-group">
224   - <div class="col-md-6">
225   - <label class="control-label col-md-5">
226   - <span class="required"> * </span> 线路规划类型  :
227   - </label>
228   - <div class="col-md-5">
229   - <select name="linePlayType" class="form-control" id="linePlayType_id">
230   - <option value="">-- 请选择线路类型 --</option>
231   - <option value="0">双向</option>
232   - <option value="1">环线</option>
233   - </select>
234   - </div>
235   - </div>
236   - <div class="col-md-6">
237   - <label class="control-label col-md-5">吃饭地点    :</label>
238   - <div class="col-md-5">
239   - <select type="text" class="form-control" name="cfdd" id="cfdd_id">
240   - <option value="">请选择...</option>
241   - <option value="0">{{map.startStationName}}</option>
242   - <option value="1">{{map.endStationName}}</option>
243   - <option value="allYes">起终点站都可以</option>
244   - </select>
245   - </div>
246   - </div>
247   - </div>
248   -
249   - <div class="form-group">
250   - <div class="col-md-6">
251   - <label class="control-label col-md-5">早晚例行保养  :</label>
252   - <div class="col-md-5">
253   - <input type="text" class="form-control" name="lb" value="{{map.lb}}" id="lb_id"
254   - placeholder="请输入早晚例行保养">
255   - </div>
256   - </div>
257   - <div class="col-md-6">
258   - <label class="control-label col-md-5">停车场     :</label>
259   - <div class="col-md-5">
260   - <select name="carPark" class="form-control" id="carPark_id" style="width:100%"></select>
261   - </div>
262   - </div>
263   - </div>
264   -
265   -
266   - <div class="form-group">
267   - <div class="col-md-6">
268   - <label class="control-label col-md-5">工作餐午餐时间 :</label>
269   - <div class="col-md-5">
270   - <input type="text" class="form-control" name="workeLunch" value="{{map.workeLunch}}" id="workeLunch_id"
271   - placeholder="请输入工作餐午餐时间">
272   - </div>
273   - </div>
274   - <div class="col-md-6">
275   - <label class="control-label col-md-5">工作餐晚餐时间 :</label>
276   - <div class="col-md-5">
277   - <input type="text" class="form-control" name="workeDinner" value="{{map.workeDinner}}" id="workeDinner_id"
278   - placeholder="请输入工作餐晚餐时间">
279   - </div>
280   - </div>
281   - </div>
282   -
283   - <div class="form-group">
284   - <div class="col-md-6">
285   - <label class="control-label col-md-5"><span class="required"> * </span>早高峰发车间隔 :</label>
286   - <div class="col-md-3" style="padding-right: 0px;">
287   - <input type="text" class="form-control" name="zgffcjxmin" value="{{map.zgffcjxmin}}" id="zgffcjxmin_id"
288   - placeholder="最小间隔">
289   - </div>
290   - <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
291   - <div class="col-md-3" style="padding-left: 0px;">
292   - <input type="text" class="form-control" name="zgffcjxmax" value="{{map.zgffcjxmax}}" id="zgffcjxmax_id"
293   - placeholder="最大间隔">
294   - </div>
295   - </div>
296   - <div class="col-md-6">
297   - <label class="control-label col-md-5"><span class="required"> * </span>晚高峰发车间隔 :</label>
298   - <div class="col-md-3" style="padding-right: 0px;">
299   - <input type="text" class="form-control" name="wffcjxmin" value="{{map.wffcjxmin}}" id="wffcjxmin_id"
300   - placeholder="最小间隔">
301   - </div>
302   - <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
303   - <div class="col-md-3" style="padding-left: 0px;">
304   - <input type="text" class="form-control" name="wffcjxmax" value="{{map.wffcjxmax}}" id="wffcjxmax_id"
305   - placeholder="最大间隔">
306   - </div>
307   - </div>
308   - </div>
309   -
310   - <div class="form-group">
311   - <div class="col-md-6">
312   - <label class="control-label col-md-5"><span class="required"> * </span>低谷发车间隔 :</label>
313   - <div class="col-md-3" style="padding-right: 0px;">
314   - <input type="text" class="form-control" name="dgfcjxmin" value="{{map.dgfcjxmin}}" id="dgfcjxmin_id"
315   - placeholder="最小间隔">
316   - </div>
317   - <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
318   - <div class="col-md-3" style="padding-left: 0px;">
319   - <input type="text" class="form-control" name="dgfcjxmax" value="{{map.dgfcjxmax}}" id="dgfcjxmax_id"
320   - placeholder="最大间隔">
321   - </div>
322   - </div>
323   - <div class="col-md-6">
324   - <label class="control-label col-md-5"><span class="required"> * </span>建议加班路牌数 :</label>
325   - <div class="col-md-5">
326   - <input type="text" class="form-control" name="jbclcount" value="{{map.jbclcount}}" id="jbclcount_id"
327   - placeholder="为0表示是周末时刻表">
328   - </div>
329   - </div>
330   - </div>
331   -
332   - <div class="form-group">
333   - <div class="col-md-6">
334   - <label class="control-label col-md-5"><span class="required"> * </span>停站类型 :</label>
335   - <div class="col-md-5 tagsDiv">
336   - <div class="row" style="margin-left: 15px;">
337   - <input type="text" value="{{map.stt}}" name="stt" id="stoptype_tagsinput" style="display: none;">
338   - </div>
339   -
340   - <div class="row" style="margin-top: 10px;">
341   - <label class="control-label col-md-4">停站类型:</label>
342   - <div class="col-md-8">
343   - <select name="stopType" class="form-control" id="stopType_id">
344   - <option value="">-- 请选择停站类型 --</option>
345   - <option value="0">主站停站</option>
346   - <option value="1">双向停站</option>
347   - </select>
348   - </div>
349   - </div>
350   -
351   - <div class="row" style="margin-top: 10px;">
352   - <label class="control-label col-md-4">主站:</label>
353   - <div class="col-md-8">
354   - <select name="masterStop" class="form-control" id="masterStop_id">
355   - <option value="">请选择...</option>
356   - <option value="0">{{map.startStationName}}</option>
357   - <option value="1">{{map.endStationName}}</option>
358   - </select>
359   - </div>
360   - </div>
361   -
362   - <div class="row" style="margin-top: 10px;margin-left: 116px;">
363   - <a href="javascript:" class="btn red" id="stoptype_tagsinput_add">添加</a>
364   - </div>
365   - </div>
366   -
367   - </div>
368   -
369   - <div class="col-md-6">
370   - <label class="control-label col-md-5">
371   - <span class="required"> * </span> 建议高峰配车数 :</label>
372   - <div class="col-md-5">
373   - <input type="text" class="form-control" placeholder="车辆数" name="gfjypcs"
374   - id="gfjypcsInput" min="1" value="{{map.gfjypcs}}">
375   - </div>
376   - </div>
377   -
378   - </div>
379   -
380   - <!-- 隐藏字段-时间 -->
381   - <input type="hidden" name="skbName" value="{{map.skbName}}" id="skbName_id"/>
382   - <input type="hidden" name="skbmc" value="{{map.skbmc}}" id="skbmc_id"/>
383   - <input type="hidden" name="xlmc" value="{{map.xlmc}}" id="xlmc_id"/>
384   - <input type="hidden" name="lineName" value="{{map.lineName}}" id="lineName_id"/>
385   - <input type="hidden" name="lineVersion" value="{{map.lineVersion}}" id="lineVersion_id"/>
386   -
387   - <!-- 上下行行驶时间 -->
388   - <input type="hidden" name="upTravelTime" value="{{map.upTravelTime}}" id="upTravelTime_id"/>
389   - <input type="hidden" name="downTravelTime" value="{{map.downTravelTime}}" id="downTravelTime_id"/>
390   -
391   - <!-- 隐藏字段-里程 -->
392   - <!-- 上下行行驶里程 -->
393   - <input type="hidden" name="upMileage" value="{{map.upMileage}}" id="upMileage_id"/>
394   - <input type="hidden" name="downMileage" value="{{map.downMileage}}" id="downMileage_id"/>
395   - <!-- 上下行进场出场里程 -->
396   - <input type="hidden" name="upInMileage" value="{{map.upInMileage}}" id="upInMileage_id"/>
397   - <input type="hidden" name="downInMileage" value="{{map.downInMileage}}" id="downInMileage_id"/>
398   - <input type="hidden" name="upOutMileage" value="{{map.upOutMileage}}" id="upOutMileage_id"/>
399   - <input type="hidden" name="downOutMileage" value="{{map.downOutMileage}}" id="downOutMileage_id"/>
400   -
401   -
402   -</script>
403   -
404   -<script type="text/javascript">
405   - $('#paramadd_mobal').on('paramAddMobal.show', function(e, g_){
406   - // 加载延迟200毫秒显示mobal
407   - setTimeout(function(){$('#paramadd_mobal').modal({show : true,backdrop: 'static', keyboard: false});},200);
408   - var param = JSON.parse(window.localStorage.Gantt_AgursData);
409   -
410   - // 获取表单元素
411   - var form = $('#param_form');
412   - // 错误提示元素
413   - var paramAlert = $('.alert-danger', form);
414   - // 确定事件点击
415   - $('#paramnext').on('click', function() {
416   - form.submit();// 表单提交
417   - });
418   -
419   - // 表单验证
420   - form.validate({
421   - errorElement : 'span',
422   - errorClass : 'help-block help-block-error',
423   - focusInvalid : false,
424   - rules: {
425   - 'skbName' : {required : true,},// 时刻表名称,必填项.
426   - 'lineName' : {required : true,},// 线路名称,必填项.
427   - 'lineVersion': {required: true}, // 站点路由版本,必填项,
428   - 'startStationFirstTime' : {required : true}, // 起始站首班时间,必填项.
429   - 'startStationEndTime' : {required : true}, // 起始站末班时间 ,必填项.
430   - 'endStationFirstTime' : {required : true}, // 终点站首班时间 ,必填项.
431   - 'endStationEndTime' : {required : true}, // 终点站末班时间,必填项.
432   - 'earlyStartTime' : {required : true},// 早高峰开始时间,必填项 .
433   - 'earlyEndTime' : {required : true},// 早高峰结束时间,必填项 .
434   - 'lateStartTime' : {required : true},// 晚高峰开始时间,必填项 .
435   - 'lateEndTime' : {required : true},// 晚高峰结束时间,必填项.
436   - 'upInTimer' : {number : true},// 上行进场时间,必须为数字.
437   - 'upOutTimer' : {number : true},// 上行出场时间,必须为数字.
438   - 'downInTimer' : {number : true},// 下行进场时间,必须为数字.
439   - 'downOutTimer' : {number : true},// 下行出场时间,必须为数字.
440   - 'earlyUpTime' : {number : true},// 早高峰上行时间,必须为数字.
441   - 'earlyDownTime' : {number : true},// 早高峰下行时间,必须为数字.
442   - 'lateUpTime' : {number : true},// 晚高峰上行时间,必须为数字.
443   - 'lateDownTime' : {number : true},// 晚高峰下行时间,必须为数字.
444   - 'troughUpTime' : {number : true},// 低谷上行时间,必须为数字.
445   - 'troughDownTime' : {number : true},// 低谷下行时间,必须为数字.
446   - 'linePlayType' : {required : true},// 线路规划类型,必填项
447   - 'lb' : {number : true},// 早晚例行保养,必须为数字.
448   - 'workeLunch' : {number : true},// 工作餐午餐时间,必须为数字.
449   - 'workeDinner' : {number : true},// 工作餐晚餐时间,必须为数字.
450   - 'zgffcjxmin' : {required : true,number : true,digits: true},// 早高峰最小发车间隔.
451   - 'zgffcjxmax' : {required : true,number : true,digits: true},// 早高峰最大发车间隔.
452   - 'wffcjxmin' : {required : true,number : true,digits: true},// 晚高峰最小发车间隔.
453   - 'wffcjxmax' : {required : true,number : true,digits: true},// 晚高峰最大发车间隔.
454   - 'dgfcjxmin' : {required : true,number : true,digits: true},// 低谷最小发车间隔.
455   - 'dgfcjxmax' : {required : true,number : true,digits: true},// 低谷最大发车间隔.
456   - 'jbclcount': {required : true,number : true,digits: true}, // 建议加班车数
457   - 'upTravelTime' : {required : true,number : true},// 上行行驶时间,必填项、必须为整数.
458   - 'downTravelTime' : {required : true,number : true},// 下行行驶时间,必填项、必须为整数.
459   - 'upMileage' : {required : true,number : true},// 上行行驶里程,必填项、必须为整数.
460   - 'downMileage' : {required : true,number : true},// 下行行驶里程,必填项、必须为整数.
461   - 'upInMileage' : {number : true},// 上行进场里程,必须为数字.
462   - 'upOutMileage' : {number : true},// 上行出场里程,必须为数字.
463   - 'downInMileage' : {number : true},// 下行进场里程,必须为数字.
464   - 'downOutMileage' : {number : true}// 下行出场里程,必须为数字.
465   -
466   - // TODO
467   - },
468   - invalidHandler : function(event, validator) {
469   - paramAlert.show();
470   - App.scrollTo(paramAlert, -200);
471   - },
472   - highlight : function(element) {
473   - $(element).closest('.form-group').addClass('has-error');
474   - },
475   - unhighlight : function(element) {
476   - $(element).closest('.form-group').removeClass('has-error');
477   - },
478   - success : function(label) {
479   - label.closest('.form-group').removeClass('has-error');
480   - },
481   - submitHandler : function(f) {
482   - // 1、 获取表单内容,并序列化
483   - var fp = form.serializeJSON();
484   -
485   - console.log(fp);
486   -
487   - // 2、重新刷新表单数据
488   - var ganttMap = JSON.parse(window.localStorage.Gantt_AgursData);
489   - var key;
490   - for (key in fp) {
491   - if (ganttMap[key]) {
492   - if (ganttMap[key] != fp[key]) {
493   - ganttMap[key] = fp[key];
494   - }
495   - } else {
496   - ganttMap[key] = fp[key];
497   - }
498   - }
499   - window.localStorage.setItem("Gantt_AgursData",JSON.stringify(ganttMap));
500   -
501   - // TODO
502   - var pp = getParamObjAndDataMap();
503   - var paramObj = pp[0];
504   - var dataMap = pp[1];
505   - var csMap = getCSMap(paramObj);
506   - // console.log(graph);
507   - var data = Main_v2.BXPplaceClassesTime03(paramObj, csMap.maxCar);
508   - Main_v2.exportDataConfig(data.aInternalLpObj);
509   -
510   - // var data = obj.getDataArray();
511   - // // 2、 调整路牌对应的班次总数
512   - // updFormParams(params,data);
513   - // 删除图形.
514   - $('svg.svg-chart').remove();
515   - // 重新创建图形.
516   - var graph = d3.select('#ganttSvg').relationshipGraph(getGraphArgus(csMap, dataMap, data));
517   - // 根据数据重新渲染图形.
518   - graph.data(data.json);
519   - // 记录早操.并保存历史班次数据
520   - graph.addHistory();
521   - // 隐藏错误提示
522   - paramAlert.hide();
523   - // 隐藏 reladplus_mobal 弹出层
524   - $('#paramadd_mobal').modal('hide');
525   - layer.msg('成功!');
526   - }
527   - });
528   -
529   -
530   - // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
531   - $('#paramadd_mobal').on('show.bs.modal', function () {
532   - // TODO
533   - // 把数据填充到模版中
534   - // var tbodyHtml = template('countAdd_temp',{list:countDate});
535   - // // 把渲染好的模版html文本追加到表格中
536   - // $('#datatable_countadd tbody').html(tbodyHtml);
537   - var htmldata = template('paramAdd_temp', {map : param});
538   - $('#ptab').html(htmldata);
539   -
540   - // 线路规划类型
541   - $('#linePlayType_id').val(param.linePlayType);
542   - // 吃饭地点
543   - $get('/stationroute/all', {
544   - 'line.id_eq': param.lineName.split('_')[0],
545   - 'destroy_eq': 0,
546   - 'versions_eq': param.lineVersion},
547   - function(result) {
548   - var opt = [];
549   - opt.push('<option value="">请选择...</option>');
550   - $.each(result, function(i, d) {
551   - if (d.stationMark == 'B' && d.directions == 0) {
552   - opt.push("<option value='0'>" + d.stationName + "</option>");
553   - } else if (d.stationMark == 'E' && d.directions == 0) {
554   - opt.push("<option value='1'>" + d.stationName + "</option>");
555   - }
556   - });
557   - initTagsinput(opt.join(","));
558   -
559   - opt.push("<option value='allYes'>起终点站都可以</option>");
560   - $('#cfdd_id').html(opt.join(""));
561   - $('#cfdd_id').val(param.cfdd);
562   -
563   - }
564   - );
565   - // 停车场
566   - $get('/carpark/all',null, function(cd) {
567   - var opt = [];
568   - opt.push('<option value="">请选择...</option><optgroup label="停车场">');
569   - var $_len = cd.length;
570   - if($_len > 0) {
571   - $.each(cd, function(i, d){
572   - opt.push('<option value="'+d.parkCode+'">'+d.parkName+'</option>');
573   - });
574   - }
575   - opt.push('</optgroup>');
576   - $('#carPark_id').html(opt.join(",")).select2();
577   - $('#carPark_id').select2("val", param.carPark);
578   - });
579   -
580   - // 上下行首末班日期控件
581   - $('#startStationFirstTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
582   - $('#startStationEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
583   - $('#endStationFirstTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
584   - $('#endStationEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
585   -
586   - // 早高峰晚高峰日期控件
587   - $('#earlyStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
588   - $('#earlyEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
589   - $('#lateStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
590   - $('#lateEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
591   -
592   - });
593   - });
594   -
595   - function initTagsinput(htmlStr) {
596   - $('#masterStop_id').html(htmlStr);
597   -
598   - var elt = $('#stoptype_tagsinput');
599   - var value = elt.val();
600   - var stoptype = value.split("/")[0];
601   - var masterstop = value.split("/")[1];
602   -
603   - $('#stopType_id').val(stoptype);
604   - $('#masterStop_id').val(masterstop);
605   -
606   - elt.tagsinput({
607   - tagClass: function(item) {
608   - return 'label label-danger label-important';
609   - },
610   - itemValue: 'value',
611   - itemText: 'text'
612   - });
613   -
614   - $('#stoptype_tagsinput').on('beforeItemAdd', function(event) {
615   - // TODO:这里可以做一些逻辑判定
616   - });
617   -
618   - $('#stoptype_tagsinput_add').on('click', function(){
619   - var stoptype = $("#stopType_id").val();
620   - var masterstop = $("#masterStop_id").val();
621   - var masterstop_text = $("#masterStop_id option:selected").text();
622   -
623   - if (stoptype && stoptype != "") {
624   - if (stoptype == "0" && masterstop && masterstop != "") {
625   - elt.tagsinput('add', {
626   - "value": stoptype + '/' + masterstop,
627   - "text": "主站停站" + "/" + masterstop_text
628   - });
629   - } else {
630   - elt.tagsinput('add', {
631   - "value": 1,
632   - "text": "双向停站"
633   - });
634   - }
635   - }
636   - });
637   -
638   - if (stoptype && stoptype != "") {
639   - elt.tagsinput('add', {
640   - "value": stoptype + '/' + masterstop,
641   - "text":
642   - $("#stopType_id option:selected").text() + "/" +
643   - $("#masterStop_id option:selected").text()
644   - });
645   - }
646   -
647   - }
648   -
649   - function getMinDate(d1,d2) {
650   - // 1、定义返回字符串.
651   - var str = '';
652   - // 2、判断时间大小.
653   - if(strToTime(d1)>strToTime(d2))
654   - str = d2;
655   - else
656   - str = d1;
657   - // 3、返回最小时间(字符串).
658   - return str;
659   - }
660   -
661   - function strToTime(t) {
662   - var d = new Date();
663   - if(t) {
664   - var _str = t.split(':');
665   - d.setHours(parseInt(_str[0]));
666   - d.setMinutes(parseInt(_str[1]));
667   - }
668   - return d;
669   - }
670   -
671   - function getMaxDate(d1,d2) {
672   - // 1、定义返回时间字符串.
673   - var str = '';
674   - // 2、判断时间大小.
675   - if(strToTime(d1)>strToTime(d2))
676   - str = d1;
677   - else
678   - str = d2;
679   - // 3、返回一个最大时间(字符串).
680   - return str;
681   - }
682   -
683   - function getEndDate(date) {
684   - var lastEndDate = Date.now();
685   - if (date) {
686   - var str = date.replace(/-/g,"/");
687   - lastEndDate = new Date(str);
688   - }
689   - // Wed Oct 26 2016 00:00:00 GMT+0800 (中国标准时间)
690   - return lastEndDate;
691   - }
692   -
693   - function formatPairing(v1,v2) {
694   - v1 = v1 == '' ? 0 : parseInt(v1);
695   - v2 = v2 == ''? 0 : parseInt(v2) ;
696   - return [v1,v2];
697   - }
698   -
699   - function qzdz(zd1,zd2) {
700   - return [zd1,zd2];
701   - }
702   -
703   - function formatksjssj(gp) {
704   - return [{'kssj':gp.startStationFirstTime,'jssj':gp.startStationEndTime},{'kssj':gp.endStationFirstTime,'jssj':gp.endStationEndTime}];
705   - }
706   -
707   - function getsd(st,ed) {
708   - return [{'st':st,'ed':ed}];
709   - }
710   -
711   - function getDateTime(time) {
712   - var dateTime = new Date();
713   - var timeArr;
714   - if(time !=null && time !='' && typeof(time) !='undefined') {
715   - timeArr = time.split(':');
716   - dateTime.setHours(parseInt(timeArr[0]));
717   - dateTime.setMinutes(parseInt(timeArr[1]));
718   - }
719   - return dateTime;
720   - }
721   -
722   - function getYAxisCarArray(len) {
723   - var array = new Array();
724   - if(len>0) {
725   - for(var y = 0; y<len; y++) {
726   - array.push({lp:null,lpNo:y+1, parent :y+1, lpName:y+1,lpType:'普通路牌'});//添加一个路牌对象
727   - };
728   - }
729   - return array;
730   - }
731   -
732   - function getylp(arr) {
733   - var ra = new Array(),name = new Array();
734   - for(var i = 0 ; i<arr.length;i++) {
735   - ra.push(arr[i].lpNo);
736   - name.push(arr[i].lpName);
737   - }
738   - return {'lpNoA':ra,'lpNameA':name,};
739   - }
740   -
741   - function getParamObjAndDataMap() {
742   - var map = JSON.parse(window.localStorage.Gantt_AgursData);
743   - // seMap
744   - var seMap = {'s': map.linePlayType == '1' ? map.startStationFirstTime : getMinDate(map.startStationFirstTime,map.endStationFirstTime),
745   - 'e': map.linePlayType == '1' ? map.startStationEndTime : getMaxDate(map.startStationEndTime,map.endStationEndTime)};
746   - // dirA
747   - var dirA = ['relationshipGraph-up', 'relationshipGraph-down'];
748   - // bcTypeArr
749   - var bcTypeArr = {
750   - 'bd': 'bd', 'out': 'out', 'normal': 'normal', 'cf': 'cf', 'in_': 'in', 'lc': 'lc',
751   - 'major': 'major', 'venting': 'venting', 'region': 'region'
752   - };
753   - // seDate
754   - var newDate = new Date();
755   - var kssj = d3.time.hour.offset(getEndDate(
756   - newDate.getFullYear()+ "-" +
757   - (newDate.getMonth()+1) + "-" +
758   - newDate.getDate() + ' ' +
759   - seMap.s.split(':')[0] + ':00'),-1);
760   -
761   - var year = '' , month = '',dt = '';
762   - if(newDate.getDate()+1>31)
763   - dt = '01';
764   - else
765   - dt = newDate.getDate()+1;
766   - if(newDate.getMonth()+1>12)
767   - month = '01';
768   - else if(newDate.getDate()+1>31)
769   - month = newDate.getMonth()+2;
770   - else
771   - month = newDate.getMonth()+1;
772   - if(newDate.getMonth()+1>12)
773   - year = newDate.getFullYear()+1;
774   - else
775   - year = newDate.getFullYear();
776   - var jssj = getEndDate(year + '-' + month + '-' + dt + ' ' + '00:00');
777   - seDate = {'kssj' : kssj, 'jssj' : jssj};
778   -
779   - // dataMap
780   - var dataMap = {'jcsjArr' : formatPairing(map.upInTimer,map.downInTimer),// 进场里程。[下标0代表上;下标1代表下]
781   - 'ccsjArr' : formatPairing(map.upOutTimer,map.downOutTimer),// 出场时间。[下标0代表上;下标1代表下]
782   - 'jclcArr' : formatPairing(map.upInMileage,map.downInMileage),// 进场里程。[下标0代表上;下标1代表下]
783   - 'cclcArr' : formatPairing(map.upOutMileage,map.downOutMileage),// 出场里程。[下标0代表上;下标1代表下]
784   - 'pcxssjArr' : formatPairing(map.upTravelTime,map.downTravelTime),// 平常行驶时间。[下标0代表上;下标1代表下]
785   - 'gfxxsjArr' : formatPairing(map.lateUpTime=='' ? map.upTravelTime : map.lateUpTime,
786   - map.lateDownTime=='' ? map.downTravelTime : map.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下]
787   - 'dgxxsjArr' : formatPairing(map.troughUpTime=='' ? map.upTravelTime : map.troughUpTime,
788   - map.troughDownTime=='' ? map.downTravelTime : map.troughDownTime),// 低谷行驶时间。[下标0代表上;下标1代表下]
789   - 'pcxslcArr' : formatPairing(map.upMileage,map.downMileage),// 行驶里程。[下标0代表上;下标1代表下]
790   - 'qdzArr' : qzdz(map.up_s.split('_')[0],map.down_s.split('_')[0]),// 起始站。[下标0代表上;下标1代表下]
791   - 'zdzArr':qzdz(map.up_s.split('_')[1],map.down_s.split('_')[1]),// 终点站。[下标0代表上;下标1代表下]
792   - 'zwcArr' : formatPairing(map.workeLunch,map.workeDinner),// 午晚餐时间。[下标0代表午;下标1代表晚]
793   - 'smbcsjArr' : formatksjssj(map), // 起终点站首末班车时间.[下标0代表起始站的首末班车时间;下标1代表终点站的首末班车时间]
794   - 'zgfsjd' : getsd(getDateTime(map.earlyStartTime),
795   - getDateTime(map.earlyEndTime)), // 早高峰时间段
796   - 'wgfsjd' : getsd(getDateTime(map.lateStartTime),
797   - getDateTime(map.lateEndTime)),// 晚高峰时间段
798   - 'gfzjsjd' : getsd(getDateTime(map.earlyEndTime),
799   - getDateTime(map.lateStartTime)),//高峰之间时间段.
800   - 'wgfzhsjd' : getsd(getDateTime(map.lateEndTime),
801   - getDateTime(seMap.e)),// 晚高峰之后时间段
802   - 'zgfzqsjd': getsd(getDateTime(seMap.s),
803   - getDateTime(map.earlyStartTime)),//早高峰之前时间段.
804   - 'dira' : dirA,// 方向集合 [下标0代表上;下标1代表下]
805   - 'bcTypeArr' : bcTypeArr,// 班次类型
806   - 'lbsj' : map.lb=='' ? 0:parseInt(map.lb),// 例保时间.
807   - // 'minztjx' : parseInt(gatps.mixstopTime), // 最小停站时间.
808   - // 'ztjxA' : BaseFun.formatPairing(gatps.upStopTime,gatps.downStopTime), // 停站时间.
809   - // 'maxztjx' : parseInt(gatps.maxstopTime), // 最大停站时间.
810   - 'gftzsj': formatPairing(map.gfupStopTime,map.gfdownStopTime),// 高峰停站时间.
811   - 'dgtzsj' : formatPairing(map.dgupStopTime,map.dgdownStopTime),// 低谷停站时间.
812   - 'dgmaxtzsj' : parseInt(map.dgmaxtzsj),// 低谷最大停站时间.
813   - 'dgmaxfcjx' : parseInt(map.dgmaxfcjx),// 低谷最大发车间隙.
814   - 'map' : map,
815   - 'zzsj':map.zzsj,// 周转时间.
816   - };
817   -
818   - var _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap);
819   - map.clzs = _paramObj.calcuClzx();
820   - return [_paramObj, dataMap];
821   -
822   - }
823   -
824   - function getCSMap(parmObj) {
825   - var map = JSON.parse(window.localStorage.Gantt_AgursData);
826   - return {'gattA':null,
827   - 'fcjx': {'gffcjx': Math.round(parmObj.calcuPeakZzsj()/parmObj.calcuClzx()) ,
828   - 'dgfcjx': Math.round(parmObj.calcuTroughZzsj()/parmObj.calcuClzx()),
829   - 'dgmaxfcjx' : parseInt(map.dgmaxfcjx)},
830   - 'maxCar':getYAxisCarArray(parseInt(parmObj.calcuClzx()))};
831   - }
832   -
833   - function getGraphArgus(CSMap, dataMap, data) {
834   - // TODO
835   - var map = JSON.parse(window.localStorage.Gantt_AgursData);
836   - var sxsj = parseInt(map.upTravelTime);// 上行时间.
837   -
838   - // seMap
839   - var seMap = {'s': map.linePlayType == '1' ? map.startStationFirstTime : getMinDate(map.startStationFirstTime,map.endStationFirstTime),
840   - 'e': map.linePlayType == '1' ? map.startStationEndTime : getMaxDate(map.startStationEndTime,map.endStationEndTime)};
841   -
842   - // seDate
843   - var newDate = new Date();
844   - var kssj = d3.time.hour.offset(getEndDate(
845   - newDate.getFullYear()+ "-" +
846   - (newDate.getMonth()+1) + "-" +
847   - newDate.getDate() + ' ' +
848   - seMap.s.split(':')[0] + ':00'),-1);
849   -
850   - var year = '' , month = '',dt = '';
851   - if(newDate.getDate()+1>31)
852   - dt = '01';
853   - else
854   - dt = newDate.getDate()+1;
855   - if(newDate.getMonth()+1>12)
856   - month = '01';
857   - else if(newDate.getDate()+1>31)
858   - month = newDate.getMonth()+2;
859   - else
860   - month = newDate.getMonth()+1;
861   - if(newDate.getMonth()+1>12)
862   - year = newDate.getFullYear()+1;
863   - else
864   - year = newDate.getFullYear();
865   - var jssj = getEndDate(year + '-' + month + '-' + dt + ' ' + '00:00');
866   - seDate = {'kssj' : kssj, 'jssj' : jssj};
867   -
868   -
869   - var bs = sxsj > 40 ? 4 : 2;
870   - var MULTIPLE = Math.round(105/sxsj) >3 ? Math.round(90/sxsj) : Math.round(90/sxsj) *bs;
871   - var VALUEKEYNAME = 'Worldwide Gross' ,
872   - DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = CSMap.maxCar.length*60 + 240,
873   - MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60,
874   - STARTDATETIME = seDate.kssj ,ENDDATETIME = seDate.jssj ,TASKTYPES =CSMap.maxCar ,TICKFORMAT ='%H:%M' ,SHOWTOOLTIPS = true;
875   - var dx_time = seDate.jssj.getTime() - seDate.kssj.getTime() ;
876   - // 计算出相差天数
877   - var days=Math.floor(dx_time/(24*3600*1000));
878   - // 计算出小时数
879   - var leave1=dx_time%(24*3600*1000); //计算天数后剩余的毫秒数
880   - var hours=Math.floor(leave1/(3600*1000));
881   - DXHOURS = days*24+hours;
882   - WIDTH = DXHOURS*MINUTE*MULTIPLE;
883   - // debugger;
884   - var lpsplitA = getylp(CSMap.maxCar);
885   -
886   - var sxsj = parseInt(map.upTravelTime);// 上行时间.
887   - var xxsj = parseInt(map.downTravelTime);// 下行时间.
888   - var stopAraay = [{
889   - 'sxsj':sxsj,// 上行时间.
890   - 'xxsj':xxsj,// 下行时间.
891   - 'zzsj':map.zzsj,// 周转时间.
892   - 'wcsj':parseInt(map.workeLunch),// 午餐时间.
893   - 'wcsj':parseInt(map.workeDinner),// 晚餐时间.
894   - 'zgfsxsj':map.earlyUpTime==''? sxsj : parseInt(map.earlyUpTime),// 早高峰上行行驶时间.
895   - 'zgfxxsj':map.earlyDownTime=='' ? xxsj : parseInt(map.earlyDownTime),// 早高峰下行行驶时间.
896   - 'wgfsxsj':map.lateUpTime=='' ? sxsj : parseInt(map.lateUpTime),// 晚高峰上行行驶时间.
897   - 'wgfxxsj':map.lateDownTime== '' ? xxsj: parseInt(map.lateDownTime),// 晚高峰下行行驶时间.
898   - 'sxjcsj':map.upInTimer == '' ? 0 : parseInt(map.upInTimer),// 上行进场时间.
899   - 'sxccsj':map.upOutTimer == '' ? 0 : parseInt(map.upOutTimer),// 上行出场时间.
900   - 'xxjcsj':map.downInTimer =='' ? 0 : parseInt(map.downInTimer),// 下行进场时间.
901   - 'xxccsj':map.downOutTimer =='' ? 0 : parseInt(map.downOutTimer),// 下行进场时间.
902   - 'sxjclc':map.upInMileage==''? 0 : parseInt(map.upInMileage),// 上行进场里程.
903   - 'sxcclc':map.upOutMileage==''? 0:parseInt(map.upOutMileage),// 上行出场里程.
904   - 'xxjclc':map.downInMileage==''? 0 : parseInt(map.downInMileage),// 下行进场里程.
905   - 'xxcclc':map.downOutMileage==''?0:parseInt(map.downOutMileage),// 下行出场里程.
906   - 'lbsj': map.lb==''? 0 : parseInt(map.lb) // 例保时间.
907   - }];
908   -
909   - var args = {
910   - 'valueKeyName': VALUEKEYNAME,
911   - 'hours' : DXHOURS,
912   - 'dxHours' : 24 - DXHOURS,
913   - 'multiple': MULTIPLE,
914   - 'width':WIDTH,
915   - 'widtMargin':MARGINLEFT,
916   - 'height':HEIGHT,
917   - 'heightMargin':MARGINBOTTOM,
918   - 'offsetX':OFFSETX,
919   - 'offsetY':OFFSETY,
920   - 'downDy':OFFSETDOWNY,
921   - 'upDy':OFFSETUPY,
922   - 'timeDomainStart' :STARTDATETIME,
923   - 'timeDomainEnd' : ENDDATETIME,
924   - 'startStr':'' + STARTDATETIME,
925   - 'endStr': '' +ENDDATETIME,
926   - 'taskTypes': TASKTYPES,
927   - 'lpNoA':lpsplitA.lpNoA,
928   - 'lpNameA':lpsplitA.lpNameA,
929   - 'tickFormat': TICKFORMAT,
930   - 'stopAraay' : stopAraay,
931   - 'dataMap':dataMap,
932   - 'showTooltips': SHOWTOOLTIPS,
933   - 'bxrcgs':data.bxrcgs
934   - }
935   - return args;
936   - }
  1 +<!-- 统计数据 -->
  2 +<style>
  3 + .form-control:focus {
  4 + border-color: #53ced9;
  5 + }
  6 + .tagsDiv {
  7 + border: 1px solid #c2cad8;
  8 + margin-left: 15px;
  9 + padding: 4px 15px 4px 15px;
  10 + width: 50%;
  11 + }
  12 +</style>
  13 +<div class="modal fade" id="paramadd_mobal" tabindex="-1" role="basic" aria-hidden="true">
  14 + <div class="modal-dialog" style="margin-left: 100px;">
  15 + <div class="modal-content" style="width: 1000px;">
  16 + <div class="modal-header">
  17 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  18 + <h4 class="modal-title">参数数据 </h4>
  19 + </div>
  20 + <div class="modal-body">
  21 + <form class="form-horizontal" id="param_form" action="/" method="POST" novalidate="novalidate">
  22 + <div class="form-body">
  23 + <div class="alert alert-danger display-hide">
  24 + <button class="close" data-close="alert"></button>
  25 + 您的输入有误,请检查下面的输入项
  26 + </div>
  27 + <div class="alert alert-success display-none">
  28 + <button class="close" data-dismiss="alert"></button>
  29 + 验证成功!
  30 + </div>
  31 +
  32 + </div>
  33 +
  34 + <div class="tab-pane" id="ptab">
  35 +
  36 + </div>
  37 + </form>
  38 + </div>
  39 +
  40 + <div class="modal-footer">
  41 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  42 + <button type="button" class="btn btn-primary" id="paramnext">确定</button>
  43 + </div>
  44 +
  45 + </div>
  46 + </div>
  47 +</div>
  48 +
  49 +<script type="text/html" id = "paramAdd_temp">
  50 + <div class="form-group">
  51 + <div class="col-md-6">
  52 + <label class="control-label col-md-5">
  53 + <span class="required"> * </span> 上行首班时间 :
  54 + </label>
  55 + <div class="col-md-5">
  56 + <input type="text" class="form-control" name="startStationFirstTime" value="{{map.startStationFirstTime}}" id="startStationFirstTime_id"
  57 + placeholder="请输入起始站首班时间">
  58 + </div>
  59 + </div>
  60 + <div class="col-md-6">
  61 + <label class="control-label col-md-5">
  62 + <span class="required"> * </span> 上行末班时间 :
  63 + </label>
  64 + <div class="col-md-5">
  65 + <input type="text" class="form-control" name="startStationEndTime" value="{{map.startStationEndTime}}" id="startStationEndTime_id"
  66 + placeholder="请输入起始站末班时间">
  67 + </div>
  68 + </div>
  69 + </div>
  70 +
  71 + <div class="form-group">
  72 + <div class="col-md-6">
  73 + <label class="control-label col-md-5">
  74 + <span class="required"> * </span> 下行首班时间 :
  75 + </label>
  76 + <div class="col-md-5">
  77 + <input type="text" class="form-control" name="endStationFirstTime" value="{{map.endStationFirstTime}}" id="endStationFirstTime_id"
  78 + placeholder="请输入终点站首班时间">
  79 + </div>
  80 + </div>
  81 + <div class="col-md-6">
  82 + <label class="control-label col-md-5">
  83 + <span class="required"> * </span> 下行末班时间 :
  84 + </label>
  85 + <div class="col-md-5">
  86 + <input type="text" class="form-control" name="endStationEndTime" value="{{map.endStationEndTime}}" id="endStationEndTime_id"
  87 + placeholder="请输入终点站末班时间">
  88 + </div>
  89 + </div>
  90 + </div>
  91 +
  92 + <div class="form-group">
  93 + <div class="col-md-6">
  94 + <label class="control-label col-md-5">
  95 + <span class="required"> * </span> 早高峰开始时间 :
  96 + </label>
  97 + <div class="col-md-5">
  98 + <input type="text" class="form-control" name="earlyStartTime" value="{{map.earlyStartTime}}" id="earlyStartTime_id"
  99 + placeholder="请输入早高峰开始时间">
  100 + </div>
  101 + </div>
  102 + <div class="col-md-6">
  103 + <label class="control-label col-md-5">
  104 + <span class="required"> * </span> 早高峰结束时间 :
  105 + </label>
  106 + <div class="col-md-5">
  107 + <input type="text" class="form-control" name="earlyEndTime" value="{{map.earlyEndTime}}" id="earlyEndTime_id"
  108 + placeholder="请输入早高峰结束时间">
  109 + </div>
  110 + </div>
  111 + </div>
  112 +
  113 + <div class="form-group">
  114 + <div class="col-md-6">
  115 + <label class="control-label col-md-5">
  116 + <span class="required"> * </span> 晚高峰开始时间 :
  117 + </label>
  118 + <div class="col-md-5">
  119 + <input type="text" class="form-control" name="lateStartTime" value="{{map.lateStartTime}}" id="lateStartTime_id"
  120 + placeholder="请输入晚高峰开始时间">
  121 + </div>
  122 + </div>
  123 + <div class="col-md-6">
  124 + <label class="control-label col-md-5">
  125 + <span class="required"> * </span> 晚高峰结束时间 :
  126 + </label>
  127 + <div class="col-md-5">
  128 + <input type="text" class="form-control" name="lateEndTime" value="{{map.lateEndTime}}" id="lateEndTime_id"
  129 + placeholder="请输入晚高峰结束时间">
  130 + </div>
  131 + </div>
  132 + </div>
  133 +
  134 + <div class="form-group">
  135 + <div class="col-md-6">
  136 + <label class="control-label col-md-5">上行进场时间  :
  137 + </label>
  138 + <div class="col-md-5">
  139 + <input type="text" class="form-control" name="upInTimer" value="{{map.upInTimer}}" id="upInTimer_id"
  140 + placeholder="请输入上行进场时间">
  141 + </div>
  142 + </div>
  143 + <div class="col-md-6">
  144 + <label class="control-label col-md-5">上行出场时间  :
  145 + </label>
  146 + <div class="col-md-5">
  147 + <input type="text" class="form-control" name="upOutTimer" value="{{map.upOutTimer}}" id="upOutTimer_id"
  148 + placeholder="请输入上行出场时间">
  149 + </div>
  150 + </div>
  151 + </div>
  152 +
  153 + <div class="form-group">
  154 + <div class="col-md-6">
  155 + <label class="control-label col-md-5">下行进场时间  :
  156 + </label>
  157 + <div class="col-md-5">
  158 + <input type="text" class="form-control" name="downInTimer" value="{{map.downInTimer}}" id="downInTimer_id"
  159 + placeholder="请输入下行进场时间">
  160 + </div>
  161 + </div>
  162 + <div class="col-md-6">
  163 + <label class="control-label col-md-5">下行出场时间  :
  164 + </label>
  165 + <div class="col-md-5">
  166 + <input type="text" class="form-control" name="downOutTimer" value="{{map.downOutTimer}}" id="downOutTimer_id"
  167 + placeholder="请输入下行出场时间">
  168 + </div>
  169 + </div>
  170 + </div>
  171 +
  172 + <div class="form-group">
  173 + <div class="col-md-6">
  174 + <label class="control-label col-md-5">早高峰上行时间 :</label>
  175 + <div class="col-md-5">
  176 + <input type="text" class="form-control" name="earlyUpTime" value="{{map.earlyUpTime}}" id="earlyUpTime_id"
  177 + placeholder="请输入早高峰上行时间">
  178 + </div>
  179 + </div>
  180 + <div class="col-md-6">
  181 + <label class="control-label col-md-5">早高峰下行时间 :</label>
  182 + <div class="col-md-5">
  183 + <input type="text" class="form-control" name="earlyDownTime" value="{{map.earlyDownTime}}" id="earlyDownTime_id"
  184 + placeholder="请输入早高峰下行时间">
  185 + </div>
  186 + </div>
  187 + </div>
  188 +
  189 + <div class="form-group">
  190 + <div class="col-md-6">
  191 + <label class="control-label col-md-5">晚高峰上行时间 :</label>
  192 + <div class="col-md-5">
  193 + <input type="text" class="form-control" name="lateUpTime" value="{{map.lateUpTime}}" id="lateUpTime_id"
  194 + placeholder="请输入晚高峰上行时间">
  195 + </div>
  196 + </div>
  197 + <div class="col-md-6">
  198 + <label class="control-label col-md-5">晚高峰下行时间 :</label>
  199 + <div class="col-md-5">
  200 + <input type="text" class="form-control" name="lateDownTime" value="{{map.lateDownTime}}" id="lateDownTime_id"
  201 + placeholder="请输入晚高峰下行时间">
  202 + </div>
  203 + </div>
  204 + </div>
  205 +
  206 + <div class="form-group">
  207 + <div class="col-md-6">
  208 + <label class="control-label col-md-5">低谷上行时间  :</label>
  209 + <div class="col-md-5">
  210 + <input type="text" class="form-control" name="troughUpTime" value="{{map.troughUpTime}}" id="troughUpTime_id"
  211 + placeholder="请输入低谷上行时间">
  212 + </div>
  213 + </div>
  214 + <div class="col-md-6">
  215 + <label class="control-label col-md-5">低谷下行时间  :</label>
  216 + <div class="col-md-5">
  217 + <input type="text" class="form-control" name="troughDownTime" value="{{map.troughDownTime}}" id="troughDownTime_id"
  218 + placeholder="请输入低谷下行时间">
  219 + </div>
  220 + </div>
  221 + </div>
  222 +
  223 + <div class="form-group">
  224 + <div class="col-md-6">
  225 + <label class="control-label col-md-5">
  226 + <span class="required"> * </span> 线路规划类型  :
  227 + </label>
  228 + <div class="col-md-5">
  229 + <select name="linePlayType" class="form-control" id="linePlayType_id">
  230 + <option value="">-- 请选择线路类型 --</option>
  231 + <option value="0">双向</option>
  232 + <option value="1">环线</option>
  233 + </select>
  234 + </div>
  235 + </div>
  236 + <div class="col-md-6">
  237 + <label class="control-label col-md-5">吃饭地点    :</label>
  238 + <div class="col-md-5">
  239 + <select type="text" class="form-control" name="cfdd" id="cfdd_id">
  240 + <option value="">请选择...</option>
  241 + <option value="0">{{map.startStationName}}</option>
  242 + <option value="1">{{map.endStationName}}</option>
  243 + <option value="allYes">起终点站都可以</option>
  244 + </select>
  245 + </div>
  246 + </div>
  247 + </div>
  248 +
  249 + <div class="form-group">
  250 + <div class="col-md-6">
  251 + <label class="control-label col-md-5">早晚例行保养  :</label>
  252 + <div class="col-md-5">
  253 + <input type="text" class="form-control" name="lb" value="{{map.lb}}" id="lb_id"
  254 + placeholder="请输入早晚例行保养">
  255 + </div>
  256 + </div>
  257 + <div class="col-md-6">
  258 + <label class="control-label col-md-5">停车场     :</label>
  259 + <div class="col-md-5">
  260 + <select name="carPark" class="form-control" id="carPark_id" style="width:100%"></select>
  261 + </div>
  262 + </div>
  263 + </div>
  264 +
  265 +
  266 + <div class="form-group">
  267 + <div class="col-md-6">
  268 + <label class="control-label col-md-5">工作餐午餐时间 :</label>
  269 + <div class="col-md-5">
  270 + <input type="text" class="form-control" name="workeLunch" value="{{map.workeLunch}}" id="workeLunch_id"
  271 + placeholder="请输入工作餐午餐时间">
  272 + </div>
  273 + </div>
  274 + <div class="col-md-6">
  275 + <label class="control-label col-md-5">工作餐晚餐时间 :</label>
  276 + <div class="col-md-5">
  277 + <input type="text" class="form-control" name="workeDinner" value="{{map.workeDinner}}" id="workeDinner_id"
  278 + placeholder="请输入工作餐晚餐时间">
  279 + </div>
  280 + </div>
  281 + </div>
  282 +
  283 + <div class="form-group">
  284 + <div class="col-md-6">
  285 + <label class="control-label col-md-5"><span class="required"> * </span>早高峰发车间隔 :</label>
  286 + <div class="col-md-3" style="padding-right: 0px;">
  287 + <input type="text" class="form-control" name="zgffcjxmin" value="{{map.zgffcjxmin}}" id="zgffcjxmin_id"
  288 + placeholder="最小间隔">
  289 + </div>
  290 + <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
  291 + <div class="col-md-3" style="padding-left: 0px;">
  292 + <input type="text" class="form-control" name="zgffcjxmax" value="{{map.zgffcjxmax}}" id="zgffcjxmax_id"
  293 + placeholder="最大间隔">
  294 + </div>
  295 + </div>
  296 + <div class="col-md-6">
  297 + <label class="control-label col-md-5"><span class="required"> * </span>晚高峰发车间隔 :</label>
  298 + <div class="col-md-3" style="padding-right: 0px;">
  299 + <input type="text" class="form-control" name="wffcjxmin" value="{{map.wffcjxmin}}" id="wffcjxmin_id"
  300 + placeholder="最小间隔">
  301 + </div>
  302 + <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
  303 + <div class="col-md-3" style="padding-left: 0px;">
  304 + <input type="text" class="form-control" name="wffcjxmax" value="{{map.wffcjxmax}}" id="wffcjxmax_id"
  305 + placeholder="最大间隔">
  306 + </div>
  307 + </div>
  308 + </div>
  309 +
  310 + <div class="form-group">
  311 + <div class="col-md-6">
  312 + <label class="control-label col-md-5"><span class="required"> * </span>低谷发车间隔 :</label>
  313 + <div class="col-md-3" style="padding-right: 0px;">
  314 + <input type="text" class="form-control" name="dgfcjxmin" value="{{map.dgfcjxmin}}" id="dgfcjxmin_id"
  315 + placeholder="最小间隔">
  316 + </div>
  317 + <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
  318 + <div class="col-md-3" style="padding-left: 0px;">
  319 + <input type="text" class="form-control" name="dgfcjxmax" value="{{map.dgfcjxmax}}" id="dgfcjxmax_id"
  320 + placeholder="最大间隔">
  321 + </div>
  322 + </div>
  323 + <div class="col-md-6">
  324 + <label class="control-label col-md-5"><span class="required"> * </span>建议加班路牌数 :</label>
  325 + <div class="col-md-5">
  326 + <input type="text" class="form-control" name="jbclcount" value="{{map.jbclcount}}" id="jbclcount_id"
  327 + placeholder="为0表示是周末时刻表">
  328 + </div>
  329 + </div>
  330 + </div>
  331 +
  332 + <div class="form-group">
  333 + <div class="col-md-6">
  334 + <label class="control-label col-md-5"><span class="required"> * </span>停站类型 :</label>
  335 + <div class="col-md-5 tagsDiv">
  336 + <div class="row" style="margin-left: 15px;">
  337 + <input type="text" value="{{map.stt}}" name="stt" id="stoptype_tagsinput" style="display: none;">
  338 + </div>
  339 +
  340 + <div class="row" style="margin-top: 10px;">
  341 + <label class="control-label col-md-4">停站类型:</label>
  342 + <div class="col-md-8">
  343 + <select name="stopType" class="form-control" id="stopType_id">
  344 + <option value="">-- 请选择停站类型 --</option>
  345 + <option value="0">主站停站</option>
  346 + <option value="1">双向停站</option>
  347 + </select>
  348 + </div>
  349 + </div>
  350 +
  351 + <div class="row" style="margin-top: 10px;">
  352 + <label class="control-label col-md-4">主站:</label>
  353 + <div class="col-md-8">
  354 + <select name="masterStop" class="form-control" id="masterStop_id">
  355 + <option value="">请选择...</option>
  356 + <option value="0">{{map.startStationName}}</option>
  357 + <option value="1">{{map.endStationName}}</option>
  358 + </select>
  359 + </div>
  360 + </div>
  361 +
  362 + <div class="row" style="margin-top: 10px;margin-left: 116px;">
  363 + <a href="javascript:" class="btn red" id="stoptype_tagsinput_add">添加</a>
  364 + </div>
  365 + </div>
  366 +
  367 + </div>
  368 +
  369 + <div class="col-md-6">
  370 + <label class="control-label col-md-5">
  371 + <span class="required"> * </span> 建议高峰配车数 :</label>
  372 + <div class="col-md-5">
  373 + <input type="text" class="form-control" placeholder="车辆数" name="gfjypcs"
  374 + id="gfjypcsInput" min="1" value="{{map.gfjypcs}}">
  375 + </div>
  376 + </div>
  377 +
  378 + </div>
  379 +
  380 + <!-- 隐藏字段-时间 -->
  381 + <input type="hidden" name="skbName" value="{{map.skbName}}" id="skbName_id"/>
  382 + <input type="hidden" name="skbmc" value="{{map.skbmc}}" id="skbmc_id"/>
  383 + <input type="hidden" name="xlmc" value="{{map.xlmc}}" id="xlmc_id"/>
  384 + <input type="hidden" name="lineName" value="{{map.lineName}}" id="lineName_id"/>
  385 + <input type="hidden" name="lineVersion" value="{{map.lineVersion}}" id="lineVersion_id"/>
  386 +
  387 + <!-- 上下行行驶时间 -->
  388 + <input type="hidden" name="upTravelTime" value="{{map.upTravelTime}}" id="upTravelTime_id"/>
  389 + <input type="hidden" name="downTravelTime" value="{{map.downTravelTime}}" id="downTravelTime_id"/>
  390 +
  391 + <!-- 隐藏字段-里程 -->
  392 + <!-- 上下行行驶里程 -->
  393 + <input type="hidden" name="upMileage" value="{{map.upMileage}}" id="upMileage_id"/>
  394 + <input type="hidden" name="downMileage" value="{{map.downMileage}}" id="downMileage_id"/>
  395 + <!-- 上下行进场出场里程 -->
  396 + <input type="hidden" name="upInMileage" value="{{map.upInMileage}}" id="upInMileage_id"/>
  397 + <input type="hidden" name="downInMileage" value="{{map.downInMileage}}" id="downInMileage_id"/>
  398 + <input type="hidden" name="upOutMileage" value="{{map.upOutMileage}}" id="upOutMileage_id"/>
  399 + <input type="hidden" name="downOutMileage" value="{{map.downOutMileage}}" id="downOutMileage_id"/>
  400 +
  401 +
  402 +</script>
  403 +
  404 +<script type="text/javascript">
  405 + $('#paramadd_mobal').on('paramAddMobal.show', function(e, g_){
  406 + // 加载延迟200毫秒显示mobal
  407 + setTimeout(function(){$('#paramadd_mobal').modal({show : true,backdrop: 'static', keyboard: false});},200);
  408 + var param = JSON.parse(window.localStorage.Gantt_AgursData);
  409 +
  410 + // 获取表单元素
  411 + var form = $('#param_form');
  412 + // 错误提示元素
  413 + var paramAlert = $('.alert-danger', form);
  414 + // 确定事件点击
  415 + $('#paramnext').on('click', function() {
  416 + form.submit();// 表单提交
  417 + });
  418 +
  419 + // 表单验证
  420 + form.validate({
  421 + errorElement : 'span',
  422 + errorClass : 'help-block help-block-error',
  423 + focusInvalid : false,
  424 + rules: {
  425 + 'skbName' : {required : true,},// 时刻表名称,必填项.
  426 + 'lineName' : {required : true,},// 线路名称,必填项.
  427 + 'lineVersion': {required: true}, // 站点路由版本,必填项,
  428 + 'startStationFirstTime' : {required : true}, // 起始站首班时间,必填项.
  429 + 'startStationEndTime' : {required : true}, // 起始站末班时间 ,必填项.
  430 + 'endStationFirstTime' : {required : true}, // 终点站首班时间 ,必填项.
  431 + 'endStationEndTime' : {required : true}, // 终点站末班时间,必填项.
  432 + 'earlyStartTime' : {required : true},// 早高峰开始时间,必填项 .
  433 + 'earlyEndTime' : {required : true},// 早高峰结束时间,必填项 .
  434 + 'lateStartTime' : {required : true},// 晚高峰开始时间,必填项 .
  435 + 'lateEndTime' : {required : true},// 晚高峰结束时间,必填项.
  436 + 'upInTimer' : {number : true},// 上行进场时间,必须为数字.
  437 + 'upOutTimer' : {number : true},// 上行出场时间,必须为数字.
  438 + 'downInTimer' : {number : true},// 下行进场时间,必须为数字.
  439 + 'downOutTimer' : {number : true},// 下行出场时间,必须为数字.
  440 + 'earlyUpTime' : {number : true},// 早高峰上行时间,必须为数字.
  441 + 'earlyDownTime' : {number : true},// 早高峰下行时间,必须为数字.
  442 + 'lateUpTime' : {number : true},// 晚高峰上行时间,必须为数字.
  443 + 'lateDownTime' : {number : true},// 晚高峰下行时间,必须为数字.
  444 + 'troughUpTime' : {number : true},// 低谷上行时间,必须为数字.
  445 + 'troughDownTime' : {number : true},// 低谷下行时间,必须为数字.
  446 + 'linePlayType' : {required : true},// 线路规划类型,必填项
  447 + 'lb' : {number : true},// 早晚例行保养,必须为数字.
  448 + 'workeLunch' : {number : true},// 工作餐午餐时间,必须为数字.
  449 + 'workeDinner' : {number : true},// 工作餐晚餐时间,必须为数字.
  450 + 'zgffcjxmin' : {required : true,number : true,digits: true},// 早高峰最小发车间隔.
  451 + 'zgffcjxmax' : {required : true,number : true,digits: true},// 早高峰最大发车间隔.
  452 + 'wffcjxmin' : {required : true,number : true,digits: true},// 晚高峰最小发车间隔.
  453 + 'wffcjxmax' : {required : true,number : true,digits: true},// 晚高峰最大发车间隔.
  454 + 'dgfcjxmin' : {required : true,number : true,digits: true},// 低谷最小发车间隔.
  455 + 'dgfcjxmax' : {required : true,number : true,digits: true},// 低谷最大发车间隔.
  456 + 'jbclcount': {required : true,number : true,digits: true}, // 建议加班车数
  457 + 'upTravelTime' : {required : true,number : true},// 上行行驶时间,必填项、必须为整数.
  458 + 'downTravelTime' : {required : true,number : true},// 下行行驶时间,必填项、必须为整数.
  459 + 'upMileage' : {required : true,number : true},// 上行行驶里程,必填项、必须为整数.
  460 + 'downMileage' : {required : true,number : true},// 下行行驶里程,必填项、必须为整数.
  461 + 'upInMileage' : {number : true},// 上行进场里程,必须为数字.
  462 + 'upOutMileage' : {number : true},// 上行出场里程,必须为数字.
  463 + 'downInMileage' : {number : true},// 下行进场里程,必须为数字.
  464 + 'downOutMileage' : {number : true}// 下行出场里程,必须为数字.
  465 +
  466 + // TODO
  467 + },
  468 + invalidHandler : function(event, validator) {
  469 + paramAlert.show();
  470 + App.scrollTo(paramAlert, -200);
  471 + },
  472 + highlight : function(element) {
  473 + $(element).closest('.form-group').addClass('has-error');
  474 + },
  475 + unhighlight : function(element) {
  476 + $(element).closest('.form-group').removeClass('has-error');
  477 + },
  478 + success : function(label) {
  479 + label.closest('.form-group').removeClass('has-error');
  480 + },
  481 + submitHandler : function(f) {
  482 + // 1、 获取表单内容,并序列化
  483 + var fp = form.serializeJSON();
  484 +
  485 + console.log(fp);
  486 +
  487 + // 2、重新刷新表单数据
  488 + var ganttMap = JSON.parse(window.localStorage.Gantt_AgursData);
  489 + var key;
  490 + for (key in fp) {
  491 + if (ganttMap[key]) {
  492 + if (ganttMap[key] != fp[key]) {
  493 + ganttMap[key] = fp[key];
  494 + }
  495 + } else {
  496 + ganttMap[key] = fp[key];
  497 + }
  498 + }
  499 + window.localStorage.setItem("Gantt_AgursData",JSON.stringify(ganttMap));
  500 +
  501 + // TODO
  502 + var pp = getParamObjAndDataMap();
  503 + var paramObj = pp[0];
  504 + var dataMap = pp[1];
  505 + var csMap = getCSMap(paramObj);
  506 + // console.log(graph);
  507 + var data = Main_v2.BXPplaceClassesTime03(paramObj, csMap.maxCar);
  508 + Main_v2.exportDataConfig(data.aInternalLpObj);
  509 +
  510 + // var data = obj.getDataArray();
  511 + // // 2、 调整路牌对应的班次总数
  512 + // updFormParams(params,data);
  513 + // 删除图形.
  514 + $('svg.svg-chart').remove();
  515 + // 重新创建图形.
  516 + var graph = d3.select('#ganttSvg').relationshipGraph(getGraphArgus(csMap, dataMap, data));
  517 + // 根据数据重新渲染图形.
  518 + graph.data(data.json);
  519 + // 记录早操.并保存历史班次数据
  520 + graph.addHistory();
  521 + // 隐藏错误提示
  522 + paramAlert.hide();
  523 + // 隐藏 reladplus_mobal 弹出层
  524 + $('#paramadd_mobal').modal('hide');
  525 + layer.msg('成功!');
  526 + }
  527 + });
  528 +
  529 +
  530 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  531 + $('#paramadd_mobal').on('show.bs.modal', function () {
  532 + // TODO
  533 + // 把数据填充到模版中
  534 + // var tbodyHtml = template('countAdd_temp',{list:countDate});
  535 + // // 把渲染好的模版html文本追加到表格中
  536 + // $('#datatable_countadd tbody').html(tbodyHtml);
  537 + var htmldata = template('paramAdd_temp', {map : param});
  538 + $('#ptab').html(htmldata);
  539 +
  540 + // 线路规划类型
  541 + $('#linePlayType_id').val(param.linePlayType);
  542 + // 吃饭地点
  543 + $get('/stationroute/all', {
  544 + 'line.id_eq': param.lineName.split('_')[0],
  545 + 'destroy_eq': 0,
  546 + 'versions_eq': param.lineVersion},
  547 + function(result) {
  548 + var opt = [];
  549 + opt.push('<option value="">请选择...</option>');
  550 + $.each(result, function(i, d) {
  551 + if (d.stationMark == 'B' && d.directions == 0) {
  552 + opt.push("<option value='0'>" + d.stationName + "</option>");
  553 + } else if (d.stationMark == 'E' && d.directions == 0) {
  554 + opt.push("<option value='1'>" + d.stationName + "</option>");
  555 + }
  556 + });
  557 + initTagsinput(opt.join(","));
  558 +
  559 + opt.push("<option value='allYes'>起终点站都可以</option>");
  560 + $('#cfdd_id').html(opt.join(""));
  561 + $('#cfdd_id').val(param.cfdd);
  562 +
  563 + }
  564 + );
  565 + // 停车场
  566 + $get('/carpark/all',null, function(cd) {
  567 + var opt = [];
  568 + opt.push('<option value="">请选择...</option><optgroup label="停车场">');
  569 + var $_len = cd.length;
  570 + if($_len > 0) {
  571 + $.each(cd, function(i, d){
  572 + opt.push('<option value="'+d.parkCode+'">'+d.parkName+'</option>');
  573 + });
  574 + }
  575 + opt.push('</optgroup>');
  576 + $('#carPark_id').html(opt.join(",")).select2();
  577 + $('#carPark_id').select2("val", param.carPark);
  578 + });
  579 +
  580 + // 上下行首末班日期控件
  581 + $('#startStationFirstTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  582 + $('#startStationEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  583 + $('#endStationFirstTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  584 + $('#endStationEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  585 +
  586 + // 早高峰晚高峰日期控件
  587 + $('#earlyStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  588 + $('#earlyEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  589 + $('#lateStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  590 + $('#lateEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  591 +
  592 + });
  593 + });
  594 +
  595 + function initTagsinput(htmlStr) {
  596 + $('#masterStop_id').html(htmlStr);
  597 +
  598 + var elt = $('#stoptype_tagsinput');
  599 + var value = elt.val();
  600 + var stoptype = value.split("/")[0];
  601 + var masterstop = value.split("/")[1];
  602 +
  603 + $('#stopType_id').val(stoptype);
  604 + $('#masterStop_id').val(masterstop);
  605 +
  606 + elt.tagsinput({
  607 + tagClass: function(item) {
  608 + return 'label label-danger label-important';
  609 + },
  610 + itemValue: 'value',
  611 + itemText: 'text'
  612 + });
  613 +
  614 + $('#stoptype_tagsinput').on('beforeItemAdd', function(event) {
  615 + // TODO:这里可以做一些逻辑判定
  616 + });
  617 +
  618 + $('#stoptype_tagsinput_add').on('click', function(){
  619 + var stoptype = $("#stopType_id").val();
  620 + var masterstop = $("#masterStop_id").val();
  621 + var masterstop_text = $("#masterStop_id option:selected").text();
  622 +
  623 + if (stoptype && stoptype != "") {
  624 + if (stoptype == "0" && masterstop && masterstop != "") {
  625 + elt.tagsinput('add', {
  626 + "value": stoptype + '/' + masterstop,
  627 + "text": "主站停站" + "/" + masterstop_text
  628 + });
  629 + } else {
  630 + elt.tagsinput('add', {
  631 + "value": 1,
  632 + "text": "双向停站"
  633 + });
  634 + }
  635 + }
  636 + });
  637 +
  638 + if (stoptype && stoptype != "") {
  639 + elt.tagsinput('add', {
  640 + "value": stoptype + '/' + masterstop,
  641 + "text":
  642 + $("#stopType_id option:selected").text() + "/" +
  643 + $("#masterStop_id option:selected").text()
  644 + });
  645 + }
  646 +
  647 + }
  648 +
  649 + function getMinDate(d1,d2) {
  650 + // 1、定义返回字符串.
  651 + var str = '';
  652 + // 2、判断时间大小.
  653 + if(strToTime(d1)>strToTime(d2))
  654 + str = d2;
  655 + else
  656 + str = d1;
  657 + // 3、返回最小时间(字符串).
  658 + return str;
  659 + }
  660 +
  661 + function strToTime(t) {
  662 + var d = new Date();
  663 + if(t) {
  664 + var _str = t.split(':');
  665 + d.setHours(parseInt(_str[0]));
  666 + d.setMinutes(parseInt(_str[1]));
  667 + }
  668 + return d;
  669 + }
  670 +
  671 + function getMaxDate(d1,d2) {
  672 + // 1、定义返回时间字符串.
  673 + var str = '';
  674 + // 2、判断时间大小.
  675 + if(strToTime(d1)>strToTime(d2))
  676 + str = d1;
  677 + else
  678 + str = d2;
  679 + // 3、返回一个最大时间(字符串).
  680 + return str;
  681 + }
  682 +
  683 + function getEndDate(date) {
  684 + var lastEndDate = Date.now();
  685 + if (date) {
  686 + var str = date.replace(/-/g,"/");
  687 + lastEndDate = new Date(str);
  688 + }
  689 + // Wed Oct 26 2016 00:00:00 GMT+0800 (中国标准时间)
  690 + return lastEndDate;
  691 + }
  692 +
  693 + function formatPairing(v1,v2) {
  694 + v1 = v1 == '' ? 0 : parseInt(v1);
  695 + v2 = v2 == ''? 0 : parseInt(v2) ;
  696 + return [v1,v2];
  697 + }
  698 +
  699 + function qzdz(zd1,zd2) {
  700 + return [zd1,zd2];
  701 + }
  702 +
  703 + function formatksjssj(gp) {
  704 + return [{'kssj':gp.startStationFirstTime,'jssj':gp.startStationEndTime},{'kssj':gp.endStationFirstTime,'jssj':gp.endStationEndTime}];
  705 + }
  706 +
  707 + function getsd(st,ed) {
  708 + return [{'st':st,'ed':ed}];
  709 + }
  710 +
  711 + function getDateTime(time) {
  712 + var dateTime = new Date();
  713 + var timeArr;
  714 + if(time !=null && time !='' && typeof(time) !='undefined') {
  715 + timeArr = time.split(':');
  716 + dateTime.setHours(parseInt(timeArr[0]));
  717 + dateTime.setMinutes(parseInt(timeArr[1]));
  718 + }
  719 + return dateTime;
  720 + }
  721 +
  722 + function getYAxisCarArray(len) {
  723 + var array = new Array();
  724 + if(len>0) {
  725 + for(var y = 0; y<len; y++) {
  726 + array.push({lp:null,lpNo:y+1, parent :y+1, lpName:y+1,lpType:'普通路牌'});//添加一个路牌对象
  727 + };
  728 + }
  729 + return array;
  730 + }
  731 +
  732 + function getylp(arr) {
  733 + var ra = new Array(),name = new Array();
  734 + for(var i = 0 ; i<arr.length;i++) {
  735 + ra.push(arr[i].lpNo);
  736 + name.push(arr[i].lpName);
  737 + }
  738 + return {'lpNoA':ra,'lpNameA':name,};
  739 + }
  740 +
  741 + function getParamObjAndDataMap() {
  742 + var map = JSON.parse(window.localStorage.Gantt_AgursData);
  743 + // seMap
  744 + var seMap = {'s': map.linePlayType == '1' ? map.startStationFirstTime : getMinDate(map.startStationFirstTime,map.endStationFirstTime),
  745 + 'e': map.linePlayType == '1' ? map.startStationEndTime : getMaxDate(map.startStationEndTime,map.endStationEndTime)};
  746 + // dirA
  747 + var dirA = ['relationshipGraph-up', 'relationshipGraph-down'];
  748 + // bcTypeArr
  749 + var bcTypeArr = {
  750 + 'bd': 'bd', 'out': 'out', 'normal': 'normal', 'cf': 'cf', 'in_': 'in', 'lc': 'lc',
  751 + 'major': 'major', 'venting': 'venting', 'region': 'region'
  752 + };
  753 + // seDate
  754 + var newDate = new Date();
  755 + var kssj = d3.time.hour.offset(getEndDate(
  756 + newDate.getFullYear()+ "-" +
  757 + (newDate.getMonth()+1) + "-" +
  758 + newDate.getDate() + ' ' +
  759 + seMap.s.split(':')[0] + ':00'),-1);
  760 +
  761 + var year = '' , month = '',dt = '';
  762 + if(newDate.getDate()+1>31)
  763 + dt = '01';
  764 + else
  765 + dt = newDate.getDate()+1;
  766 + if(newDate.getMonth()+1>12)
  767 + month = '01';
  768 + else if(newDate.getDate()+1>31)
  769 + month = newDate.getMonth()+2;
  770 + else
  771 + month = newDate.getMonth()+1;
  772 + if(newDate.getMonth()+1>12)
  773 + year = newDate.getFullYear()+1;
  774 + else
  775 + year = newDate.getFullYear();
  776 + var jssj = getEndDate(year + '-' + month + '-' + dt + ' ' + '00:00');
  777 + seDate = {'kssj' : kssj, 'jssj' : jssj};
  778 +
  779 + // dataMap
  780 + var dataMap = {'jcsjArr' : formatPairing(map.upInTimer,map.downInTimer),// 进场里程。[下标0代表上;下标1代表下]
  781 + 'ccsjArr' : formatPairing(map.upOutTimer,map.downOutTimer),// 出场时间。[下标0代表上;下标1代表下]
  782 + 'jclcArr' : formatPairing(map.upInMileage,map.downInMileage),// 进场里程。[下标0代表上;下标1代表下]
  783 + 'cclcArr' : formatPairing(map.upOutMileage,map.downOutMileage),// 出场里程。[下标0代表上;下标1代表下]
  784 + 'pcxssjArr' : formatPairing(map.upTravelTime,map.downTravelTime),// 平常行驶时间。[下标0代表上;下标1代表下]
  785 + 'gfxxsjArr' : formatPairing(map.lateUpTime=='' ? map.upTravelTime : map.lateUpTime,
  786 + map.lateDownTime=='' ? map.downTravelTime : map.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下]
  787 + 'dgxxsjArr' : formatPairing(map.troughUpTime=='' ? map.upTravelTime : map.troughUpTime,
  788 + map.troughDownTime=='' ? map.downTravelTime : map.troughDownTime),// 低谷行驶时间。[下标0代表上;下标1代表下]
  789 + 'pcxslcArr' : formatPairing(map.upMileage,map.downMileage),// 行驶里程。[下标0代表上;下标1代表下]
  790 + 'qdzArr' : qzdz(map.up_s.split('_')[0],map.down_s.split('_')[0]),// 起始站。[下标0代表上;下标1代表下]
  791 + 'zdzArr':qzdz(map.up_s.split('_')[1],map.down_s.split('_')[1]),// 终点站。[下标0代表上;下标1代表下]
  792 + 'zwcArr' : formatPairing(map.workeLunch,map.workeDinner),// 午晚餐时间。[下标0代表午;下标1代表晚]
  793 + 'smbcsjArr' : formatksjssj(map), // 起终点站首末班车时间.[下标0代表起始站的首末班车时间;下标1代表终点站的首末班车时间]
  794 + 'zgfsjd' : getsd(getDateTime(map.earlyStartTime),
  795 + getDateTime(map.earlyEndTime)), // 早高峰时间段
  796 + 'wgfsjd' : getsd(getDateTime(map.lateStartTime),
  797 + getDateTime(map.lateEndTime)),// 晚高峰时间段
  798 + 'gfzjsjd' : getsd(getDateTime(map.earlyEndTime),
  799 + getDateTime(map.lateStartTime)),//高峰之间时间段.
  800 + 'wgfzhsjd' : getsd(getDateTime(map.lateEndTime),
  801 + getDateTime(seMap.e)),// 晚高峰之后时间段
  802 + 'zgfzqsjd': getsd(getDateTime(seMap.s),
  803 + getDateTime(map.earlyStartTime)),//早高峰之前时间段.
  804 + 'dira' : dirA,// 方向集合 [下标0代表上;下标1代表下]
  805 + 'bcTypeArr' : bcTypeArr,// 班次类型
  806 + 'lbsj' : map.lb=='' ? 0:parseInt(map.lb),// 例保时间.
  807 + // 'minztjx' : parseInt(gatps.mixstopTime), // 最小停站时间.
  808 + // 'ztjxA' : BaseFun.formatPairing(gatps.upStopTime,gatps.downStopTime), // 停站时间.
  809 + // 'maxztjx' : parseInt(gatps.maxstopTime), // 最大停站时间.
  810 + 'gftzsj': formatPairing(map.gfupStopTime,map.gfdownStopTime),// 高峰停站时间.
  811 + 'dgtzsj' : formatPairing(map.dgupStopTime,map.dgdownStopTime),// 低谷停站时间.
  812 + 'dgmaxtzsj' : parseInt(map.dgmaxtzsj),// 低谷最大停站时间.
  813 + 'dgmaxfcjx' : parseInt(map.dgmaxfcjx),// 低谷最大发车间隙.
  814 + 'map' : map,
  815 + 'zzsj':map.zzsj,// 周转时间.
  816 + };
  817 +
  818 + var _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap);
  819 + map.clzs = _paramObj.calcuClzx();
  820 + return [_paramObj, dataMap];
  821 +
  822 + }
  823 +
  824 + function getCSMap(parmObj) {
  825 + var map = JSON.parse(window.localStorage.Gantt_AgursData);
  826 + return {'gattA':null,
  827 + 'fcjx': {'gffcjx': Math.round(parmObj.calcuPeakZzsj()/parmObj.calcuClzx()) ,
  828 + 'dgfcjx': Math.round(parmObj.calcuTroughZzsj()/parmObj.calcuClzx()),
  829 + 'dgmaxfcjx' : parseInt(map.dgmaxfcjx)},
  830 + 'maxCar':getYAxisCarArray(parseInt(parmObj.calcuClzx()))};
  831 + }
  832 +
  833 + function getGraphArgus(CSMap, dataMap, data) {
  834 + // TODO
  835 + var map = JSON.parse(window.localStorage.Gantt_AgursData);
  836 + var sxsj = parseInt(map.upTravelTime);// 上行时间.
  837 +
  838 + // seMap
  839 + var seMap = {'s': map.linePlayType == '1' ? map.startStationFirstTime : getMinDate(map.startStationFirstTime,map.endStationFirstTime),
  840 + 'e': map.linePlayType == '1' ? map.startStationEndTime : getMaxDate(map.startStationEndTime,map.endStationEndTime)};
  841 +
  842 + // seDate
  843 + var newDate = new Date();
  844 + var kssj = d3.time.hour.offset(getEndDate(
  845 + newDate.getFullYear()+ "-" +
  846 + (newDate.getMonth()+1) + "-" +
  847 + newDate.getDate() + ' ' +
  848 + seMap.s.split(':')[0] + ':00'),-1);
  849 +
  850 + var year = '' , month = '',dt = '';
  851 + if(newDate.getDate()+1>31)
  852 + dt = '01';
  853 + else
  854 + dt = newDate.getDate()+1;
  855 + if(newDate.getMonth()+1>12)
  856 + month = '01';
  857 + else if(newDate.getDate()+1>31)
  858 + month = newDate.getMonth()+2;
  859 + else
  860 + month = newDate.getMonth()+1;
  861 + if(newDate.getMonth()+1>12)
  862 + year = newDate.getFullYear()+1;
  863 + else
  864 + year = newDate.getFullYear();
  865 + var jssj = getEndDate(year + '-' + month + '-' + dt + ' ' + '00:00');
  866 + seDate = {'kssj' : kssj, 'jssj' : jssj};
  867 +
  868 +
  869 + var bs = sxsj > 40 ? 4 : 2;
  870 + var MULTIPLE = Math.round(105/sxsj) >3 ? Math.round(90/sxsj) : Math.round(90/sxsj) *bs;
  871 + var VALUEKEYNAME = 'Worldwide Gross' ,
  872 + DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = CSMap.maxCar.length*60 + 240,
  873 + MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60,
  874 + STARTDATETIME = seDate.kssj ,ENDDATETIME = seDate.jssj ,TASKTYPES =CSMap.maxCar ,TICKFORMAT ='%H:%M' ,SHOWTOOLTIPS = true;
  875 + var dx_time = seDate.jssj.getTime() - seDate.kssj.getTime() ;
  876 + // 计算出相差天数
  877 + var days=Math.floor(dx_time/(24*3600*1000));
  878 + // 计算出小时数
  879 + var leave1=dx_time%(24*3600*1000); //计算天数后剩余的毫秒数
  880 + var hours=Math.floor(leave1/(3600*1000));
  881 + DXHOURS = days*24+hours;
  882 + WIDTH = DXHOURS*MINUTE*MULTIPLE;
  883 + // debugger;
  884 + var lpsplitA = getylp(CSMap.maxCar);
  885 +
  886 + var sxsj = parseInt(map.upTravelTime);// 上行时间.
  887 + var xxsj = parseInt(map.downTravelTime);// 下行时间.
  888 + var stopAraay = [{
  889 + 'sxsj':sxsj,// 上行时间.
  890 + 'xxsj':xxsj,// 下行时间.
  891 + 'zzsj':map.zzsj,// 周转时间.
  892 + 'wcsj':parseInt(map.workeLunch),// 午餐时间.
  893 + 'wcsj':parseInt(map.workeDinner),// 晚餐时间.
  894 + 'zgfsxsj':map.earlyUpTime==''? sxsj : parseInt(map.earlyUpTime),// 早高峰上行行驶时间.
  895 + 'zgfxxsj':map.earlyDownTime=='' ? xxsj : parseInt(map.earlyDownTime),// 早高峰下行行驶时间.
  896 + 'wgfsxsj':map.lateUpTime=='' ? sxsj : parseInt(map.lateUpTime),// 晚高峰上行行驶时间.
  897 + 'wgfxxsj':map.lateDownTime== '' ? xxsj: parseInt(map.lateDownTime),// 晚高峰下行行驶时间.
  898 + 'sxjcsj':map.upInTimer == '' ? 0 : parseInt(map.upInTimer),// 上行进场时间.
  899 + 'sxccsj':map.upOutTimer == '' ? 0 : parseInt(map.upOutTimer),// 上行出场时间.
  900 + 'xxjcsj':map.downInTimer =='' ? 0 : parseInt(map.downInTimer),// 下行进场时间.
  901 + 'xxccsj':map.downOutTimer =='' ? 0 : parseInt(map.downOutTimer),// 下行进场时间.
  902 + 'sxjclc':map.upInMileage==''? 0 : parseInt(map.upInMileage),// 上行进场里程.
  903 + 'sxcclc':map.upOutMileage==''? 0:parseInt(map.upOutMileage),// 上行出场里程.
  904 + 'xxjclc':map.downInMileage==''? 0 : parseInt(map.downInMileage),// 下行进场里程.
  905 + 'xxcclc':map.downOutMileage==''?0:parseInt(map.downOutMileage),// 下行出场里程.
  906 + 'lbsj': map.lb==''? 0 : parseInt(map.lb) // 例保时间.
  907 + }];
  908 +
  909 + var args = {
  910 + 'valueKeyName': VALUEKEYNAME,
  911 + 'hours' : DXHOURS,
  912 + 'dxHours' : 24 - DXHOURS,
  913 + 'multiple': MULTIPLE,
  914 + 'width':WIDTH,
  915 + 'widtMargin':MARGINLEFT,
  916 + 'height':HEIGHT,
  917 + 'heightMargin':MARGINBOTTOM,
  918 + 'offsetX':OFFSETX,
  919 + 'offsetY':OFFSETY,
  920 + 'downDy':OFFSETDOWNY,
  921 + 'upDy':OFFSETUPY,
  922 + 'timeDomainStart' :STARTDATETIME,
  923 + 'timeDomainEnd' : ENDDATETIME,
  924 + 'startStr':'' + STARTDATETIME,
  925 + 'endStr': '' +ENDDATETIME,
  926 + 'taskTypes': TASKTYPES,
  927 + 'lpNoA':lpsplitA.lpNoA,
  928 + 'lpNameA':lpsplitA.lpNameA,
  929 + 'tickFormat': TICKFORMAT,
  930 + 'stopAraay' : stopAraay,
  931 + 'dataMap':dataMap,
  932 + 'showTooltips': SHOWTOOLTIPS,
  933 + 'bxrcgs':data.bxrcgs
  934 + }
  935 + return args;
  936 + }
937 937 </script>
938 938 \ No newline at end of file
... ...
src/main/resources/static/pages/control/ddyerror_log/ddyerror_wrap.html
1   -<!-- 调度员异常操作 -->
2   -<iframe id="e_ddy_error_frame" frameborder="0" style="height: 100%;width: 100%;"></iframe>
3   -
4   -<script>
5   - (function () {
6   - var url;
7   - var userName = $('#indexTopUName').text();
8   -
9   - var prefix = userName.substr(0, 2);
10   -
11   - if(prefix=='nh' || prefix=='NH')
12   - url = 'http://116.236.141.38:8082/pages/monitoring/form/ddyerror_nh.html';
13   - else //if(prefix=='jg' || prefix=='JG')
14   - url = 'http://180.168.57.114:8082/pages/monitoring/form/ddyerror_v3.html';
15   - //else{
16   - //alert('') 默认就金高吧
17   -
18   - //}
19   -
20   - var psw = md5(userName + '123');
21   - url = (url + "?ddy=" + userName + "&psw=" + psw);
22   - $('#e_ddy_error_frame').attr('src', url);
23   -
24   - function md5(string) {
25   - function md5_RotateLeft(lValue, iShiftBits) {
26   - return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
27   - }
28   - function md5_AddUnsigned(lX, lY) {
29   - var lX4, lY4, lX8, lY8, lResult;
30   - lX8 = (lX & 0x80000000);
31   - lY8 = (lY & 0x80000000);
32   - lX4 = (lX & 0x40000000);
33   - lY4 = (lY & 0x40000000);
34   - lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
35   - if (lX4 & lY4) {
36   - return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
37   - }
38   - if (lX4 | lY4) {
39   - if (lResult & 0x40000000) {
40   - return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
41   - } else {
42   - return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
43   - }
44   - } else {
45   - return (lResult ^ lX8 ^ lY8);
46   - }
47   - }
48   - function md5_F(x, y, z) {
49   - return (x & y) | ((~x) & z);
50   - }
51   - function md5_G(x, y, z) {
52   - return (x & z) | (y & (~z));
53   - }
54   - function md5_H(x, y, z) {
55   - return (x ^ y ^ z);
56   - }
57   - function md5_I(x, y, z) {
58   - return (y ^ (x | (~z)));
59   - }
60   - function md5_FF(a, b, c, d, x, s, ac) {
61   - a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_F(b, c, d), x), ac));
62   - return md5_AddUnsigned(md5_RotateLeft(a, s), b);
63   - };
64   - function md5_GG(a, b, c, d, x, s, ac) {
65   - a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_G(b, c, d), x), ac));
66   - return md5_AddUnsigned(md5_RotateLeft(a, s), b);
67   - };
68   - function md5_HH(a, b, c, d, x, s, ac) {
69   - a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_H(b, c, d), x), ac));
70   - return md5_AddUnsigned(md5_RotateLeft(a, s), b);
71   - };
72   - function md5_II(a, b, c, d, x, s, ac) {
73   - a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_I(b, c, d), x), ac));
74   - return md5_AddUnsigned(md5_RotateLeft(a, s), b);
75   - };
76   - function md5_ConvertToWordArray(string) {
77   - var lWordCount;
78   - var lMessageLength = string.length;
79   - var lNumberOfWords_temp1 = lMessageLength + 8;
80   - var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
81   - var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
82   - var lWordArray = Array(lNumberOfWords - 1);
83   - var lBytePosition = 0;
84   - var lByteCount = 0;
85   - while (lByteCount < lMessageLength) {
86   - lWordCount = (lByteCount - (lByteCount % 4)) / 4;
87   - lBytePosition = (lByteCount % 4) * 8;
88   - lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
89   - lByteCount++;
90   - }
91   - lWordCount = (lByteCount - (lByteCount % 4)) / 4;
92   - lBytePosition = (lByteCount % 4) * 8;
93   - lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
94   - lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
95   - lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
96   - return lWordArray;
97   - };
98   - function md5_WordToHex(lValue) {
99   - var WordToHexValue = "",
100   - WordToHexValue_temp = "",
101   - lByte, lCount;
102   - for (lCount = 0; lCount <= 3; lCount++) {
103   - lByte = (lValue >>> (lCount * 8)) & 255;
104   - WordToHexValue_temp = "0" + lByte.toString(16);
105   - WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
106   - }
107   - return WordToHexValue;
108   - };
109   - function md5_Utf8Encode(string) {
110   - string = string.replace(/\r\n/g, "\n");
111   - var utftext = "";
112   - for (var n = 0; n < string.length; n++) {
113   - var c = string.charCodeAt(n);
114   - if (c < 128) {
115   - utftext += String.fromCharCode(c);
116   - } else if ((c > 127) && (c < 2048)) {
117   - utftext += String.fromCharCode((c >> 6) | 192);
118   - utftext += String.fromCharCode((c & 63) | 128);
119   - } else {
120   - utftext += String.fromCharCode((c >> 12) | 224);
121   - utftext += String.fromCharCode(((c >> 6) & 63) | 128);
122   - utftext += String.fromCharCode((c & 63) | 128);
123   - }
124   - }
125   - return utftext;
126   - };
127   - var x = Array();
128   - var k, AA, BB, CC, DD, a, b, c, d;
129   - var S11 = 7,
130   - S12 = 12,
131   - S13 = 17,
132   - S14 = 22;
133   - var S21 = 5,
134   - S22 = 9,
135   - S23 = 14,
136   - S24 = 20;
137   - var S31 = 4,
138   - S32 = 11,
139   - S33 = 16,
140   - S34 = 23;
141   - var S41 = 6,
142   - S42 = 10,
143   - S43 = 15,
144   - S44 = 21;
145   - string = md5_Utf8Encode(string);
146   - x = md5_ConvertToWordArray(string);
147   - a = 0x67452301;
148   - b = 0xEFCDAB89;
149   - c = 0x98BADCFE;
150   - d = 0x10325476;
151   - for (k = 0; k < x.length; k += 16) {
152   - AA = a;
153   - BB = b;
154   - CC = c;
155   - DD = d;
156   - a = md5_FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
157   - d = md5_FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
158   - c = md5_FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
159   - b = md5_FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
160   - a = md5_FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
161   - d = md5_FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
162   - c = md5_FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
163   - b = md5_FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
164   - a = md5_FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
165   - d = md5_FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
166   - c = md5_FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
167   - b = md5_FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
168   - a = md5_FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
169   - d = md5_FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
170   - c = md5_FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
171   - b = md5_FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
172   - a = md5_GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
173   - d = md5_GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
174   - c = md5_GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
175   - b = md5_GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
176   - a = md5_GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
177   - d = md5_GG(d, a, b, c, x[k + 10], S22, 0x2441453);
178   - c = md5_GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
179   - b = md5_GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
180   - a = md5_GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
181   - d = md5_GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
182   - c = md5_GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
183   - b = md5_GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
184   - a = md5_GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
185   - d = md5_GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
186   - c = md5_GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
187   - b = md5_GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
188   - a = md5_HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
189   - d = md5_HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
190   - c = md5_HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
191   - b = md5_HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
192   - a = md5_HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
193   - d = md5_HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
194   - c = md5_HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
195   - b = md5_HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
196   - a = md5_HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
197   - d = md5_HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
198   - c = md5_HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
199   - b = md5_HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
200   - a = md5_HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
201   - d = md5_HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
202   - c = md5_HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
203   - b = md5_HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
204   - a = md5_II(a, b, c, d, x[k + 0], S41, 0xF4292244);
205   - d = md5_II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
206   - c = md5_II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
207   - b = md5_II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
208   - a = md5_II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
209   - d = md5_II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
210   - c = md5_II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
211   - b = md5_II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
212   - a = md5_II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
213   - d = md5_II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
214   - c = md5_II(c, d, a, b, x[k + 6], S43, 0xA3014314);
215   - b = md5_II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
216   - a = md5_II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
217   - d = md5_II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
218   - c = md5_II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
219   - b = md5_II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
220   - a = md5_AddUnsigned(a, AA);
221   - b = md5_AddUnsigned(b, BB);
222   - c = md5_AddUnsigned(c, CC);
223   - d = md5_AddUnsigned(d, DD);
224   - }
225   - return (md5_WordToHex(a) + md5_WordToHex(b) + md5_WordToHex(c) + md5_WordToHex(d)).toLowerCase();
226   - }
227   - })();
  1 +<!-- 调度员异常操作 -->
  2 +<iframe id="e_ddy_error_frame" frameborder="0" style="height: 100%;width: 100%;"></iframe>
  3 +
  4 +<script>
  5 + (function () {
  6 + var url;
  7 + var userName = $('#indexTopUName').text();
  8 +
  9 + var prefix = userName.substr(0, 2);
  10 +
  11 + if(prefix=='nh' || prefix=='NH')
  12 + url = 'http://116.236.141.38:8082/pages/monitoring/form/ddyerror_nh.html';
  13 + else //if(prefix=='jg' || prefix=='JG')
  14 + url = 'http://180.168.57.114:8082/pages/monitoring/form/ddyerror_v3.html';
  15 + //else{
  16 + //alert('') 默认就金高吧
  17 +
  18 + //}
  19 +
  20 + var psw = md5(userName + '123');
  21 + url = (url + "?ddy=" + userName + "&psw=" + psw);
  22 + $('#e_ddy_error_frame').attr('src', url);
  23 +
  24 + function md5(string) {
  25 + function md5_RotateLeft(lValue, iShiftBits) {
  26 + return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
  27 + }
  28 + function md5_AddUnsigned(lX, lY) {
  29 + var lX4, lY4, lX8, lY8, lResult;
  30 + lX8 = (lX & 0x80000000);
  31 + lY8 = (lY & 0x80000000);
  32 + lX4 = (lX & 0x40000000);
  33 + lY4 = (lY & 0x40000000);
  34 + lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
  35 + if (lX4 & lY4) {
  36 + return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
  37 + }
  38 + if (lX4 | lY4) {
  39 + if (lResult & 0x40000000) {
  40 + return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
  41 + } else {
  42 + return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
  43 + }
  44 + } else {
  45 + return (lResult ^ lX8 ^ lY8);
  46 + }
  47 + }
  48 + function md5_F(x, y, z) {
  49 + return (x & y) | ((~x) & z);
  50 + }
  51 + function md5_G(x, y, z) {
  52 + return (x & z) | (y & (~z));
  53 + }
  54 + function md5_H(x, y, z) {
  55 + return (x ^ y ^ z);
  56 + }
  57 + function md5_I(x, y, z) {
  58 + return (y ^ (x | (~z)));
  59 + }
  60 + function md5_FF(a, b, c, d, x, s, ac) {
  61 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_F(b, c, d), x), ac));
  62 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  63 + };
  64 + function md5_GG(a, b, c, d, x, s, ac) {
  65 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_G(b, c, d), x), ac));
  66 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  67 + };
  68 + function md5_HH(a, b, c, d, x, s, ac) {
  69 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_H(b, c, d), x), ac));
  70 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  71 + };
  72 + function md5_II(a, b, c, d, x, s, ac) {
  73 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_I(b, c, d), x), ac));
  74 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  75 + };
  76 + function md5_ConvertToWordArray(string) {
  77 + var lWordCount;
  78 + var lMessageLength = string.length;
  79 + var lNumberOfWords_temp1 = lMessageLength + 8;
  80 + var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
  81 + var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
  82 + var lWordArray = Array(lNumberOfWords - 1);
  83 + var lBytePosition = 0;
  84 + var lByteCount = 0;
  85 + while (lByteCount < lMessageLength) {
  86 + lWordCount = (lByteCount - (lByteCount % 4)) / 4;
  87 + lBytePosition = (lByteCount % 4) * 8;
  88 + lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
  89 + lByteCount++;
  90 + }
  91 + lWordCount = (lByteCount - (lByteCount % 4)) / 4;
  92 + lBytePosition = (lByteCount % 4) * 8;
  93 + lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
  94 + lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
  95 + lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
  96 + return lWordArray;
  97 + };
  98 + function md5_WordToHex(lValue) {
  99 + var WordToHexValue = "",
  100 + WordToHexValue_temp = "",
  101 + lByte, lCount;
  102 + for (lCount = 0; lCount <= 3; lCount++) {
  103 + lByte = (lValue >>> (lCount * 8)) & 255;
  104 + WordToHexValue_temp = "0" + lByte.toString(16);
  105 + WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
  106 + }
  107 + return WordToHexValue;
  108 + };
  109 + function md5_Utf8Encode(string) {
  110 + string = string.replace(/\r\n/g, "\n");
  111 + var utftext = "";
  112 + for (var n = 0; n < string.length; n++) {
  113 + var c = string.charCodeAt(n);
  114 + if (c < 128) {
  115 + utftext += String.fromCharCode(c);
  116 + } else if ((c > 127) && (c < 2048)) {
  117 + utftext += String.fromCharCode((c >> 6) | 192);
  118 + utftext += String.fromCharCode((c & 63) | 128);
  119 + } else {
  120 + utftext += String.fromCharCode((c >> 12) | 224);
  121 + utftext += String.fromCharCode(((c >> 6) & 63) | 128);
  122 + utftext += String.fromCharCode((c & 63) | 128);
  123 + }
  124 + }
  125 + return utftext;
  126 + };
  127 + var x = Array();
  128 + var k, AA, BB, CC, DD, a, b, c, d;
  129 + var S11 = 7,
  130 + S12 = 12,
  131 + S13 = 17,
  132 + S14 = 22;
  133 + var S21 = 5,
  134 + S22 = 9,
  135 + S23 = 14,
  136 + S24 = 20;
  137 + var S31 = 4,
  138 + S32 = 11,
  139 + S33 = 16,
  140 + S34 = 23;
  141 + var S41 = 6,
  142 + S42 = 10,
  143 + S43 = 15,
  144 + S44 = 21;
  145 + string = md5_Utf8Encode(string);
  146 + x = md5_ConvertToWordArray(string);
  147 + a = 0x67452301;
  148 + b = 0xEFCDAB89;
  149 + c = 0x98BADCFE;
  150 + d = 0x10325476;
  151 + for (k = 0; k < x.length; k += 16) {
  152 + AA = a;
  153 + BB = b;
  154 + CC = c;
  155 + DD = d;
  156 + a = md5_FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
  157 + d = md5_FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
  158 + c = md5_FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
  159 + b = md5_FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
  160 + a = md5_FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
  161 + d = md5_FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
  162 + c = md5_FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
  163 + b = md5_FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
  164 + a = md5_FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
  165 + d = md5_FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
  166 + c = md5_FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
  167 + b = md5_FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
  168 + a = md5_FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
  169 + d = md5_FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
  170 + c = md5_FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
  171 + b = md5_FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
  172 + a = md5_GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
  173 + d = md5_GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
  174 + c = md5_GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
  175 + b = md5_GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
  176 + a = md5_GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
  177 + d = md5_GG(d, a, b, c, x[k + 10], S22, 0x2441453);
  178 + c = md5_GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
  179 + b = md5_GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
  180 + a = md5_GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
  181 + d = md5_GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
  182 + c = md5_GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
  183 + b = md5_GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
  184 + a = md5_GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
  185 + d = md5_GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
  186 + c = md5_GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
  187 + b = md5_GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
  188 + a = md5_HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
  189 + d = md5_HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
  190 + c = md5_HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
  191 + b = md5_HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
  192 + a = md5_HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
  193 + d = md5_HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
  194 + c = md5_HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
  195 + b = md5_HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
  196 + a = md5_HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
  197 + d = md5_HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
  198 + c = md5_HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
  199 + b = md5_HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
  200 + a = md5_HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
  201 + d = md5_HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
  202 + c = md5_HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
  203 + b = md5_HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
  204 + a = md5_II(a, b, c, d, x[k + 0], S41, 0xF4292244);
  205 + d = md5_II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
  206 + c = md5_II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
  207 + b = md5_II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
  208 + a = md5_II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
  209 + d = md5_II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
  210 + c = md5_II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
  211 + b = md5_II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
  212 + a = md5_II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
  213 + d = md5_II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
  214 + c = md5_II(c, d, a, b, x[k + 6], S43, 0xA3014314);
  215 + b = md5_II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
  216 + a = md5_II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
  217 + d = md5_II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
  218 + c = md5_II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
  219 + b = md5_II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
  220 + a = md5_AddUnsigned(a, AA);
  221 + b = md5_AddUnsigned(b, BB);
  222 + c = md5_AddUnsigned(c, CC);
  223 + d = md5_AddUnsigned(d, DD);
  224 + }
  225 + return (md5_WordToHex(a) + md5_WordToHex(b) + md5_WordToHex(c) + md5_WordToHex(d)).toLowerCase();
  226 + }
  227 + })();
228 228 </script>
229 229 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/historyMessage.html
1   -<style type="text/css">
2   - .table-bordered {
3   - border: 1px solid; }
4   - .table-bordered > thead > tr > th,
5   - .table-bordered > thead > tr > td,
6   - .table-bordered > tbody > tr > th,
7   - .table-bordered > tbody > tr > td,
8   - .table-bordered > tfoot > tr > th,
9   - .table-bordered > tfoot > tr > td {
10   - border: 1px solid; }
11   - .table-bordered > thead > tr > th,
12   - .table-bordered > thead > tr > td {
13   - border-bottom-width: 2px; }
14   -
15   - .table > tbody + tbody {
16   - border-top: 1px solid; }
17   -</style>
18   -
19   -<div class="page-head">
20   - <div class="page-title">
21   - <h1>调度历史消息</h1>
22   - </div>
23   -</div>
24   -
25   -<div class="row">
26   - <div class="col-md-12">
27   - <div class="portlet light porttlet-fit bordered">
28   - <div class="portlet-title">
29   - <form id="history" class="form-inline" action="">
30   - <div style="display: inline-block;">
31   - <span class="item-label" style="width: 80px;">线路: </span>
32   - <select class="form-control" name="line" id="line" style="width: 180px;"></select>
33   - </div>
34   - <div style="display: inline-block;margin-left: 15px;">
35   - <span class="item-label" style="width: 80px;">时间: </span>
36   - <input class="form-control" type="text" id="date" style="width: 180px;"/>
37   - </div>
38   - <div style="display: inline-block;margin-left: 15px">
39   - <span class="item-label" style="width: 140px;">内部编码: </span>
40   - <select class="form-control" name="code" id="code" style="width: 180px;"></select>
41   - </div>
42   - <div class="form-group">
43   - <input class="btn btn-default" type="button" id="query" value="筛选"/>
44   - <input class="btn btn-default" type="button" id="export" value="导出"/>
45   - </div>
46   - </form>
47   - </div>
48   - <div class="portlet-body">
49   - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;">
50   - <table class="table table-bordered table-hover table-checkable" id="forms">
51   - <thead>
52   - <tr class="hidden">
53   - <th>序号</th>
54   - <th>线路</th>
55   - <th>运营车辆</th>
56   - <th>发送人</th>
57   - <th>发送时间</th>
58   - <th>调度消息内容</th>
59   - </tr>
60   - </thead>
61   - <tbody>
62   -
63   - </tbody>
64   - </table>
65   - </div>
66   - </div>
67   - </div>
68   - </div>
69   -</div>
70   -
71   -<script>
72   - $(function(){
73   - $('#export').attr('disabled', "true");
74   -
75   - // 关闭左侧栏
76   - if (!$('body').hasClass('page-sidebar-closed'))
77   - $('.menu-toggler.sidebar-toggler').click();
78   -
79   - $("#date").datetimepicker({
80   - format : 'YYYY-MM-DD',
81   - locale : 'zh-cn'
82   - });
83   -
84   - $.get('/report/lineList',function(xlList){
85   - var data = [];
86   -// data.push({id: " ", text: "全部线路"});
87   - $.get('/user/companyData', function(result){
88   - for(var i = 0; i < result.length; i++){
89   - var companyCode = result[i].companyCode;
90   - var children = result[i].children;
91   - for(var j = 0; j < children.length; j++){
92   - var code = children[j].code;
93   - for(var k=0;k < xlList.length;k++ ){
94   - if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
95   - data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
96   -// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
97   - }
98   - }
99   - }
100   - }
101   - initPinYinSelect2('#line',data,'');
102   -
103   - });
104   - });
105   -
106   -
107   - $('#code').select2({
108   - ajax: {
109   - url: '/realSchedule/sreachVehic',
110   - dataType: 'json',
111   - delay: 150,
112   - data: function(params){
113   - return{nbbm: params.term};
114   - },
115   - processResults: function (data) {
116   - return {
117   - results: data
118   - };
119   - },
120   - cache: true
121   - },
122   - templateResult: function(repo){
123   - if (repo.loading) return repo.text;
124   - var h = '<span>'+repo.text+'</span>';
125   - h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
126   - return h;
127   - },
128   - escapeMarkup: function (markup) { return markup; },
129   - minimumInputLength: 1,
130   - templateSelection: function(repo){
131   - return repo.text;
132   - },
133   - language: {
134   - noResults: function(){
135   - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
136   - },
137   - inputTooShort : function(e) {
138   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
139   - },
140   - searching : function() {
141   - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
142   - }
143   - }
144   - });
145   -
146   - var line = $("#line").val();
147   - var date = $("#date").val();
148   - var code = $("#code").val();
149   - var lineName = $('#line option:selected').text();
150   - $("#query").on("click",function(){
151   - if($("#date").val() == null || $("#date").val().trim().length == 0){
152   - layer.msg("请选择时间");
153   - return;
154   - }
155   - line = $("#line").val();
156   - date = $("#date").val();
157   - code = $("#code").val();
158   - lineName = $('#line option:selected').text();
159   - var type = "query";
160   - $(".hidden").removeClass("hidden");
161   - var i = layer.load(2);
162   - $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){
163   - // 把数据填充到模版中
164   - var tbodyHtml = template('list_history',{list:result});
165   - // 把渲染好的模版html文本追加到表格中
166   - $('#forms tbody').html(tbodyHtml);
167   - layer.close(i);
168   -
169   - if(result.length == 0)
170   - $("#export").attr('disabled',"true");
171   - else
172   - $("#export").removeAttr("disabled");
173   -
174   - });
175   - });
176   -
177   - $("#export").on("click",function(){
178   - var type = "export";
179   - var i = layer.load(2);
180   - $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){
181   - window.open("/downloadFile/download?fileName="
182   - +moment(date).format("YYYYMMDD")
183   - +"-"+lineName+"-调度历史消息");
184   - layer.close(i);
185   - });
186   - });
187   -
188   - });
189   -</script>
190   -<script type="text/html" id="list_history">
191   - {{each list as obj i}}
192   - <tr>
193   - <td>{{i+1}}</td>
194   - <td>{{obj[4]}}</td>
195   - <td>{{obj[0]}}</td>
196   - <td>{{obj[1]}}</td>
197   - <td>{{obj[3]}}</td>
198   - <td>{{obj[2]}}</td>
199   - </tr>
200   - {{/each}}
201   - {{if list.length == 0}}
202   - <tr>
203   - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
204   - </tr>
205   - {{/if}}
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>调度历史消息</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">线路: </span>
  32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">时间: </span>
  36 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 15px">
  39 + <span class="item-label" style="width: 140px;">内部编码: </span>
  40 + <select class="form-control" name="code" id="code" style="width: 180px;"></select>
  41 + </div>
  42 + <div class="form-group">
  43 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  44 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  45 + </div>
  46 + </form>
  47 + </div>
  48 + <div class="portlet-body">
  49 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;">
  50 + <table class="table table-bordered table-hover table-checkable" id="forms">
  51 + <thead>
  52 + <tr class="hidden">
  53 + <th>序号</th>
  54 + <th>线路</th>
  55 + <th>运营车辆</th>
  56 + <th>发送人</th>
  57 + <th>发送时间</th>
  58 + <th>调度消息内容</th>
  59 + </tr>
  60 + </thead>
  61 + <tbody>
  62 +
  63 + </tbody>
  64 + </table>
  65 + </div>
  66 + </div>
  67 + </div>
  68 + </div>
  69 +</div>
  70 +
  71 +<script>
  72 + $(function(){
  73 + $('#export').attr('disabled', "true");
  74 +
  75 + // 关闭左侧栏
  76 + if (!$('body').hasClass('page-sidebar-closed'))
  77 + $('.menu-toggler.sidebar-toggler').click();
  78 +
  79 + $("#date").datetimepicker({
  80 + format : 'YYYY-MM-DD',
  81 + locale : 'zh-cn'
  82 + });
  83 +
  84 + $.get('/report/lineList',function(xlList){
  85 + var data = [];
  86 +// data.push({id: " ", text: "全部线路"});
  87 + $.get('/user/companyData', function(result){
  88 + for(var i = 0; i < result.length; i++){
  89 + var companyCode = result[i].companyCode;
  90 + var children = result[i].children;
  91 + for(var j = 0; j < children.length; j++){
  92 + var code = children[j].code;
  93 + for(var k=0;k < xlList.length;k++ ){
  94 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  95 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  96 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  97 + }
  98 + }
  99 + }
  100 + }
  101 + initPinYinSelect2('#line',data,'');
  102 +
  103 + });
  104 + });
  105 +
  106 +
  107 + $('#code').select2({
  108 + ajax: {
  109 + url: '/realSchedule/sreachVehic',
  110 + dataType: 'json',
  111 + delay: 150,
  112 + data: function(params){
  113 + return{nbbm: params.term};
  114 + },
  115 + processResults: function (data) {
  116 + return {
  117 + results: data
  118 + };
  119 + },
  120 + cache: true
  121 + },
  122 + templateResult: function(repo){
  123 + if (repo.loading) return repo.text;
  124 + var h = '<span>'+repo.text+'</span>';
  125 + h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
  126 + return h;
  127 + },
  128 + escapeMarkup: function (markup) { return markup; },
  129 + minimumInputLength: 1,
  130 + templateSelection: function(repo){
  131 + return repo.text;
  132 + },
  133 + language: {
  134 + noResults: function(){
  135 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  136 + },
  137 + inputTooShort : function(e) {
  138 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  139 + },
  140 + searching : function() {
  141 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  142 + }
  143 + }
  144 + });
  145 +
  146 + var line = $("#line").val();
  147 + var date = $("#date").val();
  148 + var code = $("#code").val();
  149 + var lineName = $('#line option:selected').text();
  150 + $("#query").on("click",function(){
  151 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  152 + layer.msg("请选择时间");
  153 + return;
  154 + }
  155 + line = $("#line").val();
  156 + date = $("#date").val();
  157 + code = $("#code").val();
  158 + lineName = $('#line option:selected').text();
  159 + var type = "query";
  160 + $(".hidden").removeClass("hidden");
  161 + var i = layer.load(2);
  162 + $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){
  163 + // 把数据填充到模版中
  164 + var tbodyHtml = template('list_history',{list:result});
  165 + // 把渲染好的模版html文本追加到表格中
  166 + $('#forms tbody').html(tbodyHtml);
  167 + layer.close(i);
  168 +
  169 + if(result.length == 0)
  170 + $("#export").attr('disabled',"true");
  171 + else
  172 + $("#export").removeAttr("disabled");
  173 +
  174 + });
  175 + });
  176 +
  177 + $("#export").on("click",function(){
  178 + var type = "export";
  179 + var i = layer.load(2);
  180 + $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){
  181 + window.open("/downloadFile/download?fileName="
  182 + +moment(date).format("YYYYMMDD")
  183 + +"-"+lineName+"-调度历史消息");
  184 + layer.close(i);
  185 + });
  186 + });
  187 +
  188 + });
  189 +</script>
  190 +<script type="text/html" id="list_history">
  191 + {{each list as obj i}}
  192 + <tr>
  193 + <td>{{i+1}}</td>
  194 + <td>{{obj[4]}}</td>
  195 + <td>{{obj[0]}}</td>
  196 + <td>{{obj[1]}}</td>
  197 + <td>{{obj[3]}}</td>
  198 + <td>{{obj[2]}}</td>
  199 + </tr>
  200 + {{/each}}
  201 + {{if list.length == 0}}
  202 + <tr>
  203 + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
  204 + </tr>
  205 + {{/if}}
206 206 </script>
207 207 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/statisticsDaily.html
... ... @@ -148,16 +148,6 @@
148 148 // 关闭左侧栏
149 149 if (!$('body').hasClass('page-sidebar-closed'))
150 150 $('.menu-toggler.sidebar-toggler').click();
151   -
152   - $("#date").datetimepicker({
153   - format : 'YYYY-MM-DD',
154   - locale : 'zh-cn'
155   - });
156   -
157   - $("#date2").datetimepicker({
158   - format : 'YYYY-MM-DD',
159   - locale : 'zh-cn'
160   - });
161 151 var d = new Date();
162 152 var year = d.getFullYear();
163 153 var month = d.getMonth() + 1;
... ... @@ -166,9 +156,22 @@
166 156 month = "0" + month;
167 157 if(day < 10)
168 158 day = "0" + day;
169   - $("#date").val(year + "-" + month + "-" + day);
170 159  
171   - $("#date2").val(year + "-" + month + "-" + day);
  160 + var dateTime=year + "-" + month + "-" + day;
  161 + $("#date").val(dateTime);
  162 + $("#date2").val(dateTime);
  163 + $("#date").datetimepicker({
  164 + format : 'YYYY-MM-DD',
  165 + locale : 'zh-cn',
  166 + maxDate : dateTime
  167 + });
  168 +
  169 + $("#date2").datetimepicker({
  170 + format : 'YYYY-MM-DD',
  171 + locale : 'zh-cn',
  172 + maxDate : dateTime
  173 + });
  174 +
172 175  
173 176 var fage=false;
174 177 var obj = [];
... ... @@ -274,8 +277,12 @@
274 277 if(line=="请选择"){
275 278 line="";
276 279 }
  280 + var time1 = Date.parse(new Date(date));
  281 + var time2 = Date.parse(new Date(date2));
277 282 if(date==null || date =="" ||date2==null || date2 ==""){
278 283 layer.msg('请选择时间段.');
  284 + }else if(time2<time1){
  285 + layer.msg('结束日期不能小于开始日期.');
279 286 }else{
280 287 $("#tjrq").html(date+"至"+date2);
281 288 var params = {};
... ...
src/main/resources/static/pages/forms/statement/statisticsDailyCalc2.html
... ... @@ -162,12 +162,10 @@
162 162 $("#date").datetimepicker({
163 163 format : 'YYYY-MM-DD',
164 164 locale : 'zh-cn',
165   - maxDate : dateTime
166 165 });
167 166 $("#date2").datetimepicker({
168 167 format : 'YYYY-MM-DD',
169 168 locale : 'zh-cn',
170   - maxDate : dateTime
171 169 });
172 170 $("#date").val(dateTime);
173 171 $("#date2").val(dateTime);
... ... @@ -291,7 +289,7 @@
291 289 params['type'] = "query";
292 290 var i = layer.load(2);
293 291 // $get('/realSchedule/statisticsDailyTj',params,function(result){
294   - $get('/calcWaybill/calcStatisticsDaily',params,function(result){
  292 + $get('/calcWaybill/calcStatisticsDaily2',params,function(result){
295 293 // 把数据填充到模版中
296 294 var tbodyHtml = template('statisticsDailyCalc2',{list:result});
297 295 // 把渲染好的模版html文本追加到表格中
... ... @@ -318,7 +316,7 @@
318 316 params['type'] = "export";
319 317 var i = layer.load(2);
320 318 // $get('/realSchedule/statisticsDailyTj',params,function(result){
321   - $get('/calcWaybill/calcStatisticsDaily',params,function(result){
  319 + $get('/calcWaybill/calcStatisticsDaily2',params,function(result){
322 320 var dateTime = "";
323 321 if(date == date2){
324 322 dateTime = moment(date).format("YYYYMMDD");
... ... @@ -339,44 +337,44 @@
339 337 <tr {{if obj.zt==1}}style='color: red'{{/if}}>
340 338 <td>{{obj.xlName}}</td>
341 339 <td>{{obj.jhzlc}}</td>
342   - <td>{{obj.jhyylc}}</td>
343   - <td>{{obj.jhkslc}}</td>
344   - <td>{{obj.sjzlc}}</td>
345   - <td>{{obj.sjyylc}}</td>
346   - <td>{{obj.sjkslc}}</td>
347   - <td>{{obj.sslc}}</td>
  340 + <td>{{obj.jhlc}}</td>
  341 + <td>{{obj.jcclc}}</td>
  342 + <td>{{obj.sjzgl}}</td>
  343 + <td>{{obj.sjgl}}</td>
  344 + <td>{{obj.sjksgl}}</td>
  345 + <td>{{obj.ssgl}}</td>
348 346 <td>{{obj.ssbc}}</td>
349   - <td>{{obj.lzlc}}</td>
350   - <td>{{obj.dmlc}}</td>
351   - <td>{{obj.gzlc}}</td>
352   - <td>{{obj.jflc}}</td>
353   - <td>{{obj.zslc}}</td>
354   - <td>{{obj.qrlc}}</td>
355   - <td>{{obj.qclc}}</td>
356   - <td>{{obj.kxlc}}</td>
357   - <td>{{obj.qhlc}}</td>
358   - <td>{{obj.ywlc}}</td>
359   - <td>{{obj.qtlc}}</td>
360   - <td>{{obj.ljlc}}</td>
361   - <td>{{obj.jhbcq}}</td>
362   - <td>{{obj.jhbcz}}</td>
363   - <td>{{obj.jhbcw}}</td>
364   - <td>{{obj.sjbcq}}</td>
365   - <td>{{obj.sjbcz}}</td>
366   - <td>{{obj.sjbcw}}</td>
367   - <td>{{obj.ljbcq}}</td>
368   - <td>{{obj.ljbcz}}</td>
369   - <td>{{obj.ljbcw}}</td>
370   - <td>{{obj.fzbcq}}</td>
371   - <td>{{obj.fzbcz}}</td>
372   - <td>{{obj.fzbcw}}</td>
373   - <td>{{obj.dtbcq}}</td>
374   - <td>{{obj.dtbcz}}</td>
375   - <td>{{obj.dtbcw}}</td>
376   - <td>{{obj.djgq}}</td>
377   - <td>{{obj.djgz}}</td>
378   - <td>{{obj.djgw}}</td>
379   - <td>{{obj.djgsj}}</td>
  347 + <td>{{obj.ssgl_lz}}</td>
  348 + <td>{{obj.ssgl_dm}}</td>
  349 + <td>{{obj.ssgl_gz}}</td>
  350 + <td>{{obj.ssgl_jf}}</td>
  351 + <td>{{obj.ssgl_zs}}</td>
  352 + <td>{{obj.ssgl_qr}}</td>
  353 + <td>{{obj.ssgl_qc}}</td>
  354 + <td>{{obj.ssgl_kx}}</td>
  355 + <td>{{obj.ssgl_qh}}</td>
  356 + <td>{{obj.ssgl_yw}}</td>
  357 + <td>{{obj.ssgl_other}}</td>
  358 + <td>{{obj.ljgl}}</td>
  359 + <td>{{obj.jhbc}}</td>
  360 + <td>{{obj.jhbc_m}}</td>
  361 + <td>{{obj.jhbc_a}}</td>
  362 + <td>{{obj.sjbc}}</td>
  363 + <td>{{obj.sjbc_m}}</td>
  364 + <td>{{obj.sjbc_a}}</td>
  365 + <td>{{obj.ljbc}}</td>
  366 + <td>{{obj.ljbc_m}}</td>
  367 + <td>{{obj.ljbc_a}}</td>
  368 + <td>{{obj.fzbc}}</td>
  369 + <td>{{obj.fzbc_m}}</td>
  370 + <td>{{obj.fzbc_a}}</td>
  371 + <td>{{obj.dtbc}}</td>
  372 + <td>{{obj.dtbc_m}}</td>
  373 + <td>{{obj.dtbc_a}}</td>
  374 + <td>{{obj.djg}}</td>
  375 + <td>{{obj.djg_m}}</td>
  376 + <td>{{obj.djg_a}}</td>
  377 + <td>{{obj.djg_time}}</td>
380 378 <td>&nbsp;</td>
381 379 </tr>
382 380 {{/each}}
... ...
src/main/resources/static/pages/mforms/operationservices/operationservice.html
1   -<style type="text/css">
2   -.table-bordered {
3   - border: 1px solid;
4   -}
5   -
6   -.table-bordered>thead>tr>th, .table-bordered>thead>tr>td,
7   - .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td,
8   - .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td {
9   - border: 1px solid;
10   -}
11   -
12   -.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
13   - border-bottom-width: 2px;
14   - text-align: center;
15   -}
16   -
17   -.table>tbody+tbody {
18   - border-top: 1px solid;
19   -}
20   -</style>
21   -
22   -<div class="page-head">
23   - <div class="page-title">
24   - <h1>运营服务阶段报表</h1>
25   - </div>
26   -</div>
27   -
28   -<div class="row">
29   - <div class="col-md-12">
30   - <div class="portlet light porttlet-fit bordered">
31   - <div class="portlet-title">
32   - <form class="form-inline" action="" method="post">
33   - <div style="display: inline-block; margin-left: 33px;"
34   - id="gsdmDiv_operat">
35   - <span class="item-label" style="width: 80px;">公司: </span> <select
36   - class="form-control" name="company" id="gsdmOperat"
37   - style="width: 140px;"></select>
38   - </div>
39   - <div style="display: inline-block; margin-left: 25px;"
40   - id="fgsdmDiv_operat">
41   - <span class="item-label" style="width: 80px;">分公司: </span> <select
42   - class="form-control" name="subCompany" id="fgsdmOperat"
43   - style="width: 140px;"></select>
44   - </div>
45   - <div style="margin-top: 2px"></div>
46   - <div style="display: inline-block;margin-left: 33px;">
47   - <span class="item-label" style="width: 80px;">线路: </span> <select
48   - class="form-control" name="line" id="line" style="width: 140px;"></select>
49   - </div>
50   - <div style="display: inline-block; margin-left: 11px;">
51   - <span class="item-label" style="width: 80px;">开始时间: </span> <input
52   - class="form-control" type="text" id="startDate"
53   - style="width: 140px;" />
54   - </div>
55   - <div style="display: inline-block; margin-left: 15px;">
56   - <span class="item-label" style="width: 80px;">结束时间: </span> <input
57   - class="form-control" type="text" id="endDate"
58   - style="width: 140px;" />
59   - </div>
60   - <div style="display: inline-block; margin-left: 15px">
61   - <span class="item-label" style="width: 150px;">统计: </span>
62   - </div>
63   - <div class="form-group">
64   - <input class="btn btn-default" type="button" id="query" value="筛选" />
65   - <input class="btn btn-default" type="button" id="export"
66   - value="导出" />
67   - </div>
68   - </form>
69   - </div>
70   - <div class="portlet-body">
71   - <div class="table-container"
72   - style="margin-top: 10px; overflow: auto; min-width: 906px">
73   - <table class="table table-bordered table-hover table-checkable"
74   - id="forms">
75   - <thead>
76   - <tr>
77   - <th>序号</th>
78   - <th>线路名称</th>
79   - <th>加注量</th>
80   - <th>消耗量</th>
81   - <th>行驶总公里(含空驶里程)</th>
82   - <th>空驶里程</th>
83   - <th>实际班次(包含空放班次)</th>
84   - </tr>
85   - </thead>
86   - <tbody>
87   -
88   - </tbody>
89   - </table>
90   - </div>
91   - </div>
92   - </div>
93   - </div>
94   -</div>
95   -
96   -<script>
97   - $(function() {
98   - // 关闭左侧栏
99   - if (!$('body').hasClass('page-sidebar-closed'))
100   - $('.menu-toggler.sidebar-toggler').click();
101   -
102   - $("#startDate,#endDate").datetimepicker({
103   - format : 'YYYY-MM-DD',
104   - locale : 'zh-cn'
105   - });
106   -
107   - var d = new Date();
108   - var year = d.getFullYear();
109   - var month = d.getMonth() + 1;
110   - var day = d.getDate();
111   - if(month < 10)
112   - month = "0" + month;
113   - if(day < 10)
114   - day = "0" + day;
115   - $("#startDate").val(year + "-" + month + "-" + day);
116   - $("#endDate").val(year + "-" + month + "-" + day);
117   -
118   - var fage=false;
119   - var xlList;
120   - var obj = [];
121   -
122   -
123   - $.get('/report/lineList',function(result){
124   - xlList=result;
125   - $.get('/user/companyData', function(result){
126   - obj = result;
127   - var options = '';
128   - for(var i = 0; i < obj.length; i++){
129   - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
130   - }
131   -
132   - if(obj.length ==0){
133   - $("#gsdmDiv_operat").css('display','none');
134   - }else if(obj.length ==1){
135   - $("#gsdmDiv_operat").css('display','none');
136   - if(obj[0].children.length == 1 || obj[0].children.length ==0)
137   - $('#fgsdmDiv_operat').css('display','none');
138   - }
139   - $('#gsdmOperat').html(options);
140   - updateCompany();
141   - });
142   - })
143   - $("#gsdmOperat").on("change",updateCompany);
144   - function updateCompany(){
145   - var company = $('#gsdmOperat').val();
146   - var options = '';
147   - for(var i = 0; i < obj.length; i++){
148   - if(obj[i].companyCode == company){
149   - var children = obj[i].children;
150   - for(var j = 0; j < children.length; j++){
151   - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
152   - }
153   - }
154   - }
155   - $('#fgsdmOperat').html(options);
156   - }
157   -
158   - var tempData = {};
159   - $.get('/report/lineList',function(xlList){
160   - var data = [];
161   - data.push({id: " ", text: "全部线路"});
162   - $.get('/user/companyData', function(result){
163   - for(var i = 0; i < result.length; i++){
164   - var companyCode = result[i].companyCode;
165   - var children = result[i].children;
166   - for(var j = 0; j < children.length; j++){
167   - var code = children[j].code;
168   - for(var k=0;k < xlList.length;k++ ){
169   - if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
170   - data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
171   - tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
172   - }
173   - }
174   - }
175   - }
176   - initPinYinSelect2('#line',data,'');
177   -
178   - });
179   - });
180   -
181   - $("#line").on("change", function(){
182   - if($("#line").val() == " "){
183   - $("#gsdmOperat").attr("disabled", false);
184   - $("#fgsdmOperat").attr("disabled", false);
185   - } else {
186   - var temp = tempData[$("#line").val()].split(":");
187   - $("#gsdmOperat").val(temp[0]);
188   - updateCompany();
189   - $("#fgsdmOperat").val(temp[1]);
190   - $("#gsdmOperat").attr("disabled", true);
191   - $("#fgsdmOperat").attr("disabled", true);
192   - }
193   - });
194   -
195   -
196   - $("#query").on(
197   - "click",
198   - function() {
199   - var line = $("#line").val();
200   - var startDate = $("#startDate").val();
201   - var endDate = $("#endDate").val();
202   - var lpName = $("#lpName").val();
203   - var gsdmOperat = $("#gsdmOperat").val();
204   - var fgsdmOperat = $("#fgsdmOperat").val();
205   - var i = layer.load(2);
206   - $get("/mcy_forms/operationservice", {
207   - gsdmOperat : gsdmOperat,
208   - fgsdmOperat : fgsdmOperat,
209   - line : line,
210   - startDate : startDate,
211   - endDate : endDate,
212   - lpName : lpName,
213   - type:'query'
214   - }, function(result) {
215   - $("#sDate").text(startDate);
216   - $("#eDate").text(endDate);
217   - var temp = {};
218   - var today_account = 0;
219   - temp["line"] = $("#line").text();
220   - $.each(result, function(i, obj) {
221   - if (moment(obj.schedule_date_str).format(
222   - "YYYY-MM-DD") == moment(obj.startDate)
223   - .format("YYYY-MM-DD")) {
224   - today_account++;
225   - }
226   - obj.updateDate = moment(obj.startDate).format(
227   - "YYYY-MM-DD HH:mm:ss");
228   - });
229   - var operationservice = template('operationservice', {
230   - list : result
231   - });
232   - // 把渲染好的模版html文本追加到表格中
233   - $('#forms tbody').html(operationservice);
234   - layer.close(i);
235   -
236   - });
237   - });
238   - $("#export").on("click",function(){
239   - line = $("#line").val();
240   - startDate=$("#startDate").val();
241   - endDate=$("#endDate").val();
242   - gsdmOperat=$("#gsdmOperat").val();
243   - fgsdmOperat=$("#fgsdmOperat").val();
244   - var lineName = $('#line option:selected').text();
245   - if(lineName == "全部线路")
246   - lineName = $('#fgsdmOperat option:selected').text();
247   - var i = layer.load(2);
248   - $get('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export',lineName:lineName},function(result){
249   - var dateTime = "";
250   - if(startDate == endDate){
251   - dateTime = moment(startDate).format("YYYYMMDD");
252   - } else {
253   - dateTime = moment(startDate).format("YYYYMMDD")
254   - +"-"+moment(endDate).format("YYYYMMDD");
255   - }
256   - window.open("/downloadFile/download?fileName="
257   - +dateTime+"-"+lineName+"-运营服务阶段报表");
258   - layer.close(i);
259   - });
260   - });
261   -
262   -
263   - });
264   -</script>
265   -<script type="text/html" id="operationservice">
266   - {{each list as obj i}}
267   - <tr>
268   - <td>{{i+1}}</td>
269   - <td>{{obj.xlName}}</td>
270   - <td>{{obj.jzl}}</td>
271   - <td>{{obj.xhl}}</td>
272   - <td>{{obj.xsgl}}</td>
273   - <td>{{obj.emptMileage}}</td>
274   - <td>{{obj.sjbc}}</td>
275   - </tr>
276   - {{/each}}
277   - {{if list.length == 0}}
278   - <tr>
279   - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
280   - </tr>
281   - {{/if}}
282   -</script>
  1 +<style type="text/css">
  2 +.table-bordered {
  3 + border: 1px solid;
  4 +}
  5 +
  6 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td,
  7 + .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td,
  8 + .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td {
  9 + border: 1px solid;
  10 +}
  11 +
  12 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
  13 + border-bottom-width: 2px;
  14 + text-align: center;
  15 +}
  16 +
  17 +.table>tbody+tbody {
  18 + border-top: 1px solid;
  19 +}
  20 +</style>
  21 +
  22 +<div class="page-head">
  23 + <div class="page-title">
  24 + <h1>运营服务阶段报表</h1>
  25 + </div>
  26 +</div>
  27 +
  28 +<div class="row">
  29 + <div class="col-md-12">
  30 + <div class="portlet light porttlet-fit bordered">
  31 + <div class="portlet-title">
  32 + <form class="form-inline" action="" method="post">
  33 + <div style="display: inline-block; margin-left: 33px;"
  34 + id="gsdmDiv_operat">
  35 + <span class="item-label" style="width: 80px;">公司: </span> <select
  36 + class="form-control" name="company" id="gsdmOperat"
  37 + style="width: 140px;"></select>
  38 + </div>
  39 + <div style="display: inline-block; margin-left: 25px;"
  40 + id="fgsdmDiv_operat">
  41 + <span class="item-label" style="width: 80px;">分公司: </span> <select
  42 + class="form-control" name="subCompany" id="fgsdmOperat"
  43 + style="width: 140px;"></select>
  44 + </div>
  45 + <div style="margin-top: 2px"></div>
  46 + <div style="display: inline-block;margin-left: 33px;">
  47 + <span class="item-label" style="width: 80px;">线路: </span> <select
  48 + class="form-control" name="line" id="line" style="width: 140px;"></select>
  49 + </div>
  50 + <div style="display: inline-block; margin-left: 11px;">
  51 + <span class="item-label" style="width: 80px;">开始时间: </span> <input
  52 + class="form-control" type="text" id="startDate"
  53 + style="width: 140px;" />
  54 + </div>
  55 + <div style="display: inline-block; margin-left: 15px;">
  56 + <span class="item-label" style="width: 80px;">结束时间: </span> <input
  57 + class="form-control" type="text" id="endDate"
  58 + style="width: 140px;" />
  59 + </div>
  60 + <div style="display: inline-block; margin-left: 15px">
  61 + <span class="item-label" style="width: 150px;">统计: </span>
  62 + </div>
  63 + <div class="form-group">
  64 + <input class="btn btn-default" type="button" id="query" value="筛选" />
  65 + <input class="btn btn-default" type="button" id="export"
  66 + value="导出" />
  67 + </div>
  68 + </form>
  69 + </div>
  70 + <div class="portlet-body">
  71 + <div class="table-container"
  72 + style="margin-top: 10px; overflow: auto; min-width: 906px">
  73 + <table class="table table-bordered table-hover table-checkable"
  74 + id="forms">
  75 + <thead>
  76 + <tr>
  77 + <th>序号</th>
  78 + <th>线路名称</th>
  79 + <th>加注量</th>
  80 + <th>消耗量</th>
  81 + <th>行驶总公里(含空驶里程)</th>
  82 + <th>空驶里程</th>
  83 + <th>实际班次(包含空放班次)</th>
  84 + </tr>
  85 + </thead>
  86 + <tbody>
  87 +
  88 + </tbody>
  89 + </table>
  90 + </div>
  91 + </div>
  92 + </div>
  93 + </div>
  94 +</div>
  95 +
  96 +<script>
  97 + $(function() {
  98 + // 关闭左侧栏
  99 + if (!$('body').hasClass('page-sidebar-closed'))
  100 + $('.menu-toggler.sidebar-toggler').click();
  101 +
  102 + $("#startDate,#endDate").datetimepicker({
  103 + format : 'YYYY-MM-DD',
  104 + locale : 'zh-cn'
  105 + });
  106 +
  107 + var d = new Date();
  108 + var year = d.getFullYear();
  109 + var month = d.getMonth() + 1;
  110 + var day = d.getDate();
  111 + if(month < 10)
  112 + month = "0" + month;
  113 + if(day < 10)
  114 + day = "0" + day;
  115 + $("#startDate").val(year + "-" + month + "-" + day);
  116 + $("#endDate").val(year + "-" + month + "-" + day);
  117 +
  118 + var fage=false;
  119 + var xlList;
  120 + var obj = [];
  121 +
  122 +
  123 + $.get('/report/lineList',function(result){
  124 + xlList=result;
  125 + $.get('/user/companyData', function(result){
  126 + obj = result;
  127 + var options = '';
  128 + for(var i = 0; i < obj.length; i++){
  129 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  130 + }
  131 +
  132 + if(obj.length ==0){
  133 + $("#gsdmDiv_operat").css('display','none');
  134 + }else if(obj.length ==1){
  135 + $("#gsdmDiv_operat").css('display','none');
  136 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  137 + $('#fgsdmDiv_operat').css('display','none');
  138 + }
  139 + $('#gsdmOperat').html(options);
  140 + updateCompany();
  141 + });
  142 + })
  143 + $("#gsdmOperat").on("change",updateCompany);
  144 + function updateCompany(){
  145 + var company = $('#gsdmOperat').val();
  146 + var options = '';
  147 + for(var i = 0; i < obj.length; i++){
  148 + if(obj[i].companyCode == company){
  149 + var children = obj[i].children;
  150 + for(var j = 0; j < children.length; j++){
  151 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  152 + }
  153 + }
  154 + }
  155 + $('#fgsdmOperat').html(options);
  156 + }
  157 +
  158 + var tempData = {};
  159 + $.get('/report/lineList',function(xlList){
  160 + var data = [];
  161 + data.push({id: " ", text: "全部线路"});
  162 + $.get('/user/companyData', function(result){
  163 + for(var i = 0; i < result.length; i++){
  164 + var companyCode = result[i].companyCode;
  165 + var children = result[i].children;
  166 + for(var j = 0; j < children.length; j++){
  167 + var code = children[j].code;
  168 + for(var k=0;k < xlList.length;k++ ){
  169 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  170 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  171 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  172 + }
  173 + }
  174 + }
  175 + }
  176 + initPinYinSelect2('#line',data,'');
  177 +
  178 + });
  179 + });
  180 +
  181 + $("#line").on("change", function(){
  182 + if($("#line").val() == " "){
  183 + $("#gsdmOperat").attr("disabled", false);
  184 + $("#fgsdmOperat").attr("disabled", false);
  185 + } else {
  186 + var temp = tempData[$("#line").val()].split(":");
  187 + $("#gsdmOperat").val(temp[0]);
  188 + updateCompany();
  189 + $("#fgsdmOperat").val(temp[1]);
  190 + $("#gsdmOperat").attr("disabled", true);
  191 + $("#fgsdmOperat").attr("disabled", true);
  192 + }
  193 + });
  194 +
  195 +
  196 + $("#query").on(
  197 + "click",
  198 + function() {
  199 + var line = $("#line").val();
  200 + var startDate = $("#startDate").val();
  201 + var endDate = $("#endDate").val();
  202 + var lpName = $("#lpName").val();
  203 + var gsdmOperat = $("#gsdmOperat").val();
  204 + var fgsdmOperat = $("#fgsdmOperat").val();
  205 + var i = layer.load(2);
  206 + $get("/mcy_forms/operationservice", {
  207 + gsdmOperat : gsdmOperat,
  208 + fgsdmOperat : fgsdmOperat,
  209 + line : line,
  210 + startDate : startDate,
  211 + endDate : endDate,
  212 + lpName : lpName,
  213 + type:'query'
  214 + }, function(result) {
  215 + $("#sDate").text(startDate);
  216 + $("#eDate").text(endDate);
  217 + var temp = {};
  218 + var today_account = 0;
  219 + temp["line"] = $("#line").text();
  220 + $.each(result, function(i, obj) {
  221 + if (moment(obj.schedule_date_str).format(
  222 + "YYYY-MM-DD") == moment(obj.startDate)
  223 + .format("YYYY-MM-DD")) {
  224 + today_account++;
  225 + }
  226 + obj.updateDate = moment(obj.startDate).format(
  227 + "YYYY-MM-DD HH:mm:ss");
  228 + });
  229 + var operationservice = template('operationservice', {
  230 + list : result
  231 + });
  232 + // 把渲染好的模版html文本追加到表格中
  233 + $('#forms tbody').html(operationservice);
  234 + layer.close(i);
  235 +
  236 + });
  237 + });
  238 + $("#export").on("click",function(){
  239 + line = $("#line").val();
  240 + startDate=$("#startDate").val();
  241 + endDate=$("#endDate").val();
  242 + gsdmOperat=$("#gsdmOperat").val();
  243 + fgsdmOperat=$("#fgsdmOperat").val();
  244 + var lineName = $('#line option:selected').text();
  245 + if(lineName == "全部线路")
  246 + lineName = $('#fgsdmOperat option:selected').text();
  247 + var i = layer.load(2);
  248 + $get('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export',lineName:lineName},function(result){
  249 + var dateTime = "";
  250 + if(startDate == endDate){
  251 + dateTime = moment(startDate).format("YYYYMMDD");
  252 + } else {
  253 + dateTime = moment(startDate).format("YYYYMMDD")
  254 + +"-"+moment(endDate).format("YYYYMMDD");
  255 + }
  256 + window.open("/downloadFile/download?fileName="
  257 + +dateTime+"-"+lineName+"-运营服务阶段报表");
  258 + layer.close(i);
  259 + });
  260 + });
  261 +
  262 +
  263 + });
  264 +</script>
  265 +<script type="text/html" id="operationservice">
  266 + {{each list as obj i}}
  267 + <tr>
  268 + <td>{{i+1}}</td>
  269 + <td>{{obj.xlName}}</td>
  270 + <td>{{obj.jzl}}</td>
  271 + <td>{{obj.xhl}}</td>
  272 + <td>{{obj.xsgl}}</td>
  273 + <td>{{obj.emptMileage}}</td>
  274 + <td>{{obj.sjbc}}</td>
  275 + </tr>
  276 + {{/each}}
  277 + {{if list.length == 0}}
  278 + <tr>
  279 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  280 + </tr>
  281 + {{/if}}
  282 +</script>
283 283 </script>
284 284 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/lightbox.js
1   -/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2   -(function(addon) {
3   -
4   - var component;
5   -
6   - if (window.UIkit) {
7   - component = addon(UIkit);
8   - }
9   -
10   - if (typeof define == "function" && define.amd) { // AMD
11   - define("uikit-lightbox", ["uikit"], function(){
12   - return component || addon(UIkit);
13   - });
14   - }
15   -
16   -})(function(UI){
17   -
18   - "use strict";
19   -
20   - var modal, cache = {};
21   -
22   - UI.component('lightbox', {
23   -
24   - defaults: {
25   - "group" : false,
26   - "duration" : 400,
27   - "keyboard" : true
28   - },
29   -
30   - index : 0,
31   - items : false,
32   -
33   - boot: function() {
34   -
35   - UI.$html.on('click', '[data-uk-lightbox]', function(e){
36   -
37   - e.preventDefault();
38   -
39   - var link = UI.$(this);
40   -
41   - if (!link.data("lightbox")) {
42   -
43   - UI.lightbox(link, UI.Utils.options(link.attr("data-uk-lightbox")));
44   - }
45   -
46   - link.data("lightbox").show(link);
47   - });
48   -
49   - // keyboard navigation
50   - UI.$doc.on('keyup', function(e) {
51   -
52   - if (modal && modal.is(':visible') && modal.lightbox.options.keyboard) {
53   -
54   - e.preventDefault();
55   -
56   - switch(e.keyCode) {
57   - case 37:
58   - modal.lightbox.previous();
59   - break;
60   - case 39:
61   - modal.lightbox.next();
62   - break;
63   - }
64   - }
65   - });
66   - },
67   -
68   - init: function() {
69   -
70   - var siblings = [];
71   -
72   - this.index = 0;
73   - this.siblings = [];
74   -
75   - if (this.element && this.element.length) {
76   -
77   - var domSiblings = this.options.group ? UI.$([
78   - '[data-uk-lightbox*="'+this.options.group+'"]',
79   - "[data-uk-lightbox*='"+this.options.group+"']"
80   - ].join(',')) : this.element;
81   -
82   - domSiblings.each(function() {
83   -
84   - var ele = UI.$(this);
85   -
86   - siblings.push({
87   - 'source': ele.attr('href'),
88   - 'title' : ele.attr('data-title') || ele.attr('title'),
89   - 'type' : ele.attr("data-lightbox-type") || 'auto',
90   - 'link' : ele
91   - });
92   - });
93   -
94   - this.index = domSiblings.index(this.element);
95   - this.siblings = siblings;
96   -
97   - } else if (this.options.group && this.options.group.length) {
98   - this.siblings = this.options.group;
99   - }
100   -
101   - this.trigger('lightbox-init', [this]);
102   - },
103   -
104   - show: function(index) {
105   -
106   - this.modal = getModal(this);
107   -
108   - // stop previous animation
109   - this.modal.dialog.stop();
110   - this.modal.content.stop();
111   -
112   - var $this = this, promise = UI.$.Deferred(), data, item;
113   -
114   - index = index || 0;
115   -
116   - // index is a jQuery object or DOM element
117   - if (typeof(index) == 'object') {
118   -
119   - this.siblings.forEach(function(s, idx){
120   -
121   - if (index[0] === s.link[0]) {
122   - index = idx;
123   - }
124   - });
125   - }
126   -
127   - // fix index if needed
128   - if ( index < 0 ) {
129   - index = this.siblings.length - index;
130   - } else if (!this.siblings[index]) {
131   - index = 0;
132   - }
133   -
134   - item = this.siblings[index];
135   -
136   - data = {
137   - "lightbox" : $this,
138   - "source" : item.source,
139   - "type" : item.type,
140   - "index" : index,
141   - "promise" : promise,
142   - "title" : item.title,
143   - "item" : item,
144   - "meta" : {
145   - "content" : '',
146   - "width" : null,
147   - "height" : null
148   - }
149   - };
150   -
151   - this.index = index;
152   -
153   - this.modal.content.empty();
154   -
155   - if (!this.modal.is(':visible')) {
156   - this.modal.content.css({width:'', height:''}).empty();
157   - this.modal.modal.show();
158   - }
159   -
160   - this.modal.loader.removeClass('uk-hidden');
161   -
162   - promise.promise().done(function() {
163   -
164   - $this.data = data;
165   - $this.fitSize(data);
166   -
167   - }).fail(function(){
168   -
169   - data.meta.content = '<div class="uk-position-cover uk-flex uk-flex-middle uk-flex-center"><strong>Loading resource failed!</strong></div>';
170   - data.meta.width = 400;
171   - data.meta.height = 300;
172   -
173   - $this.data = data;
174   - $this.fitSize(data);
175   - });
176   -
177   - $this.trigger('showitem.uk.lightbox', [data]);
178   - },
179   -
180   - fitSize: function() {
181   -
182   - var $this = this,
183   - data = this.data,
184   - pad = this.modal.dialog.outerWidth() - this.modal.dialog.width(),
185   - dpadTop = parseInt(this.modal.dialog.css('margin-top'), 10),
186   - dpadBot = parseInt(this.modal.dialog.css('margin-bottom'), 10),
187   - dpad = dpadTop + dpadBot,
188   - content = data.meta.content,
189   - duration = $this.options.duration;
190   -
191   - if (this.siblings.length > 1) {
192   -
193   - content = [
194   - content,
195   - '<a href="#" class="uk-slidenav uk-slidenav-contrast uk-slidenav-previous uk-hidden-touch" data-lightbox-previous></a>',
196   - '<a href="#" class="uk-slidenav uk-slidenav-contrast uk-slidenav-next uk-hidden-touch" data-lightbox-next></a>'
197   - ].join('');
198   - }
199   -
200   - // calculate width
201   - var tmp = UI.$('<div>&nbsp;</div>').css({
202   - 'opacity' : 0,
203   - 'position' : 'absolute',
204   - 'top' : 0,
205   - 'left' : 0,
206   - 'width' : '100%',
207   - 'max-width' : $this.modal.dialog.css('max-width'),
208   - 'padding' : $this.modal.dialog.css('padding'),
209   - 'margin' : $this.modal.dialog.css('margin')
210   - }), maxwidth, maxheight, w = data.meta.width, h = data.meta.height;
211   -
212   - tmp.appendTo('body').width();
213   -
214   - maxwidth = tmp.width();
215   - maxheight = window.innerHeight - dpad;
216   -
217   - tmp.remove();
218   -
219   - this.modal.dialog.find('.uk-modal-caption').remove();
220   -
221   - if (data.title) {
222   - this.modal.dialog.append('<div class="uk-modal-caption">'+data.title+'</div>');
223   - maxheight -= this.modal.dialog.find('.uk-modal-caption').outerHeight();
224   - }
225   -
226   - if (maxwidth < data.meta.width) {
227   -
228   - h = Math.floor( h * (maxwidth / w) );
229   - w = maxwidth;
230   - }
231   -
232   - if (maxheight < h) {
233   -
234   - h = Math.floor(maxheight);
235   - w = Math.ceil(data.meta.width * (maxheight/data.meta.height));
236   - }
237   -
238   - this.modal.content.css('opacity', 0).width(w).html(content);
239   -
240   - if (data.type == 'iframe') {
241   - this.modal.content.find('iframe:first').height(h);
242   - }
243   -
244   - var dh = h + pad,
245   - t = Math.floor(window.innerHeight/2 - dh/2) - dpad;
246   -
247   - if (t < 0) { t = 0; }
248   -
249   - this.modal.closer.addClass('uk-hidden');
250   -
251   - if ($this.modal.data('mwidth') == w && $this.modal.data('mheight') == h) {
252   - duration = 0;
253   - }
254   -
255   - this.modal.dialog.animate({width: w + pad, height: h + pad, top: t }, duration, 'swing', function() {
256   - $this.modal.loader.addClass('uk-hidden');
257   - $this.modal.content.css({width:''}).animate({'opacity': 1}, function() {
258   - $this.modal.closer.removeClass('uk-hidden');
259   - });
260   -
261   - $this.modal.data({'mwidth': w, 'mheight': h});
262   - });
263   - },
264   -
265   - next: function() {
266   - this.show(this.siblings[(this.index+1)] ? (this.index+1) : 0);
267   - },
268   -
269   - previous: function() {
270   - this.show(this.siblings[(this.index-1)] ? (this.index-1) : this.siblings.length-1);
271   - }
272   - });
273   -
274   -
275   - // Plugins
276   -
277   - UI.plugin('lightbox', 'image', {
278   -
279   - init: function(lightbox) {
280   -
281   - lightbox.on("showitem.uk.lightbox", function(e, data){
282   -
283   - if (data.type == 'image' || data.source && data.source.match(/\.(jpg|jpeg|png|gif|svg)$/i)) {
284   -
285   - var resolve = function(source, width, height) {
286   -
287   - data.meta = {
288   - "content" : '<img class="uk-responsive-width" width="'+width+'" height="'+height+'" src ="'+source+'">',
289   - "width" : width,
290   - "height" : height
291   - };
292   -
293   - data.type = 'image';
294   -
295   - data.promise.resolve();
296   - };
297   -
298   - if (!cache[data.source]) {
299   -
300   - var img = new Image();
301   -
302   - img.onerror = function(){
303   - data.promise.reject('Loading image failed');
304   - };
305   -
306   - img.onload = function(){
307   - cache[data.source] = {width: img.width, height: img.height};
308   - resolve(data.source, cache[data.source].width, cache[data.source].height);
309   - };
310   -
311   - img.src = data.source;
312   -
313   - } else {
314   - resolve(data.source, cache[data.source].width, cache[data.source].height);
315   - }
316   - }
317   - });
318   - }
319   - });
320   -
321   - UI.plugin("lightbox", "youtube", {
322   -
323   - init: function(lightbox) {
324   -
325   - var youtubeRegExp = /(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/,
326   - youtubeRegExpShort = /youtu\.be\/(.*)/;
327   -
328   -
329   - lightbox.on("showitem.uk.lightbox", function(e, data){
330   -
331   - var id, matches, resolve = function(id, width, height) {
332   -
333   - data.meta = {
334   - 'content': '<iframe src="//www.youtube.com/embed/'+id+'" width="'+width+'" height="'+height+'" style="max-width:100%;"></iframe>',
335   - 'width': width,
336   - 'height': height
337   - };
338   -
339   - data.type = 'iframe';
340   -
341   - data.promise.resolve();
342   - };
343   -
344   - if (matches = data.source.match(youtubeRegExp)) {
345   - id = matches[2];
346   - }
347   -
348   - if (matches = data.source.match(youtubeRegExpShort)) {
349   - id = matches[1];
350   - }
351   -
352   - if (id) {
353   -
354   - if(!cache[id]) {
355   -
356   - var img = new Image(), lowres = false;
357   -
358   - img.onerror = function(){
359   - cache[id] = {width:640, height:320};
360   - resolve(id, cache[id].width, cache[id].height);
361   - };
362   -
363   - img.onload = function(){
364   - //youtube default 404 thumb, fall back to lowres
365   - if (img.width == 120 && img.height == 90) {
366   - if (!lowres) {
367   - lowres = true;
368   - img.src = '//img.youtube.com/vi/' + id + '/0.jpg';
369   - } else {
370   - cache[id] = {width: 640, height: 320};
371   - resolve(id, cache[id].width, cache[id].height);
372   - }
373   - } else {
374   - cache[id] = {width: img.width, height: img.height};
375   - resolve(id, img.width, img.height);
376   - }
377   - };
378   -
379   - img.src = '//img.youtube.com/vi/'+id+'/maxresdefault.jpg';
380   -
381   - } else {
382   - resolve(id, cache[id].width, cache[id].height);
383   - }
384   -
385   - e.stopImmediatePropagation();
386   - }
387   - });
388   - }
389   - });
390   -
391   -
392   - UI.plugin("lightbox", "vimeo", {
393   -
394   - init: function(lightbox) {
395   -
396   - var regex = /(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/, matches;
397   -
398   -
399   - lightbox.on("showitem.uk.lightbox", function(e, data){
400   -
401   - var id, resolve = function(id, width, height) {
402   -
403   - data.meta = {
404   - 'content': '<iframe src="//player.vimeo.com/video/'+id+'" width="'+width+'" height="'+height+'" style="width:100%;box-sizing:border-box;"></iframe>',
405   - 'width': width,
406   - 'height': height
407   - };
408   -
409   - data.type = 'iframe';
410   -
411   - data.promise.resolve();
412   - };
413   -
414   - if (matches = data.source.match(regex)) {
415   -
416   - id = matches[2];
417   -
418   - if(!cache[id]) {
419   -
420   - UI.$.ajax({
421   - type : 'GET',
422   - url : 'http://vimeo.com/api/oembed.json?url=' + encodeURI(data.source),
423   - jsonp : 'callback',
424   - dataType : 'jsonp',
425   - success : function(data) {
426   - cache[id] = {width:data.width, height:data.height};
427   - resolve(id, cache[id].width, cache[id].height);
428   - }
429   - });
430   -
431   - } else {
432   - resolve(id, cache[id].width, cache[id].height);
433   - }
434   -
435   - e.stopImmediatePropagation();
436   - }
437   - });
438   - }
439   - });
440   -
441   - UI.plugin("lightbox", "video", {
442   -
443   - init: function(lightbox) {
444   -
445   - lightbox.on("showitem.uk.lightbox", function(e, data){
446   -
447   -
448   - var resolve = function(source, width, height) {
449   -
450   - data.meta = {
451   - 'content': '<video class="uk-responsive-width" src="'+source+'" width="'+width+'" height="'+height+'" controls></video>',
452   - 'width': width,
453   - 'height': height
454   - };
455   -
456   - data.type = 'video';
457   -
458   - data.promise.resolve();
459   - };
460   -
461   - if (data.type == 'video' || data.source.match(/\.(mp4|webm|ogv)$/i)) {
462   -
463   - if (!cache[data.source]) {
464   -
465   - var vid = UI.$('<video style="position:fixed;visibility:hidden;top:-10000px;"></video>').attr('src', data.source).appendTo('body');
466   -
467   - var idle = setInterval(function() {
468   -
469   - if (vid[0].videoWidth) {
470   - clearInterval(idle);
471   - cache[data.source] = {width: vid[0].videoWidth, height: vid[0].videoHeight};
472   - resolve(data.source, cache[data.source].width, cache[data.source].height);
473   - vid.remove();
474   - }
475   -
476   - }, 20);
477   -
478   - } else {
479   - resolve(data.source, cache[data.source].width, cache[data.source].height);
480   - }
481   - }
482   - });
483   - }
484   - });
485   -
486   -
487   - function getModal(lightbox) {
488   -
489   - if (modal) {
490   - modal.lightbox = lightbox;
491   - return modal;
492   - }
493   -
494   - // init lightbox container
495   - modal = UI.$([
496   - '<div class="uk-modal">',
497   - '<div class="uk-modal-dialog uk-modal-dialog-lightbox uk-slidenav-position" style="margin-left:auto;margin-right:auto;width:200px;height:200px;top:'+Math.abs(window.innerHeight/2 - 200)+'px;">',
498   - '<a href="#" class="uk-modal-close uk-close uk-close-alt"></a>',
499   - '<div class="uk-lightbox-content"></div>',
500   - '<div class="uk-modal-spinner uk-hidden"></div>',
501   - '</div>',
502   - '</div>'
503   - ].join('')).appendTo('body');
504   -
505   - modal.dialog = modal.find('.uk-modal-dialog:first');
506   - modal.content = modal.find('.uk-lightbox-content:first');
507   - modal.loader = modal.find('.uk-modal-spinner:first');
508   - modal.closer = modal.find('.uk-close.uk-close-alt');
509   - modal.modal = UI.modal(modal, {modal:false, bgclose: false});
510   -
511   - // next / previous
512   -/* modal.on("swipeRight swipeLeft", function(e) {
513   - modal.lightbox[e.type=='swipeLeft' ? 'next':'previous']();
514   - }).on("click", "[data-lightbox-previous], [data-lightbox-next]", function(e){
515   - e.preventDefault();
516   - modal.lightbox[UI.$(this).is('[data-lightbox-next]') ? 'next':'previous']();
517   - });*/
518   -
519   - // destroy content on modal hide
520   - modal.on("hide.uk.modal", function(e) {
521   - modal.content.html('');
522   - });
523   -
524   - UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(e){
525   - if (modal.is(':visible') && !UI.Utils.isFullscreen()) modal.lightbox.fitSize();
526   - }.bind(this), 100));
527   -
528   - modal.lightbox = lightbox;
529   -
530   - return modal;
531   - }
532   -
533   - UI.lightbox.create = function(items, options) {
534   -
535   - if (!items) return;
536   -
537   - var group = [], o;
538   -
539   - items.forEach(function(item) {
540   -
541   - group.push(UI.$.extend({
542   - 'source' : '',
543   - 'title' : '',
544   - 'type' : 'auto',
545   - 'link' : false
546   - }, (typeof(item) == 'string' ? {'source': item} : item)));
547   - });
548   -
549   - o = UI.lightbox(UI.$.extend({}, options, {'group':group}));
550   -
551   - return o;
552   - };
553   -
554   - return UI.lightbox;
555   -});
  1 +/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
  2 +(function(addon) {
  3 +
  4 + var component;
  5 +
  6 + if (window.UIkit) {
  7 + component = addon(UIkit);
  8 + }
  9 +
  10 + if (typeof define == "function" && define.amd) { // AMD
  11 + define("uikit-lightbox", ["uikit"], function(){
  12 + return component || addon(UIkit);
  13 + });
  14 + }
  15 +
  16 +})(function(UI){
  17 +
  18 + "use strict";
  19 +
  20 + var modal, cache = {};
  21 +
  22 + UI.component('lightbox', {
  23 +
  24 + defaults: {
  25 + "group" : false,
  26 + "duration" : 400,
  27 + "keyboard" : true
  28 + },
  29 +
  30 + index : 0,
  31 + items : false,
  32 +
  33 + boot: function() {
  34 +
  35 + UI.$html.on('click', '[data-uk-lightbox]', function(e){
  36 +
  37 + e.preventDefault();
  38 +
  39 + var link = UI.$(this);
  40 +
  41 + if (!link.data("lightbox")) {
  42 +
  43 + UI.lightbox(link, UI.Utils.options(link.attr("data-uk-lightbox")));
  44 + }
  45 +
  46 + link.data("lightbox").show(link);
  47 + });
  48 +
  49 + // keyboard navigation
  50 + UI.$doc.on('keyup', function(e) {
  51 +
  52 + if (modal && modal.is(':visible') && modal.lightbox.options.keyboard) {
  53 +
  54 + e.preventDefault();
  55 +
  56 + switch(e.keyCode) {
  57 + case 37:
  58 + modal.lightbox.previous();
  59 + break;
  60 + case 39:
  61 + modal.lightbox.next();
  62 + break;
  63 + }
  64 + }
  65 + });
  66 + },
  67 +
  68 + init: function() {
  69 +
  70 + var siblings = [];
  71 +
  72 + this.index = 0;
  73 + this.siblings = [];
  74 +
  75 + if (this.element && this.element.length) {
  76 +
  77 + var domSiblings = this.options.group ? UI.$([
  78 + '[data-uk-lightbox*="'+this.options.group+'"]',
  79 + "[data-uk-lightbox*='"+this.options.group+"']"
  80 + ].join(',')) : this.element;
  81 +
  82 + domSiblings.each(function() {
  83 +
  84 + var ele = UI.$(this);
  85 +
  86 + siblings.push({
  87 + 'source': ele.attr('href'),
  88 + 'title' : ele.attr('data-title') || ele.attr('title'),
  89 + 'type' : ele.attr("data-lightbox-type") || 'auto',
  90 + 'link' : ele
  91 + });
  92 + });
  93 +
  94 + this.index = domSiblings.index(this.element);
  95 + this.siblings = siblings;
  96 +
  97 + } else if (this.options.group && this.options.group.length) {
  98 + this.siblings = this.options.group;
  99 + }
  100 +
  101 + this.trigger('lightbox-init', [this]);
  102 + },
  103 +
  104 + show: function(index) {
  105 +
  106 + this.modal = getModal(this);
  107 +
  108 + // stop previous animation
  109 + this.modal.dialog.stop();
  110 + this.modal.content.stop();
  111 +
  112 + var $this = this, promise = UI.$.Deferred(), data, item;
  113 +
  114 + index = index || 0;
  115 +
  116 + // index is a jQuery object or DOM element
  117 + if (typeof(index) == 'object') {
  118 +
  119 + this.siblings.forEach(function(s, idx){
  120 +
  121 + if (index[0] === s.link[0]) {
  122 + index = idx;
  123 + }
  124 + });
  125 + }
  126 +
  127 + // fix index if needed
  128 + if ( index < 0 ) {
  129 + index = this.siblings.length - index;
  130 + } else if (!this.siblings[index]) {
  131 + index = 0;
  132 + }
  133 +
  134 + item = this.siblings[index];
  135 +
  136 + data = {
  137 + "lightbox" : $this,
  138 + "source" : item.source,
  139 + "type" : item.type,
  140 + "index" : index,
  141 + "promise" : promise,
  142 + "title" : item.title,
  143 + "item" : item,
  144 + "meta" : {
  145 + "content" : '',
  146 + "width" : null,
  147 + "height" : null
  148 + }
  149 + };
  150 +
  151 + this.index = index;
  152 +
  153 + this.modal.content.empty();
  154 +
  155 + if (!this.modal.is(':visible')) {
  156 + this.modal.content.css({width:'', height:''}).empty();
  157 + this.modal.modal.show();
  158 + }
  159 +
  160 + this.modal.loader.removeClass('uk-hidden');
  161 +
  162 + promise.promise().done(function() {
  163 +
  164 + $this.data = data;
  165 + $this.fitSize(data);
  166 +
  167 + }).fail(function(){
  168 +
  169 + data.meta.content = '<div class="uk-position-cover uk-flex uk-flex-middle uk-flex-center"><strong>Loading resource failed!</strong></div>';
  170 + data.meta.width = 400;
  171 + data.meta.height = 300;
  172 +
  173 + $this.data = data;
  174 + $this.fitSize(data);
  175 + });
  176 +
  177 + $this.trigger('showitem.uk.lightbox', [data]);
  178 + },
  179 +
  180 + fitSize: function() {
  181 +
  182 + var $this = this,
  183 + data = this.data,
  184 + pad = this.modal.dialog.outerWidth() - this.modal.dialog.width(),
  185 + dpadTop = parseInt(this.modal.dialog.css('margin-top'), 10),
  186 + dpadBot = parseInt(this.modal.dialog.css('margin-bottom'), 10),
  187 + dpad = dpadTop + dpadBot,
  188 + content = data.meta.content,
  189 + duration = $this.options.duration;
  190 +
  191 + if (this.siblings.length > 1) {
  192 +
  193 + content = [
  194 + content,
  195 + '<a href="#" class="uk-slidenav uk-slidenav-contrast uk-slidenav-previous uk-hidden-touch" data-lightbox-previous></a>',
  196 + '<a href="#" class="uk-slidenav uk-slidenav-contrast uk-slidenav-next uk-hidden-touch" data-lightbox-next></a>'
  197 + ].join('');
  198 + }
  199 +
  200 + // calculate width
  201 + var tmp = UI.$('<div>&nbsp;</div>').css({
  202 + 'opacity' : 0,
  203 + 'position' : 'absolute',
  204 + 'top' : 0,
  205 + 'left' : 0,
  206 + 'width' : '100%',
  207 + 'max-width' : $this.modal.dialog.css('max-width'),
  208 + 'padding' : $this.modal.dialog.css('padding'),
  209 + 'margin' : $this.modal.dialog.css('margin')
  210 + }), maxwidth, maxheight, w = data.meta.width, h = data.meta.height;
  211 +
  212 + tmp.appendTo('body').width();
  213 +
  214 + maxwidth = tmp.width();
  215 + maxheight = window.innerHeight - dpad;
  216 +
  217 + tmp.remove();
  218 +
  219 + this.modal.dialog.find('.uk-modal-caption').remove();
  220 +
  221 + if (data.title) {
  222 + this.modal.dialog.append('<div class="uk-modal-caption">'+data.title+'</div>');
  223 + maxheight -= this.modal.dialog.find('.uk-modal-caption').outerHeight();
  224 + }
  225 +
  226 + if (maxwidth < data.meta.width) {
  227 +
  228 + h = Math.floor( h * (maxwidth / w) );
  229 + w = maxwidth;
  230 + }
  231 +
  232 + if (maxheight < h) {
  233 +
  234 + h = Math.floor(maxheight);
  235 + w = Math.ceil(data.meta.width * (maxheight/data.meta.height));
  236 + }
  237 +
  238 + this.modal.content.css('opacity', 0).width(w).html(content);
  239 +
  240 + if (data.type == 'iframe') {
  241 + this.modal.content.find('iframe:first').height(h);
  242 + }
  243 +
  244 + var dh = h + pad,
  245 + t = Math.floor(window.innerHeight/2 - dh/2) - dpad;
  246 +
  247 + if (t < 0) { t = 0; }
  248 +
  249 + this.modal.closer.addClass('uk-hidden');
  250 +
  251 + if ($this.modal.data('mwidth') == w && $this.modal.data('mheight') == h) {
  252 + duration = 0;
  253 + }
  254 +
  255 + this.modal.dialog.animate({width: w + pad, height: h + pad, top: t }, duration, 'swing', function() {
  256 + $this.modal.loader.addClass('uk-hidden');
  257 + $this.modal.content.css({width:''}).animate({'opacity': 1}, function() {
  258 + $this.modal.closer.removeClass('uk-hidden');
  259 + });
  260 +
  261 + $this.modal.data({'mwidth': w, 'mheight': h});
  262 + });
  263 + },
  264 +
  265 + next: function() {
  266 + this.show(this.siblings[(this.index+1)] ? (this.index+1) : 0);
  267 + },
  268 +
  269 + previous: function() {
  270 + this.show(this.siblings[(this.index-1)] ? (this.index-1) : this.siblings.length-1);
  271 + }
  272 + });
  273 +
  274 +
  275 + // Plugins
  276 +
  277 + UI.plugin('lightbox', 'image', {
  278 +
  279 + init: function(lightbox) {
  280 +
  281 + lightbox.on("showitem.uk.lightbox", function(e, data){
  282 +
  283 + if (data.type == 'image' || data.source && data.source.match(/\.(jpg|jpeg|png|gif|svg)$/i)) {
  284 +
  285 + var resolve = function(source, width, height) {
  286 +
  287 + data.meta = {
  288 + "content" : '<img class="uk-responsive-width" width="'+width+'" height="'+height+'" src ="'+source+'">',
  289 + "width" : width,
  290 + "height" : height
  291 + };
  292 +
  293 + data.type = 'image';
  294 +
  295 + data.promise.resolve();
  296 + };
  297 +
  298 + if (!cache[data.source]) {
  299 +
  300 + var img = new Image();
  301 +
  302 + img.onerror = function(){
  303 + data.promise.reject('Loading image failed');
  304 + };
  305 +
  306 + img.onload = function(){
  307 + cache[data.source] = {width: img.width, height: img.height};
  308 + resolve(data.source, cache[data.source].width, cache[data.source].height);
  309 + };
  310 +
  311 + img.src = data.source;
  312 +
  313 + } else {
  314 + resolve(data.source, cache[data.source].width, cache[data.source].height);
  315 + }
  316 + }
  317 + });
  318 + }
  319 + });
  320 +
  321 + UI.plugin("lightbox", "youtube", {
  322 +
  323 + init: function(lightbox) {
  324 +
  325 + var youtubeRegExp = /(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/,
  326 + youtubeRegExpShort = /youtu\.be\/(.*)/;
  327 +
  328 +
  329 + lightbox.on("showitem.uk.lightbox", function(e, data){
  330 +
  331 + var id, matches, resolve = function(id, width, height) {
  332 +
  333 + data.meta = {
  334 + 'content': '<iframe src="//www.youtube.com/embed/'+id+'" width="'+width+'" height="'+height+'" style="max-width:100%;"></iframe>',
  335 + 'width': width,
  336 + 'height': height
  337 + };
  338 +
  339 + data.type = 'iframe';
  340 +
  341 + data.promise.resolve();
  342 + };
  343 +
  344 + if (matches = data.source.match(youtubeRegExp)) {
  345 + id = matches[2];
  346 + }
  347 +
  348 + if (matches = data.source.match(youtubeRegExpShort)) {
  349 + id = matches[1];
  350 + }
  351 +
  352 + if (id) {
  353 +
  354 + if(!cache[id]) {
  355 +
  356 + var img = new Image(), lowres = false;
  357 +
  358 + img.onerror = function(){
  359 + cache[id] = {width:640, height:320};
  360 + resolve(id, cache[id].width, cache[id].height);
  361 + };
  362 +
  363 + img.onload = function(){
  364 + //youtube default 404 thumb, fall back to lowres
  365 + if (img.width == 120 && img.height == 90) {
  366 + if (!lowres) {
  367 + lowres = true;
  368 + img.src = '//img.youtube.com/vi/' + id + '/0.jpg';
  369 + } else {
  370 + cache[id] = {width: 640, height: 320};
  371 + resolve(id, cache[id].width, cache[id].height);
  372 + }
  373 + } else {
  374 + cache[id] = {width: img.width, height: img.height};
  375 + resolve(id, img.width, img.height);
  376 + }
  377 + };
  378 +
  379 + img.src = '//img.youtube.com/vi/'+id+'/maxresdefault.jpg';
  380 +
  381 + } else {
  382 + resolve(id, cache[id].width, cache[id].height);
  383 + }
  384 +
  385 + e.stopImmediatePropagation();
  386 + }
  387 + });
  388 + }
  389 + });
  390 +
  391 +
  392 + UI.plugin("lightbox", "vimeo", {
  393 +
  394 + init: function(lightbox) {
  395 +
  396 + var regex = /(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/, matches;
  397 +
  398 +
  399 + lightbox.on("showitem.uk.lightbox", function(e, data){
  400 +
  401 + var id, resolve = function(id, width, height) {
  402 +
  403 + data.meta = {
  404 + 'content': '<iframe src="//player.vimeo.com/video/'+id+'" width="'+width+'" height="'+height+'" style="width:100%;box-sizing:border-box;"></iframe>',
  405 + 'width': width,
  406 + 'height': height
  407 + };
  408 +
  409 + data.type = 'iframe';
  410 +
  411 + data.promise.resolve();
  412 + };
  413 +
  414 + if (matches = data.source.match(regex)) {
  415 +
  416 + id = matches[2];
  417 +
  418 + if(!cache[id]) {
  419 +
  420 + UI.$.ajax({
  421 + type : 'GET',
  422 + url : 'http://vimeo.com/api/oembed.json?url=' + encodeURI(data.source),
  423 + jsonp : 'callback',
  424 + dataType : 'jsonp',
  425 + success : function(data) {
  426 + cache[id] = {width:data.width, height:data.height};
  427 + resolve(id, cache[id].width, cache[id].height);
  428 + }
  429 + });
  430 +
  431 + } else {
  432 + resolve(id, cache[id].width, cache[id].height);
  433 + }
  434 +
  435 + e.stopImmediatePropagation();
  436 + }
  437 + });
  438 + }
  439 + });
  440 +
  441 + UI.plugin("lightbox", "video", {
  442 +
  443 + init: function(lightbox) {
  444 +
  445 + lightbox.on("showitem.uk.lightbox", function(e, data){
  446 +
  447 +
  448 + var resolve = function(source, width, height) {
  449 +
  450 + data.meta = {
  451 + 'content': '<video class="uk-responsive-width" src="'+source+'" width="'+width+'" height="'+height+'" controls></video>',
  452 + 'width': width,
  453 + 'height': height
  454 + };
  455 +
  456 + data.type = 'video';
  457 +
  458 + data.promise.resolve();
  459 + };
  460 +
  461 + if (data.type == 'video' || data.source.match(/\.(mp4|webm|ogv)$/i)) {
  462 +
  463 + if (!cache[data.source]) {
  464 +
  465 + var vid = UI.$('<video style="position:fixed;visibility:hidden;top:-10000px;"></video>').attr('src', data.source).appendTo('body');
  466 +
  467 + var idle = setInterval(function() {
  468 +
  469 + if (vid[0].videoWidth) {
  470 + clearInterval(idle);
  471 + cache[data.source] = {width: vid[0].videoWidth, height: vid[0].videoHeight};
  472 + resolve(data.source, cache[data.source].width, cache[data.source].height);
  473 + vid.remove();
  474 + }
  475 +
  476 + }, 20);
  477 +
  478 + } else {
  479 + resolve(data.source, cache[data.source].width, cache[data.source].height);
  480 + }
  481 + }
  482 + });
  483 + }
  484 + });
  485 +
  486 +
  487 + function getModal(lightbox) {
  488 +
  489 + if (modal) {
  490 + modal.lightbox = lightbox;
  491 + return modal;
  492 + }
  493 +
  494 + // init lightbox container
  495 + modal = UI.$([
  496 + '<div class="uk-modal">',
  497 + '<div class="uk-modal-dialog uk-modal-dialog-lightbox uk-slidenav-position" style="margin-left:auto;margin-right:auto;width:200px;height:200px;top:'+Math.abs(window.innerHeight/2 - 200)+'px;">',
  498 + '<a href="#" class="uk-modal-close uk-close uk-close-alt"></a>',
  499 + '<div class="uk-lightbox-content"></div>',
  500 + '<div class="uk-modal-spinner uk-hidden"></div>',
  501 + '</div>',
  502 + '</div>'
  503 + ].join('')).appendTo('body');
  504 +
  505 + modal.dialog = modal.find('.uk-modal-dialog:first');
  506 + modal.content = modal.find('.uk-lightbox-content:first');
  507 + modal.loader = modal.find('.uk-modal-spinner:first');
  508 + modal.closer = modal.find('.uk-close.uk-close-alt');
  509 + modal.modal = UI.modal(modal, {modal:false, bgclose: false});
  510 +
  511 + // next / previous
  512 +/* modal.on("swipeRight swipeLeft", function(e) {
  513 + modal.lightbox[e.type=='swipeLeft' ? 'next':'previous']();
  514 + }).on("click", "[data-lightbox-previous], [data-lightbox-next]", function(e){
  515 + e.preventDefault();
  516 + modal.lightbox[UI.$(this).is('[data-lightbox-next]') ? 'next':'previous']();
  517 + });*/
  518 +
  519 + // destroy content on modal hide
  520 + modal.on("hide.uk.modal", function(e) {
  521 + modal.content.html('');
  522 + });
  523 +
  524 + UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(e){
  525 + if (modal.is(':visible') && !UI.Utils.isFullscreen()) modal.lightbox.fitSize();
  526 + }.bind(this), 100));
  527 +
  528 + modal.lightbox = lightbox;
  529 +
  530 + return modal;
  531 + }
  532 +
  533 + UI.lightbox.create = function(items, options) {
  534 +
  535 + if (!items) return;
  536 +
  537 + var group = [], o;
  538 +
  539 + items.forEach(function(item) {
  540 +
  541 + group.push(UI.$.extend({
  542 + 'source' : '',
  543 + 'title' : '',
  544 + 'type' : 'auto',
  545 + 'link' : false
  546 + }, (typeof(item) == 'string' ? {'source': item} : item)));
  547 + });
  548 +
  549 + o = UI.lightbox(UI.$.extend({}, options, {'group':group}));
  550 +
  551 + return o;
  552 + };
  553 +
  554 + return UI.lightbox;
  555 +});
... ...
src/main/resources/traffic-jdbc.properties
1   -#ms.mysql.driver= com.mysql.jdbc.Driver
2   -#ms.mysql.url= jdbc:mysql://127.0.0.1/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
3   -#ms.mysql.username= root
4   -#ms.mysql.password= 123456
5   -
6   -ms.mysql.driver= com.mysql.jdbc.Driver
7   -ms.mysql.url= jdbc:mysql://10.10.150.21:3306/ms?useUnicode=true&characterEncoding=utf-8
8   -ms.mysql.username= root
9   -ms.mysql.password= root2jsp@JSP
10   -
  1 +#ms.mysql.driver= com.mysql.jdbc.Driver
  2 +#ms.mysql.url= jdbc:mysql://127.0.0.1/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  3 +#ms.mysql.username= root
  4 +#ms.mysql.password= 123456
  5 +
  6 +ms.mysql.driver= com.mysql.jdbc.Driver
  7 +ms.mysql.url= jdbc:mysql://10.10.150.21:3306/ms?useUnicode=true&characterEncoding=utf-8
  8 +ms.mysql.username= root
  9 +ms.mysql.password= root2jsp@JSP
  10 +
... ...