Commit bbb477d1a15924616cb8cb362908fe4149e689db

Authored by 潘钊
2 parents 85419dc2 7acde535

Merge branch 'minhang' into qingpu

# Conflicts:
#	src/main/resources/ms-jdbc.properties
#	src/main/resources/static/index.html
#	src/main/resources/static/login.html
Showing 47 changed files with 2933 additions and 774 deletions

Too many changes to show.

To preserve performance only 47 of 146 files are displayed.

@@ -18,21 +18,19 @@ @@ -18,21 +18,19 @@
18 <groupId>org.springframework.boot</groupId> 18 <groupId>org.springframework.boot</groupId>
19 <artifactId>spring-boot-starter-web</artifactId> 19 <artifactId>spring-boot-starter-web</artifactId>
20 </dependency> 20 </dependency>
21 - 21 +
22 <dependency> 22 <dependency>
23 - <groupId>org.springframework.boot</groupId>  
24 - <artifactId>spring-boot-starter-tomcat</artifactId>  
25 - <scope>provided</scope>  
26 - </dependency>  
27 - 23 + <groupId>org.springframework.boot</groupId>
  24 + <artifactId>spring-boot-starter-tomcat</artifactId>
  25 + <scope>provided</scope>
  26 + </dependency>
  27 +
28 <dependency> 28 <dependency>
29 <groupId>org.springframework.boot</groupId> 29 <groupId>org.springframework.boot</groupId>
30 <artifactId>spring-boot-starter-security</artifactId> 30 <artifactId>spring-boot-starter-security</artifactId>
31 </dependency> 31 </dependency>
32 -<!-- <dependency>  
33 - <groupId>org.springframework.security</groupId>  
34 - <artifactId>spring-security-config</artifactId>  
35 - </dependency> --> 32 + <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
  33 + </dependency> -->
36 <dependency> 34 <dependency>
37 <groupId>org.springframework.boot</groupId> 35 <groupId>org.springframework.boot</groupId>
38 <artifactId>spring-boot-starter-data-jpa</artifactId> 36 <artifactId>spring-boot-starter-data-jpa</artifactId>
@@ -68,27 +66,32 @@ @@ -68,27 +66,32 @@
68 <artifactId>fastjson</artifactId> 66 <artifactId>fastjson</artifactId>
69 <version>1.2.4</version> 67 <version>1.2.4</version>
70 </dependency> 68 </dependency>
71 - 69 +
72 <dependency> 70 <dependency>
73 - <groupId>org.apache.httpcomponents</groupId>  
74 - <artifactId>httpclient</artifactId>  
75 - </dependency> 71 + <groupId>org.apache.httpcomponents</groupId>
  72 + <artifactId>httpclient</artifactId>
  73 + </dependency>
76 74
77 <dependency> 75 <dependency>
78 <groupId>commons-dbcp</groupId> 76 <groupId>commons-dbcp</groupId>
79 <artifactId>commons-dbcp</artifactId> 77 <artifactId>commons-dbcp</artifactId>
80 </dependency> 78 </dependency>
81 - <dependency>  
82 - <groupId>commons-lang</groupId>  
83 - <artifactId>commons-lang</artifactId>  
84 - <version>2.6</version>  
85 - </dependency> 79 + <dependency>
  80 + <groupId>commons-lang</groupId>
  81 + <artifactId>commons-lang</artifactId>
  82 + <version>2.6</version>
  83 + </dependency>
86 <dependency> 84 <dependency>
87 <groupId>org.apache.commons</groupId> 85 <groupId>org.apache.commons</groupId>
88 <artifactId>commons-lang3</artifactId> 86 <artifactId>commons-lang3</artifactId>
89 <version>3.4</version> 87 <version>3.4</version>
90 </dependency> 88 </dependency>
91 <dependency> 89 <dependency>
  90 + <groupId>commons-fileupload</groupId>
  91 + <artifactId>commons-fileupload</artifactId>
  92 + <version>1.2.2</version>
  93 + </dependency>
  94 + <dependency>
92 <groupId>commons-io</groupId> 95 <groupId>commons-io</groupId>
93 <artifactId>commons-io</artifactId> 96 <artifactId>commons-io</artifactId>
94 <version>2.4</version> 97 <version>2.4</version>
@@ -111,38 +114,38 @@ @@ -111,38 +114,38 @@
111 </dependency> 114 </dependency>
112 <!-- ftp文件上传包 --> 115 <!-- ftp文件上传包 -->
113 <dependency> 116 <dependency>
114 - <groupId>commons-net</groupId>  
115 - <artifactId>commons-net</artifactId>  
116 - <version>3.5</version> 117 + <groupId>commons-net</groupId>
  118 + <artifactId>commons-net</artifactId>
  119 + <version>3.5</version>
  120 + </dependency>
  121 + <dependency>
  122 + <groupId>org.apache.commons</groupId>
  123 + <artifactId>commons-compress</artifactId>
  124 + <version>1.3</version>
  125 + </dependency>
  126 + <!-- drools 6依赖 -->
  127 + <dependency>
  128 + <groupId>org.kie</groupId>
  129 + <artifactId>kie-api</artifactId>
117 </dependency> 130 </dependency>
118 <dependency> 131 <dependency>
119 - <groupId>org.apache.commons</groupId>  
120 - <artifactId>commons-compress</artifactId>  
121 - <version>1.3</version> 132 + <groupId>org.drools</groupId>
  133 + <artifactId>drools-compiler</artifactId>
  134 + </dependency>
  135 +
  136 + <!-- springboot测试 -->
  137 + <dependency>
  138 + <groupId>org.springframework.boot</groupId>
  139 + <artifactId>spring-boot-starter-test</artifactId>
  140 + <scope>test</scope>
122 </dependency> 141 </dependency>
123 - <!-- drools 6依赖 -->  
124 - <dependency>  
125 - <groupId>org.kie</groupId>  
126 - <artifactId>kie-api</artifactId>  
127 - </dependency>  
128 - <dependency>  
129 - <groupId>org.drools</groupId>  
130 - <artifactId>drools-compiler</artifactId>  
131 - </dependency>  
132 142
133 - <!-- springboot测试 -->  
134 - <dependency>  
135 - <groupId>org.springframework.boot</groupId>  
136 - <artifactId>spring-boot-starter-test</artifactId>  
137 - <scope>test</scope>  
138 - </dependency>  
139 -  
140 - <dependency> 143 + <dependency>
141 <groupId>c3p0</groupId> 144 <groupId>c3p0</groupId>
142 <artifactId>c3p0</artifactId> 145 <artifactId>c3p0</artifactId>
143 <version>0.9.1.2</version> 146 <version>0.9.1.2</version>
144 </dependency> 147 </dependency>
145 - 148 +
146 <!-- 图表 --> 149 <!-- 图表 -->
147 <dependency> 150 <dependency>
148 <groupId>com.google.code.gson</groupId> 151 <groupId>com.google.code.gson</groupId>
@@ -155,82 +158,79 @@ @@ -155,82 +158,79 @@
155 <version>2.1.8</version> 158 <version>2.1.8</version>
156 </dependency> 159 </dependency>
157 160
158 - <dependency>  
159 - <groupId>org.apache.tika</groupId>  
160 - <artifactId>tika-core</artifactId>  
161 - <version>1.7</version>  
162 - </dependency> 161 + <dependency>
  162 + <groupId>org.apache.tika</groupId>
  163 + <artifactId>tika-core</artifactId>
  164 + <version>1.7</version>
  165 + </dependency>
  166 +
  167 + <!-- pentaho kettle 依赖 -->
  168 + <dependency>
  169 + <groupId>com.pentaho.kettle</groupId>
  170 + <artifactId>kettle-core</artifactId>
  171 + <version>6.0.1.0-386</version>
  172 + </dependency>
  173 + <dependency>
  174 + <groupId>com.pentaho.kettle</groupId>
  175 + <artifactId>kettle-engine</artifactId>
  176 + <version>6.0.1.0-386</version>
  177 + </dependency>
  178 + <dependency>
  179 + <groupId>com.pentaho.kettle</groupId>
  180 + <artifactId>metastore</artifactId>
  181 + <version>6.0.1.0-386</version>
  182 + </dependency>
  183 + <dependency>
  184 + <groupId>com.pentaho.kettle</groupId>
  185 + <artifactId>vfs2</artifactId>
  186 + <version>2.1-20150824</version>
  187 + </dependency>
  188 + <dependency>
  189 + <groupId>net.sourceforge.jexcelapi</groupId>
  190 + <artifactId>jxl</artifactId>
  191 + <version>2.6.12</version>
  192 + </dependency>
  193 + <dependency>
  194 + <groupId>rhino</groupId>
  195 + <artifactId>js</artifactId>
  196 + <version>1.7R2</version>
  197 + </dependency>
  198 + <dependency>
  199 + <groupId>javax.mail</groupId>
  200 + <artifactId>mail</artifactId>
  201 + <version>1.4.7</version>
  202 + </dependency>
163 203
164 - <!-- pentaho kettle 依赖 -->  
165 - <dependency>  
166 - <groupId>com.pentaho.kettle</groupId>  
167 - <artifactId>kettle-core</artifactId>  
168 - <version>6.0.1.0-386</version>  
169 - </dependency>  
170 - <dependency>  
171 - <groupId>com.pentaho.kettle</groupId>  
172 - <artifactId>kettle-engine</artifactId>  
173 - <version>6.0.1.0-386</version>  
174 - </dependency>  
175 - <dependency>  
176 - <groupId>com.pentaho.kettle</groupId>  
177 - <artifactId>metastore</artifactId>  
178 - <version>6.0.1.0-386</version>  
179 - </dependency>  
180 - <dependency>  
181 - <groupId>com.pentaho.kettle</groupId>  
182 - <artifactId>vfs2</artifactId>  
183 - <version>2.1-20150824</version>  
184 - </dependency>  
185 - <dependency>  
186 - <groupId>net.sourceforge.jexcelapi</groupId>  
187 - <artifactId>jxl</artifactId>  
188 - <version>2.6.12</version>  
189 - </dependency>  
190 - <dependency>  
191 - <groupId>rhino</groupId>  
192 - <artifactId>js</artifactId>  
193 - <version>1.7R2</version>  
194 - </dependency>  
195 - <dependency>  
196 - <groupId>javax.mail</groupId>  
197 - <artifactId>mail</artifactId>  
198 - <version>1.4.7</version>  
199 - </dependency> 204 + <dependency>
  205 + <groupId>com.github.axet</groupId>
  206 + <artifactId>kaptcha</artifactId>
  207 + <version>0.0.9</version>
  208 + </dependency>
200 209
201 <dependency> 210 <dependency>
202 - <groupId>com.github.axet</groupId>  
203 - <artifactId>kaptcha</artifactId>  
204 - <version>0.0.9</version>  
205 - </dependency>  
206 -  
207 - <dependency>  
208 - <groupId>commons-codec</groupId>  
209 - <artifactId>commons-codec</artifactId>  
210 - <version>1.4</version>  
211 - <scope>compile</scope>  
212 - </dependency>  
213 - <dependency>  
214 - <groupId>org.bouncycastle</groupId>  
215 - <artifactId>bcprov-jdk15on</artifactId>  
216 - <version>1.52</version>  
217 - </dependency>  
218 - <dependency>  
219 - <groupId>axis</groupId>  
220 - <artifactId>axis</artifactId>  
221 - <version>1.4</version>  
222 - </dependency>  
223 - <dependency>  
224 - <groupId>javax.xml</groupId>  
225 - <artifactId>jaxrpc-api</artifactId>  
226 - <version>1.1</version> 211 + <groupId>commons-codec</groupId>
  212 + <artifactId>commons-codec</artifactId>
  213 + <version>1.4</version>
  214 + <scope>compile</scope>
  215 + </dependency>
  216 + <dependency>
  217 + <groupId>org.bouncycastle</groupId>
  218 + <artifactId>bcprov-jdk15on</artifactId>
  219 + <version>1.52</version>
  220 + </dependency>
  221 + <dependency>
  222 + <groupId>axis</groupId>
  223 + <artifactId>axis</artifactId>
  224 + <version>1.4</version>
  225 + </dependency>
  226 + <dependency>
  227 + <groupId>javax.xml</groupId>
  228 + <artifactId>jaxrpc-api</artifactId>
  229 + <version>1.1</version>
227 </dependency> 230 </dependency>
228 231
229 -<!-- <dependency>  
230 - <groupId>org.springframework.boot</groupId>  
231 - <artifactId>spring-boot-devtools</artifactId>  
232 - <optional>true</optional>  
233 - </dependency>--> 232 + <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId>
  233 + <optional>true</optional> </dependency> -->
234 <dependency> 234 <dependency>
235 <groupId>com.vividsolutions</groupId> 235 <groupId>com.vividsolutions</groupId>
236 <artifactId>jts</artifactId> 236 <artifactId>jts</artifactId>
@@ -239,18 +239,18 @@ @@ -239,18 +239,18 @@
239 239
240 </dependencies> 240 </dependencies>
241 241
242 - <dependencyManagement>  
243 - <dependencies>  
244 - <!-- drools 6依赖 -->  
245 - <dependency>  
246 - <groupId>org.drools</groupId>  
247 - <artifactId>drools-bom</artifactId>  
248 - <type>pom</type>  
249 - <version>6.3.0.Final</version>  
250 - <scope>import</scope>  
251 - </dependency>  
252 - </dependencies>  
253 - </dependencyManagement> 242 + <dependencyManagement>
  243 + <dependencies>
  244 + <!-- drools 6依赖 -->
  245 + <dependency>
  246 + <groupId>org.drools</groupId>
  247 + <artifactId>drools-bom</artifactId>
  248 + <type>pom</type>
  249 + <version>6.3.0.Final</version>
  250 + <scope>import</scope>
  251 + </dependency>
  252 + </dependencies>
  253 + </dependencyManagement>
254 254
255 <build> 255 <build>
256 <plugins> 256 <plugins>
@@ -304,8 +304,8 @@ @@ -304,8 +304,8 @@
304 <url>http://repo.spring.io/milestone</url> 304 <url>http://repo.spring.io/milestone</url>
305 </pluginRepository> 305 </pluginRepository>
306 </pluginRepositories> 306 </pluginRepositories>
307 - 307 +
308 <properties> 308 <properties>
309 - <start-class>com.bsth.Application</start-class> 309 + <start-class>com.bsth.Application</start-class>
310 </properties> 310 </properties>
311 </project> 311 </project>
src/main/java/com/bsth/controller/logger/MileModifyController.java 0 → 100644
  1 +package com.bsth.controller.logger;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.logger.Logger_MileModify;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RestController;
  7 +
  8 +/**
  9 + * Created by panzhao on 2017/3/6.
  10 + */
  11 +@RestController
  12 +@RequestMapping("logger_mile_modify")
  13 +public class MileModifyController extends BaseController<Logger_MileModify, Long>{
  14 +}
src/main/java/com/bsth/controller/oil/JdlController.java 0 → 100644
  1 +package com.bsth.controller.oil;
  2 +
  3 +import java.io.File;
  4 +import java.util.HashMap;
  5 +import java.util.Map;
  6 +
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestMethod;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +import org.springframework.web.multipart.MultipartFile;
  13 +import org.springframework.web.servlet.ModelAndView;
  14 +
  15 +import com.alibaba.fastjson.JSON;
  16 +import com.alibaba.fastjson.JSONArray;
  17 +import com.alibaba.fastjson.JSONObject;
  18 +import com.bsth.controller.BaseController;
  19 +import com.bsth.entity.oil.Jdl;
  20 +import com.bsth.service.oil.JdlService;
  21 +import com.google.common.io.Files;
  22 +
  23 +@RestController
  24 +@RequestMapping("jdl")
  25 +public class JdlController extends BaseController<Jdl, Integer> {
  26 +
  27 + @Autowired
  28 + JdlService jdlService;
  29 +
  30 + public String getDataImportClasspath(){
  31 + return this.getClass().getResource("/").getPath() + "/static/pages/electricity/jdl";
  32 + }
  33 +
  34 + @RequestMapping(value = "/uploadFile",method = RequestMethod.POST)
  35 + public String uploadFile(MultipartFile file, String gsbm_, String gsName,
  36 + String fgsbm_, String fgsName) throws Exception{
  37 + Map<String, Object> map = new HashMap<String, Object>();
  38 +// File ktrfile = new File(this.getClass().getResource(getDataImportKtrClasspath()).toURI());
  39 +// System.out.println(ktrfile.getAbsolutePath());
  40 + System.out.println(file.getSize());
  41 + File newFile = new File(
  42 + getDataImportClasspath() + File.separator +
  43 + file.getOriginalFilename());
  44 + Files.write(file.getBytes(), newFile);
  45 + String result = jdlService.importExcel(newFile, gsbm_, gsName, fgsbm_, fgsName);
  46 + return "{\"result\":" + "\""+result+"\"}";
  47 + }
  48 +
  49 + @RequestMapping(value = "/query",method = RequestMethod.GET)
  50 + public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{
  51 + return jdlService.query(map);
  52 + }
  53 +
  54 +}
src/main/java/com/bsth/controller/realcontrol/LineConfigController.java
@@ -35,8 +35,18 @@ public class LineConfigController extends BaseController&lt;LineConfig, Integer&gt;{ @@ -35,8 +35,18 @@ public class LineConfigController extends BaseController&lt;LineConfig, Integer&gt;{
35 return lineConfigService.editOutTimeType(lineCode, type); 35 return lineConfigService.editOutTimeType(lineCode, type);
36 } 36 }
37 37
  38 + @RequestMapping(value = "/enableInParkForSource", method = RequestMethod.POST)
  39 + public Map<String, Object> enableInParkForSource(@RequestParam String lineCode, @RequestParam int enable){
  40 + return lineConfigService.enableInParkForSource(lineCode, enable);
  41 + }
  42 +
38 @RequestMapping(value = "/getByLineCode") 43 @RequestMapping(value = "/getByLineCode")
39 public LineConfig getByLineCode(@RequestParam String lineCode){ 44 public LineConfig getByLineCode(@RequestParam String lineCode){
40 return lineConfigService.getByLineCode(lineCode); 45 return lineConfigService.getByLineCode(lineCode);
41 } 46 }
  47 +
  48 + @RequestMapping(value = "/bufferTimeDiff", method = RequestMethod.POST)
  49 + public Map<String, Object> bufferTimeDiff(@RequestParam String lineCode, @RequestParam String field,@RequestParam String value){
  50 + return lineConfigService.bufferTimeDiff(lineCode, field, value);
  51 + }
42 } 52 }
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
@@ -144,6 +144,16 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -144,6 +144,16 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
144 } 144 }
145 145
146 /** 146 /**
  147 + * 撤销执行
  148 + * @param id
  149 + * @return
  150 + */
  151 + @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST)
  152 + public Map<String, Object> revokeRealArrive(@RequestParam Long id){
  153 + return scheduleRealInfoService.revokeRealArrive(id);
  154 + }
  155 +
  156 + /**
147 * 157 *
148 * @Title: spaceAdjust 158 * @Title: spaceAdjust
149 * @Description: TODO(间隔调整) 159 * @Description: TODO(间隔调整)
@@ -262,6 +272,12 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -262,6 +272,12 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
262 @RequestParam String date,@RequestParam String state) { 272 @RequestParam String date,@RequestParam String state) {
263 return scheduleRealInfoService.queryUserInfo(line, date,state); 273 return scheduleRealInfoService.queryUserInfo(line, date,state);
264 } 274 }
  275 +
  276 + @RequestMapping(value = "/queryUserInfoPx")
  277 + public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line,
  278 + @RequestParam String date,@RequestParam String state,@RequestParam String type) {
  279 + return scheduleRealInfoService.queryUserInfoPx(line, date,state,type);
  280 + }
265 281
266 @RequestMapping(value = "/exportWaybill") 282 @RequestMapping(value = "/exportWaybill")
267 public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh, 283 public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh,
@@ -368,6 +384,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -368,6 +384,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
368 return scheduleRealInfoService.realScheduleList(line,date); 384 return scheduleRealInfoService.realScheduleList(line,date);
369 } 385 }
370 386
  387 + @RequestMapping(value="/realScheduleListQp")
  388 + public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){
  389 + return scheduleRealInfoService.realScheduleListQp(line,date);
  390 + }
  391 +
371 @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST) 392 @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)
372 public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){ 393 public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){
373 cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson); 394 cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);
@@ -449,4 +470,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -449,4 +470,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
449 public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){ 470 public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){
450 return scheduleRealInfoService.currentSchedulePlan(lineCode); 471 return scheduleRealInfoService.currentSchedulePlan(lineCode);
451 } 472 }
  473 +
  474 + @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST)
  475 + public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){
  476 + return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type);
  477 + }
452 } 478 }
src/main/java/com/bsth/controller/realcontrol/dto/LpData.java 0 → 100644
  1 +package com.bsth.controller.realcontrol.dto;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +
  5 +/**
  6 + * 路牌相关的数据(换路牌时要换的字段)
  7 + * Created by panzhao on 2017/3/2.
  8 + */
  9 +public class LpData {
  10 +
  11 + public LpData(ScheduleRealInfo sch) {
  12 + this.jGh = sch.getjGh();
  13 + this.jName = sch.getjName();
  14 + this.sGh = sch.getsGh();
  15 + this.sName = sch.getsName();
  16 + this.nbbm = sch.getClZbh();
  17 +
  18 + this.fcsj = sch.getFcsjActualTime();
  19 + this.zdsj = sch.getZdsjActualTime();
  20 + }
  21 +
  22 + public void appendTo(ScheduleRealInfo sch, int type) {
  23 +
  24 + if (type == 0) {
  25 + //只换人
  26 + sch.setjGh(this.jGh);
  27 + sch.setjName(this.jName);
  28 + sch.setsGh(this.sGh);
  29 + sch.setsName(this.sName);
  30 + } else if (type == 1) {
  31 + //只换车
  32 + sch.setClZbh(this.nbbm);
  33 +
  34 + if (this.fcsj != null)
  35 + sch.setFcsjActualAll(this.fcsj);
  36 + if (this.zdsj != null)
  37 + sch.setZdsjActualAll(this.zdsj);
  38 +
  39 + } else if (type == 2) {
  40 + //换人并换车
  41 + sch.setjGh(this.jGh);
  42 + sch.setjName(this.jName);
  43 + sch.setsGh(this.sGh);
  44 + sch.setsName(this.sName);
  45 + sch.setClZbh(this.nbbm);
  46 +
  47 + if (this.fcsj != null)
  48 + sch.setFcsjActualAll(this.fcsj);
  49 + if (this.zdsj != null)
  50 + sch.setZdsjActualAll(this.zdsj);
  51 + }
  52 + }
  53 +
  54 + /**
  55 + * 驾驶员
  56 + */
  57 + private String jGh;
  58 + private String jName;
  59 +
  60 + /**
  61 + * 售票员
  62 + */
  63 + private String sGh;
  64 + private String sName;
  65 +
  66 + /**
  67 + * 车辆自编号
  68 + */
  69 + private String nbbm;
  70 +
  71 + /**
  72 + * 实际发车时间
  73 + */
  74 + private Long fcsj;
  75 +
  76 + /**
  77 + * 实际终点时间
  78 + */
  79 + private Long zdsj;
  80 +
  81 + public String getjGh() {
  82 + return jGh;
  83 + }
  84 +
  85 + public void setjGh(String jGh) {
  86 + this.jGh = jGh;
  87 + }
  88 +
  89 + public String getjName() {
  90 + return jName;
  91 + }
  92 +
  93 + public void setjName(String jName) {
  94 + this.jName = jName;
  95 + }
  96 +
  97 + public String getsGh() {
  98 + return sGh;
  99 + }
  100 +
  101 + public void setsGh(String sGh) {
  102 + this.sGh = sGh;
  103 + }
  104 +
  105 + public String getsName() {
  106 + return sName;
  107 + }
  108 +
  109 + public void setsName(String sName) {
  110 + this.sName = sName;
  111 + }
  112 +
  113 + public String getNbbm() {
  114 + return nbbm;
  115 + }
  116 +
  117 + public void setNbbm(String nbbm) {
  118 + this.nbbm = nbbm;
  119 + }
  120 +
  121 + public Long getFcsj() {
  122 + return fcsj;
  123 + }
  124 +
  125 + public void setFcsj(Long fcsj) {
  126 + this.fcsj = fcsj;
  127 + }
  128 +
  129 + public Long getZdsj() {
  130 + return zdsj;
  131 + }
  132 +
  133 + public void setZdsj(Long zdsj) {
  134 + this.zdsj = zdsj;
  135 + }
  136 +}
