Commit 1cb69210b707f031d6c9f79792a883e23d5a1ca2

Authored by 廖磊
2 parents e0f4b2b1 deb01f8b

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

into pudong

Too many changes to show.

To preserve performance only 14 of 50 files are displayed.

src/main/java/com/bsth/controller/LineVersionsController.java
1 package com.bsth.controller; 1 package com.bsth.controller;
2 2
3 -import java.util.List;  
4 -import java.util.Map;  
5 - 3 +import com.bsth.entity.LineVersions;
  4 +import com.bsth.repository.LineRepository;
  5 +import com.bsth.service.LineVersionsService;
6 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.web.bind.annotation.RequestMapping; 7 import org.springframework.web.bind.annotation.RequestMapping;
8 import org.springframework.web.bind.annotation.RequestMethod; 8 import org.springframework.web.bind.annotation.RequestMethod;
9 import org.springframework.web.bind.annotation.RequestParam; 9 import org.springframework.web.bind.annotation.RequestParam;
10 import org.springframework.web.bind.annotation.RestController; 10 import org.springframework.web.bind.annotation.RestController;
11 11
12 -import com.bsth.entity.LineVersions;  
13 -import com.bsth.repository.LineRepository;  
14 -import com.bsth.service.LineVersionsService; 12 +import java.util.List;
  13 +import java.util.Map;
