Commit 668bce7933c9e2f17dff8073b8dd78e8e4bb6101

Authored by 潘钊
2 parents 2f9dd0cc 478e05ff

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

Showing 44 changed files with 6952 additions and 875 deletions
src/main/java/com/bsth/controller/calc/CalcWaybillController.java
@@ -6,6 +6,7 @@ import java.util.Map; @@ -6,6 +6,7 @@ import java.util.Map;
6 6
7 import com.bsth.common.ResponseCode; 7 import com.bsth.common.ResponseCode;
8 import com.bsth.controller.BaseController; 8 import com.bsth.controller.BaseController;
  9 +import com.bsth.entity.calc.CalcStatistics;
9 import com.bsth.entity.calc.CalcWaybill; 10 import com.bsth.entity.calc.CalcWaybill;
10 import com.bsth.service.calc.CalcWaybillService; 11 import com.bsth.service.calc.CalcWaybillService;
11 12
@@ -26,19 +27,26 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> @@ -26,19 +27,26 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer>
26 27
27 @RequestMapping(value="/generateNew") 28 @RequestMapping(value="/generateNew")
28 public Map<String, Object> generateNews(@RequestParam Map<String, Object> map) throws Exception{ 29 public Map<String, Object> generateNews(@RequestParam Map<String, Object> map) throws Exception{
29 - String date = "", line = ""; 30 + String date = "", line = "", key="";
30 if(map.get("date")!=null){ 31 if(map.get("date")!=null){
31 date=map.get("date").toString().trim(); 32 date=map.get("date").toString().trim();
32 } 33 }
33 if(map.get("line")!=null){ 34 if(map.get("line")!=null){
34 line=map.get("line").toString().trim(); 35 line=map.get("line").toString().trim();
35 } 36 }
  37 + if(map.get("key")!=null){
  38 + key=map.get("key").toString().trim();
  39 + }
36 40
37 Map<String, Object> m = new HashMap<String, Object>(); 41 Map<String, Object> m = new HashMap<String, Object>();
38 try { 42 try {
39 43
40 m = calcWaybillService.generateNew(date, line); 44 m = calcWaybillService.generateNew(date, line);
41 45
  46 + if(key.length() == 0){
  47 + m.put("status", calcWaybillService.calcDaily(date, line));
  48 + }
  49 +
42 } catch (Exception e) { 50 } catch (Exception e) {
43 // TODO: handle exception 51 // TODO: handle exception
44 e.printStackTrace(); 52 e.printStackTrace();
@@ -82,4 +90,61 @@ public class CalcWaybillController extends BaseController&lt;CalcWaybill, Integer&gt; @@ -82,4 +90,61 @@ public class CalcWaybillController extends BaseController&lt;CalcWaybill, Integer&gt;
82 return calcWaybillService.statisticsDailyTj(gsdm,fgsdm,line,date,date2,xlName,type); 90 return calcWaybillService.statisticsDailyTj(gsdm,fgsdm,line,date,date2,xlName,type);
83 } 91 }
84 92
  93 + @RequestMapping(value="/generateDaliy")
  94 + public Map<String, Object> generateDaliy(@RequestParam Map<String, Object> map) throws Exception{
  95 + String date = "", line = "";
  96 + if(map.containsKey("date") && map.get("date")!=null){
  97 + date=map.get("date").toString().trim();
  98 + }
  99 + if(map.containsKey("line") && map.get("line")!=null){
  100 + line=map.get("line").toString().trim();
  101 + }
  102 +
  103 + Map<String, Object> m = new HashMap<String, Object>();
  104 + try {
  105 +
  106 + m.put("status", calcWaybillService.calcDaily(date, line));
  107 +
  108 + } catch (Exception e) {
  109 + // TODO: handle exception
  110 + e.printStackTrace();
  111 + m.put("status", ResponseCode.ERROR);
  112 + return m;
  113 + }
  114 + return m;
  115 + }
  116 +
  117 + @RequestMapping(value="/calcStatisticsDaily")
  118 + public List<CalcStatistics> calcStatisticsDaily(@RequestParam Map<String, Object> map){
  119 + String gsdm="";
  120 + if(map.get("gsdm")!=null){
  121 + gsdm=map.get("gsdm").toString().trim();
  122 + }
  123 + String fgsdm="";
  124 + if(map.get("fgsdm")!=null){
  125 + fgsdm=map.get("fgsdm").toString().trim();
  126 + }
  127 + String line="";
  128 + if(map.get("line")!=null){
  129 + line=map.get("line").toString().trim();
  130 + }
  131 + String date="";
  132 + if(map.get("date")!=null){
  133 + date=map.get("date").toString().trim();
  134 + }
  135 + String date2="";
  136 + if(map.get("date2")!=null){
  137 + date2=map.get("date2").toString().trim();
  138 + }
  139 + String xlName="";
  140 + if(map.get("xlName")!=null){
  141 + xlName=map.get("xlName").toString().trim();
  142 + }
  143 + String type="";
  144 + if(map.get("type")!=null){
  145 + type=map.get("type").toString().trim();
  146 + }
  147 + return calcWaybillService.calcStatisticsDaily(gsdm,fgsdm,line,date,date2,xlName,type);
  148 + }
  149 +
85 } 150 }
src/main/java/com/bsth/controller/schedule/core/TTInfoDetailController.java
@@ -6,6 +6,7 @@ import com.bsth.entity.schedule.TTInfoDetail; @@ -6,6 +6,7 @@ import com.bsth.entity.schedule.TTInfoDetail;
6 import com.bsth.service.schedule.TTInfoDetailService; 6 import com.bsth.service.schedule.TTInfoDetailService;
7 import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; 7 import com.bsth.service.schedule.datatools.TTInfoDetailForEdit;
8 import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; 8 import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData;
  9 +import com.bsth.service.schedule.timetable.ExcelFormatType;
9 import com.bsth.service.schedule.utils.DataToolsFile; 10 import com.bsth.service.schedule.utils.DataToolsFile;
10 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.web.bind.annotation.*; 12 import org.springframework.web.bind.annotation.*;
@@ -41,13 +42,14 @@ public class TTInfoDetailController extends BController&lt;TTInfoDetail, Long&gt; { @@ -41,13 +42,14 @@ public class TTInfoDetailController extends BController&lt;TTInfoDetail, Long&gt; {
41 */ 42 */
42 @RequestMapping(value = "/validate/sheet", method = RequestMethod.POST) 43 @RequestMapping(value = "/validate/sheet", method = RequestMethod.POST)
43 public Map<String, Object> validate_sheet( 44 public Map<String, Object> validate_sheet(
44 - String filename, String sheetname, Integer lineid, String linename, Integer lineversion) { 45 + String filename, String sheetname, Integer lineid, String linename, Integer lineversion, String excelFormatType) {
45 Map<String, Object> rtn = new HashMap<>(); 46 Map<String, Object> rtn = new HashMap<>();
46 try { 47 try {
47 if (lineversion == null) { 48 if (lineversion == null) {
48 throw new Exception("线路版本未知"); 49 throw new Exception("线路版本未知");
49 } 50 }
50 - ttInfoDetailService.validateExcelSheet(filename, sheetname, lineid, linename, lineversion); 51 + ttInfoDetailService.validateExcelSheet(filename, sheetname, lineid, linename, lineversion,
  52 + ExcelFormatType.getEnum(excelFormatType));
51 rtn.put("status", ResponseCode.SUCCESS); 53 rtn.put("status", ResponseCode.SUCCESS);
52 } catch (Exception exp) { 54 } catch (Exception exp) {
53 rtn.put("status", ResponseCode.ERROR); 55 rtn.put("status", ResponseCode.ERROR);
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java
@@ -3,6 +3,7 @@ package com.bsth.data.schedule.thread; @@ -3,6 +3,7 @@ package com.bsth.data.schedule.thread;
3 import com.bsth.data.directive.DayOfDirectives; 3 import com.bsth.data.directive.DayOfDirectives;
4 import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess; 4 import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
5 import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread; 5 import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
  6 +import com.bsth.service.calc.CalcWaybillService;
6 import com.bsth.service.oil.DlbService; 7 import com.bsth.service.oil.DlbService;
7 import com.bsth.data.safe_driv.SafeDrivCenter; 8 import com.bsth.data.safe_driv.SafeDrivCenter;
8 import com.bsth.service.oil.YlbService; 9 import com.bsth.service.oil.YlbService;
@@ -31,6 +32,9 @@ public class CalcOilThread extends Thread{ @@ -31,6 +32,9 @@ public class CalcOilThread extends Thread{
31 32
32 @Autowired 33 @Autowired
33 DayOfDirectives dayOfDirectives; 34 DayOfDirectives dayOfDirectives;
  35 +
  36 + @Autowired
  37 + CalcWaybillService calcWaybillService;
34 38
35 @Override 39 @Override
36 public void run() { 40 public void run() {
@@ -42,6 +46,9 @@ public class CalcOilThread extends Thread{ @@ -42,6 +46,9 @@ public class CalcOilThread extends Thread{
42 logger.info("开始计算班次准点率...."); 46 logger.info("开始计算班次准点率....");
43 sheetService.saveSheetList(""); 47 sheetService.saveSheetList("");
44 logger.info("计算班次准点率结束!"); 48 logger.info("计算班次准点率结束!");
  49 + logger.info("开始保存统计日报....");
  50 + calcWaybillService.calcDaily("", "");
  51 + logger.info("统计日报保存完成!");
45 } catch(Exception e){ 52 } catch(Exception e){
46 logger.error("计算路单里程加注量失败",e); 53 logger.error("计算路单里程加注量失败",e);
47 } 54 }
src/main/java/com/bsth/entity/calc/CalcInterval.java 0 → 100644
  1 +package com.bsth.entity.calc;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "calc_interval")
  12 +public class CalcInterval {
  13 + /* 主键*/
  14 + @Id
  15 + @GeneratedValue
  16 + private Long id;
  17 + /* 公司代码*/
  18 + private String gsdm;
  19 + /* 公司名称*/
  20 + private String gsname;
  21 + /* 分公司代码*/
  22 + private String fgsdm;
  23 + /* 分公司名称*/
  24 + private String fgsname;
  25 + /* 日期*/
  26 + private Date rq;
  27 + /* 日期字符串*/
  28 + private String rqStr;
  29 + /* 线路编码*/
  30 + private String xl;
  31 + /* 线路名称*/
  32 + private String xlName;
  33 + /* 大间隔次数*/
  34 + private int djg;
  35 + /* 大间隔次数(早高峰)*/
  36 + private int djgM;
  37 + /* 大间隔次数(晚高峰)*/
  38 + private int djgA;
  39 + /* 最大大间隔时间*/
  40 + private int djgTime;
  41 + /* 备注*/
  42 + private String remark;
  43 + public Long getId() {
  44 + return id;
  45 + }
  46 + public void setId(Long id) {
  47 + this.id = id;
  48 + }
  49 + public String getGsdm() {
  50 + return gsdm;
  51 + }
  52 + public void setGsdm(String gsdm) {
  53 + this.gsdm = gsdm;
  54 + }
  55 + public String getGsname() {
  56 + return gsname;
  57 + }
  58 + public void setGsname(String gsname) {
  59 + this.gsname = gsname;
  60 + }
  61 + public String getFgsdm() {
  62 + return fgsdm;
  63 + }
  64 + public void setFgsdm(String fgsdm) {
  65 + this.fgsdm = fgsdm;
  66 + }
  67 + public String getFgsname() {
  68 + return fgsname;
  69 + }
  70 + public void setFgsname(String fgsname) {
  71 + this.fgsname = fgsname;
  72 + }
  73 + public Date getRq() {
  74 + return rq;
  75 + }
  76 + public void setRq(Date rq) {
  77 + this.rq = rq;
  78 + }
  79 + public String getRqStr() {
  80 + return rqStr;
  81 + }
  82 + public void setRqStr(String rqStr) {
  83 + this.rqStr = rqStr;
  84 + }
  85 + public String getXl() {
  86 + return xl;
  87 + }
  88 + public void setXl(String xl) {
  89 + this.xl = xl;
  90 + }
  91 + public String getXlName() {
  92 + return xlName;
  93 + }
  94 + public void setXlName(String xlName) {
  95 + this.xlName = xlName;
  96 + }
  97 + public int getDjg() {
  98 + return djg;
  99 + }
  100 + public void setDjg(int djg) {
  101 + this.djg = djg;
  102 + }
  103 + public int getDjgM() {
  104 + return djgM;
  105 + }
  106 + public void setDjgM(int djgM) {
  107 + this.djgM = djgM;
  108 + }
  109 + public int getDjgA() {
  110 + return djgA;
  111 + }
  112 + public void setDjgA(int djgA) {
  113 + this.djgA = djgA;
  114 + }
  115 + public int getDjgTime() {
  116 + return djgTime;
  117 + }
  118 + public void setDjgTime(int djgTime) {
  119 + this.djgTime = djgTime;
  120 + }
  121 + public String getRemark() {
  122 + return remark;
  123 + }
  124 + public void setRemark(String remark) {
  125 + this.remark = remark;
  126 + }
  127 +
  128 +}
src/main/java/com/bsth/entity/calc/CalcStatistics.java 0 → 100644
  1 +package com.bsth.entity.calc;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "calc_statistics")
  12 +public class CalcStatistics {
  13 + /* 主键*/
  14 + @Id
  15 + @GeneratedValue
  16 + private Long id;
  17 + /* 日期*/
  18 + private Date date;
  19 + /* 日期字符串*/
  20 + private String dateStr;
  21 + /* 线路编码*/
  22 + private String xl;
  23 + /* 线路名称*/
  24 + private String xlName;
  25 + /* 公司代码*/
  26 + private String gsdm;
  27 + /* 分公司代码*/
  28 + private String fgsdm;
  29 + /* 计划总公里*/
  30 + private Double jhzlc;
  31 + /* 计划营运公里*/
  32 + private Double jhyylc;
  33 + /* 计划空驶公里*/
  34 + private Double jhkslc;
  35 + /* 实际总公里*/
  36 + private Double sjzlc;
  37 + /* 实际营运公里*/
  38 + private Double sjyylc;
  39 + /* 实际空驶公里*/
  40 + private Double sjkslc;
  41 + /* 少驶公里*/
  42 + private Double sslc;
  43 + /* 少驶班次*/
  44 + private int ssbc;
  45 + /* 路阻公里*/
  46 + private Double lzlc;
  47 + /* 吊慢公里*/
  48 + private Double dmlc;
  49 + /* 故障公里*/
  50 + private Double gzlc;
  51 + /* 纠纷公里*/
  52 + private Double jflc;
  53 + /* 肇事公里*/
  54 + private Double zslc;
  55 + /* 缺人公里*/
  56 + private Double qrlc;
  57 + /* 缺车公里*/
  58 + private Double qclc;
  59 + /* 客稀公里*/
  60 + private Double kxlc;
  61 + /* 气候公里*/
  62 + private Double qhlc;
  63 + /* 援外公里*/
  64 + private Double ywlc;
  65 + /* 其他公里*/
  66 + private Double qtlc;
  67 + /* 临加公里*/
  68 + private Double ljlc;
  69 + /* 计划班次*/
  70 + private int jhbcq;
  71 + /* 计划班次(早高峰)*/
  72 + private int jhbcz;
  73 + /* 计划班次(晚高峰)*/
  74 + private int jhbcw;
  75 + /* 实际班次*/
  76 + private int sjbcq;
  77 + /* 实际班次(早高峰)*/
  78 + private int sjbcz;
  79 + /* 实际班次(晚高峰)*/
  80 + private int sjbcw;
  81 + /* 临加班次*/
  82 + private int ljbcq;
  83 + /* 临加班次(早高峰)*/
  84 + private int ljbcz;
  85 + /* 临加班次(晚高峰)*/
  86 + private int ljbcw;
  87 + /* 放站班次*/
  88 + private int fzbcq;
  89 + /* 放站班次(早高峰)*/
  90 + private int fzbcz;
  91 + /* 放站班次(晚高峰)*/
  92 + private int fzbcw;
  93 + /* 调头班次*/
  94 + private int dtbcq;
  95 + /* 调头班次(早高峰)*/
  96 + private int dtbcz;
  97 + /* 调头班次(晚高峰)*/
  98 + private int dtbcw;
  99 + /* 大间隔次数*/
  100 + private int djgq;
  101 + /* 大间隔次数(早高峰)*/
  102 + private int djgz;
  103 + /* 大间隔次数(晚高峰)*/
  104 + private int djgw;
  105 + /* 最大大间隔时间*/
  106 + private int djgsj;
  107 + /* 备注*/
  108 + private String remark;
  109 +
  110 +
  111 + public Long getId() {
  112 + return id;
  113 + }
  114 + public void setId(Long id) {
  115 + this.id = id;
  116 + }
  117 + public Date getDate() {
  118 + return date;
  119 + }
  120 + public void setDate(Date date) {
  121 + this.date = date;
  122 + }
  123 + public String getDateStr() {
  124 + return dateStr;
  125 + }
  126 + public void setDateStr(String dateStr) {
  127 + this.dateStr = dateStr;
  128 + }
  129 + public String getXl() {
  130 + return xl;
  131 + }
  132 + public void setXl(String xl) {
  133 + this.xl = xl;
  134 + }
  135 + public String getXlName() {
  136 + return xlName;
  137 + }
  138 + public void setXlName(String xlName) {
  139 + this.xlName = xlName;
  140 + }
  141 + public String getGsdm() {
  142 + return gsdm;
  143 + }
  144 + public void setGsdm(String gsdm) {
  145 + this.gsdm = gsdm;
  146 + }
  147 + public String getFgsdm() {
  148 + return fgsdm;
  149 + }
  150 + public void setFgsdm(String fgsdm) {
  151 + this.fgsdm = fgsdm;
  152 + }
  153 + public Double getJhzlc() {
  154 + return jhzlc;
  155 + }
  156 + public void setJhzlc(Double jhzlc) {
  157 + this.jhzlc = jhzlc;
  158 + }
  159 + public Double getJhyylc() {
  160 + return jhyylc;
  161 + }
  162 + public void setJhyylc(Double jhyylc) {
  163 + this.jhyylc = jhyylc;
  164 + }
  165 + public Double getJhkslc() {
  166 + return jhkslc;
  167 + }
  168 + public void setJhkslc(Double jhkslc) {
  169 + this.jhkslc = jhkslc;
  170 + }
  171 + public Double getSjzlc() {
  172 + return sjzlc;
  173 + }
  174 + public void setSjzlc(Double sjzlc) {
  175 + this.sjzlc = sjzlc;
  176 + }
  177 + public Double getSjyylc() {
  178 + return sjyylc;
  179 + }
  180 + public void setSjyylc(Double sjyylc) {
  181 + this.sjyylc = sjyylc;
  182 + }
  183 + public Double getSjkslc() {
  184 + return sjkslc;
  185 + }
  186 + public void setSjkslc(Double sjkslc) {
  187 + this.sjkslc = sjkslc;
  188 + }
  189 + public Double getSslc() {
  190 + return sslc;
  191 + }
  192 + public void setSslc(Double sslc) {
  193 + this.sslc = sslc;
  194 + }
  195 + public int getSsbc() {
  196 + return ssbc;
  197 + }
  198 + public void setSsbc(int ssbc) {
  199 + this.ssbc = ssbc;
  200 + }
  201 + public Double getLzlc() {
  202 + return lzlc;
  203 + }
  204 + public void setLzlc(Double lzlc) {
  205 + this.lzlc = lzlc;
  206 + }
  207 + public Double getDmlc() {
  208 + return dmlc;
  209 + }
  210 + public void setDmlc(Double dmlc) {
  211 + this.dmlc = dmlc;
  212 + }
  213 + public Double getGzlc() {
  214 + return gzlc;
  215 + }
  216 + public void setGzlc(Double gzlc) {
  217 + this.gzlc = gzlc;
  218 + }
  219 + public Double getJflc() {
  220 + return jflc;
  221 + }
  222 + public void setJflc(Double jflc) {
  223 + this.jflc = jflc;
  224 + }
  225 + public Double getZslc() {
  226 + return zslc;
  227 + }
  228 + public void setZslc(Double zslc) {
  229 + this.zslc = zslc;
  230 + }
  231 + public Double getQrlc() {
  232 + return qrlc;
  233 + }
  234 + public void setQrlc(Double qrlc) {
  235 + this.qrlc = qrlc;
  236 + }
  237 + public Double getQclc() {
  238 + return qclc;
  239 + }
  240 + public void setQclc(Double qclc) {
  241 + this.qclc = qclc;
  242 + }
  243 + public Double getKxlc() {
  244 + return kxlc;
  245 + }
  246 + public void setKxlc(Double kxlc) {
  247 + this.kxlc = kxlc;
  248 + }
  249 + public Double getQhlc() {
  250 + return qhlc;
  251 + }
  252 + public void setQhlc(Double qhlc) {
  253 + this.qhlc = qhlc;
  254 + }
  255 + public Double getYwlc() {
  256 + return ywlc;
  257 + }
  258 + public void setYwlc(Double ywlc) {
  259 + this.ywlc = ywlc;
  260 + }
  261 + public Double getQtlc() {
  262 + return qtlc;
  263 + }
  264 + public void setQtlc(Double qtlc) {
  265 + this.qtlc = qtlc;
  266 + }
  267 + public Double getLjlc() {
  268 + return ljlc;
  269 + }
  270 + public void setLjlc(Double ljlc) {
  271 + this.ljlc = ljlc;
  272 + }
  273 + public int getJhbcq() {
  274 + return jhbcq;
  275 + }
  276 + public void setJhbcq(int jhbcq) {
  277 + this.jhbcq = jhbcq;
  278 + }
  279 + public int getJhbcz() {
  280 + return jhbcz;
  281 + }
  282 + public void setJhbcz(int jhbcz) {
  283 + this.jhbcz = jhbcz;
  284 + }
  285 + public int getJhbcw() {
  286 + return jhbcw;
  287 + }
  288 + public void setJhbcw(int jhbcw) {
  289 + this.jhbcw = jhbcw;
  290 + }
  291 + public int getSjbcq() {
  292 + return sjbcq;
  293 + }
  294 + public void setSjbcq(int sjbcq) {
  295 + this.sjbcq = sjbcq;
  296 + }
  297 + public int getSjbcz() {
  298 + return sjbcz;
  299 + }
  300 + public void setSjbcz(int sjbcz) {
  301 + this.sjbcz = sjbcz;
  302 + }
  303 + public int getSjbcw() {
  304 + return sjbcw;
  305 + }
  306 + public void setSjbcw(int sjbcw) {
  307 + this.sjbcw = sjbcw;
  308 + }
  309 + public int getLjbcq() {
  310 + return ljbcq;
  311 + }
  312 + public void setLjbcq(int ljbcq) {
  313 + this.ljbcq = ljbcq;
  314 + }
  315 + public int getLjbcz() {
  316 + return ljbcz;
  317 + }
  318 + public void setLjbcz(int ljbcz) {
  319 + this.ljbcz = ljbcz;
  320 + }
  321 + public int getLjbcw() {
  322 + return ljbcw;
  323 + }
  324 + public void setLjbcw(int ljbcw) {
  325 + this.ljbcw = ljbcw;
  326 + }
  327 + public int getFzbcq() {
  328 + return fzbcq;
  329 + }
  330 + public void setFzbcq(int fzbcq) {
  331 + this.fzbcq = fzbcq;
  332 + }
  333 + public int getFzbcz() {
  334 + return fzbcz;
  335 + }
  336 + public void setFzbcz(int fzbcz) {
  337 + this.fzbcz = fzbcz;
  338 + }
  339 + public int getFzbcw() {
  340 + return fzbcw;
  341 + }
  342 + public void setFzbcw(int fzbcw) {
  343 + this.fzbcw = fzbcw;
  344 + }
  345 + public int getDtbcq() {
  346 + return dtbcq;
  347 + }
  348 + public void setDtbcq(int dtbcq) {
  349 + this.dtbcq = dtbcq;
  350 + }
  351 + public int getDtbcz() {
  352 + return dtbcz;
  353 + }
  354 + public void setDtbcz(int dtbcz) {
  355 + this.dtbcz = dtbcz;
  356 + }
  357 + public int getDtbcw() {
  358 + return dtbcw;
  359 + }
  360 + public void setDtbcw(int dtbcw) {
  361 + this.dtbcw = dtbcw;
  362 + }
  363 + public int getDjgq() {
  364 + return djgq;
  365 + }
  366 + public void setDjgq(int djgq) {
  367 + this.djgq = djgq;
  368 + }
  369 + public int getDjgz() {
  370 + return djgz;
  371 + }
  372 + public void setDjgz(int djgz) {
  373 + this.djgz = djgz;
  374 + }
  375 + public int getDjgw() {
  376 + return djgw;
  377 + }
  378 + public void setDjgw(int djgw) {
  379 + this.djgw = djgw;
  380 + }
  381 + public int getDjgsj() {
  382 + return djgsj;
  383 + }
  384 + public void setDjgsj(int djgsj) {
  385 + this.djgsj = djgsj;
  386 + }
  387 + public String getRemark() {
  388 + return remark;
  389 + }
  390 + public void setRemark(String remark) {
  391 + this.remark = remark;
  392 + }
  393 +
  394 +}
src/main/java/com/bsth/repository/calc/CalcIntervalRepository.java 0 → 100644
  1 +package com.bsth.repository.calc;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.transaction.Transactional;
  6 +
  7 +import com.bsth.entity.calc.CalcInterval;
  8 +import com.bsth.repository.BaseRepository;
  9 +
  10 +import org.springframework.data.jpa.repository.Modifying;
  11 +import org.springframework.data.jpa.repository.Query;
  12 +import org.springframework.stereotype.Repository;
  13 +
  14 +/**
  15 + *
  16 + */
  17 +@Repository
  18 +public interface CalcIntervalRepository extends BaseRepository<CalcInterval, Integer>{
  19 +
  20 + //按照时间段统计,公司下线路
  21 + @Query(value="select DISTINCT c from CalcInterval c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.xl")
  22 + List<CalcInterval> selectByDateAndLine(String line,String date,String date2,String gsdm,String fgsdm);
  23 +
  24 + //按照时间段统计,单条线路
  25 + @Query(value="select DISTINCT c from CalcInterval c where c.xl = ?1 and c.rqStr between ?2 and ?3 order by c.xl")
  26 + List<CalcInterval> selectByDateAndLine(String line,String date,String date2);
  27 +
  28 + //按照日期和线路删除数据
  29 + @Modifying
  30 + @Transactional
  31 + @Query(value = "delete CalcInterval c where c.rqStr=?1 and c.xl=?2")
  32 + void deleteByDateAndLine(String date, String line);
  33 +
  34 + //按照日期删除数据
  35 + @Modifying
  36 + @Transactional
  37 + @Query(value = "delete CalcInterval c where c.rqStr=?1")
  38 + void deleteByDate(String date);
  39 +
  40 +}
src/main/java/com/bsth/repository/calc/CalcStatisticsRepository.java 0 → 100644
  1 +package com.bsth.repository.calc;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.transaction.Transactional;
  6 +
  7 +import com.bsth.entity.calc.CalcStatistics;
  8 +import com.bsth.entity.calc.CalcWaybill;
  9 +import com.bsth.repository.BaseRepository;
  10 +
  11 +import org.springframework.data.jpa.repository.Modifying;
  12 +import org.springframework.data.jpa.repository.Query;
  13 +import org.springframework.stereotype.Repository;
  14 +
  15 +/**
  16 + *
  17 + */
  18 +@Repository
  19 +public interface CalcStatisticsRepository extends BaseRepository<CalcStatistics, Integer>{
  20 +
  21 + //按照时间段统计,公司下线路
  22 + @Query(value="select DISTINCT c from CalcStatistics c where c.xl like %?1% and c.dateStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.xl")
  23 + List<CalcStatistics> selectByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm);
  24 +
  25 + //按照时间段统计,单条线路
  26 + @Query(value="select DISTINCT c from CalcStatistics c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.xl")
  27 + List<CalcStatistics> selectByDateAndLineTj2(String line,String date,String date2);
  28 +
  29 + //按照日期和线路删除数据
  30 + @Modifying
  31 + @Transactional
  32 + @Query(value = "delete CalcStatistics c where c.dateStr=?1 and c.xl=?2")
  33 + void deleteByDateAndLine(String date, String line);
  34 +
  35 + //按照日期删除数据
  36 + @Modifying
  37 + @Transactional
  38 + @Query(value = "delete CalcStatistics c where c.dateStr=?1")
  39 + void deleteByDate(String date);
  40 +
  41 +}
src/main/java/com/bsth/service/calc/CalcCulateMileageService.java
1 package com.bsth.service.calc; 1 package com.bsth.service.calc;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +import java.util.Map;
4 5
5 import com.bsth.entity.realcontrol.ScheduleRealInfo; 6 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  7 +import com.bsth.entity.sys.Interval;
6 8
7 9
8 public interface CalcCulateMileageService { 10 public interface CalcCulateMileageService {
@@ -25,6 +27,7 @@ public interface CalcCulateMileageService { @@ -25,6 +27,7 @@ public interface CalcCulateMileageService {
25 double culateLbgl(List<ScheduleRealInfo> lists);//烂班公里 27 double culateLbgl(List<ScheduleRealInfo> lists);//烂班公里
26 double culateCJLC(List<ScheduleRealInfo> lists,String item);//烂班公里详细 28 double culateCJLC(List<ScheduleRealInfo> lists,String item);//烂班公里详细
27 int culateDtfzbc(List<ScheduleRealInfo> lists,String type,String item);//掉头放站班次 29 int culateDtfzbc(List<ScheduleRealInfo> lists,String type,String item);//掉头放站班次
  30 + Map<String, Object> culateDjg(List<ScheduleRealInfo> lists,String line, List<Map<String, Object>> xlList, List<Interval> djgList);//大间隔
28 31
29 } 32 }
30 33
src/main/java/com/bsth/service/calc/CalcToolService.java
1 package com.bsth.service.calc; 1 package com.bsth.service.calc;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +import java.util.Map;
4 5
5 import com.bsth.entity.calc.CalcWaybill; 6 import com.bsth.entity.calc.CalcWaybill;
  7 +import com.bsth.entity.sys.Interval;
6 8
7 /** 9 /**
8 * Created by 17/11/16. 10 * Created by 17/11/16.
9 */ 11 */
10 public interface CalcToolService { 12 public interface CalcToolService {
11 13
12 - List<CalcWaybill> findAll(String date, String line); 14 + List<CalcWaybill> findAll(String date, String line, List<Map<String, Object>> xlList, List<Interval> djgList);
13 15
14 } 16 }
src/main/java/com/bsth/service/calc/CalcWaybillService.java
@@ -3,6 +3,7 @@ package com.bsth.service.calc; @@ -3,6 +3,7 @@ package com.bsth.service.calc;
3 import java.util.List; 3 import java.util.List;
4 import java.util.Map; 4 import java.util.Map;
5 5
  6 +import com.bsth.entity.calc.CalcStatistics;
6 import com.bsth.entity.calc.CalcWaybill; 7 import com.bsth.entity.calc.CalcWaybill;
7 import com.bsth.service.BaseService; 8 import com.bsth.service.BaseService;
8 9
@@ -14,5 +15,12 @@ public interface CalcWaybillService extends BaseService&lt;CalcWaybill, Integer&gt; { @@ -14,5 +15,12 @@ public interface CalcWaybillService extends BaseService&lt;CalcWaybill, Integer&gt; {
14 Map<String, Object> generateNew(String date, String line) throws Exception; 15 Map<String, Object> generateNew(String date, String line) throws Exception;
15 16
16 List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type); 17 List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
  18 +
  19 + /**
  20 + * @param rq 格式如:2018-03-22(留空""默认当前日期前一天)
  21 + * @param line (留空""默认全部线路)
  22 + */
  23 + String calcDaily(String rq, String line) throws Exception;
17 24
  25 + List<CalcStatistics> calcStatisticsDaily(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
18 } 26 }
src/main/java/com/bsth/service/calc/impl/CalcCulateMileageServiceImpl.java
1 package com.bsth.service.calc.impl; 1 package com.bsth.service.calc.impl;
2 2
  3 +import java.text.DecimalFormat;
  4 +import java.text.ParseException;
  5 +import java.text.SimpleDateFormat;
  6 +import java.util.ArrayList;
  7 +import java.util.Collections;
  8 +import java.util.Comparator;
  9 +import java.util.HashMap;
3 import java.util.Iterator; 10 import java.util.Iterator;
4 import java.util.List; 11 import java.util.List;
  12 +import java.util.Map;
5 import java.util.Set; 13 import java.util.Set;
6 14
7 import org.apache.commons.lang.StringUtils; 15 import org.apache.commons.lang.StringUtils;
@@ -11,8 +19,10 @@ import org.springframework.stereotype.Service; @@ -11,8 +19,10 @@ import org.springframework.stereotype.Service;
11 19
12 import com.bsth.entity.realcontrol.ChildTaskPlan; 20 import com.bsth.entity.realcontrol.ChildTaskPlan;
13 import com.bsth.entity.realcontrol.ScheduleRealInfo; 21 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  22 +import com.bsth.entity.sys.Interval;
14 import com.bsth.service.calc.CalcCulateMileageService; 23 import com.bsth.service.calc.CalcCulateMileageService;
15 import com.bsth.util.Arith; 24 import com.bsth.util.Arith;
  25 +import com.bsth.util.ComparableChild;
16 26
17 @Service 27 @Service
18 public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ 28 public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{
@@ -234,7 +244,7 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ @@ -234,7 +244,7 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{
234 double sjgl =0; 244 double sjgl =0;
235 for (int i = 0; i < lists.size(); i++) { 245 for (int i = 0; i < lists.size(); i++) {
236 ScheduleRealInfo scheduleRealInfo=lists.get(i); 246 ScheduleRealInfo scheduleRealInfo=lists.get(i);
237 -// if(!scheduleRealInfo.isSflj()){ 247 + if(!scheduleRealInfo.isSflj()){
238 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 248 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
239 if(childTaskPlans.isEmpty()){ 249 if(childTaskPlans.isEmpty()){
240 if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") 250 if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
@@ -264,7 +274,7 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ @@ -264,7 +274,7 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{
264 } 274 }
265 } 275 }
266 } 276 }
267 -// } 277 + }
268 } 278 }
269 return sjgl; 279 return sjgl;
270 } 280 }
@@ -670,4 +680,196 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ @@ -670,4 +680,196 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{
670 } 680 }
671 return bc; 681 return bc;
672 } 682 }
  683 +
  684 + public ScheduleRealInfo checkBc(ScheduleRealInfo s){
  685 + //如果班次有子任务 且 子任务中有属于营运的。把该子任务的发车时间设置成班次的发车时间
  686 + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
  687 + if(fcsj.equals("")){
  688 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  689 + if(!childTaskPlans.isEmpty()){
  690 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  691 + Collections.sort(listit, new ComparableChild());
  692 + for (int i = 0; i < listit.size(); i++) {
  693 + ChildTaskPlan c=listit.get(i);
  694 + if(!c.isDestroy()){
  695 + if(c.getMileageType().equals("service")){
  696 + s.setFcsjActual(c.getStartDate());
  697 + break;
  698 + }
  699 +
  700 + }
  701 + }
  702 + }
  703 + }
  704 + return s;
  705 + }
  706 +
  707 + public Map<String, Object> listDjg(int peak,int trough,List<ScheduleRealInfo> listInfo,String grade){
  708 + DecimalFormat df = new DecimalFormat("#0.00");
  709 + Collections.sort(listInfo, new ComparableAcuals());
  710 + List<ScheduleRealInfo> listInfo0=new ArrayList<ScheduleRealInfo>();
  711 + List<ScheduleRealInfo> listInfo1=new ArrayList<ScheduleRealInfo>();
  712 + for (int i = 0; i < listInfo.size(); i++) {
  713 + ScheduleRealInfo s=listInfo.get(i);
  714 + if(s.getXlDir().equals("0")){
  715 + listInfo0.add(s);
  716 + }else{
  717 + listInfo0.add(s);
  718 + }
  719 + }
  720 + Map<String, Object> map=new HashMap<String,Object>();
  721 + int djgcsz=0;
  722 + int djgcsw=0;
  723 + int djgcsq=0;
  724 + long djcsj=0l;
  725 + for (int i = 0; i < listInfo0.size(); i++) {
  726 + ScheduleRealInfo s=listInfo.get(i);
  727 + Long fcsjTime=s.getFcsjActualTime();
  728 + String time=s.getFcsjActual();
  729 + String[] fcsjStr = time.split(":");
  730 + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
  731 + if(i<listInfo.size()-1){
  732 + Long djg=0l;
  733 + Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  734 + if((fcsj>=zgf1&&fcsj<=zgf2)){
  735 + djg = (long) (peak*60*1000);
  736 + if(fscjNext-fcsjTime>djg){
  737 + djgcsz ++;
  738 + djgcsq ++;
  739 + if(fscjNext-fcsjTime>djcsj){
  740 + djcsj=(fscjNext-fcsjTime)/60000;
  741 + }
  742 + }
  743 + }else if((fcsj>=wgf1&&fcsj<=wgf2)){
  744 + djg = (long) (peak*60*1000);
  745 + if(fscjNext-fcsjTime>djg){
  746 + djgcsw ++;
  747 + djgcsq ++;
  748 + if(fscjNext-fcsjTime>djcsj){
  749 + djcsj=(fscjNext-fcsjTime)/60000;
  750 + }
  751 + }
  752 + }else{
  753 + djg = (long) (trough*60*1000);
  754 + if(fscjNext-fcsjTime>djg){
  755 + djgcsq ++;
  756 + if(fscjNext-fcsjTime>djcsj){
  757 + djcsj=(fscjNext-fcsjTime)/60000;
  758 + }
  759 + }
  760 + }
  761 + }
  762 + }
  763 + for (int i = 0; i < listInfo1.size(); i++) {
  764 + ScheduleRealInfo s=listInfo.get(i);
  765 + Long fcsjTime=s.getFcsjActualTime();
  766 + String time=s.getFcsjActual();
  767 + String[] fcsjStr = time.split(":");
  768 + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
  769 + if(i<listInfo.size()-1){
  770 + Long djg=0l;
  771 + Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  772 + if(fcsj>=zgf1&&fcsj<=zgf2){
  773 + djg = (long) (peak*60*1000);
  774 + if(fscjNext-fcsjTime>djg){
  775 + djgcsz ++;
  776 + djgcsq ++;
  777 + if(fscjNext-fcsjTime>djcsj){
  778 + djcsj=(fscjNext-fcsjTime)/60000;
  779 + }
  780 + }
  781 + }else if(fcsj>=wgf1&&fcsj<=wgf2){
  782 + djg = (long) (peak*60*1000);
  783 + if(fscjNext-fcsjTime>djg){
  784 + djgcsw ++;
  785 + djgcsq ++;
  786 + if(fscjNext-fcsjTime>djcsj){
  787 + djcsj=(fscjNext-fcsjTime)/60000;
  788 + }
  789 + }
  790 + }else{
  791 + djg = (long) (trough*60*1000);
  792 + if(fscjNext-fcsjTime>djg){
  793 + djgcsq ++;
  794 + if(fscjNext-fcsjTime>djcsj){
  795 + djcsj=(fscjNext-fcsjTime)/60000;
  796 + }
  797 + }
  798 + }
  799 + }
  800 + }
  801 +
  802 + map.put("djgcsz", djgcsz);
  803 + map.put("djgcsw", djgcsw);
  804 + map.put("djgcsq", djgcsq);
  805 + map.put("djgsj", djcsj);
  806 + return map;
  807 + }
  808 +
  809 + @Override
  810 + public Map<String, Object> culateDjg(List<ScheduleRealInfo> lists,
  811 + String line, List<Map<String, Object>> xlList, List<Interval> djgList) {
  812 + // TODO Auto-generated method stub
  813 +
  814 +
  815 + // TODO Auto-generated method stub
  816 + List<ScheduleRealInfo> list=lists;
  817 + Map<String, Object> m=new HashMap<String,Object>();
  818 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
  819 +// Collections.sort(listInfo,new ComparableAcuals());
  820 +
  821 + for (int i = 0; i < xlList.size(); i++) {
  822 + String lineCode=xlList.get(i).get("line").toString();
  823 + String grade =xlList.get(i).get("grade")==null?"1":xlList.get(i).get("grade").toString();
  824 + int peak=0;
  825 + int trough=0;
  826 + for (int j = 0; j < djgList.size(); j++) {
  827 + Interval il=djgList.get(j);
  828 + if(il.getLevel().equals(grade)){
  829 + peak=il.getPeak();
  830 + trough=il.getTrough();
  831 + continue;
  832 + }
  833 + }
  834 + List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>();
  835 + for (int j = 0; j < list.size(); j++) {
  836 + ScheduleRealInfo sinfo=list.get(j);
  837 + try {
  838 + if(sinfo.getXlBm().equals(lineCode)){
  839 + ScheduleRealInfo s=checkBc(sinfo);
  840 + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
  841 + if(!fcsj.equals("")){
  842 + Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
  843 + s.setFcsjActualTime(fcsjAcual);
  844 + s.setFcsjActual(fcsj);
  845 + listInfo.add(s);
  846 + }
  847 + }
  848 + } catch (ParseException e) {
  849 + // TODO Auto-generated catch block
  850 + e.printStackTrace();
  851 + }
  852 + }
  853 +
  854 + if(listInfo.size()>0){
  855 + m=listDjg(peak,trough,listInfo,grade);
  856 + }else{
  857 + m.put("djgcsz", "0");
  858 + m.put("djgcsw", "0");
  859 + m.put("djgcsq", "0");
  860 + m.put("djgsj", "0");
  861 + }
  862 + }
  863 + return m;
  864 + }
673 } 865 }
  866 +
  867 +class ComparableAcuals implements Comparator<ScheduleRealInfo>{
  868 +
  869 + @Override
  870 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  871 + // TODO Auto-generated method stub
  872 + return o1.getFcsjActualTime().compareTo(o2.getFcsjActualTime());
  873 + }
  874 +
  875 +}