src/main/java/com/bsth/controller/schedule/core/SchedulePlanController.java
1 package com.bsth.controller.schedule.core; 1 package com.bsth.controller.schedule.core;
2 2
3 -import com.bsth.common.Constants;  
4 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
5 import com.bsth.controller.schedule.BController; 4 import com.bsth.controller.schedule.BController;
6 import com.bsth.entity.schedule.SchedulePlan; 5 import com.bsth.entity.schedule.SchedulePlan;
7 -import com.bsth.entity.sys.CompanyAuthority;  
8 -import com.bsth.entity.sys.SysUser;  
9 import com.bsth.service.schedule.SchedulePlanService; 6 import com.bsth.service.schedule.SchedulePlanService;
10 -import com.bsth.service.sys.SysUserService;  
11 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
12 -import org.springframework.web.bind.annotation.*; 8 +import org.springframework.web.bind.annotation.PathVariable;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RestController;
13 12
14 -import javax.servlet.http.HttpSession;  
15 import java.util.Date; 13 import java.util.Date;
16 import java.util.HashMap; 14 import java.util.HashMap;
17 -import java.util.List;  
18 import java.util.Map; 15 import java.util.Map;
19 16
20 /** 17 /**
@@ -25,33 +22,6 @@ import java.util.Map; @@ -25,33 +22,6 @@ import java.util.Map;
25 public class SchedulePlanController extends BController<SchedulePlan, Long> { 22 public class SchedulePlanController extends BController<SchedulePlan, Long> {
26 @Autowired 23 @Autowired
27 private SchedulePlanService schedulePlanService; 24 private SchedulePlanService schedulePlanService;
28 - @Autowired  
29 - private SysUserService sysUserService;  
30 -  
31 - @Override  
32 - public Map<String, Object> save(@RequestBody SchedulePlan schedulePlan, HttpSession httpSession) {  
33 - // 用户信息  
34 - String userName = String.valueOf(httpSession.getAttribute(Constants.SESSION_USERNAME));  
35 - SysUser sysUser = sysUserService.findByUserName(userName);  
36 -  
37 - Date cdate = new Date();  
38 - schedulePlan.setCreateBy(sysUser);  
39 - schedulePlan.setCreateDate(cdate);  
40 - schedulePlan.setUpdateBy(sysUser);  
41 - schedulePlan.setUpdateDate(cdate);  
42 -  
43 - // 如果多个公司,选第一个,以后改成页面控制  
44 - List<CompanyAuthority> cmyAuths = (List<CompanyAuthority>) httpSession.getAttribute(Constants.COMPANY_AUTHORITYS);  
45 - if (cmyAuths == null || cmyAuths.size() == 0)  
46 - schedulePlanService.save(schedulePlan, new CompanyAuthority());  
47 - else  
48 - schedulePlanService.save(schedulePlan, cmyAuths.get(0));  
49 -  
50 - Map<String, Object> rtn = new HashMap<>();  
51 - rtn.put("status", ResponseCode.SUCCESS);  
52 - rtn.put("data", new Object());  
53 - return rtn;  
54 - }  
55 25
56 /** 26 /**
57 * 获取明天的一歌排班计划。 27 * 获取明天的一歌排班计划。
src/main/java/com/bsth/data/directive/DayOfDirectives.java
1 package com.bsth.data.directive; 1 package com.bsth.data.directive;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.Collection;  
5 -import java.util.Comparator;  
6 -import java.util.HashMap;  
7 -import java.util.List;  
8 -import java.util.Map;  
9 -  
10 -import org.slf4j.Logger;  
11 -import org.slf4j.LoggerFactory;  
12 -import org.springframework.beans.factory.annotation.Autowired;  
13 -import org.springframework.stereotype.Component;  
14 -  
15 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
16 import com.bsth.data.LineConfigData; 4 import com.bsth.data.LineConfigData;
17 import com.bsth.entity.directive.D60; 5 import com.bsth.entity.directive.D60;
@@ -21,6 +9,12 @@ import com.bsth.entity.directive.DirectiveReponse; @@ -21,6 +9,12 @@ import com.bsth.entity.directive.DirectiveReponse;
21 import com.bsth.entity.realcontrol.ScheduleRealInfo; 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
22 import com.bsth.service.directive.DirectiveService; 10 import com.bsth.service.directive.DirectiveService;
23 import com.bsth.websocket.handler.SendUtils; 11 import com.bsth.websocket.handler.SendUtils;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import java.util.*;
24 18
25 /** 19 /**
26 * 20 *
@@ -42,6 +36,9 @@ public class DayOfDirectives { @@ -42,6 +36,9 @@ public class DayOfDirectives {
42 //等待C0_A4回复的用户 36 //等待C0_A4回复的用户
43 //public static Map<K, V> 37 //public static Map<K, V>
44 38
  39 + //等待入库的指令
  40 + public static LinkedList<Directive> pstDirectives;
  41 +
45 @Autowired 42 @Autowired
46 DirectiveService directiveService; 43 DirectiveService directiveService;
47 44
@@ -57,14 +54,19 @@ public class DayOfDirectives { @@ -57,14 +54,19 @@ public class DayOfDirectives {
57 static{ 54 static{
58 d60Map = new HashMap<>(); 55 d60Map = new HashMap<>();
59 d64Map = new HashMap<>(); 56 d64Map = new HashMap<>();
  57 + pstDirectives = new LinkedList<>();
60 } 58 }
61 59
62 public void put60(D60 d60) { 60 public void put60(D60 d60) {
63 d60Map.put(d60.getMsgId(), d60); 61 d60Map.put(d60.getMsgId(), d60);
  62 + //等待持久化
  63 + pstDirectives.add(d60);
64 } 64 }
65 65
66 public void put64(D64 d64) { 66 public void put64(D64 d64) {
67 d64Map.put(d64.getKey(), d64); 67 d64Map.put(d64.getKey(), d64);
  68 + //等待持久化
  69 + pstDirectives.add(d64);
68 } 70 }
69 71
70 /** 72 /**
@@ -98,8 +100,9 @@ public class DayOfDirectives { @@ -98,8 +100,9 @@ public class DayOfDirectives {
98 d60.setReply47Time(System.currentTimeMillis()); 100 d60.setReply47Time(System.currentTimeMillis());
99 break; 101 break;
100 } 102 }
101 - // 入库  
102 - saveD60(d60); 103 + // 等待持久化
  104 + if(!pstDirectives.contains(d60))
  105 + pstDirectives.add(d60);
103 106
104 ScheduleRealInfo sch = d60.getSch(); 107 ScheduleRealInfo sch = d60.getSch();
105 if (null == sch) 108 if (null == sch)
@@ -131,19 +134,20 @@ public class DayOfDirectives { @@ -131,19 +134,20 @@ public class DayOfDirectives {
131 logger.warn("64响应 data is null ,json: " + json); 134 logger.warn("64响应 data is null ,json: " + json);
132 else { 135 else {
133 d64.setRespAck(data.getShort("requestAck")); 136 d64.setRespAck(data.getShort("requestAck"));
134 - // 响应入库  
135 - directiveService.save64(d64); 137 + // 持久化
  138 + if(!pstDirectives.contains(d64))
  139 + pstDirectives.add(d64);
136 } 140 }
137 } 141 }
138 } 142 }
139 143
140 - private void saveD60(D60 d60) { 144 +/* private void saveD60(D60 d60) {
141 // 等47再入库 145 // 等47再入库
142 if (d60.getReply47() == null) 146 if (d60.getReply47() == null)
143 return; 147 return;
144 148
145 directiveService.save(d60); 149 directiveService.save(d60);
146 - } 150 + }*/
147 151
148 public void clear(String device){ 152 public void clear(String device){
149 int c60 = 0, c64 = 0; 153 int c60 = 0, c64 = 0;
src/main/java/com/bsth/data/directive/DirectivesPstThread.java 0 → 100644
  1 +package com.bsth.data.directive;
  2 +
  3 +import com.bsth.entity.directive.D60;
  4 +import com.bsth.entity.directive.D64;
  5 +import com.bsth.entity.directive.Directive;
  6 +import com.bsth.repository.directive.D60Repository;
  7 +import com.bsth.repository.directive.D64Repository;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.stereotype.Component;
  12 +
  13 +import java.util.LinkedList;
  14 +
  15 +/**
  16 + * 指令持久化线程
  17 + * Created by panzhao on 2017/3/6.
  18 + */
  19 +@Component
  20 +public class DirectivesPstThread extends Thread {
  21 +
  22 + Logger logger = LoggerFactory.getLogger(this.getClass());
  23 +
  24 + @Autowired
  25 + D60Repository d60Repository;
  26 +
  27 + @Autowired
  28 + D64Repository d64Repository;
  29 +
  30 + @Override
  31 + public void run() {
  32 + LinkedList<Directive> list = DayOfDirectives.pstDirectives;
  33 +
  34 + Directive directive;
  35 + for (int i = 0; i < 1000; i++) {
  36 + try {
  37 + directive = list.poll();
  38 +
  39 + if (directive instanceof D60) {
  40 + d60Repository.save((D60) directive);
  41 + }
  42 +
  43 + if (directive instanceof D64) {
  44 + d64Repository.save((D64) directive);
  45 + }
  46 + } catch (Exception e) {
  47 + logger.error("", e);
  48 + }
  49 + }
  50 + }
  51 +}
src/main/java/com/bsth/data/directive/FirstScheduleCheckThread.java
1 -package com.bsth.data.directive;  
2 -  
3 -import java.util.List;  
4 -import java.util.Set;  
5 -  
6 -import org.slf4j.Logger;  
7 -import org.slf4j.LoggerFactory;  
8 -import org.springframework.beans.factory.annotation.Autowired;  
9 -import org.springframework.stereotype.Component;  
10 -  
11 -import com.bsth.data.match.Arrival2Schedule;  
12 -import com.bsth.data.match.ExpectArrivalEnd;  
13 -import com.bsth.data.schedule.DayOfSchedule;  
14 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
15 -import com.bsth.service.directive.DirectiveService;  
16 -  
17 -/**  
18 - *  
19 - * @ClassName: FirstScheduleCheckThread  
20 - * @Description: TODO(首班出场检测)  
21 - * @author PanZhao  
22 - * @date 2016年8月27日 上午1:25:21  
23 - *  
24 - */  
25 -@Component  
26 -public class FirstScheduleCheckThread extends Thread{  
27 -  
28 - @Autowired  
29 - DayOfSchedule dayOfSchedule;  
30 -  
31 - @Autowired  
32 - DirectiveService directiveService;  
33 -  
34 - Logger logger = LoggerFactory.getLogger(this.getClass());  
35 -  
36 - //提前半小时下发指令  
37 - private final static long THREE_MINUTES = 1000 * 60 * 30L;  
38 -  
39 - @Override  
40 - public void run() {  
41 - try{  
42 - Set<String> cars = dayOfSchedule.allCar();  
43 -  
44 - long t = System.currentTimeMillis();  
45 - List<ScheduleRealInfo> schList;  
46 - ScheduleRealInfo first;  
47 - for(String car : cars){  
48 -  
49 - schList = dayOfSchedule.findByNbbm(car);  
50 -  
51 - if(null == schList || schList.size() == 0)  
52 - continue;  
53 -  
54 - first = schList.get(0);  
55 -  
56 - if(null != first.getBcType()  
57 - && first.getBcType().equals("out")){  
58 -  
59 - //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令  
60 - if(first.getJhlc() == null && first.getXlDir().equals(schList.get(1).getXlDir()))  
61 - first = schList.get(1);  
62 -  
63 - //为首班补发指令  
64 - if(first.getDirectiveState() == -1  
65 - && Math.abs(first.getDfsjT() - t) < THREE_MINUTES){  
66 -  
67 - directiveService.send60Dispatch(first, dayOfSchedule.doneSum(first.getClZbh()), "定补@系统");  
68 - //期望完成出场班次时间  
69 - long endTime;  
70 -  
71 - if(first.getZdsj() != null)  
72 - endTime=first.getZdsjT() - 60000;  
73 - else  
74 - endTime=schList.get(1).getDfsjT() - 60000;  
75 -  
76 - ExpectArrivalEnd ead = new ExpectArrivalEnd()  
77 - ,ead2 = new ExpectArrivalEnd();  
78 - ead.setNbbm(car);  
79 - ead.setEndStation(first.getQdzCode());  
80 - ead.setEndTime(endTime);  
81 -  
82 - ead2.setNbbm(car);  
83 - ead2.setEndStation(first.getZdzCode());  
84 - ead2.setEndTime(endTime);  
85 -  
86 - Arrival2Schedule.addExpect(car, ead);  
87 - Arrival2Schedule.addExpect(car, ead2);  
88 - }  
89 - }  
90 - }  
91 - }catch(Exception e){  
92 - logger.error("", e);  
93 - }  
94 - }  
95 -} 1 +//package com.bsth.data.directive;
  2 +//
  3 +//import java.util.List;
  4 +//import java.util.Set;
  5 +//
  6 +//import org.slf4j.Logger;
  7 +//import org.slf4j.LoggerFactory;
  8 +//import org.springframework.beans.factory.annotation.Autowired;
  9 +//import org.springframework.stereotype.Component;
  10 +//
  11 +//import com.bsth.data.match.Arrival2Schedule;
  12 +//import com.bsth.data.match.ExpectArrivalEnd;
  13 +//import com.bsth.data.schedule.DayOfSchedule;
  14 +//import com.bsth.entity.realcontrol.ScheduleRealInfo;
  15 +//import com.bsth.service.directive.DirectiveService;
  16 +//
  17 +///**
  18 +// *
  19 +// * @ClassName: FirstScheduleCheckThread
  20 +// * @Description: TODO(首班出场检测)
  21 +// * @author PanZhao
  22 +// * @date 2016年8月27日 上午1:25:21
  23 +// *
  24 +// */
  25 +//@Component
  26 +//public class FirstScheduleCheckThread extends Thread{
  27 +//
  28 +// @Autowired
  29 +// DayOfSchedule dayOfSchedule;
  30 +//
  31 +// @Autowired
  32 +// DirectiveService directiveService;
  33 +//
  34 +// Logger logger = LoggerFactory.getLogger(this.getClass());
  35 +//
  36 +// //提前半小时下发指令
  37 +// private final static long THREE_MINUTES = 1000 * 60 * 30L;
  38 +//
  39 +// @Override
  40 +// public void run() {
  41 +// try{
  42 +// Set<String> cars = dayOfSchedule.allCar();
  43 +//
  44 +// long t = System.currentTimeMillis();
  45 +// List<ScheduleRealInfo> schList;
  46 +// ScheduleRealInfo first;
  47 +// for(String car : cars){
  48 +//
  49 +// schList = dayOfSchedule.findByNbbm(car);
  50 +//
  51 +// if(null == schList || schList.size() == 0)
  52 +// continue;
  53 +//
  54 +// first = schList.get(0);
  55 +//
  56 +// if(null != first.getBcType()
  57 +// && first.getBcType().equals("out")){
  58 +//
  59 +// //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令
  60 +// if(first.getJhlc() == null && first.getXlDir().equals(schList.get(1).getXlDir()))
  61 +// first = schList.get(1);
  62 +//
  63 +// //为首班补发指令
  64 +// if(first.getDirectiveState() == -1
  65 +// && Math.abs(first.getDfsjT() - t) < THREE_MINUTES){
  66 +//
  67 +// directiveService.send60Dispatch(first, dayOfSchedule.doneSum(first.getClZbh()), "定补@系统");
  68 +// //期望完成出场班次时间
  69 +// long endTime;
  70 +//
  71 +// if(first.getZdsj() != null)
  72 +// endTime=first.getZdsjT() - 60000;
  73 +// else
  74 +// endTime=schList.get(1).getDfsjT() - 60000;
  75 +//
  76 +// ExpectArrivalEnd ead = new ExpectArrivalEnd()
  77 +// ,ead2 = new ExpectArrivalEnd();
  78 +// ead.setNbbm(car);
  79 +// ead.setEndStation(first.getQdzCode());
  80 +// ead.setEndTime(endTime);
  81 +//
  82 +// ead2.setNbbm(car);
  83 +// ead2.setEndStation(first.getZdzCode());
  84 +// ead2.setEndTime(endTime);
  85 +//
  86 +// Arrival2Schedule.addExpect(car, ead);
  87 +// Arrival2Schedule.addExpect(car, ead2);
  88 +// }
  89 +// }
  90 +// }
  91 +// }catch(Exception e){
  92 +// logger.error("", e);
  93 +// }
  94 +// }
  95 +//}
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -5,13 +5,10 @@ import com.alibaba.fastjson.JSONArray; @@ -5,13 +5,10 @@ import com.alibaba.fastjson.JSONArray;
5 import com.bsth.Application; 5 import com.bsth.Application;
6 import com.bsth.data.BasicData; 6 import com.bsth.data.BasicData;
7 import com.bsth.data.LineConfigData; 7 import com.bsth.data.LineConfigData;
8 -import com.bsth.data.directive.FirstScheduleCheckThread; 8 +import com.bsth.data.directive.DirectivesPstThread;
9 import com.bsth.data.gpsdata.GpsRealData; 9 import com.bsth.data.gpsdata.GpsRealData;
10 import com.bsth.data.gpsdata.recovery.GpsDataRecovery; 10 import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
11 -import com.bsth.data.schedule.thread.ScheduleLateThread;  
12 -import com.bsth.data.schedule.thread.SchedulePstThread;  
13 -import com.bsth.data.schedule.thread.ScheduleRefreshThread;  
14 -import com.bsth.data.schedule.thread.SubmitToTrafficManage; 11 +import com.bsth.data.schedule.thread.*;
15 import com.bsth.entity.realcontrol.LineConfig; 12 import com.bsth.entity.realcontrol.LineConfig;
16 import com.bsth.entity.realcontrol.ScheduleRealInfo; 13 import com.bsth.entity.realcontrol.ScheduleRealInfo;
17 import com.bsth.entity.schedule.SchedulePlanInfo; 14 import com.bsth.entity.schedule.SchedulePlanInfo;
@@ -115,9 +112,6 @@ public class DayOfSchedule implements CommandLineRunner { @@ -115,9 +112,6 @@ public class DayOfSchedule implements CommandLineRunner {
115 SchedulePstThread schedulePstThread; 112 SchedulePstThread schedulePstThread;
116 113
117 @Autowired 114 @Autowired
118 - FirstScheduleCheckThread firstScheduleCheckThread;  
119 -  
120 - @Autowired  
121 ScheduleLateThread scheduleLateThread; 115 ScheduleLateThread scheduleLateThread;
122 116
123 @Autowired 117 @Autowired
@@ -129,6 +123,12 @@ public class DayOfSchedule implements CommandLineRunner { @@ -129,6 +123,12 @@ public class DayOfSchedule implements CommandLineRunner {
129 @Autowired 123 @Autowired
130 GpsDataRecovery gpsDataRecovery; 124 GpsDataRecovery gpsDataRecovery;
131 125
  126 + @Autowired
  127 + DirectivesPstThread directivesPstThread;
  128 +
  129 + @Autowired
  130 + CalcOilThread calcOilThread;
  131 +
132 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm"); 132 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm");
133 133
134 @Override 134 @Override
@@ -140,9 +140,7 @@ public class DayOfSchedule implements CommandLineRunner { @@ -140,9 +140,7 @@ public class DayOfSchedule implements CommandLineRunner {
140 //翻班线程 140 //翻班线程
141 Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); 141 Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
142 //入库 142 //入库
143 -// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);  
144 - //首班出场指令补发器  
145 -// Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); 143 +// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS);
146 //班次误点扫描 144 //班次误点扫描
147 // Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); 145 // Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);
148 146
@@ -153,6 +151,12 @@ public class DayOfSchedule implements CommandLineRunner { @@ -153,6 +151,12 @@ public class DayOfSchedule implements CommandLineRunner {
153 151
154 logger.info(diff / 1000 / 60 + "分钟之后提交到运管处"); 152 logger.info(diff / 1000 / 60 + "分钟之后提交到运管处");
155 //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); 153 //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  154 +
  155 + //计算油、公里加注
  156 + Application.mainServices.scheduleWithFixedDelay(calcOilThread, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  157 +
  158 + //指令持久化线程
  159 + Application.mainServices.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS);
156 } 160 }
157 161
158 //数据恢复 162 //数据恢复
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java 0 → 100644
  1 +package com.bsth.data.schedule.thread;
  2 +
  3 +import com.bsth.service.oil.YlbService;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +/**
  10 + * 计算油、公里加注量 线程
  11 + * Created by panzhao on 2017/3/7.
  12 + */
  13 +@Component
  14 +public class CalcOilThread extends Thread{
  15 +
  16 + @Autowired
  17 + YlbService ylbService;
  18 +
  19 + Logger logger = LoggerFactory.getLogger(this.getClass());
  20 +
  21 + @Override
  22 + public void run() {
  23 + try{
  24 + logger.info("开始计算路单里程加注量....");
  25 + ylbService.obtainDsq();
  26 + logger.info("计算路单里程加注量结束!");
  27 + } catch(Exception e){
  28 + logger.error("计算路单里程加注量失败",e);
  29 + }
  30 + }
  31 +}
src/main/java/com/bsth/data/schedule/thread/SubmitToTrafficManage.java
1 package com.bsth.data.schedule.thread; 1 package com.bsth.data.schedule.thread;
2 2
3 import com.bsth.service.TrafficManageService; 3 import com.bsth.service.TrafficManageService;
4 -import com.bsth.service.oil.YlbService;  
5 -  
6 import org.slf4j.Logger; 4 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 5 import org.slf4j.LoggerFactory;
8 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,18 +17,10 @@ public class SubmitToTrafficManage extends Thread{ @@ -19,18 +17,10 @@ public class SubmitToTrafficManage extends Thread{
19 17
20 @Autowired 18 @Autowired
21 TrafficManageService trafficManageService; 19 TrafficManageService trafficManageService;
22 -  
23 - @Autowired  
24 - YlbService YlbService;  
25 20
26 @Override 21 @Override
27 public void run() { 22 public void run() {
28 logger.info("开始提交数据到运管处..."); 23 logger.info("开始提交数据到运管处...");
29 - try{  
30 - YlbService.obtainDsq();  
31 - } catch(Exception e){  
32 - logger.error("计算路单里程加注量失败",e);  
33 - }  
34 24
35 try { 25 try {
36 //路单 26 //路单
src/main/java/com/bsth/entity/logger/Logger.java 0 → 100644
  1 +package com.bsth.entity.logger;
  2 +
  3 +import javax.persistence.GeneratedValue;
  4 +import javax.persistence.Id;
  5 +import javax.persistence.MappedSuperclass;
  6 +
  7 +/**
  8 + * 操作日志通用字段
  9 + * Created by panzhao on 2017/3/6.
  10 + */
  11 +@MappedSuperclass
  12 +public abstract class Logger {
  13 +
  14 + @Id
  15 + @GeneratedValue
  16 + private Long id;
  17 +
  18 + /** 用户信息 */
  19 + private String userName;
  20 + private String name;
  21 +
  22 + /** ########## 客户端信息 ########### */
  23 + /** ip */
  24 + private String clientIp;
  25 + /** 浏览器 */
  26 + private String browser;
  27 + /** 系统平台 */
  28 + private String clientSystem;
  29 + /** 浏览器内核 */
  30 + private String browserCore;
  31 +
  32 + /** 操作时间 */
  33 + private Long ts;
  34 +
  35 + public String getUserName() {
  36 + return userName;
  37 + }
  38 +
  39 + public void setUserName(String userName) {
  40 + this.userName = userName;
  41 + }
  42 +
  43 + public String getName() {
  44 + return name;
  45 + }
  46 +
  47 + public void setName(String name) {
  48 + this.name = name;
  49 + }
  50 +
  51 + public String getClientIp() {
  52 + return clientIp;
  53 + }
  54 +
  55 + public void setClientIp(String clientIp) {
  56 + this.clientIp = clientIp;
  57 + }
  58 +
  59 + public String getBrowser() {
  60 + return browser;
  61 + }
  62 +
  63 + public void setBrowser(String browser) {
  64 + this.browser = browser;
  65 + }
  66 +
  67 + public String getClientSystem() {
  68 + return clientSystem;
  69 + }
  70 +
  71 + public void setClientSystem(String clientSystem) {
  72 + this.clientSystem = clientSystem;
  73 + }
  74 +
  75 + public String getBrowserCore() {
  76 + return browserCore;
  77 + }
  78 +
  79 + public void setBrowserCore(String browserCore) {
  80 + this.browserCore = browserCore;
  81 + }
  82 +
  83 + public Long getTs() {
  84 + return ts;
  85 + }
  86 +
  87 + public void setTs(Long ts) {
  88 + this.ts = ts;
  89 + }
  90 +}
src/main/java/com/bsth/entity/logger/Logger_MileModify.java 0 → 100644
  1 +package com.bsth.entity.logger;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.Table;
  5 +
  6 +/**
  7 + * 操作日志 -修改公里
  8 + * Created by panzhao on 2017/3/6.
  9 + */
  10 +@Entity
  11 +@Table(name = "logger_mile_modify")
  12 +public class Logger_MileModify extends Logger{
  13 +
  14 + /** 之前的公里 */
  15 + private Double beforeMile;
  16 +
  17 + /** 修改之后的公里 */
  18 + private Double afterMile;
  19 +
  20 + /** 线路 code/name */
  21 + private String lineStr;
  22 +
  23 + /** 路牌 */
  24 + private String lp;
  25 +
  26 + /** 车辆自编号 */
  27 + private String nbbm;
  28 +
  29 + /** 发车时间 */
  30 + private String fcsj;
  31 +
  32 + /** 班次ID */
  33 + private Long schId;
  34 +
  35 + /** 备注 */
  36 + private String remarks;
  37 +
  38 + public Double getBeforeMile() {
  39 + return beforeMile;
  40 + }
  41 +
  42 + public void setBeforeMile(Double beforeMile) {
  43 + this.beforeMile = beforeMile;
  44 + }
  45 +
  46 + public Double getAfterMile() {
  47 + return afterMile;
  48 + }
  49 +
  50 + public void setAfterMile(Double afterMile) {
  51 + this.afterMile = afterMile;
  52 + }
  53 +
  54 + public String getLineStr() {
  55 + return lineStr;
  56 + }
  57 +
  58 + public void setLineStr(String lineStr) {
  59 + this.lineStr = lineStr;
  60 + }
  61 +
  62 + public String getLp() {
  63 + return lp;
  64 + }
  65 +
  66 + public void setLp(String lp) {
  67 + this.lp = lp;
  68 + }
  69 +
  70 + public String getNbbm() {
  71 + return nbbm;
  72 + }
  73 +
  74 + public void setNbbm(String nbbm) {
  75 + this.nbbm = nbbm;
  76 + }
  77 +
  78 + public String getFcsj() {
  79 + return fcsj;
  80 + }
  81 +
  82 + public void setFcsj(String fcsj) {
  83 + this.fcsj = fcsj;
  84 + }
  85 +
  86 + public Long getSchId() {
  87 + return schId;
  88 + }
  89 +
  90 + public void setSchId(Long schId) {
  91 + this.schId = schId;
  92 + }
  93 +
  94 + public String getRemarks() {
  95 + return remarks;
  96 + }
  97 +
  98 + public void setRemarks(String remarks) {
  99 + this.remarks = remarks;
  100 + }
  101 +}
src/main/java/com/bsth/entity/oil/Jdl.java
@@ -21,10 +21,12 @@ public class Jdl { @@ -21,10 +21,12 @@ public class Jdl {
21 private String gsName; 21 private String gsName;
22 private String fgsBm; 22 private String fgsBm;
23 private String fgsName; 23 private String fgsName;
24 - private String clZbh; 24 + private String nbbm;
25 private Double jdl = 0.0; 25 private Double jdl = 0.0;
26 private String jdz; 26 private String jdz;
27 private String remarks; 27 private String remarks;
  28 + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  29 + private Date createrDate;
28 30
29 31
30 public Integer getId() { 32 public Integer getId() {
@@ -63,11 +65,11 @@ public class Jdl { @@ -63,11 +65,11 @@ public class Jdl {
63 public void setFgsName(String fgsName) { 65 public void setFgsName(String fgsName) {
64 this.fgsName = fgsName; 66 this.fgsName = fgsName;
65 } 67 }
66 - public String getClZbh() {  
67 - return clZbh; 68 + public String getNbbm() {
  69 + return nbbm;
68 } 70 }
69 - public void setClZbh(String clZbh) {  
70 - this.clZbh = clZbh; 71 + public void setNbbm(String nbbm) {
  72 + this.nbbm = nbbm;
71 } 73 }
72 public Double getJdl() { 74 public Double getJdl() {
73 return jdl; 75 return jdl;
@@ -87,5 +89,11 @@ public class Jdl { @@ -87,5 +89,11 @@ public class Jdl {
87 public void setRemarks(String remarks) { 89 public void setRemarks(String remarks) {
88 this.remarks = remarks; 90 this.remarks = remarks;
89 } 91 }
  92 + public Date getCreaterDate() {
  93 + return createrDate;
  94 + }
  95 + public void setCreaterDate(Date createrDate) {
  96 + this.createrDate = createrDate;
  97 + }
90 98
91 } 99 }
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
@@ -56,6 +56,23 @@ public class LineConfig { @@ -56,6 +56,23 @@ public class LineConfig {
56 /** 识别区间调头 */ 56 /** 识别区间调头 */
57 private boolean readReverse; 57 private boolean readReverse;
58 58
  59 + /** 原线路回场 */
  60 + private boolean inParkForSource;
  61 +
  62 + /**
  63 + * 到离站偏移值
  64 + */
  65 +
  66 + //上行进站
  67 + private int upInDiff;
  68 + //上行出站
  69 + private int upOutDiff;
  70 + //下行进站
  71 + private int downInDiff;
  72 + //下行出站
  73 + private int downOutDiff;
  74 +
  75 +
59 @OneToMany(cascade = CascadeType.ALL) 76 @OneToMany(cascade = CascadeType.ALL)
60 private Set<D80ReplyTemp> d80Temps = new HashSet<>(); 77 private Set<D80ReplyTemp> d80Temps = new HashSet<>();
61 78
@@ -151,4 +168,44 @@ public class LineConfig { @@ -151,4 +168,44 @@ public class LineConfig {
151 public void setReadReverse(boolean readReverse) { 168 public void setReadReverse(boolean readReverse) {
152 this.readReverse = readReverse; 169 this.readReverse = readReverse;
153 } 170 }
  171 +
  172 + public boolean isInParkForSource() {
  173 + return inParkForSource;
  174 + }
  175 +
  176 + public void setInParkForSource(boolean inParkForSource) {
  177 + this.inParkForSource = inParkForSource;
  178 + }
  179 +
  180 + public int getUpInDiff() {
  181 + return upInDiff;
  182 + }
  183 +
  184 + public void setUpInDiff(int upInDiff) {
  185 + this.upInDiff = upInDiff;
  186 + }
  187 +
  188 + public int getUpOutDiff() {
  189 + return upOutDiff;
  190 + }
  191 +
  192 + public void setUpOutDiff(int upOutDiff) {
  193 + this.upOutDiff = upOutDiff;
  194 + }
  195 +
  196 + public int getDownInDiff() {
  197 + return downInDiff;
  198 + }
  199 +
  200 + public void setDownInDiff(int downInDiff) {
  201 + this.downInDiff = downInDiff;
  202 + }
  203 +
  204 + public int getDownOutDiff() {
  205 + return downOutDiff;
  206 + }
  207 +
  208 + public void setDownOutDiff(int downOutDiff) {
  209 + this.downOutDiff = downOutDiff;
  210 + }
154 } 211 }
src/main/java/com/bsth/repository/logger/MileModifyRepository.java 0 → 100644
  1 +package com.bsth.repository.logger;
  2 +
  3 +import com.bsth.entity.logger.Logger_MileModify;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/3/6.
  9 + */
  10 +@Repository
  11 +public interface MileModifyRepository extends BaseRepository<Logger_MileModify, Long>{
  12 +}
src/main/java/com/bsth/repository/oil/JdlRepository.java 0 → 100644
  1 +package com.bsth.repository.oil;
  2 +
  3 +
  4 +import java.util.List;
  5 +
  6 +import org.springframework.data.jpa.repository.Modifying;
  7 +import org.springframework.data.jpa.repository.Query;
  8 +import org.springframework.stereotype.Repository;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
  11 +import com.bsth.entity.oil.Jdl;
  12 +import com.bsth.repository.BaseRepository;
  13 +
  14 +@Repository
  15 +public interface JdlRepository extends BaseRepository<Jdl, Integer>{
  16 +
  17 + @Transactional
  18 + @Modifying
  19 + @Query(value="INSERT INTO bsth_c_jdl("+
  20 + "gs_bm, gs_name, fgs_bm, fgs_name, rq, nbbm, jdl, jdz, remarks, creater_date)" +
  21 + " VALUES(" +
  22 + "?1,?2,?3,?4,str_to_date(?5,'%Y-%m-%d'),?6,?7,?8,?9,str_to_date(?10,'%Y-%m-%d %H:%i:%s'))", nativeQuery=true)
  23 + void insertData(String gsbm, String gsName, String fgsbm, String fgsName, String rq, String nbbm, String jdl, String jdz, String remarks, String createrDate);
  24 +
  25 + @Transactional
  26 + @Modifying
  27 + @Query(value="SELECT * FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm like %?4%",nativeQuery=true)
  28 + List<Jdl> query(String gsbm, String fgsbm, String rq, String nbbm);
  29 +
  30 + @Transactional
  31 + @Modifying
  32 + @Query(value="SELECT jdl FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm = ?4 and jdz = ?5",nativeQuery=true)
  33 + List<Double> queryBySame(String gsbm, String fgsbm, String rq, String nbbm, String jdz);
  34 +
  35 + @Transactional
  36 + @Modifying
  37 + @Query(value="UPDATE bsth_c_jdl set jdl = ?1 where gs_bm = ?2 and fgs_bm = ?3 and rq = ?4 and nbbm = ?5 and jdz = ?6",nativeQuery=true)
  38 + void UpdateJdl(String jdl, String gsbm, String fgsbm, String rq, String nbbm, String jdz);
  39 +
  40 +}
src/main/java/com/bsth/repository/oil/YlbRepository.java
@@ -37,6 +37,10 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -37,6 +37,10 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
37 List<Ylb> obtainYl(String rq); 37 List<Ylb> obtainYl(String rq);
38 38
39 39
  40 + @Transactional
  41 + @Modifying
  42 + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 ",nativeQuery=true)
  43 + List<Ylb> queryListYlb(String rq,String nbbm);
40 /** 44 /**
41 * 查询当天总的加注量和总里程 45 * 查询当天总的加注量和总里程
42 * @param rq 46 * @param rq
src/main/java/com/bsth/repository/oil/YlxxbRepository.java
@@ -24,6 +24,11 @@ public interface YlxxbRepository extends BaseRepository&lt;Ylxxb, Integer&gt;{ @@ -24,6 +24,11 @@ public interface YlxxbRepository extends BaseRepository&lt;Ylxxb, Integer&gt;{
24 24
25 @Transactional 25 @Transactional
26 @Modifying 26 @Modifying
  27 + @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and ssgs=?2",nativeQuery=true)
  28 + List<Ylxxb> checkYlxx(String rq,String gs);
  29 +
  30 + @Transactional
  31 + @Modifying
27 @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nbbm =?2 and jylx=1",nativeQuery=true) 32 @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nbbm =?2 and jylx=1",nativeQuery=true)
28 List<Ylxxb> obtainYlxx2(String rq,String nbbm); 33 List<Ylxxb> obtainYlxx2(String rq,String nbbm);
29 34
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -30,6 +30,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -30,6 +30,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
30 30
31 @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by (lpName+1)") 31 @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by (lpName+1)")
32 List<ScheduleRealInfo> queryUserInfo2(String line,String date); 32 List<ScheduleRealInfo> queryUserInfo2(String line,String date);
  33 +
  34 + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 desc")
  35 + List<ScheduleRealInfo> queryUserInfoPxDesc(String line,String date,String state);
  36 +
  37 + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 asc")
  38 + List<ScheduleRealInfo> queryUserInfoPxAsc(String line,String date,String state);
33 39
34 @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ") 40 @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ")
35 List<ScheduleRealInfo> queryUserInfo3(String line,String date); 41 List<ScheduleRealInfo> queryUserInfo3(String line,String date);
@@ -114,9 +120,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -114,9 +120,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
114 void deleteByLineCodeAndDate(String xlBm, String schDate); 120 void deleteByLineCodeAndDate(String xlBm, String schDate);
115 121
116 //去掉了 xlBm is not null 122 //去掉了 xlBm is not null
117 - @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj") 123 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.realExecDate,s.fcsj, (s.lpName+1)")
118 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); 124 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date);
119 125
  126 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj")
  127 + List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date);
  128 +
120 @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm") 129 @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm")
121 List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date); 130 List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date);
122 131
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
@@ -27,27 +27,29 @@ public interface SchedulePlanInfoRepository extends BaseRepository&lt;SchedulePlanI @@ -27,27 +27,29 @@ public interface SchedulePlanInfoRepository extends BaseRepository&lt;SchedulePlanI
27 Long deleteByXlAndScheduleDateGreaterThanEqualAndScheduleDateLessThanEqual(Integer xlid, Date startDate, Date endDate); 27 Long deleteByXlAndScheduleDateGreaterThanEqualAndScheduleDateLessThanEqual(Integer xlid, Date startDate, Date endDate);
28 28
29 @Query(value = " select " + 29 @Query(value = " select " +
30 - "xl as xlId, " +  
31 - "xl_name as xlName, " +  
32 - "schedule_date as scheduleDate, " +  
33 - "lp_name as lpName, " +  
34 - "cl as clId, " +  
35 - "cl_zbh as clZbh, " +  
36 - "group_concat(fcsj) ccsj, " +  
37 - "group_concat(bc_type) bctype, " +  
38 - "group_concat(distinct j) jsyId, " +  
39 - "group_concat(distinct j_gh) jsyGh, " +  
40 - "group_concat(distinct j_name) jsyName, " +  
41 - "group_concat(distinct s) spyId, " +  
42 - "group_concat(distinct s_gh) spyGh, " +  
43 - "group_concat(distinct s_name) spyName, " +  
44 - "max(create_date) as createDate, " +  
45 - "group_concat(fcno) fcno " +  
46 - "from bsth_c_s_sp_info " +  
47 - "where xl = ?1 and " +  
48 - "schedule_date = ?2 " +  
49 - "group by xl_name, schedule_date, lp, lp_name, cl, cl_zbh " +  
50 - "order by xl_name, schedule_date, lp ", nativeQuery = true) 30 + "info.xl as xlId, " +
  31 + "info.xl_name as xlName, " +
  32 + "info.schedule_date as scheduleDate, " +
  33 + "info.lp_name as lpName, " +
  34 + "info.cl as clId, " +
  35 + "info.cl_zbh as clZbh, " +
  36 + "group_concat(info.fcsj) ccsj, " +
  37 + "group_concat(info.bc_type) bctype, " +
  38 + "group_concat(distinct info.j) jsyId, " +
  39 + "group_concat(distinct info.j_gh) jsyGh, " +
  40 + "group_concat(distinct info.j_name) jsyName, " +
  41 + "group_concat(distinct info.s) spyId, " +
  42 + "group_concat(distinct info.s_gh) spyGh, " +
  43 + "group_concat(distinct info.s_name) spyName, " +
  44 + "group_concat(info.fcno) fcno, " +
  45 + "max(info.update_date) as updateDate, " +
  46 + "max(user.name) as updateUserName, " +
  47 + "max(info.tt_info_name) as ttInfoName " +
  48 + "from bsth_c_s_sp_info info left join bsth_c_sys_user user on info.update_by = user.id " +
  49 + "where info.xl = ?1 and " +
  50 + "info.schedule_date = ?2 " +
  51 + "group by info.xl_name, info.schedule_date, info.lp, info.lp_name, info.cl, info.cl_zbh " +
  52 + "order by info.xl_name, info.schedule_date, info.lp ", nativeQuery = true)
51 List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate); 53 List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate);
52 54
53 @Modifying 55 @Modifying
src/main/java/com/bsth/service/impl/StationServiceImpl.java
@@ -758,7 +758,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -758,7 +758,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
758 String bsectionVector = "LINESTRING(" + sectionsBpoints + ")"; 758 String bsectionVector = "LINESTRING(" + sectionsBpoints + ")";
759 759
760 // 城建坐标点集合 760 // 城建坐标点集合
761 - String csectionVector = ""; 761 + String csectionVector = null;
762 762
763 // 路段类型 763 // 路段类型
764 String sectionType = ""; 764 String sectionType = "";
src/main/java/com/bsth/service/logger/MileModifyService.java 0 → 100644
  1 +package com.bsth.service.logger;
  2 +
  3 +import com.bsth.entity.logger.Logger_MileModify;
  4 +import com.bsth.service.BaseService;
  5 +
  6 +/**
  7 + * Created by panzhao on 2017/3/6.
  8 + */
  9 +public interface MileModifyService extends BaseService<Logger_MileModify, Long>{
  10 +}
src/main/java/com/bsth/service/logger/impl/MileModifyServiceImpl.java 0 → 100644
  1 +package com.bsth.service.logger.impl;
  2 +
  3 +import com.bsth.entity.logger.Logger_MileModify;
  4 +import com.bsth.service.impl.BaseServiceImpl;
  5 +import com.bsth.service.logger.MileModifyService;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +/**
  9 + * Created by panzhao on 2017/3/6.
  10 + */
  11 +@Service
  12 +public class MileModifyServiceImpl extends BaseServiceImpl<Logger_MileModify, Long> implements MileModifyService {
  13 +}
src/main/java/com/bsth/service/oil/JdlService.java 0 → 100644
  1 +package com.bsth.service.oil;
  2 +
  3 +import java.io.File;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.oil.Jdl;
  7 +import com.bsth.service.BaseService;
  8 +
  9 +public interface JdlService extends BaseService<Jdl, Integer> {
  10 +
  11 + public String importExcel(File file, String gsbm_, String gsName, String fgsbm, String fgsName);
  12 +
  13 + public Map<String, Object> query(Map<String, Object> map);
  14 +
  15 +}
src/main/java/com/bsth/service/oil/impl/JdlServiceImpl.java 0 → 100644
  1 +package com.bsth.service.oil.impl;
  2 +
  3 +import java.io.File;
  4 +import java.io.FileInputStream;
  5 +import java.text.DecimalFormat;
  6 +import java.text.SimpleDateFormat;
  7 +import java.util.ArrayList;
  8 +import java.util.Date;
  9 +import java.util.HashMap;
  10 +import java.util.Iterator;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +import org.apache.poi.hssf.usermodel.HSSFCell;
  15 +import org.apache.poi.hssf.usermodel.HSSFRow;
  16 +import org.apache.poi.hssf.usermodel.HSSFSheet;
  17 +import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  18 +import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.stereotype.Service;
  21 +
  22 +import com.bsth.entity.oil.Jdl;
  23 +import com.bsth.repository.oil.JdlRepository;
  24 +import com.bsth.service.impl.BaseServiceImpl;
  25 +import com.bsth.service.oil.JdlService;
  26 +import com.bsth.util.ReportUtils;
  27 +
  28 +@Service
  29 +public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements JdlService {
  30 +
  31 + @Autowired
  32 + JdlRepository repository;
  33 +
  34 + @Override
  35 + public String importExcel(File file, String gsbm, String gsName, String fgsbm, String fgsName) {
  36 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  37 + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  38 + DecimalFormat df = new DecimalFormat("######0.00");
  39 + List<String> textList = new ArrayList<String>();
  40 + try {
  41 + POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(file));
  42 + HSSFWorkbook wb = new HSSFWorkbook(fs);
  43 + HSSFSheet sheet = wb.getSheetAt(0);
  44 + // 取得总行数
  45 + int rowNum = sheet.getLastRowNum() + 1;
  46 + // 取得总列数
  47 + int cellNum = sheet.getRow(0).getLastCellNum();
  48 + HSSFRow row = null;
  49 + HSSFCell cell = null;
  50 + for(int i = 2; i < rowNum; i++){
  51 + row = sheet.getRow(i);
  52 + if (row == null){
  53 + continue;
  54 + }
  55 + String text = "";
  56 + for(int j = 0; j < cellNum; j++){
  57 + cell = row.getCell(j);
  58 + if(cell == null){
  59 + text += ",";
  60 + continue;
  61 + }
  62 + text += cell.getStringCellValue() + ",";
  63 + }
  64 + String[] split = (text+";").split(",");
  65 + String str = "";
  66 + for(int j = 0; j < split.length && j < 5; j++){
  67 + str += split[j];
  68 + }
  69 + if(str.trim().length() == 0)
  70 + continue;
  71 + textList.add(text + ";");
  72 + }
  73 + for(int i = 0; i < textList.size(); i++){
  74 + String text = textList.get(i);
  75 + String[] split = text.split(",");
  76 + String rq = split[0];
  77 + String nbbm = split[1];
  78 + double jdl = Double.valueOf(split[2].trim().length()!=0?split[2]:"0");
  79 + String jdz = split[3];
  80 + String remarks = split[4];
  81 + if(rq.trim().length() == 0){
  82 + rq = sdf.format(new Date());
  83 + }
  84 +
  85 + List<Double> jdl_ = repository.queryBySame(gsbm, fgsbm, rq, nbbm, jdz);
  86 +
  87 + if(jdl_.size() == 0){
  88 + repository.insertData(gsbm, gsName, fgsbm, fgsName, rq, nbbm,
  89 + df.format(jdl), jdz, remarks, sd.format(new Date()));
  90 + }else{
  91 + jdl += jdl_.get(0);
  92 + repository.UpdateJdl(df.format(jdl), gsbm, fgsbm, rq, nbbm, jdz);
  93 + }
  94 + }
  95 + wb.close();
  96 + fs.close();
  97 + } catch (Exception e) {
  98 + // TODO Auto-generated catch block
  99 + e.printStackTrace();
  100 + return "文件导入失败";
  101 + } finally {
  102 + file.delete();
  103 + }
  104 + return "文件导入成功";
  105 + }
  106 +
  107 + @Override
  108 + public Map<String, Object> query(Map<String, Object> map) {
  109 + Map<String, Object> modelMap = new HashMap<String, Object>();
  110 + String gsbm = map.get("gsbm").toString();
  111 + String fgsbm = map.get("fgsbm").toString();
  112 + String rq = map.get("rq").toString();
  113 + String nbbm = map.get("nbbm").toString();
  114 + Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0");
  115 + List<Jdl> query = repository.query(gsbm, fgsbm, rq, nbbm);
  116 +
  117 + if(!map.containsKey("type")){
  118 +
  119 + int end = (page+1)*10>query.size()?query.size():(page+1)*10;
  120 + modelMap.put("dataList", query.subList(page*10, end));
  121 + modelMap.put("totalPages", query.size()%10>0?query.size()/10+1:query.size()/10);
  122 +
  123 + } else if(map.get("type").toString().equals("export")){
  124 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  125 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  126 +
  127 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  128 + for(Jdl jdl : query){
  129 + Map<String, Object> m = new HashMap<String, Object>();
  130 + m.put("rq", sdfMonth.format(jdl.getRq()));
  131 + m.put("nbbm", jdl.getNbbm());
  132 + m.put("jdl", jdl.getJdl());
  133 + m.put("jdz", jdl.getJdz());
  134 + m.put("remarks", jdl.getRemarks());
  135 + list.add(m);
  136 + }
  137 +
  138 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  139 + Map<String, Object> m = new HashMap<String, Object>();
  140 + ReportUtils ee = new ReportUtils();
  141 + try {
  142 + listI.add(list.iterator());
  143 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  144 + ee.excelReplace(listI, new Object[] { m }, path+"mould/export_Jdl.xls",
  145 + path+"export/车辆充电量" + sdfSimple.format(sdfMonth.parse(rq)) + ".xls");
  146 + } catch (Exception e) {
  147 + // TODO: handle exception
  148 + e.printStackTrace();
  149 + }
  150 + }
  151 + return modelMap;
  152 + }
  153 +
  154 +}
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -25,6 +25,7 @@ import org.springframework.jdbc.core.RowMapper; @@ -25,6 +25,7 @@ import org.springframework.jdbc.core.RowMapper;
25 import org.springframework.stereotype.Service; 25 import org.springframework.stereotype.Service;
26 26
27 import com.bsth.common.ResponseCode; 27 import com.bsth.common.ResponseCode;
  28 +import com.bsth.data.BasicData;
28 import com.bsth.entity.oil.Cyl; 29 import com.bsth.entity.oil.Cyl;
29 import com.bsth.entity.oil.Ylb; 30 import com.bsth.entity.oil.Ylb;
30 import com.bsth.entity.oil.Ylxxb; 31 import com.bsth.entity.oil.Ylxxb;
@@ -435,6 +436,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -435,6 +436,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
435 @Override 436 @Override
436 public Map<String, Object> checkYl(Map<String, Object> map) { 437 public Map<String, Object> checkYl(Map<String, Object> map) {
437 Map<String, Object> newMap=new HashMap<String,Object>(); 438 Map<String, Object> newMap=new HashMap<String,Object>();
  439 + String xlbm=map.get("xlbm_eq").toString();
438 // TODO Auto-generated method stub 440 // TODO Auto-generated method stub
439 try{ 441 try{
440 //获取车辆存油信息 442 //获取车辆存油信息
@@ -460,7 +462,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -460,7 +462,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
460 t.setJsy(y1.getJsy()); 462 t.setJsy(y1.getJsy());
461 t.setJzl(y1.getJzl()); 463 t.setJzl(y1.getJzl());
462 t.setSsgsdm(y1.getGsdm()); 464 t.setSsgsdm(y1.getGsdm());
463 - t.setXlbm("1024"); 465 + t.setXlbm(xlbm);
464 repository.save(t); 466 repository.save(t);
465 467
466 //设置存油量 468 //设置存油量
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
1 package com.bsth.service.oil.impl; 1 package com.bsth.service.oil.impl;
2 2
  3 +import java.sql.ResultSet;
  4 +import java.sql.SQLException;
3 import java.text.ParseException; 5 import java.text.ParseException;
4 import java.text.SimpleDateFormat; 6 import java.text.SimpleDateFormat;
5 import java.util.ArrayList; 7 import java.util.ArrayList;
@@ -10,9 +12,12 @@ import java.util.Map; @@ -10,9 +12,12 @@ import java.util.Map;
10 import org.slf4j.Logger; 12 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.jdbc.core.JdbcTemplate;
  16 +import org.springframework.jdbc.core.RowMapper;
13 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
14 18
15 import com.bsth.common.ResponseCode; 19 import com.bsth.common.ResponseCode;
  20 +import com.bsth.entity.excep.Offline;
16 import com.bsth.entity.oil.Ylb; 21 import com.bsth.entity.oil.Ylb;
17 import com.bsth.entity.oil.Ylxxb; 22 import com.bsth.entity.oil.Ylxxb;
18 import com.bsth.entity.search.CustomerSpecs; 23 import com.bsth.entity.search.CustomerSpecs;
@@ -31,27 +36,23 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -31,27 +36,23 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
31 YlxxbRepository repository; 36 YlxxbRepository repository;
32 @Autowired 37 @Autowired
33 YlbRepository ylbRepository; 38 YlbRepository ylbRepository;
34 - 39 + @Autowired
  40 + JdbcTemplate jdbcTemplate;
35 @Override 41 @Override
36 public PageObject<Ylxxb> Pagequery(Map<String, Object> map) { 42 public PageObject<Ylxxb> Pagequery(Map<String, Object> map) {
37 43
38 String rq=map.get("yyrq").toString(); 44 String rq=map.get("yyrq").toString();
39 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");  
40 - try {  
41 - map.put("yyrq_eq", sdf.parseObject(rq));  
42 - } catch (ParseException e) {  
43 - // TODO Auto-generated catch block  
44 - e.printStackTrace();  
45 - } 45 + String gsdm=map.get("gsdm_like").toString();
  46 + String fgsdm=map.get("fgsdm_like").toString();
  47 +
  48 + String sql=" select x.*,y.jsy as ldgh,y.fgsdm as fgsdm from bsth_c_ylxxb x "
  49 + + " left join bsth_c_ylb y on x.nbbm = y.nbbm and x.jsy !=y.jsy "
  50 + + " where DATE_FORMAT(y.rq,'%Y-%m-%d')='"+rq+"' and y.ssgsdm='"+gsdm+"' "
  51 + + " and y.fgsdm='"+fgsdm+"' and DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' "
  52 + + " and x.gsdm='"+gsdm+"'";
  53 +
46 //根具条件查询指定日期Ylxxb的数据 54 //根具条件查询指定日期Ylxxb的数据
47 - List<Ylxxb> iterator=repository.findAll(new CustomerSpecs<Ylxxb>(map));  
48 - map.remove("yyrq_eq");  
49 - try {  
50 - map.put("rq_eq", sdf.parse(rq));  
51 - } catch (ParseException e) {  
52 - // TODO Auto-generated catch block  
53 - e.printStackTrace();  
54 - } 55 +// List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm);
55 /*if(map.get("gsdm_in")!=null){ 56 /*if(map.get("gsdm_in")!=null){
56 map.put("ssgsdm_in", map.get("gsdm_in")); 57 map.put("ssgsdm_in", map.get("gsdm_in"));
57 map.remove("gsdm_in"); 58 map.remove("gsdm_in");
@@ -62,30 +63,54 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -62,30 +63,54 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
62 }*/ 63 }*/
63 64
64 //根具条件查询指定日期Ylb的数据 65 //根具条件查询指定日期Ylb的数据
65 - List<Ylb> ylbIterator=(List<Ylb>) ylbRepository.findAll(new CustomerSpecs<Ylb>(map));  
66 - List<Ylxxb> list=new ArrayList<Ylxxb>();  
67 - for (int i = 0; i < iterator.size(); i++) {  
68 - Ylxxb y1=iterator.get(i);  
69 - boolean fage=true;  
70 - String ldgh="";  
71 - for (int j = 0; j < ylbIterator.size(); j++) {  
72 - Ylb y2 = ylbIterator.get(j);  
73 - if(y1.getNbbm().equals(y2.getNbbm())){  
74 - if(y1.getJsy().equals(y2.getJsy())){  
75 - fage=false;  
76 - }  
77 - ldgh +=y2.getJsy()+"/";  
78 - }  
79 - }  
80 - if(fage){  
81 - y1.setLdgh(ldgh);  
82 - list.add(y1);  
83 - }  
84 - } 66 +// List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm);
  67 + List<Ylxxb> list=jdbcTemplate.query(sql,
  68 + new RowMapper<Ylxxb>(){
  69 + @Override
  70 + public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException {
  71 + Ylxxb s = new Ylxxb();
  72 + s.setId(rs.getInt("id"));
  73 + s.setYyrq(rs.getDate("yyrq"));
  74 + s.setNbbm(rs.getString("nbbm"));
  75 + s.setGsdm(rs.getString("gsdm"));
  76 + s.setFgsdm(rs.getString("fgsdm"));
  77 + s.setJsy(rs.getString("jsy"));
  78 + s.setJzl(rs.getDouble("jzl"));
  79 + s.setStationid(rs.getString("stationid"));
  80 + s.setNylx(rs.getInt("nylx"));
  81 + s.setJyggh(rs.getString("jyggh"));
  82 + s.setYj(rs.getDouble("yj"));
  83 + s.setLdgh(rs.getString("ldgh"));
  84 + s.setBz(rs.getString("bz"));
  85 + return s;
  86 + }
  87 + });
  88 +
  89 + //正式使用用下面代码
  90 +// for (int i = 0; i < iterator.size(); i++) {
  91 +// Ylxxb y1=iterator.get(i);
  92 +// boolean fage=true;
  93 +// String ldgh="";
  94 +// for (int j = 0; j < ylbIterator.size(); j++) {
  95 +// Ylb y2 = ylbIterator.get(j);
  96 +// if(y1.getNbbm().equals(y2.getNbbm())){
  97 +// if(y1.getJsy().equals(y2.getJsy())){
  98 +// fage=false;
  99 +// }
  100 +// ldgh +=y2.getJsy()+"/";
  101 +// }
  102 +// }
  103 +// if(fage){
  104 +// y1.setLdgh(ldgh);
  105 +// list.add(y1);
  106 +// }
  107 +// }
  108 +
  109 +
85 110
86 PageHelper pageHelper = new PageHelper(list.size(), map); 111 PageHelper pageHelper = new PageHelper(list.size(), map);
87 pageHelper.getMap(); 112 pageHelper.getMap();
88 - PageObject<Ylxxb> pageObject=pageHelper.getPageObject(); 113 + PageObject<Ylxxb> pageObject = pageHelper.getPageObject();
89 pageObject.setDataList(list); 114 pageObject.setDataList(list);
90 return pageObject; 115 return pageObject;
91 } 116 }
src/main/java/com/bsth/service/realcontrol/LineConfigService.java
@@ -16,4 +16,8 @@ public interface LineConfigService extends BaseService&lt;LineConfig, Integer&gt;{ @@ -16,4 +16,8 @@ public interface LineConfigService extends BaseService&lt;LineConfig, Integer&gt;{
16 Map<String, Object> editOutTimeType(String lineCode, int type); 16 Map<String, Object> editOutTimeType(String lineCode, int type);
17 17
18 LineConfig getByLineCode(String lineCode); 18 LineConfig getByLineCode(String lineCode);
  19 +
  20 + Map<String,Object> enableInParkForSource(String lineCode, int enable);
  21 +
  22 + Map<String,Object> bufferTimeDiff(String lineCode, String field, String value);
19 } 23 }
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
@@ -62,6 +62,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -62,6 +62,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
62 62
63 List<ScheduleRealInfo> queryUserInfo(String line,String date,String state); 63 List<ScheduleRealInfo> queryUserInfo(String line,String date,String state);
64 64
  65 + List<ScheduleRealInfo> queryUserInfoPx(String line,String date,String state,String type);
  66 +
65 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName,String date,String line); 67 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName,String date,String line);
66 68
67 List<ScheduleRealInfo> exportWaybillQp(String clZbh,String date,String line); 69 List<ScheduleRealInfo> exportWaybillQp(String clZbh,String date,String line);
@@ -122,7 +124,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -122,7 +124,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
122 Map<String,Object> scheduleDaily(String line,String date); 124 Map<String,Object> scheduleDaily(String line,String date);
123 125
124 List<ScheduleRealInfo> realScheduleList(String line,String date); 126 List<ScheduleRealInfo> realScheduleList(String line,String date);
125 - 127 + List<ScheduleRealInfo> realScheduleListQp(String line,String date);
126 128
127 List<Map<String,Object>> yesterdayDataList(String line,String date); 129 List<Map<String,Object>> yesterdayDataList(String line,String date);
128 130
@@ -151,4 +153,10 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -151,4 +153,10 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
151 Map<String, Object> exportWaybillMore(Map<String, Object> map); 153 Map<String, Object> exportWaybillMore(Map<String, Object> map);
152 154
153 List<SchedulePlanInfo> currentSchedulePlan(String lineCode); 155 List<SchedulePlanInfo> currentSchedulePlan(String lineCode);
  156 +
  157 + Map<String,Object> lpChangeMulti(String leftIdx, String rightIdx, int type);
  158 +
  159 + void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type);
  160 +
  161 + Map<String,Object> revokeRealArrive(Long id);
154 } 162 }
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
@@ -6,6 +6,8 @@ import com.bsth.entity.realcontrol.LineConfig; @@ -6,6 +6,8 @@ import com.bsth.entity.realcontrol.LineConfig;
6 import com.bsth.repository.realcontrol.LineConfigRepository; 6 import com.bsth.repository.realcontrol.LineConfigRepository;
7 import com.bsth.service.impl.BaseServiceImpl; 7 import com.bsth.service.impl.BaseServiceImpl;
8 import com.bsth.service.realcontrol.LineConfigService; 8 import com.bsth.service.realcontrol.LineConfigService;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
11 13
@@ -15,71 +17,124 @@ import java.util.List; @@ -15,71 +17,124 @@ import java.util.List;
15 import java.util.Map; 17 import java.util.Map;
16 18
17 @Service 19 @Service
18 -public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> implements LineConfigService{  
19 -  
20 - @Autowired  
21 - LineConfigRepository lineConfigRepository;  
22 -  
23 - @Autowired  
24 - LineConfigData lineConfigData;  
25 -  
26 - @Override  
27 - public Map<String, Object> check(String[] codeArray) {  
28 - Map<String, Object> rs = new HashMap<>();  
29 - List<String> notArr = new ArrayList<>();  
30 -  
31 - for(String lineCode : codeArray){  
32 - if(null == lineConfigData.get(lineCode + ""))  
33 - notArr.add(lineCode);  
34 - }  
35 -  
36 - if(notArr.size() > 0){  
37 - rs.put("status", 1);  
38 - rs.put("not", notArr);  
39 - }  
40 - else  
41 - rs.put("status", 0);  
42 - return rs;  
43 - }  
44 -  
45 - @Override  
46 - public Integer init(String lineCode) throws Exception{  
47 - LineConfig conf = lineConfigData.get(lineCode );  
48 -  
49 - if(conf == null)  
50 - lineConfigData.init(lineCode);  
51 -  
52 - return 1;  
53 - }  
54 -  
55 - @Override  
56 - public Map<String, Object> editStartOptTime(String time, String lineCode) {  
57 - Map<String, Object> rs = new HashMap<>();  
58 - LineConfig conf = lineConfigData.get(lineCode);  
59 - conf.setStartOpt(time);  
60 - lineConfigData.set(conf);  
61 -  
62 - rs.put("status", ResponseCode.SUCCESS);  
63 - rs.put("time", time);  
64 - return rs;  
65 - }  
66 -  
67 - @Override  
68 - public Map<String, Object> editOutTimeType(String lineCode, int type) {  
69 - Map<String, Object> rs = new HashMap<>();  
70 - LineConfig conf = lineConfigData.get(lineCode);  
71 -  
72 - conf.setOutConfig(type);  
73 - //conf.setInConfig(type);  
74 - lineConfigData.set(conf);  
75 -  
76 - rs.put("status", ResponseCode.SUCCESS);  
77 - rs.put("type", type);  
78 - return rs;  
79 - }  
80 -  
81 - @Override  
82 - public LineConfig getByLineCode(String lineCode) {  
83 - return lineConfigData.get(lineCode);  
84 - } 20 +public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> implements LineConfigService {
  21 +
  22 + @Autowired
  23 + LineConfigRepository lineConfigRepository;
  24 +
  25 + @Autowired
  26 + LineConfigData lineConfigData;
  27 +
  28 + Logger logger = LoggerFactory.getLogger(this.getClass());
  29 +
  30 + @Override
  31 + public Map<String, Object> check(String[] codeArray) {
  32 + Map<String, Object> rs = new HashMap<>();
  33 + List<String> notArr = new ArrayList<>();
  34 +
  35 + for (String lineCode : codeArray) {
  36 + if (null == lineConfigData.get(lineCode + ""))
  37 + notArr.add(lineCode);
  38 + }
  39 +
  40 + if (notArr.size() > 0) {
  41 + rs.put("status", 1);
  42 + rs.put("not", notArr);
  43 + } else
  44 + rs.put("status", 0);
  45 + return rs;
  46 + }
  47 +
  48 + @Override
  49 + public Integer init(String lineCode) throws Exception {
  50 + LineConfig conf = lineConfigData.get(lineCode);
  51 +
  52 + if (conf == null)
  53 + lineConfigData.init(lineCode);
  54 +
  55 + return 1;
  56 + }
  57 +
  58 + @Override
  59 + public Map<String, Object> editStartOptTime(String time, String lineCode) {
  60 + Map<String, Object> rs = new HashMap<>();
  61 + try {
  62 + LineConfig conf = lineConfigData.get(lineCode);
  63 + conf.setStartOpt(time);
  64 + lineConfigData.set(conf);
  65 +
  66 + rs.put("status", ResponseCode.SUCCESS);
  67 + rs.put("time", time);
  68 + } catch (Exception e) {
  69 + rs.put("status", ResponseCode.ERROR);
  70 + rs.put("msg", e.getMessage());
  71 + logger.error("", e);
  72 + }
  73 + return rs;
  74 + }
  75 +
  76 + @Override
  77 + public Map<String, Object> editOutTimeType(String lineCode, int type) {
  78 + Map<String, Object> rs = new HashMap<>();
  79 + try {
  80 + LineConfig conf = lineConfigData.get(lineCode);
  81 +
  82 + conf.setOutConfig(type);
  83 + //conf.setInConfig(type);
  84 + lineConfigData.set(conf);
  85 +
  86 + rs.put("status", ResponseCode.SUCCESS);
  87 + rs.put("type", type);
  88 + } catch (Exception e) {
  89 + rs.put("status", ResponseCode.ERROR);
  90 + rs.put("msg", e.getMessage());
  91 + logger.error("", e);
  92 + }
  93 + return rs;
  94 + }
  95 +
  96 + @Override
  97 + public LineConfig getByLineCode(String lineCode) {
  98 + return lineConfigData.get(lineCode);
  99 + }
  100 +
  101 + @Override
  102 + public Map<String, Object> enableInParkForSource(String lineCode, int enable) {
  103 + Map<String, Object> rs = new HashMap<>();
  104 + try {
  105 + LineConfig conf = lineConfigData.get(lineCode);
  106 +
  107 + conf.setInParkForSource(enable==1);
  108 + lineConfigData.set(conf);
  109 +
  110 + rs.put("status", ResponseCode.SUCCESS);
  111 + rs.put("enable", enable);
  112 + } catch (Exception e) {
  113 + rs.put("status", ResponseCode.ERROR);
  114 + rs.put("msg", e.getMessage());
  115 + logger.error("", e);
  116 + }
  117 + return rs;
  118 + }
  119 +
  120 + @Override
  121 + public Map<String, Object> bufferTimeDiff(String lineCode, String field, String value) {
  122 +
  123 + Map<String, Object> rs = new HashMap<>();
  124 + try {
  125 + LineConfig conf = lineConfigData.get(lineCode);
  126 +
  127 + conf.getClass().getField(field).set(conf, value);
  128 + lineConfigData.set(conf);
  129 +
  130 + rs.put("status", ResponseCode.SUCCESS);
  131 + rs.put("field", field);
  132 + rs.put("value", value);
  133 + } catch (Exception e) {
  134 + rs.put("status", ResponseCode.ERROR);
  135 + rs.put("msg", e.getMessage());
  136 + logger.error("", e);
  137 + }
  138 + return rs;
  139 + }
85 } 140 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -6,16 +6,16 @@ import com.alibaba.fastjson.JSONObject; @@ -6,16 +6,16 @@ import com.alibaba.fastjson.JSONObject;
6 import com.bsth.common.ResponseCode; 6 import com.bsth.common.ResponseCode;
7 import com.bsth.controller.realcontrol.dto.ChangePersonCar; 7 import com.bsth.controller.realcontrol.dto.ChangePersonCar;
8 import com.bsth.controller.realcontrol.dto.DfsjChange; 8 import com.bsth.controller.realcontrol.dto.DfsjChange;
  9 +import com.bsth.controller.realcontrol.dto.LpData;
9 import com.bsth.data.BasicData; 10 import com.bsth.data.BasicData;
10 import com.bsth.data.LineConfigData; 11 import com.bsth.data.LineConfigData;
11 -import com.bsth.data.arrival.ArrivalData_GPS;  
12 -import com.bsth.data.arrival.ArrivalEntity;  
13 import com.bsth.data.schedule.DayOfSchedule; 12 import com.bsth.data.schedule.DayOfSchedule;
14 import com.bsth.data.schedule.SchAttrCalculator; 13 import com.bsth.data.schedule.SchAttrCalculator;
15 import com.bsth.data.schedule.ScheduleComparator; 14 import com.bsth.data.schedule.ScheduleComparator;
16 import com.bsth.entity.Cars; 15 import com.bsth.entity.Cars;
17 import com.bsth.entity.Line; 16 import com.bsth.entity.Line;
18 import com.bsth.entity.Personnel; 17 import com.bsth.entity.Personnel;
  18 +import com.bsth.entity.oil.Ylb;
19 import com.bsth.entity.oil.Ylxxb; 19 import com.bsth.entity.oil.Ylxxb;
20 import com.bsth.entity.realcontrol.ChildTaskPlan; 20 import com.bsth.entity.realcontrol.ChildTaskPlan;
21 import com.bsth.entity.realcontrol.LineConfig; 21 import com.bsth.entity.realcontrol.LineConfig;
@@ -28,6 +28,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; @@ -28,6 +28,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo;
28 import com.bsth.entity.sys.DutyEmployee; 28 import com.bsth.entity.sys.DutyEmployee;
29 import com.bsth.entity.sys.SysUser; 29 import com.bsth.entity.sys.SysUser;
30 import com.bsth.repository.LineRepository; 30 import com.bsth.repository.LineRepository;
  31 +import com.bsth.repository.oil.YlbRepository;
31 import com.bsth.repository.oil.YlxxbRepository; 32 import com.bsth.repository.oil.YlxxbRepository;
32 import com.bsth.repository.realcontrol.ChildTaskPlanRepository; 33 import com.bsth.repository.realcontrol.ChildTaskPlanRepository;
33 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 34 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
@@ -55,9 +56,13 @@ import org.joda.time.format.DateTimeFormatter; @@ -55,9 +56,13 @@ import org.joda.time.format.DateTimeFormatter;
55 import org.slf4j.Logger; 56 import org.slf4j.Logger;
56 import org.slf4j.LoggerFactory; 57 import org.slf4j.LoggerFactory;
57 import org.springframework.beans.factory.annotation.Autowired; 58 import org.springframework.beans.factory.annotation.Autowired;
  59 +import org.springframework.jdbc.core.JdbcTemplate;
  60 +import org.springframework.jdbc.core.RowMapper;
58 import org.springframework.stereotype.Service; 61 import org.springframework.stereotype.Service;
59 62
60 import java.io.*; 63 import java.io.*;
  64 +import java.sql.ResultSet;
  65 +import java.sql.SQLException;
61 import java.text.DecimalFormat; 66 import java.text.DecimalFormat;
62 import java.text.ParseException; 67 import java.text.ParseException;
63 import java.text.SimpleDateFormat; 68 import java.text.SimpleDateFormat;
@@ -68,7 +73,8 @@ import java.util.zip.ZipOutputStream; @@ -68,7 +73,8 @@ import java.util.zip.ZipOutputStream;
68 @Service 73 @Service
69 public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long> 74 public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long>
70 implements ScheduleRealInfoService { 75 implements ScheduleRealInfoService {
71 - 76 + @Autowired
  77 + JdbcTemplate jdbcTemplate;
72 @Autowired 78 @Autowired
73 ScheduleRealInfoRepository scheduleRealInfoRepository; 79 ScheduleRealInfoRepository scheduleRealInfoRepository;
74 80
@@ -110,6 +116,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -110,6 +116,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
110 116
111 @Autowired 117 @Autowired
112 YlxxbRepository ylxxbRepository; 118 YlxxbRepository ylxxbRepository;
  119 +
  120 + @Autowired
  121 + YlbRepository ylbRepository;
113 122
114 Logger logger = LoggerFactory.getLogger(this.getClass()); 123 Logger logger = LoggerFactory.getLogger(this.getClass());
115 124
@@ -447,6 +456,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -447,6 +456,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
447 } 456 }
448 457
449 } 458 }
  459 +
  460 + @Override
  461 + public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state,String type) {
  462 +// List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
  463 + state=state+"";
  464 + String sqlPlan="select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh,"
  465 + + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName"
  466 + + " from bsth_c_s_sp_info_real s "
  467 + + " where s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"' "
  468 + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name,s.s_Gh,"
  469 + + " s.s_Name order by ("+state+") "+type;
  470 + List<ScheduleRealInfo> list= jdbcTemplate.query(sqlPlan,
  471 + new RowMapper<ScheduleRealInfo>(){
  472 + @Override
  473 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  474 + ScheduleRealInfo t=new ScheduleRealInfo();
  475 + t.setId(rs.getLong("id"));
  476 + t.setjGh(rs.getString("jGh"));
  477 + t.setClZbh(rs.getString("clZbh"));
  478 + t.setLpName(rs.getString("lpName"));
  479 + t.setjName(rs.getString("jName"));
  480 + t.setsGh(rs.getString("sGh"));
  481 + t.setsName(rs.getString("sName"));
  482 + return t;
  483 + }
  484 + });
  485 + return list;
  486 + }
450 487
451 /** 488 /**
452 * 489 *
@@ -773,8 +810,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -773,8 +810,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
773 rs.put("status", ResponseCode.ERROR); 810 rs.put("status", ResponseCode.ERROR);
774 rs.put("msg", "无实发时间,无法撤销!"); 811 rs.put("msg", "无实发时间,无法撤销!");
775 } else { 812 } else {
776 - //将对应的到离站数据标记为不可信  
777 - List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh()); 813 + //将对应的到离站数据标记为不可信 ### 废弃的代码 ####
  814 + /*List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh());
778 for (ArrivalEntity arr : list) { 815 for (ArrivalEntity arr : list) {
779 if (arr.getInOut() == 1 816 if (arr.getInOut() == 1
780 && arr.getUpDown() == Integer.parseInt(sch.getXlDir()) 817 && arr.getUpDown() == Integer.parseInt(sch.getXlDir())
@@ -783,7 +820,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -783,7 +820,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
783 arr.setEnable(false); 820 arr.setEnable(false);
784 break; 821 break;
785 } 822 }
786 - } 823 + }*/
787 824
788 sch.clearFcsjActual(); 825 sch.clearFcsjActual();
789 rs.put("status", ResponseCode.SUCCESS); 826 rs.put("status", ResponseCode.SUCCESS);
@@ -791,6 +828,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -791,6 +828,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
791 ts.add(sch); 828 ts.add(sch);
792 rs.put("ts", ts); 829 rs.put("ts", ts);
793 830
  831 + dayOfSchedule.save(sch);
  832 +
794 } 833 }
795 } catch (Exception e) { 834 } catch (Exception e) {
796 logger.error("", e); 835 logger.error("", e);
@@ -860,12 +899,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -860,12 +899,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
860 List<ScheduleRealInfo> ts = new ArrayList<>(); 899 List<ScheduleRealInfo> ts = new ArrayList<>();
861 try { 900 try {
862 Long id = Long.parseLong(map.get("id")); 901 Long id = Long.parseLong(map.get("id"));
863 - //班次类型  
864 - //String bcType = map.get("bcType");  
865 - //车辆自编号  
866 - //String clZbh = map.get("clZbh");  
867 - //计划发车时间  
868 - //String fcsj = map.get("fcsj");  
869 //实际发车时间 902 //实际发车时间
870 String fcsjActual = map.get("fcsjActual"); 903 String fcsjActual = map.get("fcsjActual");
871 //实际终点时间 904 //实际终点时间
@@ -927,6 +960,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -927,6 +960,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
927 } catch (NumberFormatException e) { 960 } catch (NumberFormatException e) {
928 logger.error("", e); 961 logger.error("", e);
929 } 962 }
  963 +
  964 + //修改班次里程
  965 + String jhlc = map.get("jhlc");
  966 + if(StringUtils.isNotEmpty(jhlc)
  967 + && Double.parseDouble(jhlc) != sch.getJhlc()){
  968 + sch.setJhlc(Double.parseDouble(jhlc));
  969 + }
930 } 970 }
931 971
932 String bcType = map.get("bcType"); 972 String bcType = map.get("bcType");
@@ -1359,39 +1399,50 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1359,39 +1399,50 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1359 if (s.getRemarks() != null) { 1399 if (s.getRemarks() != null) {
1360 remarks += s.getRemarks(); 1400 remarks += s.getRemarks();
1361 } 1401 }
1362 - 1402 +
1363 Set<ChildTaskPlan> childTaskPlans = s.getcTasks(); 1403 Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
1364 - if (childTaskPlans.isEmpty()) {  
1365 - if(s.getStatus()==-1){  
1366 - if(remarks.indexOf("烂班")>-1){  
1367 - remarks +="(烂班)";  
1368 - }  
1369 - s.setRemarks(remarks);  
1370 - }  
1371 -  
1372 - }else{ 1404 + if (!childTaskPlans.isEmpty()) {
  1405 + s.setFcsjActual("");
  1406 + s.setZdsjActual("");
  1407 + }
  1408 +
  1409 + if(s.isDestroy()){
1373 s.setFcsjActual(""); 1410 s.setFcsjActual("");
1374 s.setZdsjActual(""); 1411 s.setZdsjActual("");
  1412 + s.setJhlc(0.0);
  1413 + remarks +="(烂班)";
  1414 + s.setRemarks(remarks);
1375 } 1415 }
1376 listSchedule.add(s); 1416 listSchedule.add(s);
1377 - if(!childTaskPlans.isEmpty()){  
1378 - Iterator<ChildTaskPlan> it = childTaskPlans.iterator();  
1379 - while (it.hasNext()) {  
1380 - ChildTaskPlan c = it.next();  
1381 - if(!c.isDestroy()){  
1382 - ScheduleRealInfo t=new ScheduleRealInfo();  
1383 - t.setFcsjActual(c.getStartDate());  
1384 - t.setZdsjActual(c.getEndDate());  
1385 - t.setQdzName(c.getStartStationName());  
1386 - t.setZdzName(c.getEndStationName());  
1387 - t.setJhlc( Double.parseDouble(String.valueOf(c.getMileage())));  
1388 - t.setRemarks(c.getRemarks());  
1389 - t.setAdjustExps("子");  
1390 - listSchedule.add(t);  
1391 - }  
1392 - } 1417 + //计算营运里程,空驶里程
  1418 + if (!childTaskPlans.isEmpty()) {
  1419 + String sqlPc="select * from bsth_c_s_child_task where schedule="+s.getId() +" order by start_date ";
  1420 + List<ScheduleRealInfo> lists= jdbcTemplate.query(sqlPc,
  1421 + new RowMapper<ScheduleRealInfo>(){
  1422 + @Override
  1423 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  1424 + ScheduleRealInfo t=new ScheduleRealInfo();
  1425 + if(rs.getInt("destroy")==0){
  1426 + t.setFcsjActual(rs.getString("start_date"));
  1427 + t.setZdsjActual(rs.getString("end_date"));
  1428 + t.setJhlc(rs.getDouble("mileage"));
  1429 + }else{
  1430 + t.setFcsjActual("");
  1431 + t.setZdsjActual("");
  1432 + t.setJhlc(0.0);
  1433 + }
  1434 + t.setQdzName(rs.getString("start_station_name"));
  1435 + t.setZdzName(rs.getString("end_station_name"));
  1436 + t.setRemarks(rs.getString("remarks"));
  1437 + t.setAdjustExps("子");
  1438 + return t;
  1439 + }
  1440 + });
  1441 + for (int j = 0; j < lists.size(); j++) {
  1442 + ScheduleRealInfo t=lists.get(j);
  1443 + listSchedule.add(t);
  1444 + }
1393 } 1445 }
1394 -  
1395 } 1446 }
1396 1447
1397 return listSchedule; 1448 return listSchedule;
@@ -1618,7 +1669,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1618,7 +1669,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1618 jhbc_a++; 1669 jhbc_a++;
1619 jhbc_aZ++; 1670 jhbc_aZ++;
1620 } 1671 }
1621 - if (scheduleRealInfo.getStatus() == 2) { 1672 + if (scheduleRealInfo.getStatus() != -1) {
1622 sjbc++; 1673 sjbc++;
1623 sjbcZ++; 1674 sjbcZ++;
1624 if ((Integer.parseInt(fcsjActual[0]) * 60 + Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0]) * 60 + Integer.parseInt(fcsjActual[1])) < sj_1) { 1675 if ((Integer.parseInt(fcsjActual[0]) * 60 + Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0]) * 60 + Integer.parseInt(fcsjActual[1])) < sj_1) {
@@ -2002,7 +2053,99 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2002,7 +2053,99 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2002 String zdsjActual=""; 2053 String zdsjActual="";
2003 String zdsj1=""; 2054 String zdsj1="";
2004 String zdsjActual1=""; 2055 String zdsjActual1="";
2005 - List<ScheduleRealInfo> listInfo=scheduleRealInfoRepository.scheduleByDateAndLine(line, date); 2056 + List<ScheduleRealInfo> listInfo=scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);
  2057 + for (int i = 0; i < listInfo.size(); i++) {
  2058 + ScheduleRealInfo t=listInfo.get(i);
  2059 + if(!lpName.equals(t.getLpName())){
  2060 + zdsjActual=t.getZdsjActual();
  2061 + zdsj=t.getZdsj();
  2062 + t.setZdsjActual("");
  2063 + t.setZdsj("");
  2064 + }else{
  2065 + zdsj1=t.getZdsj();
  2066 + zdsjActual1=t.getZdsjActual();
  2067 + t.setZdsjActual(zdsjActual);
  2068 + t.setZdsj(zdsj);
  2069 + zdsj=zdsj1;
  2070 + zdsjActual=zdsjActual1;
  2071 + }
  2072 + lpName=t.getLpName();
  2073 + list.add(t);
  2074 + }
  2075 +
  2076 + List<ScheduleRealInfo> listInfo2=scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
  2077 + List<ScheduleRealInfo> xList=new ArrayList<ScheduleRealInfo>();
  2078 + List<ScheduleRealInfo> yList=new ArrayList<ScheduleRealInfo>();
  2079 + List<ScheduleRealInfo> zList=new ArrayList<ScheduleRealInfo>();
  2080 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  2081 + if(listInfo2.size()>0){
  2082 + int a=listInfo2.size()%3;
  2083 + int b=listInfo2.size()/3;
  2084 + int x = 0,y=0;
  2085 + if(a==2){
  2086 + x=b+1;y=x*2;;
  2087 + }else if(b==1){
  2088 + x=b+1;y=x*2-1;;
  2089 + }else{
  2090 + x=b;
  2091 + y=2*x;
  2092 +
  2093 + }
  2094 + for (int i = 0; i < listInfo2.size(); i++) {
  2095 + ScheduleRealInfo s=listInfo2.get(i);
  2096 + if(i+1<=x){
  2097 + xList.add(s);
  2098 + }else if((i+1)>x&&(i+1)<=y){
  2099 + yList.add(s);
  2100 + }else{
  2101 + zList.add(s);
  2102 + }
  2103 + }
  2104 + for (int i = 0; i < x; i++) {
  2105 + newList.add(xList.get(i));
  2106 + if(yList.size()>i){
  2107 + newList.add(yList.get(i));
  2108 + }else{
  2109 + newList.add(new ScheduleRealInfo());
  2110 + }
  2111 + if(zList.size()>i){
  2112 + newList.add(zList.get(i));
  2113 + }else{
  2114 + newList.add(new ScheduleRealInfo());
  2115 + }
  2116 +
  2117 + }
  2118 + }
  2119 + for (int i = 0; i < newList.size(); i++) {
  2120 + ScheduleRealInfo t1=newList.get(i);
  2121 + for (int j = 0; j < list.size(); j++) {
  2122 + ScheduleRealInfo t2=list.get(j);
  2123 + if(t1.getId()==t2.getId()){
  2124 + t1=t2;
  2125 + }
  2126 + }
  2127 + }
  2128 + return newList;
  2129 + }
  2130 +
  2131 + @Override
  2132 + public List<ScheduleRealInfo> realScheduleListQp(String line, String date) {
  2133 + /*List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.queryUserInfo(line, date);
  2134 + List<ScheduleRealInfo> listTotal = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
  2135 + for(ScheduleRealInfo info:listInfo){
  2136 + for(ScheduleRealInfo total:listTotal){
  2137 + if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){
  2138 +
  2139 + }
  2140 + }
  2141 + }*/
  2142 + List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
  2143 + String lpName="lpName";
  2144 + String zdsj="";
  2145 + String zdsjActual="";
  2146 + String zdsj1="";
  2147 + String zdsjActual1="";
  2148 + List<ScheduleRealInfo> listInfo=scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);
2006 for (int i = 0; i < listInfo.size(); i++) { 2149 for (int i = 0; i < listInfo.size(); i++) {
2007 ScheduleRealInfo t=listInfo.get(i); 2150 ScheduleRealInfo t=listInfo.get(i);
2008 if(!lpName.equals(t.getLpName())){ 2151 if(!lpName.equals(t.getLpName())){
@@ -2037,7 +2180,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2037,7 +2180,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2037 return list; 2180 return list;
2038 } 2181 }
2039 2182
2040 -  
2041 public List<Map<String, Object>> yesterdayDataList(String line, String date) { 2183 public List<Map<String, Object>> yesterdayDataList(String line, String date) {
2042 //前一天日期 2184 //前一天日期
2043 // String date = sdfMonth.format(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1)); 2185 // String date = sdfMonth.format(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1));
@@ -2203,6 +2345,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2203,6 +2345,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2203 set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh())); 2345 set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh()));
2204 } 2346 }
2205 2347
  2348 + dayOfSchedule.save(sch);
  2349 +
2206 } 2350 }
2207 rs.put("ts", set); 2351 rs.put("ts", set);
2208 rs.put("status", ResponseCode.SUCCESS); 2352 rs.put("status", ResponseCode.SUCCESS);
@@ -2218,7 +2362,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2218,7 +2362,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2218 return; 2362 return;
2219 String jName = BasicData.allPerson.get(jGh); 2363 String jName = BasicData.allPerson.get(jGh);
2220 if (StringUtils.isNotEmpty(jName)) { 2364 if (StringUtils.isNotEmpty(jName)) {
2221 - sch.setjGh(jGh); 2365 +
  2366 + if(jGh.indexOf("-") != -1)
  2367 + sch.setjGh(jGh.substring(jGh.indexOf("-") + 1));
  2368 + else
  2369 + sch.setjGh(jGh);
  2370 +
2222 sch.setjName(jName); 2371 sch.setjName(jName);
2223 } 2372 }
2224 } 2373 }
@@ -2847,7 +2996,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2847,7 +2996,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2847 Ylxxb y=listYlxxb.get(t); 2996 Ylxxb y=listYlxxb.get(t);
2848 jzl += y.getJzl(); 2997 jzl += y.getJzl();
2849 } 2998 }
  2999 +
  3000 + List<Ylb> listYlb=ylbRepository.queryListYlb( fcrq,s.getClZbh());
  3001 + Double ccyl=0.0;
  3002 + Double jcyl=0.0;
  3003 + Double yh=0.0;
  3004 + for (int i = 0; i < listYlb.size(); i++) {
  3005 + Ylb y=listYlb.get(i);
  3006 + ccyl +=y.getCzyl();
  3007 + jcyl+= y.getJzyl();
  3008 + yh+=y.getYh();
  3009 +
  3010 + }