15 14
16 /** 15 /**
17 * 16 *
@@ -75,7 +74,11 @@ public class LineVersionsController extends BaseController<LineVersions, Integer @@ -75,7 +74,11 @@ public class LineVersionsController extends BaseController<LineVersions, Integer
75 public Map<String, Object> add(@RequestParam Map<String, Object> map) { 74 public Map<String, Object> add(@RequestParam Map<String, Object> map) {
76 return service.add(map); 75 return service.add(map);
77 } 76 }
78 - 77 + @RequestMapping(value = "delete", method = RequestMethod.POST)
  78 + public Map<String, Object> delete(@RequestParam (defaultValue = "id") int id) {
  79 + return service.delete(id);
  80 + }
  81 +
79 /** 82 /**
80 * 根据线路id获取当前版本号 83 * 根据线路id获取当前版本号
81 * 84 *
src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
@@ -376,7 +376,7 @@ public class GeoDataServiceImpl implements GeoDataService { @@ -376,7 +376,7 @@ public class GeoDataServiceImpl implements GeoDataService {
376 lVersion.setLineCode(lineCode); 376 lVersion.setLineCode(lineCode);
377 377
378 //如果有待启用的版本,设置为历史版本 378 //如果有待启用的版本,设置为历史版本
379 - jdbcTemplate.update("update bsth_c_line_versions set `status`=0, start_date=null,end_date=null where line_code='"+lineCode+"' and `status`=2"); 379 + jdbcTemplate.update("update bsth_c_line_versions set `status`=2, start_date=null,end_date=null where line_code='"+lineCode+"' and `status`=0");
380 380
381 //入库线路版本 381 //入库线路版本
382 jdbcTemplate.update("insert into bsth_c_line_versions(name, line, line_code, versions, start_date, create_date, update_date, remark,status, isupdate) " + 382 jdbcTemplate.update("insert into bsth_c_line_versions(name, line, line_code, versions, start_date, create_date, update_date, remark,status, isupdate) " +
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
1 package com.bsth.service.impl; 1 package com.bsth.service.impl;
2 2
3 -import java.sql.PreparedStatement;  
4 -import java.sql.SQLException;  
5 -import java.text.ParseException;  
6 -import java.text.SimpleDateFormat;  
7 -import java.util.Date;  
8 -import java.util.HashMap;  
9 -import java.util.List;  
10 -import java.util.Map;  
11 -  
12 -import org.springframework.beans.factory.annotation.Autowired;  
13 -import org.springframework.jdbc.core.BatchPreparedStatementSetter;  
14 -import org.springframework.jdbc.core.JdbcTemplate;  
15 -import org.springframework.stereotype.Service;  
16 -import org.springframework.transaction.annotation.Transactional;  
17 -  
18 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
19 import com.alibaba.fastjson.JSONArray; 4 import com.alibaba.fastjson.JSONArray;
20 import com.bsth.common.ResponseCode; 5 import com.bsth.common.ResponseCode;
@@ -31,6 +16,20 @@ import com.bsth.repository.LsStationRouteRepository; @@ -31,6 +16,20 @@ import com.bsth.repository.LsStationRouteRepository;
31 import com.bsth.service.LineVersionsService; 16 import com.bsth.service.LineVersionsService;
32 import com.bsth.service.SectionRouteService; 17 import com.bsth.service.SectionRouteService;
33 import com.bsth.service.StationRouteService; 18 import com.bsth.service.StationRouteService;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.jdbc.core.BatchPreparedStatementSetter;
  21 +import org.springframework.jdbc.core.JdbcTemplate;
  22 +import org.springframework.stereotype.Service;
  23 +import org.springframework.transaction.annotation.Transactional;
  24 +
  25 +import java.sql.PreparedStatement;
  26 +import java.sql.SQLException;
  27 +import java.text.ParseException;
  28 +import java.text.SimpleDateFormat;
  29 +import java.util.Date;
  30 +import java.util.HashMap;
  31 +import java.util.List;
  32 +import java.util.Map;
34 33
35 /** 34 /**
36 * 35 *
@@ -97,8 +96,10 @@ public class LineVersionsServiceImpl extends BaseServiceImpl&lt;LineVersions, Integ @@ -97,8 +96,10 @@ public class LineVersionsServiceImpl extends BaseServiceImpl&lt;LineVersions, Integ
97 int statu = repository.update(id,line,lineCode,new java.sql.Date(startDate.getTime()), 96 int statu = repository.update(id,line,lineCode,new java.sql.Date(startDate.getTime()),
98 new java.sql.Date(endDate.getTime()),versions,status,remark); 97 new java.sql.Date(endDate.getTime()),versions,status,remark);
99 LineVersions upLineVersions = repository.findBylineIdAndVersions(line.getId(),versions); 98 LineVersions upLineVersions = repository.findBylineIdAndVersions(line.getId(),versions);
100 - upLineVersions.setEndDate(new java.sql.Date(startDate.getTime()));  
101 - repository.save(upLineVersions); 99 + if(upLineVersions != null){
  100 + upLineVersions.setEndDate(new java.sql.Date(startDate.getTime()));
  101 + repository.save(upLineVersions);
  102 + }
102 if (statu==1) { 103 if (statu==1) {
103 resultMap.put("status", ResponseCode.SUCCESS); 104 resultMap.put("status", ResponseCode.SUCCESS);
104 } else { 105 } else {
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
1 package com.bsth.service.impl; 1 package com.bsth.service.impl;
2 2
3 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
4 -import com.bsth.entity.*; 4 +import com.bsth.entity.Line;
  5 +import com.bsth.entity.LsStationRoute;
  6 +import com.bsth.entity.Station;
  7 +import com.bsth.entity.StationRoute;
  8 +import com.bsth.entity.StationRouteCache;
5 import com.bsth.entity.search.CustomerSpecs; 9 import com.bsth.entity.search.CustomerSpecs;
6 -import com.bsth.repository.*; 10 +import com.bsth.repository.LineRepository;
  11 +import com.bsth.repository.LsStationRouteRepository;
  12 +import com.bsth.repository.SectionRouteRepository;
  13 +import com.bsth.repository.StationRepository;
  14 +import com.bsth.repository.StationRouteCacheRepository;
  15 +import com.bsth.repository.StationRouteRepository;
7 import com.bsth.service.StationRouteService; 16 import com.bsth.service.StationRouteService;
8 import com.bsth.util.ExcelUtil; 17 import com.bsth.util.ExcelUtil;
9 import com.bsth.util.FTPClientUtils; 18 import com.bsth.util.FTPClientUtils;
10 -import com.bsth.util.PackTarGZUtils;  
11 import com.bsth.util.Geo.GeoUtils; 19 import com.bsth.util.Geo.GeoUtils;
12 import com.bsth.util.Geo.Point; 20 import com.bsth.util.Geo.Point;
  21 +import com.bsth.util.PackTarGZUtils;
13 import com.bsth.util.db.DBUtils_MS; 22 import com.bsth.util.db.DBUtils_MS;
14 import com.google.common.base.Splitter; 23 import com.google.common.base.Splitter;
15 import org.springframework.beans.factory.annotation.Autowired; 24 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,13 +27,17 @@ import org.springframework.data.domain.Sort.Direction; @@ -18,13 +27,17 @@ import org.springframework.data.domain.Sort.Direction;
18 import org.springframework.stereotype.Service; 27 import org.springframework.stereotype.Service;
19 import org.springframework.transaction.annotation.Transactional; 28 import org.springframework.transaction.annotation.Transactional;
20 29
  30 +import javax.servlet.http.HttpServletResponse;
21 import java.io.ByteArrayInputStream; 31 import java.io.ByteArrayInputStream;
22 import java.io.File; 32 import java.io.File;
23 import java.io.InputStream; 33 import java.io.InputStream;
24 import java.text.DecimalFormat; 34 import java.text.DecimalFormat;
25 -import java.util.*;  
26 -  
27 -import javax.servlet.http.HttpServletResponse; 35 +import java.util.ArrayList;
  36 +import java.util.HashMap;
  37 +import java.util.Iterator;
  38 +import java.util.List;
  39 +import java.util.Map;
  40 +import java.util.Properties;
28 41
29 /** 42 /**
30 * 43 *
@@ -93,7 +106,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -93,7 +106,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
93 public Map<String, Object> getSectionRouteExport(Integer id, HttpServletResponse resp) { 106 public Map<String, Object> getSectionRouteExport(Integer id, HttpServletResponse resp) {
94 Map<String, Object> resultMap = new HashMap<String, Object>(); 107 Map<String, Object> resultMap = new HashMap<String, Object>();
95 try { 108 try {
96 - // List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); 109 + // List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
97 Map<String,Object> resultExcel = new HashMap<String,Object>();//导出参数的对象 110 Map<String,Object> resultExcel = new HashMap<String,Object>();//导出参数的对象
98 /* 添加表头*/ 111 /* 添加表头*/
99 List<String> title = new ArrayList<String>(); 112 List<String> title = new ArrayList<String>();
@@ -113,10 +126,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -113,10 +126,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
113 if(strtionList == null){ 126 if(strtionList == null){
114 logger.info("没有数据导,出用户信息失败!"); 127 logger.info("没有数据导,出用户信息失败!");
115 } else { 128 } else {
116 - 129 +
117 for (int i = 0; i < strtionList.size(); i++) { 130 for (int i = 0; i < strtionList.size(); i++) {
118 StationRoute station = strtionList.get(i); 131 StationRoute station = strtionList.get(i);
119 - 132 +
120 List<String> varList = new ArrayList<String>(); 133 List<String> varList = new ArrayList<String>();
121 varList.add(station.getLine().getId().toString()); 134 varList.add(station.getLine().getId().toString());
122 varList.add(station.getDirections().toString()); 135 varList.add(station.getDirections().toString());
src/main/java/com/bsth/service/impl/StationServiceImpl.java
@@ -1372,8 +1372,11 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -1372,8 +1372,11 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1372 // 匹配到了用数据库中的点替换 1372 // 匹配到了用数据库中的点替换
1373 if (GeoUtils.isPointInCircle(point, circle)) { 1373 if (GeoUtils.isPointInCircle(point, circle)) {
1374 map.put("name", s.getStationName().toString()); 1374 map.put("name", s.getStationName().toString());
1375 - map.put("potion_lng", points[0]);  
1376 - map.put("potion_lat", points[1]); 1375 + // 匹配到站点后用这个站点的名字,但是使用gps点作为中心点
  1376 +// map.put("potion_lng", points[0]);
  1377 +// map.put("potion_lat", points[1]);
  1378 + map.put("potion_lng", lon);
  1379 + map.put("potion_lat", lat);
1377 map.put("isHave", "true"); 1380 map.put("isHave", "true");
1378 map.put("id", s.getId()); 1381 map.put("id", s.getId());
1379 isMatch = true; 1382 isMatch = true;
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/CalcuParam.java
1 -package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;  
2 -  
3 -import org.joda.time.DateTime;  
4 -  
5 -/**  
6 - * 计算用参数。  
7 - */  
8 -public class CalcuParam {  
9 - /** 线路Id */  
10 - private Integer xlId;  
11 -  
12 - /** 计划开始计算日期 */  
13 - private DateTime fromDate;  
14 - /** 计划结束计算日期 */  
15 - private DateTime toDate;  
16 -  
17 - public Integer getXlId() {  
18 - return xlId;  
19 - }  
20 -  
21 - public void setXlId(Integer xlId) {  
22 - this.xlId = xlId;  
23 - }  
24 -  
25 - public DateTime getFromDate() {  
26 - return fromDate;  
27 - }  
28 -  
29 - public void setFromDate(DateTime fromDate) {  
30 - this.fromDate = fromDate;  
31 - }  
32 -  
33 - public DateTime getToDate() {  
34 - return toDate;  
35 - }  
36 -  
37 - public void setToDate(DateTime toDate) {  
38 - this.toDate = toDate;  
39 - }  
40 -} 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +import org.joda.time.DateTime;
  4 +
  5 +/**
  6 + * 计算用参数。
  7 + */
  8 +public class CalcuParam {
  9 + /** 线路Id */
  10 + private Integer xlId;
  11 +
  12 + /** 计划开始计算日期 */
  13 + private DateTime fromDate;
  14 + /** 计划结束计算日期 */
  15 + private DateTime toDate;
  16 +
  17 + public Integer getXlId() {
  18 + return xlId;
  19 + }
  20 +
  21 + public void setXlId(Integer xlId) {
  22 + this.xlId = xlId;
  23 + }
  24 +
  25 + public DateTime getFromDate() {
  26 + return fromDate;
  27 + }
  28 +
  29 + public void setFromDate(DateTime fromDate) {
  30 + this.fromDate = fromDate;
  31 + }
  32 +
  33 + public DateTime getToDate() {
  34 + return toDate;
  35 + }
  36 +
  37 + public void setToDate(DateTime toDate) {
  38 + this.toDate = toDate;
  39 + }
  40 +}
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/ErrorInfoFunction.java
1 -package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;  
2 -  
3 -  
4 -import com.bsth.entity.schedule.EmployeeConfigInfo;  
5 -import com.bsth.entity.schedule.GuideboardInfo;  
6 -import org.apache.commons.lang3.StringUtils;  
7 -import org.apache.commons.lang3.math.NumberUtils;  
8 -import org.kie.api.runtime.rule.AccumulateFunction;  
9 -  
10 -import java.io.*;  
11 -import java.util.HashMap;  
12 -import java.util.Map;  
13 -  
14 -/**  
15 - * 查找错误函数。  
16 - */  
17 -public class ErrorInfoFunction implements AccumulateFunction {  
18 - @Override  
19 - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {  
20 -  
21 - }  
22 -  
23 - @Override  
24 - public void writeExternal(ObjectOutput out) throws IOException {  
25 -  
26 - }  
27 -  
28 - protected static class ErrorInfoContext implements Externalizable {  
29 - /** 错误数量 */  
30 - public Integer errorCount = 0;  
31 - /** 错误Map,Map<规则id,errorInfo> */  
32 - public Map<Long, ValidateRuleResult.ErrorInfo> errorInfoMap = new HashMap<>();  
33 -  
34 - public ErrorInfoContext() {  
35 -  
36 - }  
37 -  
38 - @Override  
39 - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {  
40 - errorCount = in.readInt();  
41 - errorInfoMap = (Map<Long, ValidateRuleResult.ErrorInfo>) in.readObject();  
42 -  
43 - }  
44 -  
45 - @Override  
46 - public void writeExternal(ObjectOutput out) throws IOException {  
47 - out.writeInt(errorCount);  
48 - out.writeObject(errorInfoMap);  
49 - }  
50 -  
51 - }  
52 -  
53 - @Override  
54 - public Serializable createContext() {  
55 - return new ErrorInfoContext();  
56 - }  
57 -  
58 - @Override  
59 - public void init(Serializable serializable) throws Exception {  
60 - ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;  
61 - errorInfoContext.errorCount = 0;  
62 - errorInfoContext.errorInfoMap = new HashMap<>();  
63 - }  
64 -  
65 - @Override  
66 - public void accumulate(Serializable serializable, Object o) {  
67 - ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;  
68 - WrapInput wrapInput = (WrapInput) o;  
69 -  
70 - ValidateRuleResult.ErrorInfo errorInfo = new ValidateRuleResult.ErrorInfo();  
71 - errorInfo.setRuleId(wrapInput.getRuleId());  
72 - errorInfo.setClZbh(wrapInput.getClZbh());  
73 - errorInfo.setQyrq(wrapInput.getQyrq());  
74 -  
75 - // 1、车辆配置验证  
76 - if (StringUtils.isNotEmpty(wrapInput.getClZbh())) { // 自编号不能为空  
77 - if (wrapInput.getCcInfos().get(wrapInput.getClZbh()) == null) { // 车辆配置不在当前线路上  
78 - errorInfo.getErrorDescList().add("车辆配置不在当前线路,请重新编辑保存!");  
79 - }  
80 - } else {  
81 - errorInfo.getErrorDescList().add("自编号不能为空,请重新编辑保存!");  
82 - }  
83 -  
84 - // 2、路牌id,路牌名字,路牌起始索引验证  
85 - if (StringUtils.isNotEmpty(wrapInput.getLpIds()) &&  
86 - StringUtils.isNotEmpty(wrapInput.getLpNames())) { // 冗余的路牌id和路牌名字都不能为空  
87 - String[] lpIds = wrapInput.getLpIds().split(",");  
88 - String[] lpNames = wrapInput.getLpNames().split(",");  
89 - if (lpIds.length == lpNames.length) { // 路牌id和路牌名字个数一致  
90 - for (int i = 0; i < lpIds.length; i++) {  
91 - if (!NumberUtils.isDigits(lpIds[i])) { // 冗余路牌id必须是数字  
92 - errorInfo.getErrorDescList().add("冗余路牌id必须是数字,请重新编辑保存!");  
93 - break;  
94 - }  
95 -  
96 - GuideboardInfo lpInfo = wrapInput.getLpInfos().get(NumberUtils.toLong(lpIds[i]));  
97 - if (lpInfo == null) { // 路牌不在当前线路上  
98 - errorInfo.getErrorDescList().add("路牌不在当前线路上,请重新编辑保存!");  
99 - } else {  
100 - if (StringUtils.isEmpty(lpNames[i]) ||  
101 - !(lpNames[i].equals(lpInfo.getLpName()))) { // 路牌id和路牌名字不对应  
102 - errorInfo.getErrorDescList().add("路牌id和路牌名字不对应,请重新编辑保存!");  
103 - break;  
104 - }  
105 - }  
106 - }  
107 -  
108 - if (wrapInput.getLpStartIndex() < 1 ||  
109 - wrapInput.getLpStartIndex() > lpIds.length) { // 路牌起始索引溢出  
110 - errorInfo.getErrorDescList().add("路牌起始索引溢出,请重新编辑保存!");  
111 - }  
112 - } else {  
113 - errorInfo.getErrorDescList().add("路牌id和路牌名字个数不一致,请重新编辑保存!");  
114 - }  
115 - } else {  
116 - errorInfo.getErrorDescList().add("冗余的路牌id和路牌名字都不能为空,请重新编辑保存!");  
117 - }  
118 -  
119 - // 3、人员配置,搭班编码,人员起始索引验证  
120 - if (StringUtils.isNotEmpty(wrapInput.getEcIds()) &&  
121 - StringUtils.isNotEmpty(wrapInput.getEcDbbms())) { // 冗余的人员配置id和人员搭班编码都不能为空  
122 - String[] ecIds = wrapInput.getEcIds().split(",");  
123 - String[] ecDbbms = wrapInput.getEcDbbms().split(",");  
124 - if (ecIds.length == ecDbbms.length) { // 人员配置id和搭班编码个数一致  
125 - for (int i = 0; i < ecIds.length; i++) {  
126 - if (ecIds[i].contains("-")) { // 分班标识  
127 - String[] fb_ecIds = ecIds[i].split("-");  
128 - String[] fb_ecDbbms = ecDbbms[i].split("-");  
129 - if (fb_ecIds.length != 2 || fb_ecDbbms.length != 2) { // 只能早晚分班  
130 - errorInfo.getErrorDescList().add("只能早晚分班,请重新编辑保存!");  
131 - break;  
132 - } else {  
133 - EmployeeConfigInfo fb_ecInfo1 = wrapInput.getEcInfos().get(NumberUtils.toLong(fb_ecIds[0]));  
134 - EmployeeConfigInfo fb_ecInfo2 = wrapInput.getEcInfos().get(NumberUtils.toLong(fb_ecIds[1]));  
135 - if (fb_ecInfo1 == null || fb_ecInfo2 == null) { // 分班的人员配置不在当前线路  
136 - errorInfo.getErrorDescList().add("分班的人员配置不在当前线路,请重新编辑保存!");  
137 - break;  
138 - } else {  
139 - if (StringUtils.isEmpty(fb_ecDbbms[0]) ||  
140 - StringUtils.isEmpty(fb_ecDbbms[1]) ||  
141 - !(fb_ecDbbms[0].equals(fb_ecInfo1.getDbbm())) ||  
142 - !(fb_ecDbbms[1].equals(fb_ecInfo2.getDbbm()))) { // 分班人员配置id和搭班编码不对应  
143 - errorInfo.getErrorDescList().add("分班人员配置id和搭班编码不对应,请重新编辑保存!");  
144 - break;  
145 - }  
146 - }  
147 - }  
148 -  
149 - } else {  
150 - if (!NumberUtils.isDigits(ecIds[i])) { // 冗余的人员配置id必须是数字  
151 - errorInfo.getErrorDescList().add("冗余的人员配置id必须是数字,请重新编辑保存!");  
152 - break;  
153 - }  
154 -  
155 - EmployeeConfigInfo ecInfo = wrapInput.getEcInfos().get(NumberUtils.toLong(ecIds[i]));  
156 - if (ecInfo == null) { // 人员配置不在当前线路  
157 - errorInfo.getErrorDescList().add("人员配置不在当前线路,请重新编辑保存!");  
158 - break;  
159 - } else {  
160 - if (StringUtils.isEmpty(ecDbbms[i]) ||  
161 - !(ecDbbms[i].equals(ecInfo.getDbbm()))) { // 人员配置id和搭班编码不对应  
162 - errorInfo.getErrorDescList().add("人员配置id和搭班编码不对应,请重新编辑保存!");  
163 - break;  
164 - }  
165 - }  
166 - }  
167 - }  
168 -  
169 - if (wrapInput.getEcStartIndex() < 1 ||  
170 - wrapInput.getEcStartIndex() > ecIds.length) { // 人员起始索引溢出  
171 - errorInfo.getErrorDescList().add("人员起始索引溢出,请重新编辑保存!");  
172 - }  
173 - } else {  
174 - errorInfo.getErrorDescList().add("人员配置id和搭班编码个数不一致,请重新编辑保存!");  
175 - }  
176 - }  
177 -  
178 - if (errorInfo.getErrorDescList().size() > 0) {  
179 - errorInfoContext.errorCount ++;  
180 - errorInfoContext.errorInfoMap.put(wrapInput.getRuleId(), errorInfo);  
181 - }  
182 -  
183 - }  
184 -  
185 - @Override  
186 - public void reverse(Serializable serializable, Object o) throws Exception {  
187 - ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;  
188 - WrapInput wrapInput = (WrapInput) o;  
189 -  
190 - if (errorInfoContext.errorInfoMap.get(wrapInput.getRuleId()) != null) {  
191 - errorInfoContext.errorInfoMap.remove(wrapInput.getRuleId());  
192 - errorInfoContext.errorCount --;  
193 - }  
194 - }  
195 -  
196 - @Override  
197 - public Object getResult(Serializable serializable) throws Exception {  
198 - ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;  
199 - return errorInfoContext.errorInfoMap;  
200 - }  
201 -  
202 - @Override  
203 - public boolean supportsReverse() {  
204 - return true;  
205 - }  
206 -  
207 - @Override  
208 - public Class<?> getResultType() {  
209 - return Map.class;  
210 - }  
211 -  
212 -} 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +
  4 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  5 +import com.bsth.entity.schedule.GuideboardInfo;
  6 +import org.apache.commons.lang3.StringUtils;
  7 +import org.apache.commons.lang3.math.NumberUtils;
  8 +import org.kie.api.runtime.rule.AccumulateFunction;
  9 +
  10 +import java.io.*;
  11 +import java.util.HashMap;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 查找错误函数。
  16 + */
  17 +public class ErrorInfoFunction implements AccumulateFunction {
  18 + @Override
  19 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  20 +
  21 + }
  22 +
  23 + @Override
  24 + public void writeExternal(ObjectOutput out) throws IOException {
  25 +
  26 + }
  27 +
  28 + protected static class ErrorInfoContext implements Externalizable {
  29 + /** 错误数量 */
  30 + public Integer errorCount = 0;
  31 + /** 错误Map,Map<规则id,errorInfo> */
  32 + public Map<Long, ValidateRuleResult.ErrorInfo> errorInfoMap = new HashMap<>();
  33 +
  34 + public ErrorInfoContext() {
  35 +
  36 + }
  37 +
  38 + @Override
  39 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  40 + errorCount = in.readInt();
  41 + errorInfoMap = (Map<Long, ValidateRuleResult.ErrorInfo>) in.readObject();
  42 +
  43 + }
  44 +
  45 + @Override
  46 + public void writeExternal(ObjectOutput out) throws IOException {
  47 + out.writeInt(errorCount);
  48 + out.writeObject(errorInfoMap);
  49 + }
  50 +
  51 + }
  52 +
  53 + @Override
  54 + public Serializable createContext() {
  55 + return new ErrorInfoContext();
  56 + }
  57 +
  58 + @Override
  59 + public void init(Serializable serializable) throws Exception {
  60 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  61 + errorInfoContext.errorCount = 0;
  62 + errorInfoContext.errorInfoMap = new HashMap<>();
  63 + }
  64 +
  65 + @Override
  66 + public void accumulate(Serializable serializable, Object o) {
  67 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  68 + WrapInput wrapInput = (WrapInput) o;
  69 +
  70 + ValidateRuleResult.ErrorInfo errorInfo = new ValidateRuleResult.ErrorInfo();
  71 + errorInfo.setRuleId(wrapInput.getRuleId());
  72 + errorInfo.setClZbh(wrapInput.getClZbh());
  73 + errorInfo.setQyrq(wrapInput.getQyrq());
  74 +
  75 + // 1、车辆配置验证
  76 + if (StringUtils.isNotEmpty(wrapInput.getClZbh())) { // 自编号不能为空
  77 + if (wrapInput.getCcInfos().get(wrapInput.getClZbh()) == null) { // 车辆配置不在当前线路上
  78 + errorInfo.getErrorDescList().add("车辆配置不在当前线路,请重新编辑保存!");
  79 + }
  80 + } else {
  81 + errorInfo.getErrorDescList().add("自编号不能为空,请重新编辑保存!");
  82 + }
  83 +
  84 + // 2、路牌id,路牌名字,路牌起始索引验证
  85 + if (StringUtils.isNotEmpty(wrapInput.getLpIds()) &&
  86 + StringUtils.isNotEmpty(wrapInput.getLpNames())) { // 冗余的路牌id和路牌名字都不能为空
  87 + String[] lpIds = wrapInput.getLpIds().split(",");
  88 + String[] lpNames = wrapInput.getLpNames().split(",");
  89 + if (lpIds.length == lpNames.length) { // 路牌id和路牌名字个数一致
  90 + for (int i = 0; i < lpIds.length; i++) {
  91 + if (!NumberUtils.isDigits(lpIds[i])) { // 冗余路牌id必须是数字
  92 + errorInfo.getErrorDescList().add("冗余路牌id必须是数字,请重新编辑保存!");
  93 + break;
  94 + }
  95 +
  96 + GuideboardInfo lpInfo = wrapInput.getLpInfos().get(NumberUtils.toLong(lpIds[i]));
  97 + if (lpInfo == null) { // 路牌不在当前线路上
  98 + errorInfo.getErrorDescList().add("路牌不在当前线路上,请重新编辑保存!");
  99 + } else {
  100 + if (StringUtils.isEmpty(lpNames[i]) ||
  101 + !(lpNames[i].equals(lpInfo.getLpName()))) { // 路牌id和路牌名字不对应
  102 + errorInfo.getErrorDescList().add("路牌id和路牌名字不对应,请重新编辑保存!");
  103 + break;
  104 + }
  105 + }
  106 + }
  107 +
  108 + if (wrapInput.getLpStartIndex() < 1 ||
  109 + wrapInput.getLpStartIndex() > lpIds.length) { // 路牌起始索引溢出
  110 + errorInfo.getErrorDescList().add("路牌起始索引溢出,请重新编辑保存!");
  111 + }
  112 + } else {
  113 + errorInfo.getErrorDescList().add("路牌id和路牌名字个数不一致,请重新编辑保存!");
  114 + }
  115 + } else {
  116 + errorInfo.getErrorDescList().add("冗余的路牌id和路牌名字都不能为空,请重新编辑保存!");
  117 + }
  118 +
  119 + // 3、人员配置,搭班编码,人员起始索引验证
  120 + if (StringUtils.isNotEmpty(wrapInput.getEcIds()) &&
  121 + StringUtils.isNotEmpty(wrapInput.getEcDbbms())) { // 冗余的人员配置id和人员搭班编码都不能为空
  122 + String[] ecIds = wrapInput.getEcIds().split(",");
  123 + String[] ecDbbms = wrapInput.getEcDbbms().split(",");
  124 + if (ecIds.length == ecDbbms.length) { // 人员配置id和搭班编码个数一致
  125 + for (int i = 0; i < ecIds.length; i++) {
  126 + if (ecIds[i].contains("-")) { // 分班标识
  127 + String[] fb_ecIds = ecIds[i].split("-");
  128 + String[] fb_ecDbbms = ecDbbms[i].split("-");
  129 + if (fb_ecIds.length != 2 || fb_ecDbbms.length != 2) { // 只能早晚分班
  130 + errorInfo.getErrorDescList().add("只能早晚分班,请重新编辑保存!");
  131 + break;
  132 + } else {
  133 + EmployeeConfigInfo fb_ecInfo1 = wrapInput.getEcInfos().get(NumberUtils.toLong(fb_ecIds[0]));
  134 + EmployeeConfigInfo fb_ecInfo2 = wrapInput.getEcInfos().get(NumberUtils.toLong(fb_ecIds[1]));
  135 + if (fb_ecInfo1 == null || fb_ecInfo2 == null) { // 分班的人员配置不在当前线路
  136 + errorInfo.getErrorDescList().add("分班的人员配置不在当前线路,请重新编辑保存!");
  137 + break;
  138 + } else {
  139 + if (StringUtils.isEmpty(fb_ecDbbms[0]) ||
  140 + StringUtils.isEmpty(fb_ecDbbms[1]) ||
  141 + !(fb_ecDbbms[0].equals(fb_ecInfo1.getDbbm())) ||
  142 + !(fb_ecDbbms[1].equals(fb_ecInfo2.getDbbm()))) { // 分班人员配置id和搭班编码不对应
  143 + errorInfo.getErrorDescList().add("分班人员配置id和搭班编码不对应,请重新编辑保存!");
  144 + break;
  145 + }
  146 + }
  147 + }
  148 +
  149 + } else {
  150 + if (!NumberUtils.isDigits(ecIds[i])) { // 冗余的人员配置id必须是数字
  151 + errorInfo.getErrorDescList().add("冗余的人员配置id必须是数字,请重新编辑保存!");
  152 + break;
  153 + }
  154 +
  155 + EmployeeConfigInfo ecInfo = wrapInput.getEcInfos().get(NumberUtils.toLong(ecIds[i]));
  156 + if (ecInfo == null) { // 人员配置不在当前线路
  157 + errorInfo.getErrorDescList().add("人员配置不在当前线路,请重新编辑保存!");
  158 + break;
  159 + } else {
  160 + if (StringUtils.isEmpty(ecDbbms[i]) ||
  161 + !(ecDbbms[i].equals(ecInfo.getDbbm()))) { // 人员配置id和搭班编码不对应
  162 + errorInfo.getErrorDescList().add("人员配置id和搭班编码不对应,请重新编辑保存!");
  163 + break;
  164 + }
  165 + }
  166 + }
  167 + }
  168 +
  169 + if (wrapInput.getEcStartIndex() < 1 ||
  170 + wrapInput.getEcStartIndex() > ecIds.length) { // 人员起始索引溢出
  171 + errorInfo.getErrorDescList().add("人员起始索引溢出,请重新编辑保存!");
  172 + }
  173 + } else {
  174 + errorInfo.getErrorDescList().add("人员配置id和搭班编码个数不一致,请重新编辑保存!");
  175 + }
  176 + }
  177 +
  178 + if (errorInfo.getErrorDescList().size() > 0) {
  179 + errorInfoContext.errorCount ++;
  180 + errorInfoContext.errorInfoMap.put(wrapInput.getRuleId(), errorInfo);
  181 + }
  182 +
  183 + }
  184 +
  185 + @Override
  186 + public void reverse(Serializable serializable, Object o) throws Exception {
  187 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  188 + WrapInput wrapInput = (WrapInput) o;
  189 +
  190 + if (errorInfoContext.errorInfoMap.get(wrapInput.getRuleId()) != null) {
  191 + errorInfoContext.errorInfoMap.remove(wrapInput.getRuleId());
  192 + errorInfoContext.errorCount --;
  193 + }
  194 + }
  195 +
  196 + @Override
  197 + public Object getResult(Serializable serializable) throws Exception {
  198 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  199 + return errorInfoContext.errorInfoMap;
  200 + }
  201 +
  202 + @Override
  203 + public boolean supportsReverse() {
  204 + return true;
  205 + }
  206 +
  207 + @Override
  208 + public Class<?> getResultType() {
  209 + return Map.class;
  210 + }
  211 +
  212 +}
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/ValidateRuleResult.java
1 -package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;  
2 -  
3 -import java.util.ArrayList;  
4 -import java.util.Date;  
5 -import java.util.List;  
6 -  
7 -/**  
8 - * 输出结果值。  
9 - */  
10 -public class ValidateRuleResult {  
11 - /** 线路id */  
12 - private Integer xlId;  
13 - /** 规则总数量 */  
14 - private Integer count;  
15 - /** 启用的规则数量 */  
16 - private Integer qyCount;  
17 - /** 启用规则中的错误数量 */  
18 - private Integer qyErrorCount;  
19 - /** 错误列表 */  
20 - private List<ErrorInfo> errorInfos = new ArrayList<>();  
21 -  
22 - public Integer getXlId() {  
23 - return xlId;  
24 - }  
25 -  
26 - public void setXlId(Integer xlId) {  
27 - this.xlId = xlId;  
28 - }  
29 -  
30 - public Integer getCount() {  
31 - return count;  
32 - }  
33 -  
34 - public void setCount(Integer count) {  
35 - this.count = count;  
36 - }  
37 -  
38 - public Integer getQyCount() {  
39 - return qyCount;  
40 - }  
41 -  
42 - public void setQyCount(Integer qyCount) {  
43 - this.qyCount = qyCount;  
44 - }  
45 -  
46 - public Integer getQyErrorCount() {  
47 - return qyErrorCount;  
48 - }  
49 -  
50 - public void setQyErrorCount(Integer qyErrorCount) {  
51 - this.qyErrorCount = qyErrorCount;  
52 - }  
53 -  
54 - public List<ErrorInfo> getErrorInfos() {  
55 - return errorInfos;  
56 - }  
57 -  
58 - public void setErrorInfos(List<ErrorInfo> errorInfos) {  
59 - this.errorInfos = errorInfos;  
60 - }  
61 -  
62 - public static class ErrorInfo {  
63 - /** 规则id */  
64 - private Long ruleId;  
65 - /** 车辆自编号 */  
66 - private String clZbh;  
67 - /** 启用日期 */  
68 - private Date qyrq;  
69 - /** 错误描述 */  
70 - private List<String> errorDescList = new ArrayList<>();  
71 -  
72 - public Long getRuleId() {  
73 - return ruleId;  
74 - }  
75 -  
76 - public void setRuleId(Long ruleId) {  
77 - this.ruleId = ruleId;  
78 - }  
79 -  
80 - public String getClZbh() {  
81 - return clZbh;  
82 - }  
83 -  
84 - public void setClZbh(String clZbh) {  
85 - this.clZbh = clZbh;  
86 - }  
87 -  
88 - public Date getQyrq() {  
89 - return qyrq;  
90 - }  
91 -  
92 - public void setQyrq(Date qyrq) {  
93 - this.qyrq = qyrq;  
94 - }  
95 -  
96 - public List<String> getErrorDescList() {  
97 - return errorDescList;  
98 - }  
99 -  
100 - public void setErrorDescList(List<String> errorDescList) {  
101 - this.errorDescList = errorDescList;  
102 - }  
103 - }  
104 -} 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 输出结果值。
  9 + */
  10 +public class ValidateRuleResult {
  11 + /** 线路id */
  12 + private Integer xlId;
  13 + /** 规则总数量 */
  14 + private Integer count;
  15 + /** 启用的规则数量 */
  16 + private Integer qyCount;
  17 + /** 启用规则中的错误数量 */
  18 + private Integer qyErrorCount;
  19 + /** 错误列表 */
  20 + private List<ErrorInfo> errorInfos = new ArrayList<>();
  21 +
  22 + public Integer getXlId() {
  23 + return xlId;
  24 + }
  25 +
  26 + public void setXlId(Integer xlId) {
  27 + this.xlId = xlId;
  28 + }
  29 +
  30 + public Integer getCount() {
  31 + return count;
  32 + }
  33 +
  34 + public void setCount(Integer count) {
  35 + this.count = count;
  36 + }
  37 +
  38 + public Integer getQyCount() {
  39 + return qyCount;
  40 + }
  41 +
  42 + public void setQyCount(Integer qyCount) {
  43 + this.qyCount = qyCount;
  44 + }
  45 +
  46 + public Integer getQyErrorCount() {
  47 + return qyErrorCount;
  48 + }
  49 +
  50 + public void setQyErrorCount(Integer qyErrorCount) {
  51 + this.qyErrorCount = qyErrorCount;
  52 + }
  53 +
  54 + public List<ErrorInfo> getErrorInfos() {
  55 + return errorInfos;
  56 + }
  57 +
  58 + public void setErrorInfos(List<ErrorInfo> errorInfos) {
  59 + this.errorInfos = errorInfos;
  60 + }
  61 +
  62 + public static class ErrorInfo {
  63 + /** 规则id */
  64 + private Long ruleId;
  65 + /** 车辆自编号 */
  66 + private String clZbh;
  67 + /** 启用日期 */
  68 + private Date qyrq;
  69 + /** 错误描述 */
  70 + private List<String> errorDescList = new ArrayList<>();
  71 +
  72 + public Long getRuleId() {
  73 + return ruleId;
  74 + }
  75 +
  76 + public void setRuleId(Long ruleId) {
  77 + this.ruleId = ruleId;
  78 + }
  79 +
  80 + public String getClZbh() {
  81 + return clZbh;
  82 + }
  83 +
  84 + public void setClZbh(String clZbh) {
  85 + this.clZbh = clZbh;
  86 + }
  87 +
  88 + public Date getQyrq() {
  89 + return qyrq;
  90 + }
  91 +
  92 + public void setQyrq(Date qyrq) {
  93 + this.qyrq = qyrq;
  94 + }
  95 +
  96 + public List<String> getErrorDescList() {
  97 + return errorDescList;
  98 + }
  99 +
  100 + public void setErrorDescList(List<String> errorDescList) {
  101 + this.errorDescList = errorDescList;
  102 + }
  103 + }
  104 +}
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/WrapInput.java
1 -package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;  
2 -  
3 -import com.bsth.entity.schedule.CarConfigInfo;  
4 -import com.bsth.entity.schedule.EmployeeConfigInfo;  
5 -import com.bsth.entity.schedule.GuideboardInfo;  
6 -import com.bsth.entity.schedule.rule.ScheduleRule1Flat;  
7 -import org.springframework.util.CollectionUtils;  
8 -  
9 -import java.util.*;  
10 -  
11 -/**  
12 - * 聚合输入的待判定数据。  
13 - */  
14 -public class WrapInput {  
15 - /** 线路Id */  
16 - private Integer xlId;  
17 - /** 车辆自编号 */  
18 - private String clZbh;  
19 - /** 路牌id列表 */  
20 - private String lpIds;  
21 - /** 路牌名字列表 */  
22 - private String lpNames;  
23 - /** 人员配置列表 */  
24 - private String ecIds;  
25 - /** 人员搭班编码列表 */  
26 - private String ecDbbms;  
27 - /** 路牌循环起始索引 */  
28 - private Integer lpStartIndex;  
29 - /** 人员循环起始索引 */  
30 - private Integer ecStartIndex;  
31 - /** 规则id */  
32 - private Long ruleId;  
33 - /** 启用日期 */  
34 - private Date qyrq;  
35 -  
36 - private Map<String, CarConfigInfo> ccInfos = new HashMap<>();  
37 - private Map<Long, GuideboardInfo> lpInfos = new HashMap<>();  
38 - private Map<Long, EmployeeConfigInfo> ecInfos = new HashMap<>();  
39 -  
40 - public WrapInput(ScheduleRule1Flat r,  
41 - Map<String, CarConfigInfo> cc,  
42 - Map<Long, GuideboardInfo> lp,  
43 - Map<Long, EmployeeConfigInfo> ec) {  
44 - this.xlId = r.getXl().getId();  
45 - this.clZbh = r.getCarConfigInfo().getCl().getInsideCode();  
46 - this.lpIds = r.getLpIds();  
47 - this.lpNames = r.getLpNames();  
48 - this.ecIds = r.getRyConfigIds();  
49 - this.ecDbbms = r.getRyDbbms();  
50 - this.lpStartIndex = r.getLpStart();  
51 - this.ecStartIndex = r.getRyStart();  
52 - this.ruleId = r.getId();  
53 - this.qyrq = r.getQyrq();  
54 -  
55 - if (!CollectionUtils.isEmpty(cc)) {  
56 - this.ccInfos.putAll(cc);  
57 - }  
58 - if (!CollectionUtils.isEmpty(lp)) {  
59 - this.lpInfos.putAll(lp);  
60 - }  
61 - if (!CollectionUtils.isEmpty(ec)) {  
62 - this.ecInfos.putAll(ec);  
63 - }  
64 -  
65 - }  
66 -  
67 - public Integer getXlId() {  
68 - return xlId;  
69 - }  
70 -  
71 - public void setXlId(Integer xlId) {  
72 - this.xlId = xlId;  
73 - }  
74 -  
75 - public String getClZbh() {  
76 - return clZbh;  
77 - }  
78 -  
79 - public void setClZbh(String clZbh) {  
80 - this.clZbh = clZbh;  
81 - }  
82 -  
83 - public String getLpIds() {  
84 - return lpIds;  
85 - }  
86 -  
87 - public void setLpIds(String lpIds) {  
88 - this.lpIds = lpIds;  
89 - }  
90 -  
91 - public String getLpNames() {  
92 - return lpNames;  
93 - }  
94 -  
95 - public void setLpNames(String lpNames) {  
96 - this.lpNames = lpNames;  
97 - }  
98 -  
99 - public String getEcIds() {  
100 - return ecIds;  
101 - }  
102 -  
103 - public void setEcIds(String ecIds) {  
104 - this.ecIds = ecIds;  
105 - }  
106 -  
107 - public String getEcDbbms() {  
108 - return ecDbbms;  
109 - }  
110 -  
111 - public void setEcDbbms(String ecDbbms) {  
112 - this.ecDbbms = ecDbbms;  
113 - }  
114 -  
115 - public Integer getLpStartIndex() {  
116 - return lpStartIndex;  
117 - }  
118 -  
119 - public void setLpStartIndex(Integer lpStartIndex) {  
120 - this.lpStartIndex = lpStartIndex;  
121 - }  
122 -  
123 - public Integer getEcStartIndex() {  
124 - return ecStartIndex;  
125 - }  
126 -  
127 - public void setEcStartIndex(Integer ecStartIndex) {  
128 - this.ecStartIndex = ecStartIndex;  
129 - }  
130 -  
131 - public Long getRuleId() {  
132 - return ruleId;  
133 - }  
134 -  
135 - public void setRuleId(Long ruleId) {  
136 - this.ruleId = ruleId;  
137 - }  
138 -  
139 - public Date getQyrq() {  
140 - return qyrq;  
141 - }  
142 -  
143 - public void setQyrq(Date qyrq) {  
144 - this.qyrq = qyrq;  
145 - }  
146 -  
147 - public Map<String, CarConfigInfo> getCcInfos() {  
148 - return ccInfos;  
149 - }  
150 -  
151 - public void setCcInfos(Map<String, CarConfigInfo> ccInfos) {  
152 - this.ccInfos = ccInfos;  
153 - }  
154 -  
155 - public Map<Long, GuideboardInfo> getLpInfos() {  
156 - return lpInfos;  
157 - }  
158 -  
159 - public void setLpInfos(Map<Long, GuideboardInfo> lpInfos) {  
160 - this.lpInfos = lpInfos;  
161 - }  
162 -  
163 - public Map<Long, EmployeeConfigInfo> getEcInfos() {  
164 - return ecInfos;  
165 - }  
166 -  
167 - public void setEcInfos(Map<Long, EmployeeConfigInfo> ecInfos) {  
168 - this.ecInfos = ecInfos;  
169 - }  
170 -} 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +import com.bsth.entity.schedule.CarConfigInfo;
  4 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  5 +import com.bsth.entity.schedule.GuideboardInfo;
  6 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  7 +import org.springframework.util.CollectionUtils;
  8 +
  9 +import java.util.*;
  10 +
  11 +/**
  12 + * 聚合输入的待判定数据。
  13 + */
  14 +public class WrapInput {
  15 + /** 线路Id */
  16 + private Integer xlId;
  17 + /** 车辆自编号 */
  18 + private String clZbh;
  19 + /** 路牌id列表 */
  20 + private String lpIds;
  21 + /** 路牌名字列表 */
  22 + private String lpNames;
  23 + /** 人员配置列表 */
  24 + private String ecIds;
  25 + /** 人员搭班编码列表 */
  26 + private String ecDbbms;
  27 + /** 路牌循环起始索引 */
  28 + private Integer lpStartIndex;
  29 + /** 人员循环起始索引 */
  30 + private Integer ecStartIndex;
  31 + /** 规则id */
  32 + private Long ruleId;
  33 + /** 启用日期 */
  34 + private Date qyrq;
  35 +
  36 + private Map<String, CarConfigInfo> ccInfos = new HashMap<>();
  37 + private Map<Long, GuideboardInfo> lpInfos = new HashMap<>();
  38 + private Map<Long, EmployeeConfigInfo> ecInfos = new HashMap<>();
  39 +
  40 + public WrapInput(ScheduleRule1Flat r,
  41 + Map<String, CarConfigInfo> cc,
  42 + Map<Long, GuideboardInfo> lp,
  43 + Map<Long, EmployeeConfigInfo> ec) {
  44 + this.xlId = r.getXl().getId();
  45 + this.clZbh = r.getCarConfigInfo().getCl().getInsideCode();
  46 + this.lpIds = r.getLpIds();
  47 + this.lpNames = r.getLpNames();
  48 + this.ecIds = r.getRyConfigIds();
  49 + this.ecDbbms = r.getRyDbbms();
  50 + this.lpStartIndex = r.getLpStart();
  51 + this.ecStartIndex = r.getRyStart();
  52 + this.ruleId = r.getId();
  53 + this.qyrq = r.getQyrq();
  54 +
  55 + if (!CollectionUtils.isEmpty(cc)) {
  56 + this.ccInfos.putAll(cc);
  57 + }
  58 + if (!CollectionUtils.isEmpty(lp)) {
  59 + this.lpInfos.putAll(lp);
  60 + }
  61 + if (!CollectionUtils.isEmpty(ec)) {
  62 + this.ecInfos.putAll(ec);
  63 + }
  64 +
  65 + }
  66 +
  67 + public Integer getXlId() {
  68 + return xlId;
  69 + }
  70 +
  71 + public void setXlId(Integer xlId) {
  72 + this.xlId = xlId;
  73 + }
  74 +
  75 + public String getClZbh() {
  76 + return clZbh;
  77 + }
  78 +
  79 + public void setClZbh(String clZbh) {
  80 + this.clZbh = clZbh;
  81 + }
  82 +
  83 + public String getLpIds() {
  84 + return lpIds;
  85 + }
  86 +
  87 + public void setLpIds(String lpIds) {
  88 + this.lpIds = lpIds;
  89 + }
  90 +
  91 + public String getLpNames() {
  92 + return lpNames;
  93 + }
  94 +
  95 + public void setLpNames(String lpNames) {
  96 + this.lpNames = lpNames;
  97 + }
  98 +
  99 + public String getEcIds() {
  100 + return ecIds;
  101 + }
  102 +
  103 + public void setEcIds(String ecIds) {
  104 + this.ecIds = ecIds;
  105 + }
  106 +
  107 + public String getEcDbbms() {
  108 + return ecDbbms;
  109 + }
  110 +
  111 + public void setEcDbbms(String ecDbbms) {
  112 + this.ecDbbms = ecDbbms;
  113 + }
  114 +
  115 + public Integer getLpStartIndex() {
  116 + return lpStartIndex;
  117 + }
  118 +
  119 + public void setLpStartIndex(Integer lpStartIndex) {
  120 + this.lpStartIndex = lpStartIndex;
  121 + }
  122 +
  123 + public Integer getEcStartIndex() {
  124 + return ecStartIndex;
  125 + }
  126 +
  127 + public void setEcStartIndex(Integer ecStartIndex) {
  128 + this.ecStartIndex = ecStartIndex;
  129 + }
  130 +
  131 + public Long getRuleId() {
  132 + return ruleId;
  133 + }
  134 +
  135 + public void setRuleId(Long ruleId) {
  136 + this.ruleId = ruleId;
  137 + }
  138 +
  139 + public Date getQyrq() {
  140 + return qyrq;
  141 + }
  142 +
  143 + public void setQyrq(Date qyrq) {
  144 + this.qyrq = qyrq;
  145 + }
  146 +
  147 + public Map<String, CarConfigInfo> getCcInfos() {
  148 + return ccInfos;
  149 + }
  150 +
  151 + public void setCcInfos(Map<String, CarConfigInfo> ccInfos) {
  152 + this.ccInfos = ccInfos;
  153 + }
  154 +
  155 + public Map<Long, GuideboardInfo> getLpInfos() {
  156 + return lpInfos;
  157 + }
  158 +
  159 + public void setLpInfos(Map<Long, GuideboardInfo> lpInfos) {
  160 + this.lpInfos = lpInfos;
  161 + }
  162 +
  163 + public Map<Long, EmployeeConfigInfo> getEcInfos() {
  164 + return ecInfos;
  165 + }
  166 +
  167 + public void setEcInfos(Map<Long, EmployeeConfigInfo> ecInfos) {
  168 + this.ecInfos = ecInfos;
  169 + }
  170 +}
src/main/resources/application-dev.properties
@@ -31,4 +31,4 @@ http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all @@ -31,4 +31,4 @@ http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all
31 ## gateway real data 31 ## gateway real data
32 http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ 32 http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
33 ## gateway send directive 33 ## gateway send directive
34 -http.send.directive = http://192.168.168.201:9090/transport_server/message/ 34 +http.send.directive = http://192.168.168.201:9090/transport_server/message/
35 \ No newline at end of file 35 \ No newline at end of file
src/main/resources/datatools/ktrs/carsDataOutput.ktr
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<transformation>  
3 - <info>  
4 - <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</name>  
5 - <description>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</description>  
6 - <extended_description>&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;</extended_description>  
7 - <trans_version/>  
8 - <trans_type>Normal</trans_type>  
9 - <trans_status>0</trans_status>  
10 - <directory>&#x2f;</directory>  
11 - <parameters>  
12 - <parameter>  
13 - <name>QUERY</name>  
14 - <default_value/>  
15 - <description>&#x67e5;&#x8be2;</description>  
16 - </parameter>  
17 - <parameter>  
18 - <name>cgsbm_in</name>  
19 - <default_value/>  
20 - <description>&#x5206;&#x516c;&#x53f8;&#x7f16;&#x7801;</description>  
21 - </parameter>  
22 - <parameter>  
23 - <name>filepath</name>  
24 - <default_value>1&#x3d;1</default_value>  
25 - <description>excel&#x6587;&#x4ef6;&#x8def;&#x5f84;</description>  
26 - </parameter>  
27 - </parameters>  
28 - <log>  
29 -<trans-log-table><connection/>  
30 -<schema/>  
31 -<table/>  
32 -<size_limit_lines/>  
33 -<interval/>  
34 -<timeout_days/>  
35 -<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>  
36 -<perf-log-table><connection/>  
37 -<schema/>  
38 -<table/>  
39 -<interval/>  
40 -<timeout_days/>  
41 -<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>  
42 -<channel-log-table><connection/>  
43 -<schema/>  
44 -<table/>  
45 -<timeout_days/>  
46 -<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>  
47 -<step-log-table><connection/>  
48 -<schema/>  
49 -<table/>  
50 -<timeout_days/>  
51 -<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>  
52 -<metrics-log-table><connection/>  
53 -<schema/>  
54 -<table/>  
55 -<timeout_days/>  
56 -<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>  
57 - </log>  
58 - <maxdate>  
59 - <connection/>  
60 - <table/>  
61 - <field/>  
62 - <offset>0.0</offset>  
63 - <maxdiff>0.0</maxdiff>  
64 - </maxdate>  
65 - <size_rowset>10000</size_rowset>  
66 - <sleep_time_empty>50</sleep_time_empty>  
67 - <sleep_time_full>50</sleep_time_full>  
68 - <unique_connections>N</unique_connections>  
69 - <feedback_shown>Y</feedback_shown>  
70 - <feedback_size>50000</feedback_size>  
71 - <using_thread_priorities>Y</using_thread_priorities>  
72 - <shared_objects_file/>  
73 - <capture_step_performance>N</capture_step_performance>  
74 - <step_performance_capturing_delay>1000</step_performance_capturing_delay>  
75 - <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>  
76 - <dependencies>  
77 - </dependencies>  
78 - <partitionschemas>  
79 - </partitionschemas>  
80 - <slaveservers>  
81 - </slaveservers>  
82 - <clusterschemas>  
83 - </clusterschemas>  
84 - <created_user>-</created_user>  
85 - <created_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</created_date>  
86 - <modified_user>-</modified_user>  
87 - <modified_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</modified_date>  
88 - <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>  
89 - <is_key_private>N</is_key_private>  
90 - </info>  
91 - <notepads>  
92 - </notepads>  
93 - <connection>  
94 - <name>192.168.168.1_jwgl_dw</name>  
95 - <server>192.168.168.1</server>  
96 - <type>ORACLE</type>  
97 - <access>Native</access>  
98 - <database>orcl</database>  
99 - <port>1521</port>  
100 - <username>jwgl_dw</username>  
101 - <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>  
102 - <servername/>  
103 - <data_tablespace/>  
104 - <index_tablespace/>  
105 - <attributes>  
106 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
107 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
108 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
109 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
110 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
111 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
112 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
113 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
114 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
115 - </attributes>  
116 - </connection>  
117 - <connection>  
118 - <name>bus_control_variable</name>  
119 - <server>&#x24;&#x7b;v_db_ip&#x7d;</server>  
120 - <type>MYSQL</type>  
121 - <access>Native</access>  
122 - <database>&#x24;&#x7b;v_db_dname&#x7d;</database>  
123 - <port>3306</port>  
124 - <username>&#x24;&#x7b;v_db_uname&#x7d;</username>  
125 - <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>  
126 - <servername/>  
127 - <data_tablespace/>  
128 - <index_tablespace/>  
129 - <attributes>  
130 - <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>  
131 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
132 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
133 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
134 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
135 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
136 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
137 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
138 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
139 - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>  
140 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
141 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
142 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
143 - </attributes>  
144 - </connection>  
145 - <connection>  
146 - <name>bus_control_&#x516c;&#x53f8;_201</name>  
147 - <server>localhost</server>  
148 - <type>MYSQL</type>  
149 - <access>Native</access>  
150 - <database>control</database>  
151 - <port>3306</port>  
152 - <username>root</username>  
153 - <password>Encrypted </password>  
154 - <servername/>  
155 - <data_tablespace/>  
156 - <index_tablespace/>  
157 - <attributes>  
158 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
159 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
160 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
161 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
162 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
163 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
164 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
165 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
166 - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>  
167 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
168 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
169 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
170 - </attributes>  
171 - </connection>  
172 - <connection>  
173 - <name>bus_control_&#x672c;&#x673a;</name>  
174 - <server>localhost</server>  
175 - <type>MYSQL</type>  
176 - <access>Native</access>  
177 - <database>control</database>  
178 - <port>3306</port>  
179 - <username>root</username>  
180 - <password>Encrypted </password>  
181 - <servername/>  
182 - <data_tablespace/>  
183 - <index_tablespace/>  
184 - <attributes>  
185 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
186 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
187 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
188 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
189 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
190 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
191 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
192 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
193 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
194 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
195 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
196 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
197 - </attributes>  
198 - </connection>  
199 - <connection>  
200 - <name>JGJW_VM</name>  
201 - <server>192.168.198.240</server>  
202 - <type>ORACLE</type>  
203 - <access>Native</access>  
204 - <database>orcl</database>  
205 - <port>1521</port>  
206 - <username>jwgl</username>  
207 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10d485a8d6</password>  
208 - <servername/>  
209 - <data_tablespace/>  
210 - <index_tablespace/>  
211 - <attributes>  
212 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
213 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
214 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
215 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
216 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
217 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
218 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
219 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
220 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
221 - </attributes>  
222 - </connection>  
223 - <connection>  
224 - <name>NHJW_VM</name>  
225 - <server>192.168.198.240</server>  
226 - <type>ORACLE</type>  
227 - <access>Native</access>  
228 - <database>orcl</database>  
229 - <port>1521</port>  
230 - <username>nhjw</username>  
231 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10d09aa5cd</password>  
232 - <servername/>  
233 - <data_tablespace/>  
234 - <index_tablespace/>  
235 - <attributes>  
236 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
237 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
238 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
239 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
240 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
241 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
242 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
243 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
244 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
245 - </attributes>  
246 - </connection>  
247 - <connection>  
248 - <name>PDGJ_VM</name>  
249 - <server>192.168.198.240</server>  
250 - <type>ORACLE</type>  
251 - <access>Native</access>  
252 - <database>orcl</database>  
253 - <port>1521</port>  
254 - <username>pdgj</username>  
255 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10ce96a8d0</password>  
256 - <servername/>  
257 - <data_tablespace/>  
258 - <index_tablespace/>  
259 - <attributes>  
260 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
261 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
262 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
263 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
264 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
265 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
266 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
267 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
268 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
269 - </attributes>  
270 - </connection>  
271 - <connection>  
272 - <name>SNJW_VM</name>  
273 - <server>192.168.198.240</server>  
274 - <type>ORACLE</type>  
275 - <access>Native</access>  
276 - <database>orcl</database>  
277 - <port>1521</port>  
278 - <username>snjw</username>  
279 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10cd9ca5cd</password>  
280 - <servername/>  
281 - <data_tablespace/>  
282 - <index_tablespace/>  
283 - <attributes>  
284 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
285 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
286 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
287 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
288 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
289 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
290 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
291 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
292 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
293 - </attributes>  
294 - </connection>  
295 - <connection>  
296 - <name>xlab_mysql_youle</name>  
297 - <server>101.231.124.8</server>  
298 - <type>MYSQL</type>  
299 - <access>Native</access>  
300 - <database>xlab_youle</database>  
301 - <port>45687</port>  
302 - <username>xlab-youle</username>  
303 - <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>  
304 - <servername/>  
305 - <data_tablespace/>  
306 - <index_tablespace/>  
307 - <attributes>  
308 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
309 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
310 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
311 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
312 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
313 - <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>  
314 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
315 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
316 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
317 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>  
318 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>  
319 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
320 - </attributes>  
321 - </connection>  
322 - <connection>  
323 - <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>  
324 - <server>localhost</server>  
325 - <type>MYSQL</type>  
326 - <access>Native</access>  
327 - <database>xlab_youle</database>  
328 - <port>3306</port>  
329 - <username>root</username>  
330 - <password>Encrypted </password>  
331 - <servername/>  
332 - <data_tablespace/>  
333 - <index_tablespace/>  
334 - <attributes>  
335 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
336 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
337 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
338 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
339 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
340 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
341 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
342 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
343 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
344 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>  
345 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>  
346 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
347 - </attributes>  
348 - </connection>  
349 - <connection>  
350 - <name>xlab_youle</name>  
351 - <server/>  
352 - <type>MYSQL</type>  
353 - <access>JNDI</access>  
354 - <database>xlab_youle</database>  
355 - <port>1521</port>  
356 - <username/>  
357 - <password>Encrypted </password>  
358 - <servername/>  
359 - <data_tablespace/>  
360 - <index_tablespace/>  
361 - <attributes>  
362 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
363 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
364 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
365 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
366 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
367 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
368 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
369 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
370 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
371 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
372 - </attributes>  
373 - </connection>  
374 - <connection>  
375 - <name>YGJW_VM</name>  
376 - <server>192.168.198.240</server>  
377 - <type>ORACLE</type>  
378 - <access>Native</access>  
379 - <database>orcl</database>  
380 - <port>1521</port>  
381 - <username>ygjw</username>  
382 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10c795a5cd</password>  
383 - <servername/>  
384 - <data_tablespace/>  
385 - <index_tablespace/>  
386 - <attributes>  
387 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
388 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
389 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
390 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
391 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
392 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
393 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
394 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
395 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
396 - </attributes>  
397 - </connection>  
398 - <connection>  
399 - <name>&#x516c;&#x53f8;jgjw</name>  
400 - <server>192.168.168.1</server>  
401 - <type>ORACLE</type>  
402 - <access>Native</access>  
403 - <database>orcl</database>  
404 - <port>1521</port>  
405 - <username>jwgl</username>  
406 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10d485a8d6</password>  
407 - <servername/>  
408 - <data_tablespace/>  
409 - <index_tablespace/>  
410 - <attributes>  
411 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
412 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
413 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
414 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
415 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
416 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
417 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
418 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
419 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
420 - </attributes>  
421 - </connection>  
422 - <connection>  
423 - <name>&#x516c;&#x53f8;snjw</name>  
424 - <server>192.168.168.1</server>  
425 - <type>ORACLE</type>  
426 - <access>Native</access>  
427 - <database>orcl</database>  
428 - <port>1521</port>  
429 - <username>snjw</username>  
430 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10cd9ca5cd</password>  
431 - <servername/>  
432 - <data_tablespace/>  
433 - <index_tablespace/>  
434 - <attributes>  
435 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
436 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
437 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
438 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
439 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
440 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
441 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
442 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
443 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
444 - </attributes>  
445 - </connection>  
446 - <connection>  
447 - <name>&#x516c;&#x53f8;ygjw</name>  
448 - <server>192.168.168.1</server>  
449 - <type>ORACLE</type>  
450 - <access>Native</access>  
451 - <database>orcl</database>  
452 - <port>1521</port>  
453 - <username>ygjw</username>  
454 - <password>Encrypted 2be98afc86aa7f2e4cb79ce10c795a5cd</password>  
455 - <servername/>  
456 - <data_tablespace/>  
457 - <index_tablespace/>  
458 - <attributes>  
459 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
460 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
461 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
462 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
463 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
464 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
465 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
466 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
467 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
468 - </attributes>  
469 - </connection>  
470 - <order>  
471 - <hop> <from>&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop>  
472 - <hop> <from>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>  
473 - <hop> <from>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</from><to>&#x516c;&#x53f8;&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop>  
474 - <hop> <from>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x8868;&#x8f93;&#x5165;</from><to>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</to><enabled>Y</enabled> </hop>  
475 - <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>&#x662f;&#x5426;&#x7535;&#x8f66;</to><enabled>Y</enabled> </hop>  
476 - <hop> <from>&#x662f;&#x5426;&#x7535;&#x8f66;</from><to>Excel&#x8f93;&#x51fa;</to><enabled>Y</enabled> </hop>  
477 - </order>  
478 - <step>  
479 - <name>Excel&#x8f93;&#x51fa;</name>  
480 - <type>ExcelOutput</type>  
481 - <description/>  
482 - <distribute>Y</distribute>  
483 - <custom_distribution/>  
484 - <copies>1</copies>  
485 - <partitioning>  
486 - <method>none</method>  
487 - <schema_name/>  
488 - </partitioning>  
489 - <header>Y</header>  
490 - <footer>N</footer>  
491 - <encoding/>  
492 - <append>N</append>  
493 - <add_to_result_filenames>Y</add_to_result_filenames>  
494 - <file>  
495 - <name>&#x24;&#x7b;filepath&#x7d;</name>  
496 - <extention>xls</extention>  
497 - <do_not_open_newfile_init>N</do_not_open_newfile_init>  
498 - <create_parent_folder>N</create_parent_folder>  
499 - <split>N</split>  
500 - <add_date>N</add_date>  
501 - <add_time>N</add_time>  
502 - <SpecifyFormat>N</SpecifyFormat>  
503 - <date_time_format>yyyyMMddHHmmss</date_time_format>  
504 - <sheetname>&#x5de5;&#x4f5c;&#x8868;1</sheetname>  
505 - <autosizecolums>N</autosizecolums>  
506 - <nullisblank>N</nullisblank>  
507 - <protect_sheet>N</protect_sheet>  
508 - <password>Encrypted </password>  
509 - <splitevery>0</splitevery>  
510 - <usetempfiles>N</usetempfiles>  
511 - <tempdirectory/>  
512 - </file>  
513 - <template>  
514 - <enabled>N</enabled>  
515 - <append>N</append>  
516 - <filename>template.xls</filename>  
517 - </template>  
518 - <fields>  
519 - <field>  
520 - <name>&#x8f66;&#x724c;&#x53f7;</name>  
521 - <type>String</type>  
522 - <format/>  
523 - </field>  
524 - <field>  
525 - <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>  
526 - <type>String</type>  
527 - <format/>  
528 - </field>  
529 - <field>  
530 - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>  
531 - <type>String</type>  
532 - <format/>  
533 - </field>  
534 - <field>  
535 - <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>  
536 - <type>String</type>  
537 - <format/>  
538 - </field>  
539 - <field>  
540 - <name>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</name>  
541 - <type>String</type>  
542 - <format/>  
543 - </field>  
544 - <field>  
545 - <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>  
546 - <type>String</type>  
547 - <format/>  
548 - </field>  
549 - <field>  
550 - <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>  
551 - <type>String</type>  
552 - <format/>  
553 - </field>  
554 - </fields>  
555 - <custom>  
556 - <header_font_name>arial</header_font_name>  
557 - <header_font_size>10</header_font_size>  
558 - <header_font_bold>N</header_font_bold>  
559 - <header_font_italic>N</header_font_italic>  
560 - <header_font_underline>no</header_font_underline>  
561 - <header_font_orientation>horizontal</header_font_orientation>  
562 - <header_font_color>black</header_font_color>  
563 - <header_background_color>none</header_background_color>  
564 - <header_row_height>255</header_row_height>  
565 - <header_alignment>left</header_alignment>  
566 - <header_image/>  
567 - <row_font_name>arial</row_font_name>  
568 - <row_font_size>10</row_font_size>  
569 - <row_font_color>black</row_font_color>  
570 - <row_background_color>none</row_background_color>  
571 - </custom>  
572 - <cluster_schema/>  
573 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
574 - <xloc>498</xloc>  
575 - <yloc>348</yloc>  
576 - <draw>Y</draw>  
577 - </GUI>  
578 - </step>  
579 -  
580 - <step>  
581 - <name>&#x516c;&#x53f8;&#x67e5;&#x8be2;</name>  
582 - <type>DBLookup</type>  
583 - <description/>  
584 - <distribute>Y</distribute>  
585 - <custom_distribution/>  
586 - <copies>1</copies>  
587 - <partitioning>  
588 - <method>none</method>  
589 - <schema_name/>  
590 - </partitioning>  
591 - <connection>bus_control_variable</connection>  
592 - <cache>N</cache>  
593 - <cache_load_all>N</cache_load_all>  
594 - <cache_size>0</cache_size>  
595 - <lookup>  
596 - <schema/>  
597 - <table>bsth_c_business</table>  
598 - <orderby/>  
599 - <fail_on_multiple>N</fail_on_multiple>  
600 - <eat_row_on_failure>N</eat_row_on_failure>  
601 - <key>  
602 - <name>up_code</name>  
603 - <field>up_code</field>  
604 - <condition>&#x3d;</condition>  
605 - <name2/>  
606 - </key>  
607 - <key>  
608 - <name>business_code</name>  
609 - <field>business_code</field>  
610 - <condition>&#x3d;</condition>  
611 - <name2/>  
612 - </key>  
613 - <value>  
614 - <name>business_name</name>  
615 - <rename>gs</rename>  
616 - <default/>  
617 - <type>String</type>  
618 - </value>  
619 - </lookup>  
620 - <cluster_schema/>  
621 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
622 - <xloc>364</xloc>  
623 - <yloc>60</yloc>  
624 - <draw>Y</draw>  
625 - </GUI>  
626 - </step>  
627 -  
628 - <step>  
629 - <name>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</name>  
630 - <type>DBLookup</type>  
631 - <description/>  
632 - <distribute>Y</distribute>  
633 - <custom_distribution/>  
634 - <copies>1</copies>  
635 - <partitioning>  
636 - <method>none</method>  
637 - <schema_name/>  
638 - </partitioning>  
639 - <connection>bus_control_variable</connection>  
640 - <cache>N</cache>  
641 - <cache_load_all>N</cache_load_all>  
642 - <cache_size>0</cache_size>  
643 - <lookup>  
644 - <schema/>  
645 - <table>bsth_c_business</table>  
646 - <orderby/>  
647 - <fail_on_multiple>N</fail_on_multiple>  
648 - <eat_row_on_failure>N</eat_row_on_failure>  
649 - <key>  
650 - <name>business_code</name>  
651 - <field>up_code</field>  
652 - <condition>&#x3d;</condition>  
653 - <name2/>  
654 - </key>  
655 - <key>  
656 - <name>branche_company_code</name>  
657 - <field>business_code</field>  
658 - <condition>&#x3d;</condition>  
659 - <name2/>  
660 - </key>  
661 - <value>  
662 - <name>business_name</name>  
663 - <rename>fgs</rename>  
664 - <default/>  
665 - <type>String</type>  
666 - </value>  
667 - </lookup>  
668 - <cluster_schema/>  
669 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
670 - <xloc>491</xloc>  
671 - <yloc>60</yloc>  
672 - <draw>Y</draw>  
673 - </GUI>  
674 - </step>  
675 -  
676 - <step>  
677 - <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>  
678 - <type>SelectValues</type>  
679 - <description/>  
680 - <distribute>N</distribute>  
681 - <custom_distribution/>  
682 - <copies>1</copies>  
683 - <partitioning>  
684 - <method>none</method>  
685 - <schema_name/>  
686 - </partitioning>  
687 - <fields> <field> <name>car_plate</name>  
688 - <rename>&#x8f66;&#x724c;&#x53f7;</rename>  
689 - <length>-2</length>  
690 - <precision>-2</precision>  
691 - </field> <field> <name>inside_code</name>  
692 - <rename>&#x5185;&#x90e8;&#x7f16;&#x7801;</rename>  
693 - <length>-2</length>  
694 - <precision>-2</precision>  
695 - </field> <field> <name>gs</name>  
696 - <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;</rename>  
697 - <length>-2</length>  
698 - <precision>-2</precision>  
699 - </field> <field> <name>fgs</name>  
700 - <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</rename>  
701 - <length>-2</length>  
702 - <precision>-2</precision>  
703 - </field> <field> <name>supplier_name</name>  
704 - <rename>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</rename>  
705 - <length>-2</length>  
706 - <precision>-2</precision>  
707 - </field> <field> <name>equipment_code</name>  
708 - <rename>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</rename>  
709 - <length>-2</length>  
710 - <precision>-2</precision>  
711 - </field> <field> <name>sfdc</name>  
712 - <rename>sfdc_cal</rename>  
713 - <length>-2</length>  
714 - <precision>-2</precision>  
715 - </field> <select_unspecified>N</select_unspecified>  
716 - </fields> <cluster_schema/>  
717 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
718 - <xloc>495</xloc>  
719 - <yloc>173</yloc>  
720 - <draw>Y</draw>  
721 - </GUI>  
722 - </step>  
723 -  
724 - <step>  
725 - <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>  
726 - <type>ScriptValueMod</type>  
727 - <description/>  
728 - <distribute>Y</distribute>  
729 - <custom_distribution/>  
730 - <copies>1</copies>  
731 - <partitioning>  
732 - <method>none</method>  
733 - <schema_name/>  
734 - </partitioning>  
735 - <compatible>N</compatible>  
736 - <optimizationLevel>9</optimizationLevel>  
737 - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>  
738 - <jsScript_name>Script 1</jsScript_name>  
739 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#xa;if&#x28;sfdc_cal &#x3d;&#x3d; 0&#x29; &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#x7d; else if &#x28;sfdc_cal &#x3d;&#x3d; 1&#x29; &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x662f;&#x22;&#x3b;&#xa;&#x7d; else &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#x7d;&#xa;</jsScript_script>  
740 - </jsScript> </jsScripts> <fields> <field> <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>  
741 - <rename>&#x662f;&#x5426;&#x7535;&#x8f66;</rename>  
742 - <type>String</type>  
743 - <length>-1</length>  
744 - <precision>-1</precision>  
745 - <replace>N</replace>  
746 - </field> </fields> <cluster_schema/>  
747 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
748 - <xloc>695</xloc>  
749 - <yloc>173</yloc>  
750 - <draw>Y</draw>  
751 - </GUI>  
752 - </step>  
753 -  
754 - <step>  
755 - <name>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</name>  
756 - <type>ScriptValueMod</type>  
757 - <description/>  
758 - <distribute>Y</distribute>  
759 - <custom_distribution/>  
760 - <copies>1</copies>  
761 - <partitioning>  
762 - <method>none</method>  
763 - <schema_name/>  
764 - </partitioning>  
765 - <compatible>N</compatible>  
766 - <optimizationLevel>9</optimizationLevel>  
767 - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>  
768 - <jsScript_name>Script 1</jsScript_name>  
769 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var up_code &#x3d; &#x27;88&#x27;&#x3b;</jsScript_script>  
770 - </jsScript> </jsScripts> <fields> <field> <name>up_code</name>  
771 - <rename>up_code</rename>  
772 - <type>String</type>  
773 - <length>-1</length>  
774 - <precision>-1</precision>  
775 - <replace>N</replace>  
776 - </field> </fields> <cluster_schema/>  
777 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
778 - <xloc>227</xloc>  
779 - <yloc>59</yloc>  
780 - <draw>Y</draw>  
781 - </GUI>  
782 - </step>  
783 -  
784 - <step>  
785 - <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x8868;&#x8f93;&#x5165;</name>  
786 - <type>TableInput</type>  
787 - <description/>  
788 - <distribute>Y</distribute>  
789 - <custom_distribution/>  
790 - <copies>1</copies>  
791 - <partitioning>  
792 - <method>none</method>  
793 - <schema_name/>  
794 - </partitioning>  
795 - <connection>bus_control_variable</connection>  
796 - <sql>SELECT &#x2a; FROM bsth_c_cars&#xa;where &#x24;&#x7b;QUERY&#x7d;</sql>  
797 - <limit>0</limit>  
798 - <lookup/>  
799 - <execute_each_row>N</execute_each_row>  
800 - <variables_active>Y</variables_active>  
801 - <lazy_conversion_active>N</lazy_conversion_active>  
802 - <cluster_schema/>  
803 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
804 - <xloc>88</xloc>  
805 - <yloc>59</yloc>  
806 - <draw>Y</draw>  
807 - </GUI>  
808 - </step>  
809 -  
810 - <step_error_handling>  
811 - </step_error_handling>  
812 - <slave-step-copy-partition-distribution>  
813 -</slave-step-copy-partition-distribution>  
814 - <slave_transformation>N</slave_transformation>  
815 -  
816 -</transformation> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<transformation>
  3 + <info>
  4 + <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</name>
  5 + <description>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</description>
  6 + <extended_description>&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;</extended_description>
  7 + <trans_version/>
  8 + <trans_type>Normal</trans_type>
  9 + <trans_status>0</trans_status>
  10 + <directory>&#x2f;</directory>
  11 + <parameters>
  12 + <parameter>
  13 + <name>QUERY</name>
  14 + <default_value/>
  15 + <description>&#x67e5;&#x8be2;</description>
  16 + </parameter>
  17 + <parameter>
  18 + <name>cgsbm_in</name>
  19 + <default_value/>
  20 + <description>&#x5206;&#x516c;&#x53f8;&#x7f16;&#x7801;</description>
  21 + </parameter>
  22 + <parameter>
  23 + <name>filepath</name>
  24 + <default_value>1&#x3d;1</default_value>
  25 + <description>excel&#x6587;&#x4ef6;&#x8def;&#x5f84;</description>
  26 + </parameter>
  27 + </parameters>
  28 + <log>
  29 +<trans-log-table><connection/>
  30 +<schema/>
  31 +<table/>
  32 +<size_limit_lines/>
  33 +<interval/>
  34 +<timeout_days/>
  35 +<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>
  36 +<perf-log-table><connection/>
  37 +<schema/>
  38 +<table/>
  39 +<interval/>
  40 +<timeout_days/>
  41 +<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>
  42 +<channel-log-table><connection/>
  43 +<schema/>
  44 +<table/>
  45 +<timeout_days/>
  46 +<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>
  47 +<step-log-table><connection/>
  48 +<schema/>
  49 +<table/>
  50 +<timeout_days/>
  51 +<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>
  52 +<metrics-log-table><connection/>
  53 +<schema/>
  54 +<table/>
  55 +<timeout_days/>
  56 +<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>
  57 + </log>
  58 + <maxdate>
  59 + <connection/>
  60 + <table/>
  61 + <field/>
  62 + <offset>0.0</offset>
  63 + <maxdiff>0.0</maxdiff>
  64 + </maxdate>
  65 + <size_rowset>10000</size_rowset>
  66 + <sleep_time_empty>50</sleep_time_empty>
  67 + <sleep_time_full>50</sleep_time_full>
  68 + <unique_connections>N</unique_connections>
  69 + <feedback_shown>Y</feedback_shown>
  70 + <feedback_size>50000</feedback_size>
  71 + <using_thread_priorities>Y</using_thread_priorities>
  72 + <shared_objects_file/>
  73 + <capture_step_performance>N</capture_step_performance>
  74 + <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  75 + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  76 + <dependencies>
  77 + </dependencies>
  78 + <partitionschemas>
  79 + </partitionschemas>
  80 + <slaveservers>
  81 + </slaveservers>
  82 + <clusterschemas>
  83 + </clusterschemas>
  84 + <created_user>-</created_user>
  85 + <created_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</created_date>
  86 + <modified_user>-</modified_user>
  87 + <modified_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</modified_date>
  88 + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
  89 + <is_key_private>N</is_key_private>
  90 + </info>
  91 + <notepads>
  92 + </notepads>
  93 + <connection>
  94 + <name>192.168.168.1_jwgl_dw</name>
  95 + <server>192.168.168.1</server>
  96 + <type>ORACLE</type>
  97 + <access>Native</access>
  98 + <database>orcl</database>
  99 + <port>1521</port>
  100 + <username>jwgl_dw</username>
  101 + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
  102 + <servername/>
  103 + <data_tablespace/>
  104 + <index_tablespace/>
  105 + <attributes>
  106 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  107 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  108 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  109 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  110 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  111 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  112 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  113 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  114 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  115 + </attributes>
  116 + </connection>
  117 + <connection>
  118 + <name>bus_control_variable</name>
  119 + <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
  120 + <type>MYSQL</type>
  121 + <access>Native</access>
  122 + <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
  123 + <port>3306</port>
  124 + <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
  125 + <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
  126 + <servername/>
  127 + <data_tablespace/>
  128 + <index_tablespace/>
  129 + <attributes>
  130 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
  131 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  132 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  133 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  134 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  135 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  136 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  137 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  138 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  139 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  140 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  141 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  142 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  143 + </attributes>
  144 + </connection>
  145 + <connection>
  146 + <name>bus_control_&#x516c;&#x53f8;_201</name>
  147 + <server>localhost</server>
  148 + <type>MYSQL</type>
  149 + <access>Native</access>
  150 + <database>control</database>
  151 + <port>3306</port>
  152 + <username>root</username>
  153 + <password>Encrypted </password>
  154 + <servername/>
  155 + <data_tablespace/>
  156 + <index_tablespace/>
  157 + <attributes>
  158 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  159 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  160 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  161 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  162 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  163 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  164 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  165 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  166 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  167 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  168 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  169 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  170 + </attributes>
  171 + </connection>
  172 + <connection>
  173 + <name>bus_control_&#x672c;&#x673a;</name>
  174 + <server>localhost</server>
  175 + <type>MYSQL</type>
  176 + <access>Native</access>
  177 + <database>control</database>
  178 + <port>3306</port>
  179 + <username>root</username>
  180 + <password>Encrypted </password>
  181 + <servername/>
  182 + <data_tablespace/>
  183 + <index_tablespace/>
  184 + <attributes>
  185 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  186 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  187 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  188 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  189 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  190 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  191 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  192 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  193 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  194 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  195 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  196 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  197 + </attributes>
  198 + </connection>
  199 + <connection>
  200 + <name>JGJW_VM</name>
  201 + <server>192.168.198.240</server>
  202 + <type>ORACLE</type>
  203 + <access>Native</access>
  204 + <database>orcl</database>
  205 + <port>1521</port>
  206 + <username>jwgl</username>
  207 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10d485a8d6</password>
  208 + <servername/>
  209 + <data_tablespace/>
  210 + <index_tablespace/>
  211 + <attributes>
  212 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  213 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  214 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  215 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  216 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  217 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  218 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  219 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  220 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  221 + </attributes>
  222 + </connection>
  223 + <connection>
  224 + <name>NHJW_VM</name>
  225 + <server>192.168.198.240</server>
  226 + <type>ORACLE</type>
  227 + <access>Native</access>
  228 + <database>orcl</database>
  229 + <port>1521</port>
  230 + <username>nhjw</username>
  231 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10d09aa5cd</password>
  232 + <servername/>
  233 + <data_tablespace/>
  234 + <index_tablespace/>
  235 + <attributes>
  236 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  237 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  238 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  239 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  240 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  241 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  242 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  243 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  244 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  245 + </attributes>
  246 + </connection>
  247 + <connection>
  248 + <name>PDGJ_VM</name>
  249 + <server>192.168.198.240</server>
  250 + <type>ORACLE</type>
  251 + <access>Native</access>
  252 + <database>orcl</database>
  253 + <port>1521</port>
  254 + <username>pdgj</username>
  255 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10ce96a8d0</password>
  256 + <servername/>
  257 + <data_tablespace/>
  258 + <index_tablespace/>
  259 + <attributes>
  260 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  261 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  262 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  263 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  264 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  265 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  266 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  267 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  268 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  269 + </attributes>
  270 + </connection>
  271 + <connection>
  272 + <name>SNJW_VM</name>
  273 + <server>192.168.198.240</server>
  274 + <type>ORACLE</type>
  275 + <access>Native</access>
  276 + <database>orcl</database>
  277 + <port>1521</port>
  278 + <username>snjw</username>
  279 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10cd9ca5cd</password>
  280 + <servername/>
  281 + <data_tablespace/>
  282 + <index_tablespace/>
  283 + <attributes>
  284 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  285 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  286 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  287 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  288 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  289 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  290 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  291 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  292 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  293 + </attributes>
  294 + </connection>
  295 + <connection>
  296 + <name>xlab_mysql_youle</name>
  297 + <server>101.231.124.8</server>
  298 + <type>MYSQL</type>
  299 + <access>Native</access>
  300 + <database>xlab_youle</database>
  301 + <port>45687</port>
  302 + <username>xlab-youle</username>
  303 + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
  304 + <servername/>
  305 + <data_tablespace/>
  306 + <index_tablespace/>
  307 + <attributes>
  308 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  309 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  310 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  311 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  312 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  313 + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
  314 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  315 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  316 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  317 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  318 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  319 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  320 + </attributes>
  321 + </connection>
  322 + <connection>
  323 + <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
  324 + <server>localhost</server>
  325 + <type>MYSQL</type>
  326 + <access>Native</access>
  327 + <database>xlab_youle</database>
  328 + <port>3306</port>
  329 + <username>root</username>
  330 + <password>Encrypted </password>
  331 + <servername/>
  332 + <data_tablespace/>
  333 + <index_tablespace/>
  334 + <attributes>
  335 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  336 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  337 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  338 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  339 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  340 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  341 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  342 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  343 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  344 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  345 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  346 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  347 + </attributes>
  348 + </connection>
  349 + <connection>
  350 + <name>xlab_youle</name>
  351 + <server/>
  352 + <type>MYSQL</type>
  353 + <access>JNDI</access>
  354 + <database>xlab_youle</database>
  355 + <port>1521</port>
  356 + <username/>
  357 + <password>Encrypted </password>
  358 + <servername/>
  359 + <data_tablespace/>
  360 + <index_tablespace/>
  361 + <attributes>
  362 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  363 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  364 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  365 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  366 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  367 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  368 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  369 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  370 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  371 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  372 + </attributes>
  373 + </connection>
  374 + <connection>
  375 + <name>YGJW_VM</name>
  376 + <server>192.168.198.240</server>
  377 + <type>ORACLE</type>
  378 + <access>Native</access>
  379 + <database>orcl</database>
  380 + <port>1521</port>
  381 + <username>ygjw</username>
  382 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10c795a5cd</password>
  383 + <servername/>
  384 + <data_tablespace/>
  385 + <index_tablespace/>
  386 + <attributes>
  387 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  388 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  389 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  390 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  391 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  392 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  393 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  394 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  395 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  396 + </attributes>
  397 + </connection>
  398 + <connection>
  399 + <name>&#x516c;&#x53f8;jgjw</name>
  400 + <server>192.168.168.1</server>
  401 + <type>ORACLE</type>
  402 + <access>Native</access>
  403 + <database>orcl</database>
  404 + <port>1521</port>
  405 + <username>jwgl</username>
  406 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10d485a8d6</password>
  407 + <servername/>
  408 + <data_tablespace/>
  409 + <index_tablespace/>
  410 + <attributes>
  411 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  412 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  413 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  414 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  415 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  416 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  417 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  418 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  419 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  420 + </attributes>
  421 + </connection>
  422 + <connection>
  423 + <name>&#x516c;&#x53f8;snjw</name>
  424 + <server>192.168.168.1</server>
  425 + <type>ORACLE</type>
  426 + <access>Native</access>
  427 + <database>orcl</database>
  428 + <port>1521</port>
  429 + <username>snjw</username>
  430 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10cd9ca5cd</password>
  431 + <servername/>
  432 + <data_tablespace/>
  433 + <index_tablespace/>
  434 + <attributes>
  435 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  436 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  437 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  438 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  439 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  440 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  441 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  442 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  443 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  444 + </attributes>
  445 + </connection>
  446 + <connection>
  447 + <name>&#x516c;&#x53f8;ygjw</name>
  448 + <server>192.168.168.1</server>
  449 + <type>ORACLE</type>
  450 + <access>Native</access>
  451 + <database>orcl</database>
  452 + <port>1521</port>
  453 + <username>ygjw</username>
  454 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10c795a5cd</password>
  455 + <servername/>
  456 + <data_tablespace/>
  457 + <index_tablespace/>
  458 + <attributes>
  459 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  460 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  461 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  462 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  463 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  464 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  465 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  466 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  467 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  468 + </attributes>
  469 + </connection>
  470 + <order>
  471 + <hop> <from>&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop>
  472 + <hop> <from>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>
  473 + <hop> <from>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</from><to>&#x516c;&#x53f8;&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop>
  474 + <hop> <from>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x8868;&#x8f93;&#x5165;</from><to>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</to><enabled>Y</enabled> </hop>
  475 + <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>&#x662f;&#x5426;&#x7535;&#x8f66;</to><enabled>Y</enabled> </hop>
  476 + <hop> <from>&#x662f;&#x5426;&#x7535;&#x8f66;</from><to>Excel&#x8f93;&#x51fa;</to><enabled>Y</enabled> </hop>
  477 + </order>
  478 + <step>
  479 + <name>Excel&#x8f93;&#x51fa;</name>
  480 + <type>ExcelOutput</type>
  481 + <description/>
  482 + <distribute>Y</distribute>
  483 + <custom_distribution/>
  484 + <copies>1</copies>
  485 + <partitioning>
  486 + <method>none</method>
  487 + <schema_name/>
  488 + </partitioning>
  489 + <header>Y</header>
  490 + <footer>N</footer>
  491 + <encoding/>
  492 + <append>N</append>
  493 + <add_to_result_filenames>Y</add_to_result_filenames>
  494 + <file>
  495 + <name>&#x24;&#x7b;filepath&#x7d;</name>
  496 + <extention>xls</extention>
  497 + <do_not_open_newfile_init>N</do_not_open_newfile_init>
  498 + <create_parent_folder>N</create_parent_folder>
  499 + <split>N</split>
  500 + <add_date>N</add_date>
  501 + <add_time>N</add_time>
  502 + <SpecifyFormat>N</SpecifyFormat>
  503 + <date_time_format>yyyyMMddHHmmss</date_time_format>
  504 + <sheetname>&#x5de5;&#x4f5c;&#x8868;1</sheetname>
  505 + <autosizecolums>N</autosizecolums>
  506 + <nullisblank>N</nullisblank>
  507 + <protect_sheet>N</protect_sheet>
  508 + <password>Encrypted </password>
  509 + <splitevery>0</splitevery>
  510 + <usetempfiles>N</usetempfiles>
  511 + <tempdirectory/>
  512 + </file>
  513 + <template>
  514 + <enabled>N</enabled>
  515 + <append>N</append>
  516 + <filename>template.xls</filename>
  517 + </template>
  518 + <fields>
  519 + <field>
  520 + <name>&#x8f66;&#x724c;&#x53f7;</name>
  521 + <type>String</type>
  522 + <format/>
  523 + </field>
  524 + <field>
  525 + <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
  526 + <type>String</type>
  527 + <format/>
  528 + </field>
  529 + <field>
  530 + <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>
  531 + <type>String</type>
  532 + <format/>
  533 + </field>
  534 + <field>
  535 + <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>
  536 + <type>String</type>
  537 + <format/>
  538 + </field>
  539 + <field>
  540 + <name>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</name>
  541 + <type>String</type>
  542 + <format/>
  543 + </field>
  544 + <field>
  545 + <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>
  546 + <type>String</type>
  547 + <format/>
  548 + </field>
  549 + <field>
  550 + <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>
  551 + <type>String</type>
  552 + <format/>
  553 + </field>
  554 + </fields>
  555 + <custom>
  556 + <header_font_name>arial</header_font_name>
  557 + <header_font_size>10</header_font_size>
  558 + <header_font_bold>N</header_font_bold>
  559 + <header_font_italic>N</header_font_italic>
  560 + <header_font_underline>no</header_font_underline>
  561 + <header_font_orientation>horizontal</header_font_orientation>
  562 + <header_font_color>black</header_font_color>
  563 + <header_background_color>none</header_background_color>
  564 + <header_row_height>255</header_row_height>
  565 + <header_alignment>left</header_alignment>
  566 + <header_image/>
  567 + <row_font_name>arial</row_font_name>
  568 + <row_font_size>10</row_font_size>
  569 + <row_font_color>black</row_font_color>
  570 + <row_background_color>none</row_background_color>
  571 + </custom>
  572 + <cluster_schema/>
  573 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  574 + <xloc>498</xloc>
  575 + <yloc>348</yloc>
  576 + <draw>Y</draw>
  577 + </GUI>
  578 + </step>
  579 +
  580 + <step>
  581 + <name>&#x516c;&#x53f8;&#x67e5;&#x8be2;</name>
  582 + <type>DBLookup</type>
  583 + <description/>
  584 + <distribute>Y</distribute>
  585 + <custom_distribution/>
  586 + <copies>1</copies>
  587 + <partitioning>
  588 + <method>none</method>
  589 + <schema_name/>
  590 + </partitioning>
  591 + <connection>bus_control_variable</connection>
  592 + <cache>N</cache>
  593 + <cache_load_all>N</cache_load_all>
  594 + <cache_size>0</cache_size>
  595 + <lookup>
  596 + <schema/>
  597 + <table>bsth_c_business</table>
  598 + <orderby/>
  599 + <fail_on_multiple>N</fail_on_multiple>
  600 + <eat_row_on_failure>N</eat_row_on_failure>
  601 + <key>
  602 + <name>up_code</name>
  603 + <field>up_code</field>
  604 + <condition>&#x3d;</condition>
  605 + <name2/>
  606 + </key>
  607 + <key>
  608 + <name>business_code</name>
  609 + <field>business_code</field>
  610 + <condition>&#x3d;</condition>
  611 + <name2/>
  612 + </key>
  613 + <value>
  614 + <name>business_name</name>
  615 + <rename>gs</rename>
  616 + <default/>
  617 + <type>String</type>
  618 + </value>
  619 + </lookup>
  620 + <cluster_schema/>
  621 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  622 + <xloc>364</xloc>
  623 + <yloc>60</yloc>
  624 + <draw>Y</draw>
  625 + </GUI>
  626 + </step>
  627 +
  628 + <step>
  629 + <name>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</name>
  630 + <type>DBLookup</type>
  631 + <description/>
  632 + <distribute>Y</distribute>
  633 + <custom_distribution/>
  634 + <copies>1</copies>
  635 + <partitioning>
  636 + <method>none</method>
  637 + <schema_name/>
  638 + </partitioning>
  639 + <connection>bus_control_variable</connection>
  640 + <cache>N</cache>
  641 + <cache_load_all>N</cache_load_all>
  642 + <cache_size>0</cache_size>
  643 + <lookup>
  644 + <schema/>
  645 + <table>bsth_c_business</table>
  646 + <orderby/>
  647 + <fail_on_multiple>N</fail_on_multiple>
  648 + <eat_row_on_failure>N</eat_row_on_failure>
  649 + <key>
  650 + <name>business_code</name>
  651 + <field>up_code</field>
  652 + <condition>&#x3d;</condition>
  653 + <name2/>
  654 + </key>
  655 + <key>
  656 + <name>branche_company_code</name>
  657 + <field>business_code</field>
  658 + <condition>&#x3d;</condition>
  659 + <name2/>
  660 + </key>
  661 + <value>
  662 + <name>business_name</name>
  663 + <rename>fgs</rename>
  664 + <default/>
  665 + <type>String</type>
  666 + </value>
  667 + </lookup>
  668 + <cluster_schema/>
  669 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  670 + <xloc>491</xloc>
  671 + <yloc>60</yloc>
  672 + <draw>Y</draw>
  673 + </GUI>
  674 + </step>
  675 +
  676 + <step>
  677 + <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
  678 + <type>SelectValues</type>
  679 + <description/>
  680 + <distribute>N</distribute>
  681 + <custom_distribution/>
  682 + <copies>1</copies>
  683 + <partitioning>
  684 + <method>none</method>
  685 + <schema_name/>
  686 + </partitioning>
  687 + <fields> <field> <name>car_plate</name>
  688 + <rename>&#x8f66;&#x724c;&#x53f7;</rename>
  689 + <length>-2</length>
  690 + <precision>-2</precision>
  691 + </field> <field> <name>inside_code</name>
  692 + <rename>&#x5185;&#x90e8;&#x7f16;&#x7801;</rename>
  693 + <length>-2</length>
  694 + <precision>-2</precision>
  695 + </field> <field> <name>gs</name>
  696 + <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;</rename>
  697 + <length>-2</length>
  698 + <precision>-2</precision>
  699 + </field> <field> <name>fgs</name>
  700 + <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</rename>
  701 + <length>-2</length>
  702 + <precision>-2</precision>
  703 + </field> <field> <name>supplier_name</name>
  704 + <rename>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</rename>
  705 + <length>-2</length>
  706 + <precision>-2</precision>
  707 + </field> <field> <name>equipment_code</name>
  708 + <rename>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</rename>
  709 + <length>-2</length>
  710 + <precision>-2</precision>
  711 + </field> <field> <name>sfdc</name>
  712 + <rename>sfdc_cal</rename>
  713 + <length>-2</length>
  714 + <precision>-2</precision>
  715 + </field> <select_unspecified>N</select_unspecified>
  716 + </fields> <cluster_schema/>
  717 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  718 + <xloc>495</xloc>
  719 + <yloc>173</yloc>
  720 + <draw>Y</draw>
  721 + </GUI>
  722 + </step>
  723 +
  724 + <step>
  725 + <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>
  726 + <type>ScriptValueMod</type>
  727 + <description/>
  728 + <distribute>Y</distribute>
  729 + <custom_distribution/>
  730 + <copies>1</copies>
  731 + <partitioning>
  732 + <method>none</method>
  733 + <schema_name/>
  734 + </partitioning>
  735 + <compatible>N</compatible>
  736 + <optimizationLevel>9</optimizationLevel>
  737 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  738 + <jsScript_name>Script 1</jsScript_name>
  739 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#xa;if&#x28;sfdc_cal &#x3d;&#x3d; 0&#x29; &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#x7d; else if &#x28;sfdc_cal &#x3d;&#x3d; 1&#x29; &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x662f;&#x22;&#x3b;&#xa;&#x7d; else &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#x7d;&#xa;</jsScript_script>
  740 + </jsScript> </jsScripts> <fields> <field> <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>
  741 + <rename>&#x662f;&#x5426;&#x7535;&#x8f66;</rename>
  742 + <type>String</type>
  743 + <length>-1</length>
  744 + <precision>-1</precision>
  745 + <replace>N</replace>
  746 + </field> </fields> <cluster_schema/>
  747 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  748 + <xloc>695</xloc>
  749 + <yloc>173</yloc>
  750 + <draw>Y</draw>
  751 + </GUI>
  752 + </step>
  753 +
  754 + <step>
  755 + <name>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</name>
  756 + <type>ScriptValueMod</type>
  757 + <description/>
  758 + <distribute>Y</distribute>
  759 + <custom_distribution/>
  760 + <copies>1</copies>
  761 + <partitioning>
  762 + <method>none</method>
  763 + <schema_name/>
  764 + </partitioning>
  765 + <compatible>N</compatible>
  766 + <optimizationLevel>9</optimizationLevel>
  767 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  768 + <jsScript_name>Script 1</jsScript_name>
  769 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var up_code &#x3d; &#x27;88&#x27;&#x3b;</jsScript_script>
  770 + </jsScript> </jsScripts> <fields> <field> <name>up_code</name>
  771 + <rename>up_code</rename>
  772 + <type>String</type>
  773 + <length>-1</length>
  774 + <precision>-1</precision>
  775 + <replace>N</replace>
  776 + </field> </fields> <cluster_schema/>
  777 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  778 + <xloc>227</xloc>
  779 + <yloc>59</yloc>
  780 + <draw>Y</draw>
  781 + </GUI>
  782 + </step>
  783 +
  784 + <step>
  785 + <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x8868;&#x8f93;&#x5165;</name>
  786 + <type>TableInput</type>
  787 + <description/>
  788 + <distribute>Y</distribute>
  789 + <custom_distribution/>
  790 + <copies>1</copies>
  791 + <partitioning>
  792 + <method>none</method>
  793 + <schema_name/>
  794 + </partitioning>
  795 + <connection>bus_control_variable</connection>
  796 + <sql>SELECT &#x2a; FROM bsth_c_cars&#xa;where &#x24;&#x7b;QUERY&#x7d;</sql>
  797 + <limit>0</limit>
  798 + <lookup/>
  799 + <execute_each_row>N</execute_each_row>
  800 + <variables_active>Y</variables_active>
  801 + <lazy_conversion_active>N</lazy_conversion_active>
  802 + <cluster_schema/>
  803 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  804 + <xloc>88</xloc>
  805 + <yloc>59</yloc>
  806 + <draw>Y</draw>
  807 + </GUI>
  808 + </step>
  809 +
  810 + <step_error_handling>
  811 + </step_error_handling>
  812 + <slave-step-copy-partition-distribution>
  813 +</slave-step-copy-partition-distribution>
  814 + <slave_transformation>N</slave_transformation>
  815 +
  816 +</transformation>
src/main/resources/rules/kBase1_core_functions.drl
1 -package com.bsth.service.schedule.impl.plan.kBase1.core;  
2 -  
3 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidsCountFunction gidscount;  
4 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbTimeFunction gidfbtime;  
5 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbFcnoFunction gidfbfcno;  
6 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResultsFunction lpinforesult;  
7 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.MinRuleQyrqFunction minruleqyrq;  
8 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidRepeatBcFunction vrb;  
9 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWholeRerunBcFunction vwrb;  
10 -import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWantLpFunction vwlp; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core;
  2 +
  3 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidsCountFunction gidscount;
  4 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbTimeFunction gidfbtime;
  5 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbFcnoFunction gidfbfcno;
  6 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResultsFunction lpinforesult;
  7 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.MinRuleQyrqFunction minruleqyrq;
  8 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidRepeatBcFunction vrb;
  9 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWholeRerunBcFunction vwrb;
  10 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWantLpFunction vwlp;
src/main/resources/rules/kBase1_core_plan.drl
1 -package com.bsth.service.schedule.impl.plan.kBase1.core.plan;  
2 -  
3 -import org.joda.time.*;  
4 -import java.util.*;  
5 -  
6 -import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanCalcuParam_input;  
7 -import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanResult;  
8 -  
9 -import com.bsth.repository.schedule.TTInfoDetailRepository;  
10 -import com.bsth.repository.schedule.CarConfigInfoRepository;  
11 -import com.bsth.repository.schedule.EmployeeConfigInfoRepository;  
12 -import com.bsth.repository.LineRepository;  
13 -import com.bsth.repository.BusinessRepository;  
14 -  
15 -import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;  
16 -import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;  
17 -import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResult_output;  
18 -import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResults_output;  
19 -import com.bsth.entity.Line;  
20 -import com.bsth.entity.Business;  
21 -  
22 -import com.bsth.entity.schedule.CarConfigInfo;  
23 -import com.bsth.entity.schedule.EmployeeConfigInfo;  
24 -import com.bsth.entity.schedule.TTInfo;  
25 -import com.bsth.entity.schedule.TTInfoDetail;  
26 -import com.bsth.entity.schedule.SchedulePlanInfo;  
27 -  
28 -import org.slf4j.Logger  
29 -import org.joda.time.format.DateTimeFormat  
30 -import org.apache.commons.lang3.StringUtils  
31 -import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_Type;  
32 -  
33 -  
34 -// 全局日志类(一般使用调用此规则的service类)  
35 -global Logger log;  
36 -  
37 -global TTInfoDetailRepository tTInfoDetailRepository;  
38 -global CarConfigInfoRepository carConfigInfoRepository;  
39 -global EmployeeConfigInfoRepository employeeConfigInfoRepository;  
40 -global LineRepository lineRepository;  
41 -global BusinessRepository businessRepository;  
42 -  
43 -// 输出  
44 -global PlanResult planResult;  
45 -  
46 -function Map xlidParams(String xlid) {  
47 - Map param = new HashMap();  
48 - param.put("xl.id_eq", Integer.valueOf(xlid));  
49 - return param;  
50 -}  
51 -  
52 -function List ecList(EmployeeConfigInfoRepository repo, String ecids) {  
53 - List<String> ids = Arrays.asList(ecids.split("-"));  
54 - List rst = new ArrayList();  
55 - for (int i = 0; i < ids.size(); i++) {  
56 - rst.add(repo.findOne(Long.parseLong(ids.get(i))));  
57 - }  
58 - return rst;  
59 -}  
60 -  
61 -function LocalTime fcsjTime(String fcsj) {  
62 - if ("NULL".equals(fcsj)) {  
63 - return null;  
64 - }  
65 - return LocalTime.parse(fcsj, DateTimeFormat.forPattern("HH:mm"));  
66 -}  
67 -  
68 -function String ttInfoId_sd(Map map, DateTime sd) {  
69 - TTInfoResult_output ttInfoResult_output = (TTInfoResult_output) map.get(sd);  
70 - return ttInfoResult_output.getTtInfoId();  
71 -}  
72 -  
73 -function Map gsMap(List gses) {  
74 - Map gsMap = new HashMap();  
75 - for (int i = 0; i < gses.size(); i++) {  
76 - Business gs = (Business) gses.get(i);  
77 - if (StringUtils.isNotEmpty(gs.getBusinessCode())) {  
78 - if ("88".equals(gs.getUpCode())) { // 浦东公交  
79 - gsMap.put(gs.getBusinessCode(), gs);  
80 - }  
81 - if (gs.getBusinessCode().equals(gs.getUpCode())) { // 闵行,青浦  
82 - gsMap.put(gs.getBusinessCode(), gs);  
83 - }  
84 - }  
85 - }  
86 - return gsMap;  
87 -}  
88 -  
89 -function Map fgsMap(List gses) {  
90 - // 这里简单将 businessCode和upCode合并  
91 - Map fgsMap = new HashMap();  
92 - for (int i = 0; i < gses.size(); i++) {  
93 - Business gs = (Business) gses.get(i);  
94 - if (StringUtils.isNotEmpty(gs.getBusinessCode()) && StringUtils.isNotEmpty(gs.getUpCode())) {  
95 - fgsMap.put(gs.getUpCode() + "_" + gs.getBusinessCode(), gs);  
96 - }  
97 - }  
98 - return fgsMap;  
99 -}  
100 -  
101 -/*  
102 - 规则说明:  
103 - 根据循环规则输出,时刻表选择规则输出,组合计算排班明细  
104 -*/  
105 -  
106 -//-------------------- 第一阶段、计算迭代数据 -----------------//  
107 -declare Loop_result  
108 - xlId: String // 线路id  
109 -  
110 - ruleLoop: List // 每天分配的规则 List<ScheduleResult_output>  
111 -  
112 - ttInfoMapLoop_temp: Map // 每天分配的时刻表 Map<DataTime, Collection<TTInfoResult_output>>  
113 - ttInfoMapLoop: Map // 每天分配的时刻表 Map<DataTime, TTInfoResult_output>  
114 - ttInfoMap: Map // 总共用到的时刻表 Map<id, TTInfoResult_output>  
115 -end  
116 -  
117 -rule "calcu_step1_Loop_result"  
118 - salience 1000  
119 - when  
120 - $param: PlanCalcuParam_input($xlId: xlId)  
121 - then  
122 - Loop_result loop_result = new Loop_result();  
123 - loop_result.setXlId($xlId);  
124 - loop_result.setRuleLoop($param.getScheduleResults_output().getResults());  
125 -  
126 - loop_result.setTtInfoMapLoop(new HashMap());  
127 - loop_result.setTtInfoMap(new HashMap());  
128 -  
129 - com.google.common.collect.Multimap ttInfoMap_temp =  
130 - (com.google.common.collect.Multimap)  
131 - $param.getTtInfoResults_output().getResults().get(  
132 - String.valueOf($xlId));  
133 -  
134 - loop_result.setTtInfoMapLoop_temp(ttInfoMap_temp.asMap());  
135 -  
136 - insert(loop_result);  
137 -  
138 -// log.info("calcu_step1_Loop_result");  
139 -end  
140 -  
141 -rule "calcu_step2_loop_result"  
142 - salience 1000  
143 - no-loop  
144 - when  
145 - $param: PlanCalcuParam_input($xlId: xlId)  
146 - $lr: Loop_result(xlId == $xlId)  
147 - $sd: DateTime() from $lr.ttInfoMapLoop_temp.keySet()  
148 - then  
149 - // 当天时刻表只取第一张 TODO:  
150 - Collection col = (Collection) $lr.getTtInfoMapLoop_temp().get($sd);  
151 - Iterator iter = col.iterator();  
152 - TTInfoResult_output ttInfo_result = (TTInfoResult_output) iter.next();  
153 - $lr.getTtInfoMapLoop().put($sd, ttInfo_result);  
154 -  
155 - // 总共使用的时刻表  
156 - $lr.getTtInfoMap().put(ttInfo_result.getTtInfoId(), ttInfo_result);  
157 -  
158 - update($lr);  
159 -  
160 -// log.info("calcu_step2_Loop_result");  
161 -end  
162 -  
163 -//-------------------- 第二阶段、将时刻表班次,车辆配置,人员配置信息载入 -----------------//  
164 -  
165 -//--------------- 车辆配置信息载入 -------------//  
166 -declare CarConfig_Wraps  
167 - xlId: String // 线路Id  
168 - ccMap: Map // 车辆配置Map Map<id, CarConfigInfo>  
169 -end  
170 -  
171 -rule "calcu_CarConfig_Wraps"  
172 - salience 800  
173 - when  
174 - $lr: Loop_result($xlId: xlId)  
175 - then  
176 - List carConfigInfos = carConfigInfoRepository.findByXlId(Integer.parseInt($xlId));  
177 -  
178 - CarConfig_Wraps carConfig_wraps = new CarConfig_Wraps();  
179 - carConfig_wraps.setXlId($xlId);  
180 - carConfig_wraps.setCcMap(new HashMap());  
181 -  
182 - for (int i = 0; i < carConfigInfos.size(); i++) {  
183 - CarConfigInfo carConfigInfo = (CarConfigInfo) carConfigInfos.get(i);  
184 - carConfig_wraps.getCcMap().put(carConfigInfo.getId().toString(), carConfigInfo);  
185 - }  
186 -  
187 - insert(carConfig_wraps);  
188 -  
189 - log.info("calcu_CarConfig_Wrap");  
190 -end  
191 -  
192 -//--------------- 人员配置信息载入 --------------//  
193 -declare EmployeeConfig_Wraps  
194 - xlId: String // 线路Id  
195 - ecMap: Map // 人员配置Map Map<id, EmployeeConfigInfo>  
196 -end  
197 -  
198 -rule "calcu_EmployeeConfig_Wraps"  
199 - salience 800  
200 - when  
201 - $lr: Loop_result($xlId: xlId)  
202 - then  
203 - List employeeConfigInfos = employeeConfigInfoRepository.findByXlId(Integer.parseInt($xlId));  
204 -  
205 - EmployeeConfig_Wraps employeeConfig_wraps = new EmployeeConfig_Wraps();  
206 - employeeConfig_wraps.setXlId($xlId);  
207 - employeeConfig_wraps.setEcMap(new HashMap());  
208 -  
209 - for (int i = 0; i < employeeConfigInfos.size(); i++) {  
210 - EmployeeConfigInfo employeeConfigInfo = (EmployeeConfigInfo) employeeConfigInfos.get(i);  
211 - employeeConfig_wraps.getEcMap().put(employeeConfigInfo.getId().toString(), employeeConfigInfo);  
212 - }  
213 -  
214 - insert(employeeConfig_wraps);  
215 -  
216 - log.info("calcu_EmployeeConfig_Wrap");  
217 -end  
218 -  
219 -//----------------- 时刻表班次信息载入 -----------------//  
220 -declare TTInfo_gid_stat  
221 - xlId: String // 线路id(cast字符串-方便比较)  
222 - ttInfoId: String // 时刻表id(cast字符串-方便比较)  
223 - gid: String // 路牌id(cast字符串-方便比较)  
224 -  
225 - maxFcno: Integer // 最大发车顺序号  
226 -  
227 - fbTime: LocalTime // 分班时间  
228 - fbfcno: Integer // 分班发车顺序号  
229 -end  
230 -  
231 -rule "calcu_TTInfo_gid_stat"  
232 - salience 800  
233 - when  
234 - $lr: Loop_result($xlId: xlId)  
235 - $ttInfoId: String() from $lr.getTtInfoMap().keySet()  
236 - $gids: List() from accumulate ($ttd: TTInfoDetail() from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), gidscount($ttd))  
237 - $gid: String() from $gids  
238 - $fbtime_str: String() from accumulate ($ttd: TTInfoDetail(lp.id.toString() == $gid) from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), gidfbtime($ttd))  
239 - $fbfcno: Integer() from accumulate ($ttd: TTInfoDetail(lp.id.toString() == $gid) from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), gidfbfcno($ttd))  
240 - $maxfcno: Double() from accumulate ($ttd: TTInfoDetail(lp.id.toString() == $gid) from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), max($ttd.getFcno()))  
241 - then  
242 - TTInfo_gid_stat ttInfo_gid_stat = new TTInfo_gid_stat();  
243 - ttInfo_gid_stat.setXlId($xlId);  
244 - ttInfo_gid_stat.setTtInfoId($ttInfoId);  
245 - ttInfo_gid_stat.setGid($gid);  
246 -  
247 - ttInfo_gid_stat.setMaxFcno($maxfcno.intValue());  
248 - ttInfo_gid_stat.setFbTime(fcsjTime($fbtime_str));  
249 - ttInfo_gid_stat.setFbfcno($fbfcno);  
250 -  
251 - insert(ttInfo_gid_stat);  
252 -  
253 -// log.info("xlid={},ttid={},gid={},maxfcno={},fbtime={},fbfcno={}",  
254 -// $xlId, $ttInfoId, $gid, ttInfo_gid_stat.getMaxFcno(), ttInfo_gid_stat.getFbTime(), ttInfo_gid_stat.getFbfcno());  
255 -  
256 -end  
257 -  
258 -declare TTInfoDetail_Wrap  
259 - isFirstBc: Boolean = false // 是否是当前路牌的第一个班次  
260 - isLastBc: Boolean = false // 是否是当前路牌的最后一个班次  
261 - isFb: Boolean = false // 是否分班  
262 -  
263 - self: TTInfoDetail // 原始数据  
264 -end  
265 -  
266 -declare TTInfoDetail_Wraps  
267 - xlId: String // 线路id(cast字符串-方便比较)  
268 - ttInfoId: String // 时刻表id(cast字符串-方便比较)  
269 -  
270 - detailsMap: Map // 明细Map,Map<路牌id, List<TTInfoDetail_Wrap>>  
271 -end  
272 -  
273 -rule "calcu_TTInfoDetail_Wraps"  
274 - salience 700  
275 - when  
276 - $lr: Loop_result($xlId: xlId)  
277 - $ttInfoId: String() from $lr.getTtInfoMap().keySet()  
278 - $ttInfoStatList: List(size > 0) from collect (TTInfo_gid_stat(ttInfoId == $ttInfoId))  
279 - then  
280 - TTInfoDetail_Wraps ttInfoDetail_wraps = new TTInfoDetail_Wraps();  
281 - ttInfoDetail_wraps.setXlId($xlId);  
282 - ttInfoDetail_wraps.setTtInfoId($ttInfoId);  
283 - ttInfoDetail_wraps.setDetailsMap(new HashMap());  
284 -  
285 - // 将list的形式变成 Map<路牌id, TTInfo_gid_stat>  
286 - Map statMap = new HashMap();  
287 - for (int i = 0; i < $ttInfoStatList.size(); i++) {  
288 - TTInfo_gid_stat ttInfo_gid_stat = (TTInfo_gid_stat) $ttInfoStatList.get(i);  
289 - statMap.put(ttInfo_gid_stat.getGid(), ttInfo_gid_stat);  
290 - }  
291 -  
292 - // 迭代ttinfodetail,拼装 TTInfoDetail_Wraps  
293 - List detaillist = tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId));  
294 - for (int j = 0; j < detaillist.size(); j++) {  
295 - TTInfoDetail ttInfoDetail = (TTInfoDetail) detaillist.get(j);  
296 - String gid = String.valueOf(ttInfoDetail.getLp().getId());  
297 -  
298 - if (ttInfoDetail_wraps.getDetailsMap().get(gid) == null) {  
299 - ttInfoDetail_wraps.getDetailsMap().put(gid, new ArrayList());  
300 - }  
301 -  
302 - // 获取stat  
303 - TTInfo_gid_stat ttInfo_gid_stat = (TTInfo_gid_stat) statMap.get(gid);  
304 -  
305 - TTInfoDetail_Wrap ttInfoDetail_wrap = new TTInfoDetail_Wrap();  
306 - ttInfoDetail_wrap.setIsFirstBc(1 == ttInfoDetail.getFcno());  
307 - ttInfoDetail_wrap.setIsLastBc(ttInfo_gid_stat.getMaxFcno() == ttInfoDetail.getFcno());  
308 -  
309 - LocalTime fcsj = fcsjTime(ttInfoDetail.getFcsj());  
310 - LocalTime fbsj = ttInfo_gid_stat.getFbTime();  
311 - Integer fbfcno = ttInfo_gid_stat.getFbfcno();  
312 - // 不用时间判定,因为有的路牌,后面的班次都是凌晨的,时间反而比分班时间早,不合理,所以使用发车顺序号做第二次比较  
313 -// ttInfoDetail_wrap.setIsFb(fbsj == null ? false : (fcsj.isEqual(fbsj) || fcsj.isAfter(fbsj)));  
314 - ttInfoDetail_wrap.setIsFb(fbsj == null ? false : ttInfoDetail.getFcno() >= fbfcno);  
315 -  
316 - ttInfoDetail_wrap.setSelf(ttInfoDetail);  
317 -  
318 - ((List) ttInfoDetail_wraps.getDetailsMap().get(gid)).add(ttInfoDetail_wrap);  
319 -  
320 - }  
321 -  
322 -  
323 - insert(ttInfoDetail_wraps);  
324 -  
325 - log.info("xlid={}, ttinfoid={}, lpstatCount={}, detailLpCount={}",  
326 - $xlId, $ttInfoId, $ttInfoStatList.size(), ttInfoDetail_wraps.getDetailsMap().keySet().size());  
327 -  
328 -  
329 -end  
330 -  
331 -declare TTInfoDetail_Wraps_map  
332 - xlId: String // 线路id(cast字符串-方便比较)  
333 -  
334 - wrapsMap: Map // 明细Map,Map<时刻表Id, TTInfoDetail_Wraps>  
335 -end  
336 -  
337 -rule "calcu_TTInfoDetail_Wraps_toMap"  
338 - salience 600  
339 - when  
340 - $lr: Loop_result($xlId: xlId)  
341 - $wrapsList: List(size > 0) from collect (TTInfoDetail_Wraps(xlId == $xlId))  
342 - then  
343 - // 转换成Map  
344 - TTInfoDetail_Wraps_map all = new TTInfoDetail_Wraps_map();  
345 - all.setXlId($xlId);  
346 - all.setWrapsMap(new HashMap());  
347 -  
348 - for (int i = 0; i < $wrapsList.size(); i++) {  
349 - TTInfoDetail_Wraps ttInfoDetail_wraps = (TTInfoDetail_Wraps) $wrapsList.get(i);  
350 - all.getWrapsMap().put(ttInfoDetail_wraps.getTtInfoId(), ttInfoDetail_wraps);  
351 - }  
352 -  
353 - insert(all);  
354 -end  
355 -  
356 -  
357 -  
358 -  
359 -//-------------------- 第三阶段、合并计算SchedulePlanInfo -----------------//  
360 -  
361 -  
362 -rule "Calcu_SchedulePlanInfo"  
363 - salience 500  
364 - when  
365 - $param: PlanCalcuParam_input($xlId: xlId)  
366 - $lr: Loop_result(xlId == $xlId)  
367 - $ccs: CarConfig_Wraps(xlId == $xlId)  
368 - $ecs: EmployeeConfig_Wraps(xlId == $xlId)  
369 - $tts: TTInfoDetail_Wraps_map(xlId == $xlId)  
370 - then  
371 - // 线路  
372 - Line xl = lineRepository.findOne(Integer.parseInt($xlId));  
373 -  
374 - // 查找公司  
375 - List gses = (List) businessRepository.findAll();  
376 - // 构造公司代码对应map  
377 - Map gsMap = gsMap(gses);  
378 - // 构造分公司对应的map  
379 - Map fgsMap = fgsMap(gses);  
380 -  
381 - for (int i = 0; i < $lr.getRuleLoop().size(); i++) {  
382 - ScheduleResult_output sro = (ScheduleResult_output) $lr.getRuleLoop().get(i);  
383 -  
384 - // 日期  
385 - DateTime sd = sro.getSd();  
386 - // 路牌  
387 - String gid = sro.getGuideboardId();  
388 - // 车辆配置  
389 - CarConfigInfo carConfigInfo = sro.getsType() == ScheduleRule_Type.NORMAL ?  
390 - (CarConfigInfo) $ccs.getCcMap().get(sro.getCarConfigId()) : null;  
391 - // 人员配置  
392 - List eclist = sro.getsType() == ScheduleRule_Type.NORMAL ?  
393 - ecList(employeeConfigInfoRepository, sro.getEmployeeConfigId()) : null;  
394 -  
395 - // 时刻表id  
396 - String ttInfoId = ttInfoId_sd($lr.getTtInfoMapLoop(), sd);  
397 - TTInfoDetail_Wraps ttInfoDetail_wraps = (TTInfoDetail_Wraps) $tts.getWrapsMap().get(ttInfoId);  
398 - if (ttInfoDetail_wraps == null) {  
399 - // 时刻表为空,直接跳过  
400 - // 如1118路,周末不开,此是时刻表指定一个空表  
401 - // TODO:这个以后要改的,选时刻表的规则要修正,没有默认的时刻表  
402 - continue;  
403 - }  
404 -  
405 - List detaillist = (List) ttInfoDetail_wraps.getDetailsMap().get(gid);  
406 - if (detaillist == null) {  
407 - // 这里翻到的路牌时刻表里可能没有,  
408 - // 因为没有考虑翻班格式(就是做几休几)  
409 - // 所有翻班格式全由时刻表决定,即时刻表有的路牌就做,没有不做  
410 - continue;  
411 - }  
412 -  
413 - for (int j = 0; j < detaillist.size(); j++) {  
414 - TTInfoDetail_Wrap wrap = (TTInfoDetail_Wrap) detaillist.get(j);  
415 -  
416 - SchedulePlanInfo schedulePlanInfo = new SchedulePlanInfo(  
417 - xl,  
418 - sro,  
419 - wrap.getSelf(),  
420 - wrap.getIsFb(),  
421 - carConfigInfo,  
422 - eclist,  
423 - $param.getSchedulePlan(),  
424 - wrap.getIsFirstBc(),  
425 - wrap.getIsLastBc(),  
426 - sro.getsType()  
427 - );  
428 -  
429 - // 获取公司,分公司信息  
430 - String gsbm = xl.getCompany();  
431 - String fgsbm = xl.getBrancheCompany();  
432 - Business gs = null;  
433 - Business fgs = null;  
434 -  
435 - if (StringUtils.isNotEmpty(gsbm)) {  
436 - gs = (Business) gsMap.get(gsbm);  
437 - }  
438 - if (StringUtils.isNotEmpty(gsbm) && StringUtils.isNotEmpty(fgsbm)) {  
439 - fgs = (Business) fgsMap.get(gsbm + "_" + fgsbm);  
440 - }  
441 -  
442 - if (gs != null) {  
443 - schedulePlanInfo.setGsBm(gs.getBusinessCode());  
444 - schedulePlanInfo.setGsName(gs.getBusinessName());  
445 - }  
446 - if (fgs != null) {  
447 - schedulePlanInfo.setFgsBm(fgs.getBusinessCode());  
448 - schedulePlanInfo.setFgsName(fgs.getBusinessName());  
449 - }  
450 -  
451 - // 操作人,操作时间  
452 - schedulePlanInfo.setCreateBy($param.getSchedulePlan().getCreateBy());  
453 - schedulePlanInfo.setCreateDate($param.getSchedulePlan().getCreateDate());  
454 - schedulePlanInfo.setUpdateBy($param.getSchedulePlan().getUpdateBy());  
455 - schedulePlanInfo.setUpdateDate($param.getSchedulePlan().getUpdateDate());  
456 -  
457 - // result 输出  
458 - planResult.getSchedulePlanInfos().add(schedulePlanInfo);  
459 -  
460 - }  
461 -  
462 - }  
463 -  
464 - log.info("xlid={} plan ok!", $xlId);  
465 -  
466 -end  
467 -  
468 -  
469 -  
470 -  
471 -  
472 -  
473 -  
474 -  
475 -  
476 -  
477 -  
478 -  
479 -  
480 - 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.plan;
  2 +
  3 +import org.joda.time.*;
  4 +import java.util.*;
  5 +
  6 +import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanCalcuParam_input;
  7 +import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanResult;
  8 +
  9 +import com.bsth.repository.schedule.TTInfoDetailRepository;
  10 +import com.bsth.repository.schedule.CarConfigInfoRepository;
  11 +import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
  12 +import com.bsth.repository.LineRepository;
  13 +import com.bsth.repository.BusinessRepository;
  14 +
  15 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;
  16 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;
  17 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResult_output;
  18 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResults_output;
  19 +import com.bsth.entity.Line;
  20 +import com.bsth.entity.Business;
  21 +
  22 +import com.bsth.entity.schedule.CarConfigInfo;
  23 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  24 +import com.bsth.entity.schedule.TTInfo;
  25 +import com.bsth.entity.schedule.TTInfoDetail;
  26 +import com.bsth.entity.schedule.SchedulePlanInfo;
  27 +
  28 +import org.slf4j.Logger
  29 +import org.joda.time.format.DateTimeFormat
  30 +import org.apache.commons.lang3.StringUtils
  31 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_Type;
  32 +
  33 +
  34 +// 全局日志类(一般使用调用此规则的service类)
  35 +global Logger log;
  36 +
  37 +global TTInfoDetailRepository tTInfoDetailRepository;
  38 +global CarConfigInfoRepository carConfigInfoRepository;
  39 +global EmployeeConfigInfoRepository employeeConfigInfoRepository;
  40 +global LineRepository lineRepository;
  41 +global BusinessRepository businessRepository;
  42 +
  43 +// 输出
  44 +global PlanResult planResult;
  45 +
  46 +function Map xlidParams(String xlid) {
  47 + Map param = new HashMap();
  48 + param.put("xl.id_eq", Integer.valueOf(xlid));
  49 + return param;
  50 +}
  51 +
  52 +function List ecList(EmployeeConfigInfoRepository repo, String ecids) {
  53 + List<String> ids = Arrays.asList(ecids.split("-"));
  54 + List rst = new ArrayList();
  55 + for (int i = 0; i < ids.size(); i++) {
  56 + rst.add(repo.findOne(Long.parseLong(ids.get(i))));
  57 + }
  58 + return rst;
  59 +}
  60 +
  61 +function LocalTime fcsjTime(String fcsj) {
  62 + if ("NULL".equals(fcsj)) {
  63 + return null;
  64 + }
  65 + return LocalTime.parse(fcsj, DateTimeFormat.forPattern("HH:mm"));
  66 +}
  67 +
  68 +function String ttInfoId_sd(Map map, DateTime sd) {
  69 + TTInfoResult_output ttInfoResult_output = (TTInfoResult_output) map.get(sd);
  70 + return ttInfoResult_output.getTtInfoId();
  71 +}
  72 +
  73 +function Map gsMap(List gses) {
  74 + Map gsMap = new HashMap();
  75 + for (int i = 0; i < gses.size(); i++) {
  76 + Business gs = (Business) gses.get(i);
  77 + if (StringUtils.isNotEmpty(gs.getBusinessCode())) {
  78 + if ("88".equals(gs.getUpCode())) { // 浦东公交
  79 + gsMap.put(gs.getBusinessCode(), gs);
  80 + }
  81 + if (gs.getBusinessCode().equals(gs.getUpCode())) { // 闵行,青浦
  82 + gsMap.put(gs.getBusinessCode(), gs);
  83 + }
  84 + }
  85 + }
  86 + return gsMap;
  87 +}
  88 +
  89 +function Map fgsMap(List gses) {
  90 + // 这里简单将 businessCode和upCode合并
  91 + Map fgsMap = new HashMap();
  92 + for (int i = 0; i < gses.size(); i++) {
  93 + Business gs = (Business) gses.get(i);
  94 + if (StringUtils.isNotEmpty(gs.getBusinessCode()) && StringUtils.isNotEmpty(gs.getUpCode())) {
  95 + fgsMap.put(gs.getUpCode() + "_" + gs.getBusinessCode(), gs);
  96 + }
  97 + }
  98 + return fgsMap;
  99 +}
  100 +
  101 +/*
  102 + 规则说明:
  103 + 根据循环规则输出,时刻表选择规则输出,组合计算排班明细
  104 +*/
  105 +
  106 +//-------------------- 第一阶段、计算迭代数据 -----------------//
  107 +declare Loop_result
  108 + xlId: String // 线路id
  109 +
  110 + ruleLoop: List // 每天分配的规则 List<ScheduleResult_output>
  111 +
  112 + ttInfoMapLoop_temp: Map // 每天分配的时刻表 Map<DataTime, Collection<TTInfoResult_output>>
  113 + ttInfoMapLoop: Map // 每天分配的时刻表 Map<DataTime, TTInfoResult_output>
  114 + ttInfoMap: Map // 总共用到的时刻表 Map<id, TTInfoResult_output>
  115 +end
  116 +
  117 +rule "calcu_step1_Loop_result"
  118 + salience 1000
  119 + when
  120 + $param: PlanCalcuParam_input($xlId: xlId)
  121 + then
  122 + Loop_result loop_result = new Loop_result();
  123 + loop_result.setXlId($xlId);
  124 + loop_result.setRuleLoop($param.getScheduleResults_output().getResults());
  125 +
  126 + loop_result.setTtInfoMapLoop(new HashMap());
  127 + loop_result.setTtInfoMap(new HashMap());
  128 +
  129 + com.google.common.collect.Multimap ttInfoMap_temp =
  130 + (com.google.common.collect.Multimap)
  131 + $param.getTtInfoResults_output().getResults().get(
  132 + String.valueOf($xlId));
  133 +
  134 + loop_result.setTtInfoMapLoop_temp(ttInfoMap_temp.asMap());
  135 +
  136 + insert(loop_result);
  137 +
  138 +// log.info("calcu_step1_Loop_result");
  139 +end
  140 +
  141 +rule "calcu_step2_loop_result"
  142 + salience 1000
  143 + no-loop
  144 + when
  145 + $param: PlanCalcuParam_input($xlId: xlId)
  146 + $lr: Loop_result(xlId == $xlId)
  147 + $sd: DateTime() from $lr.ttInfoMapLoop_temp.keySet()
  148 + then
  149 + // 当天时刻表只取第一张 TODO:
  150 + Collection col = (Collection) $lr.getTtInfoMapLoop_temp().get($sd);
  151 + Iterator iter = col.iterator();
  152 + TTInfoResult_output ttInfo_result = (TTInfoResult_output) iter.next();
  153 + $lr.getTtInfoMapLoop().put($sd, ttInfo_result);
  154 +
  155 + // 总共使用的时刻表
  156 + $lr.getTtInfoMap().put(ttInfo_result.getTtInfoId(), ttInfo_result);
  157 +
  158 + update($lr);
  159 +
  160 +// log.info("calcu_step2_Loop_result");
  161 +end
  162 +
  163 +//-------------------- 第二阶段、将时刻表班次,车辆配置,人员配置信息载入 -----------------//
  164 +
  165 +//--------------- 车辆配置信息载入 -------------//
  166 +declare CarConfig_Wraps
  167 + xlId: String // 线路Id
  168 + ccMap: Map // 车辆配置Map Map<id, CarConfigInfo>
  169 +end
  170 +
  171 +rule "calcu_CarConfig_Wraps"
  172 + salience 800
  173 + when
  174 + $lr: Loop_result($xlId: xlId)
  175 + then
  176 + List carConfigInfos = carConfigInfoRepository.findByXlId(Integer.parseInt($xlId));
  177 +
  178 + CarConfig_Wraps carConfig_wraps = new CarConfig_Wraps();
  179 + carConfig_wraps.setXlId($xlId);
  180 + carConfig_wraps.setCcMap(new HashMap());
  181 +
  182 + for (int i = 0; i < carConfigInfos.size(); i++) {
  183 + CarConfigInfo carConfigInfo = (CarConfigInfo) carConfigInfos.get(i);
  184 + carConfig_wraps.getCcMap().put(carConfigInfo.getId().toString(), carConfigInfo);
  185 + }
  186 +
  187 + insert(carConfig_wraps);
  188 +
  189 + log.info("calcu_CarConfig_Wrap");
  190 +end
  191 +
  192 +//--------------- 人员配置信息载入 --------------//
  193 +declare EmployeeConfig_Wraps
  194 + xlId: String // 线路Id
  195 + ecMap: Map // 人员配置Map Map<id, EmployeeConfigInfo>
  196 +end
  197 +
  198 +rule "calcu_EmployeeConfig_Wraps"
  199 + salience 800
  200 + when
  201 + $lr: Loop_result($xlId: xlId)
  202 + then
  203 + List employeeConfigInfos = employeeConfigInfoRepository.findByXlId(Integer.parseInt($xlId));
  204 +
  205 + EmployeeConfig_Wraps employeeConfig_wraps = new EmployeeConfig_Wraps();
  206 + employeeConfig_wraps.setXlId($xlId);
  207 + employeeConfig_wraps.setEcMap(new HashMap());
  208 +
  209 + for (int i = 0; i < employeeConfigInfos.size(); i++) {
  210 + EmployeeConfigInfo employeeConfigInfo = (EmployeeConfigInfo) employeeConfigInfos.get(i);
  211 + employeeConfig_wraps.getEcMap().put(employeeConfigInfo.getId().toString(), employeeConfigInfo);
  212 + }
  213 +
  214 + insert(employeeConfig_wraps);
  215 +
  216 + log.info("calcu_EmployeeConfig_Wrap");
  217 +end
  218 +
  219 +//----------------- 时刻表班次信息载入 -----------------//
  220 +declare TTInfo_gid_stat
  221 + xlId: String // 线路id(cast字符串-方便比较)
  222 + ttInfoId: String // 时刻表id(cast字符串-方便比较)
  223 + gid: String // 路牌id(cast字符串-方便比较)
  224 +
  225 + maxFcno: Integer // 最大发车顺序号
  226 +
  227 + fbTime: LocalTime // 分班时间
  228 + fbfcno: Integer // 分班发车顺序号
  229 +end
  230 +
  231 +rule "calcu_TTInfo_gid_stat"
  232 + salience 800
  233 + when
  234 + $lr: Loop_result($xlId: xlId)
  235 + $ttInfoId: String() from $lr.getTtInfoMap().keySet()
  236 + $gids: List() from accumulate ($ttd: TTInfoDetail() from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), gidscount($ttd))
  237 + $gid: String() from $gids
  238 + $fbtime_str: String() from accumulate ($ttd: TTInfoDetail(lp.id.toString() == $gid) from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), gidfbtime($ttd))
  239 + $fbfcno: Integer() from accumulate ($ttd: TTInfoDetail(lp.id.toString() == $gid) from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), gidfbfcno($ttd))
  240 + $maxfcno: Double() from accumulate ($ttd: TTInfoDetail(lp.id.toString() == $gid) from tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId)), max($ttd.getFcno()))
  241 + then
  242 + TTInfo_gid_stat ttInfo_gid_stat = new TTInfo_gid_stat();
  243 + ttInfo_gid_stat.setXlId($xlId);
  244 + ttInfo_gid_stat.setTtInfoId($ttInfoId);
  245 + ttInfo_gid_stat.setGid($gid);
  246 +
  247 + ttInfo_gid_stat.setMaxFcno($maxfcno.intValue());
  248 + ttInfo_gid_stat.setFbTime(fcsjTime($fbtime_str));
  249 + ttInfo_gid_stat.setFbfcno($fbfcno);
  250 +
  251 + insert(ttInfo_gid_stat);
  252 +
  253 +// log.info("xlid={},ttid={},gid={},maxfcno={},fbtime={},fbfcno={}",
  254 +// $xlId, $ttInfoId, $gid, ttInfo_gid_stat.getMaxFcno(), ttInfo_gid_stat.getFbTime(), ttInfo_gid_stat.getFbfcno());
  255 +
  256 +end
  257 +
  258 +declare TTInfoDetail_Wrap
  259 + isFirstBc: Boolean = false // 是否是当前路牌的第一个班次
  260 + isLastBc: Boolean = false // 是否是当前路牌的最后一个班次
  261 + isFb: Boolean = false // 是否分班
  262 +
  263 + self: TTInfoDetail // 原始数据
  264 +end
  265 +
  266 +declare TTInfoDetail_Wraps
  267 + xlId: String // 线路id(cast字符串-方便比较)
  268 + ttInfoId: String // 时刻表id(cast字符串-方便比较)
  269 +
  270 + detailsMap: Map // 明细Map,Map<路牌id, List<TTInfoDetail_Wrap>>
  271 +end
  272 +
  273 +rule "calcu_TTInfoDetail_Wraps"
  274 + salience 700
  275 + when
  276 + $lr: Loop_result($xlId: xlId)
  277 + $ttInfoId: String() from $lr.getTtInfoMap().keySet()
  278 + $ttInfoStatList: List(size > 0) from collect (TTInfo_gid_stat(ttInfoId == $ttInfoId))
  279 + then
  280 + TTInfoDetail_Wraps ttInfoDetail_wraps = new TTInfoDetail_Wraps();
  281 + ttInfoDetail_wraps.setXlId($xlId);
  282 + ttInfoDetail_wraps.setTtInfoId($ttInfoId);
  283 + ttInfoDetail_wraps.setDetailsMap(new HashMap());
  284 +
  285 + // 将list的形式变成 Map<路牌id, TTInfo_gid_stat>
  286 + Map statMap = new HashMap();
  287 + for (int i = 0; i < $ttInfoStatList.size(); i++) {
  288 + TTInfo_gid_stat ttInfo_gid_stat = (TTInfo_gid_stat) $ttInfoStatList.get(i);
  289 + statMap.put(ttInfo_gid_stat.getGid(), ttInfo_gid_stat);
  290 + }
  291 +
  292 + // 迭代ttinfodetail,拼装 TTInfoDetail_Wraps
  293 + List detaillist = tTInfoDetailRepository.findByTtinfoId(Long.parseLong($ttInfoId));
  294 + for (int j = 0; j < detaillist.size(); j++) {
  295 + TTInfoDetail ttInfoDetail = (TTInfoDetail) detaillist.get(j);
  296 + String gid = String.valueOf(ttInfoDetail.getLp().getId());
  297 +
  298 + if (ttInfoDetail_wraps.getDetailsMap().get(gid) == null) {
  299 + ttInfoDetail_wraps.getDetailsMap().put(gid, new ArrayList());
  300 + }
  301 +
  302 + // 获取stat
  303 + TTInfo_gid_stat ttInfo_gid_stat = (TTInfo_gid_stat) statMap.get(gid);
  304 +
  305 + TTInfoDetail_Wrap ttInfoDetail_wrap = new TTInfoDetail_Wrap();
  306 + ttInfoDetail_wrap.setIsFirstBc(1 == ttInfoDetail.getFcno());
  307 + ttInfoDetail_wrap.setIsLastBc(ttInfo_gid_stat.getMaxFcno() == ttInfoDetail.getFcno());
  308 +
  309 + LocalTime fcsj = fcsjTime(ttInfoDetail.getFcsj());
  310 + LocalTime fbsj = ttInfo_gid_stat.getFbTime();
  311 + Integer fbfcno = ttInfo_gid_stat.getFbfcno();
  312 + // 不用时间判定,因为有的路牌,后面的班次都是凌晨的,时间反而比分班时间早,不合理,所以使用发车顺序号做第二次比较
  313 +// ttInfoDetail_wrap.setIsFb(fbsj == null ? false : (fcsj.isEqual(fbsj) || fcsj.isAfter(fbsj)));
  314 + ttInfoDetail_wrap.setIsFb(fbsj == null ? false : ttInfoDetail.getFcno() >= fbfcno);
  315 +
  316 + ttInfoDetail_wrap.setSelf(ttInfoDetail);
  317 +
  318 + ((List) ttInfoDetail_wraps.getDetailsMap().get(gid)).add(ttInfoDetail_wrap);
  319 +
  320 + }
  321 +
  322 +
  323 + insert(ttInfoDetail_wraps);
  324 +
  325 + log.info("xlid={}, ttinfoid={}, lpstatCount={}, detailLpCount={}",
  326 + $xlId, $ttInfoId, $ttInfoStatList.size(), ttInfoDetail_wraps.getDetailsMap().keySet().size());
  327 +
  328 +
  329 +end
  330 +
  331 +declare TTInfoDetail_Wraps_map
  332 + xlId: String // 线路id(cast字符串-方便比较)
  333 +
  334 + wrapsMap: Map // 明细Map,Map<时刻表Id, TTInfoDetail_Wraps>
  335 +end
  336 +
  337 +rule "calcu_TTInfoDetail_Wraps_toMap"
  338 + salience 600
  339 + when
  340 + $lr: Loop_result($xlId: xlId)
  341 + $wrapsList: List(size > 0) from collect (TTInfoDetail_Wraps(xlId == $xlId))
  342 + then
  343 + // 转换成Map
  344 + TTInfoDetail_Wraps_map all = new TTInfoDetail_Wraps_map();
  345 + all.setXlId($xlId);
  346 + all.setWrapsMap(new HashMap());
  347 +
  348 + for (int i = 0; i < $wrapsList.size(); i++) {
  349 + TTInfoDetail_Wraps ttInfoDetail_wraps = (TTInfoDetail_Wraps) $wrapsList.get(i);
  350 + all.getWrapsMap().put(ttInfoDetail_wraps.getTtInfoId(), ttInfoDetail_wraps);
  351 + }
  352 +
  353 + insert(all);
  354 +end
  355 +
  356 +
  357 +
  358 +
  359 +//-------------------- 第三阶段、合并计算SchedulePlanInfo -----------------//
  360 +
  361 +
  362 +rule "Calcu_SchedulePlanInfo"
  363 + salience 500
  364 + when
  365 + $param: PlanCalcuParam_input($xlId: xlId)
  366 + $lr: Loop_result(xlId == $xlId)
  367 + $ccs: CarConfig_Wraps(xlId == $xlId)
  368 + $ecs: EmployeeConfig_Wraps(xlId == $xlId)
  369 + $tts: TTInfoDetail_Wraps_map(xlId == $xlId)
  370 + then
  371 + // 线路
  372 + Line xl = lineRepository.findOne(Integer.parseInt($xlId));
  373 +
  374 + // 查找公司
  375 + List gses = (List) businessRepository.findAll();
  376 + // 构造公司代码对应map
  377 + Map gsMap = gsMap(gses);
  378 + // 构造分公司对应的map
  379 + Map fgsMap = fgsMap(gses);
  380 +
  381 + for (int i = 0; i < $lr.getRuleLoop().size(); i++) {
  382 + ScheduleResult_output sro = (ScheduleResult_output) $lr.getRuleLoop().get(i);
  383 +
  384 + // 日期
  385 + DateTime sd = sro.getSd();
  386 + // 路牌
  387 + String gid = sro.getGuideboardId();
  388 + // 车辆配置
  389 + CarConfigInfo carConfigInfo = sro.getsType() == ScheduleRule_Type.NORMAL ?
  390 + (CarConfigInfo) $ccs.getCcMap().get(sro.getCarConfigId()) : null;
  391 + // 人员配置
  392 + List eclist = sro.getsType() == ScheduleRule_Type.NORMAL ?
  393 + ecList(employeeConfigInfoRepository, sro.getEmployeeConfigId()) : null;
  394 +
  395 + // 时刻表id
  396 + String ttInfoId = ttInfoId_sd($lr.getTtInfoMapLoop(), sd);
  397 + TTInfoDetail_Wraps ttInfoDetail_wraps = (TTInfoDetail_Wraps) $tts.getWrapsMap().get(ttInfoId);
  398 + if (ttInfoDetail_wraps == null) {
  399 + // 时刻表为空,直接跳过
  400 + // 如1118路,周末不开,此是时刻表指定一个空表
  401 + // TODO:这个以后要改的,选时刻表的规则要修正,没有默认的时刻表
  402 + continue;
  403 + }
  404 +
  405 + List detaillist = (List) ttInfoDetail_wraps.getDetailsMap().get(gid);
  406 + if (detaillist == null) {
  407 + // 这里翻到的路牌时刻表里可能没有,
  408 + // 因为没有考虑翻班格式(就是做几休几)
  409 + // 所有翻班格式全由时刻表决定,即时刻表有的路牌就做,没有不做
  410 + continue;
  411 + }
  412 +
  413 + for (int j = 0; j < detaillist.size(); j++) {
  414 + TTInfoDetail_Wrap wrap = (TTInfoDetail_Wrap) detaillist.get(j);
  415 +
  416 + SchedulePlanInfo schedulePlanInfo = new SchedulePlanInfo(
  417 + xl,
  418 + sro,
  419 + wrap.getSelf(),
  420 + wrap.getIsFb(),
  421 + carConfigInfo,
  422 + eclist,
  423 + $param.getSchedulePlan(),
  424 + wrap.getIsFirstBc(),
  425 + wrap.getIsLastBc(),
  426 + sro.getsType()
  427 + );
  428 +
  429 + // 获取公司,分公司信息
  430 + String gsbm = xl.getCompany();
  431 + String fgsbm = xl.getBrancheCompany();
  432 + Business gs = null;
  433 + Business fgs = null;
  434 +
  435 + if (StringUtils.isNotEmpty(gsbm)) {
  436 + gs = (Business) gsMap.get(gsbm);
  437 + }
  438 + if (StringUtils.isNotEmpty(gsbm) && StringUtils.isNotEmpty(fgsbm)) {
  439 + fgs = (Business) fgsMap.get(gsbm + "_" + fgsbm);
  440 + }
  441 +
  442 + if (gs != null) {
  443 + schedulePlanInfo.setGsBm(gs.getBusinessCode());
  444 + schedulePlanInfo.setGsName(gs.getBusinessName());
  445 + }
  446 + if (fgs != null) {
  447 + schedulePlanInfo.setFgsBm(fgs.getBusinessCode());
  448 + schedulePlanInfo.setFgsName(fgs.getBusinessName());
  449 + }
  450 +
  451 + // 操作人,操作时间
  452 + schedulePlanInfo.setCreateBy($param.getSchedulePlan().getCreateBy());
  453 + schedulePlanInfo.setCreateDate($param.getSchedulePlan().getCreateDate());
  454 + schedulePlanInfo.setUpdateBy($param.getSchedulePlan().getUpdateBy());
  455 + schedulePlanInfo.setUpdateDate($param.getSchedulePlan().getUpdateDate());
  456 +
  457 + // result 输出
  458 + planResult.getSchedulePlanInfos().add(schedulePlanInfo);
  459 +
  460 + }
  461 +
  462 + }
  463 +
  464 + log.info("xlid={} plan ok!", $xlId);
  465 +
  466 +end
  467 +
  468 +
  469 +
  470 +
  471 +
  472 +
  473 +
  474 +
  475 +
  476 +
  477 +
  478 +
  479 +
  480 +