674 \ No newline at end of file 876 \ No newline at end of file
src/main/java/com/bsth/service/calc/impl/CalcToolServiceImpl.java
@@ -9,9 +9,14 @@ import java.util.List; @@ -9,9 +9,14 @@ import java.util.List;
9 import java.util.Map; 9 import java.util.Map;
10 import java.util.Set; 10 import java.util.Set;
11 11
  12 +import javax.swing.text.Keymap;
  13 +
  14 +import com.bsth.entity.calc.CalcInterval;
12 import com.bsth.entity.calc.CalcWaybill; 15 import com.bsth.entity.calc.CalcWaybill;
13 import com.bsth.entity.realcontrol.ChildTaskPlan; 16 import com.bsth.entity.realcontrol.ChildTaskPlan;
14 import com.bsth.entity.realcontrol.ScheduleRealInfo; 17 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  18 +import com.bsth.entity.sys.Interval;
  19 +import com.bsth.repository.calc.CalcIntervalRepository;
15 import com.bsth.repository.calc.CalcWaybillRepository; 20 import com.bsth.repository.calc.CalcWaybillRepository;
16 import com.bsth.service.calc.CalcToolService; 21 import com.bsth.service.calc.CalcToolService;
17 import com.bsth.service.calc.CalcCulateMileageService; 22 import com.bsth.service.calc.CalcCulateMileageService;
@@ -35,11 +40,11 @@ public class CalcToolServiceImpl implements CalcToolService { @@ -35,11 +40,11 @@ public class CalcToolServiceImpl implements CalcToolService {
35 private CalcWaybillRepository clacRepository; 40 private CalcWaybillRepository clacRepository;
36 41
37 @Autowired 42 @Autowired
38 - private CalcCulateMileageService culateMileageService; 43 + private CalcIntervalRepository culcIntervalRepository;
39 44
40 @Autowired 45 @Autowired
41 - private CulateMileageService culateMileageService2;  
42 - 46 + private CalcCulateMileageService culateMileageService;
  47 +
43 @Autowired 48 @Autowired
44 JdbcTemplate jdbcTemplate; 49 JdbcTemplate jdbcTemplate;
45 50
@@ -48,7 +53,7 @@ public class CalcToolServiceImpl implements CalcToolService { @@ -48,7 +53,7 @@ public class CalcToolServiceImpl implements CalcToolService {
48 53
49 54
50 @Override 55 @Override
51 - public List<CalcWaybill> findAll(String rq, String lineCode) { 56 + public List<CalcWaybill> findAll(String rq, String lineCode, List<Map<String, Object>> xlList, List<Interval> djgList) {
52 List<CalcWaybill> listCal=new ArrayList<CalcWaybill>(); 57 List<CalcWaybill> listCal=new ArrayList<CalcWaybill>();
53 List<ScheduleRealInfo> list = clacRepository.findAllSchedule(rq,lineCode); 58 List<ScheduleRealInfo> list = clacRepository.findAllSchedule(rq,lineCode);
54 String sql ="select r.j_gh ,r.s_gh,r.cl_zbh,r.xl_bm, r.lp_name FROM" 59 String sql ="select r.j_gh ,r.s_gh,r.cl_zbh,r.xl_bm, r.lp_name FROM"
@@ -104,9 +109,30 @@ public class CalcToolServiceImpl implements CalcToolService { @@ -104,9 +109,30 @@ public class CalcToolServiceImpl implements CalcToolService {
104 109
105 //计算方法 110 //计算方法
106 if(list_.size()>0){ 111 if(list_.size()>0){
107 - listCal.addAll(this.cul(list_, lists_)); 112 + listCal.addAll(this.cul(list_, lists_, xlList, djgList));
108 } 113 }
109 } 114 }
  115 +
  116 + //按线路计算大间隔
  117 + if(list.size() > 0){
  118 + ScheduleRealInfo s = list.get(0);
  119 + Map<String, Object> culateDjg = culateMileageService.culateDjg(list, lineCode, xlList, djgList);
  120 + CalcInterval interval = new CalcInterval();
  121 + interval.setGsdm(s.getGsBm());
  122 + interval.setGsname(s.getGsName());
  123 + interval.setFgsdm(s.getFgsBm());
  124 + interval.setFgsname(s.getFgsName());
  125 + interval.setRq(s.getScheduleDate());
  126 + interval.setRqStr(s.getScheduleDateStr());
  127 + interval.setXl(s.getXlBm());
  128 + interval.setXlName(s.getXlName());
  129 + interval.setDjg(Integer.valueOf(culateDjg.get("djgcsq").toString()));
  130 + interval.setDjgM(Integer.valueOf(culateDjg.get("djgcsz").toString()));
  131 + interval.setDjgA(Integer.valueOf(culateDjg.get("djgcsw").toString()));
  132 + interval.setDjgTime(Integer.valueOf(culateDjg.get("djgsj").toString()));
  133 + culcIntervalRepository.save(interval);
  134 + }
  135 +
110 while(true){ 136 while(true){
111 int i = 0, l = 0; 137 int i = 0, l = 0;
112 boolean flag = false; 138 boolean flag = false;
@@ -145,7 +171,7 @@ public class CalcToolServiceImpl implements CalcToolService { @@ -145,7 +171,7 @@ public class CalcToolServiceImpl implements CalcToolService {
145 } 171 }
146 172
147 //list_ 全部班次 lists_执行了的班次(实到实发不为空) 173 //list_ 全部班次 lists_执行了的班次(实到实发不为空)
148 - private List<CalcWaybill> cul(List<ScheduleRealInfo> list_,List<ScheduleRealInfo> lists_){ 174 + private List<CalcWaybill> cul(List<ScheduleRealInfo> list_,List<ScheduleRealInfo> list_s, List<Map<String, Object>> xlList, List<Interval> djgList){
149 List<CalcWaybill> list=new ArrayList<CalcWaybill>(); 175 List<CalcWaybill> list=new ArrayList<CalcWaybill>();
150 if(list_.size()>0){ 176 if(list_.size()>0){
151 Date date=list_.get(0).getScheduleDate(); 177 Date date=list_.get(0).getScheduleDate();
@@ -167,20 +193,20 @@ public class CalcToolServiceImpl implements CalcToolService { @@ -167,20 +193,20 @@ public class CalcToolServiceImpl implements CalcToolService {
167 int jhyybcWgf=culateMileageService.culateJhyybc(list_, "wgf"); 193 int jhyybcWgf=culateMileageService.culateJhyybc(list_, "wgf");
168 double jhyylc=culateMileageService.culateJhyylc(list_); 194 double jhyylc=culateMileageService.culateJhyylc(list_);
169 double jhfyylc=culateMileageService.culateJhfyylc(list_); 195 double jhfyylc=culateMileageService.culateJhfyylc(list_);
170 - int sjyybc=culateMileageService.culateSjyybc(lists_, "");  
171 - int sjyybcZgf=culateMileageService.culateSjyybc(lists_, "zgf");  
172 - int sjyybcWgf=culateMileageService.culateSjyybc(lists_, "wgf");  
173 - double sjyylc=culateMileageService.culateSjyylc(lists_);//驾售共有  
174 - double sjyylc_j=culateMileageService.culateSjyylc_j(lists_);//无售  
175 - double sjfyylc=culateMileageService.culateSjfyylc(lists_);//驾售  
176 - double sjfyylc_j=culateMileageService.culateSjfyylc_j(lists_);//无售  
177 - int ljbc=culateMileageService.culateLjbc(lists_, "");  
178 - int ljbcZgf=culateMileageService.culateLjbc(lists_, "zgf");  
179 - int ljbcWgf=culateMileageService.culateLjbc(lists_, "wgf");  
180 - double ljyylc=culateMileageService.culateLjyylc(lists_);//驾售  
181 - double ljyylc_j=culateMileageService.culateLjyylc_j(lists_);//无售  
182 - double ljfyylc=culateMileageService.culateLjfyylc(lists_);//驾售  
183 - double ljfyylc_j=culateMileageService.culateLjfyylc_j(lists_);//无售 196 + int sjyybc=culateMileageService.culateSjyybc(list_s, "");
  197 + int sjyybcZgf=culateMileageService.culateSjyybc(list_s, "zgf");
  198 + int sjyybcWgf=culateMileageService.culateSjyybc(list_s, "wgf");
  199 + double sjyylc=culateMileageService.culateSjyylc(list_s);//驾售共有
  200 + double sjyylc_j=culateMileageService.culateSjyylc_j(list_s);//无售
  201 + double sjfyylc=culateMileageService.culateSjfyylc(list_s);//驾售
  202 + double sjfyylc_j=culateMileageService.culateSjfyylc_j(list_s);//无售
  203 + int ljbc=culateMileageService.culateLjbc(list_s, "");
  204 + int ljbcZgf=culateMileageService.culateLjbc(list_s, "zgf");
  205 + int ljbcWgf=culateMileageService.culateLjbc(list_s, "wgf");
  206 + double ljyylc=culateMileageService.culateLjyylc(list_s);//驾售
  207 + double ljyylc_j=culateMileageService.culateLjyylc_j(list_s);//无售
  208 + double ljfyylc=culateMileageService.culateLjfyylc(list_s);//驾售
  209 + double ljfyylc_j=culateMileageService.culateLjfyylc_j(list_s);//无售
184 int lbbc=culateMileageService.culateLbbc(list_); 210 int lbbc=culateMileageService.culateLbbc(list_);
185 double lblc=culateMileageService.culateLbgl(list_); 211 double lblc=culateMileageService.culateLbgl(list_);
186 double ssgl_lz= culateMileageService.culateCJLC(list_, "路阻"); 212 double ssgl_lz= culateMileageService.culateCJLC(list_, "路阻");
@@ -199,12 +225,12 @@ public class CalcToolServiceImpl implements CalcToolService { @@ -199,12 +225,12 @@ public class CalcToolServiceImpl implements CalcToolService {
199 double ssgl_cj=culateMileageService.culateCJLC(list_, "抽减"); 225 double ssgl_cj=culateMileageService.culateCJLC(list_, "抽减");
200 double ssgl_qt=culateMileageService.culateCJLC(list_, "其他"); 226 double ssgl_qt=culateMileageService.culateCJLC(list_, "其他");
201 double ssgl_qtz=Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj,ssgl_qt)); 227 double ssgl_qtz=Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj,ssgl_qt));
202 - int fzbc=culateMileageService.culateDtfzbc(lists_, "major", "");//放站  
203 - int fzbcZgf=culateMileageService.culateDtfzbc(lists_, "major", "zgf");  
204 - int fzbcWgf=culateMileageService.culateDtfzbc(lists_, "major", "wgf");  
205 - int zfbc=culateMileageService.culateDtfzbc(lists_, "venting", "");//直放  
206 - int zfbcZgf=culateMileageService.culateDtfzbc(lists_, "venting", "zgf");  
207 - int zfbcWgf=culateMileageService.culateDtfzbc(lists_, "venting", "wgf"); 228 + int fzbc=culateMileageService.culateDtfzbc(list_s, "major", "");//放站
  229 + int fzbcZgf=culateMileageService.culateDtfzbc(list_s, "major", "zgf");
  230 + int fzbcWgf=culateMileageService.culateDtfzbc(list_s, "major", "wgf");
  231 + int zfbc=culateMileageService.culateDtfzbc(list_s, "venting", "");//直放
  232 + int zfbcZgf=culateMileageService.culateDtfzbc(list_s, "venting", "zgf");
  233 + int zfbcWgf=culateMileageService.culateDtfzbc(list_s, "venting", "wgf");
208 CalcWaybill t=new CalcWaybill(); 234 CalcWaybill t=new CalcWaybill();
209 t.setRq(date); 235 t.setRq(date);
210 t.setRqStr(dateStr); 236 t.setRqStr(dateStr);
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -2,9 +2,15 @@ package com.bsth.service.calc.impl; @@ -2,9 +2,15 @@ package com.bsth.service.calc.impl;
2 2
3 import java.sql.ResultSet; 3 import java.sql.ResultSet;
4 import java.sql.SQLException; 4 import java.sql.SQLException;
  5 +import java.text.SimpleDateFormat;
5 import java.util.ArrayList; 6 import java.util.ArrayList;
  7 +import java.util.Calendar;
  8 +import java.util.Collections;
  9 +import java.util.Comparator;
  10 +import java.util.Date;
6 import java.util.HashMap; 11 import java.util.HashMap;
7 import java.util.HashSet; 12 import java.util.HashSet;
  13 +import java.util.Iterator;
8 import java.util.List; 14 import java.util.List;
9 import java.util.Map; 15 import java.util.Map;
10 import java.util.Set; 16 import java.util.Set;
@@ -12,13 +18,25 @@ import java.util.Set; @@ -12,13 +18,25 @@ import java.util.Set;
12 import javax.transaction.Transactional; 18 import javax.transaction.Transactional;
13 19
14 import com.bsth.common.ResponseCode; 20 import com.bsth.common.ResponseCode;
  21 +import com.bsth.entity.calc.CalcInterval;
  22 +import com.bsth.entity.calc.CalcStatistics;
15 import com.bsth.entity.calc.CalcWaybill; 23 import com.bsth.entity.calc.CalcWaybill;
  24 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  25 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  26 +import com.bsth.entity.sys.Interval;
  27 +import com.bsth.repository.calc.CalcIntervalRepository;
  28 +import com.bsth.repository.calc.CalcStatisticsRepository;
16 import com.bsth.repository.calc.CalcWaybillRepository; 29 import com.bsth.repository.calc.CalcWaybillRepository;
  30 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
17 import com.bsth.service.calc.CalcToolService; 31 import com.bsth.service.calc.CalcToolService;
18 import com.bsth.service.calc.CalcWaybillService; 32 import com.bsth.service.calc.CalcWaybillService;
19 import com.bsth.service.impl.BaseServiceImpl; 33 import com.bsth.service.impl.BaseServiceImpl;
  34 +import com.bsth.service.report.CulateMileageService;
20 import com.bsth.util.Arith; 35 import com.bsth.util.Arith;
21 -import com.bsth.util.BatchSaveUtils; 36 +import com.bsth.util.ReportUtils;
  37 +import com.github.stuxuhai.jpinyin.PinyinException;
  38 +import com.github.stuxuhai.jpinyin.PinyinFormat;
  39 +import com.github.stuxuhai.jpinyin.PinyinHelper;
22 40
23 import org.slf4j.Logger; 41 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory; 42 import org.slf4j.LoggerFactory;
@@ -34,12 +52,24 @@ import org.springframework.stereotype.Service; @@ -34,12 +52,24 @@ import org.springframework.stereotype.Service;
34 public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer> implements CalcWaybillService { 52 public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer> implements CalcWaybillService {
35 53
36 @Autowired 54 @Autowired
37 - private CalcWaybillRepository clacRepository; 55 + private CalcWaybillRepository calcRepository;
38 56
39 @Autowired 57 @Autowired
40 - private CalcToolService calcToolService; 58 + private CalcIntervalRepository calcIntervalRepository;
41 59
42 @Autowired 60 @Autowired
  61 + private CalcStatisticsRepository calcStatisticsRepository;
  62 +
  63 + @Autowired
  64 + private CalcToolService calcToolService;
  65 +
  66 + @Autowired
  67 + private CulateMileageService culateService;
  68 +
  69 + @Autowired
  70 + private ScheduleRealInfoRepository scheduleRealInfoRepository;
  71 +
  72 + @Autowired
43 JdbcTemplate jdbcTemplate; 73 JdbcTemplate jdbcTemplate;
44 74
45 75
@@ -54,9 +84,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -54,9 +84,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
54 try { 84 try {
55 85
56 if(date.length() != 0 && line.length() != 0){ 86 if(date.length() != 0 && line.length() != 0){
57 - clacRepository.deleteByDateAndLine(date, line); 87 + calcRepository.deleteByDateAndLine(date, line);
  88 + calcIntervalRepository.deleteByDateAndLine(date, line);
58 } else if(date.length() != 0){ 89 } else if(date.length() != 0){
59 - clacRepository.deleteByDate(date); 90 + calcRepository.deleteByDate(date);
  91 + calcIntervalRepository.deleteByDate(date);
60 } else { 92 } else {
61 newMap.put("status", ResponseCode.ERROR); 93 newMap.put("status", ResponseCode.ERROR);
62 logger.error("save erro.", "日期不能为空"); 94 logger.error("save erro.", "日期不能为空");
@@ -84,21 +116,60 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -84,21 +116,60 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
84 m.put("start_opt", rs.getString("start_opt")); 116 m.put("start_opt", rs.getString("start_opt"));
85 m.put("line_code", rs.getString("line_code")); 117 m.put("line_code", rs.getString("line_code"));
86 return m; 118 return m;
87 - }});  
88 - 119 + }});
  120 +
  121 + String xlSql="select line_code,spac_grade from bsth_c_line";
  122 + if(line.length() != 0){
  123 + xlSql += " where line_code ='"+line+"'";
  124 + }
  125 + List<Map<String, Object>> xlList=jdbcTemplate.query(xlSql, new RowMapper<Map<String, Object>>() {
  126 + @Override
  127 + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
  128 + Map<String, Object> map=new HashMap<String,Object>();
  129 + map.put("line",arg0.getString("line_code"));
  130 + map.put("grade", arg0.getString("spac_grade"));
  131 + return map;
  132 + }});
  133 + Map<String, List<Map<String, Object>>> xlMap = new HashMap<String, List<Map<String, Object>>>();
  134 + for(Map<String, Object> m : xlList){
  135 + if(m.containsKey("line") && m.get("line").toString().trim().length() > 0){
  136 + String key = m.get("line").toString();
  137 + if(!xlMap.containsKey(key))
  138 + xlMap.put(key, new ArrayList<Map<String, Object>>());
  139 + xlMap.get(key).add(m);
  140 + }
  141 + }
  142 + //查询大间隔时间
  143 + String djgSql="select * from bsth_c_interval";
  144 + List<Interval> djgList=jdbcTemplate.query(djgSql, new RowMapper<Interval>() {
  145 + @Override
  146 + public Interval mapRow(ResultSet arg0, int arg1) throws SQLException {
  147 + Interval m=new Interval();
  148 + m.setLevel(arg0.getString("level"));
  149 + m.setPeak(arg0.getInt("peak"));
  150 + m.setTrough(arg0.getInt("trough"));
  151 + return m;
  152 + }});
  153 +
89 Set<String> lineSet = new HashSet<String>(); 154 Set<String> lineSet = new HashSet<String>();
90 for (int i = 0; i < listLineConfig.size(); i++) { 155 for (int i = 0; i < listLineConfig.size(); i++) {
91 Map<String, Object> m =listLineConfig.get(i); 156 Map<String, Object> m =listLineConfig.get(i);
92 String lineCode=m.get("line_code").toString().trim(); 157 String lineCode=m.get("line_code").toString().trim();
93 - String startOpt=m.get("start_opt").toString().trim(); 158 +// String startOpt=m.get("start_opt").toString().trim();
94 if(!lineSet.add(lineCode)) 159 if(!lineSet.add(lineCode))
95 continue; 160 continue;
96 161
97 - List<CalcWaybill> findAll = calcToolService.findAll(date, lineCode); 162 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  163 + if(xlMap.containsKey(lineCode) && xlMap.get(lineCode) != null){
  164 + tempList = xlMap.get(lineCode);
  165 + }
98 166
99 -// new BatchSaveUtils<CalcWaybill>().saveList2(findAll, CalcWaybill.class); 167 + List<CalcWaybill> findAll = calcToolService.findAll(date, lineCode, tempList, djgList);
100 168
101 - clacRepository.save(findAll); 169 +// new BatchSaveUtils<CalcWaybill>().saveList2(findAll, CalcWaybill.class);
  170 +
  171 +// if(xlMap.get(lineCode).size() == 0)
  172 + calcRepository.save(findAll);
102 } 173 }
103 174
104 newMap.put("status", ResponseCode.SUCCESS); 175 newMap.put("status", ResponseCode.SUCCESS);
@@ -116,28 +187,41 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -116,28 +187,41 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
116 public List<Map<String, Object>> statisticsDailyTj(String gsdm, 187 public List<Map<String, Object>> statisticsDailyTj(String gsdm,
117 String fgsdm, String line, String date, String date2, 188 String fgsdm, String line, String date, String date2,
118 String xlName, String type) { 189 String xlName, String type) {
119 - 190 +
  191 + List<String> keyList = new ArrayList<String>();
120 List<CalcWaybill> list = new ArrayList<CalcWaybill>(); 192 List<CalcWaybill> list = new ArrayList<CalcWaybill>();
121 List<CalcWaybill> lists = new ArrayList<CalcWaybill>(); 193 List<CalcWaybill> lists = new ArrayList<CalcWaybill>();
  194 + List<CalcInterval> list_ = new ArrayList<CalcInterval>();
122 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 195 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
123 Map<String, List<CalcWaybill>> keyMap = new HashMap<String, List<CalcWaybill>>(); 196 Map<String, List<CalcWaybill>> keyMap = new HashMap<String, List<CalcWaybill>>();
  197 + Map<String, List<CalcInterval>> keyMap_ = new HashMap<String, List<CalcInterval>>();
124 198
125 if(line.equals("")){ 199 if(line.equals("")){
126 //查询所有线路 200 //查询所有线路
127 - list = clacRepository.scheduleByDateAndLineTj(line,date,date2,gsdm,fgsdm); 201 + list = calcRepository.scheduleByDateAndLineTj(line,date,date2,gsdm,fgsdm);
  202 + list_ = calcIntervalRepository.selectByDateAndLine(line, date, date2, gsdm, fgsdm);
128 }else{ 203 }else{
129 //查询单条线路 204 //查询单条线路
130 - list = clacRepository.scheduleByDateAndLineTj2(line,date,date2); 205 + list = calcRepository.scheduleByDateAndLineTj2(line,date,date2);
  206 + list_ = calcIntervalRepository.selectByDateAndLine(line, date, date2);
131 } 207 }
132 208
133 for(CalcWaybill c : list){ 209 for(CalcWaybill c : list){
134 String key = c.getXlName(); 210 String key = c.getXlName();
135 if(!keyMap.containsKey(key)){ 211 if(!keyMap.containsKey(key)){
136 keyMap.put(key, new ArrayList<CalcWaybill>()); 212 keyMap.put(key, new ArrayList<CalcWaybill>());
  213 + keyList.add(key);
137 } 214 }
138 keyMap.get(key).add(c); 215 keyMap.get(key).add(c);
139 } 216 }
140 - for(String key : keyMap.keySet()){ 217 + for(CalcInterval c : list_){
  218 + String key = c.getXlName();
  219 + if(!keyMap_.containsKey(key))
  220 + keyMap_.put(key, new ArrayList<CalcInterval>());
  221 + keyMap_.get(key).add(c);
  222 + }
  223 + Collections.sort(keyList, new AccountXlbmStr());
  224 + for(String key : keyList){
141 CalcWaybill calc = keyMap.get(key).get(0); 225 CalcWaybill calc = keyMap.get(key).get(0);
142 for(int i = 1; i < keyMap.get(key).size(); i++){ 226 for(int i = 1; i < keyMap.get(key).size(); i++){
143 CalcWaybill c= keyMap.get(key).get(i); 227 CalcWaybill c= keyMap.get(key).get(i);
@@ -171,15 +255,32 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -171,15 +255,32 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
171 calc.setFzbc(calc.getFzbc() + c.getFzbc()); 255 calc.setFzbc(calc.getFzbc() + c.getFzbc());
172 calc.setFzbczgf(calc.getFzbczgf() + c.getFzbczgf()); 256 calc.setFzbczgf(calc.getFzbczgf() + c.getFzbczgf());
173 calc.setFzbcwgf(calc.getFzbcwgf() + c.getFzbcwgf()); 257 calc.setFzbcwgf(calc.getFzbcwgf() + c.getFzbcwgf());
174 - calc.setDtbc(calc.getDtbc() + c.getFzbc()); 258 + calc.setDtbc(calc.getDtbc() + c.getDtbc());
175 calc.setDtbczgf(calc.getDtbczgf() + c.getDtbczgf()); 259 calc.setDtbczgf(calc.getDtbczgf() + c.getDtbczgf());
176 calc.setDtbcwgf(calc.getDtbcwgf() + c.getDtbcwgf()); 260 calc.setDtbcwgf(calc.getDtbcwgf() + c.getDtbcwgf());
177 -  
178 } 261 }
179 calc.setSjyylc(Arith.add(calc.getSjyylc(), calc.getLjyylc())); 262 calc.setSjyylc(Arith.add(calc.getSjyylc(), calc.getLjyylc()));
180 - System.out.println();  
181 lists.add(calc); 263 lists.add(calc);
182 } 264 }
  265 + CalcInterval sum_ = new CalcInterval();
  266 + sum_.setXlName("合计");
  267 + sum_.setDjgTime(0);
  268 + for(String key : keyMap_.keySet()){
  269 + CalcInterval calc = keyMap_.get(key).get(0);
  270 + for(int i = 1; i < keyMap_.get(key).size(); i++){
  271 + CalcInterval calc_ = keyMap_.get(key).get(i);
  272 + calc.setDjg(calc.getDjg() + calc_.getDjg());
  273 + calc.setDjgM(calc.getDjgM() + calc_.getDjgM());
  274 + calc.setDjgA(calc.getDjgA() + calc_.getDjgA());
  275 + if(calc_.getDjgTime() > calc.getDjgTime())
  276 + calc.setDjgTime(calc_.getDjgTime());
  277 + }
  278 + sum_.setDjg(sum_.getDjg() + calc.getDjg());
  279 + sum_.setDjgM(sum_.getDjgM() + calc.getDjgM());
  280 + sum_.setDjgA(sum_.getDjgA() + calc.getDjgA());
  281 + if(calc.getDjgTime() > sum_.getDjgTime())
  282 + sum_.setDjgTime(calc.getDjgTime());
  283 + }
183 284
184 CalcWaybill sum = new CalcWaybill(); 285 CalcWaybill sum = new CalcWaybill();
185 sum.setXlName("合计"); 286 sum.setXlName("合计");
@@ -187,7 +288,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -187,7 +288,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
187 sum.setJhyylc(Arith.add(sum.getJhyylc()!=null?sum.getJhyylc():0, c.getJhyylc())); 288 sum.setJhyylc(Arith.add(sum.getJhyylc()!=null?sum.getJhyylc():0, c.getJhyylc()));
188 sum.setJhfyylc(Arith.add(sum.getJhfyylc()!=null?sum.getJhfyylc():0, c.getJhfyylc())); 289 sum.setJhfyylc(Arith.add(sum.getJhfyylc()!=null?sum.getJhfyylc():0, c.getJhfyylc()));
189 sum.setSjyylc(Arith.add(sum.getSjyylc()!=null?sum.getSjyylc():0, c.getSjyylc())); 290 sum.setSjyylc(Arith.add(sum.getSjyylc()!=null?sum.getSjyylc():0, c.getSjyylc()));
  291 + sum.setLjyylc(Arith.add(sum.getLjyylc()!=null?sum.getLjyylc():0, c.getLjyylc()));
190 sum.setSjfyylc(Arith.add(sum.getSjfyylc()!=null?sum.getSjfyylc():0, c.getSjfyylc())); 292 sum.setSjfyylc(Arith.add(sum.getSjfyylc()!=null?sum.getSjfyylc():0, c.getSjfyylc()));
  293 + sum.setLjfyylc(Arith.add(sum.getLjfyylc()!=null?sum.getLjfyylc():0, c.getLjfyylc()));
191 sum.setLblc(Arith.add(sum.getLblc()!=null?sum.getLblc():0, c.getLblc())); 294 sum.setLblc(Arith.add(sum.getLblc()!=null?sum.getLblc():0, c.getLblc()));
192 sum.setLbbc(sum.getLbbc() + c.getLbbc()); 295 sum.setLbbc(sum.getLbbc() + c.getLbbc());
193 sum.setLblcLz(Arith.add(sum.getLblcLz()!=null?sum.getLblcLz():0, c.getLblcLz())); 296 sum.setLblcLz(Arith.add(sum.getLblcLz()!=null?sum.getLblcLz():0, c.getLblcLz()));
@@ -214,7 +317,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -214,7 +317,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
214 sum.setFzbc(sum.getFzbc() + c.getFzbc()); 317 sum.setFzbc(sum.getFzbc() + c.getFzbc());
215 sum.setFzbczgf(sum.getFzbczgf() + c.getFzbczgf()); 318 sum.setFzbczgf(sum.getFzbczgf() + c.getFzbczgf());
216 sum.setFzbcwgf(sum.getFzbcwgf() + c.getFzbcwgf()); 319 sum.setFzbcwgf(sum.getFzbcwgf() + c.getFzbcwgf());
217 - sum.setDtbc(sum.getDtbc() + c.getFzbc()); 320 + sum.setDtbc(sum.getDtbc() + c.getDtbc());
218 sum.setDtbczgf(sum.getDtbczgf() + c.getDtbczgf()); 321 sum.setDtbczgf(sum.getDtbczgf() + c.getDtbczgf());
219 sum.setDtbcwgf(sum.getDtbcwgf() + c.getDtbcwgf()); 322 sum.setDtbcwgf(sum.getDtbcwgf() + c.getDtbcwgf());
220 } 323 }
@@ -228,9 +331,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -228,9 +331,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
228 m.put("jhzlc", Arith.add(c.getJhyylc(), c.getJhfyylc())); 331 m.put("jhzlc", Arith.add(c.getJhyylc(), c.getJhfyylc()));
229 m.put("jhlc", c.getJhyylc()); 332 m.put("jhlc", c.getJhyylc());
230 m.put("jcclc", c.getJhfyylc()); 333 m.put("jcclc", c.getJhfyylc());
231 - m.put("sjzgl", Arith.add(c.getSjyylc(), c.getSjfyylc()));  
232 - m.put("sjgl", c.getSjyylc());  
233 - m.put("sjksgl", c.getSjfyylc()); 334 + m.put("sjzgl", Arith.add(Arith.add(c.getSjyylc(), c.getLjyylc()), Arith.add(c.getSjfyylc(), c.getLjfyylc())));
  335 + m.put("sjgl", Arith.add(c.getSjyylc(), c.getLjyylc()));
  336 + m.put("sjksgl", Arith.add(c.getSjfyylc(), c.getLjfyylc()));
234 m.put("ssgl", c.getLblc()); 337 m.put("ssgl", c.getLblc());
235 m.put("ssbc", c.getLbbc()); 338 m.put("ssbc", c.getLbbc());
236 m.put("ssgl_lz", c.getLblcLz()); 339 m.put("ssgl_lz", c.getLblcLz());
@@ -260,14 +363,350 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -260,14 +363,350 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
260 m.put("dtbc", c.getDtbc()); 363 m.put("dtbc", c.getDtbc());
261 m.put("dtbc_m", c.getDtbczgf()); 364 m.put("dtbc_m", c.getDtbczgf());
262 m.put("dtbc_a", c.getDtbcwgf()); 365 m.put("dtbc_a", c.getDtbcwgf());
263 - m.put("djg", 0);  
264 - m.put("djg_m", 0);  
265 - m.put("djg_a", 0);  
266 - m.put("djg_time", 0); 366 + if(keyMap_.containsKey(c.getXlName()) || c.getXlName().equals("合计")){
  367 + CalcInterval calc;
  368 + if(c.getXlName().equals("合计"))
  369 + calc = sum_;
  370 + else
  371 + calc = keyMap_.get(c.getXlName()).get(0);
  372 + m.put("djg", calc.getDjg());
  373 + m.put("djg_m", calc.getDjgM());
  374 + m.put("djg_a", calc.getDjgA());
  375 + m.put("djg_time", calc.getDjgTime());
  376 + } else {
  377 + m.put("djg", 0);
  378 + m.put("djg_m", 0);
  379 + m.put("djg_a", 0);
  380 + m.put("djg_time", 0);
  381 + }
267 resList.add(m); 382 resList.add(m);
268 } 383 }
269 384
270 return resList; 385 return resList;
271 } 386 }
272 387
  388 + /**
  389 + * @param rq 格式如:2018-03-22(留空""默认当前日期前一天)
  390 + * @param line (留空""默认全部线路)
  391 + */
  392 + @Transactional
  393 + @Override
  394 + public String calcDaily(String rq, String line) throws Exception{
  395 + String result = "";
  396 + try {
  397 + if(rq == null || rq.trim().length() == 0){
  398 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  399 + Date dNow = new Date(); //当前时间
  400 + Date dBefore = new Date();
  401 + Calendar calendar = Calendar.getInstance(); //得到日历
  402 + calendar.setTime(dNow);//把当前时间赋给日历
  403 + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
  404 + dBefore = calendar.getTime(); //得到前一天的时间
  405 + rq = sdf.format(dBefore);
  406 + } else {
  407 + rq = rq.trim();
  408 + }
  409 + if(line == null || line.trim().length() == 0){
  410 + line = "";
  411 + } else {
  412 + line = line.trim();
  413 + }
  414 +
  415 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  416 + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
  417 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  418 +
  419 + String xlSql="select gs_bm, fgs_bm from bsth_c_s_sp_info_real where schedule_date_str = '"+rq+"'";
  420 + if(line.trim().length() > 0)
  421 + xlSql += " and xl_bm = '"+line+"'";
  422 + xlSql += " group by gs_bm, fgs_bm";
  423 + List<Map<String, String>> gsList=jdbcTemplate.query(xlSql, new RowMapper<Map<String, String>>() {
  424 + @Override
  425 + public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException {
  426 + Map<String, String> m = new HashMap<String, String>();
  427 + m.put("gsdm", arg0.getString("gs_bm"));
  428 + m.put("fgsdm", arg0.getString("fgs_bm"));
  429 + return m;
  430 + }});
  431 +
  432 + //查询所有线路
  433 + for(Map<String, String> m : gsList){
  434 + list.addAll(scheduleRealInfoRepository.scheduleByDateAndLineTj(line, rq, rq, m.get("gsdm"), m.get("fgsdm")));
  435 + }
  436 +
  437 + for (int i = 0; i < list.size(); i++) {
  438 + ScheduleRealInfo s=list.get(i);
  439 + Set<ChildTaskPlan> cts = s.getcTasks();
  440 + if(cts != null && cts.size() > 0){
  441 + list_s.add(s);
  442 + }else{
  443 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  444 + list_s.add(s);
  445 + }
  446 + }
  447 + }
  448 + List<CalcStatistics> lMap = new ArrayList<CalcStatistics>();
  449 + for (int i = 0; i < list.size(); i++) {
  450 + if(i<list.size()-1){
  451 + if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){
  452 + lists.add(list.get(i));
  453 + }else{
  454 + lists.add(list.get(i));
  455 + CalcStatistics s=staticTj(lists);
  456 + lMap.add(s);
  457 + lists=new ArrayList<ScheduleRealInfo>();
  458 + }
  459 + }else{
  460 + if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){
  461 + lists.add(list.get(i));
  462 + CalcStatistics s=staticTj(lists);
  463 + lMap.add(s);
  464 + }else{
  465 + lists=new ArrayList<ScheduleRealInfo>();
  466 + lists.add(list.get(i));
  467 + CalcStatistics s=staticTj(lists);
  468 + lMap.add(s);
  469 + }
  470 + }
  471 + }
  472 +// Collections.sort(lMap,new AccountXlbm());
  473 +
  474 + if(line.trim().length() > 0){
  475 + calcStatisticsRepository.deleteByDateAndLine(rq, line);
  476 + } else {
  477 + calcStatisticsRepository.deleteByDate(rq);
  478 + }
  479 + calcStatisticsRepository.save(lMap);
  480 + result = "success";
  481 + } catch (Exception e) {
  482 + // TODO: handle exception
  483 + throw e;
  484 + }finally{
  485 + logger.info("result:"+result);
  486 + }
  487 + return result;
  488 + }
  489 +
  490 + public final CalcStatistics staticTj(List<ScheduleRealInfo> list){
  491 +
  492 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  493 + for(int i=0;i<list.size();i++){
  494 + ScheduleRealInfo s=list.get(i);
  495 + Set<ChildTaskPlan> cts = s.getcTasks();
  496 + if(cts != null && cts.size() > 0){
  497 + lists.add(s);
  498 + }else{
  499 + if(s.getZdsjActual()!=null&& s.getFcsjActual()!=null){
  500 + lists.add(s);
  501 + }
  502 + }
  503 + }
  504 +// Map<String, Object> map = new HashMap<String, Object>();
  505 + CalcStatistics s = new CalcStatistics();
  506 + if(list.size() > 0){
  507 + ScheduleRealInfo sche = list.get(0);
  508 + s.setXl(sche.getXlBm());
  509 + s.setXlName(sche.getXlName());
  510 + s.setDate(sche.getScheduleDate());
  511 + s.setDateStr(sche.getScheduleDateStr());
  512 + s.setGsdm(sche.getGsBm());
  513 + s.setFgsdm(sche.getFgsBm());
  514 +
  515 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  516 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  517 + s.setJhyylc(jhyygl);
  518 + s.setJhkslc(jhjcclc);
  519 + s.setJhzlc(Arith.add(jhyygl, jhjcclc));
  520 +
  521 + double ljgl= culateService.culateLjgl(lists);
  522 + double sjyygl= culateService.culateSjgl(lists);
  523 + double zyygl= Arith.add(sjyygl,ljgl);
  524 +
  525 + double sjjccgl=culateService.culateJccgl(lists);
  526 + double sjksgl=culateService.culateKsgl(lists);
  527 + double zksgl=Arith.add(sjjccgl, sjksgl);
  528 + s.setSjyylc(zyygl);
  529 + s.setSjkslc(zksgl);
  530 + s.setSjzlc(Arith.add(zyygl, zksgl));
  531 +
  532 + s.setSslc(culateService.culateLbgl(list));
  533 + s.setSsbc(culateService.culateLbbc(list));
  534 +
  535 + //计划+临加-少驶=实驶
  536 +// double jl=Arith.sub(Arith.add(jhyygl, ljgl),ssgl);
  537 +// if(jl==zyygl){
  538 +// map.put("zt", 0);
  539 +// }else{
  540 +// map.put("zt", 1);
  541 +// }
  542 +
  543 + s.setLzlc(culateService.culateCJLC(list, "路阻"));
  544 + s.setDmlc(culateService.culateCJLC(list, "吊慢"));
  545 + s.setGzlc(culateService.culateCJLC(list, "故障"));
  546 + s.setJflc(culateService.culateCJLC(list, "纠纷"));
  547 + s.setZslc(culateService.culateCJLC(list, "肇事"));
  548 + s.setQrlc(culateService.culateCJLC(list, "缺人"));
  549 + s.setQclc(culateService.culateCJLC(list, "缺车"));
  550 + s.setKxlc(culateService.culateCJLC(list, "客稀"));
  551 + s.setQhlc(culateService.culateCJLC(list, "气候"));
  552 + s.setYwlc(culateService.culateCJLC(list, "援外"));
  553 + double ssgl_pc=culateService.culateCJLC(list, "配车");
  554 + double ssgl_by=culateService.culateCJLC(list, "保养");
  555 + double ssgl_cj=culateService.culateCJLC(list, "抽减");
  556 + double ssgl_qt=culateService.culateCJLC(list, "其他");
  557 + s.setQtlc(Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
  558 + s.setLjlc(ljgl);
  559 +
  560 + s.setJhbcq(culateService.culateJhbc(list,""));
  561 + s.setJhbcz(culateService.culateJhbc(list, "zgf"));
  562 + s.setJhbcw(culateService.culateJhbc(list, "wgf"));
  563 + s.setSjbcq(culateService.culateSjbc(lists,""));
  564 + s.setSjbcz(culateService.culateSjbc(lists,"zgf"));
  565 + s.setSjbcw(culateService.culateSjbc(lists,"wgf"));
  566 + s.setLjbcq(culateService.culateLjbc(lists,""));
  567 + s.setLjbcz(culateService.culateLjbc(lists,"zgf"));
  568 + s.setLjbcw(culateService.culateLjbc(lists,"wgf"));
  569 + s.setFzbcq(culateService.culateFzbc(lists, ""));
  570 + s.setFzbcz(culateService.culateFzbc(lists, "zgf"));
  571 + s.setFzbcw(culateService.culateFzbc(lists, "wgf"));
  572 + s.setDtbcq(0);
  573 + s.setDtbcz(0);
  574 + s.setDtbcw(0);
  575 + Map<String, Object> m_=culateService.culateDjg(lists, list.get(0).getXlBm());
  576 + if(m_.containsKey("djgcsq") && m_.get("djgcsq")!=null)
  577 + s.setDjgq(Integer.valueOf(m_.get("djgcsq").toString()));
  578 + else
  579 + s.setDjgq(0);
  580 + if(m_.containsKey("djgcsz") && m_.get("djgcsz")!=null)
  581 + s.setDjgz(Integer.valueOf(m_.get("djgcsz").toString()));
  582 + else
  583 + s.setDjgz(0);
  584 + if(m_.containsKey("djgcsw") && m_.get("djgcsw")!=null)
  585 + s.setDjgw(Integer.valueOf(m_.get("djgcsw").toString()));
  586 + else
  587 + s.setDjgw(0);
  588 + if(m_.containsKey("djgsj") && m_.get("djgsj")!=null)
  589 + s.setDjgsj(Integer.valueOf(m_.get("djgsj").toString()));
  590 + else
  591 + s.setDjgsj(0);
  592 + }
  593 + return s;
  594 + }
  595 +
  596 + class AccountXlbm implements Comparator<Map<String, Object>>{
  597 + @Override
  598 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  599 + // TODO Auto-generated method stub
  600 +// PinyinHelper.convertToPinyinString(ppy.getName(),
  601 +// "" , PinyinFormat.WITHOUT_TONE)
  602 + return o1.get("xlNamePy").toString().compareTo(
  603 + o2.get("xlNamePy").toString());
  604 + }
  605 + }
  606 +
  607 + class AccountXlbmStr implements Comparator<String>{
  608 + @Override
  609 + public int compare(String o1, String o2) {
  610 + // TODO Auto-generated method stub
  611 + return o1.compareTo(o2);
  612 + }
  613 + }
  614 +
  615 + @Override
  616 + public List<CalcStatistics> calcStatisticsDaily(String gsdm, String fgsdm,
  617 + String line, String date, String date2, String xlName, String type) {
  618 + // TODO Auto-generated method stub
  619 + List<CalcStatistics> list = new ArrayList<CalcStatistics>();
  620 + if(line.length() > 0){
  621 + list = calcStatisticsRepository.selectByDateAndLineTj2(line, date, date2);
  622 + } else {
  623 + list = calcStatisticsRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  624 + }
  625 +
  626 + List<CalcStatistics> resList = new ArrayList<CalcStatistics>();
  627 + Map<String, List<CalcStatistics>> keyMap = new HashMap<String, List<CalcStatistics>>();
  628 + List<String> keyList = new ArrayList<String>();
  629 +
  630 + for(CalcStatistics s : list){
  631 + try {
  632 + String key = PinyinHelper.convertToPinyinString(s.getXlName(), "" , PinyinFormat.WITHOUT_TONE);
  633 + if(!keyMap.containsKey(key)){
  634 + keyMap.put(key, new ArrayList<CalcStatistics>());
  635 + keyList.add(key);
  636 + }
  637 + keyMap.get(key).add(s);
  638 + } catch (PinyinException e) {
  639 + // TODO Auto-generated catch block
  640 + e.printStackTrace();
  641 + }
  642 + }
  643 + Collections.sort(keyList, new AccountXlbmStr());
  644 +
  645 + for(String key : keyList){
  646 + if(keyMap.get(key).size() > 0){
  647 + CalcStatistics s = keyMap.get(key).get(0);
  648 + if(keyMap.get(key).size() > 1)
  649 + for(int i = 1; i < keyMap.get(key).size(); i++){
  650 + CalcStatistics s_ = keyMap.get(key).get(i);
  651 + s = addStatistics(s, s_);
  652 + }
  653 + resList.add(s);
  654 + }
  655 + }
  656 +
  657 + if(resList.size() > 0){
  658 + CalcStatistics temp = new CalcStatistics();
  659 + temp.setXlName("合计");
  660 + for(CalcStatistics s : resList){
  661 + temp = addStatistics(temp, s);
  662 + }
  663 + resList.add(temp);
  664 + }
  665 +
  666 + return resList;
  667 + }
  668 +
  669 + public CalcStatistics addStatistics(CalcStatistics s, CalcStatistics s_){
  670 + s.setJhzlc(Arith.add(s.getJhzlc()!=null?s.getJhzlc():0, s_.getJhzlc()));
  671 + s.setJhyylc(Arith.add(s.getJhyylc()!=null?s.getJhyylc():0, s_.getJhyylc()));
  672 + s.setJhkslc(Arith.add(s.getJhkslc()!=null?s.getJhkslc():0, s_.getJhkslc()));
  673 + s.setSjzlc(Arith.add(s.getSjzlc()!=null?s.getSjzlc():0, s_.getSjzlc()));
  674 + s.setSjyylc(Arith.add(s.getSjyylc()!=null?s.getSjyylc():0, s_.getSjyylc()));
  675 + s.setSjkslc(Arith.add(s.getSjkslc()!=null?s.getSjkslc():0, s_.getSjkslc()));
  676 + s.setSslc(Arith.add(s.getSslc()!=null?s.getSslc():0, s_.getSslc()));
  677 + s.setSsbc(s.getSsbc() + s_.getSsbc());
  678 + s.setLzlc(Arith.add(s.getLzlc()!=null?s.getLzlc():0, s_.getLzlc()));
  679 + s.setDmlc(Arith.add(s.getDmlc()!=null?s.getDmlc():0, s_.getDmlc()));
  680 + s.setGzlc(Arith.add(s.getGzlc()!=null?s.getGzlc():0, s_.getGzlc()));
  681 + s.setJflc(Arith.add(s.getJflc()!=null?s.getJflc():0, s_.getJflc()));
  682 + s.setZslc(Arith.add(s.getZslc()!=null?s.getZslc():0, s_.getZslc()));
  683 + s.setQrlc(Arith.add(s.getQrlc()!=null?s.getQrlc():0, s_.getQrlc()));
  684 + s.setQclc(Arith.add(s.getQclc()!=null?s.getQclc():0, s_.getQclc()));
  685 + s.setKxlc(Arith.add(s.getKxlc()!=null?s.getKxlc():0, s_.getKxlc()));
  686 + s.setQhlc(Arith.add(s.getQhlc()!=null?s.getQhlc():0, s_.getQhlc()));
  687 + s.setYwlc(Arith.add(s.getYwlc()!=null?s.getYwlc():0, s_.getYwlc()));
  688 + s.setQtlc(Arith.add(s.getQtlc()!=null?s.getQtlc():0, s_.getQtlc()));
  689 + s.setLjlc(Arith.add(s.getLjlc()!=null?s.getLjlc():0, s_.getLjlc()));
  690 + s.setJhbcq(s.getJhbcq() + s_.getJhbcq());
  691 + s.setJhbcz(s.getJhbcz() + s_.getJhbcz());
  692 + s.setJhbcw(s.getJhbcw() + s_.getJhbcw());
  693 + s.setSjbcq(s.getSjbcq() + s_.getSjbcq());
  694 + s.setSjbcz(s.getSjbcz() + s_.getSjbcz());
  695 + s.setSjbcw(s.getSjbcw() + s_.getSjbcw());
  696 + s.setLjbcq(s.getLjbcq() + s_.getLjbcq());
  697 + s.setLjbcz(s.getLjbcz() + s_.getLjbcz());
  698 + s.setLjbcw(s.getLjbcw() + s_.getLjbcw());
  699 + s.setFzbcq(s.getFzbcq() + s_.getFzbcq());
  700 + s.setFzbcz(s.getFzbcz() + s_.getFzbcz());
  701 + s.setFzbcw(s.getFzbcw() + s_.getFzbcw());
  702 + s.setDtbcq(s.getDtbcq() + s_.getDtbcq());
  703 + s.setDtbcz(s.getDtbcz() + s_.getDtbcz());
  704 + s.setDtbcw(s.getDtbcw() + s_.getDtbcw());
  705 + s.setDjgq(s.getDjgq() + s_.getDjgq());
  706 + s.setDjgz(s.getDjgz() + s_.getDjgz());
  707 + s.setDjgw(s.getDjgw() + s_.getDjgw());
  708 + s.setDjgsj(s.getDjgsj()>s_.getDjgsj()?s.getDjgsj():s_.getDjgsj());
  709 + return s;
  710 + }
  711 +
273 } 712 }
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
@@ -1005,8 +1005,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -1005,8 +1005,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1005 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ 1005 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
1006 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 1006 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
1007 if(sobje.size()==1) { 1007 if(sobje.size()==1) {
1008 - int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());  
1009 - sleepStr = "\t" + String.valueOf(dsleepStr); 1008 +// int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());
  1009 +// sleepStr = "\t" + String.valueOf(dsleepStr);
  1010 + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());
  1011 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt);
1010 }else if(sobje.size()>1){ 1012 }else if(sobje.size()>1){
1011 for(int j =0;j<sobje.size();j++) { 1013 for(int j =0;j<sobje.size();j++) {
1012 double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString()); 1014 double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString());
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -324,37 +324,24 @@ public class ReportServiceImpl implements ReportService{ @@ -324,37 +324,24 @@ public class ReportServiceImpl implements ReportService{
324 } 324 }
325 return list; 325 return list;
326 } 326 }
  327 +