2850 map.put("jzl", jzl); 3011 map.put("jzl", jzl);
  3012 + map.put("yh", yh);
  3013 + map.put("ccyl", ccyl);
  3014 + map.put("jcyl", jcyl);
2851 map.put("xlName", s.getXlName()); 3015 map.put("xlName", s.getXlName());
2852 map.put("clZbh", s.getClZbh()); 3016 map.put("clZbh", s.getClZbh());
2853 map.put("fcsjActual", s.getFcsjActual()); 3017 map.put("fcsjActual", s.getFcsjActual());
@@ -3247,4 +3411,88 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3247,4 +3411,88 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3247 } 3411 }
3248 return rs; 3412 return rs;
3249 } 3413 }
  3414 +
  3415 +
  3416 + @Override
  3417 + public Map<String, Object> lpChangeMulti(String leftIdx, String rightIdx, int type) {
  3418 + Map<String, Object> rs = new HashMap<>();
  3419 + List<ScheduleRealInfo> ts = new ArrayList<>();
  3420 + try {
  3421 + List<String> leftList = Splitter.on(",").splitToList(leftIdx);
  3422 + List<String> rightList = Splitter.on(",").splitToList(rightIdx);
  3423 + if(leftList.size() != rightList.size()){
  3424 + rs.put("status", ResponseCode.ERROR);
  3425 + rs.put("msg", "不对称的对调!");
  3426 + return rs;
  3427 + }
  3428 +
  3429 + ScheduleRealInfo leftSch, rightSch;
  3430 + for(int i = 0; i < leftList.size(); i ++){
  3431 + leftSch = dayOfSchedule.get(Long.parseLong(leftList.get(i)));
  3432 + rightSch = dayOfSchedule.get(Long.parseLong(rightList.get(i)));
  3433 +
  3434 + //调换路牌
  3435 + lpChange(leftSch, rightSch, type);
  3436 +
  3437 + ts.add(leftSch);
  3438 + ts.add(rightSch);
  3439 +
  3440 + dayOfSchedule.save(leftSch);
  3441 + dayOfSchedule.save(rightSch);
  3442 + }
  3443 +
  3444 + rs.put("status", ResponseCode.SUCCESS);
  3445 + rs.put("ts", ts);
  3446 + }catch(Exception e){
  3447 + logger.error("", e);
  3448 + rs.put("status", ResponseCode.ERROR);
  3449 + rs.put("msg", e.getMessage());
  3450 + }
  3451 +
  3452 + return rs;
  3453 + }
  3454 +
  3455 + @Override
  3456 + public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) {
  3457 + LpData leftData = new LpData(leftSch);
  3458 + LpData rightData = new LpData(rightSch);
  3459 +
  3460 + leftData.appendTo(rightSch, type);
  3461 + rightData.appendTo(leftSch, type);
  3462 + }
  3463 +
  3464 + @Override
  3465 + public Map<String, Object> revokeRealArrive(Long id) {
  3466 + Map<String, Object> rs = new HashMap<>();
  3467 + List<ScheduleRealInfo> ts = new ArrayList<>();
  3468 +
  3469 + try {
  3470 + ScheduleRealInfo sch = dayOfSchedule.get(id);
  3471 + if (sch.getZdsjActual() == null) {
  3472 + rs.put("status", ResponseCode.ERROR);
  3473 + rs.put("msg", "无实际到达时间,无法撤销!");
  3474 + } else {
  3475 +
  3476 + sch.clearZdsjActual();
  3477 + //清除下一个班次的起点到达时间
  3478 + ScheduleRealInfo next = dayOfSchedule.next(sch);
  3479 + if (null != next) {
  3480 + next.setQdzArrDateSJ(null);
  3481 + ts.add(next);
  3482 + }
  3483 +
  3484 + rs.put("status", ResponseCode.SUCCESS);
  3485 +
  3486 + ts.add(sch);
  3487 + rs.put("ts", ts);
  3488 +
  3489 + dayOfSchedule.save(sch);
  3490 +
  3491 + }
  3492 + } catch (Exception e) {
  3493 + logger.error("", e);
  3494 + rs.put("status", ResponseCode.ERROR);
  3495 + }
  3496 + return rs;
  3497 + }