src/main/resources/rules/kBase1_core_rerun.drl
1 -package com.bsth.service.schedule.impl.plan.kBase1.core.rerun;  
2 -  
3 -import org.joda.time.*;  
4 -import java.util.*;  
5 -  
6 -import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;  
7 -import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;  
8 -  
9 -import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;  
10 -import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_param;  
11 -  
12 -import com.bsth.repository.schedule.CarConfigInfoRepository;  
13 -import com.bsth.repository.schedule.EmployeeConfigInfoRepository;  
14 -  
15 -import org.slf4j.Logger;  
16 -import com.bsth.entity.schedule.CarConfigInfo;  
17 -import java.util.HashMap;  
18 -import com.bsth.entity.schedule.EmployeeConfigInfo;  
19 -import com.bsth.entity.schedule.SchedulePlanInfo;  
20 -  
21 -// 全局日志类(一般使用调用此规则的service类)  
22 -global Logger log;  
23 -  
24 -global CarConfigInfoRepository carConfigInfoRepository;  
25 -global EmployeeConfigInfoRepository employeeConfigInfoRepository;  
26 -  
27 -// 输出  
28 -  
29 -  
30 -/*  
31 - 规则说明:  
32 - 1、对应路牌规则:将对应路牌的车辆,人员替换指定的套跑班次已有的配置  
33 - 2、对应班车规则:直接使用指定的人员,车辆替换指定的套跑班次已有的配置  
34 -*/  
35 -  
36 -//-------------------- 第一阶段、计算对应路牌套跑的车辆配置,人员配置数据 -----------------//  
37 -  
38 -//--------------- 车辆配置信息载入 -------------//  
39 -declare Dylp_CarConfig_Wraps  
40 - xlId: String // 线路Id  
41 - ccMap: Map // 车辆配置Map Map<id, CarConfigInfo>  
42 -end  
43 -  
44 -rule "calcu_Dylp_CarConfig_Wraps"  
45 - salience 1000  
46 - when  
47 - $rp: RerunRule_param($xlId: mxlid)  
48 - $dylpxlid: String() from $rp.getXlIds_dylp()  
49 - then  
50 - List carConfigInfos = carConfigInfoRepository.findByXlId(Integer.parseInt($dylpxlid));  
51 -  
52 - Dylp_CarConfig_Wraps carConfig_wraps = new Dylp_CarConfig_Wraps();  
53 - carConfig_wraps.setXlId($dylpxlid);  
54 - carConfig_wraps.setCcMap(new HashMap());  
55 -  
56 - for (int i = 0; i < carConfigInfos.size(); i++) {  
57 - CarConfigInfo carConfigInfo = (CarConfigInfo) carConfigInfos.get(i);  
58 - carConfig_wraps.getCcMap().put(carConfigInfo.getId().toString(), carConfigInfo);  
59 - }  
60 -  
61 - insert(carConfig_wraps);  
62 -  
63 - log.info("calcu_Dylp_CarConfig_Wraps");  
64 -  
65 -end  
66 -  
67 -//--------------- 人员配置信息载入 --------------//  
68 -declare Dylp_EmployeeConfig_Wraps  
69 - xlId: String // 线路Id  
70 - ecMap: Map // 人员配置Map Map<id, EmployeeConfigInfo>  
71 -end  
72 -  
73 -rule "calcu_Dylp_EmployeeConfig_Wraps"  
74 - salience 1000  
75 - when  
76 - $rp: RerunRule_param($xlId: mxlid)  
77 - $dylpxlid: String() from $rp.getXlIds_dylp()  
78 - then  
79 - List employeeConfigInfos = employeeConfigInfoRepository.findByXlId(Integer.parseInt($dylpxlid));  
80 -  
81 - Dylp_EmployeeConfig_Wraps employeeConfig_wraps = new Dylp_EmployeeConfig_Wraps();  
82 - employeeConfig_wraps.setXlId($dylpxlid);  
83 - employeeConfig_wraps.setEcMap(new HashMap());  
84 -  
85 - for (int i = 0; i < employeeConfigInfos.size(); i++) {  
86 - EmployeeConfigInfo employeeConfigInfo = (EmployeeConfigInfo) employeeConfigInfos.get(i);  
87 - employeeConfig_wraps.getEcMap().put(employeeConfigInfo.getId().toString(), employeeConfigInfo);  
88 - }  
89 -  
90 - insert(employeeConfig_wraps);  
91 -  
92 - log.info("calcu_Dylp_EmployeeConfig_Wraps");  
93 -  
94 -end  
95 -  
96 -//-------------------- 第二阶段、包装对应路牌的循环规则输出 -----------------//  
97 -  
98 -declare Dylp_ScheduleResult_output_wrap  
99 - xlId: String // 线路  
100 - sd: DateTime // 日期  
101 - lp: String // 路牌  
102 - cc: CarConfigInfo // 使用的车辆配置  
103 - ec: List // 使用的人员配置 List<EmployeeConfigInfo>  
104 -end  
105 -  
106 -rule "calcu_Dylp_ScheduleResult_output_wrap"  
107 - salience 900  
108 - when  
109 - $sro: ScheduleResults_output($xlId: xlid)  
110 - $sr: ScheduleResult_output() from $sro.getResults()  
111 - Dylp_CarConfig_Wraps(xlId == $xlId, $ccmap: ccMap)  
112 - Dylp_EmployeeConfig_Wraps(xlId == $xlId, $ecmap: ecMap)  
113 - then  
114 - Dylp_ScheduleResult_output_wrap wrap = new Dylp_ScheduleResult_output_wrap();  
115 - wrap.setXlId($xlId);  
116 - wrap.setSd($sr.getSd());  
117 - wrap.setLp($sr.getGuideboardId());  
118 - wrap.setCc((CarConfigInfo) $ccmap.get($sr.getCarConfigId()));  
119 -  
120 - List ecs = new ArrayList();  
121 - String[] ecids = $sr.getEmployeeConfigId().split("-"); // 分班的人  
122 - for (int i = 0; i < ecids.length; i++) {  
123 - ecs.add($ecmap.get(ecids[i]));  
124 - }  
125 - wrap.setEc(ecs);  
126 -  
127 -// log.info("xlid = {}", $xlId);  
128 -  
129 - insert(wrap);  
130 -end  
131 -  
132 -//-------------------- 第三阶段、套跑线路,替换班次的车辆,人员 --------------------//  
133 -rule "calcu_Dylp_rerun_update_dylp"  
134 - salience 800  
135 -// no-loop  
136 - when  
137 - $spi: SchedulePlanInfo($xlid: xl, $sd: scheduleDate, $lp: lp, $fcsj: fcsj, $ttinfo: ttInfo)  
138 - $ri: RerunRule_input(  
139 - type == "dylp",  
140 - xl == $xlid.toString(),  
141 - ttinfo == $ttinfo.toString(),  
142 - lp == $lp.toString(),  
143 - fcsj == $fcsj,  
144 - $sxl: s_xl, $slp: s_lp, $type: usetype, $hrtype: userhrtype  
145 - )  
146 - $dsro: Dylp_ScheduleResult_output_wrap(  
147 - xlId == $sxl,  
148 - lp == $slp,  
149 - sd.getMillis() == $sd.getTime()  
150 - )  
151 - then  
152 -// log.info("TODO:测试 {}", $fcsj);  
153 -  
154 - $spi.setRerunInfoDylp($dsro.getCc(), $dsro.getEc(), $type, $hrtype);  
155 -  
156 -end  
157 -  
158 -rule "calcu_Dylp_rerun_update_dybc"  
159 - salience 700  
160 - when  
161 - $spi: SchedulePlanInfo($xlid: xl, $sd: scheduleDate, $lp: lp, $fcsj: fcsj, $ttinfo: ttInfo)  
162 - $ri: RerunRule_input(  
163 - type == "dybc",  
164 - xl == $xlid.toString(),  
165 - ttinfo == $ttinfo.toString(),  
166 - lp == $lp.toString(),  
167 - fcsj == $fcsj  
168 - )  
169 -  
170 - then  
171 -  
172 - $spi.setRerunInfoDybc($ri);  
173 -  
174 -  
175 -end  
176 -  
177 -  
178 -  
179 -  
180 -  
181 -  
182 -  
183 -  
184 -  
185 -  
186 -  
187 -  
188 -  
189 -  
190 -  
191 -  
192 - 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.rerun;
  2 +
  3 +import org.joda.time.*;
  4 +import java.util.*;
  5 +
  6 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;
  7 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;
  8 +
  9 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;
  10 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_param;
  11 +
  12 +import com.bsth.repository.schedule.CarConfigInfoRepository;
  13 +import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
  14 +
  15 +import org.slf4j.Logger;
  16 +import com.bsth.entity.schedule.CarConfigInfo;
  17 +import java.util.HashMap;
  18 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  19 +import com.bsth.entity.schedule.SchedulePlanInfo;
  20 +
  21 +// 全局日志类(一般使用调用此规则的service类)
  22 +global Logger log;
  23 +
  24 +global CarConfigInfoRepository carConfigInfoRepository;
  25 +global EmployeeConfigInfoRepository employeeConfigInfoRepository;
  26 +
  27 +// 输出
  28 +
  29 +
  30 +/*
  31 + 规则说明:
  32 + 1、对应路牌规则:将对应路牌的车辆,人员替换指定的套跑班次已有的配置
  33 + 2、对应班车规则:直接使用指定的人员,车辆替换指定的套跑班次已有的配置
  34 +*/
  35 +
  36 +//-------------------- 第一阶段、计算对应路牌套跑的车辆配置,人员配置数据 -----------------//
  37 +
  38 +//--------------- 车辆配置信息载入 -------------//
  39 +declare Dylp_CarConfig_Wraps
  40 + xlId: String // 线路Id
  41 + ccMap: Map // 车辆配置Map Map<id, CarConfigInfo>
  42 +end
  43 +
  44 +rule "calcu_Dylp_CarConfig_Wraps"
  45 + salience 1000
  46 + when
  47 + $rp: RerunRule_param($xlId: mxlid)
  48 + $dylpxlid: String() from $rp.getXlIds_dylp()
  49 + then
  50 + List carConfigInfos = carConfigInfoRepository.findByXlId(Integer.parseInt($dylpxlid));
  51 +
  52 + Dylp_CarConfig_Wraps carConfig_wraps = new Dylp_CarConfig_Wraps();
  53 + carConfig_wraps.setXlId($dylpxlid);
  54 + carConfig_wraps.setCcMap(new HashMap());
  55 +
  56 + for (int i = 0; i < carConfigInfos.size(); i++) {
  57 + CarConfigInfo carConfigInfo = (CarConfigInfo) carConfigInfos.get(i);
  58 + carConfig_wraps.getCcMap().put(carConfigInfo.getId().toString(), carConfigInfo);
  59 + }
  60 +
  61 + insert(carConfig_wraps);
  62 +
  63 + log.info("calcu_Dylp_CarConfig_Wraps");
  64 +
  65 +end
  66 +
  67 +//--------------- 人员配置信息载入 --------------//
  68 +declare Dylp_EmployeeConfig_Wraps
  69 + xlId: String // 线路Id
  70 + ecMap: Map // 人员配置Map Map<id, EmployeeConfigInfo>
  71 +end
  72 +
  73 +rule "calcu_Dylp_EmployeeConfig_Wraps"
  74 + salience 1000
  75 + when
  76 + $rp: RerunRule_param($xlId: mxlid)
  77 + $dylpxlid: String() from $rp.getXlIds_dylp()
  78 + then
  79 + List employeeConfigInfos = employeeConfigInfoRepository.findByXlId(Integer.parseInt($dylpxlid));
  80 +
  81 + Dylp_EmployeeConfig_Wraps employeeConfig_wraps = new Dylp_EmployeeConfig_Wraps();
  82 + employeeConfig_wraps.setXlId($dylpxlid);
  83 + employeeConfig_wraps.setEcMap(new HashMap());
  84 +
  85 + for (int i = 0; i < employeeConfigInfos.size(); i++) {
  86 + EmployeeConfigInfo employeeConfigInfo = (EmployeeConfigInfo) employeeConfigInfos.get(i);
  87 + employeeConfig_wraps.getEcMap().put(employeeConfigInfo.getId().toString(), employeeConfigInfo);
  88 + }
  89 +
  90 + insert(employeeConfig_wraps);
  91 +
  92 + log.info("calcu_Dylp_EmployeeConfig_Wraps");
  93 +
  94 +end
  95 +
  96 +//-------------------- 第二阶段、包装对应路牌的循环规则输出 -----------------//
  97 +
  98 +declare Dylp_ScheduleResult_output_wrap
  99 + xlId: String // 线路
  100 + sd: DateTime // 日期
  101 + lp: String // 路牌
  102 + cc: CarConfigInfo // 使用的车辆配置
  103 + ec: List // 使用的人员配置 List<EmployeeConfigInfo>
  104 +end
  105 +
  106 +rule "calcu_Dylp_ScheduleResult_output_wrap"
  107 + salience 900
  108 + when
  109 + $sro: ScheduleResults_output($xlId: xlid)
  110 + $sr: ScheduleResult_output() from $sro.getResults()
  111 + Dylp_CarConfig_Wraps(xlId == $xlId, $ccmap: ccMap)
  112 + Dylp_EmployeeConfig_Wraps(xlId == $xlId, $ecmap: ecMap)
  113 + then
  114 + Dylp_ScheduleResult_output_wrap wrap = new Dylp_ScheduleResult_output_wrap();
  115 + wrap.setXlId($xlId);
  116 + wrap.setSd($sr.getSd());
  117 + wrap.setLp($sr.getGuideboardId());
  118 + wrap.setCc((CarConfigInfo) $ccmap.get($sr.getCarConfigId()));
  119 +
  120 + List ecs = new ArrayList();
  121 + String[] ecids = $sr.getEmployeeConfigId().split("-"); // 分班的人
  122 + for (int i = 0; i < ecids.length; i++) {
  123 + ecs.add($ecmap.get(ecids[i]));
  124 + }
  125 + wrap.setEc(ecs);
  126 +
  127 +// log.info("xlid = {}", $xlId);
  128 +
  129 + insert(wrap);
  130 +end
  131 +
  132 +//-------------------- 第三阶段、套跑线路,替换班次的车辆,人员 --------------------//
  133 +rule "calcu_Dylp_rerun_update_dylp"
  134 + salience 800
  135 +// no-loop
  136 + when
  137 + $spi: SchedulePlanInfo($xlid: xl, $sd: scheduleDate, $lp: lp, $fcsj: fcsj, $ttinfo: ttInfo)
  138 + $ri: RerunRule_input(
  139 + type == "dylp",
  140 + xl == $xlid.toString(),
  141 + ttinfo == $ttinfo.toString(),
  142 + lp == $lp.toString(),
  143 + fcsj == $fcsj,
  144 + $sxl: s_xl, $slp: s_lp, $type: usetype, $hrtype: userhrtype
  145 + )
  146 + $dsro: Dylp_ScheduleResult_output_wrap(
  147 + xlId == $sxl,
  148 + lp == $slp,
  149 + sd.getMillis() == $sd.getTime()
  150 + )
  151 + then
  152 +// log.info("TODO:测试 {}", $fcsj);
  153 +
  154 + $spi.setRerunInfoDylp($dsro.getCc(), $dsro.getEc(), $type, $hrtype);
  155 +
  156 +end
  157 +
  158 +rule "calcu_Dylp_rerun_update_dybc"
  159 + salience 700
  160 + when
  161 + $spi: SchedulePlanInfo($xlid: xl, $sd: scheduleDate, $lp: lp, $fcsj: fcsj, $ttinfo: ttInfo)
  162 + $ri: RerunRule_input(
  163 + type == "dybc",
  164 + xl == $xlid.toString(),
  165 + ttinfo == $ttinfo.toString(),
  166 + lp == $lp.toString(),
  167 + fcsj == $fcsj
  168 + )
  169 +
  170 + then
  171 +
  172 + $spi.setRerunInfoDybc($ri);
  173 +
  174 +
  175 +end
  176 +
  177 +
  178 +
  179 +
  180 +
  181 +
  182 +
  183 +
  184 +
  185 +
  186 +
  187 +
  188 +
  189 +
  190 +
  191 +
  192 +