327 @Override 328 @Override
328 public Map<String, Object> tbodyTime1(String line, String ttinfo) { 329 public Map<String, Object> tbodyTime1(String line, String ttinfo) {
329 DecimalFormat df = new DecimalFormat("#0.00"); 330 DecimalFormat df = new DecimalFormat("#0.00");
  331 + Map<String, Object> map=new HashMap<String,Object>();
330 // TODO Auto-generated method stub 332 // TODO Auto-generated method stub
  333 +
331 //查询配车 334 //查询配车
332 - String sqlPc=" select count(*) from bsth_c_cars where id in("  
333 - + " select cl from bsth_c_s_ccinfo where xl in ( "  
334 - + " select id from bsth_c_line where line_code='"+line+"' )"  
335 - + " group by equipment_code ) ";  
336 -  
337 - Map<String, Object> map=new HashMap<String,Object>();  
338 -  
339 - /*List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,  
340 - new RowMapper<Map<String, Object>>(){  
341 - @Override  
342 - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {  
343 - Map<String, Object> m=new HashMap<String,Object>();  
344 - m.put("zbh", rs.getString("cl_zbh"));  
345 - return m;  
346 - }  
347 - });*/ 335 + String sqlPc=" select count(*) from (select lp, count(*) from"
  336 + + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"'"
  337 + + " group by lp ) a";
348 //配车 338 //配车
349 int pcs=jdbcTemplate.queryForObject(sqlPc, Integer.class); 339 int pcs=jdbcTemplate.queryForObject(sqlPc, Integer.class);
350 340
  341 +
351 String sqlPlan=" SELECT jhlc,bc_type,fcsj FROM bsth_c_s_ttinfo_detail " 342 String sqlPlan=" SELECT jhlc,bc_type,fcsj FROM bsth_c_s_ttinfo_detail "
352 +" where ttinfo ='"+ttinfo+"' "; 343 +" where ttinfo ='"+ttinfo+"' ";
353 344
354 - //班次  
355 - int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60;  
356 - int qcBc=0,qjBc=0,zqcBc=0,zqjBc=0,wqcBc=0,wqjBc=0;  
357 - double zlc = 0 , yylc = 0,kslc=0;  
358 //查询班次 345 //查询班次
359 List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan, 346 List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan,
360 new RowMapper<Map<String, Object>>(){ 347 new RowMapper<Map<String, Object>>(){
@@ -368,6 +355,11 @@ public class ReportServiceImpl implements ReportService{ @@ -368,6 +355,11 @@ public class ReportServiceImpl implements ReportService{
368 } 355 }
369 }); 356 });
370 357
  358 + //班次
  359 + int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60;
  360 + int qcBc=0,qjBc=0,zqcBc=0,zqjBc=0,wqcBc=0,wqjBc=0;
  361 + double zlc = 0 , yylc = 0,kslc=0;
  362 +