3250 } 3498 }
3251 \ No newline at end of file 3499 \ No newline at end of file
src/main/java/com/bsth/service/schedule/SchedulePlanInfoService.java
@@ -115,8 +115,12 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L @@ -115,8 +115,12 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L
115 /** 售票员1姓名 */ 115 /** 售票员1姓名 */
116 private String spy2Name; 116 private String spy2Name;
117 117
118 - /** 创建时间 */  
119 - private Date createDate; 118 + /** 修改时间 */
  119 + private Date updateDate;
  120 + /** 修改人名 */
  121 + private String updateByName;
  122 + /** 时刻表名字 */
  123 + private String ttInfoName;
120 124
121 /** 出场班次1发车的顺序号 */ 125 /** 出场班次1发车的顺序号 */
122 private Integer fcno1; 126 private Integer fcno1;
@@ -141,7 +145,7 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L @@ -141,7 +145,7 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L
141 // 出场时间,出场班次,如果有多个,需要分开 145 // 出场时间,出场班次,如果有多个,需要分开
142 Object ccsj = datas[6]; 146 Object ccsj = datas[6];
143 Object bctype = datas[7]; 147 Object bctype = datas[7];
144 - Object fcno = datas[15]; 148 + Object fcno = datas[14];
145 149
146 if (ccsj != null) { 150 if (ccsj != null) {
147 String[] ccsj_array = ((String) ccsj).split(","); 151 String[] ccsj_array = ((String) ccsj).split(",");
@@ -238,12 +242,32 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L @@ -238,12 +242,32 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L
238 this.spy1Name = String.valueOf(spyName_array[0]); 242 this.spy1Name = String.valueOf(spyName_array[0]);
239 } 243 }
240 } 244 }
241 - // 创建时间  
242 - this.createDate = new DateTime(datas[14]).toDate(); 245 + // 修改时间
  246 + this.updateDate = new DateTime(datas[15]).toDate();
  247 + // 修改人
  248 + this.updateByName = String.valueOf(datas[16]);
  249 + // 时刻表名字
  250 + this.ttInfoName = String.valueOf(datas[17]);
