Commit 238e076dd3c088f3905d619c4c635c1e36f369c1
1 parent
9e0e468b
浦东公交调度系统-车辆信息同步功能
1、完善ktr转换,转换中有多个文件输出,以后可以配合主log日志查找问题 2、自定义jndi数据源绑定本地springboot数据源,使ktr可以使用
Showing
38 changed files
with
3278 additions
and
587 deletions
doc/jar/jsonpath-1.0.jar deleted
100644 → 0
No preview for this file type
doc/jar/simple-jndi-1.0.0.jar
0 → 100644
No preview for this file type
doc/pom错误解决.txt
| 1 | 1 | 1、jsonpath手动导入 |
| 2 | 2 | pom定义如下: |
| 3 | -<!-- https://mvnrepository.com/artifact/jsonpath/jsonpath --> | |
| 3 | +<!-- https://mvnrepository.com/artifact/pentaho/simple-jndi --> | |
| 4 | 4 | <dependency> |
| 5 | - <groupId>jsonpath</groupId> | |
| 6 | - <artifactId>jsonpath</artifactId> | |
| 7 | - <version>1.0</version> | |
| 5 | + <groupId>pentaho</groupId> | |
| 6 | + <artifactId>simple-jndi</artifactId> | |
| 7 | + <version>1.0.0</version> | |
| 8 | 8 | </dependency> |
| 9 | 9 | pom中repositoy添加如下: |
| 10 | 10 | <repository> |
| ... | ... | @@ -12,4 +12,4 @@ pom中repositoy添加如下: |
| 12 | 12 | <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url> |
| 13 | 13 | </repository> |
| 14 | 14 | 如果无法获取,可能由于被墙了,则手动导入,控制台输入命令如下: |
| 15 | -mvn install:install-file -DgroupId=jsonpath -DartifactId=jsonpath -Dversion=1.0 -Dpackaging=jar -Dfile=./jar/jsonpath-1.0.jar | |
| 15 | +mvn install:install-file -DgroupId=pentaho -DartifactId=simple-jndi -Dversion=1.0.0 -Dpackaging=jar -Dfile=./jar/simple-jndi-1.0.0.jar | ... | ... |
pom.xml
| ... | ... | @@ -185,11 +185,11 @@ |
| 185 | 185 | <artifactId>kettle-core</artifactId> |
| 186 | 186 | <version>6.0.1.0-386</version> |
| 187 | 187 | </dependency> |
| 188 | - <dependency> | |
| 189 | - <groupId>com.pentaho.kettle</groupId> | |
| 190 | - <artifactId>kettle-engine</artifactId> | |
| 191 | - <version>6.0.1.0-386</version> | |
| 192 | - </dependency> | |
| 188 | + <dependency> | |
| 189 | + <groupId>com.pentaho.kettle</groupId> | |
| 190 | + <artifactId>kettle-engine</artifactId> | |
| 191 | + <version>6.0.1.0-386</version> | |
| 192 | + </dependency> | |
| 193 | 193 | <dependency> |
| 194 | 194 | <groupId>com.pentaho.kettle</groupId> |
| 195 | 195 | <artifactId>metastore</artifactId> |
| ... | ... | @@ -200,6 +200,8 @@ |
| 200 | 200 | <artifactId>vfs2</artifactId> |
| 201 | 201 | <version>2.1-20150824</version> |
| 202 | 202 | </dependency> |
| 203 | + | |
| 204 | + | |
| 203 | 205 | <dependency> |
| 204 | 206 | <groupId>net.sourceforge.jexcelapi</groupId> |
| 205 | 207 | <artifactId>jxl</artifactId> |
| ... | ... | @@ -401,21 +403,13 @@ |
| 401 | 403 | <artifactId>lombok</artifactId> |
| 402 | 404 | </dependency> |
| 403 | 405 | |
| 404 | - <!-- https://mvnrepository.com/artifact/jsonpath/jsonpath --> | |
| 405 | - <dependency> | |
| 406 | - <groupId>jsonpath</groupId> | |
| 407 | - <artifactId>jsonpath</artifactId> | |
| 408 | - <version>1.0</version> | |
| 409 | - </dependency> | |
| 410 | - | |
| 411 | - <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> | |
| 406 | + <!-- https://mvnrepository.com/artifact/pentaho/simple-jndi --> | |
| 412 | 407 | <dependency> |
| 413 | - <groupId>com.googlecode.json-simple</groupId> | |
| 414 | - <artifactId>json-simple</artifactId> | |
| 415 | - <version>1.1</version> | |
| 408 | + <groupId>pentaho</groupId> | |
| 409 | + <artifactId>simple-jndi</artifactId> | |
| 410 | + <version>1.0.0</version> | |
| 416 | 411 | </dependency> |
| 417 | 412 | |
| 418 | - | |
| 419 | 413 | </dependencies> |
| 420 | 414 | |
| 421 | 415 | <dependencyManagement> | ... | ... |
src/main/java/com/bsth/common/Constants.java
| 1 | 1 | package com.bsth.common; |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * | |
| 5 | - * @ClassName: Constants | |
| 6 | - * @Description: TODO(常量类) | |
| 7 | - * @author PanZhao | |
| 8 | - * @date 2016年3月18日 下午11:06:53 | |
| 4 | + * | |
| 5 | + * @ClassName: Constants | |
| 6 | + * @Description: TODO(常量类) | |
| 7 | + * @author PanZhao | |
| 8 | + * @date 2016年3月18日 下午11:06:53 | |
| 9 | 9 | * |
| 10 | 10 | */ |
| 11 | 11 | public class Constants { |
| 12 | - | |
| 12 | + | |
| 13 | 13 | /** |
| 14 | 14 | * 不需要拦截的资源 |
| 15 | 15 | */ |
| ... | ... | @@ -25,6 +25,8 @@ public class Constants { |
| 25 | 25 | public static final String ACTUATOR_MANAGEMENT_HEALTH = "/manage/health"; |
| 26 | 26 | // web服务url |
| 27 | 27 | public static final String WEBSERVICE_URL = "/ws/**"; |
| 28 | + // 车辆数据同步url | |
| 29 | + public static final String VEHICLE_DATA_SYNC_URL = "/dataSync/vehicle/api/**"; | |
| 28 | 30 | |
| 29 | 31 | //对外的营运数据接口 |
| 30 | 32 | public static final String SERVICE_INTERFACE = "/companyService/**"; |
| ... | ... | @@ -35,12 +37,12 @@ public class Constants { |
| 35 | 37 | public static final String XD_CHILD_PAGES = "/real_control_v2/**"; |
| 36 | 38 | public static final String XD_REAL_GPS = "/gps/real/line"; |
| 37 | 39 | //public static final String XD_TEMPS = "/pages/control/line/temps/**"; |
| 38 | - | |
| 40 | + | |
| 39 | 41 | //车载网关上行接口 |
| 40 | 42 | public static final String UPSTREAM_URL = "/control/upstream"; |
| 41 | 43 | //rfid 上传入口 |
| 42 | 44 | public static final String UP_RFID_URL = "/rfid/**"; |
| 43 | - | |
| 45 | + | |
| 44 | 46 | public static final String SESSION_USERNAME = "sessionUserName"; |
| 45 | 47 | public static final String COMPANY_AUTHORITYS = "cmyAuths"; |
| 46 | 48 | public static final String STATION_AND_SECTION_COUNT = "/station/updateStationAndSectionCode"; | ... | ... |
src/main/java/com/bsth/controller/schedule/datasync/VehicleDataSyncController.java
| ... | ... | @@ -2,35 +2,39 @@ package com.bsth.controller.schedule.datasync; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.controller.schedule.BController; |
| 4 | 4 | import com.bsth.controller.schedule.datasync.common.ApiResult; |
| 5 | -import com.bsth.entity.schedule.datasync.VehicleDataSyncLog; | |
| 6 | -import com.bsth.service.schedule.datasync.VehicleDataSyncService; | |
| 7 | -import com.bsth.service.schedule.datasync.task.VehicleDataSyncTaskFlag; | |
| 5 | +import com.bsth.controller.schedule.datasync.request.VehicleDataSyncTaskRequest; | |
| 6 | +import com.bsth.entity.schedule.datasync.VehicleDataSyncTask; | |
| 7 | +import com.bsth.entity.schedule.datasync.VehicleDataSyncTaskTypeEnum; | |
| 8 | +import com.bsth.service.schedule.datasync.VehicleDataSyncTaskService; | |
| 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | -import org.springframework.web.bind.annotation.GetMapping; | |
| 10 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 11 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | -import org.springframework.web.bind.annotation.RestController; | |
| 10 | +import org.springframework.web.bind.annotation.*; | |
| 13 | 11 | |
| 14 | 12 | import javax.servlet.http.HttpServletResponse; |
| 15 | 13 | import java.io.*; |
| 14 | +import java.util.Date; | |
| 16 | 15 | |
| 17 | 16 | @RestController |
| 18 | 17 | @RequestMapping("dataSync/vehicle") |
| 19 | -public class VehicleDataSyncController extends BController<VehicleDataSyncLog, Long> { | |
| 18 | +public class VehicleDataSyncController extends BController<VehicleDataSyncTask, Long> { | |
| 20 | 19 | @Autowired |
| 21 | - private VehicleDataSyncService vehicleDataSyncService; | |
| 20 | + private VehicleDataSyncTaskService vehicleDataSyncService; | |
| 22 | 21 | |
| 22 | + //------------------ 外部系统调用的api(如下)-----------------------// | |
| 23 | 23 | /** |
| 24 | - * 同步标识。 | |
| 24 | + * 添加任务(此接口用于外部系统调用)。 | |
| 25 | 25 | * @return |
| 26 | 26 | */ |
| 27 | - @GetMapping(value = "/flag") | |
| 28 | - public ApiResult dataSyncFlag() { | |
| 27 | + @GetMapping(value = "/api/addTask") | |
| 28 | + public ApiResult addTask() { | |
| 29 | 29 | try { |
| 30 | - VehicleDataSyncTaskFlag taskFlag = VehicleDataSyncTaskFlag | |
| 31 | - .builder() // TODO:以后加别的参数 | |
| 30 | + // 远程触发,使用当前服务器时间作为参数 | |
| 31 | + Date currentDate = new Date(); | |
| 32 | + VehicleDataSyncTask task = VehicleDataSyncTask.builder() | |
| 33 | + .type(VehicleDataSyncTaskTypeEnum.REMOTE_TRIGGER) // 类型 | |
| 34 | + .paramFrom(currentDate) | |
| 35 | + .paramTo(currentDate) | |
| 32 | 36 | .build(); |
| 33 | - this.vehicleDataSyncService.addToDataSyncTaskQueue(taskFlag); | |
| 37 | + this.vehicleDataSyncService.addToDataSyncTaskQueue(task); | |
| 34 | 38 | return ApiResult.success( |
| 35 | 39 | "200", |
| 36 | 40 | "添加同步任务成功", |
| ... | ... | @@ -41,17 +45,61 @@ public class VehicleDataSyncController extends BController<VehicleDataSyncLog, L |
| 41 | 45 | "添加同步任务失败,内部错误:" + exp.getMessage()); |
| 42 | 46 | } |
| 43 | 47 | } |
| 48 | + //------------------ 外部系统调用的api(如上)-----------------------// | |
| 44 | 49 | |
| 45 | 50 | /** |
| 46 | - * 获取同步日志。 | |
| 51 | + * 手动添加同步任务。 | |
| 52 | + * @param vehicleDataSyncTaskRequest | |
| 53 | + * @return | |
| 54 | + */ | |
| 55 | + @PostMapping(value = "/addTask") | |
| 56 | + public ApiResult addTask(@RequestBody VehicleDataSyncTaskRequest vehicleDataSyncTaskRequest) { | |
| 57 | + try { | |
| 58 | + VehicleDataSyncTask task = VehicleDataSyncTask.builder() | |
| 59 | + .type(VehicleDataSyncTaskTypeEnum.ACTIVE_TRIGGER) // 类型 | |
| 60 | + .paramClzbh(vehicleDataSyncTaskRequest.getParamClzbh()) | |
| 61 | + .paramFrom(vehicleDataSyncTaskRequest.getParamFrom()) | |
| 62 | + .paramTo(vehicleDataSyncTaskRequest.getParamTo()) | |
| 63 | + .build(); | |
| 64 | + this.vehicleDataSyncService.addToDataSyncTaskQueue(task); | |
| 65 | + return ApiResult.success( | |
| 66 | + "200", | |
| 67 | + "添加同步任务成功", | |
| 68 | + "添加同步任务成功"); | |
| 69 | + } catch (Exception exp) { | |
| 70 | + return ApiResult.failure( | |
| 71 | + "500", | |
| 72 | + "添加同步任务失败,内部错误:" + exp.getMessage()); | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 获取日志相关文件。 | |
| 47 | 78 | * @param response |
| 48 | 79 | * @param id 日志Id |
| 49 | 80 | */ |
| 50 | - @GetMapping(value = "/logfile/{id}") | |
| 81 | + @GetMapping(value = "/logfile/{id}/{type}") | |
| 51 | 82 | public void exportTaskLogFile( |
| 52 | 83 | HttpServletResponse response, |
| 53 | - @PathVariable("id") long id) { | |
| 54 | - File file = this.vehicleDataSyncService.getTaskLogFile(id); | |
| 84 | + @PathVariable("id") long id, | |
| 85 | + @PathVariable("type") Integer type) { | |
| 86 | + File file; | |
| 87 | + if (type == 1) { | |
| 88 | + file = this.vehicleDataSyncService.getTaskLogFile(id); | |
| 89 | + } else if (type == 2) { | |
| 90 | + file = this.vehicleDataSyncService.getTaskValidateErrorFile(id); | |
| 91 | + } else if (type == 3) { | |
| 92 | + file = this.vehicleDataSyncService.getTaskPrepareFile(id); | |
| 93 | + } else if (type == 4) { | |
| 94 | + file = this.vehicleDataSyncService.getTaskAddErrorFile(id); | |
| 95 | + } else if (type == 5) { | |
| 96 | + file = this.vehicleDataSyncService.getTaskUpdateErrorFile(id); | |
| 97 | + } else if (type == 6) { | |
| 98 | + file = this.vehicleDataSyncService.getTaskDeviceAddErrorFile(id); | |
| 99 | + } else { | |
| 100 | + throw new RuntimeException("未知类型[" + type + "]的日志文件!"); | |
| 101 | + } | |
| 102 | + | |
| 55 | 103 | if (file == null || !file.exists()) { |
| 56 | 104 | throw new RuntimeException("日志文件不存在!"); |
| 57 | 105 | } |
| ... | ... | @@ -85,4 +133,5 @@ public class VehicleDataSyncController extends BController<VehicleDataSyncLog, L |
| 85 | 133 | bos.flush(); |
| 86 | 134 | } |
| 87 | 135 | } |
| 136 | + | |
| 88 | 137 | } | ... | ... |
src/main/java/com/bsth/controller/schedule/datasync/request/VehicleDataSyncTaskRequest.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.datasync.request; | |
| 2 | + | |
| 3 | +import lombok.AllArgsConstructor; | |
| 4 | +import lombok.Builder; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.ToString; | |
| 7 | + | |
| 8 | +import java.util.Date; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 车辆信息同步任务请求对象。 | |
| 12 | + */ | |
| 13 | +@Data | |
| 14 | +@Builder | |
| 15 | +@AllArgsConstructor | |
| 16 | +@ToString | |
| 17 | +public class VehicleDataSyncTaskRequest { | |
| 18 | + /** 车辆自编号(针对同步来源数据,如:车辆库中,自编号为S01-001的车辆信息) */ | |
| 19 | + private String paramClzbh; | |
| 20 | + | |
| 21 | + /** 开始时间(针对同步来源数据,如:车辆库中,某段时间内的新增和报废车辆) */ | |
| 22 | + private Date paramFrom; | |
| 23 | + /** 结束时间(针对数据源) */ | |
| 24 | + private Date paramTo; | |
| 25 | + | |
| 26 | + public VehicleDataSyncTaskRequest() {} | |
| 27 | +} | ... | ... |
src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncLog.java deleted
100644 → 0
| 1 | -package com.bsth.entity.schedule.datasync; | |
| 2 | - | |
| 3 | -import javax.persistence.*; | |
| 4 | -import java.io.Serializable; | |
| 5 | -import java.util.Date; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * 车辆数据同步日志。 | |
| 9 | - */ | |
| 10 | -@Entity | |
| 11 | -@Table(name = "bsth_c_data_sync_cars") | |
| 12 | -public class VehicleDataSyncLog implements Serializable { | |
| 13 | - private static final long serialVersionUID = -3042098095111282402L; | |
| 14 | - /** 主键Id */ | |
| 15 | - @Id | |
| 16 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 17 | - private Long id; | |
| 18 | - | |
| 19 | - /** 待同步的记录数 */ | |
| 20 | - private Integer syncRowCounts; | |
| 21 | - /** 同步-插入记录数 */ | |
| 22 | - private Integer syncInsertCounts; | |
| 23 | - /** 同步-更新记录数 */ | |
| 24 | - private Integer syncUpdateCounts; | |
| 25 | - /** 同步-错误记录数 */ | |
| 26 | - private Integer syncErrorCounts; | |
| 27 | - | |
| 28 | - /** 开始时间 */ | |
| 29 | - @Column(nullable = false) | |
| 30 | - @Temporal(TemporalType.TIMESTAMP) | |
| 31 | - private Date startDate; | |
| 32 | - /** 结束时间 */ | |
| 33 | - @Temporal(TemporalType.TIMESTAMP) | |
| 34 | - private Date endDate; | |
| 35 | - | |
| 36 | - /** 同步状态 */ | |
| 37 | - @Column(nullable = false) | |
| 38 | - @Convert(converter = VehicleDataSyncStatusEnumConverter.class) | |
| 39 | - private VehicleDataSyncStatusEnum status; | |
| 40 | - | |
| 41 | - /** 执行结果信息 */ | |
| 42 | - @Column(length = 2000) | |
| 43 | - private String processMsg; | |
| 44 | - | |
| 45 | - /** 执行耗时(秒) */ | |
| 46 | - private Integer processSeconds; | |
| 47 | - | |
| 48 | - public Long getId() { | |
| 49 | - return id; | |
| 50 | - } | |
| 51 | - | |
| 52 | - public void setId(Long id) { | |
| 53 | - this.id = id; | |
| 54 | - } | |
| 55 | - | |
| 56 | - public Integer getSyncRowCounts() { | |
| 57 | - return syncRowCounts; | |
| 58 | - } | |
| 59 | - | |
| 60 | - public void setSyncRowCounts(Integer syncRowCounts) { | |
| 61 | - this.syncRowCounts = syncRowCounts; | |
| 62 | - } | |
| 63 | - | |
| 64 | - public Integer getSyncInsertCounts() { | |
| 65 | - return syncInsertCounts; | |
| 66 | - } | |
| 67 | - | |
| 68 | - public void setSyncInsertCounts(Integer syncInsertCounts) { | |
| 69 | - this.syncInsertCounts = syncInsertCounts; | |
| 70 | - } | |
| 71 | - | |
| 72 | - public Integer getSyncUpdateCounts() { | |
| 73 | - return syncUpdateCounts; | |
| 74 | - } | |
| 75 | - | |
| 76 | - public void setSyncUpdateCounts(Integer syncUpdateCounts) { | |
| 77 | - this.syncUpdateCounts = syncUpdateCounts; | |
| 78 | - } | |
| 79 | - | |
| 80 | - public Integer getSyncErrorCounts() { | |
| 81 | - return syncErrorCounts; | |
| 82 | - } | |
| 83 | - | |
| 84 | - public void setSyncErrorCounts(Integer syncErrorCounts) { | |
| 85 | - this.syncErrorCounts = syncErrorCounts; | |
| 86 | - } | |
| 87 | - | |
| 88 | - public Date getStartDate() { | |
| 89 | - return startDate; | |
| 90 | - } | |
| 91 | - | |
| 92 | - public void setStartDate(Date startDate) { | |
| 93 | - this.startDate = startDate; | |
| 94 | - } | |
| 95 | - | |
| 96 | - public Date getEndDate() { | |
| 97 | - return endDate; | |
| 98 | - } | |
| 99 | - | |
| 100 | - public void setEndDate(Date endDate) { | |
| 101 | - this.endDate = endDate; | |
| 102 | - } | |
| 103 | - | |
| 104 | - public VehicleDataSyncStatusEnum getStatus() { | |
| 105 | - return status; | |
| 106 | - } | |
| 107 | - | |
| 108 | - public void setStatus(VehicleDataSyncStatusEnum status) { | |
| 109 | - this.status = status; | |
| 110 | - } | |
| 111 | - | |
| 112 | - public String getProcessMsg() { | |
| 113 | - return processMsg; | |
| 114 | - } | |
| 115 | - | |
| 116 | - public void setProcessMsg(String processMsg) { | |
| 117 | - this.processMsg = processMsg; | |
| 118 | - } | |
| 119 | - | |
| 120 | - public Integer getProcessSeconds() { | |
| 121 | - return processSeconds; | |
| 122 | - } | |
| 123 | - | |
| 124 | - public void setProcessSeconds(Integer processSeconds) { | |
| 125 | - this.processSeconds = processSeconds; | |
| 126 | - } | |
| 127 | -} |
src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncTask.java
0 → 100644
| 1 | +package com.bsth.entity.schedule.datasync; | |
| 2 | + | |
| 3 | +import lombok.AllArgsConstructor; | |
| 4 | +import lombok.Builder; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +import javax.persistence.*; | |
| 8 | +import java.io.Serializable; | |
| 9 | +import java.util.Date; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 车辆数据同步日志。 | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +@Builder | |
| 16 | +@AllArgsConstructor | |
| 17 | +@Entity | |
| 18 | +@Table(name = "bsth_c_data_sync_cars") | |
| 19 | +public class VehicleDataSyncTask implements Serializable { | |
| 20 | + private static final long serialVersionUID = -3042098095111282402L; | |
| 21 | + /** 主键Id */ | |
| 22 | + @Id | |
| 23 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 24 | + private Long id; | |
| 25 | + | |
| 26 | + //------------- 同步用参数(以下) --------------// | |
| 27 | + /** 车辆自编号(针对同步来源数据,如:车辆库中,自编号为S01-001的车辆信息) */ | |
| 28 | + private String paramClzbh; | |
| 29 | + | |
| 30 | + /** 开始时间(针对同步来源数据,如:车辆库中,某段时间内的新增和报废车辆) */ | |
| 31 | + private Date paramFrom; | |
| 32 | + /** 结束时间(针对数据源) */ | |
| 33 | + private Date paramTo; | |
| 34 | + | |
| 35 | + // TODO:对象放在队列中,自定义属性暂时不需要,以后需要再加 | |
| 36 | + | |
| 37 | + //------------- 同步用参数(以上) --------------// | |
| 38 | + | |
| 39 | + /** 待同步的记录数 */ | |
| 40 | + private Integer syncRowCounts; | |
| 41 | + /** 同步-插入记录数 */ | |
| 42 | + private Integer syncInsertCounts; | |
| 43 | + /** 同步-更新记录数 */ | |
| 44 | + private Integer syncUpdateCounts; | |
| 45 | + /** 同步-错误记录数 */ | |
| 46 | + private Integer syncErrorCounts; | |
| 47 | + | |
| 48 | + /** 开始时间 */ | |
| 49 | + @Column(nullable = false) | |
| 50 | + @Temporal(TemporalType.TIMESTAMP) | |
| 51 | + private Date startDate; | |
| 52 | + /** 结束时间 */ | |
| 53 | + @Temporal(TemporalType.TIMESTAMP) | |
| 54 | + private Date endDate; | |
| 55 | + | |
| 56 | + /** 同步状态 */ | |
| 57 | + @Column(nullable = false) | |
| 58 | + @Convert(converter = VehicleDataSyncTaskStatusEnumConverter.class) | |
| 59 | + private VehicleDataSyncTaskStatusEnum status; | |
| 60 | + | |
| 61 | + /** 同步类型 */ | |
| 62 | + @Column(nullable = false) | |
| 63 | + @Convert(converter = VehicleDataSyncTaskTypeEnumConverter.class) | |
| 64 | + private VehicleDataSyncTaskTypeEnum type; | |
| 65 | + | |
| 66 | + /** 执行结果信息 */ | |
| 67 | + @Column(length = 2000) | |
| 68 | + private String processMsg; | |
| 69 | + | |
| 70 | + /** 执行耗时(秒) */ | |
| 71 | + private Integer processSeconds; | |
| 72 | + | |
| 73 | + public VehicleDataSyncTask() {} | |
| 74 | +} | ... | ... |
src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncStatusEnum.java renamed to src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncTaskStatusEnum.java
| ... | ... | @@ -10,18 +10,18 @@ import java.util.Map; |
| 10 | 10 | /** |
| 11 | 11 | * 车辆数据同步状态enum。 |
| 12 | 12 | */ |
| 13 | -public enum VehicleDataSyncStatusEnum { | |
| 13 | +public enum VehicleDataSyncTaskStatusEnum { | |
| 14 | 14 | |
| 15 | 15 | PREPARE("同步准备"), |
| 16 | 16 | PREPARE_FAIL("同步准备失败"), |
| 17 | 17 | SYNCING("同步中"), |
| 18 | 18 | END("同步结束"); |
| 19 | 19 | |
| 20 | - /** 字典描述(对应数据库的字典) */ | |
| 20 | + /** 字典描述(对应数据库的字典)*/ | |
| 21 | 21 | private String dicDesc; |
| 22 | 22 | |
| 23 | 23 | @JsonCreator |
| 24 | - VehicleDataSyncStatusEnum(String dicDesc) { | |
| 24 | + VehicleDataSyncTaskStatusEnum(String dicDesc) { | |
| 25 | 25 | this.dicDesc = dicDesc; |
| 26 | 26 | } |
| 27 | 27 | |
| ... | ... | @@ -39,15 +39,15 @@ public enum VehicleDataSyncStatusEnum { |
| 39 | 39 | return dicDesc; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public static Map<String, VehicleDataSyncStatusEnum> enumMap = | |
| 43 | - new HashMap<String, VehicleDataSyncStatusEnum>() {{ | |
| 42 | + public static Map<String, VehicleDataSyncTaskStatusEnum> enumMap = | |
| 43 | + new HashMap<String, VehicleDataSyncTaskStatusEnum>() {{ | |
| 44 | 44 | put("同步准备", PREPARE); |
| 45 | 45 | put("同步准备失败", PREPARE_FAIL); |
| 46 | 46 | put("同步中", SYNCING); |
| 47 | 47 | put("同步结束", END); |
| 48 | 48 | }}; |
| 49 | 49 | |
| 50 | - public static VehicleDataSyncStatusEnum fromDicDesc(String dicDesc) { | |
| 50 | + public static VehicleDataSyncTaskStatusEnum fromDicDesc(String dicDesc) { | |
| 51 | 51 | if (StringUtils.isEmpty(dicDesc)) { |
| 52 | 52 | throw new RuntimeException("车辆数据同步状态描述不能为空!"); |
| 53 | 53 | } else if (enumMap.get(dicDesc) == null) { | ... | ... |
src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncStatusEnumConverter.java renamed to src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncTaskStatusEnumConverter.java
| ... | ... | @@ -7,14 +7,14 @@ import javax.persistence.Convert; |
| 7 | 7 | * 车辆数据同步状态jpa转换器。 |
| 8 | 8 | */ |
| 9 | 9 | @Convert |
| 10 | -public class VehicleDataSyncStatusEnumConverter implements AttributeConverter<VehicleDataSyncStatusEnum, String> { | |
| 10 | +public class VehicleDataSyncTaskStatusEnumConverter implements AttributeConverter<VehicleDataSyncTaskStatusEnum, String> { | |
| 11 | 11 | @Override |
| 12 | - public String convertToDatabaseColumn(VehicleDataSyncStatusEnum vehicleDataSyncStatusEnum) { | |
| 12 | + public String convertToDatabaseColumn(VehicleDataSyncTaskStatusEnum vehicleDataSyncStatusEnum) { | |
| 13 | 13 | return vehicleDataSyncStatusEnum.getDicDesc(); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | @Override |
| 17 | - public VehicleDataSyncStatusEnum convertToEntityAttribute(String dbData) { | |
| 18 | - return VehicleDataSyncStatusEnum.fromDicDesc(dbData); | |
| 17 | + public VehicleDataSyncTaskStatusEnum convertToEntityAttribute(String dbData) { | |
| 18 | + return VehicleDataSyncTaskStatusEnum.fromDicDesc(dbData); | |
| 19 | 19 | } |
| 20 | 20 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncTaskTypeEnum.java
0 → 100644
| 1 | +package com.bsth.entity.schedule.datasync; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonCreator; | |
| 4 | +import com.fasterxml.jackson.annotation.JsonValue; | |
| 5 | +import org.springframework.util.StringUtils; | |
| 6 | + | |
| 7 | +import java.util.HashMap; | |
| 8 | +import java.util.Map; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 车辆数据同步类型enum。 | |
| 12 | + */ | |
| 13 | +public enum VehicleDataSyncTaskTypeEnum { | |
| 14 | + REMOTE_TRIGGER("远端触发"), | |
| 15 | + ACTIVE_TRIGGER("主动触发"); | |
| 16 | + | |
| 17 | + /** 字典描述(对应数据库的字典)*/ | |
| 18 | + private String dicDesc; | |
| 19 | + | |
| 20 | + @JsonCreator | |
| 21 | + VehicleDataSyncTaskTypeEnum(String dicDesc) { | |
| 22 | + this.dicDesc = dicDesc; | |
| 23 | + } | |
| 24 | + | |
| 25 | + @JsonValue | |
| 26 | + public String getDicDesc() { | |
| 27 | + return dicDesc; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setDicDesc(String dicDesc) { | |
| 31 | + this.dicDesc = dicDesc; | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public String toString() { | |
| 36 | + return dicDesc; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public static Map<String, VehicleDataSyncTaskTypeEnum> enumMap = | |
| 40 | + new HashMap<String, VehicleDataSyncTaskTypeEnum>() {{ | |
| 41 | + put("远端触发", REMOTE_TRIGGER); | |
| 42 | + put("主动触发", ACTIVE_TRIGGER); | |
| 43 | + }}; | |
| 44 | + | |
| 45 | + public static VehicleDataSyncTaskTypeEnum fromDicDesc(String dicDesc) { | |
| 46 | + if (StringUtils.isEmpty(dicDesc)) { | |
| 47 | + throw new RuntimeException("车辆数据同步类型描述不能为空!"); | |
| 48 | + } else if (enumMap.get(dicDesc) == null) { | |
| 49 | + throw new RuntimeException("车辆数据同步类型未定义:" + dicDesc); | |
| 50 | + } | |
| 51 | + return enumMap.get(dicDesc); | |
| 52 | + } | |
| 53 | + | |
| 54 | +} | ... | ... |
src/main/java/com/bsth/entity/schedule/datasync/VehicleDataSyncTaskTypeEnumConverter.java
0 → 100644
| 1 | +package com.bsth.entity.schedule.datasync; | |
| 2 | + | |
| 3 | +import javax.persistence.AttributeConverter; | |
| 4 | +import javax.persistence.Convert; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * 车辆数据同步类型jpa转换器。 | |
| 8 | + */ | |
| 9 | +@Convert | |
| 10 | +public class VehicleDataSyncTaskTypeEnumConverter implements AttributeConverter<VehicleDataSyncTaskTypeEnum, String> { | |
| 11 | + @Override | |
| 12 | + public String convertToDatabaseColumn(VehicleDataSyncTaskTypeEnum vehicleDataSyncTaskTypeEnum) { | |
| 13 | + return vehicleDataSyncTaskTypeEnum.getDicDesc(); | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public VehicleDataSyncTaskTypeEnum convertToEntityAttribute(String dbData) { | |
| 18 | + return VehicleDataSyncTaskTypeEnum.fromDicDesc(dbData); | |
| 19 | + } | |
| 20 | + | |
| 21 | +} | ... | ... |
src/main/java/com/bsth/filter/BaseFilter.java
| ... | ... | @@ -17,7 +17,8 @@ public abstract class BaseFilter implements Filter { |
| 17 | 17 | * 白名单 |
| 18 | 18 | */ |
| 19 | 19 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.SERVICE_INTERFACE, |
| 20 | - Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS, Constants.UP_RFID_URL, Constants.STATION_AND_SECTION_COUNT, Constants.ACTUATOR_MANAGEMENT_HEALTH, Constants.WEBSERVICE_URL }; | |
| 20 | + Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS, Constants.UP_RFID_URL, Constants.STATION_AND_SECTION_COUNT, Constants.ACTUATOR_MANAGEMENT_HEALTH, | |
| 21 | + Constants.WEBSERVICE_URL, Constants.VEHICLE_DATA_SYNC_URL }; | |
| 21 | 22 | |
| 22 | 23 | @Override |
| 23 | 24 | public void destroy() { | ... | ... |
src/main/java/com/bsth/repository/schedule/batch/VehicleDataSyncLogRepository.java renamed to src/main/java/com/bsth/repository/schedule/datasync/VehicleDataSyncTaskRepository.java
| 1 | -package com.bsth.repository.schedule.batch; | |
| 1 | +package com.bsth.repository.schedule.datasync; | |
| 2 | 2 | |
| 3 | -import com.bsth.entity.schedule.datasync.VehicleDataSyncLog; | |
| 3 | +import com.bsth.entity.schedule.datasync.VehicleDataSyncTask; | |
| 4 | 4 | import com.bsth.repository.BaseRepository; |
| 5 | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | |
| 7 | 7 | @Repository |
| 8 | -public interface VehicleDataSyncLogRepository extends BaseRepository<VehicleDataSyncLog, Long> { | |
| 8 | +public interface VehicleDataSyncTaskRepository extends BaseRepository<VehicleDataSyncTask, Long> { | |
| 9 | 9 | } | ... | ... |
src/main/java/com/bsth/security/filter/LoginInterceptor.java
| ... | ... | @@ -17,11 +17,11 @@ import java.util.HashMap; |
| 17 | 17 | import java.util.Map; |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | - * | |
| 21 | - * @ClassName: LoginInterceptor | |
| 22 | - * @Description: TODO(登录校验) | |
| 23 | - * @author PanZhao | |
| 24 | - * @date 2016年3月24日 上午11:49:20 | |
| 20 | + * | |
| 21 | + * @ClassName: LoginInterceptor | |
| 22 | + * @Description: TODO(登录校验) | |
| 23 | + * @author PanZhao | |
| 24 | + * @date 2016年3月24日 上午11:49:20 | |
| 25 | 25 | * |
| 26 | 26 | */ |
| 27 | 27 | public class LoginInterceptor implements Filter { |
| ... | ... | @@ -33,12 +33,13 @@ public class LoginInterceptor implements Filter { |
| 33 | 33 | * 相比于 BaseFilter,此处对线调GPS请求进行了拦截验证 |
| 34 | 34 | */ |
| 35 | 35 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.SERVICE_INTERFACE, |
| 36 | - Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.UP_RFID_URL,Constants.STATION_AND_SECTION_COUNT, Constants.WEBSERVICE_URL }; | |
| 36 | + Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.UP_RFID_URL,Constants.STATION_AND_SECTION_COUNT, | |
| 37 | + Constants.WEBSERVICE_URL, Constants.VEHICLE_DATA_SYNC_URL }; | |
| 37 | 38 | |
| 38 | 39 | |
| 39 | 40 | @Override |
| 40 | 41 | public void destroy() { |
| 41 | - | |
| 42 | + | |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | ... | ... |
src/main/java/com/bsth/service/schedule/datasync/VehicleDataSyncService.java renamed to src/main/java/com/bsth/service/schedule/datasync/VehicleDataSyncTaskService.java
| 1 | 1 | package com.bsth.service.schedule.datasync; |
| 2 | 2 | |
| 3 | -import com.bsth.service.schedule.datasync.task.VehicleDataSyncTaskFlag; | |
| 3 | +import com.bsth.entity.schedule.datasync.VehicleDataSyncTask; | |
| 4 | +import com.bsth.service.schedule.BService; | |
| 4 | 5 | |
| 5 | 6 | import java.io.File; |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * 车辆信息同步接口。 |
| 9 | 10 | */ |
| 10 | -public interface VehicleDataSyncService { | |
| 11 | +public interface VehicleDataSyncTaskService extends BService<VehicleDataSyncTask, Long> { | |
| 11 | 12 | /** |
| 12 | 13 | * 添加数据同步任务到队列-等待同步。 |
| 13 | - * @param taskFlag 同步标识对象 | |
| 14 | + * @param task 同步任务对象 | |
| 14 | 15 | */ |
| 15 | - void addToDataSyncTaskQueue(VehicleDataSyncTaskFlag taskFlag); | |
| 16 | + void addToDataSyncTaskQueue(VehicleDataSyncTask task); | |
| 16 | 17 | |
| 17 | 18 | /** |
| 18 | 19 | * 获取车辆数据同步task Id。 |
| 19 | - * @param vehicleDataSyncLogId VehicleDataSyncLog主键Id | |
| 20 | + * @param vehicleDataSyncTaskId VehicleDataSyncTask主键Id | |
| 20 | 21 | * @return 日志文件 |
| 21 | 22 | */ |
| 22 | - File getTaskLogFile(Long vehicleDataSyncLogId); | |
| 23 | + File getTaskLogFile(Long vehicleDataSyncTaskId); | |
| 24 | + | |
| 25 | + //--------- 获取相关的错误信息文件(具体对应VehicleDataSyncTaskThread中的描述)-----// | |
| 26 | + File getTaskValidateErrorFile(Long vehicleDataSyncTaskId); | |
| 27 | + File getTaskPrepareFile(Long vehicleDataSyncTaskId); | |
| 28 | + File getTaskAddErrorFile(Long vehicleDataSyncTaskId); | |
| 29 | + File getTaskUpdateErrorFile(Long vehicleDataSyncTaskId); | |
| 30 | + File getTaskDeviceAddErrorFile(Long vehicleDataSyncTaskId); | |
| 23 | 31 | } | ... | ... |
src/main/java/com/bsth/service/schedule/datasync/VehicleDataSyncServiceImpl.java renamed to src/main/java/com/bsth/service/schedule/datasync/VehicleDataSyncTaskServiceImpl.java
| 1 | 1 | package com.bsth.service.schedule.datasync; |
| 2 | 2 | |
| 3 | -import ch.qos.logback.classic.LoggerContext; | |
| 4 | -import ch.qos.logback.core.FileAppender; | |
| 5 | -import com.bsth.entity.schedule.datasync.VehicleDataSyncLog; | |
| 6 | -import com.bsth.entity.schedule.datasync.VehicleDataSyncStatusEnum; | |
| 7 | -import com.bsth.service.schedule.datasync.log.VehicleDataSyncLogService; | |
| 8 | -import com.bsth.service.schedule.datasync.task.VehicleDataSyncTaskFlag; | |
| 3 | +import com.bsth.entity.schedule.datasync.VehicleDataSyncTask; | |
| 4 | +import com.bsth.entity.schedule.datasync.VehicleDataSyncTaskStatusEnum; | |
| 9 | 5 | import com.bsth.service.schedule.datasync.task.VehicleDataSyncTaskThread; |
| 6 | +import com.bsth.service.schedule.exception.ScheduleException; | |
| 7 | +import com.bsth.service.schedule.impl.BServiceImpl; | |
| 10 | 8 | import com.bsth.service.schedule.utils.DataToolsProperties; |
| 11 | 9 | import com.bsth.service.schedule.utils.DataToolsService; |
| 12 | 10 | import com.bsth.service.schedule.utils.DataToolsServiceImpl; |
| ... | ... | @@ -28,6 +26,7 @@ import java.nio.file.Path; |
| 28 | 26 | import java.nio.file.Paths; |
| 29 | 27 | import java.text.MessageFormat; |
| 30 | 28 | import java.util.Date; |
| 29 | +import java.util.List; | |
| 31 | 30 | import java.util.concurrent.ArrayBlockingQueue; |
| 32 | 31 | import java.util.concurrent.CountDownLatch; |
| 33 | 32 | |
| ... | ... | @@ -35,12 +34,12 @@ import java.util.concurrent.CountDownLatch; |
| 35 | 34 | * 车辆信息同步实现。 |
| 36 | 35 | */ |
| 37 | 36 | @Service("VehicleDataSyncServiceImpl2") |
| 38 | -public class VehicleDataSyncServiceImpl implements VehicleDataSyncService, Runnable, DisposableBean { | |
| 37 | +public class VehicleDataSyncTaskServiceImpl extends BServiceImpl<VehicleDataSyncTask, Long> implements VehicleDataSyncTaskService, Runnable, DisposableBean { | |
| 39 | 38 | /** 日志记录器 */ |
| 40 | - private final static Logger LOG = LoggerFactory.getLogger(VehicleDataSyncServiceImpl.class); | |
| 39 | + private final static Logger LOG = LoggerFactory.getLogger(VehicleDataSyncTaskServiceImpl.class); | |
| 41 | 40 | |
| 42 | 41 | /** 同步阻塞队列 */ |
| 43 | - private ArrayBlockingQueue<VehicleDataSyncTaskFlag> dataSyncQueue; | |
| 42 | + private ArrayBlockingQueue<VehicleDataSyncTask> dataSyncQueue; | |
| 44 | 43 | /** 队列容量 */ |
| 45 | 44 | private final static int QUEUE_CAPACITY = 100; |
| 46 | 45 | |
| ... | ... | @@ -57,22 +56,43 @@ public class VehicleDataSyncServiceImpl implements VehicleDataSyncService, Runna |
| 57 | 56 | new Thread(this).start(); |
| 58 | 57 | } |
| 59 | 58 | |
| 59 | + //--------------------- 禁止override某些方法(如下) -----------------// | |
| 60 | 60 | @Override |
| 61 | - public void addToDataSyncTaskQueue(VehicleDataSyncTaskFlag vehicleDataSyncFlag) { | |
| 61 | + public VehicleDataSyncTask save(VehicleDataSyncTask vehicleDataSyncTask) { | |
| 62 | + throw new RuntimeException("VehicleDataSyncTaskServiceImpl 不支持save操作!"); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @Override | |
| 66 | + public <S extends VehicleDataSyncTask> List<S> bulkSave(List<S> entities) { | |
| 67 | + throw new RuntimeException("VehicleDataSyncTaskServiceImpl 不支持bulkSave操作!"); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 71 | + public void delete(Long aLong) throws ScheduleException { | |
| 72 | + throw new RuntimeException("VehicleDataSyncTaskServiceImpl 不支持delete操作!"); | |
| 73 | + } | |
| 74 | + //--------------------- 禁止override某些方法(如上) -----------------// | |
| 75 | + | |
| 76 | + @Override | |
| 77 | + public void addToDataSyncTaskQueue(VehicleDataSyncTask task) { | |
| 62 | 78 | if (!this.beanDestroy) { |
| 63 | 79 | // 1、初始创建同步日志对象 |
| 64 | - VehicleDataSyncLog vehicleDataSyncLog = new VehicleDataSyncLog(); | |
| 65 | - vehicleDataSyncLog.setStartDate(new Date()); | |
| 66 | - vehicleDataSyncLog.setStatus(VehicleDataSyncStatusEnum.PREPARE); | |
| 67 | - vehicleDataSyncLog = this.vehicleDataSyncLogService.save(vehicleDataSyncLog); | |
| 68 | - vehicleDataSyncFlag.setVehicleDataSyncLogId(vehicleDataSyncLog.getId()); // 设定日志Id | |
| 69 | - if (!this.dataSyncQueue.offer(vehicleDataSyncFlag)) { | |
| 70 | - vehicleDataSyncLog.setEndDate(new Date()); | |
| 71 | - vehicleDataSyncLog.setStatus(VehicleDataSyncStatusEnum.PREPARE_FAIL); | |
| 72 | - vehicleDataSyncLog.setProcessMsg(MessageFormat.format( | |
| 80 | + VehicleDataSyncTask internalTask = VehicleDataSyncTask.builder() | |
| 81 | + .paramClzbh(task.getParamClzbh()) | |
| 82 | + .paramFrom(task.getParamFrom()) | |
| 83 | + .paramTo(task.getParamTo()) | |
| 84 | + .type(task.getType()) | |
| 85 | + .startDate(new Date()) | |
| 86 | + .status(VehicleDataSyncTaskStatusEnum.PREPARE) | |
| 87 | + .build(); | |
| 88 | + internalTask = super.save(internalTask); | |
| 89 | + if (!this.dataSyncQueue.offer(internalTask)) { | |
| 90 | + internalTask.setEndDate(new Date()); | |
| 91 | + internalTask.setStatus(VehicleDataSyncTaskStatusEnum.PREPARE_FAIL); | |
| 92 | + internalTask.setProcessMsg(MessageFormat.format( | |
| 73 | 93 | "同步队列已满,队列容量={0},待处理量={1}, 无法添加同步任务!", |
| 74 | 94 | QUEUE_CAPACITY, dataSyncQueue.size())); |
| 75 | - this.vehicleDataSyncLogService.save(vehicleDataSyncLog); | |
| 95 | + super.save(internalTask); | |
| 76 | 96 | } |
| 77 | 97 | } |
| 78 | 98 | LOG.info("队列容量={},待处理量={}", QUEUE_CAPACITY, dataSyncQueue.size()); |
| ... | ... | @@ -95,8 +115,6 @@ public class VehicleDataSyncServiceImpl implements VehicleDataSyncService, Runna |
| 95 | 115 | } |
| 96 | 116 | |
| 97 | 117 | @Autowired |
| 98 | - private VehicleDataSyncLogService vehicleDataSyncLogService; | |
| 99 | - @Autowired | |
| 100 | 118 | @Qualifier(value = "dataToolsServiceImpl") |
| 101 | 119 | private DataToolsService dataToolsService; |
| 102 | 120 | @Autowired |
| ... | ... | @@ -106,43 +124,37 @@ public class VehicleDataSyncServiceImpl implements VehicleDataSyncService, Runna |
| 106 | 124 | int queueSize = this.dataSyncQueue.size(); |
| 107 | 125 | // 如果没有销毁bean,则一直检索队列,如果销毁bean,则需要等待所有队列元素执行完毕 |
| 108 | 126 | while (!this.beanDestroy || queueSize > 0) { |
| 109 | - // flag出队列 | |
| 110 | - VehicleDataSyncTaskFlag flag = this.dataSyncQueue.poll(); | |
| 111 | - if (flag != null) { | |
| 112 | - // 同步日志对象 | |
| 113 | - VehicleDataSyncLog vehicleDataSyncLog = null; | |
| 127 | + // task出队列 | |
| 128 | + VehicleDataSyncTask task = this.dataSyncQueue.poll(); | |
| 129 | + if (task != null) { | |
| 114 | 130 | try { |
| 115 | - // 1、获取同步日志 | |
| 116 | - vehicleDataSyncLog = this.vehicleDataSyncLogService.findById( | |
| 117 | - flag.getVehicleDataSyncLogId()); | |
| 118 | - // 2、设定logback MDC key,用于子线程单独输出日志 | |
| 131 | + // 1、设定logback MDC key,用于子线程单独输出日志 | |
| 119 | 132 | String taskLogKey = String.format( |
| 120 | 133 | "%s.%s", |
| 121 | - DateFormatUtils.format(vehicleDataSyncLog.getStartDate(), "yyyy-MM-dd"), | |
| 122 | - String.valueOf(vehicleDataSyncLog.getId())); | |
| 134 | + DateFormatUtils.format(task.getStartDate(), "yyyy-MM-dd"), | |
| 135 | + String.valueOf(task.getId())); | |
| 123 | 136 | MDC.put("taskLogKey", taskLogKey); |
| 124 | - // 3、开始同步 | |
| 125 | - vehicleDataSyncLog.setStatus(VehicleDataSyncStatusEnum.SYNCING); | |
| 126 | - vehicleDataSyncLog = this.vehicleDataSyncLogService.save(vehicleDataSyncLog); | |
| 127 | - // 3-1、启动同步线程 | |
| 137 | + // 2、开始同步 | |
| 138 | + task.setStatus(VehicleDataSyncTaskStatusEnum.SYNCING); | |
| 139 | + task = super.save(task); | |
| 140 | + // 2-1、启动同步线程 | |
| 128 | 141 | CountDownLatch countDownLatch = new CountDownLatch(1); |
| 129 | 142 | new Thread(VehicleDataSyncTaskThread.builder() |
| 130 | 143 | .countDownLatch(countDownLatch) |
| 131 | 144 | .dataToolsService((DataToolsServiceImpl) dataToolsService) |
| 132 | 145 | .dataToolsProperties(dataToolsProperties) |
| 133 | - .vehicleDataSyncLogService(vehicleDataSyncLogService) | |
| 134 | - .vehicleDataSyncLog(vehicleDataSyncLog) | |
| 146 | + .vehicleDataSyncTask(task) | |
| 135 | 147 | .mdcCopyOfContextMap(MDC.getCopyOfContextMap()) |
| 136 | 148 | .build()).start(); |
| 137 | - // 4、等待同步结束 | |
| 149 | + // 3、等待同步结束 | |
| 138 | 150 | countDownLatch.await(); |
| 139 | - // 4-1、更新日志 | |
| 140 | - vehicleDataSyncLog.setEndDate(new Date()); | |
| 141 | - long runMills = vehicleDataSyncLog.getEndDate().getTime() - vehicleDataSyncLog.getStartDate().getTime(); | |
| 142 | - vehicleDataSyncLog.setProcessSeconds((int) runMills / 1000); | |
| 143 | - vehicleDataSyncLog.setStatus(VehicleDataSyncStatusEnum.END); | |
| 144 | - vehicleDataSyncLog.setProcessMsg("成功!"); | |
| 145 | - this.vehicleDataSyncLogService.save(vehicleDataSyncLog); | |
| 151 | + // 3-1、更新日志 | |
| 152 | + task.setEndDate(new Date()); | |
| 153 | + long runMills = task.getEndDate().getTime() - task.getStartDate().getTime(); | |
| 154 | + task.setProcessSeconds((int) runMills / 1000); | |
| 155 | + task.setStatus(VehicleDataSyncTaskStatusEnum.END); | |
| 156 | + task.setProcessMsg("成功!"); | |
| 157 | + super.save(task); | |
| 146 | 158 | } catch (Exception exp) { |
| 147 | 159 | // 获取异常stack信息 |
| 148 | 160 | StringWriter sw = new StringWriter(); |
| ... | ... | @@ -150,12 +162,12 @@ public class VehicleDataSyncServiceImpl implements VehicleDataSyncService, Runna |
| 150 | 162 | exp.printStackTrace(pw); |
| 151 | 163 | |
| 152 | 164 | // 更新日志 |
| 153 | - vehicleDataSyncLog.setEndDate(new Date()); | |
| 154 | - long runMills = vehicleDataSyncLog.getEndDate().getTime() - vehicleDataSyncLog.getStartDate().getTime(); | |
| 155 | - vehicleDataSyncLog.setProcessSeconds((int) runMills / 1000); | |
| 156 | - vehicleDataSyncLog.setStatus(VehicleDataSyncStatusEnum.END); | |
| 157 | - vehicleDataSyncLog.setProcessMsg("有问题:" + StringUtils.substring(sw.toString(), 0, 1800)); // 日志限定长度 | |
| 158 | - this.vehicleDataSyncLogService.save(vehicleDataSyncLog); | |
| 165 | + task.setEndDate(new Date()); | |
| 166 | + long runMills = task.getEndDate().getTime() - task.getStartDate().getTime(); | |
| 167 | + task.setProcessSeconds((int) runMills / 1000); | |
| 168 | + task.setStatus(VehicleDataSyncTaskStatusEnum.END); | |
| 169 | + task.setProcessMsg("有问题:" + StringUtils.substring(sw.toString(), 0, 1800)); // 日志限定长度 | |
| 170 | + super.save(task); | |
| 159 | 171 | } finally { |
| 160 | 172 | MDC.clear(); |
| 161 | 173 | } |
| ... | ... | @@ -172,24 +184,53 @@ public class VehicleDataSyncServiceImpl implements VehicleDataSyncService, Runna |
| 172 | 184 | |
| 173 | 185 | } |
| 174 | 186 | |
| 175 | - /** 日志格式 */ | |
| 176 | - private final static String TASK_LOG_PATTERN = "vehicle-data-sync.%s.%s.log"; | |
| 187 | + //----------------------- 获取日志相关文件 ------------------// | |
| 188 | + @Override | |
| 189 | + public File getTaskLogFile(Long vehicleDataSyncTaskId) { | |
| 190 | + return this.getInternalFile(vehicleDataSyncTaskId, ".log"); | |
| 191 | + } | |
| 192 | + | |
| 193 | + @Override | |
| 194 | + public File getTaskValidateErrorFile(Long vehicleDataSyncTaskId) { | |
| 195 | + return this.getInternalFile(vehicleDataSyncTaskId, "-validate_error.xls"); | |
| 196 | + } | |
| 197 | + | |
| 198 | + @Override | |
| 199 | + public File getTaskPrepareFile(Long vehicleDataSyncTaskId) { | |
| 200 | + return this.getInternalFile(vehicleDataSyncTaskId, "-prepare.xls"); | |
| 201 | + } | |
| 202 | + | |
| 203 | + @Override | |
| 204 | + public File getTaskAddErrorFile(Long vehicleDataSyncTaskId) { | |
| 205 | + return this.getInternalFile(vehicleDataSyncTaskId, "-add_error.xls"); | |
| 206 | + } | |
| 207 | + | |
| 208 | + @Override | |
| 209 | + public File getTaskUpdateErrorFile(Long vehicleDataSyncTaskId) { | |
| 210 | + return this.getInternalFile(vehicleDataSyncTaskId, "-update_error.xls"); | |
| 211 | + } | |
| 212 | + | |
| 177 | 213 | @Override |
| 178 | - public File getTaskLogFile(Long vehicleDataSyncLogId) { | |
| 179 | - VehicleDataSyncLog vehicleDataSyncLog = this.vehicleDataSyncLogService.findById(vehicleDataSyncLogId); | |
| 214 | + public File getTaskDeviceAddErrorFile(Long vehicleDataSyncTaskId) { | |
| 215 | + return this.getInternalFile(vehicleDataSyncTaskId, "-device_add_error.xls"); | |
| 216 | + } | |
| 217 | + | |
| 218 | + /** 文件前缀格式 */ | |
| 219 | + private final static String FILE_PREFIX_PATTERN = "vehicle-data-sync.%s.%s"; | |
| 220 | + private File getInternalFile(Long vehicleDataSyncLogId, String fileSuffix) { | |
| 221 | + VehicleDataSyncTask vehicleDataSyncLog = this.findById(vehicleDataSyncLogId); | |
| 180 | 222 | if (vehicleDataSyncLog == null) { |
| 181 | 223 | throw new RuntimeException("日志Id=" + vehicleDataSyncLogId + ",不存在!"); |
| 182 | 224 | } |
| 183 | 225 | // 组合日志文件名称 |
| 184 | - String logFileName = String.format( | |
| 185 | - TASK_LOG_PATTERN, | |
| 226 | + String fileName = String.format( | |
| 227 | + FILE_PREFIX_PATTERN, | |
| 186 | 228 | DateFormatUtils.format(vehicleDataSyncLog.getStartDate(), "yyyy-MM-dd"), |
| 187 | - String.valueOf(vehicleDataSyncLogId)); | |
| 188 | - | |
| 229 | + String.valueOf(vehicleDataSyncLogId)) + fileSuffix; | |
| 189 | 230 | File file = null; |
| 190 | 231 | try { |
| 191 | - Path rootPath = this.getLogbackFilePath(); | |
| 192 | - Path logFilePath = Paths.get(rootPath.toString(), "datasync", "vehicle", logFileName); | |
| 232 | + Path rootPath = VehicleDataSyncTaskThread.getLogbackFilePath(); | |
| 233 | + Path logFilePath = Paths.get(rootPath.toString(), "datasync", "vehicle", fileName); | |
| 193 | 234 | return logFilePath.toFile(); |
| 194 | 235 | } catch (Exception exp) { |
| 195 | 236 | exp.printStackTrace(); |
| ... | ... | @@ -197,20 +238,4 @@ public class VehicleDataSyncServiceImpl implements VehicleDataSyncService, Runna |
| 197 | 238 | return file; |
| 198 | 239 | } |
| 199 | 240 | |
| 200 | - // 获取Logback中命名为File的Appender的日志文件输出路径,然后反向获取 ${LOG_BASE} 目录 | |
| 201 | - private Path getLogbackFilePath() throws Exception { | |
| 202 | - LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); | |
| 203 | - ch.qos.logback.classic.Logger logger = loggerContext.getLogger("ROOT"); | |
| 204 | - FileAppender fileAppender = (FileAppender) logger.getAppender("FILE");//"FILE"是logback配置中,输出日志文件的appender的name属性 | |
| 205 | - File file = new File(fileAppender.getFile()); | |
| 206 | - Path filePath = Paths.get(file.getCanonicalPath()); // 这个等于 ${LOG_BASE}/main/main.log | |
| 207 | - return filePath.getParent().getParent(); | |
| 208 | - } | |
| 209 | - | |
| 210 | - public static void main(String[] args) throws Exception { | |
| 211 | - String filepath = "/Users/xu/resource/project_code/bsth_project/bsth_control_parent/E:/bsth_control_logs"; | |
| 212 | - Path p = Paths.get(filepath); | |
| 213 | - System.out.println(p.getParent().getParent()); | |
| 214 | - | |
| 215 | - } | |
| 216 | 241 | } | ... | ... |
src/main/java/com/bsth/service/schedule/datasync/log/VehicleDataSyncLogService.java deleted
100644 → 0
src/main/java/com/bsth/service/schedule/datasync/log/VehicleDataSyncLogServiceImpl.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.datasync.log; | |
| 2 | - | |
| 3 | -import com.bsth.control_v2.plan_module.common.exception.PlanModuleException; | |
| 4 | -import com.bsth.entity.schedule.datasync.VehicleDataSyncLog; | |
| 5 | -import com.bsth.service.schedule.exception.ScheduleException; | |
| 6 | -import com.bsth.service.schedule.impl.BServiceImpl; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | -import org.springframework.transaction.annotation.Isolation; | |
| 9 | -import org.springframework.transaction.annotation.Propagation; | |
| 10 | -import org.springframework.transaction.annotation.Transactional; | |
| 11 | - | |
| 12 | -@Service | |
| 13 | -@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED) | |
| 14 | -public class VehicleDataSyncLogServiceImpl extends BServiceImpl<VehicleDataSyncLog, Long> implements VehicleDataSyncLogService { | |
| 15 | - | |
| 16 | - @Override | |
| 17 | - public void delete(Long aLong) throws ScheduleException { | |
| 18 | - throw new PlanModuleException("不支持delete方法!"); | |
| 19 | - } | |
| 20 | - | |
| 21 | -} |
src/main/java/com/bsth/service/schedule/datasync/task/VehicleDataSyncTaskFlag.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.datasync.task; | |
| 2 | - | |
| 3 | -import lombok.AllArgsConstructor; | |
| 4 | -import lombok.Builder; | |
| 5 | -import lombok.Data; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * 车辆信息同步标示对象。 | |
| 9 | - */ | |
| 10 | -@Data | |
| 11 | -@Builder | |
| 12 | -@AllArgsConstructor | |
| 13 | -public class VehicleDataSyncTaskFlag { | |
| 14 | - // TODO:对象放在队列中,自定义属性暂时不需要,以后需要再加 | |
| 15 | - | |
| 16 | - /** 日志Id(同步进入准备中状态设定) */ | |
| 17 | - private Long vehicleDataSyncLogId; | |
| 18 | - | |
| 19 | - public VehicleDataSyncTaskFlag() {} | |
| 20 | -} |
src/main/java/com/bsth/service/schedule/datasync/task/VehicleDataSyncTaskThread.java
| 1 | 1 | package com.bsth.service.schedule.datasync.task; |
| 2 | 2 | |
| 3 | -import com.bsth.entity.schedule.datasync.VehicleDataSyncLog; | |
| 4 | -import com.bsth.service.schedule.datasync.log.VehicleDataSyncLogService; | |
| 3 | +import ch.qos.logback.classic.LoggerContext; | |
| 4 | +import ch.qos.logback.core.FileAppender; | |
| 5 | +import com.bsth.entity.schedule.datasync.VehicleDataSyncTask; | |
| 5 | 6 | import com.bsth.service.schedule.utils.DataToolsProperties; |
| 6 | 7 | import com.bsth.service.schedule.utils.DataToolsServiceImpl; |
| 7 | 8 | import lombok.AllArgsConstructor; |
| 8 | 9 | import lombok.Builder; |
| 9 | 10 | import lombok.Data; |
| 10 | 11 | import lombok.ToString; |
| 11 | -import org.pentaho.di.core.exception.KettleException; | |
| 12 | +import org.apache.commons.lang.time.DateFormatUtils; | |
| 13 | +import org.apache.commons.lang3.StringUtils; | |
| 12 | 14 | import org.pentaho.di.core.logging.KettleLogStore; |
| 13 | 15 | import org.pentaho.di.core.logging.LoggingBuffer; |
| 14 | 16 | import org.pentaho.di.core.logging.LoggingRegistry; |
| ... | ... | @@ -21,6 +23,10 @@ import org.slf4j.LoggerFactory; |
| 21 | 23 | import org.slf4j.MDC; |
| 22 | 24 | |
| 23 | 25 | import java.io.File; |
| 26 | +import java.io.PrintWriter; | |
| 27 | +import java.io.StringWriter; | |
| 28 | +import java.nio.file.Path; | |
| 29 | +import java.nio.file.Paths; | |
| 24 | 30 | import java.util.HashMap; |
| 25 | 31 | import java.util.Map; |
| 26 | 32 | import java.util.concurrent.CountDownLatch; |
| ... | ... | @@ -38,12 +44,23 @@ public class VehicleDataSyncTaskThread implements Runnable { |
| 38 | 44 | private CountDownLatch countDownLatch; |
| 39 | 45 | private DataToolsServiceImpl dataToolsService; |
| 40 | 46 | private DataToolsProperties dataToolsProperties; |
| 41 | - private VehicleDataSyncLogService vehicleDataSyncLogService; | |
| 42 | - private VehicleDataSyncLog vehicleDataSyncLog; | |
| 47 | + private VehicleDataSyncTask vehicleDataSyncTask; | |
| 43 | 48 | private Map<String, String> mdcCopyOfContextMap; |
| 44 | 49 | |
| 45 | 50 | public VehicleDataSyncTaskThread() {} |
| 46 | 51 | |
| 52 | + /** 文件名前缀 */ | |
| 53 | + private final static String KTR_FILE_PREFIX_PATTERN = "vehicle-data-sync.%s-"; | |
| 54 | + // 获取Logback中命名为File的Appender的日志文件输出路径,然后反向获取 ${LOG_BASE} 目录 | |
| 55 | + public static Path getLogbackFilePath() throws Exception { | |
| 56 | + LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); | |
| 57 | + ch.qos.logback.classic.Logger logger = loggerContext.getLogger("ROOT"); | |
| 58 | + FileAppender fileAppender = (FileAppender) logger.getAppender("FILE");//"FILE"是logback配置中,输出日志文件的appender的name属性 | |
| 59 | + File file = new File(fileAppender.getFile()); | |
| 60 | + Path filePath = Paths.get(file.getCanonicalPath()); // 这个等于 ${LOG_BASE}/main/main.log | |
| 61 | + return filePath.getParent().getParent(); | |
| 62 | + } | |
| 63 | + | |
| 47 | 64 | @Override |
| 48 | 65 | public void run() { |
| 49 | 66 | try { |
| ... | ... | @@ -57,18 +74,54 @@ public class VehicleDataSyncTaskThread implements Runnable { |
| 57 | 74 | dataToolsProperties.getVehicleDatasyncktr()).toURI()); |
| 58 | 75 | // 2、创建命名参数 |
| 59 | 76 | Map<String, String> ktrNamedParams = new HashMap<>(); |
| 77 | + ktrNamedParams.put("paramClzbh", vehicleDataSyncTask.getParamClzbh()); | |
| 78 | + ktrNamedParams.put("paramFrom", vehicleDataSyncTask.getParamFrom() == null ? | |
| 79 | + null : DateFormatUtils.format(vehicleDataSyncTask.getParamFrom(), "yyyy-MM-dd") + " 00:00:00"); | |
| 80 | + ktrNamedParams.put("paramTo", vehicleDataSyncTask.getParamTo() == null ? | |
| 81 | + null : DateFormatUtils.format(vehicleDataSyncTask.getParamTo(), "yyyy-MM-dd") + " 23:59:59"); | |
| 82 | + Path fileDir = Paths.get(VehicleDataSyncTaskThread.getLogbackFilePath().toString(), "datasync", "vehicle"); | |
| 83 | + String filePrefix = String.format(KTR_FILE_PREFIX_PATTERN, MDC.get("taskLogKey")); | |
| 84 | + ktrNamedParams.put("file_validate_error", Paths.get(fileDir.toString(), | |
| 85 | + filePrefix + "validate_error").toFile().getCanonicalPath()); | |
| 86 | + ktrNamedParams.put("file_prepare", Paths.get(fileDir.toString(), | |
| 87 | + filePrefix + "prepare").toFile().getCanonicalPath()); | |
| 88 | + ktrNamedParams.put("file_add_error", Paths.get(fileDir.toString(), | |
| 89 | + filePrefix + "add_error").toFile().getCanonicalPath()); | |
| 90 | + ktrNamedParams.put("file_update_error", Paths.get(fileDir.toString(), | |
| 91 | + filePrefix + "update_error").toFile().getCanonicalPath()); | |
| 92 | + ktrNamedParams.put("file_deivce_add_error", Paths.get(fileDir.toString(), | |
| 93 | + filePrefix + "device_add_error").toFile().getCanonicalPath()); | |
| 60 | 94 | |
| 61 | 95 | // 3、执行ktr |
| 62 | 96 | Map<String, ProcessKtrStepMeature> processKtrStepMeatureMap = |
| 63 | - this.processKtr(ktrFile, ktrNamedParams); | |
| 64 | - | |
| 65 | - // TODO: | |
| 97 | + this.processKtr(ktrFile, ktrNamedParams, vehicleDataSyncTask); | |
| 98 | + | |
| 99 | + // 4、更新task | |
| 100 | + vehicleDataSyncTask.setSyncRowCounts(Long.valueOf( | |
| 101 | + processKtrStepMeatureMap.get("待处理数据xls输出").writes).intValue()); | |
| 102 | + vehicleDataSyncTask.setSyncInsertCounts(Long.valueOf( | |
| 103 | + processKtrStepMeatureMap.get("新增车辆数据输出").outputs).intValue()); | |
| 104 | + vehicleDataSyncTask.setSyncUpdateCounts(Long.valueOf( | |
| 105 | + processKtrStepMeatureMap.get("更新车辆数据输出").updates).intValue()); | |
| 106 | + vehicleDataSyncTask.setSyncErrorCounts(Long.valueOf( | |
| 107 | + processKtrStepMeatureMap.get("新增车辆数据输出").errors + | |
| 108 | + processKtrStepMeatureMap.get("更新车辆数据输出").errors).intValue()); | |
| 66 | 109 | |
| 67 | 110 | LOG.info("ktr执行度量值:{}", processKtrStepMeatureMap); |
| 68 | 111 | |
| 69 | 112 | } catch (Exception exp) { |
| 70 | - // 获取异常stack信息 | |
| 71 | 113 | LOG.error(exp.getMessage(), exp); |
| 114 | + | |
| 115 | + if (vehicleDataSyncTask.getProcessMsg() == null) { | |
| 116 | + // 获取异常stack信息 | |
| 117 | + StringWriter sw = new StringWriter(); | |
| 118 | + PrintWriter pw = new PrintWriter(sw); | |
| 119 | + exp.printStackTrace(pw); | |
| 120 | + | |
| 121 | + vehicleDataSyncTask.setProcessMsg( | |
| 122 | + "有问题:" + StringUtils.substring(sw.toString(), 0, 1800)); // 日志限定长度 | |
| 123 | + } | |
| 124 | + | |
| 72 | 125 | } finally { |
| 73 | 126 | LOG.info("------同步线程[taskLogKey={}]执行完毕------", MDC.get("taskLogKey")); |
| 74 | 127 | MDC.clear(); |
| ... | ... | @@ -82,7 +135,8 @@ public class VehicleDataSyncTaskThread implements Runnable { |
| 82 | 135 | * @param namedParams ktr命名参数 |
| 83 | 136 | * @return 返回Map, key为step名字,value为step度量对象 |
| 84 | 137 | */ |
| 85 | - private Map<String, ProcessKtrStepMeature> processKtr(File ktrFile, Map<String, String> namedParams) { | |
| 138 | + private Map<String, ProcessKtrStepMeature> processKtr( | |
| 139 | + File ktrFile, Map<String, String> namedParams, VehicleDataSyncTask task) throws Exception { | |
| 86 | 140 | TransMeta transMeta = null; |
| 87 | 141 | Trans trans = null; |
| 88 | 142 | |
| ... | ... | @@ -111,10 +165,6 @@ public class VehicleDataSyncTaskThread implements Runnable { |
| 111 | 165 | trans.execute(null); |
| 112 | 166 | // 2.5、等待转换结束 |
| 113 | 167 | trans.waitUntilFinished(); |
| 114 | - } catch (KettleException exp) { | |
| 115 | - LOG.error(exp.getMessage(), exp); | |
| 116 | - } catch (Exception exp) { | |
| 117 | - throw new RuntimeException(exp); | |
| 118 | 168 | } finally { |
| 119 | 169 | // 获取步骤度量值 |
| 120 | 170 | for (int i = 0; i < trans.nrSteps(); i++) { |
| ... | ... | @@ -131,17 +181,30 @@ public class VehicleDataSyncTaskThread implements Runnable { |
| 131 | 181 | .build()); |
| 132 | 182 | } |
| 133 | 183 | |
| 134 | - // 获取日志 | |
| 184 | + // 获取trans的执行日志 | |
| 135 | 185 | transLogId = trans.getLogChannelId(); |
| 136 | 186 | transMetaLogId = transMeta.getLogChannelId(); |
| 137 | - | |
| 138 | 187 | LoggingBuffer loggingBuffer = KettleLogStore.getAppender(); |
| 139 | 188 | StringBuffer stringBuffer = loggingBuffer.getBuffer( |
| 140 | 189 | trans.getLogChannelId(), false |
| 141 | 190 | ); |
| 142 | - | |
| 143 | 191 | LOG.info(stringBuffer.toString()); |
| 144 | 192 | |
| 193 | + // 如果task内部有errors,更新日志 | |
| 194 | + if (processKtrStepMeatureMap.get("数据检验错误输出").writes > 0) { | |
| 195 | + task.setProcessMsg("有问题:存在数据检验错误,请查看日志!"); | |
| 196 | + } else if (processKtrStepMeatureMap.get("新增错误数据文件").writes > 0) { | |
| 197 | + task.setProcessMsg("有问题:存在新增车辆数据错误,请查看日志!"); | |
| 198 | + } else if (processKtrStepMeatureMap.get("更新错误数据文件").writes > 0) { | |
| 199 | + task.setProcessMsg("有问题:存在更新车辆数据错误,请查看日志!"); | |
| 200 | + } else if (processKtrStepMeatureMap.get("添加车辆设备错误数据文件").writes > 0) { | |
| 201 | + task.setProcessMsg("有问题:存在添加车辆设备数据错误,请查看日志!"); | |
| 202 | + } else if (trans.getErrors() > 0) { | |
| 203 | + task.setProcessMsg("有问题:存在其他步骤错误,请查看日志!"); | |
| 204 | + } else if (trans.getResult().getExitStatus() != 0) { | |
| 205 | + task.setProcessMsg("有问题:转换执行未成功,请查看日志!"); | |
| 206 | + } | |
| 207 | + | |
| 145 | 208 | // 清除日志操作 |
| 146 | 209 | KettleLogStore.discardLines(transLogId, true); |
| 147 | 210 | KettleLogStore.discardLines(transMetaLogId, true); | ... | ... |
src/main/java/com/bsth/service/schedule/utils/DataToolsServiceImpl.java
| ... | ... | @@ -51,7 +51,9 @@ public class DataToolsServiceImpl implements DataToolsService { |
| 51 | 51 | kvars.put("v_db_pwd", dataToolsProperties.getKvarsDbpwd()); |
| 52 | 52 | kvars.put("v_db_dname", dataToolsProperties.getKvarsDbdname()); |
| 53 | 53 | EnvUtil.applyKettleProperties(kvars, true); |
| 54 | - KettleEnvironment.init(); | |
| 54 | + KettleEnvironment.init(); // 默认使用jndi数据源 | |
| 55 | + // 使用自定义的jndi上下文工厂 | |
| 56 | + System.setProperty("java.naming.factory.initial", "com.bsth.service.schedule.utils.jndi.MySimpleJndiContextFactory"); | |
| 55 | 57 | } |
| 56 | 58 | } |
| 57 | 59 | ... | ... |
src/main/java/com/bsth/service/schedule/utils/SpringUtils.java
0 → 100644
| 1 | +package com.bsth.service.schedule.utils; | |
| 2 | + | |
| 3 | +import org.springframework.beans.BeansException; | |
| 4 | +import org.springframework.beans.factory.config.BeanFactoryPostProcessor; | |
| 5 | +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
| 6 | +import org.springframework.context.ApplicationContext; | |
| 7 | +import org.springframework.context.ApplicationContextAware; | |
| 8 | +import org.springframework.stereotype.Component; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * spring工具类 方便在非spring管理环境中获取bean | |
| 12 | + */ | |
| 13 | +@Component | |
| 14 | +public class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware { | |
| 15 | + /** Spring应用上下文环境 */ | |
| 16 | + private static ConfigurableListableBeanFactory beanFactory; | |
| 17 | + | |
| 18 | + private static ApplicationContext applicationContext; | |
| 19 | + | |
| 20 | + @Override | |
| 21 | + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { | |
| 22 | + SpringUtils.beanFactory = beanFactory; | |
| 23 | + } | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | |
| 27 | + SpringUtils.applicationContext = applicationContext; | |
| 28 | + } | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 获取对象 | |
| 32 | + * | |
| 33 | + * @param name | |
| 34 | + * @return Object 一个以所给名字注册的bean的实例 | |
| 35 | + * @throws org.springframework.beans.BeansException | |
| 36 | + * | |
| 37 | + */ | |
| 38 | + @SuppressWarnings("unchecked") | |
| 39 | + public static <T> T getBean(String name) throws BeansException { | |
| 40 | + return (T) beanFactory.getBean(name); | |
| 41 | + } | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 获取类型为requiredType的对象 | |
| 45 | + * | |
| 46 | + * @param clz | |
| 47 | + * @return | |
| 48 | + * @throws org.springframework.beans.BeansException | |
| 49 | + * | |
| 50 | + */ | |
| 51 | + public static <T> T getBean(Class<T> clz) throws BeansException { | |
| 52 | + T result = (T) beanFactory.getBean(clz); | |
| 53 | + return result; | |
| 54 | + } | |
| 55 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/utils/jndi/MySimpleJndiContext.java
0 → 100644
| 1 | +package com.bsth.service.schedule.utils.jndi; | |
| 2 | + | |
| 3 | +import com.bsth.service.schedule.utils.SpringUtils; | |
| 4 | +import org.slf4j.Logger; | |
| 5 | +import org.slf4j.LoggerFactory; | |
| 6 | + | |
| 7 | +import javax.naming.*; | |
| 8 | +import javax.sql.DataSource; | |
| 9 | +import java.util.Hashtable; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 简单的jndi数据源,给kettle使用,默认返回springboot内部的datasource。 | |
| 13 | + */ | |
| 14 | +public class MySimpleJndiContext implements Context { | |
| 15 | + private final static Logger LOG = LoggerFactory.getLogger(MySimpleJndiContext.class); | |
| 16 | + | |
| 17 | + public MySimpleJndiContext(Hashtable<?, ?> environment) { | |
| 18 | + | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public Object lookup(Name name) throws NamingException { | |
| 23 | + return null; | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public Object lookup(String name) throws NamingException { | |
| 28 | + DataSource dataSource = SpringUtils.getBean(DataSource.class); | |
| 29 | + LOG.info("初始化获取jndi数据源:" + name); | |
| 30 | + return dataSource; | |
| 31 | + } | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public void bind(Name name, Object obj) throws NamingException { | |
| 35 | + | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public void bind(String name, Object obj) throws NamingException { | |
| 40 | + | |
| 41 | + } | |
| 42 | + | |
| 43 | + @Override | |
| 44 | + public void rebind(Name name, Object obj) throws NamingException { | |
| 45 | + | |
| 46 | + } | |
| 47 | + | |
| 48 | + @Override | |
| 49 | + public void rebind(String name, Object obj) throws NamingException { | |
| 50 | + | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public void unbind(Name name) throws NamingException { | |
| 55 | + | |
| 56 | + } | |
| 57 | + | |
| 58 | + @Override | |
| 59 | + public void unbind(String name) throws NamingException { | |
| 60 | + | |
| 61 | + } | |
| 62 | + | |
| 63 | + @Override | |
| 64 | + public void rename(Name oldName, Name newName) throws NamingException { | |
| 65 | + | |
| 66 | + } | |
| 67 | + | |
| 68 | + @Override | |
| 69 | + public void rename(String oldName, String newName) throws NamingException { | |
| 70 | + | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Override | |
| 74 | + public NamingEnumeration<NameClassPair> list(Name name) throws NamingException { | |
| 75 | + return null; | |
| 76 | + } | |
| 77 | + | |
| 78 | + @Override | |
| 79 | + public NamingEnumeration<NameClassPair> list(String name) throws NamingException { | |
| 80 | + return null; | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Override | |
| 84 | + public NamingEnumeration<Binding> listBindings(Name name) throws NamingException { | |
| 85 | + return null; | |
| 86 | + } | |
| 87 | + | |
| 88 | + @Override | |
| 89 | + public NamingEnumeration<Binding> listBindings(String name) throws NamingException { | |
| 90 | + return null; | |
| 91 | + } | |
| 92 | + | |
| 93 | + @Override | |
| 94 | + public void destroySubcontext(Name name) throws NamingException { | |
| 95 | + | |
| 96 | + } | |
| 97 | + | |
| 98 | + @Override | |
| 99 | + public void destroySubcontext(String name) throws NamingException { | |
| 100 | + | |
| 101 | + } | |
| 102 | + | |
| 103 | + @Override | |
| 104 | + public Context createSubcontext(Name name) throws NamingException { | |
| 105 | + return null; | |
| 106 | + } | |
| 107 | + | |
| 108 | + @Override | |
| 109 | + public Context createSubcontext(String name) throws NamingException { | |
| 110 | + return null; | |
| 111 | + } | |
| 112 | + | |
| 113 | + @Override | |
| 114 | + public Object lookupLink(Name name) throws NamingException { | |
| 115 | + return null; | |
| 116 | + } | |
| 117 | + | |
| 118 | + @Override | |
| 119 | + public Object lookupLink(String name) throws NamingException { | |
| 120 | + return null; | |
| 121 | + } | |
| 122 | + | |
| 123 | + @Override | |
| 124 | + public NameParser getNameParser(Name name) throws NamingException { | |
| 125 | + return null; | |
| 126 | + } | |
| 127 | + | |
| 128 | + @Override | |
| 129 | + public NameParser getNameParser(String name) throws NamingException { | |
| 130 | + return null; | |
| 131 | + } | |
| 132 | + | |
| 133 | + @Override | |
| 134 | + public Name composeName(Name name, Name prefix) throws NamingException { | |
| 135 | + return null; | |
| 136 | + } | |
| 137 | + | |
| 138 | + @Override | |
| 139 | + public String composeName(String name, String prefix) throws NamingException { | |
| 140 | + return null; | |
| 141 | + } | |
| 142 | + | |
| 143 | + @Override | |
| 144 | + public Object addToEnvironment(String propName, Object propVal) throws NamingException { | |
| 145 | + return null; | |
| 146 | + } | |
| 147 | + | |
| 148 | + @Override | |
| 149 | + public Object removeFromEnvironment(String propName) throws NamingException { | |
| 150 | + return null; | |
| 151 | + } | |
| 152 | + | |
| 153 | + @Override | |
| 154 | + public Hashtable<?, ?> getEnvironment() throws NamingException { | |
| 155 | + return null; | |
| 156 | + } | |
| 157 | + | |
| 158 | + @Override | |
| 159 | + public void close() throws NamingException { | |
| 160 | + | |
| 161 | + } | |
| 162 | + | |
| 163 | + @Override | |
| 164 | + public String getNameInNamespace() throws NamingException { | |
| 165 | + return null; | |
| 166 | + } | |
| 167 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/utils/jndi/MySimpleJndiContextFactory.java
0 → 100644
| 1 | +package com.bsth.service.schedule.utils.jndi; | |
| 2 | + | |
| 3 | +import javax.naming.Context; | |
| 4 | +import javax.naming.NamingException; | |
| 5 | +import javax.naming.spi.InitialContextFactory; | |
| 6 | +import java.util.Hashtable; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 自定义jndi工厂类。 | |
| 10 | + */ | |
| 11 | +public class MySimpleJndiContextFactory implements InitialContextFactory { | |
| 12 | + @Override | |
| 13 | + public Context getInitialContext(Hashtable environment) throws NamingException { | |
| 14 | + MySimpleJndiContext mySimpleJndiContext = new MySimpleJndiContext(environment); | |
| 15 | + return mySimpleJndiContext; | |
| 16 | + } | |
| 17 | +} | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -32,6 +32,7 @@ spring.datasource.hikari.max-lifetime= 1800000 |
| 32 | 32 | spring.datasource.hikari.connection-timeout= 3000 |
| 33 | 33 | spring.datasource.hikari.connection-test-query= SELECT 1 |
| 34 | 34 | spring.datasource.hikari.validation-timeout= 3000 |
| 35 | +spring.datasource.hikari.register-mbeans=true | |
| 35 | 36 | |
| 36 | 37 | ## gps client data |
| 37 | 38 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | ... | ... |
src/main/resources/application-prod.properties
| 1 | 1 | server.port=9088 |
| 2 | 2 | |
| 3 | -# dubbo服务化使用开关flag | |
| 3 | +# dubbo锟斤拷锟斤拷使锟矫匡拷锟斤拷flag | |
| 4 | 4 | dubbo.use=false |
| 5 | 5 | |
| 6 | 6 | #JPA |
| ... | ... | @@ -28,6 +28,7 @@ spring.datasource.hikari.max-lifetime= 1800000 |
| 28 | 28 | spring.datasource.hikari.connection-timeout= 3000 |
| 29 | 29 | spring.datasource.hikari.connection-test-query= SELECT 1 |
| 30 | 30 | spring.datasource.hikari.validation-timeout= 3000 |
| 31 | +spring.datasource.hikari.register-mbeans=true | |
| 31 | 32 | |
| 32 | 33 | ## gps client data |
| 33 | 34 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all |
| ... | ... | @@ -45,4 +46,4 @@ http.rfid.url= http://10.10.200.82:9000/rfid |
| 45 | 46 | http.report.url.05= http://116.228.197.222:8081/ygjwsystem_j2ee/clbx/clbx_dd.do |
| 46 | 47 | http.report.url.22= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd.do |
| 47 | 48 | http.report.url.26= http://116.236.141.34:8088/nhjwsystem_j2ee/clbx/clbx_dd.do |
| 48 | -http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do | |
| 49 | 49 | \ No newline at end of file |
| 50 | +http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do | ... | ... |
src/main/resources/datatools/ktrs/vehicleDataSync.ktr
| ... | ... | @@ -10,6 +10,46 @@ |
| 10 | 10 | <directory>/</directory> |
| 11 | 11 | <parameters> |
| 12 | 12 | <parameter> |
| 13 | + <name>file_add_error</name> | |
| 14 | + <default_value>/Users/xu/resource/project_code/runtime_temp/add_error</default_value> | |
| 15 | + <description>新增错误数据文件</description> | |
| 16 | + </parameter> | |
| 17 | + <parameter> | |
| 18 | + <name>file_deivce_add_error</name> | |
| 19 | + <default_value>/Users/xu/resource/project_code/runtime_temp/device_add_error</default_value> | |
| 20 | + <description>添加车辆设备错误数据文件</description> | |
| 21 | + </parameter> | |
| 22 | + <parameter> | |
| 23 | + <name>file_prepare</name> | |
| 24 | + <default_value>/Users/xu/resource/project_code/runtime_temp/prepare</default_value> | |
| 25 | + <description>待处理数据文件</description> | |
| 26 | + </parameter> | |
| 27 | + <parameter> | |
| 28 | + <name>file_update_error</name> | |
| 29 | + <default_value>/Users/xu/resource/project_code/runtime_temp/update_error</default_value> | |
| 30 | + <description>更新错误数据文件</description> | |
| 31 | + </parameter> | |
| 32 | + <parameter> | |
| 33 | + <name>file_validate_error</name> | |
| 34 | + <default_value>/Users/xu/resource/project_code/runtime_temp/validate_error</default_value> | |
| 35 | + <description>数据检验错误文件</description> | |
| 36 | + </parameter> | |
| 37 | + <parameter> | |
| 38 | + <name>paramClzbh</name> | |
| 39 | + <default_value/> | |
| 40 | + <description>参数-车辆自编号</description> | |
| 41 | + </parameter> | |
| 42 | + <parameter> | |
| 43 | + <name>paramFrom</name> | |
| 44 | + <default_value>2021-01-01 00:00:00</default_value> | |
| 45 | + <description>参数-开始时间(格式:yyyy-MM-dd HH:mm:ss)</description> | |
| 46 | + </parameter> | |
| 47 | + <parameter> | |
| 48 | + <name>paramTo</name> | |
| 49 | + <default_value>2021-05-01 00:00:00</default_value> | |
| 50 | + <description>参数-结束时间(格式:yyyy-MM-dd HH:mm:ss)</description> | |
| 51 | + </parameter> | |
| 52 | + <parameter> | |
| 13 | 53 | <name>password</name> |
| 14 | 54 | <default_value>856s543af26166g8</default_value> |
| 15 | 55 | <description>密钥</description> |
| ... | ... | @@ -85,11 +125,11 @@ |
| 85 | 125 | </info> |
| 86 | 126 | <notepads> |
| 87 | 127 | <notepad> |
| 88 | - <note>TODO:</note> | |
| 89 | - <xloc>105</xloc> | |
| 90 | - <yloc>283</yloc> | |
| 91 | - <width>50</width> | |
| 92 | - <heigth>26</heigth> | |
| 128 | + <note>1、json输入step处理太慢,使用javascript模拟代替
2、待处理数据xls输出中已经包含了远程和本地的对比车辆数据(不需要输出整个车辆基础信息xls),
 如果以后添加更多的更新字段,这个步骤要改的
</note> | |
| 129 | + <xloc>463</xloc> | |
| 130 | + <yloc>36</yloc> | |
| 131 | + <width>563</width> | |
| 132 | + <heigth>74</heigth> | |
| 93 | 133 | <fontname>YaHei Consolas Hybrid</fontname> |
| 94 | 134 | <fontsize>12</fontsize> |
| 95 | 135 | <fontbold>N</fontbold> |
| ... | ... | @@ -213,6 +253,31 @@ |
| 213 | 253 | </attributes> |
| 214 | 254 | </connection> |
| 215 | 255 | <connection> |
| 256 | + <name>control_jndi</name> | |
| 257 | + <server/> | |
| 258 | + <type>MYSQL</type> | |
| 259 | + <access>JNDI</access> | |
| 260 | + <database>control_jndi</database> | |
| 261 | + <port>1521</port> | |
| 262 | + <username/> | |
| 263 | + <password>Encrypted </password> | |
| 264 | + <servername/> | |
| 265 | + <data_tablespace/> | |
| 266 | + <index_tablespace/> | |
| 267 | + <attributes> | |
| 268 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 269 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 270 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 271 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | |
| 272 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 273 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 274 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 275 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 276 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 277 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 278 | + </attributes> | |
| 279 | + </connection> | |
| 280 | + <connection> | |
| 216 | 281 | <name>JGJW_VM</name> |
| 217 | 282 | <server>192.168.198.240</server> |
| 218 | 283 | <type>ORACLE</type> |
| ... | ... | @@ -589,12 +654,120 @@ |
| 589 | 654 | </attributes> |
| 590 | 655 | </connection> |
| 591 | 656 | <order> |
| 592 | - <hop> <from>http接口调用</from><to>json解析获取每辆车的json信息</to><enabled>Y</enabled> </hop> | |
| 593 | - <hop> <from>json解析获取每辆车的json信息</from><to>json解析每辆车</to><enabled>Y</enabled> </hop> | |
| 657 | + <hop> <from>http接口调用</from><to>JavaScript解析json生成数据</to><enabled>Y</enabled> </hop> | |
| 594 | 658 | <hop> <from>获取参数</from><to>http接口调用</to><enabled>Y</enabled> </hop> |
| 659 | + <hop> <from>JavaScript解析json生成数据</from><to>数据检验</to><enabled>Y</enabled> </hop> | |
| 660 | + <hop> <from>数据检验</from><to>数据检验错误输出</to><enabled>Y</enabled> </hop> | |
| 661 | + <hop> <from>公司,分公司名称代码数据</from><to>数据检验</to><enabled>Y</enabled> </hop> | |
| 662 | + <hop> <from>数据检验</from><to>待处理数据</to><enabled>Y</enabled> </hop> | |
| 663 | + <hop> <from>公司,分公司名称代码数据</from><to>获取公司分公司编码</to><enabled>Y</enabled> </hop> | |
| 664 | + <hop> <from>待处理数据</from><to>获取公司分公司编码</to><enabled>Y</enabled> </hop> | |
| 665 | + <hop> <from>判定新增/更新数据</from><to>待新增数据</to><enabled>Y</enabled> </hop> | |
| 666 | + <hop> <from>判定新增/更新数据</from><to>待更新数据</to><enabled>Y</enabled> </hop> | |
| 667 | + <hop> <from>待新增数据</from><to>新增数据处理</to><enabled>Y</enabled> </hop> | |
| 668 | + <hop> <from>获取公司分公司编码</from><to>本地车辆信息查询 </to><enabled>Y</enabled> </hop> | |
| 669 | + <hop> <from>本地车辆信息查询 </from><to>本地车辆配置信息查询</to><enabled>Y</enabled> </hop> | |
| 670 | + <hop> <from>待更新数据</from><to>更新数据处理</to><enabled>Y</enabled> </hop> | |
| 671 | + <hop> <from>字段选择</from><to>待处理数据xls输出</to><enabled>Y</enabled> </hop> | |
| 672 | + <hop> <from>更新数据处理</from><to>获取报废车辆数据(曾经配置过线路)</to><enabled>Y</enabled> </hop> | |
| 673 | + <hop> <from>获取报废车辆数据(曾经配置过线路)</from><to>报废车辆管理设备数据处理</to><enabled>Y</enabled> </hop> | |
| 674 | + <hop> <from>本地车辆配置信息查询</from><to>本地线路信息查询</to><enabled>Y</enabled> </hop> | |
| 675 | + <hop> <from>本地线路信息查询</from><to>字段选择</to><enabled>Y</enabled> </hop> | |
| 676 | + <hop> <from>本地线路信息查询</from><to>判定新增/更新数据</to><enabled>Y</enabled> </hop> | |
| 595 | 677 | <hop> <from>获取参数</from><to>写日志</to><enabled>Y</enabled> </hop> |
| 678 | + <hop> <from>新增数据处理</from><to>新增车辆数据输出</to><enabled>Y</enabled> </hop> | |
| 679 | + <hop> <from>报废车辆管理设备数据处理</from><to>新增车辆设备数据输出</to><enabled>Y</enabled> </hop> | |
| 680 | + <hop> <from>新增车辆数据输出</from><to>新增错误数据文件</to><enabled>Y</enabled> </hop> | |
| 681 | + <hop> <from>新增车辆设备数据输出</from><to>添加车辆设备错误数据文件</to><enabled>Y</enabled> </hop> | |
| 682 | + <hop> <from>更新数据处理</from><to>判定是否更新</to><enabled>Y</enabled> </hop> | |
| 683 | + <hop> <from>更新车辆数据输出</from><to>更新错误数据文件</to><enabled>Y</enabled> </hop> | |
| 684 | + <hop> <from>判定是否更新</from><to>更新车辆数据输出</to><enabled>Y</enabled> </hop> | |
| 596 | 685 | </order> |
| 597 | 686 | <step> |
| 687 | + <name>JavaScript解析json生成数据</name> | |
| 688 | + <type>ScriptValueMod</type> | |
| 689 | + <description/> | |
| 690 | + <distribute>Y</distribute> | |
| 691 | + <custom_distribution/> | |
| 692 | + <copies>1</copies> | |
| 693 | + <partitioning> | |
| 694 | + <method>none</method> | |
| 695 | + <schema_name/> | |
| 696 | + </partitioning> | |
| 697 | + <compatible>N</compatible> | |
| 698 | + <optimizationLevel>9</optimizationLevel> | |
| 699 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 700 | + <jsScript_name>Script 1</jsScript_name> | |
| 701 | + <jsScript_script>//Script here
//---------------- 数据过滤参数处理 --------------//
// 1、车辆自编号
var existParamZbh = false; // 是否存在车辆自编号参数
if (paramClzbh != null && paramClzbh != "") {
 existParamZbh = true;
}
// 2、开始时间、结束时间参数
var paramFrom_date;
var paramTo_date;
if (paramFrom != null && paramFrom != "") {
 paramFrom_date = str2date(paramFrom, 'yyyy-MM-dd HH:mm:ss');
}
if (paramTo != null && paramTo != "") {
 paramTo_date = str2date(paramTo, 'yyyy-MM-dd HH:mm:ss');
}

/**
 * 新增处理行函数。
 * @param newRow 待新增的行
 * @param jsonRow 可解析的行对象数据
 * @return false:表示外部循环break
 */
function processRow(newRow, jsonRow) {
 //------------ 根据参数,过滤记录 ---------//
 // 1、车辆自编号参数,优先级最高(其他参数不匹配了),并且只匹配一次
 if (existParamZbh) {
 if (paramClzbh == jsonRow.car_code) {
 putRow(newRow);
 return false;
 }
 return true;
 }

 // 2、开始时间,结束时间参数,两个都是必填参数,只要有一个不存在,则退出整个循环
 // 使用新增和更新时间匹配,如果又一个为null,则忽略本条数据
 if (paramFrom_date == null || paramTo_date == null) {
 return false;
 }
 // create_time为空,过滤记录
 if (jsonRow.create_time == null || jsonRow.create_time == "") {
 return true;
 }
 // 判定 paramFrom_date <= create_time <= paramTo_date
 var create_time_cov = str2date(jsonRow.create_time, 'yyyy-MM-dd HH:mm:ss');
 if (dateDiff(paramFrom_date, create_time_cov, 'ss') >= 0 && dateDiff(create_time_cov, paramTo_date, 'ss') >= 0) {
 putRow(newRow);
 return true;
 }
 // create_time不为空,不再时间范围内,update_time为空,过滤记录
 if (jsonRow.update_time == null || jsonRow.update_time == "") {
 return true;
 }
 // 判定 paramFrom_date <= update_time <= paramTo_date
 var update_time_cov = str2date(jsonRow.update_time, 'yyyy-MM-dd HH:mm:ss');
 if (dateDiff(paramFrom_date, update_time_cov, 'ss') >= 0 && dateDiff(update_time_cov, paramTo_date, 'ss') >= 0) {
 putRow(newRow);
 return true;
 }

 // TODO:其他判定参数再议
 return true;
}


var json_script = 'var jsonlist = ' + result;
eval(json_script);
for (i = 0; i < jsonlist.length; i++) {
 newRow = createRowCopy(getOutputRowMeta().size());
 var rowIndex = getInputRowMeta().size();

 //----------- 新生成字段 ----------//
 newRow[rowIndex ++] = jsonlist[i].company || null; // 公司名称
 newRow[rowIndex ++] = jsonlist[i].branch_company || null; // 分公司名称
 newRow[rowIndex ++] = jsonlist[i].company + "-" + jsonlist[i].branch_company; // 公司分公司名称合并
 newRow[rowIndex ++] = jsonlist[i].car_code || null; // 车辆自编号
 newRow[rowIndex ++] = jsonlist[i].car_plate || null; // 车牌号
 newRow[rowIndex ++] = jsonlist[i].create_time || null; // 新增时间
 newRow[rowIndex ++] = jsonlist[i].update_time || null; // 更新时间
 newRow[rowIndex ++] = jsonlist[i].application_scrap_type || null; // 报废类型
 newRow[rowIndex ++] = jsonlist[i].car_state || null; // 车辆状态
 newRow[rowIndex ++] = jsonlist[i].cancel_date || null; // 报废日期
 
 // 处理行数据
 if (!processRow(newRow, jsonlist[i])) {
 break;
 }
}
trans_Status = SKIP_TRANSFORMATION;

// 公司名称
var gsmc;
// 分公司名称
var fgsmc;
// 公司分公司名称合并
var allgsmc;
// 车辆自编号
var clzbh;
// 车牌号
var cph;
// 新增时间
var createTime;
// 更新时间
var updateTime;
// 报废类型
var scrapType;
// 车辆状态
var carState;
// 报废时间
var scrapDate;</jsScript_script> | |
| 702 | + </jsScript> </jsScripts> <fields> <field> <name>gsmc</name> | |
| 703 | + <rename>gsmc</rename> | |
| 704 | + <type>String</type> | |
| 705 | + <length>-1</length> | |
| 706 | + <precision>-1</precision> | |
| 707 | + <replace>N</replace> | |
| 708 | + </field> <field> <name>fgsmc</name> | |
| 709 | + <rename>fgsmc</rename> | |
| 710 | + <type>String</type> | |
| 711 | + <length>-1</length> | |
| 712 | + <precision>-1</precision> | |
| 713 | + <replace>N</replace> | |
| 714 | + </field> <field> <name>allgsmc</name> | |
| 715 | + <rename>allgsmc</rename> | |
| 716 | + <type>String</type> | |
| 717 | + <length>-1</length> | |
| 718 | + <precision>-1</precision> | |
| 719 | + <replace>N</replace> | |
| 720 | + </field> <field> <name>clzbh</name> | |
| 721 | + <rename>clzbh</rename> | |
| 722 | + <type>String</type> | |
| 723 | + <length>-1</length> | |
| 724 | + <precision>-1</precision> | |
| 725 | + <replace>N</replace> | |
| 726 | + </field> <field> <name>cph</name> | |
| 727 | + <rename>cph</rename> | |
| 728 | + <type>String</type> | |
| 729 | + <length>-1</length> | |
| 730 | + <precision>-1</precision> | |
| 731 | + <replace>N</replace> | |
| 732 | + </field> <field> <name>createTime</name> | |
| 733 | + <rename>createTime</rename> | |
| 734 | + <type>String</type> | |
| 735 | + <length>-1</length> | |
| 736 | + <precision>-1</precision> | |
| 737 | + <replace>N</replace> | |
| 738 | + </field> <field> <name>updateTime</name> | |
| 739 | + <rename>updateTime</rename> | |
| 740 | + <type>String</type> | |
| 741 | + <length>-1</length> | |
| 742 | + <precision>-1</precision> | |
| 743 | + <replace>N</replace> | |
| 744 | + </field> <field> <name>scrapType</name> | |
| 745 | + <rename>scrapType</rename> | |
| 746 | + <type>String</type> | |
| 747 | + <length>-1</length> | |
| 748 | + <precision>-1</precision> | |
| 749 | + <replace>N</replace> | |
| 750 | + </field> <field> <name>carState</name> | |
| 751 | + <rename>carState</rename> | |
| 752 | + <type>String</type> | |
| 753 | + <length>-1</length> | |
| 754 | + <precision>-1</precision> | |
| 755 | + <replace>N</replace> | |
| 756 | + </field> <field> <name>scrapDate</name> | |
| 757 | + <rename>scrapDate</rename> | |
| 758 | + <type>String</type> | |
| 759 | + <length>-1</length> | |
| 760 | + <precision>-1</precision> | |
| 761 | + <replace>N</replace> | |
| 762 | + </field> </fields> <cluster_schema/> | |
| 763 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 764 | + <xloc>335</xloc> | |
| 765 | + <yloc>29</yloc> | |
| 766 | + <draw>Y</draw> | |
| 767 | + </GUI> | |
| 768 | + </step> | |
| 769 | + | |
| 770 | + <step> | |
| 598 | 771 | <name>http接口调用</name> |
| 599 | 772 | <type>HTTP</type> |
| 600 | 773 | <description/> |
| ... | ... | @@ -629,108 +802,59 @@ |
| 629 | 802 | </result> |
| 630 | 803 | <cluster_schema/> |
| 631 | 804 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 632 | - <xloc>261</xloc> | |
| 633 | - <yloc>73</yloc> | |
| 805 | + <xloc>176</xloc> | |
| 806 | + <yloc>29</yloc> | |
| 634 | 807 | <draw>Y</draw> |
| 635 | 808 | </GUI> |
| 636 | 809 | </step> |
| 637 | 810 | |
| 638 | 811 | <step> |
| 639 | - <name>json解析每辆车</name> | |
| 640 | - <type>JsonInput</type> | |
| 812 | + <name>公司,分公司名称代码数据</name> | |
| 813 | + <type>DataGrid</type> | |
| 641 | 814 | <description/> |
| 642 | - <distribute>Y</distribute> | |
| 815 | + <distribute>N</distribute> | |
| 643 | 816 | <custom_distribution/> |
| 644 | 817 | <copies>1</copies> |
| 645 | 818 | <partitioning> |
| 646 | 819 | <method>none</method> |
| 647 | 820 | <schema_name/> |
| 648 | 821 | </partitioning> |
| 649 | - <include>N</include> | |
| 650 | - <include_field/> | |
| 651 | - <rownum>N</rownum> | |
| 652 | - <addresultfile>N</addresultfile> | |
| 653 | - <readurl>N</readurl> | |
| 654 | - <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile> | |
| 655 | - <doNotFailIfNoFile>Y</doNotFailIfNoFile> | |
| 656 | - <ignoreMissingPath>Y</ignoreMissingPath> | |
| 657 | - <rownum_field/> | |
| 658 | - <file> | |
| 659 | - <name/> | |
| 660 | - <filemask/> | |
| 661 | - <exclude_filemask/> | |
| 662 | - <file_required>N</file_required> | |
| 663 | - <include_subfolders>N</include_subfolders> | |
| 664 | - </file> | |
| 665 | 822 | <fields> |
| 666 | 823 | <field> |
| 667 | - <name>车辆自编号</name> | |
| 668 | - <path>$.car_code</path> | |
| 669 | - <type>String</type> | |
| 670 | - <format/> | |
| 671 | - <currency/> | |
| 672 | - <decimal/> | |
| 673 | - <group/> | |
| 674 | - <length>-1</length> | |
| 675 | - <precision>-1</precision> | |
| 676 | - <trim_type>both</trim_type> | |
| 677 | - <repeat>N</repeat> | |
| 678 | - </field> | |
| 679 | - <field> | |
| 680 | - <name>公司名称</name> | |
| 681 | - <path>$.company</path> | |
| 824 | + <name>gsmc</name> | |
| 682 | 825 | <type>String</type> |
| 683 | 826 | <format/> |
| 684 | 827 | <currency/> |
| 685 | 828 | <decimal/> |
| 686 | 829 | <group/> |
| 687 | - <length>-1</length> | |
| 688 | - <precision>-1</precision> | |
| 689 | - <trim_type>both</trim_type> | |
| 690 | - <repeat>N</repeat> | |
| 691 | - </field> | |
| 692 | - <field> | |
| 693 | - <name>分公司名称</name> | |
| 694 | - <path>$.branch_company</path> | |
| 695 | - <type>String</type> | |
| 696 | - <format/> | |
| 697 | - <currency/> | |
| 698 | - <decimal/> | |
| 699 | - <group/> | |
| 700 | - <length>-1</length> | |
| 830 | + <length>100</length> | |
| 701 | 831 | <precision>-1</precision> |
| 702 | - <trim_type>both</trim_type> | |
| 703 | - <repeat>N</repeat> | |
| 832 | + <set_empty_string>N</set_empty_string> | |
| 704 | 833 | </field> |
| 705 | 834 | <field> |
| 706 | - <name>车辆VIN号</name> | |
| 707 | - <path>$.vin_code</path> | |
| 835 | + <name>fgsmc</name> | |
| 708 | 836 | <type>String</type> |
| 709 | 837 | <format/> |
| 710 | 838 | <currency/> |
| 711 | 839 | <decimal/> |
| 712 | 840 | <group/> |
| 713 | - <length>-1</length> | |
| 841 | + <length>100</length> | |
| 714 | 842 | <precision>-1</precision> |
| 715 | - <trim_type>both</trim_type> | |
| 716 | - <repeat>N</repeat> | |
| 843 | + <set_empty_string>N</set_empty_string> | |
| 717 | 844 | </field> |
| 718 | 845 | <field> |
| 719 | - <name>动力类型</name> | |
| 720 | - <path>$.car_energy_type</path> | |
| 846 | + <name>allmc</name> | |
| 721 | 847 | <type>String</type> |
| 722 | 848 | <format/> |
| 723 | 849 | <currency/> |
| 724 | 850 | <decimal/> |
| 725 | 851 | <group/> |
| 726 | - <length>-1</length> | |
| 852 | + <length>100</length> | |
| 727 | 853 | <precision>-1</precision> |
| 728 | - <trim_type>both</trim_type> | |
| 729 | - <repeat>N</repeat> | |
| 854 | + <set_empty_string>N</set_empty_string> | |
| 730 | 855 | </field> |
| 731 | 856 | <field> |
| 732 | - <name>车身长度</name> | |
| 733 | - <path>$.car_long</path> | |
| 857 | + <name>gsdm</name> | |
| 734 | 858 | <type>String</type> |
| 735 | 859 | <format/> |
| 736 | 860 | <currency/> |
| ... | ... | @@ -738,12 +862,10 @@ |
| 738 | 862 | <group/> |
| 739 | 863 | <length>-1</length> |
| 740 | 864 | <precision>-1</precision> |
| 741 | - <trim_type>both</trim_type> | |
| 742 | - <repeat>N</repeat> | |
| 865 | + <set_empty_string>N</set_empty_string> | |
| 743 | 866 | </field> |
| 744 | 867 | <field> |
| 745 | - <name>投运日期</name> | |
| 746 | - <path>$.real_use_date</path> | |
| 868 | + <name>fgsdm</name> | |
| 747 | 869 | <type>String</type> |
| 748 | 870 | <format/> |
| 749 | 871 | <currency/> |
| ... | ... | @@ -751,33 +873,41 @@ |
| 751 | 873 | <group/> |
| 752 | 874 | <length>-1</length> |
| 753 | 875 | <precision>-1</precision> |
| 754 | - <trim_type>both</trim_type> | |
| 755 | - <repeat>N</repeat> | |
| 876 | + <set_empty_string>N</set_empty_string> | |
| 756 | 877 | </field> |
| 757 | 878 | </fields> |
| 758 | - <limit>0</limit> | |
| 759 | - <IsInFields>Y</IsInFields> | |
| 760 | - <IsAFile>N</IsAFile> | |
| 761 | - <valueField>json_str</valueField> | |
| 762 | - <shortFileFieldName/> | |
| 763 | - <pathFieldName/> | |
| 764 | - <hiddenFieldName/> | |
| 765 | - <lastModificationTimeFieldName/> | |
| 766 | - <uriNameFieldName/> | |
| 767 | - <rootUriNameFieldName/> | |
| 768 | - <extensionFieldName/> | |
| 769 | - <sizeFieldName/> | |
| 879 | + <data> | |
| 880 | + <line> <item>上南公司</item><item>上南一分公司</item><item>上南公司-上南一分公司</item><item>55</item><item>4</item> </line> | |
| 881 | + <line> <item>上南公司</item><item>上南六分公司</item><item>上南公司-上南六分公司</item><item>55</item><item>3</item> </line> | |
| 882 | + <line> <item>上南公司</item><item>上南二分公司</item><item>上南公司-上南二分公司</item><item>55</item><item>1</item> </line> | |
| 883 | + <line> <item>上南公司</item><item>上南三分公司</item><item>上南公司-上南三分公司</item><item>55</item><item>2</item> </line> | |
| 884 | + <line> <item>南汇公司</item><item>南汇三分</item><item>南汇公司-南汇三分</item><item>26</item><item>3</item> </line> | |
| 885 | + <line> <item>南汇公司</item><item>南汇二分</item><item>南汇公司-南汇二分</item><item>26</item><item>2</item> </line> | |
| 886 | + <line> <item>南汇公司</item><item>南汇一分</item><item>南汇公司-南汇一分</item><item>26</item><item>1</item> </line> | |
| 887 | + <line> <item>南汇公司</item><item>南汇维修公司</item><item>南汇公司-南汇维修公司</item><item>26</item><item>4</item> </line> | |
| 888 | + <line> <item>南汇公司</item><item>南汇公司</item><item>南汇公司-南汇公司</item><item>26</item><item>5</item> </line> | |
| 889 | + <line> <item>南汇公司</item><item>南汇六分</item><item>南汇公司-南汇六分</item><item>26</item><item>6</item> </line> | |
| 890 | + <line> <item>金高公司</item><item>二分公司</item><item>金高公司-二分公司</item><item>22</item><item>2</item> </line> | |
| 891 | + <line> <item>金高公司</item><item>四分公司</item><item>金高公司-四分公司</item><item>22</item><item>1</item> </line> | |
| 892 | + <line> <item>金高公司</item><item>三分公司</item><item>金高公司-三分公司</item><item>22</item><item>3</item> </line> | |
| 893 | + <line> <item>金高公司</item><item>一分公司</item><item>金高公司-一分公司</item><item>22</item><item>5</item> </line> | |
| 894 | + <line> <item>杨高公司</item><item>杨高分公司</item><item>杨高公司-杨高分公司</item><item>05</item><item>5</item> </line> | |
| 895 | + <line> <item>杨高公司</item><item>周浦分公司</item><item>杨高公司-周浦分公司</item><item>05</item><item>6</item> </line> | |
| 896 | + <line> <item>杨高公司</item><item>芦潮港分公司</item><item>杨高公司-芦潮港分公司</item><item>05</item><item>3</item> </line> | |
| 897 | + <line> <item>杨高公司</item><item>川沙分公司</item><item>杨高公司-川沙分公司</item><item>05</item><item>1</item> </line> | |
| 898 | + <line> <item>杨高公司</item><item>金桥分公司</item><item>杨高公司-金桥分公司</item><item>05</item><item>2</item> </line> | |
| 899 | + </data> | |
| 770 | 900 | <cluster_schema/> |
| 771 | 901 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 772 | - <xloc>450</xloc> | |
| 773 | - <yloc>181</yloc> | |
| 902 | + <xloc>178</xloc> | |
| 903 | + <yloc>222</yloc> | |
| 774 | 904 | <draw>Y</draw> |
| 775 | 905 | </GUI> |
| 776 | 906 | </step> |
| 777 | 907 | |
| 778 | 908 | <step> |
| 779 | - <name>json解析获取每辆车的json信息</name> | |
| 780 | - <type>JsonInput</type> | |
| 909 | + <name>写日志</name> | |
| 910 | + <type>WriteToLog</type> | |
| 781 | 911 | <description/> |
| 782 | 912 | <distribute>Y</distribute> |
| 783 | 913 | <custom_distribution/> |
| ... | ... | @@ -786,60 +916,24 @@ |
| 786 | 916 | <method>none</method> |
| 787 | 917 | <schema_name/> |
| 788 | 918 | </partitioning> |
| 789 | - <include>N</include> | |
| 790 | - <include_field/> | |
| 791 | - <rownum>N</rownum> | |
| 792 | - <addresultfile>N</addresultfile> | |
| 793 | - <readurl>N</readurl> | |
| 794 | - <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile> | |
| 795 | - <doNotFailIfNoFile>Y</doNotFailIfNoFile> | |
| 796 | - <ignoreMissingPath>Y</ignoreMissingPath> | |
| 797 | - <rownum_field/> | |
| 798 | - <file> | |
| 799 | - <name/> | |
| 800 | - <filemask/> | |
| 801 | - <exclude_filemask/> | |
| 802 | - <file_required>N</file_required> | |
| 803 | - <include_subfolders>N</include_subfolders> | |
| 804 | - </file> | |
| 919 | + <loglevel>log_level_basic</loglevel> | |
| 920 | + <displayHeader>Y</displayHeader> | |
| 921 | + <limitRows>N</limitRows> | |
| 922 | + <limitRowsNumber>0</limitRowsNumber> | |
| 923 | + <logmessage>开始获取 ${ssgs} 远端数据,并处理输出
获取数据 api url=${url}
url参数(密钥)password=${password}
数据源过滤参数:
1、车辆自编号 ${paramClzbh}
2、开始时间 ${paramFrom}
3、结束时间 ${paramTo}
4、数据检验错误文件 ${file_validate_error}
5、待处理数据文件 ${file_prepare}
6、车辆基础信息文件 ${file_cljcxx}
7、新增错误数据文件 ${file_add_error}
8、更新错误数据文件 ${file_update_error}
9、添加车辆设备错误数据文件 ${file_deivce_add_error}</logmessage> | |
| 805 | 924 | <fields> |
| 806 | - <field> | |
| 807 | - <name>json_str</name> | |
| 808 | - <path>$.*</path> | |
| 809 | - <type>String</type> | |
| 810 | - <format/> | |
| 811 | - <currency/> | |
| 812 | - <decimal/> | |
| 813 | - <group/> | |
| 814 | - <length>-1</length> | |
| 815 | - <precision>-1</precision> | |
| 816 | - <trim_type>both</trim_type> | |
| 817 | - <repeat>N</repeat> | |
| 818 | - </field> | |
| 819 | - </fields> | |
| 820 | - <limit>0</limit> | |
| 821 | - <IsInFields>Y</IsInFields> | |
| 822 | - <IsAFile>N</IsAFile> | |
| 823 | - <valueField>result</valueField> | |
| 824 | - <shortFileFieldName/> | |
| 825 | - <pathFieldName/> | |
| 826 | - <hiddenFieldName/> | |
| 827 | - <lastModificationTimeFieldName/> | |
| 828 | - <uriNameFieldName/> | |
| 829 | - <rootUriNameFieldName/> | |
| 830 | - <extensionFieldName/> | |
| 831 | - <sizeFieldName/> | |
| 925 | + </fields> | |
| 832 | 926 | <cluster_schema/> |
| 833 | 927 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 834 | - <xloc>265</xloc> | |
| 835 | - <yloc>181</yloc> | |
| 928 | + <xloc>56</xloc> | |
| 929 | + <yloc>123</yloc> | |
| 836 | 930 | <draw>Y</draw> |
| 837 | 931 | </GUI> |
| 838 | 932 | </step> |
| 839 | 933 | |
| 840 | 934 | <step> |
| 841 | - <name>写日志</name> | |
| 842 | - <type>WriteToLog</type> | |
| 935 | + <name>判定新增/更新数据</name> | |
| 936 | + <type>FilterRows</type> | |
| 843 | 937 | <description/> |
| 844 | 938 | <distribute>Y</distribute> |
| 845 | 939 | <custom_distribution/> |
| ... | ... | @@ -848,67 +942,2002 @@ |
| 848 | 942 | <method>none</method> |
| 849 | 943 | <schema_name/> |
| 850 | 944 | </partitioning> |
| 851 | - <loglevel>log_level_basic</loglevel> | |
| 852 | - <displayHeader>Y</displayHeader> | |
| 853 | - <limitRows>N</limitRows> | |
| 854 | - <limitRowsNumber>0</limitRowsNumber> | |
| 855 | - <logmessage>开始获取 ${ssgs} 远端数据,并处理输出
获取数据 api url=${url}
参数1(密钥)password=${password}</logmessage> | |
| 856 | - <fields> | |
| 857 | - </fields> | |
| 945 | +<send_true_to>待新增数据</send_true_to> | |
| 946 | +<send_false_to>待更新数据</send_false_to> | |
| 947 | + <compare> | |
| 948 | +<condition> | |
| 949 | + <negated>N</negated> | |
| 950 | + <leftvalue>id</leftvalue> | |
| 951 | + <function>IS NULL</function> | |
| 952 | + <rightvalue/> | |
| 953 | + </condition> | |
| 954 | + </compare> | |
| 858 | 955 | <cluster_schema/> |
| 859 | 956 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 860 | - <xloc>114</xloc> | |
| 861 | - <yloc>184</yloc> | |
| 957 | + <xloc>506</xloc> | |
| 958 | + <yloc>309</yloc> | |
| 862 | 959 | <draw>Y</draw> |
| 863 | 960 | </GUI> |
| 864 | 961 | </step> |
| 865 | 962 | |
| 866 | 963 | <step> |
| 867 | - <name>获取参数</name> | |
| 868 | - <type>GetVariable</type> | |
| 964 | + <name>判定是否更新</name> | |
| 965 | + <type>FilterRows</type> | |
| 869 | 966 | <description/> |
| 870 | - <distribute>N</distribute> | |
| 967 | + <distribute>Y</distribute> | |
| 968 | + <custom_distribution/> | |
| 969 | + <copies>1</copies> | |
| 970 | + <partitioning> | |
| 971 | + <method>none</method> | |
| 972 | + <schema_name/> | |
| 973 | + </partitioning> | |
| 974 | +<send_true_to>更新车辆数据输出</send_true_to> | |
| 975 | +<send_false_to/> | |
| 976 | + <compare> | |
| 977 | +<condition> | |
| 978 | + <negated>N</negated> | |
| 979 | + <conditions> | |
| 980 | + <condition> | |
| 981 | + <negated>N</negated> | |
| 982 | + <leftvalue>isGsUpdate</leftvalue> | |
| 983 | + <function>=</function> | |
| 984 | + <rightvalue/> | |
| 985 | + <value><name>constant</name><type>Boolean</type><text>Y</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition> | |
| 986 | + <condition> | |
| 987 | + <negated>N</negated> | |
| 988 | + <operator>OR</operator> | |
| 989 | + <leftvalue>isScrapUpdate</leftvalue> | |
| 990 | + <function>=</function> | |
| 991 | + <rightvalue/> | |
| 992 | + <value><name>constant</name><type>Boolean</type><text>Y</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition> | |
| 993 | + </conditions> | |
| 994 | + </condition> | |
| 995 | + </compare> | |
| 996 | + <cluster_schema/> | |
| 997 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 998 | + <xloc>754</xloc> | |
| 999 | + <yloc>312</yloc> | |
| 1000 | + <draw>Y</draw> | |
| 1001 | + </GUI> | |
| 1002 | + </step> | |
| 1003 | + | |
| 1004 | + <step> | |
| 1005 | + <name>字段选择</name> | |
| 1006 | + <type>SelectValues</type> | |
| 1007 | + <description/> | |
| 1008 | + <distribute>Y</distribute> | |
| 871 | 1009 | <custom_distribution/> |
| 872 | 1010 | <copies>1</copies> |
| 873 | 1011 | <partitioning> |
| 874 | 1012 | <method>none</method> |
| 875 | 1013 | <schema_name/> |
| 876 | 1014 | </partitioning> |
| 1015 | + <fields> <field> <name>gsmc</name> | |
| 1016 | + <rename>远程_公司名称</rename> | |
| 1017 | + <length>-2</length> | |
| 1018 | + <precision>-2</precision> | |
| 1019 | + </field> <field> <name>fgsmc</name> | |
| 1020 | + <rename>远程_分公司名称</rename> | |
| 1021 | + <length>-2</length> | |
| 1022 | + <precision>-2</precision> | |
| 1023 | + </field> <field> <name>clzbh</name> | |
| 1024 | + <rename>远程_车辆自编号</rename> | |
| 1025 | + <length>-2</length> | |
| 1026 | + <precision>-2</precision> | |
| 1027 | + </field> <field> <name>cph</name> | |
| 1028 | + <rename>远程_车牌号</rename> | |
| 1029 | + <length>-2</length> | |
| 1030 | + <precision>-2</precision> | |
| 1031 | + </field> <field> <name>createTime</name> | |
| 1032 | + <rename>远程_创建时间</rename> | |
| 1033 | + <length>-2</length> | |
| 1034 | + <precision>-2</precision> | |
| 1035 | + </field> <field> <name>updateTime</name> | |
| 1036 | + <rename>远程_更新时间</rename> | |
| 1037 | + <length>-2</length> | |
| 1038 | + <precision>-2</precision> | |
| 1039 | + </field> <field> <name>scrapType</name> | |
| 1040 | + <rename>远程_application_scrap_type</rename> | |
| 1041 | + <length>-2</length> | |
| 1042 | + <precision>-2</precision> | |
| 1043 | + </field> <field> <name>carState</name> | |
| 1044 | + <rename>远程_car_state</rename> | |
| 1045 | + <length>-2</length> | |
| 1046 | + <precision>-2</precision> | |
| 1047 | + </field> <field> <name>scrapDate</name> | |
| 1048 | + <rename>远程_cancel_date</rename> | |
| 1049 | + <length>-2</length> | |
| 1050 | + <precision>-2</precision> | |
| 1051 | + </field> <field> <name>company</name> | |
| 1052 | + <rename>本地_公司名称</rename> | |
| 1053 | + <length>-2</length> | |
| 1054 | + <precision>-2</precision> | |
| 1055 | + </field> <field> <name>branche_company</name> | |
| 1056 | + <rename>本地_分公司名称</rename> | |
| 1057 | + <length>-2</length> | |
| 1058 | + <precision>-2</precision> | |
| 1059 | + </field> <field> <name>id</name> | |
| 1060 | + <rename>本地_车辆Id</rename> | |
| 1061 | + <length>-2</length> | |
| 1062 | + <precision>-2</precision> | |
| 1063 | + </field> <field> <name>xl</name> | |
| 1064 | + <rename>本地_车辆最近配置线路Id</rename> | |
| 1065 | + <length>-2</length> | |
| 1066 | + <precision>-2</precision> | |
| 1067 | + </field> <field> <name>name</name> | |
| 1068 | + <rename>本地_车辆最近配置线路名字</rename> | |
| 1069 | + <length>-2</length> | |
| 1070 | + <precision>-2</precision> | |
| 1071 | + </field> <field> <name>line_code</name> | |
| 1072 | + <rename>本地_车辆最近配置线路编码</rename> | |
| 1073 | + <length>-2</length> | |
| 1074 | + <precision>-2</precision> | |
| 1075 | + </field> <field> <name>equipment_code</name> | |
| 1076 | + <rename>本地_车辆设备编号</rename> | |
| 1077 | + <length>-2</length> | |
| 1078 | + <precision>-2</precision> | |
| 1079 | + </field> <field> <name>scrap_code</name> | |
| 1080 | + <rename>本地_车辆报废号</rename> | |
| 1081 | + <length>-2</length> | |
| 1082 | + <precision>-2</precision> | |
| 1083 | + </field> <field> <name>scrap_state</name> | |
| 1084 | + <rename>本地_车辆是否报废</rename> | |
| 1085 | + <length>-2</length> | |
| 1086 | + <precision>-2</precision> | |
| 1087 | + </field> <field> <name>scrap_date</name> | |
| 1088 | + <rename>本地_车辆报废日期</rename> | |
| 1089 | + <length>-2</length> | |
| 1090 | + <precision>-2</precision> | |
| 1091 | + </field> <select_unspecified>N</select_unspecified> | |
| 1092 | + </fields> <cluster_schema/> | |
| 1093 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1094 | + <xloc>196</xloc> | |
| 1095 | + <yloc>585</yloc> | |
| 1096 | + <draw>Y</draw> | |
| 1097 | + </GUI> | |
| 1098 | + </step> | |
| 1099 | + | |
| 1100 | + <step> | |
| 1101 | + <name>待处理数据</name> | |
| 1102 | + <type>Dummy</type> | |
| 1103 | + <description/> | |
| 1104 | + <distribute>Y</distribute> | |
| 1105 | + <custom_distribution/> | |
| 1106 | + <copies>1</copies> | |
| 1107 | + <partitioning> | |
| 1108 | + <method>none</method> | |
| 1109 | + <schema_name/> | |
| 1110 | + </partitioning> | |
| 1111 | + <cluster_schema/> | |
| 1112 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1113 | + <xloc>336</xloc> | |
| 1114 | + <yloc>221</yloc> | |
| 1115 | + <draw>Y</draw> | |
| 1116 | + </GUI> | |
| 1117 | + </step> | |
| 1118 | + | |
| 1119 | + <step> | |
| 1120 | + <name>待处理数据xls输出</name> | |
| 1121 | + <type>ExcelOutput</type> | |
| 1122 | + <description/> | |
| 1123 | + <distribute>Y</distribute> | |
| 1124 | + <custom_distribution/> | |
| 1125 | + <copies>1</copies> | |
| 1126 | + <partitioning> | |
| 1127 | + <method>none</method> | |
| 1128 | + <schema_name/> | |
| 1129 | + </partitioning> | |
| 1130 | + <header>Y</header> | |
| 1131 | + <footer>N</footer> | |
| 1132 | + <encoding/> | |
| 1133 | + <append>N</append> | |
| 1134 | + <add_to_result_filenames>Y</add_to_result_filenames> | |
| 1135 | + <file> | |
| 1136 | + <name>${file_prepare}</name> | |
| 1137 | + <extention>xls</extention> | |
| 1138 | + <do_not_open_newfile_init>N</do_not_open_newfile_init> | |
| 1139 | + <create_parent_folder>N</create_parent_folder> | |
| 1140 | + <split>N</split> | |
| 1141 | + <add_date>N</add_date> | |
| 1142 | + <add_time>N</add_time> | |
| 1143 | + <SpecifyFormat>N</SpecifyFormat> | |
| 1144 | + <date_time_format/> | |
| 1145 | + <sheetname>Sheet1</sheetname> | |
| 1146 | + <autosizecolums>N</autosizecolums> | |
| 1147 | + <nullisblank>N</nullisblank> | |
| 1148 | + <protect_sheet>N</protect_sheet> | |
| 1149 | + <password>Encrypted </password> | |
| 1150 | + <splitevery>0</splitevery> | |
| 1151 | + <usetempfiles>N</usetempfiles> | |
| 1152 | + <tempdirectory/> | |
| 1153 | + </file> | |
| 1154 | + <template> | |
| 1155 | + <enabled>N</enabled> | |
| 1156 | + <append>N</append> | |
| 1157 | + <filename>template.xls</filename> | |
| 1158 | + </template> | |
| 877 | 1159 | <fields> |
| 878 | 1160 | <field> |
| 879 | - <name>password</name> | |
| 880 | - <variable>${password}</variable> | |
| 1161 | + <name>远程_公司名称</name> | |
| 881 | 1162 | <type>String</type> |
| 882 | 1163 | <format/> |
| 883 | - <currency/> | |
| 884 | - <decimal/> | |
| 885 | - <group/> | |
| 886 | - <length>-1</length> | |
| 887 | - <precision>-1</precision> | |
| 888 | - <trim_type>none</trim_type> | |
| 889 | 1164 | </field> |
| 890 | 1165 | <field> |
| 891 | - <name>url</name> | |
| 892 | - <variable>${url}</variable> | |
| 1166 | + <name>远程_分公司名称</name> | |
| 1167 | + <type>String</type> | |
| 1168 | + <format/> | |
| 1169 | + </field> | |
| 1170 | + <field> | |
| 1171 | + <name>远程_车辆自编号</name> | |
| 1172 | + <type>String</type> | |
| 1173 | + <format/> | |
| 1174 | + </field> | |
| 1175 | + <field> | |
| 1176 | + <name>远程_车牌号</name> | |
| 1177 | + <type>String</type> | |
| 1178 | + <format/> | |
| 1179 | + </field> | |
| 1180 | + <field> | |
| 1181 | + <name>远程_创建时间</name> | |
| 1182 | + <type>String</type> | |
| 1183 | + <format/> | |
| 1184 | + </field> | |
| 1185 | + <field> | |
| 1186 | + <name>远程_更新时间</name> | |
| 1187 | + <type>String</type> | |
| 1188 | + <format/> | |
| 1189 | + </field> | |
| 1190 | + <field> | |
| 1191 | + <name>远程_application_scrap_type</name> | |
| 1192 | + <type>String</type> | |
| 1193 | + <format/> | |
| 1194 | + </field> | |
| 1195 | + <field> | |
| 1196 | + <name>远程_car_state</name> | |
| 1197 | + <type>String</type> | |
| 1198 | + <format/> | |
| 1199 | + </field> | |
| 1200 | + <field> | |
| 1201 | + <name>远程_cancel_date</name> | |
| 1202 | + <type>String</type> | |
| 1203 | + <format/> | |
| 1204 | + </field> | |
| 1205 | + <field> | |
| 1206 | + <name>本地_公司名称</name> | |
| 1207 | + <type>String</type> | |
| 1208 | + <format/> | |
| 1209 | + </field> | |
| 1210 | + <field> | |
| 1211 | + <name>本地_分公司名称</name> | |
| 1212 | + <type>String</type> | |
| 1213 | + <format/> | |
| 1214 | + </field> | |
| 1215 | + <field> | |
| 1216 | + <name>本地_车辆Id</name> | |
| 1217 | + <type>Integer</type> | |
| 1218 | + <format/> | |
| 1219 | + </field> | |
| 1220 | + <field> | |
| 1221 | + <name>本地_车辆最近配置线路Id</name> | |
| 1222 | + <type>Integer</type> | |
| 1223 | + <format/> | |
| 1224 | + </field> | |
| 1225 | + <field> | |
| 1226 | + <name>本地_车辆最近配置线路名字</name> | |
| 1227 | + <type>String</type> | |
| 1228 | + <format/> | |
| 1229 | + </field> | |
| 1230 | + <field> | |
| 1231 | + <name>本地_车辆最近配置线路编码</name> | |
| 1232 | + <type>String</type> | |
| 1233 | + <format/> | |
| 1234 | + </field> | |
| 1235 | + <field> | |
| 1236 | + <name>本地_车辆设备编号</name> | |
| 1237 | + <type>String</type> | |
| 1238 | + <format/> | |
| 1239 | + </field> | |
| 1240 | + <field> | |
| 1241 | + <name>本地_车辆报废号</name> | |
| 1242 | + <type>String</type> | |
| 1243 | + <format/> | |
| 1244 | + </field> | |
| 1245 | + <field> | |
| 1246 | + <name>本地_车辆是否报废</name> | |
| 1247 | + <type>Boolean</type> | |
| 1248 | + <format/> | |
| 1249 | + </field> | |
| 1250 | + <field> | |
| 1251 | + <name>本地_车辆报废日期</name> | |
| 1252 | + <type>Timestamp</type> | |
| 1253 | + <format/> | |
| 1254 | + </field> | |
| 1255 | + </fields> | |
| 1256 | + <custom> | |
| 1257 | + <header_font_name>arial</header_font_name> | |
| 1258 | + <header_font_size>10</header_font_size> | |
| 1259 | + <header_font_bold>N</header_font_bold> | |
| 1260 | + <header_font_italic>N</header_font_italic> | |
| 1261 | + <header_font_underline>no</header_font_underline> | |
| 1262 | + <header_font_orientation>horizontal</header_font_orientation> | |
| 1263 | + <header_font_color>black</header_font_color> | |
| 1264 | + <header_background_color>none</header_background_color> | |
| 1265 | + <header_row_height>255</header_row_height> | |
| 1266 | + <header_alignment>left</header_alignment> | |
| 1267 | + <header_image/> | |
| 1268 | + <row_font_name>arial</row_font_name> | |
| 1269 | + <row_font_size>10</row_font_size> | |
| 1270 | + <row_font_color>black</row_font_color> | |
| 1271 | + <row_background_color>none</row_background_color> | |
| 1272 | + </custom> | |
| 1273 | + <cluster_schema/> | |
| 1274 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1275 | + <xloc>65</xloc> | |
| 1276 | + <yloc>585</yloc> | |
| 1277 | + <draw>Y</draw> | |
| 1278 | + </GUI> | |
| 1279 | + </step> | |
| 1280 | + | |
| 1281 | + <step> | |
| 1282 | + <name>待新增数据</name> | |
| 1283 | + <type>Dummy</type> | |
| 1284 | + <description/> | |
| 1285 | + <distribute>Y</distribute> | |
| 1286 | + <custom_distribution/> | |
| 1287 | + <copies>1</copies> | |
| 1288 | + <partitioning> | |
| 1289 | + <method>none</method> | |
| 1290 | + <schema_name/> | |
| 1291 | + </partitioning> | |
| 1292 | + <cluster_schema/> | |
| 1293 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1294 | + <xloc>507</xloc> | |
| 1295 | + <yloc>216</yloc> | |
| 1296 | + <draw>Y</draw> | |
| 1297 | + </GUI> | |
| 1298 | + </step> | |
| 1299 | + | |
| 1300 | + <step> | |
| 1301 | + <name>待更新数据</name> | |
| 1302 | + <type>Dummy</type> | |
| 1303 | + <description/> | |
| 1304 | + <distribute>Y</distribute> | |
| 1305 | + <custom_distribution/> | |
| 1306 | + <copies>1</copies> | |
| 1307 | + <partitioning> | |
| 1308 | + <method>none</method> | |
| 1309 | + <schema_name/> | |
| 1310 | + </partitioning> | |
| 1311 | + <cluster_schema/> | |
| 1312 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1313 | + <xloc>508</xloc> | |
| 1314 | + <yloc>404</yloc> | |
| 1315 | + <draw>Y</draw> | |
| 1316 | + </GUI> | |
| 1317 | + </step> | |
| 1318 | + | |
| 1319 | + <step> | |
| 1320 | + <name>报废车辆管理设备数据处理</name> | |
| 1321 | + <type>ScriptValueMod</type> | |
| 1322 | + <description/> | |
| 1323 | + <distribute>Y</distribute> | |
| 1324 | + <custom_distribution/> | |
| 1325 | + <copies>1</copies> | |
| 1326 | + <partitioning> | |
| 1327 | + <method>none</method> | |
| 1328 | + <schema_name/> | |
| 1329 | + </partitioning> | |
| 1330 | + <compatible>N</compatible> | |
| 1331 | + <optimizationLevel>9</optimizationLevel> | |
| 1332 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 1333 | + <jsScript_name>Script 1</jsScript_name> | |
| 1334 | + <jsScript_script>//Script here

//---------------- 车辆报废时需要向设备表添加一条记录 -------------//
// TODO:没有配置过线路的车辆报废时,不添加车辆设备记录

var device_gsName = gsmc; // 公司名称
var device_company = gsdm; // 公司代码
var device_branch_company = fgsdm; // 分公司代码
var device_cl = id; // 车辆Id
var device_clzbh = clzbh; // 车辆自编号
var device_old_no = equipment_code; // 之前的设备编码
var device_new_no = equipmentCode_update; // 新的设备编码
var device_is_cancel = 1; // 是否删除
var device_create_date = new Date(); // 创建时间
var device_update_date = new Date(); // 更新日期
var device_qyrq = new Date(); // 启用日期
var device_xl = xl; // 线路Id
var device_xlName = name; // 线路名字
var device_xlbm = line_code; // 线路编码</jsScript_script> | |
| 1335 | + </jsScript> </jsScripts> <fields> <field> <name>device_gsName</name> | |
| 1336 | + <rename>device_gsName</rename> | |
| 1337 | + <type>String</type> | |
| 1338 | + <length>-1</length> | |
| 1339 | + <precision>-1</precision> | |
| 1340 | + <replace>N</replace> | |
| 1341 | + </field> <field> <name>device_company</name> | |
| 1342 | + <rename>device_company</rename> | |
| 1343 | + <type>String</type> | |
| 1344 | + <length>-1</length> | |
| 1345 | + <precision>-1</precision> | |
| 1346 | + <replace>N</replace> | |
| 1347 | + </field> <field> <name>device_branch_company</name> | |
| 1348 | + <rename>device_branch_company</rename> | |
| 1349 | + <type>String</type> | |
| 1350 | + <length>-1</length> | |
| 1351 | + <precision>-1</precision> | |
| 1352 | + <replace>N</replace> | |
| 1353 | + </field> <field> <name>device_cl</name> | |
| 1354 | + <rename>device_cl</rename> | |
| 1355 | + <type>String</type> | |
| 1356 | + <length>-1</length> | |
| 1357 | + <precision>-1</precision> | |
| 1358 | + <replace>N</replace> | |
| 1359 | + </field> <field> <name>device_clzbh</name> | |
| 1360 | + <rename>device_clzbh</rename> | |
| 1361 | + <type>String</type> | |
| 1362 | + <length>-1</length> | |
| 1363 | + <precision>-1</precision> | |
| 1364 | + <replace>N</replace> | |
| 1365 | + </field> <field> <name>device_old_no</name> | |
| 1366 | + <rename>device_old_no</rename> | |
| 1367 | + <type>String</type> | |
| 1368 | + <length>-1</length> | |
| 1369 | + <precision>-1</precision> | |
| 1370 | + <replace>N</replace> | |
| 1371 | + </field> <field> <name>device_new_no</name> | |
| 1372 | + <rename>device_new_no</rename> | |
| 1373 | + <type>String</type> | |
| 1374 | + <length>-1</length> | |
| 1375 | + <precision>-1</precision> | |
| 1376 | + <replace>N</replace> | |
| 1377 | + </field> <field> <name>device_is_cancel</name> | |
| 1378 | + <rename>device_is_cancel</rename> | |
| 1379 | + <type>Integer</type> | |
| 1380 | + <length>-1</length> | |
| 1381 | + <precision>-1</precision> | |
| 1382 | + <replace>N</replace> | |
| 1383 | + </field> <field> <name>device_create_date</name> | |
| 1384 | + <rename>device_create_date</rename> | |
| 1385 | + <type>Date</type> | |
| 1386 | + <length>-1</length> | |
| 1387 | + <precision>-1</precision> | |
| 1388 | + <replace>N</replace> | |
| 1389 | + </field> <field> <name>device_update_date</name> | |
| 1390 | + <rename>device_update_date</rename> | |
| 1391 | + <type>Date</type> | |
| 1392 | + <length>-1</length> | |
| 1393 | + <precision>-1</precision> | |
| 1394 | + <replace>N</replace> | |
| 1395 | + </field> <field> <name>device_qyrq</name> | |
| 1396 | + <rename>device_qyrq</rename> | |
| 1397 | + <type>Date</type> | |
| 1398 | + <length>-1</length> | |
| 1399 | + <precision>-1</precision> | |
| 1400 | + <replace>N</replace> | |
| 1401 | + </field> <field> <name>device_xl</name> | |
| 1402 | + <rename>device_xl</rename> | |
| 1403 | + <type>String</type> | |
| 1404 | + <length>-1</length> | |
| 1405 | + <precision>-1</precision> | |
| 1406 | + <replace>N</replace> | |
| 1407 | + </field> <field> <name>device_xlName</name> | |
| 1408 | + <rename>device_xlName</rename> | |
| 1409 | + <type>String</type> | |
| 1410 | + <length>-1</length> | |
| 1411 | + <precision>-1</precision> | |
| 1412 | + <replace>N</replace> | |
| 1413 | + </field> <field> <name>device_xlbm</name> | |
| 1414 | + <rename>device_xlbm</rename> | |
| 1415 | + <type>String</type> | |
| 1416 | + <length>-1</length> | |
| 1417 | + <precision>-1</precision> | |
| 1418 | + <replace>N</replace> | |
| 1419 | + </field> </fields> <cluster_schema/> | |
| 1420 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1421 | + <xloc>674</xloc> | |
| 1422 | + <yloc>583</yloc> | |
| 1423 | + <draw>Y</draw> | |
| 1424 | + </GUI> | |
| 1425 | + </step> | |
| 1426 | + | |
| 1427 | + <step> | |
| 1428 | + <name>数据检验</name> | |
| 1429 | + <type>Validator</type> | |
| 1430 | + <description/> | |
| 1431 | + <distribute>Y</distribute> | |
| 1432 | + <custom_distribution/> | |
| 1433 | + <copies>1</copies> | |
| 1434 | + <partitioning> | |
| 1435 | + <method>none</method> | |
| 1436 | + <schema_name/> | |
| 1437 | + </partitioning> | |
| 1438 | +<validate_all>Y</validate_all> | |
| 1439 | +<concat_errors>Y</concat_errors> | |
| 1440 | +<concat_separator>|</concat_separator> | |
| 1441 | + <validator_field><name>clzbh</name> | |
| 1442 | +<validation_name>车辆自编号不为空</validation_name> | |
| 1443 | +<max_length/> | |
| 1444 | +<min_length/> | |
| 1445 | +<null_allowed>N</null_allowed> | |
| 1446 | +<only_null_allowed>N</only_null_allowed> | |
| 1447 | +<only_numeric_allowed>N</only_numeric_allowed> | |
| 1448 | +<data_type>String</data_type> | |
| 1449 | +<data_type_verified>N</data_type_verified> | |
| 1450 | +<conversion_mask/> | |
| 1451 | +<decimal_symbol/> | |
| 1452 | +<grouping_symbol/> | |
| 1453 | +<max_value/> | |
| 1454 | +<min_value/> | |
| 1455 | +<start_string/> | |
| 1456 | +<end_string/> | |
| 1457 | +<start_string_not_allowed/> | |
| 1458 | +<end_string_not_allowed/> | |
| 1459 | +<regular_expression/> | |
| 1460 | +<regular_expression_not_allowed/> | |
| 1461 | +<error_code/> | |
| 1462 | +<error_description/> | |
| 1463 | +<is_sourcing_values>N</is_sourcing_values> | |
| 1464 | +<sourcing_step/> | |
| 1465 | +<sourcing_field/> | |
| 1466 | +<allowed_value></allowed_value></validator_field> | |
| 1467 | + <validator_field><name>cph</name> | |
| 1468 | +<validation_name>车牌号不能为空</validation_name> | |
| 1469 | +<max_length/> | |
| 1470 | +<min_length/> | |
| 1471 | +<null_allowed>N</null_allowed> | |
| 1472 | +<only_null_allowed>N</only_null_allowed> | |
| 1473 | +<only_numeric_allowed>N</only_numeric_allowed> | |
| 1474 | +<data_type>String</data_type> | |
| 1475 | +<data_type_verified>N</data_type_verified> | |
| 1476 | +<conversion_mask/> | |
| 1477 | +<decimal_symbol/> | |
| 1478 | +<grouping_symbol/> | |
| 1479 | +<max_value/> | |
| 1480 | +<min_value/> | |
| 1481 | +<start_string/> | |
| 1482 | +<end_string/> | |
| 1483 | +<start_string_not_allowed/> | |
| 1484 | +<end_string_not_allowed/> | |
| 1485 | +<regular_expression/> | |
| 1486 | +<regular_expression_not_allowed/> | |
| 1487 | +<error_code/> | |
| 1488 | +<error_description/> | |
| 1489 | +<is_sourcing_values>N</is_sourcing_values> | |
| 1490 | +<sourcing_step/> | |
| 1491 | +<sourcing_field/> | |
| 1492 | +<allowed_value></allowed_value></validator_field> | |
| 1493 | + <validator_field><name>allgsmc</name> | |
| 1494 | +<validation_name>公司分公司名称匹配</validation_name> | |
| 1495 | +<max_length/> | |
| 1496 | +<min_length/> | |
| 1497 | +<null_allowed>N</null_allowed> | |
| 1498 | +<only_null_allowed>N</only_null_allowed> | |
| 1499 | +<only_numeric_allowed>N</only_numeric_allowed> | |
| 1500 | +<data_type>String</data_type> | |
| 1501 | +<data_type_verified>N</data_type_verified> | |
| 1502 | +<conversion_mask/> | |
| 1503 | +<decimal_symbol/> | |
| 1504 | +<grouping_symbol/> | |
| 1505 | +<max_value/> | |
| 1506 | +<min_value/> | |
| 1507 | +<start_string/> | |
| 1508 | +<end_string/> | |
| 1509 | +<start_string_not_allowed/> | |
| 1510 | +<end_string_not_allowed/> | |
| 1511 | +<regular_expression/> | |
| 1512 | +<regular_expression_not_allowed/> | |
| 1513 | +<error_code/> | |
| 1514 | +<error_description/> | |
| 1515 | +<is_sourcing_values>Y</is_sourcing_values> | |
| 1516 | +<sourcing_step>公司,分公司名称代码数据</sourcing_step> | |
| 1517 | +<sourcing_field>allmc</sourcing_field> | |
| 1518 | +<allowed_value></allowed_value></validator_field> | |
| 1519 | + <cluster_schema/> | |
| 1520 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1521 | + <xloc>335</xloc> | |
| 1522 | + <yloc>124</yloc> | |
| 1523 | + <draw>Y</draw> | |
| 1524 | + </GUI> | |
| 1525 | + </step> | |
| 1526 | + | |
| 1527 | + <step> | |
| 1528 | + <name>数据检验错误输出</name> | |
| 1529 | + <type>ExcelOutput</type> | |
| 1530 | + <description/> | |
| 1531 | + <distribute>Y</distribute> | |
| 1532 | + <custom_distribution/> | |
| 1533 | + <copies>1</copies> | |
| 1534 | + <partitioning> | |
| 1535 | + <method>none</method> | |
| 1536 | + <schema_name/> | |
| 1537 | + </partitioning> | |
| 1538 | + <header>Y</header> | |
| 1539 | + <footer>N</footer> | |
| 1540 | + <encoding/> | |
| 1541 | + <append>N</append> | |
| 1542 | + <add_to_result_filenames>Y</add_to_result_filenames> | |
| 1543 | + <file> | |
| 1544 | + <name>${file_validate_error}</name> | |
| 1545 | + <extention>xls</extention> | |
| 1546 | + <do_not_open_newfile_init>N</do_not_open_newfile_init> | |
| 1547 | + <create_parent_folder>N</create_parent_folder> | |
| 1548 | + <split>N</split> | |
| 1549 | + <add_date>N</add_date> | |
| 1550 | + <add_time>N</add_time> | |
| 1551 | + <SpecifyFormat>N</SpecifyFormat> | |
| 1552 | + <date_time_format/> | |
| 1553 | + <sheetname>Sheet1</sheetname> | |
| 1554 | + <autosizecolums>N</autosizecolums> | |
| 1555 | + <nullisblank>N</nullisblank> | |
| 1556 | + <protect_sheet>N</protect_sheet> | |
| 1557 | + <password>Encrypted </password> | |
| 1558 | + <splitevery>0</splitevery> | |
| 1559 | + <usetempfiles>N</usetempfiles> | |
| 1560 | + <tempdirectory/> | |
| 1561 | + </file> | |
| 1562 | + <template> | |
| 1563 | + <enabled>N</enabled> | |
| 1564 | + <append>N</append> | |
| 1565 | + <filename>template.xls</filename> | |
| 1566 | + </template> | |
| 1567 | + <fields> | |
| 1568 | + <field> | |
| 1569 | + <name>clzbh</name> | |
| 1570 | + <type>String</type> | |
| 1571 | + <format/> | |
| 1572 | + </field> | |
| 1573 | + <field> | |
| 1574 | + <name>gsmc</name> | |
| 1575 | + <type>None</type> | |
| 1576 | + <format/> | |
| 1577 | + </field> | |
| 1578 | + <field> | |
| 1579 | + <name>fgsmc</name> | |
| 1580 | + <type>String</type> | |
| 1581 | + <format/> | |
| 1582 | + </field> | |
| 1583 | + <field> | |
| 1584 | + <name>allgsmc</name> | |
| 1585 | + <type>String</type> | |
| 1586 | + <format/> | |
| 1587 | + </field> | |
| 1588 | + <field> | |
| 1589 | + <name>NrErrors</name> | |
| 1590 | + <type>Integer</type> | |
| 1591 | + <format/> | |
| 1592 | + </field> | |
| 1593 | + <field> | |
| 1594 | + <name>ErrorDescription</name> | |
| 1595 | + <type>String</type> | |
| 1596 | + <format/> | |
| 1597 | + </field> | |
| 1598 | + <field> | |
| 1599 | + <name>ErrorFields</name> | |
| 1600 | + <type>String</type> | |
| 1601 | + <format/> | |
| 1602 | + </field> | |
| 1603 | + <field> | |
| 1604 | + <name>ErrorCodes</name> | |
| 1605 | + <type>String</type> | |
| 1606 | + <format/> | |
| 1607 | + </field> | |
| 1608 | + </fields> | |
| 1609 | + <custom> | |
| 1610 | + <header_font_name>arial</header_font_name> | |
| 1611 | + <header_font_size>10</header_font_size> | |
| 1612 | + <header_font_bold>N</header_font_bold> | |
| 1613 | + <header_font_italic>N</header_font_italic> | |
| 1614 | + <header_font_underline>no</header_font_underline> | |
| 1615 | + <header_font_orientation>horizontal</header_font_orientation> | |
| 1616 | + <header_font_color>black</header_font_color> | |
| 1617 | + <header_background_color>none</header_background_color> | |
| 1618 | + <header_row_height>255</header_row_height> | |
| 1619 | + <header_alignment>left</header_alignment> | |
| 1620 | + <header_image/> | |
| 1621 | + <row_font_name>arial</row_font_name> | |
| 1622 | + <row_font_size>10</row_font_size> | |
| 1623 | + <row_font_color>black</row_font_color> | |
| 1624 | + <row_background_color>none</row_background_color> | |
| 1625 | + </custom> | |
| 1626 | + <cluster_schema/> | |
| 1627 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1628 | + <xloc>175</xloc> | |
| 1629 | + <yloc>122</yloc> | |
| 1630 | + <draw>Y</draw> | |
| 1631 | + </GUI> | |
| 1632 | + </step> | |
| 1633 | + | |
| 1634 | + <step> | |
| 1635 | + <name>新增数据处理</name> | |
| 1636 | + <type>ScriptValueMod</type> | |
| 1637 | + <description/> | |
| 1638 | + <distribute>Y</distribute> | |
| 1639 | + <custom_distribution/> | |
| 1640 | + <copies>1</copies> | |
| 1641 | + <partitioning> | |
| 1642 | + <method>none</method> | |
| 1643 | + <schema_name/> | |
| 1644 | + </partitioning> | |
| 1645 | + <compatible>N</compatible> | |
| 1646 | + <optimizationLevel>9</optimizationLevel> | |
| 1647 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 1648 | + <jsScript_name>Script 1</jsScript_name> | |
| 1649 | + <jsScript_script>//Script here

//---------------- 新增用的字段重新命名(方便后续操作)-----------//
var insideCode_add = clzbh; // 车辆自编号
var carPlate_add = cph; // 车牌号
var carCode_add = clzbh; // 车辆编码(初始使用自编号代替)
var supplierName_add = "1"; // 供应商名称(字典:1=巴士拓华)
var businessCode_add = gsdm; // 公司代码
var company_add = gsmc; // 公司名称
var brancheCompanyCode_add = fgsdm; // 分公司代码
var brancheCompany_add = fgsmc; // 分公司名称
var equipmentCode_add = clzbh; // 设备编号(初始使用自编号代替)
var scrapState_add = 0; // 是否报废
var scrapDate_add; // 报废日期
var scrapCode_add; // 报废号
if (carState == '3' || scrapType == '1') {
 scrapState_add = 1;
 scrapDate_add = scrapDate == null ? null : str2date(scrapDate, 'yyyy-MM-dd');
 equipmentCode_add = 'BF-' + equipmentCode_add;
 scrapCode_add = 'BF-' + equipmentCode_add;
}
var createDate_add = new Date(); // 创建时间
var updateDate_add = createDate_add; // 更新时间</jsScript_script> | |
| 1650 | + </jsScript> </jsScripts> <fields> <field> <name>insideCode_add</name> | |
| 1651 | + <rename>insideCode_add</rename> | |
| 1652 | + <type>String</type> | |
| 1653 | + <length>-1</length> | |
| 1654 | + <precision>-1</precision> | |
| 1655 | + <replace>N</replace> | |
| 1656 | + </field> <field> <name>carPlate_add</name> | |
| 1657 | + <rename>carPlate_add</rename> | |
| 1658 | + <type>String</type> | |
| 1659 | + <length>-1</length> | |
| 1660 | + <precision>-1</precision> | |
| 1661 | + <replace>N</replace> | |
| 1662 | + </field> <field> <name>carCode_add</name> | |
| 1663 | + <rename>carCode_add</rename> | |
| 1664 | + <type>String</type> | |
| 1665 | + <length>-1</length> | |
| 1666 | + <precision>-1</precision> | |
| 1667 | + <replace>N</replace> | |
| 1668 | + </field> <field> <name>supplierName_add</name> | |
| 1669 | + <rename>supplierName_add</rename> | |
| 1670 | + <type>String</type> | |
| 1671 | + <length>-1</length> | |
| 1672 | + <precision>-1</precision> | |
| 1673 | + <replace>N</replace> | |
| 1674 | + </field> <field> <name>businessCode_add</name> | |
| 1675 | + <rename>businessCode_add</rename> | |
| 1676 | + <type>String</type> | |
| 1677 | + <length>-1</length> | |
| 1678 | + <precision>-1</precision> | |
| 1679 | + <replace>N</replace> | |
| 1680 | + </field> <field> <name>company_add</name> | |
| 1681 | + <rename>company_add</rename> | |
| 1682 | + <type>String</type> | |
| 1683 | + <length>-1</length> | |
| 1684 | + <precision>-1</precision> | |
| 1685 | + <replace>N</replace> | |
| 1686 | + </field> <field> <name>brancheCompanyCode_add</name> | |
| 1687 | + <rename>brancheCompanyCode_add</rename> | |
| 1688 | + <type>String</type> | |
| 1689 | + <length>-1</length> | |
| 1690 | + <precision>-1</precision> | |
| 1691 | + <replace>N</replace> | |
| 1692 | + </field> <field> <name>brancheCompany_add</name> | |
| 1693 | + <rename>brancheCompany_add</rename> | |
| 1694 | + <type>String</type> | |
| 1695 | + <length>-1</length> | |
| 1696 | + <precision>-1</precision> | |
| 1697 | + <replace>N</replace> | |
| 1698 | + </field> <field> <name>equipmentCode_add</name> | |
| 1699 | + <rename>equipmentCode_add</rename> | |
| 1700 | + <type>String</type> | |
| 1701 | + <length>-1</length> | |
| 1702 | + <precision>-1</precision> | |
| 1703 | + <replace>N</replace> | |
| 1704 | + </field> <field> <name>scrapState_add</name> | |
| 1705 | + <rename>scrapState_add</rename> | |
| 1706 | + <type>Integer</type> | |
| 1707 | + <length>-1</length> | |
| 1708 | + <precision>-1</precision> | |
| 1709 | + <replace>N</replace> | |
| 1710 | + </field> <field> <name>scrapDate_add</name> | |
| 1711 | + <rename>scrapDate_add</rename> | |
| 1712 | + <type>Date</type> | |
| 1713 | + <length>-1</length> | |
| 1714 | + <precision>-1</precision> | |
| 1715 | + <replace>N</replace> | |
| 1716 | + </field> <field> <name>scrapCode_add</name> | |
| 1717 | + <rename>scrapCode_add</rename> | |
| 1718 | + <type>String</type> | |
| 1719 | + <length>-1</length> | |
| 1720 | + <precision>-1</precision> | |
| 1721 | + <replace>N</replace> | |
| 1722 | + </field> <field> <name>createDate_add</name> | |
| 1723 | + <rename>createDate_add</rename> | |
| 1724 | + <type>Date</type> | |
| 1725 | + <length>-1</length> | |
| 1726 | + <precision>-1</precision> | |
| 1727 | + <replace>N</replace> | |
| 1728 | + </field> <field> <name>updateDate_add</name> | |
| 1729 | + <rename>updateDate_add</rename> | |
| 1730 | + <type>Date</type> | |
| 1731 | + <length>-1</length> | |
| 1732 | + <precision>-1</precision> | |
| 1733 | + <replace>N</replace> | |
| 1734 | + </field> </fields> <cluster_schema/> | |
| 1735 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1736 | + <xloc>673</xloc> | |
| 1737 | + <yloc>215</yloc> | |
| 1738 | + <draw>Y</draw> | |
| 1739 | + </GUI> | |
| 1740 | + </step> | |
| 1741 | + | |
| 1742 | + <step> | |
| 1743 | + <name>新增车辆数据输出</name> | |
| 1744 | + <type>TableOutput</type> | |
| 1745 | + <description/> | |
| 1746 | + <distribute>Y</distribute> | |
| 1747 | + <custom_distribution/> | |
| 1748 | + <copies>1</copies> | |
| 1749 | + <partitioning> | |
| 1750 | + <method>none</method> | |
| 1751 | + <schema_name/> | |
| 1752 | + </partitioning> | |
| 1753 | + <connection>control_jndi</connection> | |
| 1754 | + <schema/> | |
| 1755 | + <table>bsth_c_cars</table> | |
| 1756 | + <commit>1000</commit> | |
| 1757 | + <truncate>N</truncate> | |
| 1758 | + <ignore_errors>N</ignore_errors> | |
| 1759 | + <use_batch>Y</use_batch> | |
| 1760 | + <specify_fields>Y</specify_fields> | |
| 1761 | + <partitioning_enabled>N</partitioning_enabled> | |
| 1762 | + <partitioning_field/> | |
| 1763 | + <partitioning_daily>N</partitioning_daily> | |
| 1764 | + <partitioning_monthly>Y</partitioning_monthly> | |
| 1765 | + <tablename_in_field>N</tablename_in_field> | |
| 1766 | + <tablename_field/> | |
| 1767 | + <tablename_in_table>Y</tablename_in_table> | |
| 1768 | + <return_keys>N</return_keys> | |
| 1769 | + <return_field/> | |
| 1770 | + <fields> | |
| 1771 | + <field> | |
| 1772 | + <column_name>inside_code</column_name> | |
| 1773 | + <stream_name>insideCode_add</stream_name> | |
| 1774 | + </field> | |
| 1775 | + <field> | |
| 1776 | + <column_name>car_plate</column_name> | |
| 1777 | + <stream_name>carPlate_add</stream_name> | |
| 1778 | + </field> | |
| 1779 | + <field> | |
| 1780 | + <column_name>car_code</column_name> | |
| 1781 | + <stream_name>carCode_add</stream_name> | |
| 1782 | + </field> | |
| 1783 | + <field> | |
| 1784 | + <column_name>supplier_name</column_name> | |
| 1785 | + <stream_name>supplierName_add</stream_name> | |
| 1786 | + </field> | |
| 1787 | + <field> | |
| 1788 | + <column_name>business_code</column_name> | |
| 1789 | + <stream_name>businessCode_add</stream_name> | |
| 1790 | + </field> | |
| 1791 | + <field> | |
| 1792 | + <column_name>company</column_name> | |
| 1793 | + <stream_name>company_add</stream_name> | |
| 1794 | + </field> | |
| 1795 | + <field> | |
| 1796 | + <column_name>branche_company_code</column_name> | |
| 1797 | + <stream_name>brancheCompanyCode_add</stream_name> | |
| 1798 | + </field> | |
| 1799 | + <field> | |
| 1800 | + <column_name>branche_company</column_name> | |
| 1801 | + <stream_name>brancheCompany_add</stream_name> | |
| 1802 | + </field> | |
| 1803 | + <field> | |
| 1804 | + <column_name>equipment_code</column_name> | |
| 1805 | + <stream_name>equipmentCode_add</stream_name> | |
| 1806 | + </field> | |
| 1807 | + <field> | |
| 1808 | + <column_name>scrap_state</column_name> | |
| 1809 | + <stream_name>scrapState_add</stream_name> | |
| 1810 | + </field> | |
| 1811 | + <field> | |
| 1812 | + <column_name>scrap_date</column_name> | |
| 1813 | + <stream_name>scrapDate_add</stream_name> | |
| 1814 | + </field> | |
| 1815 | + <field> | |
| 1816 | + <column_name>scrap_code</column_name> | |
| 1817 | + <stream_name>scrapCode_add</stream_name> | |
| 1818 | + </field> | |
| 1819 | + <field> | |
| 1820 | + <column_name>create_date</column_name> | |
| 1821 | + <stream_name>createDate_add</stream_name> | |
| 1822 | + </field> | |
| 1823 | + <field> | |
| 1824 | + <column_name>update_date</column_name> | |
| 1825 | + <stream_name>updateDate_add</stream_name> | |
| 1826 | + </field> | |
| 1827 | + </fields> | |
| 1828 | + <cluster_schema/> | |
| 1829 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1830 | + <xloc>819</xloc> | |
| 1831 | + <yloc>213</yloc> | |
| 1832 | + <draw>Y</draw> | |
| 1833 | + </GUI> | |
| 1834 | + </step> | |
| 1835 | + | |
| 1836 | + <step> | |
| 1837 | + <name>新增车辆设备数据输出</name> | |
| 1838 | + <type>TableOutput</type> | |
| 1839 | + <description/> | |
| 1840 | + <distribute>Y</distribute> | |
| 1841 | + <custom_distribution/> | |
| 1842 | + <copies>1</copies> | |
| 1843 | + <partitioning> | |
| 1844 | + <method>none</method> | |
| 1845 | + <schema_name/> | |
| 1846 | + </partitioning> | |
| 1847 | + <connection>control_jndi</connection> | |
| 1848 | + <schema/> | |
| 1849 | + <table>bsth_c_car_device</table> | |
| 1850 | + <commit>1000</commit> | |
| 1851 | + <truncate>N</truncate> | |
| 1852 | + <ignore_errors>N</ignore_errors> | |
| 1853 | + <use_batch>Y</use_batch> | |
| 1854 | + <specify_fields>Y</specify_fields> | |
| 1855 | + <partitioning_enabled>N</partitioning_enabled> | |
| 1856 | + <partitioning_field/> | |
| 1857 | + <partitioning_daily>N</partitioning_daily> | |
| 1858 | + <partitioning_monthly>Y</partitioning_monthly> | |
| 1859 | + <tablename_in_field>N</tablename_in_field> | |
| 1860 | + <tablename_field/> | |
| 1861 | + <tablename_in_table>Y</tablename_in_table> | |
| 1862 | + <return_keys>N</return_keys> | |
| 1863 | + <return_field/> | |
| 1864 | + <fields> | |
| 1865 | + <field> | |
| 1866 | + <column_name>gs_name</column_name> | |
| 1867 | + <stream_name>device_gsName</stream_name> | |
| 1868 | + </field> | |
| 1869 | + <field> | |
| 1870 | + <column_name>company</column_name> | |
| 1871 | + <stream_name>device_company</stream_name> | |
| 1872 | + </field> | |
| 1873 | + <field> | |
| 1874 | + <column_name>branche_company</column_name> | |
| 1875 | + <stream_name>device_branch_company</stream_name> | |
| 1876 | + </field> | |
| 1877 | + <field> | |
| 1878 | + <column_name>cl</column_name> | |
| 1879 | + <stream_name>device_cl</stream_name> | |
| 1880 | + </field> | |
| 1881 | + <field> | |
| 1882 | + <column_name>cl_zbh</column_name> | |
| 1883 | + <stream_name>device_clzbh</stream_name> | |
| 1884 | + </field> | |
| 1885 | + <field> | |
| 1886 | + <column_name>old_device_no</column_name> | |
| 1887 | + <stream_name>device_old_no</stream_name> | |
| 1888 | + </field> | |
| 1889 | + <field> | |
| 1890 | + <column_name>new_device_no</column_name> | |
| 1891 | + <stream_name>device_new_no</stream_name> | |
| 1892 | + </field> | |
| 1893 | + <field> | |
| 1894 | + <column_name>is_cancel</column_name> | |
| 1895 | + <stream_name>device_is_cancel</stream_name> | |
| 1896 | + </field> | |
| 1897 | + <field> | |
| 1898 | + <column_name>create_date</column_name> | |
| 1899 | + <stream_name>device_create_date</stream_name> | |
| 1900 | + </field> | |
| 1901 | + <field> | |
| 1902 | + <column_name>update_date</column_name> | |
| 1903 | + <stream_name>device_update_date</stream_name> | |
| 1904 | + </field> | |
| 1905 | + <field> | |
| 1906 | + <column_name>qyrq</column_name> | |
| 1907 | + <stream_name>device_qyrq</stream_name> | |
| 1908 | + </field> | |
| 1909 | + <field> | |
| 1910 | + <column_name>xl</column_name> | |
| 1911 | + <stream_name>device_xl</stream_name> | |
| 1912 | + </field> | |
| 1913 | + <field> | |
| 1914 | + <column_name>xl_name</column_name> | |
| 1915 | + <stream_name>device_xlName</stream_name> | |
| 1916 | + </field> | |
| 1917 | + <field> | |
| 1918 | + <column_name>xl_bm</column_name> | |
| 1919 | + <stream_name>device_xlbm</stream_name> | |
| 1920 | + </field> | |
| 1921 | + </fields> | |
| 1922 | + <cluster_schema/> | |
| 1923 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1924 | + <xloc>828</xloc> | |
| 1925 | + <yloc>584</yloc> | |
| 1926 | + <draw>Y</draw> | |
| 1927 | + </GUI> | |
| 1928 | + </step> | |
| 1929 | + | |
| 1930 | + <step> | |
| 1931 | + <name>新增错误数据文件</name> | |
| 1932 | + <type>ExcelOutput</type> | |
| 1933 | + <description/> | |
| 1934 | + <distribute>Y</distribute> | |
| 1935 | + <custom_distribution/> | |
| 1936 | + <copies>1</copies> | |
| 1937 | + <partitioning> | |
| 1938 | + <method>none</method> | |
| 1939 | + <schema_name/> | |
| 1940 | + </partitioning> | |
| 1941 | + <header>Y</header> | |
| 1942 | + <footer>N</footer> | |
| 1943 | + <encoding/> | |
| 1944 | + <append>N</append> | |
| 1945 | + <add_to_result_filenames>Y</add_to_result_filenames> | |
| 1946 | + <file> | |
| 1947 | + <name>${file_add_error}</name> | |
| 1948 | + <extention>xls</extention> | |
| 1949 | + <do_not_open_newfile_init>N</do_not_open_newfile_init> | |
| 1950 | + <create_parent_folder>N</create_parent_folder> | |
| 1951 | + <split>N</split> | |
| 1952 | + <add_date>N</add_date> | |
| 1953 | + <add_time>N</add_time> | |
| 1954 | + <SpecifyFormat>N</SpecifyFormat> | |
| 1955 | + <date_time_format/> | |
| 1956 | + <sheetname>Sheet1</sheetname> | |
| 1957 | + <autosizecolums>N</autosizecolums> | |
| 1958 | + <nullisblank>N</nullisblank> | |
| 1959 | + <protect_sheet>N</protect_sheet> | |
| 1960 | + <password>Encrypted </password> | |
| 1961 | + <splitevery>0</splitevery> | |
| 1962 | + <usetempfiles>N</usetempfiles> | |
| 1963 | + <tempdirectory/> | |
| 1964 | + </file> | |
| 1965 | + <template> | |
| 1966 | + <enabled>N</enabled> | |
| 1967 | + <append>N</append> | |
| 1968 | + <filename>template.xls</filename> | |
| 1969 | + </template> | |
| 1970 | + <fields> | |
| 1971 | + <field> | |
| 1972 | + <name>insideCode_add</name> | |
| 1973 | + <type>String</type> | |
| 1974 | + <format/> | |
| 1975 | + </field> | |
| 1976 | + <field> | |
| 1977 | + <name>carPlate_add</name> | |
| 1978 | + <type>String</type> | |
| 1979 | + <format/> | |
| 1980 | + </field> | |
| 1981 | + <field> | |
| 1982 | + <name>carCode_add</name> | |
| 1983 | + <type>String</type> | |
| 1984 | + <format/> | |
| 1985 | + </field> | |
| 1986 | + <field> | |
| 1987 | + <name>supplierName_add</name> | |
| 1988 | + <type>String</type> | |
| 1989 | + <format/> | |
| 1990 | + </field> | |
| 1991 | + <field> | |
| 1992 | + <name>businessCode_add</name> | |
| 1993 | + <type>String</type> | |
| 1994 | + <format/> | |
| 1995 | + </field> | |
| 1996 | + <field> | |
| 1997 | + <name>company_add</name> | |
| 1998 | + <type>String</type> | |
| 1999 | + <format/> | |
| 2000 | + </field> | |
| 2001 | + <field> | |
| 2002 | + <name>brancheCompanyCode_add</name> | |
| 2003 | + <type>String</type> | |
| 2004 | + <format/> | |
| 2005 | + </field> | |
| 2006 | + <field> | |
| 2007 | + <name>brancheCompany_add</name> | |
| 2008 | + <type>String</type> | |
| 2009 | + <format/> | |
| 2010 | + </field> | |
| 2011 | + <field> | |
| 2012 | + <name>equipmentCode_add</name> | |
| 2013 | + <type>String</type> | |
| 2014 | + <format/> | |
| 2015 | + </field> | |
| 2016 | + <field> | |
| 2017 | + <name>scrapState_add</name> | |
| 2018 | + <type>Integer</type> | |
| 2019 | + <format/> | |
| 2020 | + </field> | |
| 2021 | + <field> | |
| 2022 | + <name>scrapDate_add</name> | |
| 2023 | + <type>Date</type> | |
| 2024 | + <format/> | |
| 2025 | + </field> | |
| 2026 | + <field> | |
| 2027 | + <name>scrapCode_add</name> | |
| 2028 | + <type>String</type> | |
| 2029 | + <format/> | |
| 2030 | + </field> | |
| 2031 | + <field> | |
| 2032 | + <name>createDate_add</name> | |
| 2033 | + <type>Date</type> | |
| 2034 | + <format/> | |
| 2035 | + </field> | |
| 2036 | + <field> | |
| 2037 | + <name>updateDate_add</name> | |
| 2038 | + <type>Date</type> | |
| 2039 | + <format/> | |
| 2040 | + </field> | |
| 2041 | + <field> | |
| 2042 | + <name>NrErrors</name> | |
| 2043 | + <type>Integer</type> | |
| 2044 | + <format/> | |
| 2045 | + </field> | |
| 2046 | + <field> | |
| 2047 | + <name>ErrorDescription</name> | |
| 2048 | + <type>String</type> | |
| 2049 | + <format/> | |
| 2050 | + </field> | |
| 2051 | + <field> | |
| 2052 | + <name>ErrorFields</name> | |
| 2053 | + <type>String</type> | |
| 2054 | + <format/> | |
| 2055 | + </field> | |
| 2056 | + <field> | |
| 2057 | + <name>ErrorCodes</name> | |
| 2058 | + <type>String</type> | |
| 2059 | + <format/> | |
| 2060 | + </field> | |
| 2061 | + </fields> | |
| 2062 | + <custom> | |
| 2063 | + <header_font_name>arial</header_font_name> | |
| 2064 | + <header_font_size>10</header_font_size> | |
| 2065 | + <header_font_bold>N</header_font_bold> | |
| 2066 | + <header_font_italic>N</header_font_italic> | |
| 2067 | + <header_font_underline>no</header_font_underline> | |
| 2068 | + <header_font_orientation>horizontal</header_font_orientation> | |
| 2069 | + <header_font_color>black</header_font_color> | |
| 2070 | + <header_background_color>none</header_background_color> | |
| 2071 | + <header_row_height>255</header_row_height> | |
| 2072 | + <header_alignment>left</header_alignment> | |
| 2073 | + <header_image/> | |
| 2074 | + <row_font_name>arial</row_font_name> | |
| 2075 | + <row_font_size>10</row_font_size> | |
| 2076 | + <row_font_color>black</row_font_color> | |
| 2077 | + <row_background_color>none</row_background_color> | |
| 2078 | + </custom> | |
| 2079 | + <cluster_schema/> | |
| 2080 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2081 | + <xloc>968</xloc> | |
| 2082 | + <yloc>215</yloc> | |
| 2083 | + <draw>Y</draw> | |
| 2084 | + </GUI> | |
| 2085 | + </step> | |
| 2086 | + | |
| 2087 | + <step> | |
| 2088 | + <name>更新数据处理</name> | |
| 2089 | + <type>ScriptValueMod</type> | |
| 2090 | + <description/> | |
| 2091 | + <distribute>N</distribute> | |
| 2092 | + <custom_distribution/> | |
| 2093 | + <copies>1</copies> | |
| 2094 | + <partitioning> | |
| 2095 | + <method>none</method> | |
| 2096 | + <schema_name/> | |
| 2097 | + </partitioning> | |
| 2098 | + <compatible>N</compatible> | |
| 2099 | + <optimizationLevel>9</optimizationLevel> | |
| 2100 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 2101 | + <jsScript_name>Script 1</jsScript_name> | |
| 2102 | + <jsScript_script>//Script here

//---------------- 更新用的字段重新命名(方便后续操作)-----------//
// TODO:后面还有更多的更新字段

var update_date = new Date();

//------------ 1、公司分公司相关字段 -----------//
var company_update = gsmc; // 公司名称
var branche_company_update = fgsmc; // 分公司名称
var business_code_update = gsdm; // 公司代码
var branch_company_code_update = fgsdm; // 分公司代码
var isGsUpdate = false; // 是否更新
if (!company_update.equals(company)) {
 isGsUpdate = true;
}
if (!branche_company_update.equals(branche_company)) {
 isGsUpdate = true;
}

//------------- 2、报废相关字段 ------------//
var equipmentCode_update = equipment_code; // 设备编号
var scrapCode_update = scrap_code; // 报废号
var scrapState_update = (scrap_state == true ? 1 : 0); // 报废状态
var scrapState_update_b = scrap_state; // 报废状态
var scrapDate_update = scrap_date; // 报废日期
var isScrapUpdate = false; // 是否更新
if (carState == '3' || scrapType == '1') {
 scrapState_update_b = true;
 scrapState_update = 1;
 scrapDate_update = scrapDate == null ? null : str2date(scrapDate, 'yyyy-MM-dd');
 equipmentCode_update = 'BF-' + equipmentCode_update;
 scrapCode_update = 'BF-' + equipmentCode_update;
}
if (scrapState_update_b != scrap_state) {
 isScrapUpdate = true;
}</jsScript_script> | |
| 2103 | + </jsScript> </jsScripts> <fields> <field> <name>update_date</name> | |
| 2104 | + <rename>update_date</rename> | |
| 2105 | + <type>Date</type> | |
| 2106 | + <length>-1</length> | |
| 2107 | + <precision>-1</precision> | |
| 2108 | + <replace>N</replace> | |
| 2109 | + </field> <field> <name>company_update</name> | |
| 2110 | + <rename>company_update</rename> | |
| 2111 | + <type>String</type> | |
| 2112 | + <length>-1</length> | |
| 2113 | + <precision>-1</precision> | |
| 2114 | + <replace>N</replace> | |
| 2115 | + </field> <field> <name>branche_company_update</name> | |
| 2116 | + <rename>branche_company_update</rename> | |
| 2117 | + <type>String</type> | |
| 2118 | + <length>-1</length> | |
| 2119 | + <precision>-1</precision> | |
| 2120 | + <replace>N</replace> | |
| 2121 | + </field> <field> <name>business_code_update</name> | |
| 2122 | + <rename>business_code_update</rename> | |
| 2123 | + <type>String</type> | |
| 2124 | + <length>-1</length> | |
| 2125 | + <precision>-1</precision> | |
| 2126 | + <replace>N</replace> | |
| 2127 | + </field> <field> <name>branch_company_code_update</name> | |
| 2128 | + <rename>branch_company_code_update</rename> | |
| 2129 | + <type>String</type> | |
| 2130 | + <length>-1</length> | |
| 2131 | + <precision>-1</precision> | |
| 2132 | + <replace>N</replace> | |
| 2133 | + </field> <field> <name>isGsUpdate</name> | |
| 2134 | + <rename>isGsUpdate</rename> | |
| 2135 | + <type>Boolean</type> | |
| 2136 | + <length>-1</length> | |
| 2137 | + <precision>-1</precision> | |
| 2138 | + <replace>N</replace> | |
| 2139 | + </field> <field> <name>equipmentCode_update</name> | |
| 2140 | + <rename>equipmentCode_update</rename> | |
| 2141 | + <type>String</type> | |
| 2142 | + <length>-1</length> | |
| 2143 | + <precision>-1</precision> | |
| 2144 | + <replace>N</replace> | |
| 2145 | + </field> <field> <name>scrapCode_update</name> | |
| 2146 | + <rename>scrapCode_update</rename> | |
| 2147 | + <type>String</type> | |
| 2148 | + <length>-1</length> | |
| 2149 | + <precision>-1</precision> | |
| 2150 | + <replace>N</replace> | |
| 2151 | + </field> <field> <name>scrapState_update</name> | |
| 2152 | + <rename>scrapState_update</rename> | |
| 2153 | + <type>Integer</type> | |
| 2154 | + <length>-1</length> | |
| 2155 | + <precision>-1</precision> | |
| 2156 | + <replace>N</replace> | |
| 2157 | + </field> <field> <name>scrapState_update_b</name> | |
| 2158 | + <rename>scrapState_update_b</rename> | |
| 2159 | + <type>Boolean</type> | |
| 2160 | + <length>-1</length> | |
| 2161 | + <precision>-1</precision> | |
| 2162 | + <replace>N</replace> | |
| 2163 | + </field> <field> <name>scrapDate_update</name> | |
| 2164 | + <rename>scrapDate_update</rename> | |
| 2165 | + <type>String</type> | |
| 2166 | + <length>-1</length> | |
| 2167 | + <precision>-1</precision> | |
| 2168 | + <replace>N</replace> | |
| 2169 | + </field> <field> <name>isScrapUpdate</name> | |
| 2170 | + <rename>isScrapUpdate</rename> | |
| 2171 | + <type>Boolean</type> | |
| 2172 | + <length>-1</length> | |
| 2173 | + <precision>-1</precision> | |
| 2174 | + <replace>N</replace> | |
| 2175 | + </field> </fields> <cluster_schema/> | |
| 2176 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2177 | + <xloc>674</xloc> | |
| 2178 | + <yloc>403</yloc> | |
| 2179 | + <draw>Y</draw> | |
| 2180 | + </GUI> | |
| 2181 | + </step> | |
| 2182 | + | |
| 2183 | + <step> | |
| 2184 | + <name>本地线路信息查询</name> | |
| 2185 | + <type>DBLookup</type> | |
| 2186 | + <description/> | |
| 2187 | + <distribute>N</distribute> | |
| 2188 | + <custom_distribution/> | |
| 2189 | + <copies>1</copies> | |
| 2190 | + <partitioning> | |
| 2191 | + <method>none</method> | |
| 2192 | + <schema_name/> | |
| 2193 | + </partitioning> | |
| 2194 | + <connection>control_jndi</connection> | |
| 2195 | + <cache>Y</cache> | |
| 2196 | + <cache_load_all>Y</cache_load_all> | |
| 2197 | + <cache_size>0</cache_size> | |
| 2198 | + <lookup> | |
| 2199 | + <schema/> | |
| 2200 | + <table>bsth_c_line</table> | |
| 2201 | + <orderby/> | |
| 2202 | + <fail_on_multiple>N</fail_on_multiple> | |
| 2203 | + <eat_row_on_failure>N</eat_row_on_failure> | |
| 2204 | + <key> | |
| 2205 | + <name>xl</name> | |
| 2206 | + <field>id</field> | |
| 2207 | + <condition>=</condition> | |
| 2208 | + <name2/> | |
| 2209 | + </key> | |
| 2210 | + <value> | |
| 2211 | + <name>line_code</name> | |
| 2212 | + <rename>line_code</rename> | |
| 2213 | + <default/> | |
| 2214 | + <type>None</type> | |
| 2215 | + </value> | |
| 2216 | + <value> | |
| 2217 | + <name>name</name> | |
| 2218 | + <rename>name</rename> | |
| 2219 | + <default/> | |
| 2220 | + <type>None</type> | |
| 2221 | + </value> | |
| 2222 | + </lookup> | |
| 2223 | + <cluster_schema/> | |
| 2224 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2225 | + <xloc>340</xloc> | |
| 2226 | + <yloc>582</yloc> | |
| 2227 | + <draw>Y</draw> | |
| 2228 | + </GUI> | |
| 2229 | + </step> | |
| 2230 | + | |
| 2231 | + <step> | |
| 2232 | + <name>本地车辆信息查询 </name> | |
| 2233 | + <type>DBLookup</type> | |
| 2234 | + <description/> | |
| 2235 | + <distribute>Y</distribute> | |
| 2236 | + <custom_distribution/> | |
| 2237 | + <copies>1</copies> | |
| 2238 | + <partitioning> | |
| 2239 | + <method>none</method> | |
| 2240 | + <schema_name/> | |
| 2241 | + </partitioning> | |
| 2242 | + <connection>control_jndi</connection> | |
| 2243 | + <cache>Y</cache> | |
| 2244 | + <cache_load_all>Y</cache_load_all> | |
| 2245 | + <cache_size>0</cache_size> | |
| 2246 | + <lookup> | |
| 2247 | + <schema/> | |
| 2248 | + <table>bsth_c_cars</table> | |
| 2249 | + <orderby>update_date desc</orderby> | |
| 2250 | + <fail_on_multiple>N</fail_on_multiple> | |
| 2251 | + <eat_row_on_failure>N</eat_row_on_failure> | |
| 2252 | + <key> | |
| 2253 | + <name>clzbh</name> | |
| 2254 | + <field>inside_code</field> | |
| 2255 | + <condition>=</condition> | |
| 2256 | + <name2/> | |
| 2257 | + </key> | |
| 2258 | + <value> | |
| 2259 | + <name>id</name> | |
| 2260 | + <rename>id</rename> | |
| 2261 | + <default/> | |
| 2262 | + <type>Integer</type> | |
| 2263 | + </value> | |
| 2264 | + <value> | |
| 2265 | + <name>equipment_code</name> | |
| 2266 | + <rename>equipment_code</rename> | |
| 2267 | + <default/> | |
| 2268 | + <type>String</type> | |
| 2269 | + </value> | |
| 2270 | + <value> | |
| 2271 | + <name>scrap_code</name> | |
| 2272 | + <rename>scrap_code</rename> | |
| 2273 | + <default/> | |
| 2274 | + <type>String</type> | |
| 2275 | + </value> | |
| 2276 | + <value> | |
| 2277 | + <name>scrap_state</name> | |
| 2278 | + <rename>scrap_state</rename> | |
| 2279 | + <default/> | |
| 2280 | + <type>Integer</type> | |
| 2281 | + </value> | |
| 2282 | + <value> | |
| 2283 | + <name>scrap_date</name> | |
| 2284 | + <rename>scrap_date</rename> | |
| 2285 | + <default/> | |
| 2286 | + <type>Date</type> | |
| 2287 | + </value> | |
| 2288 | + <value> | |
| 2289 | + <name>company</name> | |
| 2290 | + <rename>company</rename> | |
| 2291 | + <default/> | |
| 2292 | + <type>String</type> | |
| 2293 | + </value> | |
| 2294 | + <value> | |
| 2295 | + <name>branche_company</name> | |
| 2296 | + <rename>branche_company</rename> | |
| 2297 | + <default/> | |
| 2298 | + <type>String</type> | |
| 2299 | + </value> | |
| 2300 | + </lookup> | |
| 2301 | + <cluster_schema/> | |
| 2302 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2303 | + <xloc>337</xloc> | |
| 2304 | + <yloc>396</yloc> | |
| 2305 | + <draw>Y</draw> | |
| 2306 | + </GUI> | |
| 2307 | + </step> | |
| 2308 | + | |
| 2309 | + <step> | |
| 2310 | + <name>本地车辆配置信息查询</name> | |
| 2311 | + <type>DBLookup</type> | |
| 2312 | + <description/> | |
| 2313 | + <distribute>Y</distribute> | |
| 2314 | + <custom_distribution/> | |
| 2315 | + <copies>1</copies> | |
| 2316 | + <partitioning> | |
| 2317 | + <method>none</method> | |
| 2318 | + <schema_name/> | |
| 2319 | + </partitioning> | |
| 2320 | + <connection>control_jndi</connection> | |
| 2321 | + <cache>Y</cache> | |
| 2322 | + <cache_load_all>Y</cache_load_all> | |
| 2323 | + <cache_size>0</cache_size> | |
| 2324 | + <lookup> | |
| 2325 | + <schema/> | |
| 2326 | + <table>bsth_c_s_ccinfo</table> | |
| 2327 | + <orderby>update_date desc</orderby> | |
| 2328 | + <fail_on_multiple>N</fail_on_multiple> | |
| 2329 | + <eat_row_on_failure>N</eat_row_on_failure> | |
| 2330 | + <key> | |
| 2331 | + <name>id</name> | |
| 2332 | + <field>cl</field> | |
| 2333 | + <condition>=</condition> | |
| 2334 | + <name2/> | |
| 2335 | + </key> | |
| 2336 | + <value> | |
| 2337 | + <name>xl</name> | |
| 2338 | + <rename>xl</rename> | |
| 2339 | + <default/> | |
| 2340 | + <type>None</type> | |
| 2341 | + </value> | |
| 2342 | + </lookup> | |
| 2343 | + <cluster_schema/> | |
| 2344 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2345 | + <xloc>338</xloc> | |
| 2346 | + <yloc>486</yloc> | |
| 2347 | + <draw>Y</draw> | |
| 2348 | + </GUI> | |
| 2349 | + </step> | |
| 2350 | + | |
| 2351 | + <step> | |
| 2352 | + <name>添加车辆设备错误数据文件</name> | |
| 2353 | + <type>ExcelOutput</type> | |
| 2354 | + <description/> | |
| 2355 | + <distribute>Y</distribute> | |
| 2356 | + <custom_distribution/> | |
| 2357 | + <copies>1</copies> | |
| 2358 | + <partitioning> | |
| 2359 | + <method>none</method> | |
| 2360 | + <schema_name/> | |
| 2361 | + </partitioning> | |
| 2362 | + <header>Y</header> | |
| 2363 | + <footer>N</footer> | |
| 2364 | + <encoding/> | |
| 2365 | + <append>N</append> | |
| 2366 | + <add_to_result_filenames>Y</add_to_result_filenames> | |
| 2367 | + <file> | |
| 2368 | + <name>${file_deivce_add_error}</name> | |
| 2369 | + <extention>xls</extention> | |
| 2370 | + <do_not_open_newfile_init>N</do_not_open_newfile_init> | |
| 2371 | + <create_parent_folder>N</create_parent_folder> | |
| 2372 | + <split>N</split> | |
| 2373 | + <add_date>N</add_date> | |
| 2374 | + <add_time>N</add_time> | |
| 2375 | + <SpecifyFormat>N</SpecifyFormat> | |
| 2376 | + <date_time_format/> | |
| 2377 | + <sheetname>Sheet1</sheetname> | |
| 2378 | + <autosizecolums>N</autosizecolums> | |
| 2379 | + <nullisblank>N</nullisblank> | |
| 2380 | + <protect_sheet>N</protect_sheet> | |
| 2381 | + <password>Encrypted </password> | |
| 2382 | + <splitevery>0</splitevery> | |
| 2383 | + <usetempfiles>N</usetempfiles> | |
| 2384 | + <tempdirectory/> | |
| 2385 | + </file> | |
| 2386 | + <template> | |
| 2387 | + <enabled>N</enabled> | |
| 2388 | + <append>N</append> | |
| 2389 | + <filename>template.xls</filename> | |
| 2390 | + </template> | |
| 2391 | + <fields> | |
| 2392 | + <field> | |
| 2393 | + <name>device_gsName</name> | |
| 2394 | + <type>String</type> | |
| 2395 | + <format/> | |
| 2396 | + </field> | |
| 2397 | + <field> | |
| 2398 | + <name>device_company</name> | |
| 2399 | + <type>String</type> | |
| 2400 | + <format/> | |
| 2401 | + </field> | |
| 2402 | + <field> | |
| 2403 | + <name>device_branch_company</name> | |
| 2404 | + <type>String</type> | |
| 2405 | + <format/> | |
| 2406 | + </field> | |
| 2407 | + <field> | |
| 2408 | + <name>device_cl</name> | |
| 2409 | + <type>String</type> | |
| 2410 | + <format/> | |
| 2411 | + </field> | |
| 2412 | + <field> | |
| 2413 | + <name>device_clzbh</name> | |
| 2414 | + <type>String</type> | |
| 2415 | + <format/> | |
| 2416 | + </field> | |
| 2417 | + <field> | |
| 2418 | + <name>device_old_no</name> | |
| 2419 | + <type>String</type> | |
| 2420 | + <format/> | |
| 2421 | + </field> | |
| 2422 | + <field> | |
| 2423 | + <name>device_new_no</name> | |
| 2424 | + <type>String</type> | |
| 2425 | + <format/> | |
| 2426 | + </field> | |
| 2427 | + <field> | |
| 2428 | + <name>device_is_cancel</name> | |
| 2429 | + <type>Integer</type> | |
| 2430 | + <format/> | |
| 2431 | + </field> | |
| 2432 | + <field> | |
| 2433 | + <name>device_create_date</name> | |
| 2434 | + <type>Date</type> | |
| 2435 | + <format/> | |
| 2436 | + </field> | |
| 2437 | + <field> | |
| 2438 | + <name>device_update_date</name> | |
| 2439 | + <type>Date</type> | |
| 2440 | + <format/> | |
| 2441 | + </field> | |
| 2442 | + <field> | |
| 2443 | + <name>device_qyrq</name> | |
| 2444 | + <type>Date</type> | |
| 2445 | + <format/> | |
| 2446 | + </field> | |
| 2447 | + <field> | |
| 2448 | + <name>device_xl</name> | |
| 2449 | + <type>String</type> | |
| 2450 | + <format/> | |
| 2451 | + </field> | |
| 2452 | + <field> | |
| 2453 | + <name>device_xlName</name> | |
| 2454 | + <type>String</type> | |
| 2455 | + <format/> | |
| 2456 | + </field> | |
| 2457 | + <field> | |
| 2458 | + <name>device_xlbm</name> | |
| 2459 | + <type>String</type> | |
| 2460 | + <format/> | |
| 2461 | + </field> | |
| 2462 | + <field> | |
| 2463 | + <name>NrErrors</name> | |
| 2464 | + <type>Integer</type> | |
| 2465 | + <format/> | |
| 2466 | + </field> | |
| 2467 | + <field> | |
| 2468 | + <name>ErrorDescription</name> | |
| 2469 | + <type>String</type> | |
| 2470 | + <format/> | |
| 2471 | + </field> | |
| 2472 | + <field> | |
| 2473 | + <name>ErrorFields</name> | |
| 2474 | + <type>String</type> | |
| 2475 | + <format/> | |
| 2476 | + </field> | |
| 2477 | + <field> | |
| 2478 | + <name>ErrorCodes</name> | |
| 2479 | + <type>String</type> | |
| 2480 | + <format/> | |
| 2481 | + </field> | |
| 2482 | + </fields> | |
| 2483 | + <custom> | |
| 2484 | + <header_font_name>arial</header_font_name> | |
| 2485 | + <header_font_size>10</header_font_size> | |
| 2486 | + <header_font_bold>N</header_font_bold> | |
| 2487 | + <header_font_italic>N</header_font_italic> | |
| 2488 | + <header_font_underline>no</header_font_underline> | |
| 2489 | + <header_font_orientation>horizontal</header_font_orientation> | |
| 2490 | + <header_font_color>black</header_font_color> | |
| 2491 | + <header_background_color>none</header_background_color> | |
| 2492 | + <header_row_height>255</header_row_height> | |
| 2493 | + <header_alignment>left</header_alignment> | |
| 2494 | + <header_image/> | |
| 2495 | + <row_font_name>arial</row_font_name> | |
| 2496 | + <row_font_size>10</row_font_size> | |
| 2497 | + <row_font_color>black</row_font_color> | |
| 2498 | + <row_background_color>none</row_background_color> | |
| 2499 | + </custom> | |
| 2500 | + <cluster_schema/> | |
| 2501 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2502 | + <xloc>981</xloc> | |
| 2503 | + <yloc>585</yloc> | |
| 2504 | + <draw>Y</draw> | |
| 2505 | + </GUI> | |
| 2506 | + </step> | |
| 2507 | + | |
| 2508 | + <step> | |
| 2509 | + <name>获取公司分公司编码</name> | |
| 2510 | + <type>StreamLookup</type> | |
| 2511 | + <description/> | |
| 2512 | + <distribute>Y</distribute> | |
| 2513 | + <custom_distribution/> | |
| 2514 | + <copies>1</copies> | |
| 2515 | + <partitioning> | |
| 2516 | + <method>none</method> | |
| 2517 | + <schema_name/> | |
| 2518 | + </partitioning> | |
| 2519 | + <from>公司,分公司名称代码数据</from> | |
| 2520 | + <input_sorted>N</input_sorted> | |
| 2521 | + <preserve_memory>Y</preserve_memory> | |
| 2522 | + <sorted_list>N</sorted_list> | |
| 2523 | + <integer_pair>N</integer_pair> | |
| 2524 | + <lookup> | |
| 2525 | + <key> | |
| 2526 | + <name>allgsmc</name> | |
| 2527 | + <field>allmc</field> | |
| 2528 | + </key> | |
| 2529 | + <value> | |
| 2530 | + <name>gsdm</name> | |
| 2531 | + <rename>gsdm</rename> | |
| 2532 | + <default/> | |
| 2533 | + <type>None</type> | |
| 2534 | + </value> | |
| 2535 | + <value> | |
| 2536 | + <name>fgsdm</name> | |
| 2537 | + <rename>fgsdm</rename> | |
| 2538 | + <default/> | |
| 2539 | + <type>None</type> | |
| 2540 | + </value> | |
| 2541 | + </lookup> | |
| 2542 | + <cluster_schema/> | |
| 2543 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2544 | + <xloc>337</xloc> | |
| 2545 | + <yloc>312</yloc> | |
| 2546 | + <draw>Y</draw> | |
| 2547 | + </GUI> | |
| 2548 | + </step> | |
| 2549 | + | |
| 2550 | + <step> | |
| 2551 | + <name>获取参数</name> | |
| 2552 | + <type>GetVariable</type> | |
| 2553 | + <description/> | |
| 2554 | + <distribute>N</distribute> | |
| 2555 | + <custom_distribution/> | |
| 2556 | + <copies>1</copies> | |
| 2557 | + <partitioning> | |
| 2558 | + <method>none</method> | |
| 2559 | + <schema_name/> | |
| 2560 | + </partitioning> | |
| 2561 | + <fields> | |
| 2562 | + <field> | |
| 2563 | + <name>password</name> | |
| 2564 | + <variable>${password}</variable> | |
| 2565 | + <type>String</type> | |
| 2566 | + <format/> | |
| 2567 | + <currency/> | |
| 2568 | + <decimal/> | |
| 2569 | + <group/> | |
| 2570 | + <length>-1</length> | |
| 2571 | + <precision>-1</precision> | |
| 2572 | + <trim_type>none</trim_type> | |
| 2573 | + </field> | |
| 2574 | + <field> | |
| 2575 | + <name>url</name> | |
| 2576 | + <variable>${url}</variable> | |
| 2577 | + <type>String</type> | |
| 2578 | + <format/> | |
| 2579 | + <currency/> | |
| 2580 | + <decimal/> | |
| 2581 | + <group/> | |
| 2582 | + <length>-1</length> | |
| 2583 | + <precision>-1</precision> | |
| 2584 | + <trim_type>none</trim_type> | |
| 2585 | + </field> | |
| 2586 | + <field> | |
| 2587 | + <name>paramClzbh</name> | |
| 2588 | + <variable>${paramClzbh}</variable> | |
| 2589 | + <type>String</type> | |
| 2590 | + <format/> | |
| 2591 | + <currency/> | |
| 2592 | + <decimal/> | |
| 2593 | + <group/> | |
| 2594 | + <length>-1</length> | |
| 2595 | + <precision>-1</precision> | |
| 2596 | + <trim_type>both</trim_type> | |
| 2597 | + </field> | |
| 2598 | + <field> | |
| 2599 | + <name>paramFrom</name> | |
| 2600 | + <variable>${paramFrom}</variable> | |
| 2601 | + <type>String</type> | |
| 2602 | + <format/> | |
| 2603 | + <currency/> | |
| 2604 | + <decimal/> | |
| 2605 | + <group/> | |
| 2606 | + <length>-1</length> | |
| 2607 | + <precision>-1</precision> | |
| 2608 | + <trim_type>both</trim_type> | |
| 2609 | + </field> | |
| 2610 | + <field> | |
| 2611 | + <name>paramTo</name> | |
| 2612 | + <variable>${paramTo}</variable> | |
| 2613 | + <type>String</type> | |
| 2614 | + <format/> | |
| 2615 | + <currency/> | |
| 2616 | + <decimal/> | |
| 2617 | + <group/> | |
| 2618 | + <length>-1</length> | |
| 2619 | + <precision>-1</precision> | |
| 2620 | + <trim_type>both</trim_type> | |
| 2621 | + </field> | |
| 2622 | + </fields> | |
| 2623 | + <cluster_schema/> | |
| 2624 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2625 | + <xloc>55</xloc> | |
| 2626 | + <yloc>27</yloc> | |
| 2627 | + <draw>Y</draw> | |
| 2628 | + </GUI> | |
| 2629 | + </step> | |
| 2630 | + | |
| 2631 | + <step> | |
| 2632 | + <name>获取报废车辆数据(曾经配置过线路)</name> | |
| 2633 | + <type>FilterRows</type> | |
| 2634 | + <description/> | |
| 2635 | + <distribute>Y</distribute> | |
| 2636 | + <custom_distribution/> | |
| 2637 | + <copies>1</copies> | |
| 2638 | + <partitioning> | |
| 2639 | + <method>none</method> | |
| 2640 | + <schema_name/> | |
| 2641 | + </partitioning> | |
| 2642 | +<send_true_to/> | |
| 2643 | +<send_false_to/> | |
| 2644 | + <compare> | |
| 2645 | +<condition> | |
| 2646 | + <negated>N</negated> | |
| 2647 | + <conditions> | |
| 2648 | + <condition> | |
| 2649 | + <negated>N</negated> | |
| 2650 | + <leftvalue>scrapState_update</leftvalue> | |
| 2651 | + <function>=</function> | |
| 2652 | + <rightvalue/> | |
| 2653 | + <value><name>constant</name><type>String</type><text>1</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition> | |
| 2654 | + <condition> | |
| 2655 | + <negated>N</negated> | |
| 2656 | + <operator>AND</operator> | |
| 2657 | + <leftvalue>xl</leftvalue> | |
| 2658 | + <function>IS NOT NULL</function> | |
| 2659 | + <rightvalue/> | |
| 2660 | + </condition> | |
| 2661 | + </conditions> | |
| 2662 | + </condition> | |
| 2663 | + </compare> | |
| 2664 | + <cluster_schema/> | |
| 2665 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2666 | + <xloc>672</xloc> | |
| 2667 | + <yloc>496</yloc> | |
| 2668 | + <draw>Y</draw> | |
| 2669 | + </GUI> | |
| 2670 | + </step> | |
| 2671 | + | |
| 2672 | + <step> | |
| 2673 | + <name>更新车辆数据输出</name> | |
| 2674 | + <type>Update</type> | |
| 2675 | + <description/> | |
| 2676 | + <distribute>Y</distribute> | |
| 2677 | + <custom_distribution/> | |
| 2678 | + <copies>1</copies> | |
| 2679 | + <partitioning> | |
| 2680 | + <method>none</method> | |
| 2681 | + <schema_name/> | |
| 2682 | + </partitioning> | |
| 2683 | + <connection>control_jndi</connection> | |
| 2684 | + <skip_lookup>N</skip_lookup> | |
| 2685 | + <commit>100</commit> | |
| 2686 | + <use_batch>N</use_batch> | |
| 2687 | + <error_ignored>N</error_ignored> | |
| 2688 | + <ignore_flag_field/> | |
| 2689 | + <lookup> | |
| 2690 | + <schema/> | |
| 2691 | + <table>bsth_c_cars</table> | |
| 2692 | + <key> | |
| 2693 | + <name>id</name> | |
| 2694 | + <field>id</field> | |
| 2695 | + <condition>=</condition> | |
| 2696 | + <name2/> | |
| 2697 | + </key> | |
| 2698 | + <value> | |
| 2699 | + <name>equipment_code</name> | |
| 2700 | + <rename>equipmentCode_update</rename> | |
| 2701 | + </value> | |
| 2702 | + <value> | |
| 2703 | + <name>scrap_code</name> | |
| 2704 | + <rename>scrapCode_update</rename> | |
| 2705 | + </value> | |
| 2706 | + <value> | |
| 2707 | + <name>scrap_date</name> | |
| 2708 | + <rename>scrapDate_update</rename> | |
| 2709 | + </value> | |
| 2710 | + <value> | |
| 2711 | + <name>scrap_state</name> | |
| 2712 | + <rename>scrapState_update</rename> | |
| 2713 | + </value> | |
| 2714 | + <value> | |
| 2715 | + <name>company</name> | |
| 2716 | + <rename>company_update</rename> | |
| 2717 | + </value> | |
| 2718 | + <value> | |
| 2719 | + <name>business_code</name> | |
| 2720 | + <rename>business_code_update</rename> | |
| 2721 | + </value> | |
| 2722 | + <value> | |
| 2723 | + <name>branche_company</name> | |
| 2724 | + <rename>branche_company_update</rename> | |
| 2725 | + </value> | |
| 2726 | + <value> | |
| 2727 | + <name>branche_company_code</name> | |
| 2728 | + <rename>branch_company_code_update</rename> | |
| 2729 | + </value> | |
| 2730 | + <value> | |
| 2731 | + <name>update_date</name> | |
| 2732 | + <rename>update_date</rename> | |
| 2733 | + </value> | |
| 2734 | + </lookup> | |
| 2735 | + <cluster_schema/> | |
| 2736 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 2737 | + <xloc>825</xloc> | |
| 2738 | + <yloc>400</yloc> | |
| 2739 | + <draw>Y</draw> | |
| 2740 | + </GUI> | |
| 2741 | + </step> | |
| 2742 | + | |
| 2743 | + <step> | |
| 2744 | + <name>更新错误数据文件</name> | |
| 2745 | + <type>ExcelOutput</type> | |
| 2746 | + <description/> | |
| 2747 | + <distribute>Y</distribute> | |
| 2748 | + <custom_distribution/> | |
| 2749 | + <copies>1</copies> | |
| 2750 | + <partitioning> | |
| 2751 | + <method>none</method> | |
| 2752 | + <schema_name/> | |
| 2753 | + </partitioning> | |
| 2754 | + <header>Y</header> | |
| 2755 | + <footer>N</footer> | |
| 2756 | + <encoding/> | |
| 2757 | + <append>N</append> | |
| 2758 | + <add_to_result_filenames>Y</add_to_result_filenames> | |
| 2759 | + <file> | |
| 2760 | + <name>${file_update_error}</name> | |
| 2761 | + <extention>xls</extention> | |
| 2762 | + <do_not_open_newfile_init>N</do_not_open_newfile_init> | |
| 2763 | + <create_parent_folder>N</create_parent_folder> | |
| 2764 | + <split>N</split> | |
| 2765 | + <add_date>N</add_date> | |
| 2766 | + <add_time>N</add_time> | |
| 2767 | + <SpecifyFormat>N</SpecifyFormat> | |
| 2768 | + <date_time_format/> | |
| 2769 | + <sheetname>Sheet1</sheetname> | |
| 2770 | + <autosizecolums>N</autosizecolums> | |
| 2771 | + <nullisblank>N</nullisblank> | |
| 2772 | + <protect_sheet>N</protect_sheet> | |
| 2773 | + <password>Encrypted </password> | |
| 2774 | + <splitevery>0</splitevery> | |
| 2775 | + <usetempfiles>N</usetempfiles> | |
| 2776 | + <tempdirectory/> | |
| 2777 | + </file> | |
| 2778 | + <template> | |
| 2779 | + <enabled>N</enabled> | |
| 2780 | + <append>N</append> | |
| 2781 | + <filename>template.xls</filename> | |
| 2782 | + </template> | |
| 2783 | + <fields> | |
| 2784 | + <field> | |
| 2785 | + <name>clzbh</name> | |
| 2786 | + <type>String</type> | |
| 2787 | + <format/> | |
| 2788 | + </field> | |
| 2789 | + <field> | |
| 2790 | + <name>id</name> | |
| 2791 | + <type>Integer</type> | |
| 2792 | + <format/> | |
| 2793 | + </field> | |
| 2794 | + <field> | |
| 2795 | + <name>company_update</name> | |
| 2796 | + <type>String</type> | |
| 2797 | + <format/> | |
| 2798 | + </field> | |
| 2799 | + <field> | |
| 2800 | + <name>branche_company_update</name> | |
| 2801 | + <type>String</type> | |
| 2802 | + <format/> | |
| 2803 | + </field> | |
| 2804 | + <field> | |
| 2805 | + <name>business_code_update</name> | |
| 2806 | + <type>String</type> | |
| 2807 | + <format/> | |
| 2808 | + </field> | |
| 2809 | + <field> | |
| 2810 | + <name>branch_company_code_update</name> | |
| 2811 | + <type>String</type> | |
| 2812 | + <format/> | |
| 2813 | + </field> | |
| 2814 | + <field> | |
| 2815 | + <name>equipmentCode_update</name> | |
| 2816 | + <type>String</type> | |
| 2817 | + <format/> | |
| 2818 | + </field> | |
| 2819 | + <field> | |
| 2820 | + <name>scrapCode_update</name> | |
| 2821 | + <type>String</type> | |
| 2822 | + <format/> | |
| 2823 | + </field> | |
| 2824 | + <field> | |
| 2825 | + <name>scrapState_update</name> | |
| 2826 | + <type>Integer</type> | |
| 2827 | + <format/> | |
| 2828 | + </field> | |
| 2829 | + <field> | |
| 2830 | + <name>scrapDate_update</name> | |
| 2831 | + <type>String</type> | |
| 2832 | + <format/> | |
| 2833 | + </field> | |
| 2834 | + <field> | |
| 2835 | + <name>NrErrors</name> | |
| 2836 | + <type>Integer</type> | |
| 2837 | + <format/> | |
| 2838 | + </field> | |
| 2839 | + <field> | |
| 2840 | + <name>ErrorDescription</name> | |
| 2841 | + <type>String</type> | |
| 2842 | + <format/> | |
| 2843 | + </field> | |
| 2844 | + <field> | |
| 2845 | + <name>ErrorFields</name> | |
| 2846 | + <type>String</type> | |
| 2847 | + <format/> | |
| 2848 | + </field> | |
| 2849 | + <field> | |
| 2850 | + <name>ErrorCodes</name> | |
| 893 | 2851 | <type>String</type> |
| 894 | 2852 | <format/> |
| 895 | - <currency/> | |
| 896 | - <decimal/> | |
| 897 | - <group/> | |
| 898 | - <length>-1</length> | |
| 899 | - <precision>-1</precision> | |
| 900 | - <trim_type>none</trim_type> | |
| 901 | 2853 | </field> |
| 902 | 2854 | </fields> |
| 2855 | + <custom> | |
| 2856 | + <header_font_name>arial</header_font_name> | |
| 2857 | + <header_font_size>10</header_font_size> | |
| 2858 | + <header_font_bold>N</header_font_bold> | |
| 2859 | + <header_font_italic>N</header_font_italic> | |
| 2860 | + <header_font_underline>no</header_font_underline> | |
| 2861 | + <header_font_orientation>horizontal</header_font_orientation> | |
| 2862 | + <header_font_color>black</header_font_color> | |
| 2863 | + <header_background_color>none</header_background_color> | |
| 2864 | + <header_row_height>255</header_row_height> | |
| 2865 | + <header_alignment>left</header_alignment> | |
| 2866 | + <header_image/> | |
| 2867 | + <row_font_name>arial</row_font_name> | |
| 2868 | + <row_font_size>10</row_font_size> | |
| 2869 | + <row_font_color>black</row_font_color> | |
| 2870 | + <row_background_color>none</row_background_color> | |
| 2871 | + </custom> | |
| 903 | 2872 | <cluster_schema/> |
| 904 | 2873 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 905 | - <xloc>114</xloc> | |
| 906 | - <yloc>75</yloc> | |
| 2874 | + <xloc>962</xloc> | |
| 2875 | + <yloc>400</yloc> | |
| 907 | 2876 | <draw>Y</draw> |
| 908 | 2877 | </GUI> |
| 909 | 2878 | </step> |
| 910 | 2879 | |
| 911 | 2880 | <step_error_handling> |
| 2881 | + <error> | |
| 2882 | + <source_step>JavaScript解析json生成数据</source_step> | |
| 2883 | + <target_step/> | |
| 2884 | + <is_enabled>Y</is_enabled> | |
| 2885 | + <nr_valuename/> | |
| 2886 | + <descriptions_valuename/> | |
| 2887 | + <fields_valuename/> | |
| 2888 | + <codes_valuename/> | |
| 2889 | + <max_errors/> | |
| 2890 | + <max_pct_errors/> | |
| 2891 | + <min_pct_rows/> | |
| 2892 | + </error> | |
| 2893 | + <error> | |
| 2894 | + <source_step>数据检验</source_step> | |
| 2895 | + <target_step>数据检验错误输出</target_step> | |
| 2896 | + <is_enabled>Y</is_enabled> | |
| 2897 | + <nr_valuename>NrErrors</nr_valuename> | |
| 2898 | + <descriptions_valuename>ErrorDescription</descriptions_valuename> | |
| 2899 | + <fields_valuename>ErrorFields</fields_valuename> | |
| 2900 | + <codes_valuename>ErrorCodes</codes_valuename> | |
| 2901 | + <max_errors>-1</max_errors> | |
| 2902 | + <max_pct_errors>-1</max_pct_errors> | |
| 2903 | + <min_pct_rows>-1</min_pct_rows> | |
| 2904 | + </error> | |
| 2905 | + <error> | |
| 2906 | + <source_step>新增车辆数据输出</source_step> | |
| 2907 | + <target_step>新增错误数据文件</target_step> | |
| 2908 | + <is_enabled>Y</is_enabled> | |
| 2909 | + <nr_valuename>NrErrors</nr_valuename> | |
| 2910 | + <descriptions_valuename>ErrorDescription</descriptions_valuename> | |
| 2911 | + <fields_valuename>ErrorFields</fields_valuename> | |
| 2912 | + <codes_valuename>ErrorCodes</codes_valuename> | |
| 2913 | + <max_errors>-1</max_errors> | |
| 2914 | + <max_pct_errors>-1</max_pct_errors> | |
| 2915 | + <min_pct_rows>-1</min_pct_rows> | |
| 2916 | + </error> | |
| 2917 | + <error> | |
| 2918 | + <source_step>新增车辆设备数据输出</source_step> | |
| 2919 | + <target_step>添加车辆设备错误数据文件</target_step> | |
| 2920 | + <is_enabled>Y</is_enabled> | |
| 2921 | + <nr_valuename>NrErrors</nr_valuename> | |
| 2922 | + <descriptions_valuename>ErrorDescription</descriptions_valuename> | |
| 2923 | + <fields_valuename>ErrorFields</fields_valuename> | |
| 2924 | + <codes_valuename>ErrorCodes</codes_valuename> | |
| 2925 | + <max_errors>-1</max_errors> | |
| 2926 | + <max_pct_errors>-1</max_pct_errors> | |
| 2927 | + <min_pct_rows>-1</min_pct_rows> | |
| 2928 | + </error> | |
| 2929 | + <error> | |
| 2930 | + <source_step>更新车辆数据输出</source_step> | |
| 2931 | + <target_step>更新错误数据文件</target_step> | |
| 2932 | + <is_enabled>Y</is_enabled> | |
| 2933 | + <nr_valuename>NrErrors</nr_valuename> | |
| 2934 | + <descriptions_valuename>ErrorDescription</descriptions_valuename> | |
| 2935 | + <fields_valuename>ErrorFields</fields_valuename> | |
| 2936 | + <codes_valuename>ErrorCodes</codes_valuename> | |
| 2937 | + <max_errors>-1</max_errors> | |
| 2938 | + <max_pct_errors>-1</max_pct_errors> | |
| 2939 | + <min_pct_rows>-1</min_pct_rows> | |
| 2940 | + </error> | |
| 912 | 2941 | </step_error_handling> |
| 913 | 2942 | <slave-step-copy-partition-distribution> |
| 914 | 2943 | </slave-step-copy-partition-distribution> | ... | ... |
src/main/resources/logback.xml
| ... | ... | @@ -177,7 +177,7 @@ |
| 177 | 177 | </sift> |
| 178 | 178 | </appender> |
| 179 | 179 | <!-- 车辆信息同步任务 --> |
| 180 | - <logger name="com.bsth.service.schedule.datasync.task" level="info"> | |
| 180 | + <logger name="com.bsth.service.schedule.datasync.task" level="info" additivity="false"> | |
| 181 | 181 | <appender-ref ref="vehicle_data_sync_log"/> |
| 182 | 182 | </logger> |
| 183 | 183 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/form.html
0 → 100644
| 1 | +<div class="page-head"> | |
| 2 | + <div class="page-title"> | |
| 3 | + <h1>车辆信息同步管理</h1> | |
| 4 | + </div> | |
| 5 | +</div> | |
| 6 | + | |
| 7 | +<ul class="page-breadcrumb breadcrumb"> | |
| 8 | + <li> | |
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | |
| 10 | + <i class="fa fa-circle"></i> | |
| 11 | + </li> | |
| 12 | + <li> | |
| 13 | + <span class="active">基础信息</span> | |
| 14 | + <i class="fa fa-circle"></i> | |
| 15 | + </li> | |
| 16 | + <li> | |
| 17 | + <a ui-sref="vehicleDataSyncManage">车辆信息同步管理</a> | |
| 18 | + <i class="fa fa-circle"></i> | |
| 19 | + </li> | |
| 20 | + <li> | |
| 21 | + <span class="active">添加同步任务</span> | |
| 22 | + </li> | |
| 23 | +</ul> | |
| 24 | + | |
| 25 | +<div class="portlet light bordered" ng-controller="VehicleDataSyncManageFormCtrl as ctrl"> | |
| 26 | + <div class="portlet-title"> | |
| 27 | + <div class="caption"> | |
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | |
| 29 | + class="caption-subject font-red-sunglo bold uppercase">同步任务</span> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + <div class="portlet-body form"> | |
| 34 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | |
| 35 | + <div class="form-body"> | |
| 36 | + | |
| 37 | + <div class="form-group"> | |
| 38 | + <label class="col-md-2 control-label">车辆自编号:</label> | |
| 39 | + <div class="col-md-4"> | |
| 40 | + <input type="text" class="form-control" ng-model="ctrl.dataSyncTask.paramClzbh" | |
| 41 | + placeholder="请输入车辆自编号"/> | |
| 42 | + </div> | |
| 43 | + </div> | |
| 44 | + | |
| 45 | + <div class="form-group has-success has-feedback"> | |
| 46 | + <label class="col-md-2 control-label">开始日期*:</label> | |
| 47 | + <div class="col-md-3"> | |
| 48 | + <div class="input-group"> | |
| 49 | + <input type="text" class="form-control" | |
| 50 | + name="paramFrom" placeholder="请选择开始日期..." | |
| 51 | + uib-datepicker-popup="yyyy年MM月dd日" | |
| 52 | + is-open="ctrl.paramFrom" required | |
| 53 | + ng-model="ctrl.dataSyncTask.paramFrom" readonly/> | |
| 54 | + <span class="input-group-btn"> | |
| 55 | + <button type="button" class="btn btn-default" ng-click="ctrl.paramFrom_open()"> | |
| 56 | + <i class="glyphicon glyphicon-calendar"></i> | |
| 57 | + </button> | |
| 58 | + </span> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + <!-- 隐藏块,显示验证信息 --> | |
| 62 | + <div class="alert alert-danger well-sm" ng-show="myForm.paramFrom.$error.required"> | |
| 63 | + 开始日期必须选择 | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + | |
| 67 | + <div class="form-group has-success has-feedback"> | |
| 68 | + <label class="col-md-2 control-label">结束日期*:</label> | |
| 69 | + <div class="col-md-3"> | |
| 70 | + <div class="input-group"> | |
| 71 | + <input type="text" class="form-control" | |
| 72 | + name="paramTo" placeholder="请选择开始日期..." | |
| 73 | + uib-datepicker-popup="yyyy年MM月dd日" | |
| 74 | + is-open="ctrl.paramTo" required | |
| 75 | + ng-model="ctrl.dataSyncTask.paramTo" readonly/> | |
| 76 | + <span class="input-group-btn"> | |
| 77 | + <button type="button" class="btn btn-default" ng-click="ctrl.paramTo_open()"> | |
| 78 | + <i class="glyphicon glyphicon-calendar"></i> | |
| 79 | + </button> | |
| 80 | + </span> | |
| 81 | + </div> | |
| 82 | + </div> | |
| 83 | + <!-- 隐藏块,显示验证信息 --> | |
| 84 | + <div class="alert alert-danger well-sm" ng-show="myForm.paramTo.$error.required"> | |
| 85 | + 结束日期必须选择 | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + | |
| 89 | + <div class="form-actions"> | |
| 90 | + <div class="row"> | |
| 91 | + <div class="col-md-offset-3 col-md-4"> | |
| 92 | + <button type="submit" class="btn green" ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | |
| 93 | + <a type="button" class="btn default" ui-sref="vehicleDataSyncManage" ><i class="fa fa-times"></i> 取消</a> | |
| 94 | + </div> | |
| 95 | + </div> | |
| 96 | + </div> | |
| 97 | + </div> | |
| 98 | + </form> | |
| 99 | + </div> | |
| 100 | +</div> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/index.html
| ... | ... | @@ -35,6 +35,12 @@ |
| 35 | 35 | <i class="fa fa-database font-dark"></i> |
| 36 | 36 | <span class="caption-subject bold uppercase">车辆信息同步日志</span> |
| 37 | 37 | </div> |
| 38 | + <div class="actions"> | |
| 39 | + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()"> | |
| 40 | + <i class="fa fa-plus"></i> | |
| 41 | + 添加同步任务 | |
| 42 | + </a> | |
| 43 | + </div> | |
| 38 | 44 | </div> |
| 39 | 45 | |
| 40 | 46 | <div class="portlet-body"> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/list.html
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <th style="width:150px;">开始时间 </th> |
| 8 | 8 | <th style="width:150px;">结束时间 </th> |
| 9 | 9 | <th >执行耗时(秒)</th> |
| 10 | - <th >同步数量</th> | |
| 10 | + <th >待同步数量</th> | |
| 11 | 11 | <th >新增数量</th> |
| 12 | 12 | <th >更新数量</th> |
| 13 | 13 | <th >错误数量</th> |
| ... | ... | @@ -145,77 +145,110 @@ |
| 145 | 145 | <td> |
| 146 | 146 | <a sweetalert |
| 147 | 147 | sweet-options="{title: '同步信息',text: |
| 148 | + '</br>同步参数-车辆自编号:' + (info.paramClzbh == null ? '无' : info.paramClzbh) + | |
| 149 | + '</br>同步参数-开始时间:' + (info.paramFrom | date: 'yyyy-MM-dd') + | |
| 150 | + '</br>同步参数-结束时间:' + (info.paramTo | date: 'yyyy-MM-dd') + | |
| 151 | + '</br>同步类型:' + info.type + | |
| 148 | 152 | '</br>同步开始时间:' + (info.startDate | date: 'yyyy-MM-dd HH:mm:ss') + |
| 149 | 153 | '</br>同步结束时间:' + (info.endDate | date: 'yyyy-MM-dd HH:mm:ss') + |
| 150 | 154 | '</br>执行结果信息:' + info.processMsg, |
| 151 | 155 | html: true, |
| 152 | - type: 'info'}" | |
| 156 | + type: ctrl.sweetOptionsType(info)}" | |
| 153 | 157 | sweet-on-confirm="" |
| 154 | - class="btn btn-info btn-sm" | |
| 155 | - ng-if="info.status === '同步准备'"> | |
| 156 | - <span>同步准备</span> | |
| 157 | - <i class="fa fa-spinner" aria-hidden="true"></i> | |
| 158 | - </a> | |
| 159 | - <a sweetalert | |
| 160 | - sweet-options="{title: '同步信息',text: | |
| 161 | - '</br>同步开始时间:' + (info.startDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 162 | - '</br>同步结束时间:' + (info.endDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 163 | - '</br>执行结果信息:' + info.processMsg, | |
| 164 | - html: true, | |
| 165 | - type: 'info'}" | |
| 166 | - sweet-on-confirm="" | |
| 167 | - class="btn btn-danger btn-sm" | |
| 168 | - ng-if="info.status === '同步准备失败'"> | |
| 169 | - <span>同步准备失败</span> | |
| 170 | - <i class="fa fa-times" aria-hidden="true"></i> | |
| 171 | - </a> | |
| 172 | - <a sweetalert | |
| 173 | - sweet-options="{title: '同步信息',text: | |
| 174 | - '</br>同步开始时间:' + (info.startDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 175 | - '</br>同步结束时间:' + (info.endDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 176 | - '</br>执行结果信息:' + info.processMsg, | |
| 177 | - html: true, | |
| 178 | - type: 'info'}" | |
| 179 | - sweet-on-confirm="" | |
| 180 | - class="btn btn-primary btn-sm" | |
| 181 | - ng-if="info.status === '同步中'"> | |
| 182 | - <span>同步中</span> | |
| 183 | - <i class="fa fa-spinner" aria-hidden="true"></i> | |
| 184 | - </a> | |
| 185 | - <a sweetalert | |
| 186 | - sweet-options="{title: '同步信息',text: | |
| 187 | - '</br>同步开始时间:' + (info.startDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 188 | - '</br>同步结束时间:' + (info.endDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 189 | - '</br>执行结果信息:' + info.processMsg, | |
| 190 | - html: true, | |
| 191 | - type: 'info'}" | |
| 192 | - sweet-on-confirm="" | |
| 193 | - class="btn btn-success btn-sm" | |
| 194 | - ng-if="info.status === '同步结束' && info.processMsg.indexOf('成功') >= 0"> | |
| 195 | - <span>同步结束</span> | |
| 196 | - <i class="fa fa-check" aria-hidden="true"></i> | |
| 197 | - </a> | |
| 198 | - <a sweetalert | |
| 199 | - sweet-options="{title: '同步信息',text: | |
| 200 | - '</br>同步开始时间:' + (info.startDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 201 | - '</br>同步结束时间:' + (info.endDate | date: 'yyyy-MM-dd HH:mm:ss') + | |
| 202 | - '</br>执行结果信息:' + info.processMsg, | |
| 203 | - html: true, | |
| 204 | - type: 'info'}" | |
| 205 | - sweet-on-confirm="" | |
| 206 | - class="btn btn-warning btn-sm" | |
| 207 | - ng-if="info.status === '同步结束' && info.processMsg.indexOf('成功') === -1"> | |
| 208 | - <span>同步结束</span> | |
| 209 | - <i class="fa fa-exclamation" aria-hidden="true"></i> | |
| 158 | + ng-class="{ | |
| 159 | + btn: true, | |
| 160 | + 'btn-info': info.status === '同步准备', | |
| 161 | + 'btn-danger': info.status === '同步准备失败', | |
| 162 | + 'btn-primary': info.status === '同步中', | |
| 163 | + 'btn-success': (info.status === '同步结束' && info.processMsg.indexOf('成功') >= 0), | |
| 164 | + 'btn-warning': (info.status === '同步结束' && info.processMsg.indexOf('成功') === -1), | |
| 165 | + 'btn-sm': true | |
| 166 | + }" | |
| 167 | + > | |
| 168 | + <span ng-bind="info.status"></span> | |
| 169 | + <i ng-class="{ | |
| 170 | + fa: true, | |
| 171 | + 'fa-spinner': (info.status === '同步准备' || info.status === '同步中'), | |
| 172 | + 'fa-times' : info.status === '同步准备失败', | |
| 173 | + 'fa-check': (info.status === '同步结束' && info.processMsg.indexOf('成功') >= 0), | |
| 174 | + 'fa-exclamation': (info.status === '同步结束' && info.processMsg.indexOf('成功') === -1) | |
| 175 | + }" | |
| 176 | + > | |
| 177 | + </i> | |
| 210 | 178 | </a> |
| 179 | + | |
| 211 | 180 | </td> |
| 212 | 181 | <td> |
| 213 | 182 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 214 | 183 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 184 | + | |
| 215 | 185 | <button class="btn btn-info btn-sm" |
| 216 | - ng-click="ctrl.getLogFile(info.id)"> | |
| 186 | + ng-click="ctrl.getLogFile(info.id, 1)"> | |
| 217 | 187 | <i class="fa fa-download" aria-hidden="true"></i> 执行日志 |
| 218 | 188 | </button> |
| 189 | + | |
| 190 | + <!--<div class="btn-group">--> | |
| 191 | + <!--<button type="button" class="btn btn-danger">Action</button>--> | |
| 192 | + <!--<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">--> | |
| 193 | + <!--<span class="caret"></span>--> | |
| 194 | + <!--<span class="sr-only">Toggle Dropdown</span>--> | |
| 195 | + <!--</button>--> | |
| 196 | + <!--<ul class="dropdown-menu" role="menu">--> | |
| 197 | + <!--<li><a href="#">Action</a></li>--> | |
| 198 | + <!--<li><a href="#">Another action</a></li>--> | |
| 199 | + <!--<li><a href="#">Something else here</a></li>--> | |
| 200 | + <!--<li class="divider"></li>--> | |
| 201 | + <!--<li><a href="#">Separated link</a></li>--> | |
| 202 | + <!--</ul>--> | |
| 203 | + <!--</div>--> | |
| 204 | + | |
| 205 | + | |
| 206 | + <!--<div class="btn-group">--> | |
| 207 | + <!--<a href="javascript:" class="btn red btn-outline" data-toggle="dropdown">--> | |
| 208 | + <!--<i class="fa fa-download" aria-hidden="true"></i>--> | |
| 209 | + <!--<span>相关日志</span>--> | |
| 210 | + <!--<i class="fa fa-angle-down"></i>--> | |
| 211 | + <!--</a>--> | |
| 212 | + <!--<ul class="dropdown-menu pull-right">--> | |
| 213 | + <!--<li>--> | |
| 214 | + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.getLogFile(info.id, 1)">--> | |
| 215 | + <!--<i class="fa fa-file-excel-o"></i>--> | |
| 216 | + <!--日志文件.log--> | |
| 217 | + <!--</a>--> | |
| 218 | + <!--</li>--> | |
| 219 | + <!--<li>--> | |
| 220 | + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.getLogFile(info.id, 2)">--> | |
| 221 | + <!--<i class="fa fa-file-excel-o"></i>--> | |
| 222 | + <!--数据检验错误文件.xls--> | |
| 223 | + <!--</a>--> | |
| 224 | + <!--</li>--> | |
| 225 | + <!--<li>--> | |
| 226 | + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.getLogFile(info.id, 3)">--> | |
| 227 | + <!--<i class="fa fa-file-excel-o"></i>--> | |
| 228 | + <!--待处理文件.xls--> | |
| 229 | + <!--</a>--> | |
| 230 | + <!--</li>--> | |
| 231 | + <!--<li>--> | |
| 232 | + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.getLogFile(info.id, 4)">--> | |
| 233 | + <!--<i class="fa fa-file-excel-o"></i>--> | |
| 234 | + <!--新增车辆数据错误文件.xls--> | |
| 235 | + <!--</a>--> | |
| 236 | + <!--</li>--> | |
| 237 | + <!--<li>--> | |
| 238 | + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.getLogFile(info.id, 5)">--> | |
| 239 | + <!--<i class="fa fa-file-excel-o"></i>--> | |
| 240 | + <!--更新车辆数据错误文件.xls--> | |
| 241 | + <!--</a>--> | |
| 242 | + <!--</li>--> | |
| 243 | + <!--<li>--> | |
| 244 | + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.getLogFile(info.id, 6)">--> | |
| 245 | + <!--<i class="fa fa-file-excel-o"></i>--> | |
| 246 | + <!--新增报废车辆设备数据错误文件.xls--> | |
| 247 | + <!--</a>--> | |
| 248 | + <!--</li>--> | |
| 249 | + <!--</ul>--> | |
| 250 | + <!--</div>--> | |
| 251 | + | |
| 219 | 252 | </td> |
| 220 | 253 | </tr> |
| 221 | 254 | </tbody> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/module.js
| ... | ... | @@ -22,11 +22,16 @@ angular.module('ScheduleApp').factory( |
| 22 | 22 | |
| 23 | 23 | // rest查询对象 |
| 24 | 24 | var queryClass = service.rest; |
| 25 | + // addTask操作对象 | |
| 26 | + var addTaskClass = service.addTask; | |
| 25 | 27 | |
| 26 | 28 | return { |
| 27 | 29 | getQueryClass: function() { |
| 28 | 30 | return queryClass; |
| 29 | 31 | }, |
| 32 | + getAddTaskClass: function() { | |
| 33 | + return addTaskClass; | |
| 34 | + }, | |
| 30 | 35 | /** |
| 31 | 36 | * 获取查询条件信息, |
| 32 | 37 | * 用于给controller用来和页面数据绑定。 |
| ... | ... | @@ -66,8 +71,8 @@ angular.module('ScheduleApp').factory( |
| 66 | 71 | }; |
| 67 | 72 | }, |
| 68 | 73 | |
| 69 | - logFileExportPromise: function(logId) { | |
| 70 | - return service.logFileExport.getLog({id: logId}).$promise; | |
| 74 | + logFileExportPromise: function(logId, type) { | |
| 75 | + return service.logFileExport.getLog({id: logId, type: type}).$promise; | |
| 71 | 76 | } |
| 72 | 77 | |
| 73 | 78 | }; |
| ... | ... | @@ -84,7 +89,12 @@ angular.module('ScheduleApp').controller( |
| 84 | 89 | function($state) { |
| 85 | 90 | var self = this; |
| 86 | 91 | |
| 87 | - // TODO: | |
| 92 | + // 切换到form状态 | |
| 93 | + self.goForm = function() { | |
| 94 | + //alert("切换"); | |
| 95 | + $state.go("vehicleDataSyncManage_form"); | |
| 96 | + }; | |
| 97 | + | |
| 88 | 98 | } |
| 89 | 99 | ] |
| 90 | 100 | ); |
| ... | ... | @@ -134,11 +144,25 @@ angular.module('ScheduleApp').controller( |
| 134 | 144 | }); |
| 135 | 145 | }; |
| 136 | 146 | |
| 137 | - self.getLogFile = function(id) { | |
| 138 | - var promise = service.logFileExportPromise(id); | |
| 147 | + self.getLogFile = function(id, type) { | |
| 148 | + var promise = service.logFileExportPromise(id, type); | |
| 139 | 149 | promise.then( |
| 140 | 150 | function(result) { |
| 141 | - fileDownload.downloadFile(result.data, "application/octet-stream", "日志文件.xls"); | |
| 151 | + var fileName = "todo.log"; | |
| 152 | + if (type == 1) { | |
| 153 | + fileName = "日志文件.log"; | |
| 154 | + } else if (type == 2) { | |
| 155 | + fileName = "数据检验错误文件.xls"; | |
| 156 | + } else if (type == 3) { | |
| 157 | + fileName = "待处理文件.xls"; | |
| 158 | + } else if (type == 4) { | |
| 159 | + fileName = "新增车辆数据错误文件.xls"; | |
| 160 | + } else if (type == 5) { | |
| 161 | + fileName = "更新车辆数据错误文件.xls"; | |
| 162 | + } else if (type == 6) { | |
| 163 | + fileName = "新增报废车辆设备数据错误文件.xls"; | |
| 164 | + } | |
| 165 | + fileDownload.downloadFile(result.data, "application/octet-stream", fileName); | |
| 142 | 166 | }, |
| 143 | 167 | function(result) { |
| 144 | 168 | console.log("获取日志文件失败:" + result); |
| ... | ... | @@ -149,6 +173,58 @@ angular.module('ScheduleApp').controller( |
| 149 | 173 | // 查询 |
| 150 | 174 | self.doPage(); |
| 151 | 175 | |
| 176 | + self.sweetOptionsType = function(info) { | |
| 177 | + if (info.status === '同步准备') { | |
| 178 | + return "info"; | |
| 179 | + } else if (info.status === '同步准备失败') { | |
| 180 | + return "error"; | |
| 181 | + } else if (info.status === '同步中') { | |
| 182 | + return "info"; | |
| 183 | + } else if ((info.status === '同步结束' && info.processMsg.indexOf('成功') >= 0)) { | |
| 184 | + return "success"; | |
| 185 | + } else if ((info.status === '同步结束' && info.processMsg.indexOf('成功') === -1)) { | |
| 186 | + return "warning"; | |
| 187 | + } | |
| 188 | + | |
| 189 | + } | |
| 190 | + | |
| 152 | 191 | } |
| 153 | 192 | ] |
| 154 | 193 | ); |
| 194 | + | |
| 195 | +// form.html控制器 | |
| 196 | +angular.module('ScheduleApp').controller( | |
| 197 | + 'VehicleDataSyncManageFormCtrl', | |
| 198 | + [ | |
| 199 | + 'VehicleDataSyncManageService', | |
| 200 | + '$state', | |
| 201 | + function(service, $state) { | |
| 202 | + var self = this; | |
| 203 | + var Task = service.getAddTaskClass(); | |
| 204 | + | |
| 205 | + // 日期 日期控件开关 | |
| 206 | + self.paramFrom = false; | |
| 207 | + self.paramFrom_open = function() { | |
| 208 | + self.paramFrom = true; | |
| 209 | + }; | |
| 210 | + self.paramTo = false; | |
| 211 | + self.paramTo_open = function() { | |
| 212 | + self.paramTo = true; | |
| 213 | + }; | |
| 214 | + | |
| 215 | + self.dataSyncTask = new Task(); | |
| 216 | + | |
| 217 | + // TODO: | |
| 218 | + | |
| 219 | + // 提交方法 | |
| 220 | + self.submit = function() { | |
| 221 | + console.log(self.dataSyncTask); | |
| 222 | + | |
| 223 | + self.dataSyncTask.$save(function() { | |
| 224 | + $state.go("vehicleDataSyncManage"); | |
| 225 | + }); | |
| 226 | + }; | |
| 227 | + } | |
| 228 | + | |
| 229 | + ] | |
| 230 | +); | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/route.js
| ... | ... | @@ -31,5 +31,26 @@ ScheduleApp.config([ |
| 31 | 31 | }] |
| 32 | 32 | } |
| 33 | 33 | }) |
| 34 | + .state("vehicleDataSyncManage_form", { // 添加车辆form | |
| 35 | + url: '/vehicleDataSyncManage_form', | |
| 36 | + views: { | |
| 37 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/form.html'} | |
| 38 | + }, | |
| 39 | + resolve: { | |
| 40 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 41 | + return $ocLazyLoad.load({ | |
| 42 | + name: 'vehicleDataSyncManage_form_module', | |
| 43 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 44 | + files: [ | |
| 45 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 46 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 47 | + "pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/module.js" | |
| 48 | + ] | |
| 49 | + }); | |
| 50 | + }] | |
| 51 | + } | |
| 52 | + }) | |
| 53 | + | |
| 34 | 54 | } |
| 35 | 55 | ]); |
| 56 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/service.js
| ... | ... | @@ -37,7 +37,7 @@ angular.module('ScheduleApp').factory( |
| 37 | 37 | } |
| 38 | 38 | ), |
| 39 | 39 | logFileExport: $resource( |
| 40 | - '/dataSync/vehicle/logfile/:id', | |
| 40 | + '/dataSync/vehicle/logfile/:id/:type', | |
| 41 | 41 | {id: '@id'}, |
| 42 | 42 | { |
| 43 | 43 | getLog: { |
| ... | ... | @@ -48,6 +48,15 @@ angular.module('ScheduleApp').factory( |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | + ), | |
| 52 | + addTask: $resource( | |
| 53 | + '/dataSync/vehicle/addTask', | |
| 54 | + {}, | |
| 55 | + { | |
| 56 | + save: { | |
| 57 | + method: 'POST' | |
| 58 | + } | |
| 59 | + } | |
| 51 | 60 | ) |
| 52 | 61 | }; |
| 53 | 62 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -223,7 +223,7 @@ angular.module('ScheduleApp').factory( |
| 223 | 223 | } |
| 224 | 224 | ), |
| 225 | 225 | logFileExport: $resource( |
| 226 | - '/dataSync/vehicle/logfile/:id', | |
| 226 | + '/dataSync/vehicle/logfile/:id/:type', | |
| 227 | 227 | {id: '@id'}, |
| 228 | 228 | { |
| 229 | 229 | getLog: { |
| ... | ... | @@ -234,6 +234,15 @@ angular.module('ScheduleApp').factory( |
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | + ), | |
| 238 | + addTask: $resource( | |
| 239 | + '/dataSync/vehicle/addTask', | |
| 240 | + {}, | |
| 241 | + { | |
| 242 | + save: { | |
| 243 | + method: 'POST' | |
| 244 | + } | |
| 245 | + } | |
| 237 | 246 | ) |
| 238 | 247 | }; |
| 239 | 248 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| ... | ... | @@ -313,9 +313,30 @@ ScheduleApp.config([ |
| 313 | 313 | }] |
| 314 | 314 | } |
| 315 | 315 | }) |
| 316 | + .state("vehicleDataSyncManage_form", { // 添加车辆form | |
| 317 | + url: '/vehicleDataSyncManage_form', | |
| 318 | + views: { | |
| 319 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/form.html'} | |
| 320 | + }, | |
| 321 | + resolve: { | |
| 322 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 323 | + return $ocLazyLoad.load({ | |
| 324 | + name: 'vehicleDataSyncManage_form_module', | |
| 325 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 326 | + files: [ | |
| 327 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 328 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 329 | + "pages/scheduleApp/module/basicInfo/vehicleDataSyncManage/module.js" | |
| 330 | + ] | |
| 331 | + }); | |
| 332 | + }] | |
| 333 | + } | |
| 334 | + }) | |
| 335 | + | |
| 316 | 336 | } |
| 317 | 337 | ]); |
| 318 | 338 | |
| 339 | + | |
| 319 | 340 | // ui route 配置 |
| 320 | 341 | |
| 321 | 342 | /** 车辆配置模块页面route */ | ... | ... |