371 for (int i = 0; i < listPlan.size(); i++) { 363 for (int i = 0; i < listPlan.size(); i++) {
372 Map<String, Object> m=listPlan.get(i); 364 Map<String, Object> m=listPlan.get(i);
373 double jhlc=Double.parseDouble(m.get("jhlc").toString()); 365 double jhlc=Double.parseDouble(m.get("jhlc").toString());
@@ -423,21 +415,23 @@ public class ReportServiceImpl implements ReportService{ @@ -423,21 +415,23 @@ public class ReportServiceImpl implements ReportService{
423 String minfcsj="02:00"; 415 String minfcsj="02:00";
424 List<Line> lineList=lineRepository.findLineByCode(line); 416 List<Line> lineList=lineRepository.findLineByCode(line);
425 if(lineList.size()>0){ 417 if(lineList.size()>0){
426 - String sqlMinYysj="select start_opt from bsth_c_line_config where "  
427 - + " id = ("  
428 - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"  
429 - + ")";  
430 - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 418 + String sql = "select count(*) from bsth_c_line_config where line = '"+lineList.get(0).getId()+"'";
  419 + if(jdbcTemplate.queryForObject(sql, Integer.class) > 0){
  420 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  421 + + " id = ("
  422 + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
  423 + + ")";
  424 + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  425 + }
431 } 426 }
432 String[] minSjs = minfcsj.split(":"); 427 String[] minSjs = minfcsj.split(":");
433 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); 428 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
434 //查询时间里程 429 //查询时间里程
435 - String sqlPc=" (SELECT jhlc,fcsj,bc_type,lp,2 as xh, ists FROM bsth_c_s_ttinfo_detail " 430 + String sqlPc=" (SELECT jhlc,fcsj,bc_type,bcsj,lp,2 as xh, ists FROM bsth_c_s_ttinfo_detail "
436 + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) " 431 + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
437 + " union " 432 + " union "
438 - + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh, ists FROM bsth_c_s_ttinfo_detail "  
439 - + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj";  
440 - 433 + + " (SELECT jhlc,fcsj,bc_type,bcsj,lp,1 as xh, ists FROM bsth_c_s_ttinfo_detail "
  434 + + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"' ) order by lp,xh,fcsj";
441 Map<String, Object> map=new HashMap<String,Object>(); 435 Map<String, Object> map=new HashMap<String,Object>();
442 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, 436 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
443 new RowMapper<Map<String, Object>>(){ 437 new RowMapper<Map<String, Object>>(){
@@ -447,26 +441,31 @@ public class ReportServiceImpl implements ReportService{ @@ -447,26 +441,31 @@ public class ReportServiceImpl implements ReportService{
447 m.put("fcsj", rs.getString("fcsj")); 441 m.put("fcsj", rs.getString("fcsj"));
448 m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc")); 442 m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
449 m.put("bcType", rs.getString("bc_type")); 443 m.put("bcType", rs.getString("bc_type"));
  444 + m.put("bcsj", rs.getString("bcsj"));
450 m.put("lp", rs.getString("lp")); 445 m.put("lp", rs.getString("lp"));
451 m.put("ists", rs.getObject("ists")==null?"0":rs.getString("ists")); 446 m.put("ists", rs.getObject("ists")==null?"0":rs.getString("ists"));
452 return m; 447 return m;
453 } 448 }
454 }); 449 });
455 - int yysj=0 ; 450 +
  451 + int yysj=0;
456 double yycs=0 ,yygl=0; 452 double yycs=0 ,yygl=0;
457 String lp ="0"; 453 String lp ="0";
458 - int sj=0;  
459 - 454 + int sj=0, bcsj = 0;
  455 + int temp = 0;
460 for(int i=0;i<list.size();i++){ 456 for(int i=0;i<list.size();i++){
461 Map<String, Object> m=list.get(i); 457 Map<String, Object> m=list.get(i);
462 String time=m.get("fcsj").toString(); 458 String time=m.get("fcsj").toString();
463 String[] times = time.split(":"); 459 String[] times = time.split(":");
  460 + int sjT = Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
464 if(lp.equals(m.get("lp").toString())){ 461 if(lp.equals(m.get("lp").toString())){
465 - if(Integer.parseInt(times[0])*60+Integer.parseInt(times[1]) <=minSj){ 462 + if(sjT <= minSj){
466 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){ 463 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
467 if(m.get("bcType").equals("in")){ 464 if(m.get("bcType").equals("in")){
468 if(sj!=0){ 465 if(sj!=0){
469 - yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj; 466 +// yysj += sjT + (24*60) - sj;
  467 + yysj += bcsj;
  468 + bcsj = 0;
470 } 469 }
471 sj=0; 470 sj=0;
472 } 471 }
@@ -474,45 +473,62 @@ public class ReportServiceImpl implements ReportService{ @@ -474,45 +473,62 @@ public class ReportServiceImpl implements ReportService{
474 yygl += Double.parseDouble(m.get("yygl").toString()); 473 yygl += Double.parseDouble(m.get("yygl").toString());
475 474
476 if(sj==0){ 475 if(sj==0){
477 - sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]); 476 + sj = sjT + (24*60);
478 }else{ 477 }else{
479 - yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;  
480 - sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]); 478 + yysj += sjT + (24*60) - sj;
  479 + if(m.containsKey("ists") && m.get("ists").equals("1")){
  480 + yysj += Integer.valueOf(m.get("bcsj").toString());
  481 + } else {
  482 + sj = sjT + (24*60);
  483 + }
481 } 484 }
482 } 485 }
483 }else{ 486 }else{
484 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){ 487 if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
485 if(m.get("bcType").equals("in")){ 488 if(m.get("bcType").equals("in")){
486 if(sj!=0){ 489 if(sj!=0){
487 - yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj; 490 +// yysj += sjT - sj;
  491 + yysj += bcsj;
  492 + bcsj = 0;
488 } 493 }
489 sj=0; 494 sj=0;
490 } 495 }
491 - }else{ 496 + } else {
492 yygl += Double.parseDouble(m.get("yygl").toString()); 497 yygl += Double.parseDouble(m.get("yygl").toString());
493 498
494 if(sj==0){ 499 if(sj==0){
495 - sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]); 500 + sj = sjT;
496 }else{ 501 }else{
497 - yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;  
498 - sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]); 502 + yysj += sjT - sj;
  503 + if(m.containsKey("ists") && m.get("ists").equals("1")){
  504 + yysj += Integer.valueOf(m.get("bcsj").toString());
  505 + } else {
  506 + sj = sjT;
  507 + }
499 } 508 }
500 } 509 }
501 } 510 }
502 }else{ 511 }else{
  512 + if(sj == 0){
  513 + yysj += bcsj;
  514 + bcsj = 0;
  515 + }
503 if( !(m.get("bcType").equals("in") || m.get("bcType").equals("out"))){ 516 if( !(m.get("bcType").equals("in") || m.get("bcType").equals("out"))){
504 yygl += Double.parseDouble(m.get("yygl").toString()); 517 yygl += Double.parseDouble(m.get("yygl").toString());
505 - sj =Integer.parseInt(times[0])*60+Integer.parseInt(times[1]); 518 + sj = sjT;
506 }else{ 519 }else{
507 sj=0; 520 sj=0;
508 } 521 }
509 lp=m.get("lp").toString(); 522 lp=m.get("lp").toString();
510 -  
511 } 523 }
  524 +
512 if(m.containsKey("ists") && m.get("ists").equals("1")){ 525 if(m.containsKey("ists") && m.get("ists").equals("1")){
513 sj = 0; 526 sj = 0;
514 } 527 }
  528 + if( !(m.get("bcType").equals("in") || m.get("bcType").equals("out")))
  529 + bcsj = Integer.valueOf(m.get("bcsj").toString());
515 } 530 }
  531 +
516 if(yysj>0){ 532 if(yysj>0){
517 yycs =yygl/(yysj*1.0/60); 533 yycs =yygl/(yysj*1.0/60);
518 } 534 }
@@ -522,6 +538,7 @@ public class ReportServiceImpl implements ReportService{ @@ -522,6 +538,7 @@ public class ReportServiceImpl implements ReportService{
522 map.put("yysj", hh+":"+mm); 538 map.put("yysj", hh+":"+mm);
523 map.put("yycs", df.format(yycs)+"公里/小时"); 539 map.put("yycs", df.format(yycs)+"公里/小时");
524 // map.put(key, value) 540 // map.put(key, value)
  541 +
525 return map; 542 return map;
526 } 543 }
527 544
@@ -529,126 +546,15 @@ public class ReportServiceImpl implements ReportService{ @@ -529,126 +546,15 @@ public class ReportServiceImpl implements ReportService{
529 System.out.println(609360/60); 546 System.out.println(609360/60);
530 System.out.println(609360%60); 547 System.out.println(609360%60);
531 } 548 }
532 - /* @Override  
533 - public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) {  
534 - // TODO Auto-generated method stub  
535 - List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();  
536 -  
537 -  
538 -  
539 - String sqlZd="select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqc' AS lx from ("  
540 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"' "  
541 - + " and bc_type ='normal'"  
542 - + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"  
543 - + " group by cl_zbh,qdz_name) a group by a.qdz_name"  
544 - + " union "  
545 - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqc' AS lx from ("  
546 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"  
547 - + " and bc_type ='normal' "  
548 - + " and fcsj >'16:01' and fcsj<'18:00' group by cl_zbh,qdz_name "  
549 - + " ) a group by a.qdz_name "  
550 - + " union "  
551 - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqj' AS lx from ("  
552 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"  
553 - + " and bc_type ='region' "  
554 - + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"  
555 - + " group by cl_zbh,qdz_name) a group by a.qdz_name"  
556 - + " union "  
557 - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqj' AS lx from ("  
558 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"  
559 - + " and bc_type ='region' and fcsj >'16:01' and fcsj<'18:00'"  
560 - + " group by cl_zbh,qdz_name) a group by a.qdz_name";  
561 - List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd,  
562 - new RowMapper<Map<String, Object>>(){  
563 - @Override  
564 - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {  
565 - Map<String, Object> m=new HashMap<String,Object>();  
566 - m.put("zdm", rs.getString("qdz_name"));  
567 - m.put("cls", rs.getString("cls"));  
568 - m.put("lx", rs.getString("lx"));  
569 - return m;  
570 - }  
571 - });  
572 - int a=0;  
573 - int b=0;  
574 - int c=0;  
575 - int d=0;  
576 - for(int i=0;i<lists.size();i++){  
577 - boolean fage=true;  
578 - Map<String, Object> newMap= new HashMap<String, Object>();  
579 - list.add(newMap);  
580 - Map<String, Object> maps=lists.get(i);  
581 - if(maps.get("lx").equals("zqc")){  
582 - list.get(a).put("zqcZm", maps.get("zdm"));  
583 - list.get(a).put("zqcCls", maps.get("cls"));  
584 - a++;  
585 - fage=false;  
586 - }else if(maps.get("lx").equals("wqc")){  
587 - list.get(b).put("wqcZm", maps.get("zdm"));  
588 - list.get(b).put("wqcCls", maps.get("cls"));  
589 - b++;  
590 - fage=false;  
591 - }else if(maps.get("lx").equals("zqj")){  
592 - list.get(c).put("zqjZm", maps.get("zdm"));  
593 - list.get(c).put("zqjCls", maps.get("cls"));  
594 - c++;  
595 - fage=false;  
596 - }else if(maps.get("lx").equals("wqj")){  
597 - list.get(d).put("wqjZm", maps.get("zdm"));  
598 - list.get(d).put("wqjCls", maps.get("cls"));  
599 - d++;  
600 - fage=false;  
601 - }  
602 - if(fage){  
603 - break;  
604 - }  
605 - }  
606 - boolean status=true;  
607 - while (status) {  
608 - for (int i = 0; i < list.size(); i++) {  
609 - if(list.get(i).isEmpty()){  
610 - list.remove(i);  
611 - status=true;  
612 - }else{  
613 - status=false;  
614 - }  
615 - }  
616 -  
617 - }  
618 - return list;  
619 - }*/ 549 +
620 @Override 550 @Override
621 public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) { 551 public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) {
622 // TODO Auto-generated method stub 552 // TODO Auto-generated method stub
623 List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); 553 List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
624 List<Map<String, Object>> list_s=new ArrayList<Map<String,Object>>(); 554 List<Map<String, Object>> list_s=new ArrayList<Map<String,Object>>();
625 555
626 -  
627 - /*String sqlZd="select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqc' AS lx from ("  
628 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"' "  
629 - + " and bc_type ='normal'"  
630 - + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"  
631 - + " group by cl_zbh,qdz_name) a group by a.qdz_name"  
632 - + " union "  
633 - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqc' AS lx from ("  
634 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"  
635 - + " and bc_type ='normal' "  
636 - + " and fcsj >'16:01' and fcsj<'18:00' group by cl_zbh,qdz_name "  
637 - + " ) a group by a.qdz_name "  
638 - + " union "  
639 - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqj' AS lx from ("  
640 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"  
641 - + " and bc_type ='region' "  
642 - + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"  
643 - + " group by cl_zbh,qdz_name) a group by a.qdz_name"  
644 - + " union "  
645 - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqj' AS lx from ("  
646 - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"  
647 - + " and bc_type ='region' and fcsj >'16:01' and fcsj<'18:00'"  
648 - + " group by cl_zbh,qdz_name) a group by a.qdz_name";*/  
649 -  
650 - String sqlCl="SELECT cl_zbh,qdz_name,bc_type,fcsj,bcsj FROM"  
651 - + " bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' " 556 + String sqlCl="SELECT lp cl_zbh,qdz_name,bc_type,fcsj,bcsj FROM"
  557 + + " bsth_c_s_ttinfo_detail WHERE ttinfo = '"+ttinfo+"' "
652 + " AND (bc_type = 'normal' or bc_type='region') order by qdz_name"; 558 + " AND (bc_type = 'normal' or bc_type='region') order by qdz_name";
653 559
654 List<Map<String, Object>> listj= jdbcTemplate.query(sqlCl, 560 List<Map<String, Object>> listj= jdbcTemplate.query(sqlCl,
@@ -665,7 +571,7 @@ public class ReportServiceImpl implements ReportService{ @@ -665,7 +571,7 @@ public class ReportServiceImpl implements ReportService{
665 } 571 }
666 }); 572 });
667 573
668 - String sqlZd="select qdz_name ,bc_type from bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' " 574 + String sqlZd="select qdz_name,bc_type from bsth_c_s_ttinfo_detail WHERE ttinfo = '"+ttinfo+"' "
669 + " AND (bc_type = 'normal' or bc_type='region') group by qdz_name ,bc_type " 575 + " AND (bc_type = 'normal' or bc_type='region') group by qdz_name ,bc_type "
670 + " order by qdz_name"; 576 + " order by qdz_name";
671 List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd, 577 List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd,
@@ -807,6 +713,8 @@ public class ReportServiceImpl implements ReportService{ @@ -807,6 +713,8 @@ public class ReportServiceImpl implements ReportService{
807 } 713 }
808 boolean status=true; 714 boolean status=true;
809 while (status) { 715 while (status) {
  716 + if(list.size() == 0)
  717 + break;
810 for (int i = 0; i < list.size(); i++) { 718 for (int i = 0; i < list.size(); i++) {
811 if(list.get(i).isEmpty()){ 719 if(list.get(i).isEmpty()){
812 list.remove(i); 720 list.remove(i);
@@ -815,8 +723,8 @@ public class ReportServiceImpl implements ReportService{ @@ -815,8 +723,8 @@ public class ReportServiceImpl implements ReportService{
815 status=false; 723 status=false;
816 } 724 }
817 } 725 }
818 -  
819 } 726 }
  727 +
820 return list; 728 return list;
821 } 729 }
822 730
@@ -828,11 +736,14 @@ public class ReportServiceImpl implements ReportService{ @@ -828,11 +736,14 @@ public class ReportServiceImpl implements ReportService{
828 String minfcsj="02:00"; 736 String minfcsj="02:00";
829 List<Line> lineList=lineRepository.findLineByCode(line); 737 List<Line> lineList=lineRepository.findLineByCode(line);
830 if(lineList.size()>0){ 738 if(lineList.size()>0){
831 - String sqlMinYysj="select start_opt from bsth_c_line_config where "  
832 - + " id = ("  
833 - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"  
834 - + ")";  
835 - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 739 + String sql = "select count(*) from bsth_c_line_config where line = '"+lineList.get(0).getId()+"'";
  740 + if(jdbcTemplate.queryForObject(sql, Integer.class) > 0){
  741 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  742 + + " id = ("
  743 + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
  744 + + ")";
  745 + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  746 + }
836 } 747 }
837 748
838 //查询全程 749 //查询全程
@@ -917,11 +828,14 @@ public class ReportServiceImpl implements ReportService{ @@ -917,11 +828,14 @@ public class ReportServiceImpl implements ReportService{
917 String minfcsj="02:00"; 828 String minfcsj="02:00";
918 List<Line> lineList=lineRepository.findLineByCode(line); 829 List<Line> lineList=lineRepository.findLineByCode(line);
919 if(lineList.size()>0){ 830 if(lineList.size()>0){
920 - String sqlMinYysj="select start_opt from bsth_c_line_config where "  
921 - + " id = ("  
922 - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"  
923 - + ")";  
924 - minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class); 831 + String sql = "select count(*) from bsth_c_line_config where line = '"+lineList.get(0).getId()+"'";
  832 + if(jdbcTemplate.queryForObject(sql, Integer.class) > 0){
  833 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  834 + + " id = ("
  835 + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
  836 + + ")";
  837 + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  838 + }
925 } 839 }
926 String[] minSjs = minfcsj.split(":"); 840 String[] minSjs = minfcsj.split(":");
927 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); 841 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
@@ -4,6 +4,7 @@ import com.bsth.entity.schedule.TTInfoDetail; @@ -4,6 +4,7 @@ import com.bsth.entity.schedule.TTInfoDetail;
4 import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; 4 import com.bsth.service.schedule.datatools.TTInfoDetailForEdit;
5 import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; 5 import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData;
6 import com.bsth.service.schedule.exception.ScheduleException; 6 import com.bsth.service.schedule.exception.ScheduleException;
  7 +import com.bsth.service.schedule.timetable.ExcelFormatType;
7 import com.bsth.service.schedule.utils.DataToolsFile; 8 import com.bsth.service.schedule.utils.DataToolsFile;
8 9
9 import java.util.List; 10 import java.util.List;
@@ -45,13 +46,15 @@ public interface TTInfoDetailService extends BService&lt;TTInfoDetail, Long&gt; { @@ -45,13 +46,15 @@ public interface TTInfoDetailService extends BService&lt;TTInfoDetail, Long&gt; {
45 * @param sheetname sheet名字 46 * @param sheetname sheet名字
46 * @param lineid 线路id 47 * @param lineid 线路id
47 * @param lineversion 线路版本 48 * @param lineversion 线路版本
  49 + * @param excelFormatType 版本
48 */ 50 */
49 void validateExcelSheet( 51 void validateExcelSheet(
50 String filename, 52 String filename,
51 String sheetname, 53 String sheetname,
52 Integer lineid, 54 Integer lineid,
53 String linename, 55 String linename,
54 - Integer lineversion) throws ScheduleException; 56 + Integer lineversion,
  57 + ExcelFormatType excelFormatType) throws ScheduleException;
55 58
56 /** 59 /**
57 * 验证关联的线路标准信息(以后放到规则引擎里去做)。 60 * 验证关联的线路标准信息(以后放到规则引擎里去做)。
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
1 package com.bsth.service.schedule.datatools; 1 package com.bsth.service.schedule.datatools;
2 2
3 -import com.bsth.entity.Station;  
4 -import com.bsth.service.StationService; 3 +import com.bsth.entity.StationRoute;
  4 +import com.bsth.service.StationRouteService;
5 import com.bsth.service.schedule.exception.ScheduleException; 5 import com.bsth.service.schedule.exception.ScheduleException;
  6 +import com.bsth.service.schedule.timetable.ExcelFormatType;
6 import com.bsth.service.schedule.utils.*; 7 import com.bsth.service.schedule.utils.*;
7 import jxl.Sheet; 8 import jxl.Sheet;
8 import jxl.Workbook; 9 import jxl.Workbook;
@@ -14,10 +15,13 @@ import org.apache.poi.ss.usermodel.Cell; @@ -14,10 +15,13 @@ import org.apache.poi.ss.usermodel.Cell;
14 import org.apache.poi.ss.usermodel.Row; 15 import org.apache.poi.ss.usermodel.Row;
15 import org.apache.poi.ss.util.CellRangeAddress; 16 import org.apache.poi.ss.util.CellRangeAddress;
16 import org.apache.poi.ss.util.WorkbookUtil; 17 import org.apache.poi.ss.util.WorkbookUtil;
  18 +import org.apache.poi.xssf.usermodel.XSSFCell;
17 import org.apache.poi.xssf.usermodel.XSSFRow; 19 import org.apache.poi.xssf.usermodel.XSSFRow;
18 import org.apache.poi.xssf.usermodel.XSSFSheet; 20 import org.apache.poi.xssf.usermodel.XSSFSheet;
19 import org.apache.poi.xssf.usermodel.XSSFWorkbook; 21 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
20 import org.joda.time.DateTime; 22 import org.joda.time.DateTime;
  23 +import org.joda.time.LocalTime;
  24 +import org.joda.time.format.DateTimeFormat;
21 import org.slf4j.Logger; 25 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
23 import org.springframework.beans.factory.annotation.Autowired; 27 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,9 +46,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -42,9 +46,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
42 /** 日志记录器 */ 46 /** 日志记录器 */
43 private final static Logger LOGGER = LoggerFactory.getLogger(TTInfoDetailDataToolsImpl.class); 47 private final static Logger LOGGER = LoggerFactory.getLogger(TTInfoDetailDataToolsImpl.class);
44 48
45 - // TODO:之后改了  
46 @Autowired 49 @Autowired
47 - private StationService stationService; 50 + private StationRouteService stationRouteService;
48 51
49 @Autowired 52 @Autowired
50 @Qualifier(value = "dataToolsServiceImpl") 53 @Qualifier(value = "dataToolsServiceImpl")
@@ -98,7 +101,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -98,7 +101,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
98 Integer lineid = Integer.valueOf(String.valueOf(params.get("lineinfo"))); // 线路标准id 101 Integer lineid = Integer.valueOf(String.valueOf(params.get("lineinfo"))); // 线路标准id
99 String xlname = String.valueOf(params.get("xlname")); // 线路名字 102 String xlname = String.valueOf(params.get("xlname")); // 线路名字
100 String ttname = String.valueOf(params.get("ttname")); // 时刻表名字 103 String ttname = String.valueOf(params.get("ttname")); // 时刻表名字
101 - Integer lineversion = Integer.valueOf(params.get("lineversion").toString()); 104 + Integer lineversion = Integer.valueOf(params.get("lineversion").toString()); // 线路路由版本
  105 + ExcelFormatType excelFormatType = ExcelFormatType.getEnum(String.valueOf(params.get("excelFormatType"))); // 格式
102 106
103 LOGGER.info("参数1, xls文件名={},sheet名字={}", filename, sheetname); 107 LOGGER.info("参数1, xls文件名={},sheet名字={}", filename, sheetname);
104 LOGGER.info("参数2, 线路id={},线路名字={}", xlid, xlname); 108 LOGGER.info("参数2, 线路id={},线路名字={}", xlid, xlname);
@@ -175,6 +179,10 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -175,6 +179,10 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
175 // 实际数据ktr 179 // 实际数据ktr
176 File ktrFile2_version = new File(this.getClass().getResource( 180 File ktrFile2_version = new File(this.getClass().getResource(
177 dataToolsProperties.getTtinfodetailDatainputktr2version()).toURI()); 181 dataToolsProperties.getTtinfodetailDatainputktr2version()).toURI());
  182 + // 实际数据ktr2
  183 + File ktrFile2_version2 = new File(this.getClass().getResource(
  184 + dataToolsProperties.getTtinfodetailDatainputktr2version2()).toURI());
  185 +
178 186
179 // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 187 // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径
180 ktrParms.put("transpath", mktrFile.getAbsolutePath()); 188 ktrParms.put("transpath", mktrFile.getAbsolutePath());
@@ -182,7 +190,14 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -182,7 +190,14 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
182 ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); 190 ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir());
183 191
184 // 附加参数 192 // 附加参数
185 - ktrParms.put("injectktrfile", ktrFile2_version.getAbsolutePath()); // 注入元数据的ktr文件 193 + if (excelFormatType == ExcelFormatType.Normal) {
  194 + ktrParms.put("injectktrfile", ktrFile2_version.getAbsolutePath()); // 注入元数据的ktr文件
  195 + } else if (excelFormatType == ExcelFormatType.Dynamic) {
  196 + ktrParms.put("injectktrfile", ktrFile2_version2.getAbsolutePath()); // 注入元数据的ktr文件
  197 + } else {
  198 + throw new ScheduleException("未知ExcelFormatType");
  199 + }
  200 +
186 ktrParms.put("sheetname", sheetname); // sheet工作区的名字 201 ktrParms.put("sheetname", sheetname); // sheet工作区的名字
187 ktrParms.put("lineinfoid", lineid); // 线路标准id 202 ktrParms.put("lineinfoid", lineid); // 线路标准id
188 ktrParms.put("xlname", xlname); // 线路名称 203 ktrParms.put("xlname", xlname); // 线路名称
@@ -441,8 +456,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -441,8 +456,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
441 456
442 // 构造表头 457 // 构造表头
443 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7)); 458 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7));
444 - Station station1 = stationService.findById(lpObjList.get(0).getStationRouteId1());  
445 - Station station2 = stationService.findById(lpObjList.get(1).getStationRouteId2()); 459 + StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1());
  460 + StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2());