243 251
244 // TODO:可能还有其他字段 252 // TODO:可能还有其他字段
245 } 253 }
246 254
  255 + public Date getUpdateDate() {
  256 + return updateDate;
  257 + }
  258 +
  259 + public void setUpdateDate(Date updateDate) {
  260 + this.updateDate = updateDate;
  261 + }
  262 +
  263 + public String getUpdateByName() {
  264 + return updateByName;
  265 + }
  266 +
  267 + public void setUpdateByName(String updateByName) {
  268 + this.updateByName = updateByName;
  269 + }
  270 +
247 public String getXlName() { 271 public String getXlName() {
248 return xlName; 272 return xlName;
249 } 273 }
@@ -396,14 +420,6 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L @@ -396,14 +420,6 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L
396 this.spy2Name = spy2Name; 420 this.spy2Name = spy2Name;
397 } 421 }
398 422
399 - public Date getCreateDate() {  
400 - return createDate;  
401 - }  
402 -  
403 - public void setCreateDate(Date createDate) {  
404 - this.createDate = createDate;  
405 - }  
406 -  
407 public Integer getXlId() { 423 public Integer getXlId() {
408 return xlId; 424 return xlId;
409 } 425 }
@@ -427,5 +443,13 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L @@ -427,5 +443,13 @@ public interface SchedulePlanInfoService extends BaseService&lt;SchedulePlanInfo, L
427 public void setFcno2(Integer fcno2) { 443 public void setFcno2(Integer fcno2) {
428 this.fcno2 = fcno2; 444 this.fcno2 = fcno2;
429 } 445 }
  446 +
  447 + public String getTtInfoName() {
  448 + return ttInfoName;
  449 + }
  450 +
  451 + public void setTtInfoName(String ttInfoName) {
  452 + this.ttInfoName = ttInfoName;
  453 + }