446 for (int i = 0; i < groupCount; i++) { 461 for (int i = 0; i < groupCount; i++) {
447 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1), 462 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1),
448 station1.getStationName(), new Color(0x96b9d7)); 463 station1.getStationName(), new Color(0x96b9d7));
@@ -553,8 +568,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -553,8 +568,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
553 568
554 // 构造表头,添加一个进场,添加一个出场 569 // 构造表头,添加一个进场,添加一个出场
555 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7)); 570 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7));
556 - Station station1 = stationService.findById(lpObjList.get(0).getStationRouteId1());  
557 - Station station2 = stationService.findById(lpObjList.get(1).getStationRouteId2()); 571 + StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1());
  572 + StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2());
558 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (1), 573 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (1),
559 "报到", new Color(0x96b9d7)); 574 "报到", new Color(0x96b9d7));
560 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (2), 575 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (2),
@@ -565,8 +580,12 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -565,8 +580,12 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
565 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 2), 580 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 2),
566 station2.getStationName(), new Color(0x96b9d7)); 581 station2.getStationName(), new Color(0x96b9d7));
567 } 582 }
  583 +
  584 + // 最后一个进场需要变成三个班次
  585 + // 1个分班进场班次插入到前面的班次
  586 + // 后面添加两个班次,1个到场班次,1个离场班次
568 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 3), 587 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 3),
569 - "场", new Color(0x96b9d7)); 588 + "场", new Color(0x96b9d7));
570 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 4), 589 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 4),
571 "离场", new Color(0x96b9d7)); 590 "离场", new Color(0x96b9d7));
572 591
@@ -589,56 +608,74 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -589,56 +608,74 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
589 LpObj lpObj = lpObjList.get(i); 608 LpObj lpObj = lpObjList.get(i);
590 XSSFRow lpRow = sheet.createRow((short) (i + 1)); 609 XSSFRow lpRow = sheet.createRow((short) (i + 1));
591 PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname()); 610 PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname());
592 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (1));  
593 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (2));  
594 - for (int j = 1; j <= groupCount; j++) {  
595 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));  
596 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 2));  
597 - }  
598 611
599 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 3));  
600 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 4)); 612 + // 创建空白单元格,并设置字符串格式
  613 + XSSFCell xssfCell = null;
601 614
602 - for (BcObj bcObj : lpObj.getBcObjList()) {  
603 - if (bcObj.getBcType() == BcType.NORMAL) {  
604 - Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));  
605 - cell.setCellValue(bcObj.getFcsj()); 615 + xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (1));
  616 + PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
606 617
607 - } else if (bcObj.getBcType() == BcType.BD) {  
608 - if (bcObj.getGroupNo() == -1) {  
609 - Cell cell = lpRow.getCell((short) 1);  
610 - cell.setCellValue(bcObj.getFcsj());  
611 - } else if (bcObj.getGroupNo() > 0) { // 分班报到  
612 - Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));  
613 - cell.setCellValue("报" + bcObj.getFcsj()); 618 + xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (2));
  619 + PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
614 620
615 - }  
616 -  
617 - } else if (bcObj.getBcType() == BcType.OUT) {  
618 - if (bcObj.getGroupNo() == -1) {  
619 - Cell cell = lpRow.getCell((short) (2));  
620 - cell.setCellValue(bcObj.getFcsj());  
621 - } else if (bcObj.getGroupNo() > 0) { // 分班出场  
622 - Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));  
623 - cell.setCellValue("出" + bcObj.getFcsj());  
624 - } 621 + for (int j = 1; j <= groupCount; j++) {
  622 + xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));
  623 + PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
  624 + xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 2));
  625 + PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
  626 + }
625 627
626 - } else if (bcObj.getBcType() == BcType.IN) {  
627 - if (bcObj.getGroupNo() == -2) {  
628 - Cell cell = lpRow.getCell((short) (groupCount * 2 + 3)); 628 + xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 3));
  629 + PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
  630 + xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 4));
  631 + PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
  632 +
  633 + for (int j = 0; j < lpObj.getBcObjList().size(); j++) {
  634 + BcObj bcObj = lpObj.getBcObjList().get(j); // 当前班次
  635 + Cell cell = null; // 待处理的单元格
  636 +
  637 + switch (bcObj.getBcType()) {
  638 + case BD: // 报到班次
  639 + if (bcObj.getIsFb()) { // 分班-两个车次链
  640 + cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
  641 + cell.setCellValue("报" + bcObj.getFcsj());
  642 + } else { // 一个车次链
  643 + cell = lpRow.getCell((short) 1);
  644 + cell.setCellValue(bcObj.getFcsj());
  645 + }
  646 + break;
  647 + case OUT: // 出场班次
  648 + if (bcObj.getIsFb()) { // 分班-两个车次链
  649 + cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
  650 + cell.setCellValue("出" + bcObj.getFcsj());
  651 + } else { // 一个车次链
  652 + cell = lpRow.getCell((short) (2));
  653 + cell.setCellValue(bcObj.getFcsj());
  654 + }
  655 + break;
  656 + case NORMAL: // 正常班次
  657 + cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
629 cell.setCellValue(bcObj.getFcsj()); 658 cell.setCellValue(bcObj.getFcsj());
630 - } else if (bcObj.getGroupNo() > 0) { //分班进场  
631 - Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));  
632 - // 停驶用 ※  
633 - cell.setCellValue(bcObj.getFcsj() + "X");  
634 - }  
635 -  
636 - } else if (bcObj.getBcType() == BcType.LC) {  
637 - if (bcObj.getGroupNo() == -2) {  
638 - Cell cell = lpRow.getCell((short) (groupCount * 2 + 4)); 659 + break;
  660 + case IN: // 进场班次
  661 + if (bcObj.getIsFb()) { // 分班-两个车次链
  662 + cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
  663 + // TODO:停驶用 ※
  664 + cell.setCellValue(bcObj.getFcsj() + "X");
  665 + } else { // 一个车次链
  666 + cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
  667 + cell.setCellValue(bcObj.getFcsj() + "X");
  668 + }
  669 + break;
  670 + case LC:
  671 + // 这个是到场,准备离场班次
  672 + cell = lpRow.getCell((short) (groupCount * 2 + 3));
639 cell.setCellValue(bcObj.getFcsj()); 673 cell.setCellValue(bcObj.getFcsj());
640 - }  
641 - 674 + // 加10分钟表示真正离场时间
  675 + cell = lpRow.getCell((short) (groupCount * 2 + 4));
  676 + LocalTime localTime = LocalTime.parse(bcObj.getFcsj(), DateTimeFormat.forPattern("HH:mm"));
  677 + cell.setCellValue(localTime.plusMinutes(10).toString(DateTimeFormat.forPattern("HH:mm")));
  678 + break;
642 } 679 }
643 } 680 }
644 681
@@ -647,9 +684,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -647,9 +684,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
647 PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 6), lpObj.getYylc()); 684 PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 6), lpObj.getYylc());
648 PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 7), lpObj.getKslc()); 685 PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 7), lpObj.getKslc());
649 PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 8), 686 PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 8),
650 - String.format("%d小时%d分钟", (int) (lpObj.getZgs() / 60), (int) (lpObj.getZgs() % 60))); 687 + String.format("%d%s%d", (int) (lpObj.getZgs() / 60), ":", (int) (lpObj.getZgs() % 60)));
651 PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 9), 688 PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 9),
652 - String.format("%d小时%d分钟", (int) (lpObj.getYygs() / 60), (int) (lpObj.getYygs() % 60))); 689 + String.format("%d%s%d", (int) (lpObj.getYygs() / 60), ":", (int) (lpObj.getYygs() % 60)));
653 PoiUtils.createIntegerXSSFCell(wb, lpRow, (short) (groupCount * 2 + 10), lpObj.getYybc()); 690 PoiUtils.createIntegerXSSFCell(wb, lpRow, (short) (groupCount * 2 + 10), lpObj.getYybc());
654 691
655 } 692 }
src/main/java/com/bsth/service/schedule/datatools/TTinfoDetailDynamicData.java
@@ -54,6 +54,9 @@ public interface TTinfoDetailDynamicData { @@ -54,6 +54,9 @@ public interface TTinfoDetailDynamicData {
54 /** 是否上行 */ 54 /** 是否上行 */
55 private Boolean isUp; 55 private Boolean isUp;
56 56
  57 + /** 是否分班 */
  58 + private Boolean isFb;
  59 +
57 /** 班次类型 */ 60 /** 班次类型 */
58 private BcType bcType; 61 private BcType bcType;
59 /** 发车时刻 */ 62 /** 发车时刻 */
@@ -154,14 +157,6 @@ public interface TTinfoDetailDynamicData { @@ -154,14 +157,6 @@ public interface TTinfoDetailDynamicData {
154 this.groupBcNo = groupBcNo; 157 this.groupBcNo = groupBcNo;
155 } 158 }
156 159
157 - public Boolean getUp() {  
158 - return isUp;  
159 - }  
160 -  
161 - public void setUp(Boolean up) {  
162 - isUp = up;  
163 - }  
164 -  
165 public String getFcsjDesc() { 160 public String getFcsjDesc() {
166 return fcsjDesc; 161 return fcsjDesc;
167 } 162 }
@@ -169,6 +164,14 @@ public interface TTinfoDetailDynamicData { @@ -169,6 +164,14 @@ public interface TTinfoDetailDynamicData {
169 public void setFcsjDesc(String fcsjDesc) { 164 public void setFcsjDesc(String fcsjDesc) {
170 this.fcsjDesc = fcsjDesc; 165 this.fcsjDesc = fcsjDesc;
171 } 166 }
  167 +
  168 + public Boolean getIsFb() {
  169 + return isFb;
  170 + }
  171 +
  172 + public void setIsFb(Boolean fb) {
  173 + isFb = fb;
  174 + }
172 } 175 }
173 176
174 public static class LpObj { // 路牌对象 177 public static class LpObj { // 路牌对象
@@ -314,6 +317,7 @@ public interface TTinfoDetailDynamicData { @@ -314,6 +317,7 @@ public interface TTinfoDetailDynamicData {
314 public void setYybc(Integer yybc) { 317 public void setYybc(Integer yybc) {
315 this.yybc = yybc; 318 this.yybc = yybc;
316 } 319 }
  320 +
317 } 321 }
318 322
319 public static class StatInfo { // 统计数据对象 323 public static class StatInfo { // 统计数据对象
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
@@ -565,7 +565,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -565,7 +565,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
565 } 565 }
566 try { 566 try {
567 567
568 - String sql = "select * from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"; 568 + String sql = "select schedule_date_str,xl_name,bc_type,gs_name,fgs_name,bcs,fcno,"
  569 + +"fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service"
  570 + +" from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate
  571 + +"' and schedule_date_str <= '"+endDate+"'";
569 if(line.length() != 0){ 572 if(line.length() != 0){
570 sql += " and xl_bm = '"+line+"'"; 573 sql += " and xl_bm = '"+line+"'";
571 } 574 }
@@ -636,8 +639,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -636,8 +639,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
636 639
637 if(model.length() != 0){ 640 if(model.length() != 0){
638 // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'"; 641 // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
639 - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'" +  
640 - " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'"; 642 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'"
  643 + + " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'";
641 if(line.length() != 0){ 644 if(line.length() != 0){
642 sql += " and xl_bm = '"+line+"'"; 645 sql += " and xl_bm = '"+line+"'";
643 } 646 }
@@ -656,21 +659,21 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -656,21 +659,21 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
656 e.printStackTrace(); 659 e.printStackTrace();
657 } 660 }
658 661
  662 + Set<Long> ttSet = new HashSet<Long>();
  663 + for(Long tt : ttList){
  664 + ttSet.add(tt);
  665 + }
659 //分组计算 同时判断是否所选时刻信息 666 //分组计算 同时判断是否所选时刻信息
660 for(ScheduleRealInfo schedule : list){ 667 for(ScheduleRealInfo schedule : list){
661 if(schedule.isCcService()){ 668 if(schedule.isCcService()){
662 continue; 669 continue;
663 } 670 }
664 - DO:{  
665 if(model.length() != 0){ 671 if(model.length() != 0){
666 - for(Long tt : ttList){  
667 - if((long)tt == (long)schedule.getSpId()){  
668 - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();  
669 - if(!keyMap.containsKey(key))  
670 - keyMap.put(key, new ArrayList<ScheduleRealInfo>());  
671 - keyMap.get(key).add(schedule);  
672 - break DO;  
673 - } 672 + if(ttSet.contains(schedule.getSpId())){
  673 + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
  674 + if(!keyMap.containsKey(key))
  675 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  676 + keyMap.get(key).add(schedule);
674 } 677 }
675 } else { 678 } else {
676 String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); 679 String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
@@ -678,7 +681,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -678,7 +681,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
678 keyMap.put(key, new ArrayList<ScheduleRealInfo>()); 681 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
679 keyMap.get(key).add(schedule); 682 keyMap.get(key).add(schedule);
680 } 683 }
681 - }  
682 } 684 }
683 String companyName = "", subCompanyName = ""; 685 String companyName = "", subCompanyName = "";
684 for(String key : keyMap.keySet()){ 686 for(String key : keyMap.keySet()){
@@ -800,7 +802,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -800,7 +802,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
800 if(page.length() != 0 && type.equals("query")){ 802 if(page.length() != 0 && type.equals("query")){
801 int currPage = Integer.valueOf(page); 803 int currPage = Integer.valueOf(page);
802 modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10); 804 modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10);
803 - modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10)); 805 +// modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10));
  806 + modelMap.put("dataList", resList);
804 } else { 807 } else {
805 modelMap.put("dataList", resList); 808 modelMap.put("dataList", resList);
806 } 809 }
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
1 package com.bsth.service.schedule.impl; 1 package com.bsth.service.schedule.impl;
2 2
3 -import com.bsth.entity.Line;  
4 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
5 -import com.bsth.entity.schedule.SchedulePlanInfo;  
6 import com.bsth.entity.schedule.TTInfo; 4 import com.bsth.entity.schedule.TTInfo;
7 -import com.bsth.entity.schedule.rule.ScheduleRule1Flat;  
8 import com.bsth.repository.BusinessRepository; 5 import com.bsth.repository.BusinessRepository;
9 import com.bsth.repository.LineRepository; 6 import com.bsth.repository.LineRepository;
10 import com.bsth.repository.schedule.*; 7 import com.bsth.repository.schedule.*;
11 import com.bsth.service.schedule.SchedulePlanService; 8 import com.bsth.service.schedule.SchedulePlanService;
12 import com.bsth.service.schedule.exception.ScheduleException; 9 import com.bsth.service.schedule.exception.ScheduleException;
  10 +import com.bsth.service.schedule.plan.DroolsSchedulePlan;
13 import com.bsth.service.schedule.rules.ScheduleRuleService; 11 import com.bsth.service.schedule.rules.ScheduleRuleService;
14 -import com.bsth.service.schedule.rules.plan.PlanCalcuParam_input;  
15 -import com.bsth.service.schedule.rules.plan.PlanResult;  
16 -import com.bsth.service.schedule.rules.rerun.RerunRule_input;  
17 -import com.bsth.service.schedule.rules.rerun.RerunRule_param;  
18 -import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;  
19 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output;  
20 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;  
21 -import com.bsth.service.schedule.rules.ttinfo.*;  
22 import com.bsth.service.schedule.rules.ttinfo2.CalcuParam; 12 import com.bsth.service.schedule.rules.ttinfo2.CalcuParam;
23 import com.bsth.service.schedule.rules.ttinfo2.Result; 13 import com.bsth.service.schedule.rules.ttinfo2.Result;
24 -import com.bsth.service.schedule.rules.validate.ValidateParam;  
25 -import com.bsth.service.schedule.rules.validate.ValidateResults_output;  
26 -import org.apache.commons.lang3.StringUtils;  
27 import org.joda.time.DateTime; 14 import org.joda.time.DateTime;
28 import org.kie.api.KieBase; 15 import org.kie.api.KieBase;
29 import org.kie.api.runtime.KieSession; 16 import org.kie.api.runtime.KieSession;
@@ -37,6 +24,9 @@ import org.springframework.transaction.annotation.Propagation; @@ -37,6 +24,9 @@ import org.springframework.transaction.annotation.Propagation;
37 import org.springframework.transaction.annotation.Transactional; 24 import org.springframework.transaction.annotation.Transactional;
38 25
39 import java.util.*; 26 import java.util.*;
  27 +import java.util.concurrent.ConcurrentHashMap;
  28 +import java.util.concurrent.TimeUnit;
  29 +import java.util.concurrent.locks.ReentrantLock;
40 30
41 /** 31 /**
42 * Created by xu on 16/6/16. 32 * Created by xu on 16/6/16.
@@ -44,12 +34,12 @@ import java.util.*; @@ -44,12 +34,12 @@ import java.util.*;
44 @Service 34 @Service
45 public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> implements SchedulePlanService { 35 public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> implements SchedulePlanService {
46 @Autowired 36 @Autowired
47 - @Qualifier("kb1")  
48 - private KieBase kieBase; 37 + @Qualifier("coreKBase")
  38 + private KieBase coreKBase;
49 39
50 @Autowired 40 @Autowired
51 - @Qualifier("kb2")  
52 - private KieBase kieBase2; 41 + @Qualifier("preKBase")
  42 + private KieBase preKBase;
53 43
54 @Autowired 44 @Autowired
55 private ScheduleRule1FlatRepository scheduleRule1FlatRepository; 45 private ScheduleRule1FlatRepository scheduleRule1FlatRepository;
@@ -73,398 +63,62 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -73,398 +63,62 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
73 /** 日志记录器 */ 63 /** 日志记录器 */
74 private Logger logger = LoggerFactory.getLogger(SchedulePlanServiceImpl.class); 64 private Logger logger = LoggerFactory.getLogger(SchedulePlanServiceImpl.class);
75 65
76 - /**  
77 - * 计算规则输入。  
78 - * @param schedulePlan  
79 - * @return  
80 - */  
81 - private List<ScheduleRule_input> calcuSrfList(SchedulePlan schedulePlan) {  
82 - // 1-1、构造drools规则输入数据,输出数据  
83 - // 全局计算参数  
84 - ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(schedulePlan);  
85 -  
86 - // 规则输出数据  
87 - List<ScheduleRule_input> scheduleRule_inputs = new ArrayList<>();  
88 -  
89 - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session  
90 - // 创建session,内部配置的是stateful  
91 - KieSession session = kieBase2.newKieSession();  
92 - // 设置gloable对象,在drl中通过别名使用  
93 - session.setGlobal("sriList", scheduleRule_inputs);  
94 - session.setGlobal("log", logger); // 设置日志  
95 -  
96 - session.setGlobal("srf", scheduleRule1FlatRepository);  
97 - session.setGlobal("rrr", rerunRuleRepository);  
98 - session.setGlobal("srservice", scheduleRuleService);  
99 -  
100 - // 载入数据  
101 - session.insert(scheduleCalcuParam_input);  
102 -  
103 - // 执行rule  
104 - session.fireAllRules();  
105 -  
106 - // 执行完毕销毁,有日志的也要关闭  
107 - session.dispose();  
108 -  
109 - return scheduleRule_inputs;  
110 - }  
111 -  
112 - /**  
113 - * 循环规则输出。  
114 - * @param schedulePlan 排班计划对象  
115 - * @param lpInfoResults_output 时刻表每日路牌的情况  
116 - */  
117 - private ScheduleResults_output loopRuleOutput(  
118 - SchedulePlan schedulePlan,  
119 - LpInfoResults_output lpInfoResults_output) {  
120 - // 1-1、构造drools规则输入数据,输出数据  
121 - // 全局计算参数  
122 - ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(schedulePlan);  
123 - // 每个规则对应的输入参数  
124 - List<ScheduleRule_input> scheduleRule_inputs = calcuSrfList(schedulePlan);  
125 -  
126 - // 规则输出数据  
127 - ScheduleResults_output scheduleResults_output = new ScheduleResults_output();  
128 -  
129 - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session  
130 - // 创建session,内部配置的是stateful  
131 - KieSession session = kieBase.newKieSession();  
132 - // 设置gloable对象,在drl中通过别名使用  
133 - session.setGlobal("scheduleResult", scheduleResults_output);  
134 - session.setGlobal("log", logger); // 设置日志  
135 - session.setGlobal("scheduleRuleService", scheduleRuleService);  
136 -  
137 - // 载入数据  
138 - session.insert(scheduleCalcuParam_input);  
139 - for (ScheduleRule_input scheduleRule_input : scheduleRule_inputs) {  
140 - session.insert(scheduleRule_input);  
141 - }  
142 - // 每日时刻表路牌数据  
143 - for (LpInfoResult_output lpInfoResult_output: lpInfoResults_output.getLpInfoResult_outputs()) {  
144 - session.insert(lpInfoResult_output);  
145 - }  
146 - // 执行rule  
147 - session.fireAllRules();  
148 -  
149 - // 执行完毕销毁,有日志的也要关闭  
150 - session.dispose();  
151 -  
152 - // 保存循环规则结果数据  
153 - scheduleRuleService.generateRuleResult(scheduleResults_output.getSchedulePlanRuleResults());  
154 -  
155 -// logger.info("循环规则输出={}", scheduleResults_output.showGuideboardDesc1());  
156 -  
157 - return scheduleResults_output;  
158 - }  
159 -  
160 - /**  
161 - * 时刻表选择(判定每天使用的时刻表,以及路牌数据输出)。  
162 - * @param schedulePlan 排班计划对象  
163 - * @return TTInfoResults_output, LpInfoResults_output  
164 - */  
165 - private Object[] ttInfoOutput(SchedulePlan schedulePlan) {  
166 - // 获取线路的所有未作废的时刻表  
167 - List<TTInfo> ttInfos = ttInfoRepository.findInCanceledByXl(schedulePlan.getXl());  
168 -  
169 - // 1-1、构造drools规则输入数据,输出数据  
170 - // 全局计算参数  
171 - TTInfoCalcuParam_input ttInfoCalcuParam_input =  
172 - new TTInfoCalcuParam_input(  
173 - new DateTime(schedulePlan.getScheduleFromTime()),  
174 - new DateTime(schedulePlan.getScheduleToTime()),  
175 - String.valueOf(schedulePlan.getXl().getId())  
176 - );  
177 - // 规则输出数据  
178 - TTInfoResults_output ttInfoResults_output = new TTInfoResults_output();  
179 - LpInfoResults_output lpInfoResults_output = new LpInfoResults_output();  
180 -  
181 - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session  
182 - // 创建session,内部配置的是stateful  
183 - KieSession session = kieBase.newKieSession();  
184 -  
185 - // 设置gloable对象,在drl中通过别名使用  
186 - session.setGlobal("results", ttInfoResults_output);  
187 - session.setGlobal("lpInfoResults_output", lpInfoResults_output);  
188 - session.setGlobal("log", logger); // 设置日志  
189 - session.setGlobal("tTInfoDetailRepository", ttInfoDetailRepository);  
190 -  
191 - // 载入数据  
192 - session.insert(ttInfoCalcuParam_input);  
193 - for (TTInfo ttInfo : ttInfos) {  
194 - TTInfo_input ttInfo_input = new TTInfo_input(ttInfo);  
195 - session.insert(ttInfo_input);  
196 - }  
197 -  
198 - // 载入数据2(计算规则最早启用时间)  
199 - List<ScheduleRule1Flat> scheduleRule1Flats = scheduleRule1FlatRepository.findByXl(schedulePlan.getXl());  
200 -  
201 - for (ScheduleRule1Flat scheduleRule1Flat: scheduleRule1Flats) {  
202 - ScheduleRule_input scheduleRule_input = new ScheduleRule_input(scheduleRule1Flat);  
203 - session.insert(scheduleRule_input);  
204 - }  
205 -  
206 - // 执行rule  
207 - session.fireAllRules();  
208 -  
209 - // 执行完毕销毁,有日志的也要关闭  
210 - session.dispose();  
211 -  
212 - return new Object[] {ttInfoResults_output, lpInfoResults_output};  
213 -  
214 - }  
215 -  
216 - /**  
217 - * 排班生成。  
218 - * @param schedulePlan 排班计划对象  
219 - * @param scheduleResults_output loopRuleOutput方法规则输出  
220 - * @param ttInfoResults_output ttInfoOutput方法规则输出  
221 - * @return PlanResult  
222 - */  
223 - private PlanResult planResultOutput(  
224 - SchedulePlan schedulePlan,  
225 - ScheduleResults_output scheduleResults_output,  
226 - TTInfoResults_output ttInfoResults_output) {  
227 -  
228 - // 1-1、构造drools规则输入数据,输出数据  
229 - PlanCalcuParam_input planCalcuParam_input = new PlanCalcuParam_input(  
230 - schedulePlan,  
231 - scheduleResults_output,  
232 - ttInfoResults_output  
233 - );  
234 - // 规则输出数据  
235 - PlanResult planResult = new PlanResult();  
236 - planResult.setXlId(schedulePlan.getXl().getId().toString());  
237 -  
238 - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session  
239 - // 创建session,内部配置的是stateful  
240 - KieSession session = kieBase.newKieSession();  
241 -  
242 - // 设置gloable对象,在drl中通过别名使用  
243 - session.setGlobal("planResult", planResult);  
244 - session.setGlobal("log", logger); // 设置日志  
245 -  
246 - session.setGlobal("tTInfoDetailRepository", ttInfoDetailRepository);  
247 - session.setGlobal("carConfigInfoRepository", carConfigInfoRepository);  
248 - session.setGlobal("employeeConfigInfoRepository", employeeConfigInfoRepository);  
249 - session.setGlobal("lineRepository", lineRepository);  
250 - session.setGlobal("businessRepository", businessRepository);  
251 -  
252 - // 载入数据  
253 - session.insert(planCalcuParam_input);  
254 -  
255 - // 执行rule  
256 - session.fireAllRules();  
257 -  
258 - // 执行完毕销毁,有日志的也要关闭  
259 - session.dispose();  
260 -  
261 - return planResult;  
262 -  
263 - }  
264 -  
265 - /**  
266 - * 生成线路排班(不含套跑规则)。  
267 - * @param schedulePlan  
268 - * @return  
269 - */  
270 - private PlanResult schedulePlanWithOutRerun(SchedulePlan schedulePlan) {  
271 - // 1、时刻表数据及每日路牌数据计算  
272 - Date start1 = new Date();  
273 - Object[] ttInfoRets = ttInfoOutput(schedulePlan);  
274 - TTInfoResults_output ttInfoResults_output = (TTInfoResults_output) ttInfoRets[0];  
275 - LpInfoResults_output lpInfoResults_output = (LpInfoResults_output) ttInfoRets[1];  
276 - Date end1 = new Date();  
277 - // 2、循环规则计算输出  
278 - Date start2 = new Date();  
279 - ScheduleResults_output scheduleResults_output = loopRuleOutput(schedulePlan, lpInfoResults_output);  
280 - Date end2 = new Date();  
281 -  
282 - logger.info("规则计算结果={}", scheduleResults_output.showGuideboardDesc1());  
283 -  
284 - // 3、计划输出  
285 - Date start3 = new Date();  
286 - PlanResult planResult = planResultOutput(schedulePlan, scheduleResults_output, ttInfoResults_output);  
287 - Date end3 = new Date();  
288 -  
289 - logger.info("drool时刻表每日路牌计算 {} ms,drool循环规则计算 {} ms,drool计划数据 {} ms",  
290 - end1.getTime() - start1.getTime(),  
291 - end2.getTime() - start2.getTime(),  
292 - end3.getTime() - start3.getTime());  
293 -  
294 - // TODO:将lpInfoResults_output 也要返回  
295 -  
296 - return planResult;  
297 - }  
298 -  
299 - /**  
300 - * 套跑计划排班数据。  
301 - * @param planResult  
302 - */  
303 - private void rerunPlanResult(PlanResult planResult, SchedulePlan schedulePlan) {  
304 - List<RerunRule_input> rerunRule_inputs = scheduleRuleService.findRerunrule(Integer.parseInt(planResult.getXlId()));  
305 - logger.info("套跑数量 {} 组", rerunRule_inputs.size());  
306 -  
307 - // 主线路id  
308 - Integer mainXlId = schedulePlan.getXl().getId();  
309 -  
310 - if (rerunRule_inputs.size() > 0) {  
311 - // 找出是对应路牌类型的线路,计算循环规则输出  
312 - Set<String> xlids = new HashSet<>();  
313 - for (RerunRule_input rerunRule_input: rerunRule_inputs) {  
314 - if ("dylp".equals(rerunRule_input.getType())) {  
315 - xlids.add(rerunRule_input.getS_xl()); // 参与套跑的线路  
316 - }  
317 - }  
318 -  
319 - List<ScheduleResults_output> scheduleResults_outputs = new ArrayList<>();  
320 - Date start1 = new Date();  
321 - for (String xlid: xlids) {  
322 - schedulePlan.getXl().setId(Integer.parseInt(xlid)); // 套跑的线路默认跟着主线路设定走  
323 - // 获取套跑线路的循环规则计算输出  
324 - Object[] ttInfoRets = ttInfoOutput(schedulePlan);  
325 - LpInfoResults_output lpInfoResults_output = (LpInfoResults_output) ttInfoRets[1];  
326 - ScheduleResults_output scheduleResults_output = loopRuleOutput(schedulePlan, lpInfoResults_output);  
327 - scheduleResults_outputs.add(scheduleResults_output);  
328 - }  
329 -  
330 - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session  
331 - // 创建session,内部配置的是stateful  
332 - KieSession session = kieBase.newKieSession();  
333 -  
334 - // 设置gloable对象,在drl中通过别名使用  
335 - session.setGlobal("planResult", planResult);  
336 - session.setGlobal("log", logger); // 设置日志  
337 -  
338 - session.setGlobal("carConfigInfoRepository", carConfigInfoRepository);  
339 - session.setGlobal("employeeConfigInfoRepository", employeeConfigInfoRepository);  
340 -  
341 - // 载入数据  
342 - RerunRule_param rerunRule_param = new RerunRule_param();  
343 - rerunRule_param.setMxlid(planResult.getXlId());  
344 - rerunRule_param.setXlIds_dylp(xlids);  
345 - session.insert(rerunRule_param);  
346 - for (RerunRule_input rri: rerunRule_inputs) {  
347 - session.insert(rri);  
348 - }  
349 - for (SchedulePlanInfo spi: planResult.getSchedulePlanInfos()) {  
350 - session.insert(spi); 66 + /** 线路独占锁 */
  67 + private ConcurrentHashMap<Integer, ReentrantLock> lineXLatchMaps = new ConcurrentHashMap<>();
  68 + private ReentrantLock getLineXLatch(Integer xlid) {
  69 + ReentrantLock lineXLatch = lineXLatchMaps.get(xlid);
  70 + if (lineXLatch == null) {
  71 + lineXLatch = new ReentrantLock();
  72 + ReentrantLock pre = lineXLatchMaps.putIfAbsent(xlid, lineXLatch);
  73 + if (pre != null) {
  74 + lineXLatch = pre;
351 } 75 }
352 - for (ScheduleResults_output sro: scheduleResults_outputs) {  
353 - session.insert(sro);  
354 - }  
355 -  
356 - // 执行rule  
357 - session.fireAllRules();  
358 -  
359 - // 执行完毕销毁,有日志的也要关闭  
360 - session.dispose();  
361 -  
362 - Date end1 = new Date();  
363 - logger.info("套跑规则计算,耗时 {} ms", end1.getTime() - start1.getTime());  
364 -  
365 - schedulePlan.getXl().setId(mainXlId);  
366 -  
367 - }  
368 -  
369 - }  
370 -  
371 - /**  
372 - * 验证排班结果。  
373 - * @param planResult  
374 - * @param schedulePlan  
375 - */  
376 - public void validPlanResult(PlanResult planResult, SchedulePlan schedulePlan) {  
377 - // 1-1、构造drools规则输入数据,输出数据  
378 - ValidateParam validateParam = new ValidateParam(  
379 - new DateTime(schedulePlan.getScheduleFromTime()),  
380 - new DateTime(schedulePlan.getScheduleToTime())  
381 - );  
382 - // 规则输出数据  
383 - ValidateResults_output result = new ValidateResults_output();  
384 -  
385 - // 1-2、构造drools session->载入数据->启动规则->计算->销毁session  
386 - // 创建session,内部配置的是stateful  
387 - KieSession session = kieBase.newKieSession();  
388 -  
389 - // 设置gloable对象,在drl中通过别名使用  
390 - session.setGlobal("validResult", result);  
391 - session.setGlobal("log", logger); // 设置日志  
392 -  
393 - // 载入数据  
394 - session.insert(validateParam);  
395 - for (SchedulePlanInfo schedulePlanInfo: planResult.getSchedulePlanInfos()) {  
396 - session.insert(schedulePlanInfo);  
397 - }  
398 -  
399 - // 执行rule  
400 - session.fireAllRules();  
401 -  
402 - // 执行完毕销毁,有日志的也要关闭  
403 - session.dispose();  
404 -  
405 -// logger.info("错误总数={}", result.getInfos().size());  
406 -// for (ValidateResults_output.ValidInfo validInfo: result.getInfos()) {  
407 -// logger.info(validInfo.getDesc());  
408 -// }  
409 -  
410 - // 取10条错误  
411 - int size = result.getInfos().size() > 10 ? 10: result.getInfos().size();  
412 - List<String> desclist = new ArrayList<>();  
413 - for (int i = 0; i < size; i++) {  
414 - desclist.add(result.getInfos().get(i).getDesc());  
415 - }  
416 - if (desclist.size() > 0) {  
417 - schedulePlan.setPlanResult(StringUtils.join(desclist, "</br>"));  
418 - } else {  
419 - schedulePlan.setPlanResult("ok");  
420 } 76 }
421 -  
422 - // TODO:设定错误信息 77 + return lineXLatch;
423 } 78 }
424 79
425 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) 80 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
426 public SchedulePlan save(SchedulePlan schedulePlan) { 81 public SchedulePlan save(SchedulePlan schedulePlan) {
427 - // pre、如果排班的数据之前已经有了,删除之前的数据  
428 - Date startpre = new Date();  
429 - scheduleRuleService.deleteSchedulePlanInfo(  
430 - schedulePlan.getXl().getLineCode(),  
431 - schedulePlan.getScheduleFromTime(),  
432 - schedulePlan.getScheduleToTime());  
433 - Date endpre = new Date();  
434 -  
435 - // 1、查找线路,这是主线路  
436 - Line xl = lineRepository.findOne(schedulePlan.getXl().getId());  
437 - logger.info("<--- 排班master线路 id={}, name={}, 开始排班", xl.getId(), xl.getName());  
438 -  
439 - // 2、确定主线路排班(包含完全套跑路牌规则,所谓完全套跑路牌规则指整个路牌的班次都是套跑规则指定的)  
440 - PlanResult planResult = schedulePlanWithOutRerun(schedulePlan);  
441 -  
442 - // 3、确定套跑规则  
443 - rerunPlanResult(planResult, schedulePlan);  
444 -  
445 - // TODO:3-1、验证排班结果  
446 - validPlanResult(planResult, schedulePlan); 82 + ReentrantLock lineXLatch = getLineXLatch(schedulePlan.getXl().getId());
  83 + try {
  84 + if (lineXLatch.tryLock(1, TimeUnit.SECONDS)) {
  85 + // pre、如果排班的数据之前已经有了,删除之前的数据
  86 + Date startPre = new Date();
  87 + scheduleRuleService.deleteSchedulePlanInfo(
  88 + schedulePlan.getXl().getLineCode(),
  89 + schedulePlan.getScheduleFromTime(),
  90 + schedulePlan.getScheduleToTime());
  91 + Date endPre = new Date();
  92 + logger.info("删除数据 {} ms --->", endPre.getTime() - startPre.getTime());
  93 +
  94 + // core、生成排班计划
  95 + DroolsSchedulePlan droolsSchedulePlan = new DroolsSchedulePlan(
  96 + schedulePlan,
  97 + lineRepository, scheduleRule1FlatRepository,
  98 + ttInfoRepository, ttInfoDetailRepository,
  99 + carConfigInfoRepository, employeeConfigInfoRepository,
  100 + rerunRuleRepository, businessRepository,
  101 + scheduleRuleService,
  102 + preKBase, coreKBase,
  103 + logger
  104 + );
  105 + droolsSchedulePlan.generatePlan();
447 106
448 - // TODO:3-2、去除完全套跑遗漏班次(以后放到规则中执行)  
449 - Iterator<SchedulePlanInfo> infoIterator = planResult.getSchedulePlanInfos().iterator();  
450 - while (infoIterator.hasNext()) {  
451 - SchedulePlanInfo schedulePlanInfo = infoIterator.next();  
452 - if (schedulePlanInfo.getCl() == null) {  
453 - infoIterator.remove(); 107 + return new SchedulePlan();
  108 + } else {
  109 + throw new ScheduleException("当前线路正在排班,请稍后再操作...");
454 } 110 }
455 - } 111 + } catch (Exception exp) {
  112 + throw new RuntimeException(exp);
  113 + } finally {
  114 + try {
  115 + lineXLatch.unlock();
  116 + } catch (Exception exp2) {
456 117
457 - // 4、保存数据(jdbcTemplate 批量插入)  
458 - Date start4 = new Date();  
459 - scheduleRuleService.generateSchedulePlan(schedulePlan, planResult.getSchedulePlanInfos());  
460 - Date end4 = new Date(); 118 + }
461 119
462 - logger.info("删除数据 {} ms,保存主线路数据 {} 条 耗时 {} ms --->",  
463 - endpre.getTime() - startpre.getTime(),  
464 - planResult.getSchedulePlanInfos().size(),  
465 - end4.getTime() - start4.getTime()); 120 + }
466 121
467 - return new SchedulePlan();  
468 } 122 }
469 123
470 @Override 124 @Override
@@ -475,10 +129,12 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -475,10 +129,12 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
475 @Override 129 @Override
476 public SchedulePlan findSchedulePlanTommorw() { 130 public SchedulePlan findSchedulePlanTommorw() {
477 DateTime today = new DateTime(new Date()); 131 DateTime today = new DateTime(new Date());
478 - DateTime tommorw = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth(), 0, 0).plusDays(1); 132 + DateTime tommorw = new DateTime(
  133 + today.getYear(), today.getMonthOfYear(),
  134 + today.getDayOfMonth(), 0, 0).plusDays(1);
479 Map<String, Object> param = new HashMap<>(); 135 Map<String, Object> param = new HashMap<>();
480 param.put("scheduleFromTime_le", tommorw.toDate()); 136 param.put("scheduleFromTime_le", tommorw.toDate());
481 - param.put("scheduleToTime_ge", tommorw.toDate() ); 137 + param.put("scheduleToTime_ge", tommorw.toDate());
482 Iterator<SchedulePlan> schedulePlanIterator = this.list(param).iterator(); 138 Iterator<SchedulePlan> schedulePlanIterator = this.list(param).iterator();
483 if (schedulePlanIterator.hasNext()) { 139 if (schedulePlanIterator.hasNext()) {
484 return schedulePlanIterator.next(); 140 return schedulePlanIterator.next();
@@ -490,7 +146,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -490,7 +146,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
490 public Result validateTTInfo(Integer xlid, Date from, Date to) { 146 public Result validateTTInfo(Integer xlid, Date from, Date to) {
491 // 构造drools session->载入数据->启动规则->计算->销毁session 147 // 构造drools session->载入数据->启动规则->计算->销毁session
492 // 创建session,内部配置的是stateful 148 // 创建session,内部配置的是stateful
493 - KieSession session = kieBase.newKieSession(); 149 + KieSession session = coreKBase.newKieSession();
494 // 设置gloable对象,在drl中通过别名使用 150 // 设置gloable对象,在drl中通过别名使用
495 session.setGlobal("log", logger); 151 session.setGlobal("log", logger);
496 session.setGlobal("lineRepository", lineRepository); 152 session.setGlobal("lineRepository", lineRepository);
@@ -513,7 +169,6 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -513,7 +169,6 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
513 // 执行完毕销毁,有日志的也要关闭 169 // 执行完毕销毁,有日志的也要关闭
514 session.dispose(); 170 session.dispose();
515 171
516 -  
517 return rs; 172 return rs;
518 } 173 }
519 } 174 }
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
@@ -15,12 +15,15 @@ import com.bsth.repository.schedule.TTInfoRepository; @@ -15,12 +15,15 @@ import com.bsth.repository.schedule.TTInfoRepository;
15 import com.bsth.repository.sys.SysUserRepository; 15 import com.bsth.repository.sys.SysUserRepository;
16 import com.bsth.service.CarParkService; 16 import com.bsth.service.CarParkService;
17 import com.bsth.service.LineInformationService; 17 import com.bsth.service.LineInformationService;
  18 +import com.bsth.service.LineService;
18 import com.bsth.service.StationRouteService; 19 import com.bsth.service.StationRouteService;
19 import com.bsth.service.schedule.GuideboardInfoService; 20 import com.bsth.service.schedule.GuideboardInfoService;
20 import com.bsth.service.schedule.TTInfoDetailService; 21 import com.bsth.service.schedule.TTInfoDetailService;
21 import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; 22 import com.bsth.service.schedule.datatools.TTInfoDetailForEdit;
22 import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; 23 import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData;
23 import com.bsth.service.schedule.exception.ScheduleException; 24 import com.bsth.service.schedule.exception.ScheduleException;
  25 +import com.bsth.service.schedule.timetable.ExcelData;
  26 +import com.bsth.service.schedule.timetable.ExcelFormatType;
24 import com.bsth.service.schedule.utils.DataToolsFile; 27 import com.bsth.service.schedule.utils.DataToolsFile;
25 import com.bsth.service.schedule.utils.DataToolsFileType; 28 import com.bsth.service.schedule.utils.DataToolsFileType;
26 import com.bsth.service.schedule.utils.DataToolsService; 29 import com.bsth.service.schedule.utils.DataToolsService;
@@ -77,6 +80,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im @@ -77,6 +80,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
77 private SysUserRepository sysUserRepository; 80 private SysUserRepository sysUserRepository;
78 @Autowired 81 @Autowired
79 private GuideboardInfoRepository guideboardInfoRepository; 82 private GuideboardInfoRepository guideboardInfoRepository;
  83 + @Autowired
  84 + private LineService lineService;
80 85
81 @Autowired 86 @Autowired
82 @Qualifier(value = "ttInfoDetail_dataTool") 87 @Qualifier(value = "ttInfoDetail_dataTool")
@@ -155,130 +160,13 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im @@ -155,130 +160,13 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
155 } 160 }
156 161
157 @Override 162 @Override
158 - public void validateExcelSheet(String filename, String sheetname, Integer lineid, String linename, Integer lineversion) throws ScheduleException {  
159 - try {  
160 - File file = new File(filename);  
161 - Workbook workbook;  
162 -  
163 - if (DataToolsFileType.XLS.isThisType(file)) {  
164 - workbook = DataToolsFileType.XLS.getWorkBook(file);  
165 - } else if (DataToolsFileType.XLSX.isThisType(file)) {  
166 - workbook = DataToolsFileType.XLSX.getWorkBook(file);  
167 - } else {  
168 - throw new Exception("不是xls xlsx文件!");  
169 - }  
170 -  
171 - Sheet sheet = workbook.getSheet(sheetname);  
172 - int rowNums = sheet.getLastRowNum() + 1; // 基于0 base的,长度加1  
173 - int colNums = sheet.getRow(0).getLastCellNum(); // 不需要加1,就是长度  
174 -  
175 - if (rowNums == 0 || colNums == 0) { // 工作区是否为空  
176 - throw new Exception(String.format("%s 工作区没有数据!", sheetname));  
177 - } else {  
178 - if (rowNums <= 1 || rowNums <= 1) {  
179 - throw new Exception(String.format("工作区至少包含2行2列的数据"));  
180 - } else {  
181 - Row firstRow = sheet.getRow(0); // 获取第一行数据列  
182 - for (int i = 0; i < colNums; i++) {  
183 - String cell_con = StringUtils.trimToEmpty(PoiUtils.getStringValueFromCell(firstRow.getCell(i))); // trimToEmpty  
184 -  
185 - if (StringUtils.isEmpty(cell_con)) {  
186 - throw new Exception(String.format("第1行,第%d列数据不能为空", i + 1));  
187 - } else {  
188 - // 正则表达式去除右侧数字  
189 -// cell_con = cell_con.replaceAll("[\\d+]", "");  
190 -// cell_con = cell_con.replaceAll("(\\d+)$", "");  
191 -  
192 - // 如果站名中有类似->{数字},使用正则表达式过滤掉  
193 - cell_con = cell_con.replaceAll("(->\\d+)", "");  
194 -  
195 - if (i == 0) { // 第一列必须是路牌2个字  
196 - if (!"路牌".equals(cell_con.trim())) {  
197 - throw new Exception("第1行,第1列数据必须是路牌2个字");  
198 - }  
199 - } else { // 排除出场,进场,其余内容到站点路由里查询,以各个方向的起点站为查询依据  
200 - if ((!"出场".equals(cell_con.trim())) &&  
201 - (!"进场".equals(cell_con.trim()))) {  
202 - Map<String, Object> p1 = new HashMap<>();  
203 - p1.put("line.id_eq", lineid);  
204 - p1.put("stationName_eq", cell_con.trim());  
205 - p1.put("stationMark_eq", "B"); // 起点站  
206 - p1.put("destroy_eq", 0); // 未撤销  
207 - p1.put("versions_eq", lineversion); // 带线路版本  
208 -  
209 - List<LsStationRoute> lsStationRoutes = (List<LsStationRoute>) stationRouteService.list_ls(p1);  
210 - if (CollectionUtils.isEmpty(lsStationRoutes)) {  
211 - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站", i + 1, cell_con.trim(), linename));  
212 - } else if (lsStationRoutes.size() > 1) {  
213 - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站", i + 1, cell_con.trim(), linename));  
214 - } else if (StringUtils.isEmpty(lsStationRoutes.get(0).getStationCode())) {  
215 - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中没有站点编码", i + 1, cell_con.trim(), linename));  
216 - }  
217 -  
218 - }  
219 -  
220 - }  
221 - }  
222 - }  
223 -  
224 - // 验证路牌内容  
225 - Map<String, Integer> gbindexmap = new HashMap<>(); // 记录每个路牌在第几行  
226 - for (int i = 1; i < rowNums; i++) { // 从第2行开始验证数据  
227 - Cell cell = sheet.getRow(i).getCell(0); // 获取第1列  
228 - String bcell_con = StringUtils.trimToEmpty(PoiUtils.getStringValueFromCell(cell)); // trimToEmpty  
229 - if (StringUtils.isEmpty(bcell_con)) {  
230 - throw new Exception(String.format("第%d行,第1列路牌无数据", i + 1));  
231 - } else if (gbindexmap.get(bcell_con.trim()) != null) {  
232 - throw new Exception(String.format("第%d行,第1列的路牌数据与第%d行,第1列数据重复",  
233 - i + 1,  
234 - gbindexmap.get(bcell_con.trim())));  
235 - } else {  
236 - Map<String, Object> p2 = new HashMap<>();  
237 - p2.put("xl.id_eq", lineid);  
238 - p2.put("lpName_eq", bcell_con.trim());  
239 - p2.put("isCancel_eq", false);  
240 - List<GuideboardInfo> guideboardInfoList = (List<GuideboardInfo>) guideboardInfoService.list(p2);  
241 - if (CollectionUtils.isEmpty(guideboardInfoList)) {  
242 - throw new Exception(String.format("第%d行,第1列的路牌在%s中不存在", i + 1, linename));  
243 - } else if (guideboardInfoList.size() > 1) {  
244 - throw new Exception(String.format("第%d行,第1列的路牌在%s中重复", i + 1, linename));  
245 - } else {  
246 - gbindexmap.put(bcell_con.trim(), i + 1);  
247 - }  
248 - }  
249 - }  
250 -  
251 - // 班次时间验证,正则表达式,格式hh:mm或者hhmm  
252 - String rex1 = "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"; // hh:mm格式  
253 - String rex2 = "^([01]?[0-9]|2[0-3]),[0-5][0-9]$"; // hh,mm格式  
254 - String rex3 = "^([01]?[0-9]|2[0-3])[0-5][0-9]$"; // hhmm格式  
255 - Pattern p1 = Pattern.compile(rex1);  
256 - Pattern p2 = Pattern.compile(rex2);  
257 - Pattern p3 = Pattern.compile(rex3);  
258 -  
259 - for (int i = 1; i < rowNums; i++) { // 从第2行开始验证数据  
260 - Row row = sheet.getRow(i);  
261 - for (int j = 1; j < colNums; j++) { // 从第2列开始  
262 - String bcell_con = StringUtils.trimToEmpty(PoiUtils.getStringValueFromCell(row.getCell(j))).replaceAll("\\s*", ""); // trimToEmpty  
263 - if (StringUtils.isNotEmpty(bcell_con)) {  
264 - Matcher m1 = p1.matcher(bcell_con.trim());  
265 - Matcher m2 = p2.matcher(bcell_con.trim());  
266 - Matcher m3 = p3.matcher(bcell_con.trim());  
267 - if ((!m1.matches()) && (!m2.matches()) && (!m3.matches())) {  
268 - throw new Exception(String.format("第%d行,第%d列的发车时间格式不正确,格式应为hh:mm或hh,mm或hhmm", i + 1, j + 1));  
269 - }  
270 - }  
271 - }  
272 - }  
273 - }  
274 -  
275 - }  
276 -  
277 - } catch (Exception exp) {  
278 - exp.printStackTrace();  
279 - throw new ScheduleException(exp.getMessage());  
280 - }  
281 - 163 + public void validateExcelSheet(String filename, String sheetname, Integer lineid, String linename, Integer lineversion, ExcelFormatType excelFormatType) throws ScheduleException {
  164 + ExcelData excelData = new ExcelData(
  165 + filename, sheetname, lineid,
  166 + lineService, guideboardInfoService,
  167 + lineversion, stationRouteService,
  168 + excelFormatType);
  169 + excelData.validateExcelSheet();
282 } 170 }
283 171
284 @Override 172 @Override
src/main/java/com/bsth/service/schedule/plan/DroolsSchedulePlan.java 0 → 100644
  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/rules/MyDroolsConfiguration.java
@@ -28,7 +28,7 @@ public class MyDroolsConfiguration { @@ -28,7 +28,7 @@ public class MyDroolsConfiguration {
28 * 返回一个kiebase知识库,直接冲文件系统读入drl规则文件, 28 * 返回一个kiebase知识库,直接冲文件系统读入drl规则文件,
29 * TODO:以后需要从数据库读入规则文件,并重新创建kbase知识库。 29 * TODO:以后需要从数据库读入规则文件,并重新创建kbase知识库。
30 */ 30 */
31 - @Bean(name = "kb1") 31 + @Bean(name = "coreKBase")
32 public KieBase myKieBase() { 32 public KieBase myKieBase() {
33 // Drools 6开始引入kie统一接口(jboss的jbpm工作流也使用kie接口了),整个定义方式和5差别很大 33 // Drools 6开始引入kie统一接口(jboss的jbpm工作流也使用kie接口了),整个定义方式和5差别很大
34 // 这里使用全api方式创建知识库对象,不使用xml的方式,提供最大的灵活性 34 // 这里使用全api方式创建知识库对象,不使用xml的方式,提供最大的灵活性
@@ -105,7 +105,7 @@ public class MyDroolsConfiguration { @@ -105,7 +105,7 @@ public class MyDroolsConfiguration {
105 * 返回一个kiebase知识库,直接冲文件系统读入drl规则文件, 105 * 返回一个kiebase知识库,直接冲文件系统读入drl规则文件,
106 * TODO:以后需要从数据库读入规则文件,并重新创建kbase知识库。 106 * TODO:以后需要从数据库读入规则文件,并重新创建kbase知识库。
107 */ 107 */
108 - @Bean(name = "kb2") 108 + @Bean(name = "preKBase")
109 public KieBase myKieBase2() { 109 public KieBase myKieBase2() {
110 // Drools 6开始引入kie统一接口(jboss的jbpm工作流也使用kie接口了),整个定义方式和5差别很大 110 // Drools 6开始引入kie统一接口(jboss的jbpm工作流也使用kie接口了),整个定义方式和5差别很大
111 // 这里使用全api方式创建知识库对象,不使用xml的方式,提供最大的灵活性 111 // 这里使用全api方式创建知识库对象,不使用xml的方式,提供最大的灵活性
src/main/java/com/bsth/service/schedule/timetable/ExcelData.java 0 → 100644
  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 0 → 100644
  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/service/schedule/utils/DataToolsFileType.java
@@ -76,7 +76,8 @@ public enum DataToolsFileType { @@ -76,7 +76,8 @@ public enum DataToolsFileType {
76 76
77 // application/x-tika-ooxml 77 // application/x-tika-ooxml
78 if ("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet".equals(type) || 78 if ("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet".equals(type) ||
79 - "application/x-tika-ooxml".equals(type)) { 79 + "application/x-tika-ooxml".equals(type) ||
  80 + "application/zip".equals(type)) {
80 // .xlsx 2007之后的格式 81 // .xlsx 2007之后的格式
81 return true; 82 return true;
82 } else { 83 } else {
src/main/java/com/bsth/service/schedule/utils/DataToolsProperties.java
@@ -81,6 +81,9 @@ public class DataToolsProperties { @@ -81,6 +81,9 @@ public class DataToolsProperties {
81 /** 时刻表明细信息导入2(带版本) */ 81 /** 时刻表明细信息导入2(带版本) */
82 @NotNull 82 @NotNull
83 private String ttinfodetailDatainputktr2version; 83 private String ttinfodetailDatainputktr2version;
  84 + /** 时刻表明细信息导入2(带版本),使用生成时刻表格式 */
  85 + @NotNull
  86 + private String ttinfodetailDatainputktr2version2;
84 /** 排班规则信息导入 */ 87 /** 排班规则信息导入 */
85 @NotNull 88 @NotNull
86 private String scheduleruleDatainputktr; 89 private String scheduleruleDatainputktr;
@@ -353,4 +356,12 @@ public class DataToolsProperties { @@ -353,4 +356,12 @@ public class DataToolsProperties {
353 public void setTransTemplatedir(String transTemplatedir) { 356 public void setTransTemplatedir(String transTemplatedir) {
354 this.transTemplatedir = transTemplatedir; 357 this.transTemplatedir = transTemplatedir;
355 } 358 }
  359 +
  360 + public String getTtinfodetailDatainputktr2version2() {
  361 + return ttinfodetailDatainputktr2version2;
  362 + }
  363 +
  364 + public void setTtinfodetailDatainputktr2version2(String ttinfodetailDatainputktr2version2) {
  365 + this.ttinfodetailDatainputktr2version2 = ttinfodetailDatainputktr2version2;
  366 + }
356 } 367 }
src/main/java/com/bsth/service/schedule/utils/PoiUtils.java
@@ -2,7 +2,6 @@ package com.bsth.service.schedule.utils; @@ -2,7 +2,6 @@ package com.bsth.service.schedule.utils;
2 2
3 import org.apache.poi.hssf.usermodel.HSSFDateUtil; 3 import org.apache.poi.hssf.usermodel.HSSFDateUtil;
4 import org.apache.poi.ss.usermodel.*; 4 import org.apache.poi.ss.usermodel.*;
5 -import org.apache.poi.ss.util.WorkbookUtil;  
6 import org.apache.poi.xssf.usermodel.*; 5 import org.apache.poi.xssf.usermodel.*;
7 6
8 import java.awt.Color; 7 import java.awt.Color;
@@ -58,7 +57,7 @@ public class PoiUtils { @@ -58,7 +57,7 @@ public class PoiUtils {
58 public static XSSFCell createStringXSSFCell( 57 public static XSSFCell createStringXSSFCell(
59 XSSFWorkbook xssfWorkbook, XSSFRow xssfRow, short column, String value, 58 XSSFWorkbook xssfWorkbook, XSSFRow xssfRow, short column, String value,
60 Color backgroundColor) { 59 Color backgroundColor) {
61 - return createXSSFCell( 60 + XSSFCell xssfCell = createXSSFCell(
62 xssfWorkbook, xssfRow, column, 61 xssfWorkbook, xssfRow, column,
63 value, XSSFCell.CELL_TYPE_STRING, 62 value, XSSFCell.CELL_TYPE_STRING,
64 HorizontalAlignment.CENTER, VerticalAlignment.CENTER, 63 HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
@@ -66,11 +65,14 @@ public class PoiUtils { @@ -66,11 +65,14 @@ public class PoiUtils {
66 (short) 13, new Color(0x2765A7), "宋体", 65 (short) 13, new Color(0x2765A7), "宋体",
67 backgroundColor, FillPatternType.SOLID_FOREGROUND 66 backgroundColor, FillPatternType.SOLID_FOREGROUND
68 ); 67 );
  68 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  69 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  70 + return xssfCell;
69 } 71 }
70 72
71 public static XSSFCell createStringXSSFCell( 73 public static XSSFCell createStringXSSFCell(
72 XSSFWorkbook xssfWorkbook, XSSFRow xssfRow, short column, String value) { 74 XSSFWorkbook xssfWorkbook, XSSFRow xssfRow, short column, String value) {
73 - return createXSSFCell( 75 + XSSFCell xssfCell = createXSSFCell(
74 xssfWorkbook, xssfRow, column, 76 xssfWorkbook, xssfRow, column,
75 value, XSSFCell.CELL_TYPE_STRING, 77 value, XSSFCell.CELL_TYPE_STRING,
76 HorizontalAlignment.CENTER, VerticalAlignment.CENTER, 78 HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
@@ -78,6 +80,9 @@ public class PoiUtils { @@ -78,6 +80,9 @@ public class PoiUtils {
78 (short) 13, new Color(0x2765A7), "宋体", 80 (short) 13, new Color(0x2765A7), "宋体",
79 new Color(0xffffff), FillPatternType.SOLID_FOREGROUND 81 new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
80 ); 82 );
  83 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  84 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  85 + return xssfCell;
81 } 86 }
82 87
83 public static XSSFCell createDoubleXSSFCell( 88 public static XSSFCell createDoubleXSSFCell(
@@ -120,6 +125,12 @@ public class PoiUtils { @@ -120,6 +125,12 @@ public class PoiUtils {
120 ); 125 );
121 } 126 }
122 127
  128 + public static XSSFCell setStringStyleXSSFCellStyle(XSSFWorkbook xssfWorkbook, XSSFCell xssfCell) {
  129 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  130 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  131 + return xssfCell;
  132 + }
  133 +
123 public static XSSFCell setIntegerStyleXSSFCellStyle(XSSFWorkbook xssfWorkbook, XSSFCell xssfCell) { 134 public static XSSFCell setIntegerStyleXSSFCellStyle(XSSFWorkbook xssfWorkbook, XSSFCell xssfCell) {
124 CreationHelper creationHelper = xssfWorkbook.getCreationHelper(); 135 CreationHelper creationHelper = xssfWorkbook.getCreationHelper();
125 XSSFCellStyle xssfCellStyle = xssfCell.getCellStyle(); 136 XSSFCellStyle xssfCellStyle = xssfCell.getCellStyle();
@@ -150,8 +161,9 @@ public class PoiUtils { @@ -150,8 +161,9 @@ public class PoiUtils {
150 161
151 // 设定值 162 // 设定值
152 if (valueType == XSSFCell.CELL_TYPE_STRING) { 163 if (valueType == XSSFCell.CELL_TYPE_STRING) {
153 - cell.setCellValue(creationHelper.createRichTextString(  
154 - WorkbookUtil.createSafeSheetName(String.valueOf(value)))); 164 +// cell.setCellValue(creationHelper.createRichTextString(
  165 +// WorkbookUtil.createSafeSheetName(String.valueOf(value))));
  166 + cell.setCellValue(creationHelper.createRichTextString(String.valueOf(value)));
155 } else if (valueType == XSSFCell.CELL_TYPE_NUMERIC) { 167 } else if (valueType == XSSFCell.CELL_TYPE_NUMERIC) {
156 if (value instanceof Date) { // 日期 168 if (value instanceof Date) { // 日期
157 cellStyle.setDataFormat(creationHelper.createDataFormat().getFormat("yyyy-mm-dd")); 169 cellStyle.setDataFormat(creationHelper.createDataFormat().getFormat("yyyy-mm-dd"));
src/main/java/com/bsth/service/traffic/impl/VehicleInoutStopServiceImpl.java
@@ -8,7 +8,6 @@ import com.bsth.util.DateUtils; @@ -8,7 +8,6 @@ import com.bsth.util.DateUtils;
8 import com.bsth.util.db.DBUtils_MS; 8 import com.bsth.util.db.DBUtils_MS;
9 import org.slf4j.Logger; 9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 import org.springframework.jdbc.core.JdbcTemplate; 11 import org.springframework.jdbc.core.JdbcTemplate;
13 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
14 13
src/main/java/com/bsth/util/db/DBUtils_traffic.java 0 → 100644
  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/config-dev.properties
@@ -10,7 +10,7 @@ datatools.kvars_dbuname=root @@ -10,7 +10,7 @@ datatools.kvars_dbuname=root
10 #数据库密码 10 #数据库密码
11 datatools.kvars_dbpwd= 11 datatools.kvars_dbpwd=
12 #数据库库名 12 #数据库库名
13 -datatools.kvars_dbdname=control 13 +datatools.kvars_dbdname=test_control
14 14
15 # 3、上传数据配置信息 15 # 3、上传数据配置信息
16 # 上传文件目录配置(根据不同的环境需要修正) 16 # 上传文件目录配置(根据不同的环境需要修正)
@@ -41,6 +41,8 @@ datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr @@ -41,6 +41,8 @@ datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr
41 datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr 41 datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr
42 # 时刻表明细信息导入2(版本化) 42 # 时刻表明细信息导入2(版本化)
43 datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr 43 datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr
  44 +# 时刻表明细信息导入2(版本化),使用生成时刻表格式
  45 +datatools.ttinfodetail_datainputktr2version2=/datatools/ktrs/ttinfodetailDataInput2_version_2.ktr
44 46
45 # 车辆配置信息导入 47 # 车辆配置信息导入
46 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr 48 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr
src/main/resources/datatools/config-prod.properties
@@ -42,6 +42,8 @@ datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr @@ -42,6 +42,8 @@ datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr
42 datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr 42 datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr
43 # 时刻表明细信息导入2(版本化) 43 # 时刻表明细信息导入2(版本化)
44 datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr 44 datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr
  45 +# 时刻表明细信息导入2(版本化),使用生成时刻表格式
  46 +datatools.ttinfodetail_datainputktr2version2=/datatools/ktrs/ttinfodetailDataInput2_version_2.ktr
45 47
46 # 车辆配置信息导入 48 # 车辆配置信息导入
47 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr 49 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr
src/main/resources/datatools/ktrs/ttinfodetailDataInput2_version_2.ktr 0 → 100644
  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/static/pages/base/timesmodel/add.html
@@ -120,7 +120,21 @@ @@ -120,7 +120,21 @@
120 </div> 120 </div>
121 </div> 121 </div>
122 <!-- 线路名称 (* 必填项) END --> 122 <!-- 线路名称 (* 必填项) END -->
123 - </div> 123 +
  124 + </div>
  125 +
  126 + <div class="form-group">
  127 + <!-- 线路版本 -->
  128 + <div class="col-md-6">
  129 + <label class="control-label col-md-5">
  130 + <span class="required"> * </span> 站点路由版本&nbsp;:
  131 + </label>
  132 + <div class="col-md-6">
  133 + <select name="lineVersion" class="form-control input-medium" id="lineVersionSelect"></select>
  134 + </div>
  135 + </div>
  136 + </div>
  137 +
124 <!-- 表单分组组件 form-group END --> 138 <!-- 表单分组组件 form-group END -->
125 </div> 139 </div>
126 <!-- 获取参数 --> 140 <!-- 获取参数 -->
@@ -132,10 +146,10 @@ @@ -132,10 +146,10 @@
132 <div class="col-md-9"> 146 <div class="col-md-9">
133 <div class="icheck-list"> 147 <div class="icheck-list">
134 <label > 148 <label >
135 - <input type="radio" class="icheck" name="baseRes" value=1 checked> 班型/人次/车辆 149 + <input type="radio" class="icheck" name="baseRes" value=1> 班型/人次/车辆
136 </label> 150 </label>
137 <label> 151 <label>
138 - <input type="radio" class="icheck" name="baseRes" value=2> 发车间隔分析 152 + <input type="radio" class="icheck" name="baseRes" value=2 checked> 发车间隔分析
139 </label> 153 </label>
140 <label> 154 <label>
141 <input type="radio" class="icheck" name="baseRes" value=0> 客流大数据分析 155 <input type="radio" class="icheck" name="baseRes" value=0> 客流大数据分析
src/main/resources/static/pages/base/timesmodel/js/add-form-reload.js
@@ -201,6 +201,25 @@ @@ -201,6 +201,25 @@
201 $get('/tic_ec/' + skbId ,null, function(d){ 201 $get('/tic_ec/' + skbId ,null, function(d){
202 if(d.status=='SUCCESS') { 202 if(d.status=='SUCCESS') {
203 $("#lineSelect").select2("val", d.data.xl.id + '_' + d.data.xl.lineCode + '_' + d.data.xl.name); 203 $("#lineSelect").select2("val", d.data.xl.id + '_' + d.data.xl.lineCode + '_' + d.data.xl.name);
  204 +
  205 + // 获取线路版本信息
  206 + $get('/tic_ec/stationroute/' + d.data.xl.id, null, function(rs){
  207 + // 构造select2内容
  208 + var iSelVersion = 0;
  209 + var aOption = [];
  210 + aOption.push('<option value="">请选择...</option><optgroup label="线路版本">');
  211 + $.each(rs.data, function(i, g) {
  212 + aOption.push('<option value="'+ g.version + '">' + g.desc + '</option>');
  213 + if (i == 0) {
  214 + iSelVersion = g.version;
  215 + }
  216 + });
  217 + aOption.push('</optgroup>');
  218 + $('#lineVersionSelect').html(aOption.join("")).select2();
  219 + if (iSelVersion > 0) {
  220 + $("#lineVersionSelect").select2("val", iSelVersion);
  221 + }
  222 + });
204 } 223 }
205 }); 224 });
206 } 225 }
src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js
@@ -395,10 +395,26 @@ var SKBFormWizard = function() { @@ -395,10 +395,26 @@ var SKBFormWizard = function() {
395 // 返回参数详情模版. 395 // 返回参数详情模版.
396 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})}); 396 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
397 }else if (n==2) { 397 }else if (n==2) {
398 - return cb && cb({ 398 + // 更具站点路由版本获取起点终点站
  399 + var iversion = $('#lineVersionSelect').val();
  400 + $get('/stationroute/all',{'line.id_eq':lineId,'destroy_eq':0, 'versions_eq': iversion},function(result) {
  401 + $.each(result, function(i, d) {
  402 + if (d.stationMark == 'B' && d.directions == 0) {
  403 + // alert(d.stationName);
  404 + map.line.startStationName = d.stationName;
  405 + } else if (d.stationMark == 'E' && d.directions == 0) {
  406 + // alert(d.stationName);
  407 + map.line.endStationName = d.stationName;
  408 + }
  409 + });
  410 +
  411 +
  412 + return cb && cb({
399 'forminput': template(tempName, {map: map}), 413 'forminput': template(tempName, {map: map}),
400 'datadisplay': template(tempName + '_config', {map: null}) 414 'datadisplay': template(tempName + '_config', {map: null})
401 }); 415 });
  416 + });
  417 +
402 } 418 }
403 }); 419 });
404 } 420 }
@@ -476,6 +492,7 @@ var SKBFormWizard = function() { @@ -476,6 +492,7 @@ var SKBFormWizard = function() {
476 rules : { 492 rules : {
477 'skbName' : {required : true,},// 时刻表名称,必填项. 493 'skbName' : {required : true,},// 时刻表名称,必填项.
478 'lineName' : {required : true,},// 线路名称,必填项. 494 'lineName' : {required : true,},// 线路名称,必填项.
  495 + 'lineVersion': {required: true}, // 站点路由版本,必填项,
479 // 'krl' : {isBaseRes : true,number : true,digits : true,},// 客容量,当选择为客流方式时必填项、整数 496 // 'krl' : {isBaseRes : true,number : true,digits : true,},// 客容量,当选择为客流方式时必填项、整数
480 'startStationFirstTime' : {required : true}, // 起始站首班时间,必填项. 497 'startStationFirstTime' : {required : true}, // 起始站首班时间,必填项.
481 'startStationEndTime' : {required : true}, // 起始站末班时间 ,必填项. 498 'startStationEndTime' : {required : true}, // 起始站末班时间 ,必填项.
@@ -598,20 +615,20 @@ var SKBFormWizard = function() { @@ -598,20 +615,20 @@ var SKBFormWizard = function() {
598 var argus = form.serializeJSON(); 615 var argus = form.serializeJSON();
599 console.log(argus); 616 console.log(argus);
600 // 获取站点路由. 617 // 获取站点路由.
601 - $get('/stationroute/all',{'line.id_eq':argus.lineName.split('_')[0],'destroy_eq':0},function(result) { 618 + $get('/stationroute/all',{'line.id_eq':argus.lineName.split('_')[0],'destroy_eq':0, 'versions_eq': argus.lineVersion},function(result) {
602 // 判断. 619 // 判断.
603 if(result) { 620 if(result) {
604 // 定义上行起点站,上行终点站,下行起点站,下行终点站. 621 // 定义上行起点站,上行终点站,下行起点站,下行终点站.
605 var upB ='',upE='',downB='',downE=''; 622 var upB ='',upE='',downB='',downE='';
606 for(var r = 0 ; r<result.length;r++) { 623 for(var r = 0 ; r<result.length;r++) {
607 if(result[r].directions==0 && result[r].stationMark =='B') 624 if(result[r].directions==0 && result[r].stationMark =='B')
608 - upB = result[r].station.id; 625 + upB = result[r].id;
609 if(result[r].directions==0 && result[r].stationMark =='E') 626 if(result[r].directions==0 && result[r].stationMark =='E')
610 - upE = result[r].station.id; 627 + upE = result[r].id;
611 if(result[r].directions==1 && result[r].stationMark =='B') 628 if(result[r].directions==1 && result[r].stationMark =='B')
612 - downB = result[r].station.id; 629 + downB = result[r].id;
613 if(result[r].directions==1 && result[r].stationMark =='E') 630 if(result[r].directions==1 && result[r].stationMark =='E')
614 - downE = result[r].station.id; 631 + downE = result[r].id;
615 } 632 }
616 argus.up_s = upB + '_' + upE; 633 argus.up_s = upB + '_' + upE;
617 argus.down_s = downB + '_' + downE; 634 argus.down_s = downB + '_' + downE;
@@ -628,7 +645,7 @@ var SKBFormWizard = function() { @@ -628,7 +645,7 @@ var SKBFormWizard = function() {
628 $get('/tidc/all',{'ttinfo.id_eq':parseInt(argus.skbName)},function(data) { 645 $get('/tidc/all',{'ttinfo.id_eq':parseInt(argus.skbName)},function(data) {
629 if(data.status=='SUCCESS' && data.data.length>0) { 646 if(data.status=='SUCCESS' && data.data.length>0) {
630 argus.istidc = 1; 647 argus.istidc = 1;
631 - layer.confirm('系统已存在该时刻表【'+ 648 + layer.confirm('系统已存在该时刻表【'+
632 $("#skbNameSelect").select2("data")[0].text + 649 $("#skbNameSelect").select2("data")[0].text +
633 '】明细,是否使用已有数据渲染模型?', { 650 '】明细,是否使用已有数据渲染模型?', {
634 btn: ['确定并使用','取消并继续'] //按钮 651 btn: ['确定并使用','取消并继续'] //按钮
@@ -648,7 +665,7 @@ var SKBFormWizard = function() { @@ -648,7 +665,7 @@ var SKBFormWizard = function() {
648 layer.msg('系统不存在该线路的上、下行起终点站!'); 665 layer.msg('系统不存在该线路的上、下行起终点站!');
649 } 666 }
650 }); 667 });
651 - 668 +
652 // 表单提交. 669 // 表单提交.
653 function submit(p,argus) { 670 function submit(p,argus) {
654 var baseRes2 = $('#submit_argus_form input[name="baseRes"]:checked').val();// 获取参数方式值. 671 var baseRes2 = $('#submit_argus_form input[name="baseRes"]:checked').val();// 获取参数方式值.
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalScheduleObj.js
@@ -354,13 +354,18 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -354,13 +354,18 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
354 alert("总配车数小于低谷最小配车"); 354 alert("总配车数小于低谷最小配车");
355 throw "总配车数小于低谷最小配车"; 355 throw "总配车数小于低谷最小配车";
356 } 356 }
  357 +
357 if (iDgminpc < 2) { 358 if (iDgminpc < 2) {
358 - alert("连班路牌小于2,办不到啊");  
359 - throw "连班路牌小于2,办不到啊"; 359 + // alert("连班路牌小于2,办不到啊");
  360 + // throw "连班路牌小于2,办不到啊";
  361 + console.log("连班路牌小于2,则5休2之外的车辆数则为连班车辆数");
  362 + iDgminpc = iCls - i_5_2_lpes;
360 } 363 }
361 if (iCls - iDgminpc < i_5_2_lpes) { 364 if (iCls - iDgminpc < i_5_2_lpes) {
362 - alert("总分班路牌数小于加班路牌数");  
363 - throw "总分班路牌数小于加班路牌数"; 365 + // alert("总分班路牌数小于加班路牌数");
  366 + // throw "总分班路牌数小于加班路牌数";
  367 + console.log("总分班路牌数小于加班路牌数,则忽略其他分班路牌数");
  368 + iDgminpc = iCls - i_5_2_lpes;
364 } 369 }
365 370
366 //// 修正连班路牌数,班次间隔大于20的,加1,直至班次间隔小于20 371 //// 修正连班路牌数,班次间隔大于20的,加1,直至班次间隔小于20
@@ -929,11 +934,14 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -929,11 +934,14 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
929 // 处理中间 934 // 处理中间
930 iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1; 935 iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1;
931 for (i = 1; i <= iQInternelCount; i++) { 936 for (i = 1; i <= iQInternelCount; i++) {
932 - oLp = _internalLpArray[iQIndex + i];  
933 937
934 - if (!oLp.getBc(iQIndex + i, iBcIndex)) {  
935 - _fnGenerateBcAndSetBc(i, iQIndex + i, iBcIndex); 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 + }
936 } 943 }
  944 +
937 } 945 }
938 946
939 // 处理尾部 947 // 处理尾部
@@ -1821,6 +1829,10 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1821,6 +1829,10 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1821 } 1829 }
1822 }); 1830 });
1823 1831
  1832 + if (aBc.length == 0) {
  1833 + return;
  1834 + }
  1835 +
1824 var j; 1836 var j;
1825 var iCount = aBc.length - 1; 1837 var iCount = aBc.length - 1;
1826 var iC1 = Math.floor(aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") / iCount); 1838 var iC1 = Math.floor(aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") / iCount);
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
@@ -202,6 +202,7 @@ var Main_v2 = function() { @@ -202,6 +202,7 @@ var Main_v2 = function() {
202 "zdzid": oTempBc._$_zdzid, // 终点站id 202 "zdzid": oTempBc._$_zdzid, // 终点站id
203 203
204 "isUp": oTempBc._$_isUp, // 是否上行 204 "isUp": oTempBc._$_isUp, // 是否上行
  205 + "isFb": false, // 是否分班
205 206
206 "bcType": oTempBc._$_bcType, // 班次类型 207 "bcType": oTempBc._$_bcType, // 班次类型
207 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 208 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -230,6 +231,7 @@ var Main_v2 = function() { @@ -230,6 +231,7 @@ var Main_v2 = function() {
230 "zdzid": oTempBc._$_zdzid, // 终点站id 231 "zdzid": oTempBc._$_zdzid, // 终点站id
231 232
232 "isUp": oTempBc._$_isUp, // 是否上行 233 "isUp": oTempBc._$_isUp, // 是否上行
  234 + "isFb": false, // 是否分班
233 235
234 "bcType": oTempBc._$_bcType, // 班次类型 236 "bcType": oTempBc._$_bcType, // 班次类型
235 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 237 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -263,12 +265,15 @@ var Main_v2 = function() { @@ -263,12 +265,15 @@ var Main_v2 = function() {
263 "zdzid": oTempBc._$_zdzid, // 终点站id 265 "zdzid": oTempBc._$_zdzid, // 终点站id
264 266
265 "isUp": oTempBc._$_isUp, // 是否上行 267 "isUp": oTempBc._$_isUp, // 是否上行
  268 + "isFb": false, // 是否分班
266 269
267 "bcType": oTempBc._$_bcType, // 班次类型 270 "bcType": oTempBc._$_bcType, // 班次类型
268 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 271 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
269 272
270 - "groupNo": -2, // 第几圈  
271 - "groupBcNo": -3 // 圈里第几个班次 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 // 圈里第几个班次
272 277
273 }); 278 });
274 279
@@ -288,6 +293,7 @@ var Main_v2 = function() { @@ -288,6 +293,7 @@ var Main_v2 = function() {
288 "zdzid": oTempBc._$_zdzid, // 终点站id 293 "zdzid": oTempBc._$_zdzid, // 终点站id
289 294
290 "isUp": oTempBc._$_isUp, // 是否上行 295 "isUp": oTempBc._$_isUp, // 是否上行
  296 + "isFb": false, // 是否分班
291 297
292 "bcType": oTempBc._$_bcType, // 班次类型 298 "bcType": oTempBc._$_bcType, // 班次类型
293 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 299 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -320,6 +326,7 @@ var Main_v2 = function() { @@ -320,6 +326,7 @@ var Main_v2 = function() {
320 "zdzid": oTempBc._$_zdzid, // 终点站id 326 "zdzid": oTempBc._$_zdzid, // 终点站id
321 327
322 "isUp": oTempBc._$_isUp, // 是否上行 328 "isUp": oTempBc._$_isUp, // 是否上行
  329 + "isFb": false, // 是否分班
323 330
324 "bcType": oTempBc._$_bcType, // 班次类型 331 "bcType": oTempBc._$_bcType, // 班次类型
325 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 332 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -348,6 +355,7 @@ var Main_v2 = function() { @@ -348,6 +355,7 @@ var Main_v2 = function() {
348 "zdzid": oTempBc._$_zdzid, // 终点站id 355 "zdzid": oTempBc._$_zdzid, // 终点站id
349 356
350 "isUp": oTempBc._$_isUp, // 是否上行 357 "isUp": oTempBc._$_isUp, // 是否上行
  358 + "isFb": false, // 是否分班
351 359
352 "bcType": oTempBc._$_bcType, // 班次类型 360 "bcType": oTempBc._$_bcType, // 班次类型
353 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 361 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -380,6 +388,7 @@ var Main_v2 = function() { @@ -380,6 +388,7 @@ var Main_v2 = function() {
380 "zdzid": oTempBc._$_zdzid, // 终点站id 388 "zdzid": oTempBc._$_zdzid, // 终点站id
381 389
382 "isUp": oTempBc._$_isUp, // 是否上行 390 "isUp": oTempBc._$_isUp, // 是否上行
  391 + "isFb": true, // 是否分班
383 392
384 "bcType": oTempBc._$_bcType, // 班次类型 393 "bcType": oTempBc._$_bcType, // 班次类型
385 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 394 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -414,6 +423,7 @@ var Main_v2 = function() { @@ -414,6 +423,7 @@ var Main_v2 = function() {
414 "zdzid": oTempBc._$_zdzid, // 终点站id 423 "zdzid": oTempBc._$_zdzid, // 终点站id
415 424
416 "isUp": oTempBc._$_isUp, // 是否上行 425 "isUp": oTempBc._$_isUp, // 是否上行
  426 + "isFb": true, // 是否分班
417 427
418 "bcType": oTempBc._$_bcType, // 班次类型 428 "bcType": oTempBc._$_bcType, // 班次类型
419 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 429 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -438,6 +448,7 @@ var Main_v2 = function() { @@ -438,6 +448,7 @@ var Main_v2 = function() {
438 "zdzid": oTempBc._$_zdzid, // 终点站id 448 "zdzid": oTempBc._$_zdzid, // 终点站id
439 449
440 "isUp": oTempBc._$_isUp, // 是否上行 450 "isUp": oTempBc._$_isUp, // 是否上行
  451 + "isFb": true, // 是否分班
441 452
442 "bcType": oTempBc._$_bcType, // 班次类型 453 "bcType": oTempBc._$_bcType, // 班次类型
443 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 454 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
@@ -476,12 +487,15 @@ var Main_v2 = function() { @@ -476,12 +487,15 @@ var Main_v2 = function() {
476 "zdzid": oTempBc._$_zdzid, // 终点站id 487 "zdzid": oTempBc._$_zdzid, // 终点站id
477 488
478 "isUp": oTempBc._$_isUp, // 是否上行 489 "isUp": oTempBc._$_isUp, // 是否上行
  490 + "isFb": false, // 是否分班
479 491
480 "bcType": oTempBc._$_bcType, // 班次类型 492 "bcType": oTempBc._$_bcType, // 班次类型
481 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 493 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
482 494
483 - "groupNo": -2, // 第几圈  
484 - "groupBcNo": -3 // 圈里第几个班次 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 // 圈里第几个班次
485 499
486 }); 500 });
487 501
@@ -501,6 +515,7 @@ var Main_v2 = function() { @@ -501,6 +515,7 @@ var Main_v2 = function() {
501 "zdzid": oTempBc._$_zdzid, // 终点站id 515 "zdzid": oTempBc._$_zdzid, // 终点站id
502 516
503 "isUp": oTempBc._$_isUp, // 是否上行 517 "isUp": oTempBc._$_isUp, // 是否上行
  518 + "isFb": false, // 是否分班
504 519
505 "bcType": oTempBc._$_bcType, // 班次类型 520 "bcType": oTempBc._$_bcType, // 班次类型
506 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述 521 "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
@@ -218,6 +218,7 @@ @@ -218,6 +218,7 @@
218 jsDoQuery(true); 218 jsDoQuery(true);
219 }); 219 });
220 220
  221 + var list;
221 var line = $("#line").val(); 222 var line = $("#line").val();
222 var startDate = $("#startDate").val(); 223 var startDate = $("#startDate").val();
223 var endDate = $("#endDate").val(); 224 var endDate = $("#endDate").val();
@@ -254,10 +255,8 @@ @@ -254,10 +255,8 @@
254 $(".hidden").removeClass("hidden"); 255 $(".hidden").removeClass("hidden");
255 var i = layer.load(2); 256 var i = layer.load(2);
256 $get('/pcpc/scheduleAnaly', params, function(result){ 257 $get('/pcpc/scheduleAnaly', params, function(result){
257 - // 把数据填充到模版中  
258 - var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList});  
259 - // 把渲染好的模版html文本追加到表格中  
260 - $('#forms tbody').html(tbodyHtml); 258 + list = result.dataList;
  259 + dataPageChange(page, result.dataList);
261 layer.close(i); 260 layer.close(i);
262 261
263 if(result.dataList.length == 0) 262 if(result.dataList.length == 0)
@@ -277,6 +276,17 @@ @@ -277,6 +276,17 @@
277 }); 276 });
278 } 277 }
279 278
  279 + function dataPageChange(page, list){
  280 + var tempList = [];
  281 + for(var f = page*10; f < list.length && f < (page+1)*10; f++){
  282 + tempList[tempList.length] = list[f];
  283 + }
  284 + // 把数据填充到模版中
  285 + var tbodyHtml = template('list_scheduleAnaly',{list:tempList});
  286 + // 把渲染好的模版html文本追加到表格中
  287 + $('#forms tbody').html(tbodyHtml);
  288 + }
  289 +
280 $("#export").on("click",function(){ 290 $("#export").on("click",function(){
281 var params = {}; 291 var params = {};
282 params['page'] = page; 292 params['page'] = page;
@@ -387,7 +397,8 @@ @@ -387,7 +397,8 @@
387 return; 397 return;
388 } 398 }
389 page = num - 1; 399 page = num - 1;
390 - jsDoQuery(false); 400 +// jsDoQuery(false);
  401 + dataPageChange(page, list);
391 } 402 }
392 }); 403 });
393 } 404 }
src/main/resources/static/pages/forms/statement/statisticsDailyCalc.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +
  18 + #forms > thead > tr> td >span{
  19 + width: 5px;
  20 + word-wrap: break-word;
  21 + letter-spacing: 20px;
  22 + }
  23 +
  24 + #forms > thead > tr> td >label{
  25 + word-break: keep-all;white-space:nowrap;
  26 + }
  27 +</style>
  28 +
  29 +<div class="page-head">
  30 + <div class="page-title">
  31 + <h1>统计日报</h1>
  32 + </div>
  33 +</div>
  34 +
  35 +<!-- <div class="row"> -->
  36 + <div class="col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)">
  37 +<!-- <div> -->
  38 + <div class="portlet-title">
  39 + <form class="form-inline" action="">
  40 + <div style="display: inline-block; " id="gsdmDiv">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  47 + </div>
  48 + <div style="margin-top: 2px"></div>
  49 + <div style="display: inline-block;">
  50 + <span class="item-label" style="width: 80px;">线路: </span>
  51 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  52 + </div>
  53 + <div style="display: inline-block;margin-left: 15px;">
  54 + <span class="item-label" style="width: 80px;">开始时间: </span>
  55 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  56 + </div>
  57 + <div style="display: inline-block;margin-left: 15px;">
  58 + <span class="item-label" style="width: 80px;">结束时间: </span>
  59 + <input class="form-control" type="text" id="date2" style="width: 180px;"/>
  60 + </div>
  61 + <div class="form-group">
  62 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  63 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  64 + </div>
  65 + </form>
  66 + </div>
  67 + <div class="portlet-body" id="tjrbBody" style="overflow:auto;height: calc(100% - 80px)">
  68 + <div class="table-container" style="margin-top: 10px;min-width: 906px">
  69 + <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
  70 + <table class="table table-bordered table-hover table-checkable" id="forms">
  71 + <thead>
  72 + <tr>
  73 + <th colspan="44"><label id="tjrq"></label> 线路统计日报</th>
  74 + </tr>
  75 + <tr>
  76 + <td rowspan="3"><span >路线名</span></td>
  77 + <td colspan="20">全日营运里程(公里)</td>
  78 + <td colspan="15">全日营运班次</td>
  79 + <td colspan="9">大间隔情况</td>
  80 + </tr>
  81 + <tr>
  82 + <td rowspan="2"><label>计划总</label>
  83 + <label>公里&nbsp;&nbsp;&nbsp;</label></td>
  84 + <td rowspan="2"><label>计划营</label><label>运公里</label></td>
  85 + <td rowspan="2"><label>计划空</label><label>驶公里</label></td>
  86 + <td rowspan="2"><label>实际</label><label>总公里</label></td>
  87 + <td rowspan="2"><label>实际营</label><label>运公里</label></td>
  88 + <td rowspan="2"><label>实际空</label><label>驶公里</label></td>
  89 + <td rowspan="2"><span>少驶公里</span></td>
  90 + <td rowspan="2"><span>少驶班次</span></td>
  91 + <td colspan="11">少驶原因(公里)</td>
  92 + <td rowspan="2"><span >临加公里</span></td>
  93 + <td colspan="3">计划班次</td>
  94 + <td colspan="3">实际班次</td>
  95 + <td colspan="3">临加班次</td>
  96 + <td colspan="3">放站班次</td>
  97 + <td colspan="3">调头班次</td>
  98 + <td colspan="3">发生次数</td>
  99 + <td rowspan="2">最大间隔时间(分)</td>
  100 + <td rowspan="2">原因</td>
  101 + </tr>
  102 + <tr>
  103 + <td><span >路阻</span></td>
  104 + <td><span>吊慢</span></td>
  105 + <td><span >故障</span></td>
  106 + <td><span >纠纷</span></td>
  107 + <td><span >肇事</span></td>
  108 + <td><span>缺人</span></td>
  109 + <td><span>缺车</span></td>
  110 + <td><span >客稀</span></td>
  111 + <td><span>气候</span></td>
  112 + <td><span>援外</span></td>
  113 + <td><span>其他</span></td>
  114 + <td><span>全日</span></td>
  115 + <td><span>早高峰</span></td>
  116 + <td><span>晚高峰</span></td>
  117 + <td><span>全日</span></td>
  118 + <td><span>早高峰</span></td>
  119 + <td><span>晚高峰</span></td>
  120 + <td><span>全日</span></td>
  121 + <td><span>早高峰</span></td>
  122 + <td><span>晚高峰</span></td>
  123 + <td><span>全日</span></td>
  124 + <td><span>早高峰</span></td>
  125 + <td><span>晚高峰</span></td>
  126 + <td><span>全日</span></td>
  127 + <td><span>早高峰</span></td>
  128 + <td><span>晚高峰</span></td>
  129 + <td><span>全日</span></td>
  130 + <td><span>早高峰</span></td>
  131 + <td><span>晚高峰</span></td>
  132 + </tr>
  133 + </thead>
  134 + <tbody class="statisticsDailyCalc">
  135 +
  136 + </tbody>
  137 + </table>
  138 + </div>
  139 + </div>
  140 + </div>
  141 + </div>
  142 +</div>
  143 +
  144 +<script>
  145 + $(function(){
  146 + $('#export').attr('disabled', "true");
  147 +
  148 + // 关闭左侧栏
  149 + if (!$('body').hasClass('page-sidebar-closed'))
  150 + $('.menu-toggler.sidebar-toggler').click();
  151 +
  152 + var d = new Date();
  153 + d.setTime(d.getTime() - 1*1000*60*60*24);
  154 + var year = d.getFullYear();
  155 + var month = d.getMonth() + 1;
  156 + var day = d.getDate();
  157 + if(month < 10)
  158 + month = "0" + month;
  159 + if(day < 10)
  160 + day = "0" + day;
  161 + var dateTime = year + "-" + month + "-" + day;
  162 + $("#date").datetimepicker({
  163 + format : 'YYYY-MM-DD',
  164 + locale : 'zh-cn',
  165 + maxDate : dateTime
  166 + });
  167 + $("#date2").datetimepicker({
  168 + format : 'YYYY-MM-DD',
  169 + locale : 'zh-cn',
  170 + maxDate : dateTime
  171 + });
  172 + $("#date").val(dateTime);
  173 + $("#date2").val(dateTime);
  174 +
  175 +
  176 + var fage=false;
  177 + var obj = [];
  178 + var xlList;
  179 + $.get('/report/lineList',function(result){
  180 + xlList=result;
  181 + $.get('/user/companyData', function(result){
  182 + obj = result;
  183 + var options = '';
  184 + for(var i = 0; i < obj.length; i++){
  185 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  186 + }
  187 +
  188 + if(obj.length ==0){
  189 + $("#gsdmDiv").css('display','none');
  190 + }else if(obj.length ==1){
  191 + $("#gsdmDiv").css('display','none');
  192 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  193 + $('#fgsdmDiv').css('display','none');
  194 + }
  195 + $('#gsdm').html(options);
  196 + updateCompany();
  197 + });
  198 + })
  199 + $("#gsdm").on("change",updateCompany);
  200 + function updateCompany(){
  201 + var company = $('#gsdm').val();
  202 + var options = '';
  203 + for(var i = 0; i < obj.length; i++){
  204 + if(obj[i].companyCode == company){
  205 + var children = obj[i].children;
  206 + for(var j = 0; j < children.length; j++){
  207 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  208 + }
  209 + }
  210 + }
  211 + $('#fgsdm').html(options);
  212 +// initXl();
  213 + }
  214 +
  215 + var tempData = {};
  216 + $.get('/report/lineList',function(xlList){
  217 + var data = [];
  218 + data.push({id: " ", text: "全部线路"});
  219 + $.get('/user/companyData', function(result){
  220 + for(var i = 0; i < result.length; i++){
  221 + var companyCode = result[i].companyCode;
  222 + var children = result[i].children;
  223 + for(var j = 0; j < children.length; j++){
  224 + var code = children[j].code;
  225 + for(var k=0;k < xlList.length;k++ ){
  226 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  227 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  228 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  229 + }
  230 + }
  231 + }
  232 + }
  233 + initPinYinSelect2('#line',data,'');
  234 +
  235 + });
  236 + });
  237 +
  238 + $("#line").on("change", function(){
  239 + if($("#line").val() == " "){
  240 + $("#gsdm").attr("disabled", false);
  241 + $("#fgsdm").attr("disabled", false);
  242 + } else {
  243 + var temp = tempData[$("#line").val()].split(":");
  244 + $("#gsdm").val(temp[0]);
  245 + updateCompany();
  246 + $("#fgsdm").val(temp[1]);
  247 + $("#gsdm").attr("disabled", true);
  248 + $("#fgsdm").attr("disabled", true);
  249 + }
  250 + });
  251 +
  252 +
  253 + var line ="";
  254 + var xlName ="";
  255 + var date = "";
  256 + var date2 ="";
  257 + var gsdm="";
  258 + var fgsdm="";
  259 + $("#query").on("click",function(){
  260 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  261 + layer.msg("请选择时间范围!");
  262 + return;
  263 + }
  264 + if($("#date2").val() == null || $("#date2").val().trim().length == 0){
  265 + layer.msg("请选择时间范围!");
  266 + return;
  267 + }
  268 +// $("#tjrbBody").height($(window).height()-100);
  269 + line = $("#line").val();
  270 + xlName = $("#select2-line-container").html();
  271 + date = $("#date").val();
  272 + date2 =$("#date2").val();
  273 + gsdm =$("#gsdm").val();
  274 + fgsdm=$("#fgsdm").val();
  275 + if(line=="请选择"){
  276 + line="";
  277 + }
  278 + if(date==null || date =="" ||date2==null || date2 ==""){
  279 + layer.msg('请选择时间段.');
  280 + }else{
  281 + $("#tjrq").html(date+"至"+date2);
  282 + var params = {};
  283 + params['gsdm'] = gsdm;
  284 + params['fgsdm'] =fgsdm ;
  285 + params['line'] = line;
  286 + params['date'] = date;
  287 + params['date2'] = date2;
  288 + params['xlName'] = xlName;
  289 + params['type'] = "query";
  290 + var i = layer.load(2);
  291 +// $get('/realSchedule/statisticsDailyTj',params,function(result){
  292 + $get('/calcWaybill/statisticsDailyTj',params,function(result){
  293 + // 把数据填充到模版中
  294 + var tbodyHtml = template('statisticsDailyCalc',{list:result});
  295 + // 把渲染好的模版html文本追加到表格中
  296 + $('#forms .statisticsDailyCalc').html(tbodyHtml);
  297 + layer.close(i);
  298 +
  299 + if(result.length == 0)
  300 + $("#export").attr('disabled',"true");
  301 + else
  302 + $("#export").removeAttr("disabled");
  303 + });
  304 + }
  305 +
  306 + });
  307 +// $("#tjrbBody").height($(window).height()-100);
  308 + $("#export").on("click",function(){
  309 + var params = {};
  310 + params['gsdm'] = gsdm;
  311 + params['fgsdm'] =fgsdm ;
  312 + params['line'] = line;
  313 + params['date'] = date;
  314 + params['date2'] = date2;
  315 + params['xlName'] = xlName;
  316 + params['type'] = "export";
  317 + $get('/realSchedule/statisticsDailyTj',params,function(result){
  318 + window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD"));
  319 + });
  320 + });
  321 +
  322 + });
  323 +</script>
  324 +<script type="text/html" id="statisticsDailyCalc">
  325 + {{each list as obj i}}
  326 + <tr {{if obj.zt==1}}style='color: red'{{/if}}>
  327 + <td>{{obj.xlName}}</td>
  328 + <td>{{obj.jhzlc}}</td>
  329 + <td>{{obj.jhlc}}</td>
  330 + <td>{{obj.jcclc}}</td>
  331 + <td>{{obj.sjzgl}}</td>
  332 + <td>{{obj.sjgl}}</td>
  333 + <td>{{obj.sjksgl}}</td>
  334 + <td>{{obj.ssgl}}</td>
  335 + <td>{{obj.ssbc}}</td>
  336 + <td>{{obj.ssgl_lz}}</td>
  337 + <td>{{obj.ssgl_dm}}</td>
  338 + <td>{{obj.ssgl_gz}}</td>
  339 + <td>{{obj.ssgl_jf}}</td>
  340 + <td>{{obj.ssgl_zs}}</td>
  341 + <td>{{obj.ssgl_qr}}</td>
  342 + <td>{{obj.ssgl_qc}}</td>
  343 + <td>{{obj.ssgl_kx}}</td>
  344 + <td>{{obj.ssgl_qh}}</td>
  345 + <td>{{obj.ssgl_yw}}</td>
  346 + <td>{{obj.ssgl_other}}</td>
  347 + <td>{{obj.ljgl}}</td>
  348 + <td>{{obj.jhbc}}</td>
  349 + <td>{{obj.jhbc_m}}</td>
  350 + <td>{{obj.jhbc_a}}</td>
  351 + <td>{{obj.sjbc}}</td>
  352 + <td>{{obj.sjbc_m}}</td>
  353 + <td>{{obj.sjbc_a}}</td>
  354 + <td>{{obj.ljbc}}</td>
  355 + <td>{{obj.ljbc_m}}</td>
  356 + <td>{{obj.ljbc_a}}</td>
  357 + <td>{{obj.fzbc}}</td>
  358 + <td>{{obj.fzbc_m}}</td>
  359 + <td>{{obj.fzbc_a}}</td>
  360 + <td>{{obj.dtbc}}</td>
  361 + <td>{{obj.dtbc_m}}</td>
  362 + <td>{{obj.dtbc_a}}</td>
  363 + <td>{{obj.djg}}</td>
  364 + <td>{{obj.djg_m}}</td>
  365 + <td>{{obj.djg_a}}</td>
  366 + <td>{{obj.djg_time}}</td>
  367 + <td>&nbsp;</td>
  368 + </tr>
  369 + {{/each}}
  370 + {{if list.length == 0}}
  371 + <tr>
  372 + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td>
  373 + </tr>
  374 + {{/if}}
  375 +</script>
0 \ No newline at end of file 376 \ No newline at end of file
src/main/resources/static/pages/forms/statement/statisticsDailyCalc2.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +
  18 + #forms > thead > tr> td >span{
  19 + width: 5px;
  20 + word-wrap: break-word;
  21 + letter-spacing: 20px;
  22 + }
  23 +
  24 + #forms > thead > tr> td >label{
  25 + word-break: keep-all;white-space:nowrap;
  26 + }
  27 +</style>
  28 +
  29 +<div class="page-head">
  30 + <div class="page-title">
  31 + <h1>统计日报</h1>
  32 + </div>
  33 +</div>
  34 +
  35 +<!-- <div class="row"> -->
  36 + <div class="col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)">
  37 +<!-- <div> -->
  38 + <div class="portlet-title">
  39 + <form class="form-inline" action="">
  40 + <div style="display: inline-block; " id="gsdmDiv">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  47 + </div>
  48 + <div style="margin-top: 2px"></div>
  49 + <div style="display: inline-block;">
  50 + <span class="item-label" style="width: 80px;">线路: </span>
  51 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  52 + </div>
  53 + <div style="display: inline-block;margin-left: 15px;">
  54 + <span class="item-label" style="width: 80px;">开始时间: </span>
  55 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  56 + </div>
  57 + <div style="display: inline-block;margin-left: 15px;">
  58 + <span class="item-label" style="width: 80px;">结束时间: </span>
  59 + <input class="form-control" type="text" id="date2" style="width: 180px;"/>
  60 + </div>
  61 + <div class="form-group">
  62 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  63 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  64 + </div>
  65 + </form>
  66 + </div>
  67 + <div class="portlet-body" id="tjrbBody" style="overflow:auto;height: calc(100% - 80px)">
  68 + <div class="table-container" style="margin-top: 10px;min-width: 906px">
  69 + <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
  70 + <table class="table table-bordered table-hover table-checkable" id="forms">
  71 + <thead>
  72 + <tr>
  73 + <th colspan="44"><label id="tjrq"></label> 线路统计日报</th>
  74 + </tr>
  75 + <tr>
  76 + <td rowspan="3"><span >路线名</span></td>
  77 + <td colspan="20">全日营运里程(公里)</td>
  78 + <td colspan="15">全日营运班次</td>
  79 + <td colspan="9">大间隔情况</td>
  80 + </tr>
  81 + <tr>
  82 + <td rowspan="2"><label>计划总</label>
  83 + <label>公里&nbsp;&nbsp;&nbsp;</label></td>
  84 + <td rowspan="2"><label>计划营</label><label>运公里</label></td>
  85 + <td rowspan="2"><label>计划空</label><label>驶公里</label></td>
  86 + <td rowspan="2"><label>实际</label><label>总公里</label></td>
  87 + <td rowspan="2"><label>实际营</label><label>运公里</label></td>
  88 + <td rowspan="2"><label>实际空</label><label>驶公里</label></td>
  89 + <td rowspan="2"><span>少驶公里</span></td>
  90 + <td rowspan="2"><span>少驶班次</span></td>
  91 + <td colspan="11">少驶原因(公里)</td>
  92 + <td rowspan="2"><span >临加公里</span></td>
  93 + <td colspan="3">计划班次</td>
  94 + <td colspan="3">实际班次</td>
  95 + <td colspan="3">临加班次</td>
  96 + <td colspan="3">放站班次</td>
  97 + <td colspan="3">调头班次</td>
  98 + <td colspan="3">发生次数</td>
  99 + <td rowspan="2">最大间隔时间(分)</td>
  100 + <td rowspan="2">原因</td>
  101 + </tr>
  102 + <tr>
  103 + <td><span >路阻</span></td>
  104 + <td><span>吊慢</span></td>
  105 + <td><span >故障</span></td>
  106 + <td><span >纠纷</span></td>
  107 + <td><span >肇事</span></td>
  108 + <td><span>缺人</span></td>
  109 + <td><span>缺车</span></td>
  110 + <td><span >客稀</span></td>
  111 + <td><span>气候</span></td>
  112 + <td><span>援外</span></td>
  113 + <td><span>其他</span></td>
  114 + <td><span>全日</span></td>
  115 + <td><span>早高峰</span></td>
  116 + <td><span>晚高峰</span></td>
  117 + <td><span>全日</span></td>
  118 + <td><span>早高峰</span></td>
  119 + <td><span>晚高峰</span></td>
  120 + <td><span>全日</span></td>
  121 + <td><span>早高峰</span></td>
  122 + <td><span>晚高峰</span></td>
  123 + <td><span>全日</span></td>
  124 + <td><span>早高峰</span></td>
  125 + <td><span>晚高峰</span></td>
  126 + <td><span>全日</span></td>
  127 + <td><span>早高峰</span></td>
  128 + <td><span>晚高峰</span></td>
  129 + <td><span>全日</span></td>
  130 + <td><span>早高峰</span></td>
  131 + <td><span>晚高峰</span></td>
  132 + </tr>
  133 + </thead>
  134 + <tbody class="statisticsDailyCalc2">
  135 +
  136 + </tbody>
  137 + </table>
  138 + </div>
  139 + </div>
  140 + </div>
  141 + </div>
  142 +</div>
  143 +
  144 +<script>
  145 + $(function(){
  146 + $('#export').attr('disabled', "true");
  147 +
  148 + // 关闭左侧栏
  149 + if (!$('body').hasClass('page-sidebar-closed'))
  150 + $('.menu-toggler.sidebar-toggler').click();
  151 +
  152 + var d = new Date();
  153 + d.setTime(d.getTime() - 1*1000*60*60*24);
  154 + var year = d.getFullYear();
  155 + var month = d.getMonth() + 1;
  156 + var day = d.getDate();
  157 + if(month < 10)
  158 + month = "0" + month;
  159 + if(day < 10)
  160 + day = "0" + day;
  161 + var dateTime = year + "-" + month + "-" + day;
  162 + $("#date").datetimepicker({
  163 + format : 'YYYY-MM-DD',
  164 + locale : 'zh-cn',
  165 + maxDate : dateTime
  166 + });
  167 + $("#date2").datetimepicker({
  168 + format : 'YYYY-MM-DD',
  169 + locale : 'zh-cn',
  170 + maxDate : dateTime
  171 + });
  172 + $("#date").val(dateTime);
  173 + $("#date2").val(dateTime);
  174 +
  175 +
  176 + var fage=false;
  177 + var obj = [];
  178 + var xlList;
  179 + $.get('/report/lineList',function(result){
  180 + xlList=result;
  181 + $.get('/user/companyData', function(result){
  182 + obj = result;
  183 + var options = '';
  184 + for(var i = 0; i < obj.length; i++){
  185 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  186 + }
  187 +
  188 + if(obj.length ==0){
  189 + $("#gsdmDiv").css('display','none');
  190 + }else if(obj.length ==1){
  191 + $("#gsdmDiv").css('display','none');
  192 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  193 + $('#fgsdmDiv').css('display','none');
  194 + }
  195 + $('#gsdm').html(options);
  196 + updateCompany();
  197 + });
  198 + })
  199 + $("#gsdm").on("change",updateCompany);
  200 + function updateCompany(){
  201 + var company = $('#gsdm').val();
  202 + var options = '';
  203 + for(var i = 0; i < obj.length; i++){
  204 + if(obj[i].companyCode == company){
  205 + var children = obj[i].children;
  206 + for(var j = 0; j < children.length; j++){
  207 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  208 + }
  209 + }
  210 + }
  211 + $('#fgsdm').html(options);
  212 +// initXl();
  213 + }
  214 +
  215 + var tempData = {};
  216 + $.get('/report/lineList',function(xlList){
  217 + var data = [];
  218 + data.push({id: " ", text: "全部线路"});
  219 + $.get('/user/companyData', function(result){
  220 + for(var i = 0; i < result.length; i++){
  221 + var companyCode = result[i].companyCode;
  222 + var children = result[i].children;
  223 + for(var j = 0; j < children.length; j++){
  224 + var code = children[j].code;
  225 + for(var k=0;k < xlList.length;k++ ){
  226 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  227 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  228 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  229 + }
  230 + }
  231 + }
  232 + }
  233 + initPinYinSelect2('#line',data,'');
  234 +
  235 + });
  236 + });
  237 +
  238 + $("#line").on("change", function(){
  239 + if($("#line").val() == " "){
  240 + $("#gsdm").attr("disabled", false);
  241 + $("#fgsdm").attr("disabled", false);
  242 + } else {
  243 + var temp = tempData[$("#line").val()].split(":");
  244 + $("#gsdm").val(temp[0]);
  245 + updateCompany();
  246 + $("#fgsdm").val(temp[1]);
  247 + $("#gsdm").attr("disabled", true);
  248 + $("#fgsdm").attr("disabled", true);
  249 + }
  250 + });
  251 +
  252 +
  253 + var line ="";
  254 + var xlName ="";
  255 + var date = "";
  256 + var date2 ="";
  257 + var gsdm="";
  258 + var fgsdm="";
  259 + $("#query").on("click",function(){
  260 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  261 + layer.msg("请选择时间范围!");
  262 + return;
  263 + }
  264 + if($("#date2").val() == null || $("#date2").val().trim().length == 0){
  265 + layer.msg("请选择时间范围!");
  266 + return;
  267 + }
  268 +// $("#tjrbBody").height($(window).height()-100);
  269 + line = $("#line").val();
  270 + xlName = $("#select2-line-container").html();
  271 + date = $("#date").val();
  272 + date2 =$("#date2").val();
  273 + gsdm =$("#gsdm").val();
  274 + fgsdm=$("#fgsdm").val();
  275 + if(line=="请选择"){
  276 + line="";
  277 + }
  278 + if(date==null || date =="" ||date2==null || date2 ==""){
  279 + layer.msg('请选择时间段.');
  280 + }else{
  281 + $("#tjrq").html(date+"至"+date2);
  282 + var params = {};
  283 + params['gsdm'] = gsdm;
  284 + params['fgsdm'] =fgsdm ;
  285 + params['line'] = line;
  286 + params['date'] = date;
  287 + params['date2'] = date2;
  288 + params['xlName'] = xlName;
  289 + params['type'] = "query";
  290 + var i = layer.load(2);
  291 +// $get('/realSchedule/statisticsDailyTj',params,function(result){
  292 + $get('/calcWaybill/calcStatisticsDaily',params,function(result){
  293 + // 把数据填充到模版中
  294 + var tbodyHtml = template('statisticsDailyCalc2',{list:result});
  295 + // 把渲染好的模版html文本追加到表格中
  296 + $('#forms .statisticsDailyCalc2').html(tbodyHtml);
  297 + layer.close(i);
  298 +
  299 + if(result.length == 0)
  300 + $("#export").attr('disabled',"true");
  301 + else
  302 + $("#export").removeAttr("disabled");
  303 + });
  304 + }
  305 +
  306 + });
  307 +// $("#tjrbBody").height($(window).height()-100);
  308 + $("#export").on("click",function(){
  309 + var params = {};
  310 + params['gsdm'] = gsdm;
  311 + params['fgsdm'] =fgsdm ;
  312 + params['line'] = line;
  313 + params['date'] = date;
  314 + params['date2'] = date2;
  315 + params['xlName'] = xlName;
  316 + params['type'] = "export";
  317 + $get('/realSchedule/statisticsDailyTj',params,function(result){
  318 + window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD"));
  319 + });
  320 + });
  321 +
  322 + });
  323 +</script>
  324 +<script type="text/html" id="statisticsDailyCalc2">
  325 + {{each list as obj i}}
  326 + <tr {{if obj.zt==1}}style='color: red'{{/if}}>
  327 + <td>{{obj.xlName}}</td>
  328 + <td>{{obj.jhzlc}}</td>
  329 + <td>{{obj.jhyylc}}</td>
  330 + <td>{{obj.jhkslc}}</td>
  331 + <td>{{obj.sjzlc}}</td>
  332 + <td>{{obj.sjyylc}}</td>
  333 + <td>{{obj.sjkslc}}</td>
  334 + <td>{{obj.sslc}}</td>
  335 + <td>{{obj.ssbc}}</td>
  336 + <td>{{obj.lzlc}}</td>
  337 + <td>{{obj.dmlc}}</td>
  338 + <td>{{obj.gzlc}}</td>
  339 + <td>{{obj.jflc}}</td>
  340 + <td>{{obj.zslc}}</td>
  341 + <td>{{obj.qrlc}}</td>
  342 + <td>{{obj.qclc}}</td>
  343 + <td>{{obj.kxlc}}</td>
  344 + <td>{{obj.qhlc}}</td>
  345 + <td>{{obj.ywlc}}</td>
  346 + <td>{{obj.qtlc}}</td>
  347 + <td>{{obj.ljlc}}</td>
  348 + <td>{{obj.jhbcq}}</td>
  349 + <td>{{obj.jhbcz}}</td>
  350 + <td>{{obj.jhbcw}}</td>
  351 + <td>{{obj.sjbcq}}</td>
  352 + <td>{{obj.sjbcz}}</td>
  353 + <td>{{obj.sjbcw}}</td>
  354 + <td>{{obj.ljbcq}}</td>
  355 + <td>{{obj.ljbcz}}</td>
  356 + <td>{{obj.ljbcw}}</td>
  357 + <td>{{obj.fzbcq}}</td>
  358 + <td>{{obj.fzbcz}}</td>
  359 + <td>{{obj.fzbcw}}</td>
  360 + <td>{{obj.dtbcq}}</td>
  361 + <td>{{obj.dtbcz}}</td>
  362 + <td>{{obj.dtbcw}}</td>
  363 + <td>{{obj.djgq}}</td>
  364 + <td>{{obj.djgz}}</td>
  365 + <td>{{obj.djgw}}</td>
  366 + <td>{{obj.djgsj}}</td>
  367 + <td>&nbsp;</td>
  368 + </tr>
  369 + {{/each}}
  370 + {{if list.length == 0}}
  371 + <tr>
  372 + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td>
  373 + </tr>
  374 + {{/if}}
  375 +</script>
0 \ No newline at end of file 376 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/form.html
@@ -103,6 +103,28 @@ @@ -103,6 +103,28 @@
103 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> 103 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
104 <div class="form-body"> 104 <div class="form-body">
105 <div class="form-group has-success has-feedback"> 105 <div class="form-group has-success has-feedback">
  106 + <label class="col-md-2 control-label">ExcelSheet格式类型*:</label>
  107 + <div class="col-md-4">
  108 + <sa-Select5 name="timetabletype"
  109 + model="ctrl.ttInfoDetailManageForForm"
  110 + cmaps="{'excelFormatType': 'code'}"
  111 + dcname="excelFormatType"
  112 + icname="code"
  113 + dsparams="{{ {type: 'dic', param: 'timetabletype' } | json }}"
  114 + iterobjname="item"
  115 + iterobjexp="item.name"
  116 + searchph="格式类型..."
  117 + searchexp="this.name"
  118 + required >
  119 + </sa-Select5>
  120 + </div>
  121 + <!-- 隐藏快,显示验证信息 -->
  122 + <div class="alert alert-danger well-sm" ng-show="myForm.timetabletype.$error.required">
  123 + 格式类型必须选择
  124 + </div>
  125 + </div>
  126 +
  127 + <div class="form-group has-success has-feedback">
106 <label class="col-md-2 control-label">站点路由版本类型*:</label> 128 <label class="col-md-2 control-label">站点路由版本类型*:</label>
107 <div class="col-md-4"> 129 <div class="col-md-4">
108 <sa-Select5 name="zdlytype" 130 <sa-Select5 name="zdlytype"
@@ -173,7 +195,8 @@ @@ -173,7 +195,8 @@
173 'sheetname': ctrl.ttInfoDetailManageForForm.sheetname, 195 'sheetname': ctrl.ttInfoDetailManageForForm.sheetname,
174 'lineid' : ctrl.ttInfoDetailManageForForm.xlid, 196 'lineid' : ctrl.ttInfoDetailManageForForm.xlid,
175 'linename' : ctrl.ttInfoDetailManageForForm.xlname, 197 'linename' : ctrl.ttInfoDetailManageForForm.xlname,
176 - 'lineversion' : ctrl.ttInfoDetailManageForForm.lineversion 198 + 'lineversion' : ctrl.ttInfoDetailManageForForm.lineversion,
  199 + 'excelFormatType': ctrl.ttInfoDetailManageForForm.excelFormatType
177 } | json}}"/> 200 } | json}}"/>
178 </div> 201 </div>
179 <!-- 隐藏块,显示验证信息 --> 202 <!-- 隐藏块,显示验证信息 -->
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/module.js
@@ -89,7 +89,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -89,7 +89,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
89 sheetname: undefined, // sheet名字 89 sheetname: undefined, // sheet名字
90 sheetvaliddesc: undefined, // sheet验证描述返回 90 sheetvaliddesc: undefined, // sheet验证描述返回
91 lineinfo: undefined, // 线路标准id 91 lineinfo: undefined, // 线路标准id
92 - lineinfovaliddesc: undefined // 线路标准验证描述返回 92 + lineinfovaliddesc: undefined, // 线路标准验证描述返回
  93 + excelFormatType: "normal" // 格式类型
93 }; 94 };
94 self.sheetnames = [ 95 self.sheetnames = [
95 //{name: '工作表1'}, {name: '工作表2'} // sheet名字列表 96 //{name: '工作表1'}, {name: '工作表2'} // sheet名字列表
src/main/resources/traffic-jdbc.properties 0 → 100644
  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 +