430 } 454 }
431 } 455 }
src/main/java/com/bsth/service/schedule/SchedulePlanService.java
1 package com.bsth.service.schedule; 1 package com.bsth.service.schedule;
2 2
3 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
4 -import com.bsth.entity.sys.CompanyAuthority;  
5 import com.bsth.service.schedule.rules.ttinfo2.Result; 4 import com.bsth.service.schedule.rules.ttinfo2.Result;
6 5
7 import java.util.Date; 6 import java.util.Date;
@@ -11,7 +10,7 @@ import java.util.Date; @@ -11,7 +10,7 @@ import java.util.Date;
11 */ 10 */
12 public interface SchedulePlanService extends BService<SchedulePlan, Long> { 11 public interface SchedulePlanService extends BService<SchedulePlan, Long> {
13 12
14 - SchedulePlan save(SchedulePlan schedulePlan, CompanyAuthority companyAuthority); 13 + SchedulePlan save(SchedulePlan schedulePlan);
15 14
16 /** 15 /**
17 * 获取有明日排班的计划。 16 * 获取有明日排班的计划。
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
1 package com.bsth.service.schedule.impl; 1 package com.bsth.service.schedule.impl;
2 2
  3 +import com.bsth.entity.Business;
3 import com.bsth.entity.Line; 4 import com.bsth.entity.Line;
4 import com.bsth.entity.schedule.*; 5 import com.bsth.entity.schedule.*;
5 import com.bsth.entity.schedule.rule.ScheduleRule1Flat; 6 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
6 -import com.bsth.entity.sys.CompanyAuthority;  
7 import com.bsth.repository.schedule.SchedulePlanInfoRepository; 7 import com.bsth.repository.schedule.SchedulePlanInfoRepository;
8 import com.bsth.repository.schedule.SchedulePlanRepository; 8 import com.bsth.repository.schedule.SchedulePlanRepository;
  9 +import com.bsth.service.BusinessService;
9 import com.bsth.service.LineService; 10 import com.bsth.service.LineService;
10 import com.bsth.service.schedule.SchedulePlanService; 11 import com.bsth.service.schedule.SchedulePlanService;
11 import com.bsth.service.schedule.TTInfoDetailService; 12 import com.bsth.service.schedule.TTInfoDetailService;
@@ -51,12 +52,14 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -51,12 +52,14 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
51 private TTInfoService ttInfoService; 52 private TTInfoService ttInfoService;
52 @Autowired 53 @Autowired
53 private TTInfoDetailService ttInfoDetailService; 54 private TTInfoDetailService ttInfoDetailService;
  55 + @Autowired
  56 + private BusinessService businessService;
54 57
55 /** 日志记录器 */ 58 /** 日志记录器 */
56 private Logger logger = LoggerFactory.getLogger(SchedulePlanServiceImpl.class); 59 private Logger logger = LoggerFactory.getLogger(SchedulePlanServiceImpl.class);
57 60
58 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) 61 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
59 - public SchedulePlan save(SchedulePlan schedulePlan, CompanyAuthority companyAuthority) { 62 + public SchedulePlan save(SchedulePlan schedulePlan) {
60 // 1-1、查找线路具体信息 63 // 1-1、查找线路具体信息
61 Line xl = strategy.getLine(schedulePlan.getXl().getId()); 64 Line xl = strategy.getLine(schedulePlan.getXl().getId());
62 // 1-2、查出指定线路的所有规则 65 // 1-2、查出指定线路的所有规则
@@ -82,6 +85,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -82,6 +85,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
82 KieSession session = kieBase.newKieSession(); 85 KieSession session = kieBase.newKieSession();
83 // 设置gloable对象,在drl中通过别名使用 86 // 设置gloable对象,在drl中通过别名使用
84 session.setGlobal("scheduleResult", scheduleResults_output); 87 session.setGlobal("scheduleResult", scheduleResults_output);
  88 + session.setGlobal("log", logger); // 设置日志
85 89
86 // 载入数据 90 // 载入数据
87 session.insert(scheduleCalcuParam_input); 91 session.insert(scheduleCalcuParam_input);
@@ -148,11 +152,46 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -148,11 +152,46 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
148 employeeConfigInfoList, 152 employeeConfigInfoList,
149 schedulePlan); 153 schedulePlan);
150 154
151 - // 公司,分公司编码  
152 - schedulePlanInfo.setGsBm(companyAuthority.getCompanyCode());  
153 - schedulePlanInfo.setGsName(companyAuthority.getCompanyName());  
154 - schedulePlanInfo.setFgsBm(companyAuthority.getSubCompanyCode());  
155 - schedulePlanInfo.setFgsName(companyAuthority.getSubCompanyName()); 155 + // 获取公司,分公司信息
  156 + String gsbm = xl.getCompany();
  157 + String fgsbm = xl.getBrancheCompany();
  158 + Business gs = null;
  159 + Business fgs = null;
  160 +
  161 + Map<String, Object> param = new HashMap<>();
  162 +
  163 + if (StringUtils.isNotEmpty(gsbm)) {
  164 + param.clear();
  165 + param.put("businessCode_eq", gsbm);
  166 + Iterator<Business> businessIterator = businessService.list(param).iterator();
  167 + if (businessIterator.hasNext()) {
  168 + gs = businessIterator.next();
  169 + }
  170 + }
  171 + if (StringUtils.isNotEmpty(gsbm) && StringUtils.isNotEmpty(fgsbm)) {
  172 + param.clear();;
  173 + param.put("upCode_eq", gsbm);
  174 + param.put("businessCode_eq", fgsbm);
  175 + Iterator<Business> businessIterator = businessService.list(param).iterator();
  176 + if (businessIterator.hasNext()) {
  177 + fgs = businessIterator.next();
  178 + }
  179 + }
  180 +
  181 + if (gs != null) {
  182 + schedulePlanInfo.setGsBm(gs.getBusinessCode());
  183 + schedulePlanInfo.setGsName(gs.getBusinessName());
  184 + }
  185 + if (fgs != null) {
  186 + schedulePlanInfo.setFgsBm(fgs.getBusinessCode());
  187 + schedulePlanInfo.setFgsName(fgs.getBusinessName());
  188 + }
  189 +
  190 + // 操作人,操作时间
  191 + schedulePlanInfo.setCreateBy(schedulePlan.getCreateBy());
  192 + schedulePlanInfo.setCreateDate(schedulePlan.getCreateDate());
  193 + schedulePlanInfo.setUpdateBy(schedulePlan.getUpdateBy());
  194 + schedulePlanInfo.setUpdateDate(schedulePlan.getUpdateDate());
156 195
157 schedulePlanInfos.add(schedulePlanInfo); 196 schedulePlanInfos.add(schedulePlanInfo);
158 ttInfoMap.put(ttInfoDetail.getTtinfo().getId(), ttInfoDetail.getTtinfo().getName()); 197 ttInfoMap.put(ttInfoDetail.getTtinfo().getId(), ttInfoDetail.getTtinfo().getName());
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
@@ -169,8 +169,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im @@ -169,8 +169,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
169 Map<String, Object> ktrParms = new HashMap<>(); 169 Map<String, Object> ktrParms = new HashMap<>();
170 File ktrFile = new File(this.getClass().getResource( 170 File ktrFile = new File(this.getClass().getResource(
171 dataToolsProperties.getTtinfodetailMetadatainputktr()).toURI()); 171 dataToolsProperties.getTtinfodetailMetadatainputktr()).toURI());
  172 +// File ktrFile2 = new File(this.getClass().getResource(
  173 +// dataToolsProperties.getTtinfodetailDatainputktr()).toURI());
172 File ktrFile2 = new File(this.getClass().getResource( 174 File ktrFile2 = new File(this.getClass().getResource(
173 - dataToolsProperties.getTtinfodetailDatainputktr()).toURI()); 175 + dataToolsProperties.getTtinfodetailDatainputktr2()).toURI());
174 176
175 // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 177 // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径
176 ktrParms.put("transpath", ktrFile.getAbsolutePath()); 178 ktrParms.put("transpath", ktrFile.getAbsolutePath());
src/main/java/com/bsth/service/schedule/rules/ttinfo2/CalcuParam.java
1 -package com.bsth.service.schedule.rules.ttinfo2;  
2 -  
3 -import org.joda.time.DateTime;  
4 -  
5 -/**  
6 - * 时刻表计算参数。  
7 - */  
8 -public class CalcuParam {  
9 - /** 开始计算时间 */  
10 - private DateTime fromDate;  
11 - /** 结束计算时间 */  
12 - private DateTime toDate;  
13 - /** 线路id */  
14 - private Integer xlId;  
15 -  
16 - public CalcuParam() {}  
17 - public CalcuParam(  
18 - DateTime fromDate,  
19 - DateTime toDate,  
20 - Integer xlId) {  
21 - this.fromDate = fromDate;  
22 - this.toDate = toDate;  
23 - this.xlId = xlId;  
24 - }  
25 -  
26 - public DateTime getFromDate() {  
27 - return fromDate;  
28 - }  
29 -  
30 - public void setFromDate(DateTime fromDate) {  
31 - this.fromDate = fromDate;  
32 - }  
33 -  
34 - public DateTime getToDate() {  
35 - return toDate;  
36 - }  
37 -  
38 - public void setToDate(DateTime toDate) {  
39 - this.toDate = toDate;  
40 - }  
41 -  
42 - public Integer getXlId() {  
43 - return xlId;  
44 - }  
45 -  
46 - public void setXlId(Integer xlId) {  
47 - this.xlId = xlId;  
48 - }  
49 -} 1 +package com.bsth.service.schedule.rules.ttinfo2;
  2 +
  3 +import org.joda.time.DateTime;
  4 +
  5 +/**
  6 + * 时刻表计算参数。
  7 + */
  8 +public class CalcuParam {
  9 + /** 开始计算时间 */
  10 + private DateTime fromDate;
  11 + /** 结束计算时间 */
  12 + private DateTime toDate;
  13 + /** 线路id */
  14 + private Integer xlId;
  15 +
  16 + public CalcuParam() {}
  17 + public CalcuParam(
  18 + DateTime fromDate,
  19 + DateTime toDate,
  20 + Integer xlId) {
  21 + this.fromDate = fromDate;
  22 + this.toDate = toDate;
  23 + this.xlId = xlId;
  24 + }
  25 +
  26 + public DateTime getFromDate() {
  27 + return fromDate;
  28 + }
  29 +
  30 + public void setFromDate(DateTime fromDate) {
  31 + this.fromDate = fromDate;
  32 + }
  33 +
  34 + public DateTime getToDate() {
  35 + return toDate;
  36 + }
  37 +
  38 + public void setToDate(DateTime toDate) {
  39 + this.toDate = toDate;
  40 + }
  41 +
  42 + public Integer getXlId() {
  43 + return xlId;
  44 + }
  45 +
  46 + public void setXlId(Integer xlId) {
  47 + this.xlId = xlId;
  48 + }
  49 +}
src/main/java/com/bsth/service/schedule/rules/ttinfo2/ErrorBcCountFunction.java
1 -package com.bsth.service.schedule.rules.ttinfo2;  
2 -  
3 -import com.bsth.entity.schedule.TTInfoDetail;  
4 -import org.kie.api.runtime.rule.AccumulateFunction;  
5 -  
6 -import java.io.*;  
7 -  
8 -/**  
9 - * Created by xu on 17/2/28.  
10 - */  
11 -public class ErrorBcCountFunction implements AccumulateFunction {  
12 - @Override  
13 - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {  
14 - }  
15 -  
16 - @Override  
17 - public void writeExternal(ObjectOutput out) throws IOException {  
18 - }  
19 -  
20 - protected static class ErrorCountData implements Externalizable {  
21 - public long errorcount = 0;  
22 - public TTInfoDetail ttInfoDetail;  
23 -  
24 - public ErrorCountData() {  
25 - }  
26 -  
27 - @Override  
28 - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {  
29 - errorcount = in.readLong();  
30 - ttInfoDetail = (TTInfoDetail) in.readObject();  
31 - }  
32 -  
33 - @Override  
34 - public void writeExternal(ObjectOutput out) throws IOException {  
35 - out.writeLong(errorcount);  
36 - out.writeObject(ttInfoDetail);  
37 - }  
38 - }  
39 -  
40 - @Override  
41 - public Serializable createContext() {  
42 - return new ErrorCountData();  
43 - }  
44 -  
45 - @Override  
46 - public void init(Serializable context) throws Exception {  
47 - ErrorCountData errorCountData = (ErrorCountData) context;  
48 - errorCountData.errorcount = 0;  
49 - }  
50 -  
51 - @Override  
52 - public void accumulate(Serializable context, Object value) {  
53 - ErrorCountData errorCountData = (ErrorCountData) context;  
54 - TTInfoDetail ttInfoDetail = (TTInfoDetail) value;  
55 -  
56 - if (ttInfoDetail.getTtinfo() == null) {  
57 - errorCountData.errorcount ++;  
58 - return;  
59 - }  
60 -  
61 - if ("in".equals(ttInfoDetail.getBcType())) {  
62 - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getTcc() == null) {  
63 - errorCountData.errorcount ++;  
64 - }  
65 - } else if ("out".equals(ttInfoDetail.getBcType())) {  
66 - if (ttInfoDetail.getTcc() == null || ttInfoDetail.getZdz() == null) {  
67 - errorCountData.errorcount ++;  
68 - }  
69 - } else {  
70 - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getZdz() == null) {  
71 - errorCountData.errorcount ++;  
72 - }  
73 - }  
74 - }  
75 -  
76 - @Override  
77 - public void reverse(Serializable context, Object value) throws Exception {  
78 - ErrorCountData errorCountData = (ErrorCountData) context;  
79 - TTInfoDetail ttInfoDetail = (TTInfoDetail) value;  
80 -  
81 - if (ttInfoDetail.getTtinfo() == null) {  
82 - errorCountData.errorcount --;  
83 - return;  
84 - }  
85 -  
86 - if ("in".equals(ttInfoDetail.getBcType())) {  
87 - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getTcc() == null) {  
88 - errorCountData.errorcount --;  
89 - }  
90 - } else if ("out".equals(ttInfoDetail.getBcType())) {  
91 - if (ttInfoDetail.getTcc() == null || ttInfoDetail.getZdz() == null) {  
92 - errorCountData.errorcount --;  
93 - }  
94 - } else {  
95 - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getZdz() == null) {  
96 - errorCountData.errorcount --;  
97 - }  
98 - }  
99 -  
100 - }  
101 -  
102 - @Override  
103 - public Object getResult(Serializable context) throws Exception {  
104 - ErrorCountData errorCountData = (ErrorCountData) context;  
105 - return errorCountData.errorcount;  
106 - }  
107 -  
108 - @Override  
109 - public boolean supportsReverse() {  
110 - return true;  
111 - }  
112 -  
113 - @Override  
114 - public Class<?> getResultType() {  
115 - return Number.class;  
116 - }  
117 -} 1 +package com.bsth.service.schedule.rules.ttinfo2;
  2 +
  3 +import com.bsth.entity.schedule.TTInfoDetail;
  4 +import org.kie.api.runtime.rule.AccumulateFunction;
  5 +
  6 +import java.io.*;
  7 +
  8 +/**
  9 + * Created by xu on 17/2/28.
  10 + */
  11 +public class ErrorBcCountFunction implements AccumulateFunction {
  12 + @Override
  13 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  14 + }
  15 +
  16 + @Override
  17 + public void writeExternal(ObjectOutput out) throws IOException {
  18 + }
  19 +
  20 + protected static class ErrorCountData implements Externalizable {
  21 + public long errorcount = 0;
  22 + public TTInfoDetail ttInfoDetail;
  23 +
  24 + public ErrorCountData() {
  25 + }
  26 +
  27 + @Override
  28 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  29 + errorcount = in.readLong();
  30 + ttInfoDetail = (TTInfoDetail) in.readObject();
  31 + }
  32 +
  33 + @Override
  34 + public void writeExternal(ObjectOutput out) throws IOException {
  35 + out.writeLong(errorcount);
  36 + out.writeObject(ttInfoDetail);
  37 + }
  38 + }
  39 +
  40 + @Override
  41 + public Serializable createContext() {
  42 + return new ErrorCountData();
  43 + }
  44 +
  45 + @Override
  46 + public void init(Serializable context) throws Exception {
  47 + ErrorCountData errorCountData = (ErrorCountData) context;
  48 + errorCountData.errorcount = 0;
  49 + }
  50 +
  51 + @Override
  52 + public void accumulate(Serializable context, Object value) {
  53 + ErrorCountData errorCountData = (ErrorCountData) context;
  54 + TTInfoDetail ttInfoDetail = (TTInfoDetail) value;
  55 +
  56 + if (ttInfoDetail.getTtinfo() == null) {
  57 + errorCountData.errorcount ++;
  58 + return;
  59 + }
  60 +
  61 + if ("in".equals(ttInfoDetail.getBcType())) {
  62 + if (ttInfoDetail.getQdz() == null || ttInfoDetail.getTcc() == null) {
  63 + errorCountData.errorcount ++;
  64 + }
  65 + } else if ("out".equals(ttInfoDetail.getBcType())) {
  66 + if (ttInfoDetail.getTcc() == null || ttInfoDetail.getZdz() == null) {
  67 + errorCountData.errorcount ++;
  68 + }
  69 + } else {
  70 + if (ttInfoDetail.getQdz() == null || ttInfoDetail.getZdz() == null) {
  71 + errorCountData.errorcount ++;
  72 + }
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + public void reverse(Serializable context, Object value) throws Exception {
  78 + ErrorCountData errorCountData = (ErrorCountData) context;
  79 + TTInfoDetail ttInfoDetail = (TTInfoDetail) value;
  80 +
  81 + if (ttInfoDetail.getTtinfo() == null) {
  82 + errorCountData.errorcount --;
  83 + return;
  84 + }
  85 +
  86 + if ("in".equals(ttInfoDetail.getBcType())) {
  87 + if (ttInfoDetail.getQdz() == null || ttInfoDetail.getTcc() == null) {
  88 + errorCountData.errorcount --;
  89 + }
  90 + } else if ("out".equals(ttInfoDetail.getBcType())) {
  91 + if (ttInfoDetail.getTcc() == null || ttInfoDetail.getZdz() == null) {
  92 + errorCountData.errorcount --;
  93 + }
  94 + } else {
  95 + if (ttInfoDetail.getQdz() == null || ttInfoDetail.getZdz() == null) {
  96 + errorCountData.errorcount --;
  97 + }
  98 + }
  99 +
  100 + }
  101 +
  102 + @Override
  103 + public Object getResult(Serializable context) throws Exception {
  104 + ErrorCountData errorCountData = (ErrorCountData) context;
  105 + return errorCountData.errorcount;
  106 + }
  107 +
  108 + @Override
  109 + public boolean supportsReverse() {
  110 + return true;
  111 + }
  112 +
  113 + @Override
  114 + public Class<?> getResultType() {
  115 + return Number.class;
  116 + }
  117 +}
src/main/java/com/bsth/service/schedule/rules/ttinfo2/Result.java
1 -package com.bsth.service.schedule.rules.ttinfo2;  
2 -  
3 -import java.util.ArrayList;  
4 -import java.util.List;  
5 -  
6 -/**  
7 - * 输出结果值。  
8 - */  
9 -public class Result {  
10 - private List<StatInfo> infos = new ArrayList<>();  
11 -  
12 - public List<StatInfo> getInfos() {  
13 - return infos;  
14 - }  
15 -  
16 - public void setInfos(List<StatInfo> infos) {  
17 - this.infos = infos;  
18 - }  
19 -  
20 - public static class StatInfo {  
21 - /** 时刻表id */  
22 - private Long ttid;  
23 - /** 时刻表名字 */  
24 - private String ttname;  
25 -  
26 - /** 所有班次数 */  
27 - private Long allbc;  
28 - /** 进场班次数 */  
29 - private Long inbc;  
30 - /** 出场班次数 */  
31 - private Long outbc;  
32 - /** 营运班次数 */  
33 - private Long yybc;  
34 -  
35 - /** 错误班次数 */  
36 - private Long errorbc;  
37 -  
38 - public Long getTtid() {  
39 - return ttid;  
40 - }  
41 -  
42 - public void setTtid(Long ttid) {  
43 - this.ttid = ttid;  
44 - }  
45 -  
46 - public String getTtname() {  
47 - return ttname;  
48 - }  
49 -  
50 - public void setTtname(String ttname) {  
51 - this.ttname = ttname;  
52 - }  
53 -  
54 - public Long getAllbc() {  
55 - return allbc;  
56 - }  
57 -  
58 - public void setAllbc(Long allbc) {  
59 - this.allbc = allbc;  
60 - }  
61 -  
62 - public Long getInbc() {  
63 - return inbc;  
64 - }  
65 -  
66 - public void setInbc(Long inbc) {  
67 - this.inbc = inbc;  
68 - }  
69 -  
70 - public Long getOutbc() {  
71 - return outbc;  
72 - }  
73 -  
74 - public void setOutbc(Long outbc) {  
75 - this.outbc = outbc;  
76 - }  
77 -  
78 - public Long getYybc() {  
79 - return yybc;  
80 - }  
81 -  
82 - public void setYybc(Long yybc) {  
83 - this.yybc = yybc;  
84 - }  
85 -  
86 - public Long getErrorbc() {  
87 - return errorbc;  
88 - }  
89 -  
90 - public void setErrorbc(Long errorbc) {  
91 - this.errorbc = errorbc;  
92 - }  
93 - }  
94 -} 1 +package com.bsth.service.schedule.rules.ttinfo2;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +/**
  7 + * 输出结果值。
  8 + */
  9 +public class Result {
  10 + private List<StatInfo> infos = new ArrayList<>();
  11 +
  12 + public List<StatInfo> getInfos() {
  13 + return infos;
  14 + }
  15 +
  16 + public void setInfos(List<StatInfo> infos) {
  17 + this.infos = infos;
  18 + }
  19 +
  20 + public static class StatInfo {
  21 + /** 时刻表id */
  22 + private Long ttid;
  23 + /** 时刻表名字 */
  24 + private String ttname;
  25 +
  26 + /** 所有班次数 */
  27 + private Long allbc;
  28 + /** 进场班次数 */
  29 + private Long inbc;
  30 + /** 出场班次数 */
  31 + private Long outbc;
  32 + /** 营运班次数 */
  33 + private Long yybc;
  34 +
  35 + /** 错误班次数 */
  36 + private Long errorbc;
  37 +
  38 + public Long getTtid() {
  39 + return ttid;
  40 + }
  41 +
  42 + public void setTtid(Long ttid) {
  43 + this.ttid = ttid;
  44 + }
  45 +
  46 + public String getTtname() {
  47 + return ttname;
  48 + }
  49 +
  50 + public void setTtname(String ttname) {
  51 + this.ttname = ttname;
  52 + }
  53 +
  54 + public Long getAllbc() {
  55 + return allbc;
  56 + }
  57 +
  58 + public void setAllbc(Long allbc) {
  59 + this.allbc = allbc;
  60 + }
  61 +
  62 + public Long getInbc() {
  63 + return inbc;
  64 + }
  65 +
  66 + public void setInbc(Long inbc) {
  67 + this.inbc = inbc;
  68 + }
  69 +
  70 + public Long getOutbc() {
  71 + return outbc;
  72 + }
  73 +
  74 + public void setOutbc(Long outbc) {
  75 + this.outbc = outbc;
  76 + }
  77 +
  78 + public Long getYybc() {
  79 + return yybc;
  80 + }
  81 +
  82 + public void setYybc(Long yybc) {
  83 + this.yybc = yybc;
  84 + }
  85 +
  86 + public Long getErrorbc() {
  87 + return errorbc;
  88 + }
  89 +
  90 + public void setErrorbc(Long errorbc) {
  91 + this.errorbc = errorbc;
  92 + }
  93 + }
  94 +}
src/main/java/com/bsth/service/schedule/utils/DataToolsProperties.java
@@ -72,6 +72,9 @@ public class DataToolsProperties { @@ -72,6 +72,9 @@ public class DataToolsProperties {
72 /** 时刻表明细信息导入 */ 72 /** 时刻表明细信息导入 */
73 @NotNull 73 @NotNull
74 private String ttinfodetailDatainputktr; 74 private String ttinfodetailDatainputktr;
  75 + /** 时刻表明细信息导入 */
  76 + @NotNull
  77 + private String ttinfodetailDatainputktr2;
75 /** 排班规则信息导入 */ 78 /** 排班规则信息导入 */
76 @NotNull 79 @NotNull
77 private String scheduleruleDatainputktr; 80 private String scheduleruleDatainputktr;
@@ -320,4 +323,12 @@ public class DataToolsProperties { @@ -320,4 +323,12 @@ public class DataToolsProperties {
320 public void setGuideboardsDataoutputktr(String guideboardsDataoutputktr) { 323 public void setGuideboardsDataoutputktr(String guideboardsDataoutputktr) {
321 this.guideboardsDataoutputktr = guideboardsDataoutputktr; 324 this.guideboardsDataoutputktr = guideboardsDataoutputktr;
322 } 325 }
  326 +
  327 + public String getTtinfodetailDatainputktr2() {
  328 + return ttinfodetailDatainputktr2;
  329 + }
  330 +
  331 + public void setTtinfodetailDatainputktr2(String ttinfodetailDatainputktr2) {
  332 + this.ttinfodetailDatainputktr2 = ttinfodetailDatainputktr2;
  333 + }
323 } 334 }
src/main/resources/datatools/config-dev.properties
@@ -30,11 +30,13 @@ datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr @@ -30,11 +30,13 @@ datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr
30 # 时刻表基础信息导入 30 # 时刻表基础信息导入
31 datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr 31 datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr
32 # 时刻表明细信息导入(元数据) 32 # 时刻表明细信息导入(元数据)
33 -datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailMetaData.ktr 33 +datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailDataInputMetaData.ktr
34 # 时刻表明细编辑用数据 34 # 时刻表明细编辑用数据
35 datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr 35 datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr
36 # 时刻表明细信息导入 36 # 时刻表明细信息导入
37 datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr 37 datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr
  38 +# 时刻表明细信息导入2
  39 +datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr
38 40
39 # 车辆配置信息导入 41 # 车辆配置信息导入
40 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr 42 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr
src/main/resources/datatools/config-prod.properties
@@ -31,11 +31,13 @@ datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr @@ -31,11 +31,13 @@ datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr
31 # 时刻表基础信息导入 31 # 时刻表基础信息导入
32 datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr 32 datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr
33 # 时刻表明细信息导入(元数据) 33 # 时刻表明细信息导入(元数据)
34 -datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailMetaData.ktr 34 +datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailDataInputMetaData.ktr
35 # 时刻表明细编辑用数据 35 # 时刻表明细编辑用数据
36 datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr 36 datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr
37 # 时刻表明细信息导入 37 # 时刻表明细信息导入
38 datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr 38 datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr
  39 +# 时刻表明细信息导入2
  40 +datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr
39 41
40 # 车辆配置信息导入 42 # 车辆配置信息导入
41 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr 43 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr
src/main/resources/datatools/ktrs/employeesConfigDataInput.ktr
@@ -273,10 +273,11 @@ @@ -273,10 +273,11 @@
273 <hop> <from>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</from><to>&#x542f;&#x7528;&#x88ab;&#x6570;&#x636e;flag</to><enabled>Y</enabled> </hop> 273 <hop> <from>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</from><to>&#x542f;&#x7528;&#x88ab;&#x6570;&#x636e;flag</to><enabled>Y</enabled> </hop>
274 <hop> <from>&#x542f;&#x7528;&#x88ab;&#x6570;&#x636e;flag</from><to>&#x7ebf;&#x8def;id&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop> 274 <hop> <from>&#x542f;&#x7528;&#x88ab;&#x6570;&#x636e;flag</from><to>&#x7ebf;&#x8def;id&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop>
275 <hop> <from>&#x7ebf;&#x8def;id&#x67e5;&#x8be2;</from><to>&#x8fc7;&#x6ee4;&#x7ebf;&#x8def;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop> 275 <hop> <from>&#x7ebf;&#x8def;id&#x67e5;&#x8be2;</from><to>&#x8fc7;&#x6ee4;&#x7ebf;&#x8def;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
276 - <hop> <from>&#x8fc7;&#x6ee4;&#x7ebf;&#x8def;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</from><to>&#x9a7e;&#x9a76;&#x5458;id&#x67e5;&#x627e;</to><enabled>Y</enabled> </hop>  
277 <hop> <from>&#x9a7e;&#x9a76;&#x5458;id&#x67e5;&#x627e;</from><to>&#x8fc7;&#x6ee4;&#x9a7e;&#x9a76;&#x5458;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop> 276 <hop> <from>&#x9a7e;&#x9a76;&#x5458;id&#x67e5;&#x627e;</from><to>&#x8fc7;&#x6ee4;&#x9a7e;&#x9a76;&#x5458;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
278 <hop> <from>&#x8fc7;&#x6ee4;&#x9a7e;&#x9a76;&#x5458;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</from><to>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</to><enabled>Y</enabled> </hop> 277 <hop> <from>&#x8fc7;&#x6ee4;&#x9a7e;&#x9a76;&#x5458;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</from><to>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</to><enabled>Y</enabled> </hop>
279 <hop> <from>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ecinfo</to><enabled>Y</enabled> </hop> 278 <hop> <from>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ecinfo</to><enabled>Y</enabled> </hop>
  279 + <hop> <from>&#x8fc7;&#x6ee4;&#x7ebf;&#x8def;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</from><to>&#x5de5;&#x53f7;&#x6570;&#x636e;&#x5904;&#x7406;</to><enabled>Y</enabled> </hop>
  280 + <hop> <from>&#x5de5;&#x53f7;&#x6570;&#x636e;&#x5904;&#x7406;</from><to>&#x9a7e;&#x9a76;&#x5458;id&#x67e5;&#x627e;</to><enabled>Y</enabled> </hop>
280 </order> 281 </order>
281 <step> 282 <step>
282 <name>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</name> 283 <name>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</name>
@@ -464,12 +465,12 @@ @@ -464,12 +465,12 @@
464 </partitioning> 465 </partitioning>
465 <connection>bus_control_variable</connection> 466 <connection>bus_control_variable</connection>
466 <rowlimit>1</rowlimit> 467 <rowlimit>1</rowlimit>
467 - <sql>select id as sid from bsth_c_personnel&#xa;where job_code &#x3d; &#x3f; and personnel_name &#x3d; &#x3f;</sql> 468 + <sql>select id as sid from bsth_c_personnel&#xa;where job_code like &#x3f; and personnel_name &#x3d; &#x3f;</sql>
468 <outer_join>Y</outer_join> 469 <outer_join>Y</outer_join>
469 <replace_vars>N</replace_vars> 470 <replace_vars>N</replace_vars>
470 <parameter> 471 <parameter>
471 <field> 472 <field>
472 - <name>&#x552e;&#x7968;&#x5458;&#x5de5;&#x53f7;</name> 473 + <name>sgh_temp</name>
473 <type>String</type> 474 <type>String</type>
474 </field> 475 </field>
475 <field> 476 <field>
@@ -479,8 +480,8 @@ @@ -479,8 +480,8 @@
479 </parameter> 480 </parameter>
480 <cluster_schema/> 481 <cluster_schema/>
481 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 482 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
482 - <xloc>673</xloc>  
483 - <yloc>47</yloc> 483 + <xloc>830</xloc>
  484 + <yloc>45</yloc>
484 <draw>Y</draw> 485 <draw>Y</draw>
485 </GUI> 486 </GUI>
486 </step> 487 </step>
@@ -548,8 +549,8 @@ @@ -548,8 +549,8 @@
548 </lookup> 549 </lookup>
549 <cluster_schema/> 550 <cluster_schema/>
550 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 551 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
551 - <xloc>676</xloc>  
552 - <yloc>200</yloc> 552 + <xloc>833</xloc>
  553 + <yloc>198</yloc>
553 <draw>Y</draw> 554 <draw>Y</draw>
554 </GUI> 555 </GUI>
555 </step> 556 </step>
@@ -699,8 +700,8 @@ @@ -699,8 +700,8 @@
699 </compare> 700 </compare>
700 <cluster_schema/> 701 <cluster_schema/>
701 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 702 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
702 - <xloc>538</xloc>  
703 - <yloc>47</yloc> 703 + <xloc>695</xloc>
  704 + <yloc>45</yloc>
704 <draw>Y</draw> 705 <draw>Y</draw>
705 </GUI> 706 </GUI>
706 </step> 707 </step>
@@ -836,8 +837,8 @@ @@ -836,8 +837,8 @@
836 </custom> 837 </custom>
837 <cluster_schema/> 838 <cluster_schema/>
838 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 839 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
839 - <xloc>676</xloc>  
840 - <yloc>323</yloc> 840 + <xloc>833</xloc>
  841 + <yloc>321</yloc>
841 <draw>Y</draw> 842 <draw>Y</draw>
842 </GUI> 843 </GUI>
843 </step> 844 </step>
@@ -855,12 +856,12 @@ @@ -855,12 +856,12 @@
855 </partitioning> 856 </partitioning>
856 <connection>bus_control_variable</connection> 857 <connection>bus_control_variable</connection>
857 <rowlimit>1</rowlimit> 858 <rowlimit>1</rowlimit>
858 - <sql>select id as jid from bsth_c_personnel&#xa;where job_code &#x3d; &#x3f; and personnel_name &#x3d; &#x3f;</sql> 859 + <sql>select id as jid from bsth_c_personnel&#xa;where job_code like &#x3f; and personnel_name &#x3d; &#x3f;</sql>
859 <outer_join>Y</outer_join> 860 <outer_join>Y</outer_join>
860 <replace_vars>N</replace_vars> 861 <replace_vars>N</replace_vars>
861 <parameter> 862 <parameter>
862 <field> 863 <field>
863 - <name>&#x9a7e;&#x9a76;&#x5458;&#x5de5;&#x53f7;</name> 864 + <name>jgh_temp</name>
864 <type>String</type> 865 <type>String</type>
865 </field> 866 </field>
866 <field> 867 <field>
@@ -870,8 +871,44 @@ @@ -870,8 +871,44 @@
870 </parameter> 871 </parameter>
871 <cluster_schema/> 872 <cluster_schema/>
872 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 873 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
873 - <xloc>537</xloc>  
874 - <yloc>143</yloc> 874 + <xloc>694</xloc>
  875 + <yloc>141</yloc>
  876 + <draw>Y</draw>
  877 + </GUI>
  878 + </step>
  879 +
  880 + <step>
  881 + <name>&#x5de5;&#x53f7;&#x6570;&#x636e;&#x5904;&#x7406;</name>
  882 + <type>ScriptValueMod</type>
  883 + <description/>
  884 + <distribute>Y</distribute>
  885 + <custom_distribution/>
  886 + <copies>1</copies>
  887 + <partitioning>
  888 + <method>none</method>
  889 + <schema_name/>
  890 + </partitioning>
  891 + <compatible>N</compatible>
  892 + <optimizationLevel>9</optimizationLevel>
  893 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  894 + <jsScript_name>Script 1</jsScript_name>
  895 + <jsScript_script>&#x2f;&#x2f; &#x56e0;&#x4e3a;&#x6570;&#x636e;&#x5e93;&#x4e2d;&#x7684;&#x6570;&#x636e;&#x5de5;&#x53f7;&#x53ef;&#x80fd;&#x5e26;suffix&#xff0c;&#x5982;55-12345678&#xa;&#x2f;&#x2f; &#x6240;&#x4ee5;&#x4e4b;&#x540e;&#x7684;&#x5339;&#x914d;&#x4f7f;&#x7528;like&#xff0c;&#x5219;&#x5143;&#x6570;&#x636e;&#x9700;&#x8981;&#x52a0;&#x4e0a;&#x25; &#x25;&#x7b26;&#x53f7;&#xa;&#xa;var jgh_temp&#x3b;&#xa;var sgh_temp&#x3b;&#xa;&#xa;if &#x28;&#x9a7e;&#x9a76;&#x5458;&#x5de5;&#x53f7;&#x29; &#x7b;&#xa; jgh_temp &#x3d; &#x27;&#x25;&#x27; &#x2b; &#x9a7e;&#x9a76;&#x5458;&#x5de5;&#x53f7; &#x2b; &#x27;&#x25;&#x27;&#x3b;&#xa;&#x7d; else &#x7b;&#xa; jgh_temp &#x3d; &#x9a7e;&#x9a76;&#x5458;&#x5de5;&#x53f7;&#x3b;&#xa;&#x7d;&#xa;&#xa;if &#x28;&#x552e;&#x7968;&#x5458;&#x5de5;&#x53f7;&#x29; &#x7b;&#xa; sgh_temp &#x3d; &#x27;&#x25;&#x27; &#x2b; &#x552e;&#x7968;&#x5458;&#x5de5;&#x53f7; &#x2b; &#x27;&#x25;&#x27;&#x3b;&#xa;&#x7d; else &#x7b;&#xa; sgh_temp &#x3d; &#x552e;&#x7968;&#x5458;&#x5de5;&#x53f7;&#x3b;&#xa;&#x7d;</jsScript_script>
  896 + </jsScript> </jsScripts> <fields> <field> <name>jgh_temp</name>
  897 + <rename>jgh_temp</rename>
  898 + <type>String</type>
  899 + <length>-1</length>
  900 + <precision>-1</precision>
  901 + <replace>N</replace>
  902 + </field> <field> <name>sgh_temp</name>
  903 + <rename>sgh_temp</rename>
  904 + <type>String</type>
  905 + <length>-1</length>
  906 + <precision>-1</precision>
  907 + <replace>N</replace>
  908 + </field> </fields> <cluster_schema/>
  909 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  910 + <xloc>548</xloc>
  911 + <yloc>47</yloc>
875 <draw>Y</draw> 912 <draw>Y</draw>
876 </GUI> 913 </GUI>
877 </step> 914 </step>
src/main/resources/datatools/ktrs/test.ktr 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<transformation>
  3 + <info>
  4 + <name>employeesConfigDataInput</name>
  5 + <description>&#x4eba;&#x5458;&#x914d;&#x7f6e;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</description>
  6 + <extended_description>&#x4eba;&#x5458;&#x914d;&#x7f6e;&#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>erroroutputdir</name>
  14 + <default_value/>
  15 + <description>ktr step&#x914d;&#x7f6e;&#x7684;&#x9519;&#x8bef;&#x8f93;&#x51fa;&#x76ee;&#x5f55;</description>
  16 + </parameter>
  17 + <parameter>
  18 + <name>filepath</name>
  19 + <default_value/>
  20 + <description>&#x5f85;&#x5904;&#x7406;&#x5bfc;&#x5165;&#x7684;excel&#x6587;&#x4ef6;</description>
  21 + </parameter>
  22 + </parameters>
  23 + <log>
  24 +<trans-log-table><connection/>
  25 +<schema/>
  26 +<table/>
  27 +<size_limit_lines/>
  28 +<interval/>
  29 +<timeout_days/>
  30 +<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>
  31 +<perf-log-table><connection/>
  32 +<schema/>
  33 +<table/>
  34 +<interval/>
  35 +<timeout_days/>
  36 +<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>
  37 +<channel-log-table><connection/>
  38 +<schema/>
  39 +<table/>
  40 +<timeout_days/>
  41 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>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>
  42 +<step-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>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>
  47 +<metrics-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>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>
  52 + </log>
  53 + <maxdate>
  54 + <connection/>
  55 + <table/>
  56 + <field/>
  57 + <offset>0.0</offset>
  58 + <maxdiff>0.0</maxdiff>
  59 + </maxdate>
  60 + <size_rowset>10000</size_rowset>
  61 + <sleep_time_empty>50</sleep_time_empty>
  62 + <sleep_time_full>50</sleep_time_full>
  63 + <unique_connections>N</unique_connections>
  64 + <feedback_shown>Y</feedback_shown>
  65 + <feedback_size>50000</feedback_size>
  66 + <using_thread_priorities>Y</using_thread_priorities>
  67 + <shared_objects_file/>
  68 + <capture_step_performance>N</capture_step_performance>
  69 + <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  70 + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  71 + <dependencies>
  72 + </dependencies>
  73 + <partitionschemas>
  74 + </partitionschemas>
  75 + <slaveservers>
  76 + </slaveservers>
  77 + <clusterschemas>
  78 + </clusterschemas>
  79 + <created_user>-</created_user>
  80 + <created_date>2016&#x2f;06&#x2f;29 15&#x3a;12&#x3a;27.273</created_date>
  81 + <modified_user>-</modified_user>
  82 + <modified_date>2016&#x2f;06&#x2f;29 15&#x3a;12&#x3a;27.273</modified_date>
  83 + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
  84 + <is_key_private>N</is_key_private>
  85 + </info>
  86 + <notepads>
  87 + <notepad>
  88 + <note>&#x8fd9;&#x91cc;&#x6709;&#x4e9b;&#x95ee;&#x9898;&#xa;&#x5728;window2012&#x7684;&#x73af;&#x5883;&#x4e0b;&#xff0c;&#xa;MySql&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x4e2d;&#x5982;&#x679c;&#x8fd4;&#x56de;&#x4e2d;&#x6587;&#x5185;&#x5bb9;&#x7684;&#x5b57;&#x6bb5;&#xff0c;&#x8fd9;&#x4e2a;&#x5185;&#x5bb9;&#x4e71;&#x7801;&#xa;&#x89e3;&#x51b3;&#x529e;&#x6cd5;&#xff0c;&#x5c31;&#x662f;&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x5168;&#x90e8;&#x7f13;&#x5b58;&#xff0c;&#x5c31;&#x4e0d;&#x4e71;&#x7801;&#xa;linux&#x73af;&#x5883;&#x4e0b;&#x6ca1;&#x95ee;&#x9898;</note>
  89 + <xloc>101</xloc>
  90 + <yloc>264</yloc>
  91 + <width>333</width>
  92 + <heigth>90</heigth>
  93 + <fontname>YaHei Consolas Hybrid</fontname>
  94 + <fontsize>12</fontsize>
  95 + <fontbold>N</fontbold>
  96 + <fontitalic>N</fontitalic>
  97 + <fontcolorred>0</fontcolorred>
  98 + <fontcolorgreen>0</fontcolorgreen>
  99 + <fontcolorblue>0</fontcolorblue>
  100 + <backgroundcolorred>255</backgroundcolorred>
  101 + <backgroundcolorgreen>205</backgroundcolorgreen>
  102 + <backgroundcolorblue>112</backgroundcolorblue>
  103 + <bordercolorred>100</bordercolorred>
  104 + <bordercolorgreen>100</bordercolorgreen>
  105 + <bordercolorblue>100</bordercolorblue>
  106 + <drawshadow>Y</drawshadow>
  107 + </notepad>
  108 + </notepads>
  109 + <connection>
  110 + <name>bus_control_variable</name>
  111 + <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
  112 + <type>MYSQL</type>
  113 + <access>Native</access>
  114 + <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
  115 + <port>3306</port>
  116 + <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
  117 + <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
  118 + <servername/>
  119 + <data_tablespace/>
  120 + <index_tablespace/>
  121 + <attributes>
  122 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
  123 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  124 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  125 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  126 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  127 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  128 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  129 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  130 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  131 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  132 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  133 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  134 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  135 + </attributes>
  136 + </connection>
  137 + <connection>
  138 + <name>bus_control_&#x516c;&#x53f8;_201</name>
  139 + <server>localhost</server>
  140 + <type>MYSQL</type>
  141 + <access>Native</access>
  142 + <database>control</database>
  143 + <port>3306</port>
  144 + <username>root</username>
  145 + <password>Encrypted </password>
  146 + <servername/>
  147 + <data_tablespace/>
  148 + <index_tablespace/>
  149 + <attributes>
  150 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  151 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  152 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  153 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  154 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  155 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  156 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  157 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  158 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  159 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  160 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  161 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  162 + </attributes>
  163 + </connection>
  164 + <connection>
  165 + <name>bus_control_&#x672c;&#x673a;</name>
  166 + <server>localhost</server>
  167 + <type>MYSQL</type>
  168 + <access>Native</access>
  169 + <database>control</database>
  170 + <port>3306</port>
  171 + <username>root</username>
  172 + <password>Encrypted </password>
  173 + <servername/>
  174 + <data_tablespace/>
  175 + <index_tablespace/>
  176 + <attributes>
  177 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  178 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  179 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  180 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  181 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  182 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  183 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  184 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  185 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  186 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  187 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  188 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  189 + </attributes>
  190 + </connection>
  191 + <connection>
  192 + <name>xlab_mysql_youle</name>
  193 + <server>101.231.124.8</server>
  194 + <type>MYSQL</type>
  195 + <access>Native</access>
  196 + <database>xlab_youle</database>
  197 + <port>45687</port>
  198 + <username>xlab-youle</username>
  199 + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
  200 + <servername/>
  201 + <data_tablespace/>
  202 + <index_tablespace/>
  203 + <attributes>
  204 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  205 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  206 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  207 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  208 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  209 + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
  210 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  211 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  212 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  213 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  214 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  215 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  216 + </attributes>
  217 + </connection>
  218 + <connection>
  219 + <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
  220 + <server>localhost</server>
  221 + <type>MYSQL</type>
  222 + <access>Native</access>
  223 + <database>xlab_youle</database>
  224 + <port>3306</port>
  225 + <username>root</username>
  226 + <password>Encrypted </password>
  227 + <servername/>
  228 + <data_tablespace/>
  229 + <index_tablespace/>
  230 + <attributes>
  231 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  232 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  233 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  234 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  235 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  236 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  237 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  238 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  239 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  240 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  241 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  242 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  243 + </attributes>
  244 + </connection>
  245 + <connection>
  246 + <name>xlab_youle</name>
  247 + <server/>
  248 + <type>MYSQL</type>
  249 + <access>JNDI</access>
  250 + <database>xlab_youle</database>
  251 + <port>1521</port>
  252 + <username/>
  253 + <password>Encrypted </password>
  254 + <servername/>
  255 + <data_tablespace/>
  256 + <index_tablespace/>
  257 + <attributes>
  258 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  259 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  260 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  261 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  262 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  263 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  264 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  265 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  266 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  267 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  268 + </attributes>
  269 + </connection>
  270 + <order>
  271 + <hop> <from>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ecinfo</from><to>&#x9519;&#x8bef;&#x8f93;&#x51fa;</to><enabled>Y</enabled> </hop>
  272 + <hop> <from>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</from><to>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</to><enabled>Y</enabled> </hop>
  273 + <hop> <from>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</from><to>&#x542f;&#x7528;&#x88ab;&#x6570;&#x636e;flag</to><enabled>Y</enabled> </hop>
  274 + <hop> <from>&#x542f;&#x7528;&#x88ab;&#x6570;&#x636e;flag</from><to>&#x7ebf;&#x8def;id&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop>
  275 + <hop> <from>&#x7ebf;&#x8def;id&#x67e5;&#x8be2;</from><to>&#x8fc7;&#x6ee4;&#x7ebf;&#x8def;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
  276 + <hop> <from>&#x8fc7;&#x6ee4;&#x7ebf;&#x8def;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</from><to>&#x9a7e;&#x9a76;&#x5458;id&#x67e5;&#x627e;</to><enabled>Y</enabled> </hop>
  277 + <hop> <from>&#x9a7e;&#x9a76;&#x5458;id&#x67e5;&#x627e;</from><to>&#x8fc7;&#x6ee4;&#x9a7e;&#x9a76;&#x5458;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
  278 + <hop> <from>&#x8fc7;&#x6ee4;&#x9a7e;&#x9a76;&#x5458;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</from><to>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</to><enabled>Y</enabled> </hop>
  279 + <hop> <from>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ecinfo</to><enabled>Y</enabled> </hop>
  280 + </order>
  281 + <step>
  282 + <name>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</name>
  283 + <type>ExcelInput</type>
  284 + <description/>
  285 + <distribute>Y</distribute>
  286 + <custom_distribution/>
  287 + <copies>1</copies>
  288 + <partitioning>
  289 + <method>none</method>
  290 + <schema_name/>
  291 + </partitioning>
  292 + <header>Y</header>
  293 + <noempty>Y</noempty>
  294 + <stoponempty>N</stoponempty>
  295 + <filefield/>
  296 + <sheetfield/>
  297 + <sheetrownumfield/>
  298 + <rownumfield/>
  299 + <sheetfield/>
  300 + <filefield/>
  301 + <limit>0</limit>
  302 + <encoding/>
  303 + <add_to_result_filenames>Y</add_to_result_filenames>
  304 + <accept_filenames>Y</accept_filenames>
  305 + <accept_field>filepath_</accept_field>
  306 + <accept_stepname>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</accept_stepname>
  307 + <file>
  308 + <name/>
  309 + <filemask/>
  310 + <exclude_filemask/>
  311 + <file_required>N</file_required>
  312 + <include_subfolders>N</include_subfolders>
  313 + </file>
  314 + <fields>
  315 + <field>
  316 + <name>&#x7ebf;&#x8def;</name>
  317 + <type>String</type>
  318 + <length>-1</length>
  319 + <precision>-1</precision>
  320 + <trim_type>none</trim_type>
  321 + <repeat>N</repeat>
  322 + <format/>
  323 + <currency/>
  324 + <decimal/>
  325 + <group/>
  326 + </field>
  327 + <field>
  328 + <name>&#x642d;&#x73ed;&#x7f16;&#x7801;</name>
  329 + <type>String</type>
  330 + <length>-1</length>
  331 + <precision>-1</precision>
  332 + <trim_type>none</trim_type>
  333 + <repeat>N</repeat>
  334 + <format>&#x23;</format>
  335 + <currency/>
  336 + <decimal/>
  337 + <group/>
  338 + </field>
  339 + <field>
  340 + <name>&#x9a7e;&#x9a76;&#x5458;&#x5de5;&#x53f7;</name>
  341 + <type>String</type>
  342 + <length>-1</length>
  343 + <precision>-1</precision>
  344 + <trim_type>none</trim_type>
  345 + <repeat>N</repeat>
  346 + <format>&#x23;</format>
  347 + <currency/>
  348 + <decimal/>
  349 + <group/>
  350 + </field>
  351 + <field>
  352 + <name>&#x9a7e;&#x9a76;&#x5458;</name>
  353 + <type>String</type>
  354 + <length>-1</length>
  355 + <precision>-1</precision>
  356 + <trim_type>none</trim_type>
  357 + <repeat>N</repeat>
  358 + <format/>
  359 + <currency/>
  360 + <decimal/>
  361 + <group/>
  362 + </field>
  363 + <field>
  364 + <name>&#x552e;&#x7968;&#x5458;&#x5de5;&#x53f7;</name>
  365 + <type>String</type>
  366 + <length>-1</length>
  367 + <precision>-1</precision>
  368 + <trim_type>none</trim_type>
  369 + <repeat>N</repeat>
  370 + <format>&#x23;</format>
  371 + <currency/>
  372 + <decimal/>
  373 + <group/>
  374 + </field>
  375 + <field>
  376 + <name>&#x552e;&#x7968;&#x5458;</name>
  377 + <type>String</type>
  378 + <length>-1</length>
  379 + <precision>-1</precision>
  380 + <trim_type>none</trim_type>
  381 + <repeat>N</repeat>
  382 + <format/>
  383 + <currency/>
  384 + <decimal/>
  385 + <group/>
  386 + </field>
  387 + </fields>
  388 + <sheets>
  389 + <sheet>
  390 + <name>&#x5de5;&#x4f5c;&#x8868;1</name>
  391 + <startrow>0</startrow>
  392 + <startcol>0</startcol>
  393 + </sheet>
  394 + </sheets>
  395 + <strict_types>N</strict_types>
  396 + <error_ignored>N</error_ignored>
  397 + <error_line_skipped>N</error_line_skipped>
  398 + <bad_line_files_destination_directory/>
  399 + <bad_line_files_extension>warning</bad_line_files_extension>
  400 + <error_line_files_destination_directory/>
  401 + <error_line_files_extension>error</error_line_files_extension>
  402 + <line_number_files_destination_directory/>
  403 + <line_number_files_extension>line</line_number_files_extension>
  404 + <shortFileFieldName/>
  405 + <pathFieldName/>
  406 + <hiddenFieldName/>
  407 + <lastModificationTimeFieldName/>
  408 + <uriNameFieldName/>
  409 + <rootUriNameFieldName/>
  410 + <extensionFieldName/>
  411 + <sizeFieldName/>
  412 + <spreadsheet_type>JXL</spreadsheet_type>
  413 + <cluster_schema/>
  414 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  415 + <xloc>93</xloc>
  416 + <yloc>51</yloc>
  417 + <draw>Y</draw>
  418 + </GUI>
  419 + </step>
  420 +
  421 + <step>
  422 + <name>&#x542f;&#x7528;&#x88ab;&#x6570;&#x636e;flag</name>
  423 + <type>Constant</type>
  424 + <description/>
  425 + <distribute>Y</distribute>
  426 + <custom_distribution/>
  427 + <copies>1</copies>
  428 + <partitioning>
  429 + <method>none</method>
  430 + <schema_name/>
  431 + </partitioning>
  432 + <fields>
  433 + <field>
  434 + <name>isCancel</name>
  435 + <type>Integer</type>
  436 + <format/>
  437 + <currency/>
  438 + <decimal/>
  439 + <group/>
  440 + <nullif>0</nullif>
  441 + <length>-1</length>
  442 + <precision>-1</precision>
  443 + <set_empty_string>N</set_empty_string>
  444 + </field>
  445 + </fields>
  446 + <cluster_schema/>
  447 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  448 + <xloc>225</xloc>
  449 + <yloc>53</yloc>
  450 + <draw>Y</draw>
  451 + </GUI>
  452 + </step>
  453 +
  454 + <step>
  455 + <name>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</name>
  456 + <type>DBJoin</type>
  457 + <description/>
  458 + <distribute>Y</distribute>
  459 + <custom_distribution/>
  460 + <copies>1</copies>
  461 + <partitioning>
  462 + <method>none</method>
  463 + <schema_name/>
  464 + </partitioning>
  465 + <connection>bus_control_variable</connection>
  466 + <rowlimit>1</rowlimit>
  467 + <sql>select id as sid from bsth_c_personnel&#xa;where job_code &#x3d; &#x3f; and personnel_name &#x3d; &#x3f;</sql>
  468 + <outer_join>Y</outer_join>
  469 + <replace_vars>N</replace_vars>
  470 + <parameter>
  471 + <field>
  472 + <name>&#x552e;&#x7968;&#x5458;&#x5de5;&#x53f7;</name>
  473 + <type>String</type>
  474 + </field>
  475 + <field>
  476 + <name>&#x552e;&#x7968;&#x5458;</name>
  477 + <type>String</type>
  478 + </field>
  479 + </parameter>
  480 + <cluster_schema/>
  481 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  482 + <xloc>673</xloc>
  483 + <yloc>47</yloc>
  484 + <draw>Y</draw>
  485 + </GUI>
  486 + </step>
  487 +
  488 + <step>
  489 + <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ecinfo</name>
  490 + <type>InsertUpdate</type>
  491 + <description/>
  492 + <distribute>Y</distribute>
  493 + <custom_distribution/>
  494 + <copies>1</copies>
  495 + <partitioning>
  496 + <method>none</method>
  497 + <schema_name/>
  498 + </partitioning>
  499 + <connection>bus_control_variable</connection>
  500 + <commit>100</commit>
  501 + <update_bypassed>N</update_bypassed>
  502 + <lookup>
  503 + <schema/>
  504 + <table>bsth_c_s_ecinfo</table>
  505 + <key>
  506 + <name>xlid</name>
  507 + <field>xl</field>
  508 + <condition>&#x3d;</condition>
  509 + <name2/>
  510 + </key>
  511 + <key>
  512 + <name>&#x642d;&#x73ed;&#x7f16;&#x7801;</name>
  513 + <field>dbbm</field>
  514 + <condition>&#x3d;</condition>
  515 + <name2/>
  516 + </key>
  517 + <value>
  518 + <name>xl</name>
  519 + <rename>xlid</rename>
  520 + <update>Y</update>
  521 + </value>
  522 + <value>
  523 + <name>dbbm</name>
  524 + <rename>&#x642d;&#x73ed;&#x7f16;&#x7801;</rename>
  525 + <update>Y</update>
  526 + </value>
  527 + <value>
  528 + <name>jsy</name>
  529 + <rename>jid</rename>
  530 + <update>Y</update>
  531 + </value>
  532 + <value>
  533 + <name>spy</name>
  534 + <rename>sid</rename>
  535 + <update>Y</update>
  536 + </value>
  537 + <value>
  538 + <name>is_cancel</name>
  539 + <rename>isCancel</rename>
  540 + <update>Y</update>
  541 + </value>
  542 + </lookup>
  543 + <cluster_schema/>
  544 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  545 + <xloc>676</xloc>
  546 + <yloc>200</yloc>
  547 + <draw>Y</draw>
  548 + </GUI>
  549 + </step>
  550 +
  551 + <step>
  552 + <name>&#x7ebf;&#x8def;id&#x67e5;&#x8be2;</name>
  553 + <type>DBLookup</type>
  554 + <description/>
  555 + <distribute>Y</distribute>
  556 + <custom_distribution/>
  557 + <copies>1</copies>
  558 + <partitioning>
  559 + <method>none</method>
  560 + <schema_name/>
  561 + </partitioning>
  562 + <connection>bus_control_variable</connection>
  563 + <cache>Y</cache>
  564 + <cache_load_all>Y</cache_load_all>
  565 + <cache_size>0</cache_size>
  566 + <lookup>
  567 + <schema/>
  568 + <table>bsth_c_line</table>
  569 + <orderby/>
  570 + <fail_on_multiple>N</fail_on_multiple>
  571 + <eat_row_on_failure>N</eat_row_on_failure>
  572 + <key>
  573 + <name>&#x7ebf;&#x8def;</name>
  574 + <field>name</field>
  575 + <condition>&#x3d;</condition>
  576 + <name2/>
  577 + </key>
  578 + <key>
  579 + <name>isCancel</name>
  580 + <field>destroy</field>
  581 + <condition>&#x3d;</condition>
  582 + <name2/>
  583 + </key>
  584 + <value>
  585 + <name>id</name>
  586 + <rename>xlid</rename>
  587 + <default/>
  588 + <type>Integer</type>
  589 + </value>
  590 + </lookup>
  591 + <cluster_schema/>
  592 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  593 + <xloc>397</xloc>
  594 + <yloc>144</yloc>
  595 + <draw>Y</draw>
  596 + </GUI>
  597 + </step>
  598 +
  599 + <step>
  600 + <name>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</name>
  601 + <type>GetVariable</type>
  602 + <description/>
  603 + <distribute>Y</distribute>
  604 + <custom_distribution/>
  605 + <copies>1</copies>
  606 + <partitioning>
  607 + <method>none</method>
  608 + <schema_name/>
  609 + </partitioning>
  610 + <fields>
  611 + <field>
  612 + <name>filepath_</name>
  613 + <variable>&#x24;&#x7b;filepath&#x7d;</variable>
  614 + <type>String</type>
  615 + <format/>
  616 + <currency/>
  617 + <decimal/>
  618 + <group/>
  619 + <length>-1</length>
  620 + <precision>-1</precision>
  621 + <trim_type>none</trim_type>
  622 + </field>
  623 + <field>
  624 + <name>erroroutputdir_</name>
  625 + <variable>&#x24;&#x7b;erroroutputdir&#x7d;</variable>
  626 + <type>String</type>
  627 + <format/>
  628 + <currency/>
  629 + <decimal/>
  630 + <group/>
  631 + <length>-1</length>
  632 + <precision>-1</precision>
  633 + <trim_type>none</trim_type>
  634 + </field>
  635 + </fields>
  636 + <cluster_schema/>
  637 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  638 + <xloc>94</xloc>
  639 + <yloc>178</yloc>
  640 + <draw>Y</draw>
  641 + </GUI>
  642 + </step>
  643 +
  644 + <step>
  645 + <name>&#x8fc7;&#x6ee4;&#x7ebf;&#x8def;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</name>
  646 + <type>FilterRows</type>
  647 + <description/>
  648 + <distribute>Y</distribute>
  649 + <custom_distribution/>
  650 + <copies>1</copies>
  651 + <partitioning>
  652 + <method>none</method>
  653 + <schema_name/>
  654 + </partitioning>
  655 +<send_true_to/>
  656 +<send_false_to/>
  657 + <compare>
  658 +<condition>
  659 + <negated>N</negated>
  660 + <leftvalue>xlid</leftvalue>
  661 + <function>IS NOT NULL</function>
  662 + <rightvalue/>
  663 + </condition>
  664 + </compare>
  665 + <cluster_schema/>
  666 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  667 + <xloc>395</xloc>
  668 + <yloc>49</yloc>
  669 + <draw>Y</draw>
  670 + </GUI>
  671 + </step>
  672 +
  673 + <step>
  674 + <name>&#x8fc7;&#x6ee4;&#x9a7e;&#x9a76;&#x5458;id&#x4e3a;&#x7a7a;&#x8bb0;&#x5f55;</name>
  675 + <type>FilterRows</type>
  676 + <description/>
  677 + <distribute>Y</distribute>
  678 + <custom_distribution/>
  679 + <copies>1</copies>
  680 + <partitioning>
  681 + <method>none</method>
  682 + <schema_name/>
  683 + </partitioning>
  684 +<send_true_to>&#x552e;&#x7968;&#x5458;id&#x67e5;&#x627e;</send_true_to>
  685 +<send_false_to/>
  686 + <compare>
  687 +<condition>
  688 + <negated>N</negated>
  689 + <leftvalue>jid</leftvalue>
  690 + <function>IS NOT NULL</function>
  691 + <rightvalue/>
  692 + </condition>
  693 + </compare>
  694 + <cluster_schema/>
  695 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  696 + <xloc>538</xloc>
  697 + <yloc>47</yloc>
  698 + <draw>Y</draw>
  699 + </GUI>
  700 + </step>
  701 +
  702 + <step>
  703 + <name>&#x9519;&#x8bef;&#x8f93;&#x51fa;</name>
  704 + <type>ExcelOutput</type>
  705 + <description/>
  706 + <distribute>Y</distribute>
  707 + <custom_distribution/>
  708 + <copies>1</copies>
  709 + <partitioning>
  710 + <method>none</method>
  711 + <schema_name/>
  712 + </partitioning>
  713 + <header>Y</header>
  714 + <footer>N</footer>
  715 + <encoding>UTF-8</encoding>
  716 + <append>N</append>
  717 + <add_to_result_filenames>Y</add_to_result_filenames>
  718 + <file>
  719 + <name>&#x24;&#x7b;erroroutputdir&#x7d;&#x2f;&#x4eba;&#x5458;&#x914d;&#x7f6e;_&#x9519;&#x8bef;</name>
  720 + <extention>xls</extention>
  721 + <do_not_open_newfile_init>N</do_not_open_newfile_init>
  722 + <create_parent_folder>N</create_parent_folder>
  723 + <split>N</split>
  724 + <add_date>N</add_date>
  725 + <add_time>N</add_time>
  726 + <SpecifyFormat>N</SpecifyFormat>
  727 + <date_time_format/>
  728 + <sheetname>Sheet1</sheetname>
  729 + <autosizecolums>N</autosizecolums>
  730 + <nullisblank>N</nullisblank>
  731 + <protect_sheet>N</protect_sheet>
  732 + <password>Encrypted </password>
  733 + <splitevery>0</splitevery>
  734 + <usetempfiles>N</usetempfiles>
  735 + <tempdirectory/>
  736 + </file>
  737 + <template>
  738 + <enabled>N</enabled>
  739 + <append>N</append>
  740 + <filename>template.xls</filename>
  741 + </template>
  742 + <fields>
  743 + <field>
  744 + <name>&#x7ebf;&#x8def;</name>
  745 + <type>String</type>
  746 + <format/>
  747 + </field>
  748 + <field>
  749 + <name>&#x642d;&#x73ed;&#x7f16;&#x7801;</name>
  750 + <type>String</type>
  751 + <format/>
  752 + </field>
  753 + <field>
  754 + <name>&#x9a7e;&#x9a76;&#x5458;&#x5de5;&#x53f7;</name>
  755 + <type>String</type>
  756 + <format/>
  757 + </field>
  758 + <field>
  759 + <name>&#x9a7e;&#x9a76;&#x5458;</name>
  760 + <type>String</type>
  761 + <format/>
  762 + </field>
  763 + <field>
  764 + <name>&#x552e;&#x7968;&#x5458;&#x5de5;&#x53f7;</name>
  765 + <type>String</type>
  766 + <format/>
  767 + </field>
  768 + <field>
  769 + <name>&#x552e;&#x7968;&#x5458;</name>
  770 + <type>String</type>
  771 + <format/>
  772 + </field>
  773 + <field>
  774 + <name>isCancel</name>
  775 + <type>Integer</type>
  776 + <format/>
  777 + </field>
  778 + <field>
  779 + <name>xlid</name>
  780 + <type>Integer</type>
  781 + <format/>
  782 + </field>
  783 + <field>
  784 + <name>jid</name>
  785 + <type>Integer</type>
  786 + <format/>
  787 + </field>
  788 + <field>
  789 + <name>sid</name>
  790 + <type>Integer</type>
  791 + <format/>
  792 + </field>
  793 + <field>
  794 + <name>error_count</name>
  795 + <type>Integer</type>
  796 + <format/>
  797 + </field>
  798 + <field>
  799 + <name>error_desc</name>
  800 + <type>String</type>
  801 + <format/>
  802 + </field>
  803 + <field>
  804 + <name>error_column1</name>
  805 + <type>String</type>
  806 + <format/>
  807 + </field>
  808 + <field>
  809 + <name>error_column2</name>
  810 + <type>String</type>
  811 + <format/>
  812 + </field>
  813 + </fields>
  814 + <custom>
  815 + <header_font_name>arial</header_font_name>
  816 + <header_font_size>10</header_font_size>
  817 + <header_font_bold>N</header_font_bold>
  818 + <header_font_italic>N</header_font_italic>
  819 + <header_font_underline>no</header_font_underline>
  820 + <header_font_orientation>horizontal</header_font_orientation>
  821 + <header_font_color>black</header_font_color>
  822 + <header_background_color>none</header_background_color>
  823 + <header_row_height>255</header_row_height>
  824 + <header_alignment>left</header_alignment>
  825 + <header_image/>
  826 + <row_font_name>arial</row_font_name>
  827 + <row_font_size>10</row_font_size>
  828 + <row_font_color>black</row_font_color>
  829 + <row_background_color>none</row_background_color>
  830 + </custom>
  831 + <cluster_schema/>
  832 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  833 + <xloc>676</xloc>
  834 + <yloc>323</yloc>
  835 + <draw>Y</draw>
  836 + </GUI>
  837 + </step>
  838 +
  839 + <step>
  840 + <name>&#x9a7e;&#x9a76;&#x5458;id&#x67e5;&#x627e;</name>
  841 + <type>DBJoin</type>
  842 + <description/>
  843 + <distribute>Y</distribute>
  844 + <custom_distribution/>
  845 + <copies>1</copies>
  846 + <partitioning>
  847 + <method>none</method>
  848 + <schema_name/>
  849 + </partitioning>
  850 + <connection>bus_control_variable</connection>
  851 + <rowlimit>1</rowlimit>
  852 + <sql>select id as jid from bsth_c_personnel&#xa;where job_code &#x3d; &#x3f; and personnel_name &#x3d; &#x3f;</sql>
  853 + <outer_join>Y</outer_join>
  854 + <replace_vars>N</replace_vars>
  855 + <parameter>
  856 + <field>
  857 + <name>&#x9a7e;&#x9a76;&#x5458;&#x5de5;&#x53f7;</name>
  858 + <type>String</type>
  859 + </field>
  860 + <field>
  861 + <name>&#x9a7e;&#x9a76;&#x5458;</name>
  862 + <type>String</type>
  863 + </field>
  864 + </parameter>
  865 + <cluster_schema/>
  866 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  867 + <xloc>537</xloc>
  868 + <yloc>143</yloc>
  869 + <draw>Y</draw>
  870 + </GUI>
  871 + </step>
  872 +
  873 + <step_error_handling>
  874 + <error>
  875 + <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ecinfo</source_step>
  876 + <target_step>&#x9519;&#x8bef;&#x8f93;&#x51fa;</target_step>
  877 + <is_enabled>Y</is_enabled>
  878 + <nr_valuename>error_count</nr_valuename>
  879 + <descriptions_valuename>error_desc</descriptions_valuename>
  880 + <fields_valuename>error_column1</fields_valuename>
  881 + <codes_valuename>error_column2</codes_valuename>
  882 + <max_errors/>
  883 + <max_pct_errors/>
  884 + <min_pct_rows/>
  885 + </error>
  886 + </step_error_handling>
  887 + <slave-step-copy-partition-distribution>
  888 +</slave-step-copy-partition-distribution>
  889 + <slave_transformation>N</slave_transformation>
  890 +
  891 +</transformation>
src/main/resources/datatools/ktrs/ttinfodetailDataInput.ktr
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <transformation> 2 <transformation>
3 <info> 3 <info>
4 - <name>ttinfodetailDataInput</name> 4 + <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5bfc;&#x5165;</name>
5 <description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</description> 5 <description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</description>
6 <extended_description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;</extended_description> 6 <extended_description>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;</extended_description>
7 <trans_version/> 7 <trans_version/>