Commit a4f546423224b7bd4307f7787259217a2a0dcd99
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
25 changed files
with
1970 additions
and
1739 deletions
Too many changes to show.
To preserve performance only 25 of 57 files are displayed.
src/main/java/com/bsth/controller/CarParkController.java
| @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*; | @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*; | ||
| 15 | @RestController | 15 | @RestController |
| 16 | @RequestMapping("carpark") | 16 | @RequestMapping("carpark") |
| 17 | public class CarParkController extends BaseController<CarPark, Integer> { | 17 | public class CarParkController extends BaseController<CarPark, Integer> { |
| 18 | - | ||
| 19 | @Autowired | 18 | @Autowired |
| 20 | CarParkService service; | 19 | CarParkService service; |
| 21 | 20 | ||
| @@ -26,16 +25,10 @@ public class CarParkController extends BaseController<CarPark, Integer> { | @@ -26,16 +25,10 @@ public class CarParkController extends BaseController<CarPark, Integer> { | ||
| 26 | */ | 25 | */ |
| 27 | @RequestMapping(value="getCarParkCode" , method = RequestMethod.GET) | 26 | @RequestMapping(value="getCarParkCode" , method = RequestMethod.GET) |
| 28 | public Map<String, Object> getStationCode() { | 27 | public Map<String, Object> getStationCode() { |
| 29 | - | ||
| 30 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 28 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 31 | - | ||
| 32 | - resultMap.put("carParkCode", "FFFF" + GetUIDAndCode.getCarParkId()); | ||
| 33 | - | 29 | + resultMap.put("carParkCode", "FFFFFF" + GetUIDAndCode.getCarParkId()); |
| 34 | return resultMap; | 30 | return resultMap; |
| 35 | - | ||
| 36 | } | 31 | } |
| 37 | - | ||
| 38 | - | ||
| 39 | /** | 32 | /** |
| 40 | * 新增停车场信息 | 33 | * 新增停车场信息 |
| 41 | * | 34 | * |
| @@ -53,21 +46,14 @@ public class CarParkController extends BaseController<CarPark, Integer> { | @@ -53,21 +46,14 @@ public class CarParkController extends BaseController<CarPark, Integer> { | ||
| 53 | */ | 46 | */ |
| 54 | @RequestMapping(value="carParkSave" , method = RequestMethod.POST) | 47 | @RequestMapping(value="carParkSave" , method = RequestMethod.POST) |
| 55 | public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) { | 48 | public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) { |
| 56 | - | ||
| 57 | map.put("createBy", ""); | 49 | map.put("createBy", ""); |
| 58 | - | ||
| 59 | map.put("updateBy", ""); | 50 | map.put("updateBy", ""); |
| 60 | - | ||
| 61 | return service.carParkSave(map); | 51 | return service.carParkSave(map); |
| 62 | - | ||
| 63 | } | 52 | } |
| 64 | - | ||
| 65 | @RequestMapping(value = "findCarParkInfoFormId",method = RequestMethod.GET) | 53 | @RequestMapping(value = "findCarParkInfoFormId",method = RequestMethod.GET) |
| 66 | public List<Map<String, Object>> findCarParkInfoFormId(@RequestParam Map<String, Object> map) { | 54 | public List<Map<String, Object>> findCarParkInfoFormId(@RequestParam Map<String, Object> map) { |
| 67 | - | ||
| 68 | return service.findCarParkInfoFormId(map); | 55 | return service.findCarParkInfoFormId(map); |
| 69 | } | 56 | } |
| 70 | - | ||
| 71 | /** | 57 | /** |
| 72 | * 修改停车场信息 | 58 | * 修改停车场信息 |
| 73 | * | 59 | * |
| @@ -85,11 +71,12 @@ public class CarParkController extends BaseController<CarPark, Integer> { | @@ -85,11 +71,12 @@ public class CarParkController extends BaseController<CarPark, Integer> { | ||
| 85 | */ | 71 | */ |
| 86 | @RequestMapping(value="carParkUpdate" , method = RequestMethod.POST) | 72 | @RequestMapping(value="carParkUpdate" , method = RequestMethod.POST) |
| 87 | public Map<String, Object> carParkUpdate(@RequestParam Map<String, Object> map) { | 73 | public Map<String, Object> carParkUpdate(@RequestParam Map<String, Object> map) { |
| 88 | - | ||
| 89 | map.put("updateBy", ""); | 74 | map.put("updateBy", ""); |
| 90 | - | ||
| 91 | return service.carParkUpdate(map); | 75 | return service.carParkUpdate(map); |
| 92 | - | ||
| 93 | } | 76 | } |
| 94 | 77 | ||
| 78 | + @RequestMapping(value="isHaveParkCode",method=RequestMethod.GET) | ||
| 79 | + public boolean isHaveParkCode(@RequestParam Map<String,Object> map) { | ||
| 80 | + return service.selectTccInfoByCode(map); | ||
| 81 | + } | ||
| 95 | } | 82 | } |
src/main/java/com/bsth/controller/realcontrol/anomalyCheckController.java
| 1 | package com.bsth.controller.realcontrol; | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | ||
| 3 | +import com.bsth.data.gpsdata.client.ClientApp; | ||
| 3 | import com.bsth.data.schedule.DayOfSchedule; | 4 | import com.bsth.data.schedule.DayOfSchedule; |
| 4 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 5 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| @@ -15,7 +16,6 @@ import java.util.List; | @@ -15,7 +16,6 @@ import java.util.List; | ||
| 15 | import java.util.Map; | 16 | import java.util.Map; |
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| 18 | - * 相关数据异常检测 | ||
| 19 | * Created by panzhao on 2017/4/14. | 19 | * Created by panzhao on 2017/4/14. |
| 20 | */ | 20 | */ |
| 21 | @RestController | 21 | @RestController |
| @@ -50,4 +50,10 @@ public class anomalyCheckController { | @@ -50,4 +50,10 @@ public class anomalyCheckController { | ||
| 50 | dayOfSchedule.replaceByNbbm(nbbm, map.values()); | 50 | dayOfSchedule.replaceByNbbm(nbbm, map.values()); |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | + | ||
| 54 | + @RequestMapping(value = "/gpsClientReconn", method = RequestMethod.POST) | ||
| 55 | + public void gpsClientReconn(){ | ||
| 56 | + ClientApp.pdreconn(); | ||
| 57 | + ClientApp.pfreconn(); | ||
| 58 | + } | ||
| 53 | } | 59 | } |
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; | @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; | ||
| 12 | import org.springframework.web.bind.annotation.RequestParam; | 12 | import org.springframework.web.bind.annotation.RequestParam; |
| 13 | import org.springframework.web.bind.annotation.RestController; | 13 | import org.springframework.web.bind.annotation.RestController; |
| 14 | 14 | ||
| 15 | +import com.bsth.entity.StationRoute; | ||
| 15 | import com.bsth.entity.excep.ArrivalInfo; | 16 | import com.bsth.entity.excep.ArrivalInfo; |
| 16 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 17 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 17 | import com.bsth.service.report.ReportService; | 18 | import com.bsth.service.report.ReportService; |
| @@ -75,6 +76,17 @@ public class ReportController { | @@ -75,6 +76,17 @@ public class ReportController { | ||
| 75 | } | 76 | } |
| 76 | 77 | ||
| 77 | 78 | ||
| 79 | + @RequestMapping(value="/queryStrinon" ,method = RequestMethod.GET) | ||
| 80 | + public List<StationRoute> queryStrinon(@RequestParam String line, | ||
| 81 | + @RequestParam int zd){ | ||
| 82 | + return service.queryStrinon(line,zd); | ||
| 83 | + } | ||
| 84 | + @RequestMapping(value="/queryInOutStrtion" ,method = RequestMethod.GET) | ||
| 85 | + public List<Map<String, Object>> queryInOutStrtion(@RequestParam String line, | ||
| 86 | + @RequestParam String date,@RequestParam int zd,@RequestParam String lzsj){ | ||
| 87 | + return service.queryInOutStrtion(line,date,zd,lzsj); | ||
| 88 | + } | ||
| 89 | + | ||
| 78 | @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET) | 90 | @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET) |
| 79 | public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line, | 91 | public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line, |
| 80 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ | 92 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ |
| @@ -84,6 +96,8 @@ public class ReportController { | @@ -84,6 +96,8 @@ public class ReportController { | ||
| 84 | 96 | ||
| 85 | 97 | ||
| 86 | 98 | ||
| 99 | + | ||
| 100 | + | ||
| 87 | @RequestMapping(value="/exportQueryListClzd" ,method = RequestMethod.GET) | 101 | @RequestMapping(value="/exportQueryListClzd" ,method = RequestMethod.GET) |
| 88 | public List<Map<String, Object>> exportQueryListClzd(@RequestParam String zd,@RequestParam String line, | 102 | public List<Map<String, Object>> exportQueryListClzd(@RequestParam String zd,@RequestParam String line, |
| 89 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ | 103 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ |
src/main/java/com/bsth/data/car_out_info/CarOutInfo.java
| 1 | -package com.bsth.data.car_out_info; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 4 | - | ||
| 5 | -import java.util.List; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * Created by panzhao on 2017/5/7. | ||
| 9 | - */ | ||
| 10 | -public interface CarOutInfo { | ||
| 11 | - | ||
| 12 | - void updateAll(); | ||
| 13 | - | ||
| 14 | - void update(String lineCode); | ||
| 15 | - | ||
| 16 | - void update(List<ScheduleRealInfo> list) ; | ||
| 17 | -} | 1 | +package com.bsth.data.car_out_info; |
| 2 | + | ||
| 3 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 4 | + | ||
| 5 | +import java.util.List; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Created by panzhao on 2017/5/7. | ||
| 9 | + */ | ||
| 10 | +public interface CarOutInfo { | ||
| 11 | + | ||
| 12 | + void updateAll(); | ||
| 13 | + | ||
| 14 | + void update(String lineCode); | ||
| 15 | + | ||
| 16 | + void update(List<ScheduleRealInfo> list) ; | ||
| 17 | +} |
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
| 1 | -package com.bsth.data.car_out_info; | ||
| 2 | - | ||
| 3 | -import com.bsth.data.BasicData; | ||
| 4 | -import com.bsth.data.schedule.DayOfSchedule; | ||
| 5 | -import com.bsth.data.schedule.ScheduleComparator; | ||
| 6 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 7 | -import com.google.common.collect.ArrayListMultimap; | ||
| 8 | -import org.apache.commons.lang3.StringUtils; | ||
| 9 | -import org.slf4j.Logger; | ||
| 10 | -import org.slf4j.LoggerFactory; | ||
| 11 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 12 | -import org.springframework.boot.CommandLineRunner; | ||
| 13 | -import org.springframework.jdbc.core.BatchPreparedStatementSetter; | ||
| 14 | -import org.springframework.jdbc.core.JdbcTemplate; | ||
| 15 | -import org.springframework.stereotype.Component; | ||
| 16 | -import org.springframework.stereotype.Service; | ||
| 17 | -import org.springframework.transaction.annotation.Transactional; | ||
| 18 | - | ||
| 19 | -import java.sql.PreparedStatement; | ||
| 20 | -import java.sql.SQLException; | ||
| 21 | -import java.util.*; | ||
| 22 | - | ||
| 23 | -/** | ||
| 24 | - * 发车信息表处理程序 | ||
| 25 | - * Created by panzhao on 2017/5/5. | ||
| 26 | - */ | ||
| 27 | -@Service | ||
| 28 | -public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo { | ||
| 29 | - | ||
| 30 | - @Autowired | ||
| 31 | - DayOfSchedule dayOfSchedule; | ||
| 32 | - | ||
| 33 | - //班次类型对照表 | ||
| 34 | - Map<String, String> bcTypeMap; | ||
| 35 | - | ||
| 36 | - private static ScheduleComparator.FCSJ schFCSJComparator = new ScheduleComparator.FCSJ(); | ||
| 37 | - | ||
| 38 | - @Autowired | ||
| 39 | - JdbcTemplate jdbcTemplate; | ||
| 40 | - | ||
| 41 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 42 | - | ||
| 43 | - /** | ||
| 44 | - * 全量更新发车信息表 | ||
| 45 | - */ | ||
| 46 | - @Override | ||
| 47 | - public void updateAll() { | ||
| 48 | - Set<String> ks = BasicData.lineCode2NameMap.keySet(); | ||
| 49 | - for (String lineCode : ks) { | ||
| 50 | - update(lineCode); | ||
| 51 | - } | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - @Override | ||
| 55 | - public void update(String lineCode) { | ||
| 56 | - try { | ||
| 57 | - ArrayListMultimap<String, ScheduleRealInfo> lpScheduleMap = dayOfSchedule.getLpScheduleMap(); | ||
| 58 | - List<ScheduleRealInfo> list = new ArrayList<>(); | ||
| 59 | - | ||
| 60 | - Set<String> ks = lpScheduleMap.keySet(); | ||
| 61 | - String prefix = lineCode + "_"; | ||
| 62 | - for (String k : ks) { | ||
| 63 | - if (k.indexOf(prefix) != -1) { | ||
| 64 | - list.addAll(lpScheduleMap.get(k)); | ||
| 65 | - } | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - update(list); | ||
| 69 | - } catch (Exception e) { | ||
| 70 | - logger.error("", e); | ||
| 71 | - } | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - @Transactional | ||
| 75 | - @Override | ||
| 76 | - public void update(List<ScheduleRealInfo> list) { | ||
| 77 | - if (list.size() == 0) | ||
| 78 | - return; | ||
| 79 | - String lineCode = list.get(0).getXlBm(); | ||
| 80 | - //按上下行分组 | ||
| 81 | - List<ScheduleRealInfo> ups = new ArrayList<>(), downs = new ArrayList<>(); | ||
| 82 | - for (ScheduleRealInfo sch : list) { | ||
| 83 | - if (sch.getXlDir().equals("0")) | ||
| 84 | - ups.add(sch); | ||
| 85 | - else | ||
| 86 | - downs.add(sch); | ||
| 87 | - } | ||
| 88 | - | ||
| 89 | - ScheduleRealInfo[] upArray = nexts(ups), | ||
| 90 | - downArray = nexts(downs); | ||
| 91 | - | ||
| 92 | - final List<ScheduleRealInfo> pstArray = mergeArray(upArray, downArray); | ||
| 93 | - //删除 | ||
| 94 | - jdbcTemplate.update("delete from bsth_t_clfcxxb where line_code=?", lineCode); | ||
| 95 | - //重新写入 | ||
| 96 | - jdbcTemplate.batchUpdate("insert into bsth_t_clfcxxb(rq, line_code, line_name, lp_name, lp_sn, dfsj, nbbm, cph, bc_type, end_station_name, updown, jGh, jName, remarks, sn)" + | ||
| 97 | - " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() { | ||
| 98 | - @Override | ||
| 99 | - public void setValues(PreparedStatement ps, int i) throws SQLException { | ||
| 100 | - ScheduleRealInfo sch = pstArray.get(i); | ||
| 101 | - ps.setString(1, sch.getScheduleDateStr()); | ||
| 102 | - ps.setString(2, sch.getXlBm()); | ||
| 103 | - ps.setString(3, sch.getXlName()); | ||
| 104 | - ps.setString(4, sch.getLpName()); | ||
| 105 | - ps.setInt(5, sch.getFcno()); | ||
| 106 | - ps.setString(6, sch.getDfsj()); | ||
| 107 | - ps.setString(7, sch.getClZbh()); | ||
| 108 | - ps.setString(8, BasicData.nbbmCompanyPlateMap.get(sch.getClZbh())); | ||
| 109 | - ps.setString(9, bcTypeMap.containsKey(sch.getBcType()) ? bcTypeMap.get(sch.getBcType()) : sch.getBcType()); | ||
| 110 | - ps.setString(10, sch.getZdzName()); | ||
| 111 | - ps.setInt(11, Integer.parseInt(sch.getXlDir())); | ||
| 112 | - ps.setString(12, sch.getjGh()); | ||
| 113 | - ps.setString(13, sch.getjName()); | ||
| 114 | - ps.setString(14, sch.getRemarks()); | ||
| 115 | - ps.setInt(15, sch.getFcpSn()); | ||
| 116 | - } | ||
| 117 | - | ||
| 118 | - @Override | ||
| 119 | - public int getBatchSize() { | ||
| 120 | - return pstArray.size(); | ||
| 121 | - } | ||
| 122 | - }); | ||
| 123 | - } | ||
| 124 | - | ||
| 125 | - private List<ScheduleRealInfo> mergeArray(ScheduleRealInfo[] upArray, ScheduleRealInfo[] downArray) { | ||
| 126 | - List<ScheduleRealInfo> list = new ArrayList<>(); | ||
| 127 | - for (int i = 0; i < upArray.length; i++) { | ||
| 128 | - if (upArray[i] != null) { | ||
| 129 | - upArray[i].setFcpSn(i + 1); | ||
| 130 | - list.add(upArray[i]); | ||
| 131 | - } | ||
| 132 | - } | ||
| 133 | - for (int i = 0; i < downArray.length; i++) { | ||
| 134 | - if (downArray[i] != null) { | ||
| 135 | - downArray[i].setFcpSn(i + 1); | ||
| 136 | - list.add(downArray[i]); | ||
| 137 | - } | ||
| 138 | - } | ||
| 139 | - return list; | ||
| 140 | - } | ||
| 141 | - | ||
| 142 | - /** | ||
| 143 | - * 接下来要执行的3个班次 | ||
| 144 | - * | ||
| 145 | - * @param list | ||
| 146 | - * @return | ||
| 147 | - */ | ||
| 148 | - private ScheduleRealInfo[] nexts(List<ScheduleRealInfo> list) { | ||
| 149 | - ScheduleRealInfo[] array = new ScheduleRealInfo[3]; | ||
| 150 | - Collections.sort(list, schFCSJComparator); | ||
| 151 | - | ||
| 152 | - int count = 0, threshold = 1000 * 60 * 30; | ||
| 153 | - long t = System.currentTimeMillis(); | ||
| 154 | - for (ScheduleRealInfo sch : list) { | ||
| 155 | - if (count == 3) | ||
| 156 | - break; | ||
| 157 | - | ||
| 158 | - //烂班 | ||
| 159 | - if (sch.isDestroy()) | ||
| 160 | - continue; | ||
| 161 | - | ||
| 162 | - //进场、出场、2点间空驶 | ||
| 163 | - if (sch.getBcType().equals("in") | ||
| 164 | - || sch.getBcType().equals("out") | ||
| 165 | - || sch.getBcType().equals("ldks")) | ||
| 166 | - continue; | ||
| 167 | - | ||
| 168 | - //有实发实达时间的 | ||
| 169 | - if (StringUtils.isNotEmpty(sch.getFcsjActual()) | ||
| 170 | - || StringUtils.isNotEmpty(sch.getZdsjActual())) | ||
| 171 | - continue; | ||
| 172 | - | ||
| 173 | - if (t - sch.getDfsjT() > threshold) | ||
| 174 | - continue; | ||
| 175 | - | ||
| 176 | - array[count] = sch; | ||
| 177 | - count++; | ||
| 178 | - } | ||
| 179 | - return array; | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | - @Autowired | ||
| 183 | - UpdateInfoThread updateInfoThread; | ||
| 184 | - | ||
| 185 | - @Override | ||
| 186 | - public void run(String... strings) throws Exception { | ||
| 187 | - bcTypeMap = new HashMap<>(); | ||
| 188 | - bcTypeMap.put("normal", "正常班次"); | ||
| 189 | - bcTypeMap.put("region", "区间"); | ||
| 190 | - bcTypeMap.put("venting", "直放"); | ||
| 191 | - bcTypeMap.put("major", "放站"); | ||
| 192 | - bcTypeMap.put("ldks", "两点间空驶"); | ||
| 193 | - //Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS); | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - @Component | ||
| 197 | - private static class UpdateInfoThread extends Thread { | ||
| 198 | - | ||
| 199 | - @Autowired | ||
| 200 | - CarOutInfo carOutInfoHandler; | ||
| 201 | - | ||
| 202 | - @Override | ||
| 203 | - public void run() { | ||
| 204 | - carOutInfoHandler.updateAll(); | ||
| 205 | - } | ||
| 206 | - } | ||
| 207 | -} | 1 | +package com.bsth.data.car_out_info; |
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | +import com.bsth.data.schedule.DayOfSchedule; | ||
| 5 | +import com.bsth.data.schedule.ScheduleComparator; | ||
| 6 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 7 | +import com.google.common.collect.ArrayListMultimap; | ||
| 8 | +import org.apache.commons.lang3.StringUtils; | ||
| 9 | +import org.slf4j.Logger; | ||
| 10 | +import org.slf4j.LoggerFactory; | ||
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 12 | +import org.springframework.boot.CommandLineRunner; | ||
| 13 | +import org.springframework.jdbc.core.BatchPreparedStatementSetter; | ||
| 14 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 15 | +import org.springframework.stereotype.Component; | ||
| 16 | +import org.springframework.stereotype.Service; | ||
| 17 | +import org.springframework.transaction.annotation.Transactional; | ||
| 18 | + | ||
| 19 | +import java.sql.PreparedStatement; | ||
| 20 | +import java.sql.SQLException; | ||
| 21 | +import java.util.*; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * 发车信息表处理程序 | ||
| 25 | + * Created by panzhao on 2017/5/5. | ||
| 26 | + */ | ||
| 27 | +@Service | ||
| 28 | +public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo { | ||
| 29 | + | ||
| 30 | + @Autowired | ||
| 31 | + DayOfSchedule dayOfSchedule; | ||
| 32 | + | ||
| 33 | + //班次类型对照表 | ||
| 34 | + Map<String, String> bcTypeMap; | ||
| 35 | + | ||
| 36 | + private static ScheduleComparator.FCSJ schFCSJComparator = new ScheduleComparator.FCSJ(); | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + JdbcTemplate jdbcTemplate; | ||
| 40 | + | ||
| 41 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 全量更新发车信息表 | ||
| 45 | + */ | ||
| 46 | + @Override | ||
| 47 | + public void updateAll() { | ||
| 48 | + Set<String> ks = BasicData.lineCode2NameMap.keySet(); | ||
| 49 | + for (String lineCode : ks) { | ||
| 50 | + update(lineCode); | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @Override | ||
| 55 | + public void update(String lineCode) { | ||
| 56 | + try { | ||
| 57 | + ArrayListMultimap<String, ScheduleRealInfo> lpScheduleMap = dayOfSchedule.getLpScheduleMap(); | ||
| 58 | + List<ScheduleRealInfo> list = new ArrayList<>(); | ||
| 59 | + | ||
| 60 | + Set<String> ks = lpScheduleMap.keySet(); | ||
| 61 | + String prefix = lineCode + "_"; | ||
| 62 | + for (String k : ks) { | ||
| 63 | + if (k.indexOf(prefix) != -1) { | ||
| 64 | + list.addAll(lpScheduleMap.get(k)); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + update(list); | ||
| 69 | + } catch (Exception e) { | ||
| 70 | + logger.error("", e); | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + @Transactional | ||
| 75 | + @Override | ||
| 76 | + public void update(List<ScheduleRealInfo> list) { | ||
| 77 | + if (list.size() == 0) | ||
| 78 | + return; | ||
| 79 | + String lineCode = list.get(0).getXlBm(); | ||
| 80 | + //按上下行分组 | ||
| 81 | + List<ScheduleRealInfo> ups = new ArrayList<>(), downs = new ArrayList<>(); | ||
| 82 | + for (ScheduleRealInfo sch : list) { | ||
| 83 | + if (sch.getXlDir().equals("0")) | ||
| 84 | + ups.add(sch); | ||
| 85 | + else | ||
| 86 | + downs.add(sch); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + ScheduleRealInfo[] upArray = nexts(ups), | ||
| 90 | + downArray = nexts(downs); | ||
| 91 | + | ||
| 92 | + final List<ScheduleRealInfo> pstArray = mergeArray(upArray, downArray); | ||
| 93 | + //删除 | ||
| 94 | + jdbcTemplate.update("delete from bsth_t_clfcxxb where line_code=?", lineCode); | ||
| 95 | + //重新写入 | ||
| 96 | + jdbcTemplate.batchUpdate("insert into bsth_t_clfcxxb(rq, line_code, line_name, lp_name, lp_sn, dfsj, nbbm, cph, bc_type, end_station_name, updown, jGh, jName, remarks, sn)" + | ||
| 97 | + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() { | ||
| 98 | + @Override | ||
| 99 | + public void setValues(PreparedStatement ps, int i) throws SQLException { | ||
| 100 | + ScheduleRealInfo sch = pstArray.get(i); | ||
| 101 | + ps.setString(1, sch.getScheduleDateStr()); | ||
| 102 | + ps.setString(2, sch.getXlBm()); | ||
| 103 | + ps.setString(3, sch.getXlName()); | ||
| 104 | + ps.setString(4, sch.getLpName()); | ||
| 105 | + ps.setInt(5, sch.getFcno()); | ||
| 106 | + ps.setString(6, sch.getDfsj()); | ||
| 107 | + ps.setString(7, sch.getClZbh()); | ||
| 108 | + ps.setString(8, BasicData.nbbmCompanyPlateMap.get(sch.getClZbh())); | ||
| 109 | + ps.setString(9, bcTypeMap.containsKey(sch.getBcType()) ? bcTypeMap.get(sch.getBcType()) : sch.getBcType()); | ||
| 110 | + ps.setString(10, sch.getZdzName()); | ||
| 111 | + ps.setInt(11, Integer.parseInt(sch.getXlDir())); | ||
| 112 | + ps.setString(12, sch.getjGh()); | ||
| 113 | + ps.setString(13, sch.getjName()); | ||
| 114 | + ps.setString(14, sch.getRemarks()); | ||
| 115 | + ps.setInt(15, sch.getFcpSn()); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + @Override | ||
| 119 | + public int getBatchSize() { | ||
| 120 | + return pstArray.size(); | ||
| 121 | + } | ||
| 122 | + }); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + private List<ScheduleRealInfo> mergeArray(ScheduleRealInfo[] upArray, ScheduleRealInfo[] downArray) { | ||
| 126 | + List<ScheduleRealInfo> list = new ArrayList<>(); | ||
| 127 | + for (int i = 0; i < upArray.length; i++) { | ||
| 128 | + if (upArray[i] != null) { | ||
| 129 | + upArray[i].setFcpSn(i + 1); | ||
| 130 | + list.add(upArray[i]); | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + for (int i = 0; i < downArray.length; i++) { | ||
| 134 | + if (downArray[i] != null) { | ||
| 135 | + downArray[i].setFcpSn(i + 1); | ||
| 136 | + list.add(downArray[i]); | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + return list; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + /** | ||
| 143 | + * 接下来要执行的3个班次 | ||
| 144 | + * | ||
| 145 | + * @param list | ||
| 146 | + * @return | ||
| 147 | + */ | ||
| 148 | + private ScheduleRealInfo[] nexts(List<ScheduleRealInfo> list) { | ||
| 149 | + ScheduleRealInfo[] array = new ScheduleRealInfo[3]; | ||
| 150 | + Collections.sort(list, schFCSJComparator); | ||
| 151 | + | ||
| 152 | + int count = 0, threshold = 1000 * 60 * 30; | ||
| 153 | + long t = System.currentTimeMillis(); | ||
| 154 | + for (ScheduleRealInfo sch : list) { | ||
| 155 | + if (count == 3) | ||
| 156 | + break; | ||
| 157 | + | ||
| 158 | + //烂班 | ||
| 159 | + if (sch.isDestroy()) | ||
| 160 | + continue; | ||
| 161 | + | ||
| 162 | + //进场、出场、2点间空驶 | ||
| 163 | + if (sch.getBcType().equals("in") | ||
| 164 | + || sch.getBcType().equals("out") | ||
| 165 | + || sch.getBcType().equals("ldks")) | ||
| 166 | + continue; | ||
| 167 | + | ||
| 168 | + //有实发实达时间的 | ||
| 169 | + if (StringUtils.isNotEmpty(sch.getFcsjActual()) | ||
| 170 | + || StringUtils.isNotEmpty(sch.getZdsjActual())) | ||
| 171 | + continue; | ||
| 172 | + | ||
| 173 | + if (t - sch.getDfsjT() > threshold) | ||
| 174 | + continue; | ||
| 175 | + | ||
| 176 | + array[count] = sch; | ||
| 177 | + count++; | ||
| 178 | + } | ||
| 179 | + return array; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + @Autowired | ||
| 183 | + UpdateInfoThread updateInfoThread; | ||
| 184 | + | ||
| 185 | + @Override | ||
| 186 | + public void run(String... strings) throws Exception { | ||
| 187 | + bcTypeMap = new HashMap<>(); | ||
| 188 | + bcTypeMap.put("normal", "正常班次"); | ||
| 189 | + bcTypeMap.put("region", "区间"); | ||
| 190 | + bcTypeMap.put("venting", "直放"); | ||
| 191 | + bcTypeMap.put("major", "放站"); | ||
| 192 | + bcTypeMap.put("ldks", "两点间空驶"); | ||
| 193 | + //Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS); | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + @Component | ||
| 197 | + private static class UpdateInfoThread extends Thread { | ||
| 198 | + | ||
| 199 | + @Autowired | ||
| 200 | + CarOutInfo carOutInfoHandler; | ||
| 201 | + | ||
| 202 | + @Override | ||
| 203 | + public void run() { | ||
| 204 | + carOutInfoHandler.updateAll(); | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | +} |
src/main/java/com/bsth/data/forecast/ArrivalComparator.java
| 1 | -package com.bsth.data.forecast; | ||
| 2 | - | ||
| 3 | -import com.bsth.data.forecast.entity.ArrivalEntity; | ||
| 4 | - | ||
| 5 | -import java.util.Comparator; | ||
| 6 | - | ||
| 7 | -public class ArrivalComparator implements Comparator<ArrivalEntity>{ | ||
| 8 | - | ||
| 9 | - @Override | ||
| 10 | - public int compare(ArrivalEntity a1, ArrivalEntity a2) { | ||
| 11 | - return (int) (a1.getTs() - a2.getTs()); | ||
| 12 | - } | ||
| 13 | -} | 1 | +package com.bsth.data.forecast; |
| 2 | + | ||
| 3 | +import com.bsth.data.forecast.entity.ArrivalEntity; | ||
| 4 | + | ||
| 5 | +import java.util.Comparator; | ||
| 6 | + | ||
| 7 | +public class ArrivalComparator implements Comparator<ArrivalEntity>{ | ||
| 8 | + | ||
| 9 | + @Override | ||
| 10 | + public int compare(ArrivalEntity a1, ArrivalEntity a2) { | ||
| 11 | + return (int) (a1.getTs() - a2.getTs()); | ||
| 12 | + } | ||
| 13 | +} |
src/main/java/com/bsth/data/forecast/ArrivalDataLoader.java
| 1 | -package com.bsth.data.forecast; | ||
| 2 | - | ||
| 3 | -import com.bsth.data.BasicData; | ||
| 4 | -import com.bsth.data.LineConfigData; | ||
| 5 | -import com.bsth.data.forecast.entity.ArrivalEntity; | ||
| 6 | -import com.bsth.entity.realcontrol.LineConfig; | ||
| 7 | -import com.bsth.util.db.DBUtils_MS; | ||
| 8 | -import org.slf4j.Logger; | ||
| 9 | -import org.slf4j.LoggerFactory; | ||
| 10 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 11 | -import org.springframework.stereotype.Component; | ||
| 12 | - | ||
| 13 | -import java.sql.Connection; | ||
| 14 | -import java.sql.PreparedStatement; | ||
| 15 | -import java.sql.ResultSet; | ||
| 16 | -import java.sql.SQLException; | ||
| 17 | -import java.util.ArrayList; | ||
| 18 | -import java.util.Calendar; | ||
| 19 | -import java.util.Collection; | ||
| 20 | -import java.util.List; | ||
| 21 | - | ||
| 22 | -/** | ||
| 23 | - * | ||
| 24 | - * @ClassName: DataLoader | ||
| 25 | - * @Description: TODO(从数据库加载进出站数据) | ||
| 26 | - * @author PanZhao | ||
| 27 | - * @date 2016年8月19日 上午9:59:21 | ||
| 28 | - * | ||
| 29 | - */ | ||
| 30 | -@Component | ||
| 31 | -public class ArrivalDataLoader { | ||
| 32 | - | ||
| 33 | - private static Long prveLoadTime; | ||
| 34 | - | ||
| 35 | - private final static long DAY_TIME = 1000 * 60 * 60 * 24; | ||
| 36 | - | ||
| 37 | - private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 38 | - | ||
| 39 | - @Autowired | ||
| 40 | - LineConfigData lineConfigData; | ||
| 41 | - | ||
| 42 | - /** | ||
| 43 | - * | ||
| 44 | - * @Title: load | ||
| 45 | - * @Description: TODO(根据上次加载时间,查询之后的增量数据) | ||
| 46 | - */ | ||
| 47 | - public List<ArrivalEntity> load(){ | ||
| 48 | - List<ArrivalEntity> list = null; | ||
| 49 | - | ||
| 50 | - if(null == prveLoadTime) | ||
| 51 | - list = recovery(); | ||
| 52 | - else{ | ||
| 53 | - Calendar cal = Calendar.getInstance(); | ||
| 54 | - //周数,表分区字段 | ||
| 55 | - int weeks_year = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 56 | - | ||
| 57 | - Connection conn = null; | ||
| 58 | - PreparedStatement ps = null; | ||
| 59 | - ResultSet rs = null; | ||
| 60 | - | ||
| 61 | - String sql = "select * from bsth_c_arrival_info where weeks_year=? AND create_timestamp > ? AND create_timestamp <=? AND ABS(create_timestamp - ts) < 3600000 order by create_date"; | ||
| 62 | - try{ | ||
| 63 | - long t = System.currentTimeMillis(); | ||
| 64 | - | ||
| 65 | - conn = DBUtils_MS.getConnection(); | ||
| 66 | - ps = conn.prepareStatement(sql); | ||
| 67 | - ps.setInt(1, weeks_year); | ||
| 68 | - ps.setLong(2, prveLoadTime); | ||
| 69 | - ps.setLong(3, t); | ||
| 70 | - rs = ps.executeQuery(); | ||
| 71 | - | ||
| 72 | - list = resultSet2Set(rs); | ||
| 73 | - | ||
| 74 | - prveLoadTime = t; | ||
| 75 | - }catch(Exception e){ | ||
| 76 | - logger.error("", e); | ||
| 77 | - }finally { | ||
| 78 | - DBUtils_MS.close(rs, ps, conn); | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - return list; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - /** | ||
| 85 | - * | ||
| 86 | - * @Title: recovery | ||
| 87 | - * @Description: TODO(从数据库恢复数据,按照线路的开始运营时间恢复) | ||
| 88 | - */ | ||
| 89 | - public List<ArrivalEntity> recovery(){ | ||
| 90 | - Collection<LineConfig> confs = lineConfigData.getAll(); | ||
| 91 | - long t = System.currentTimeMillis() | ||
| 92 | - ,st; | ||
| 93 | - | ||
| 94 | - List<ArrivalEntity> all = new ArrayList<>(); | ||
| 95 | - for(LineConfig conf : confs){ | ||
| 96 | - st = conf.getCurrStartTime(); | ||
| 97 | - if(t < st) | ||
| 98 | - st = st - DAY_TIME; | ||
| 99 | - try{ | ||
| 100 | - all.addAll(loadByLineAndTime(conf.getLine().getLineCode(), st, t)); | ||
| 101 | - }catch(Exception e){ | ||
| 102 | - logger.error("", e); | ||
| 103 | - } | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - prveLoadTime = t; | ||
| 107 | - return all; | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - /** | ||
| 111 | - * | ||
| 112 | - * @Title: loadByLineAndStartTime | ||
| 113 | - * @Description: TODO(根据线路和时间戳加载数据) | ||
| 114 | - */ | ||
| 115 | - public List<ArrivalEntity> loadByLineAndTime(String lineCode, long st, long et){ | ||
| 116 | - Calendar cal = Calendar.getInstance(); | ||
| 117 | - cal.setTimeInMillis(st); | ||
| 118 | - int weeks_year = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 119 | - | ||
| 120 | - Connection conn = null; | ||
| 121 | - PreparedStatement ps = null; | ||
| 122 | - ResultSet rs = null; | ||
| 123 | - | ||
| 124 | - List<ArrivalEntity> list = new ArrayList<>(); | ||
| 125 | - String sql = "select * from bsth_c_arrival_info where weeks_year=? and line_id=? AND create_timestamp > ? AND create_timestamp <=? AND ABS(create_timestamp - ts) < 3600000 order by ts"; | ||
| 126 | - try{ | ||
| 127 | - conn = DBUtils_MS.getConnection(); | ||
| 128 | - ps = conn.prepareStatement(sql); | ||
| 129 | - ps.setInt(1, weeks_year); | ||
| 130 | - ps.setString(2, lineCode); | ||
| 131 | - ps.setLong(3, st); | ||
| 132 | - ps.setLong(4, et); | ||
| 133 | - rs = ps.executeQuery(); | ||
| 134 | - | ||
| 135 | - list = resultSet2Set(rs); | ||
| 136 | - }catch(Exception e){ | ||
| 137 | - logger.error("", e); | ||
| 138 | - }finally { | ||
| 139 | - DBUtils_MS.close(rs, ps, conn); | ||
| 140 | - } | ||
| 141 | - return list; | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - /** | ||
| 145 | - * | ||
| 146 | - * @Title: loadByLineAndStartTime | ||
| 147 | - * @Description: TODO(根据线路,走向和时间戳加载数据) | ||
| 148 | - */ | ||
| 149 | - public List<ArrivalEntity> loadByLineAndTime(String lineCode, int updown, long st, long et){ | ||
| 150 | - Calendar cal = Calendar.getInstance(); | ||
| 151 | - cal.setTimeInMillis(st); | ||
| 152 | - int weeks_year = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 153 | - | ||
| 154 | - Connection conn = null; | ||
| 155 | - PreparedStatement ps = null; | ||
| 156 | - ResultSet rs = null; | ||
| 157 | - | ||
| 158 | - List<ArrivalEntity> list = new ArrayList<>(); | ||
| 159 | - String sql = "select * from bsth_c_arrival_info where weeks_year=? and line_id=? and up_down=? and in_out=0 AND create_timestamp > ? AND create_timestamp <=? AND ABS(create_timestamp - ts) < 3600000 order by ts"; | ||
| 160 | - try{ | ||
| 161 | - conn = DBUtils_MS.getConnection(); | ||
| 162 | - ps = conn.prepareStatement(sql); | ||
| 163 | - ps.setInt(1, weeks_year); | ||
| 164 | - ps.setString(2, lineCode); | ||
| 165 | - ps.setInt(3, updown); | ||
| 166 | - ps.setLong(4, st); | ||
| 167 | - ps.setLong(5, et); | ||
| 168 | - rs = ps.executeQuery(); | ||
| 169 | - | ||
| 170 | - list = resultSet2Set(rs); | ||
| 171 | - }catch(Exception e){ | ||
| 172 | - logger.error("", e); | ||
| 173 | - }finally { | ||
| 174 | - DBUtils_MS.close(rs, ps, conn); | ||
| 175 | - } | ||
| 176 | - return list; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - public List<ArrivalEntity> resultSet2Set(ResultSet rs) throws SQLException{ | ||
| 180 | - List<ArrivalEntity> list = new ArrayList<>(); | ||
| 181 | - | ||
| 182 | - ArrivalEntity arr; | ||
| 183 | - while(rs.next()){ | ||
| 184 | - arr = new ArrivalEntity(); | ||
| 185 | - arr.setDeviceId(rs.getString("device_id")); | ||
| 186 | - arr.setNbbm(BasicData.deviceId2NbbmMap.get(arr.getDeviceId())); | ||
| 187 | - if(null == arr.getNbbm()){ | ||
| 188 | - logger.warn("未注册的设备号," + arr.getDeviceId()); | ||
| 189 | - continue; | ||
| 190 | - } | ||
| 191 | - | ||
| 192 | - arr.setTs(rs.getLong("ts")); | ||
| 193 | - arr.setLineCode(rs.getString("line_id")); | ||
| 194 | - arr.setUpDown(rs.getInt("up_down")); | ||
| 195 | - arr.setStopNo(rs.getString("stop_no")); | ||
| 196 | - arr.setStopName(BasicData.stationCode2NameMap.get(arr.getStopNo())); | ||
| 197 | - arr.setInOut(rs.getInt("in_out")); | ||
| 198 | - arr.setCreateDate(rs.getLong("create_timestamp")); | ||
| 199 | - arr.setWeeksYear(rs.getInt("weeks_year")); | ||
| 200 | - arr.setEnable(true); | ||
| 201 | - | ||
| 202 | - list.add(arr); | ||
| 203 | - } | ||
| 204 | - return list; | ||
| 205 | - } | ||
| 206 | - | ||
| 207 | - public static void setPrveLoadTime(long t){ | ||
| 208 | - prveLoadTime = t; | ||
| 209 | - } | ||
| 210 | -} | 1 | +package com.bsth.data.forecast; |
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | +import com.bsth.data.LineConfigData; | ||
| 5 | +import com.bsth.data.forecast.entity.ArrivalEntity; | ||
| 6 | +import com.bsth.entity.realcontrol.LineConfig; | ||
| 7 | +import com.bsth.util.db.DBUtils_MS; | ||
| 8 | +import org.slf4j.Logger; | ||
| 9 | +import org.slf4j.LoggerFactory; | ||
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 11 | +import org.springframework.stereotype.Component; | ||
| 12 | + | ||
| 13 | +import java.sql.Connection; | ||
| 14 | +import java.sql.PreparedStatement; | ||
| 15 | +import java.sql.ResultSet; | ||
| 16 | +import java.sql.SQLException; | ||
| 17 | +import java.util.ArrayList; | ||
| 18 | +import java.util.Calendar; | ||
| 19 | +import java.util.Collection; | ||
| 20 | +import java.util.List; | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * | ||
| 24 | + * @ClassName: DataLoader | ||
| 25 | + * @Description: TODO(从数据库加载进出站数据) | ||
| 26 | + * @author PanZhao | ||
| 27 | + * @date 2016年8月19日 上午9:59:21 | ||
| 28 | + * | ||
| 29 | + */ | ||
| 30 | +@Component | ||
| 31 | +public class ArrivalDataLoader { | ||
| 32 | + | ||
| 33 | + private static Long prveLoadTime; | ||
| 34 | + | ||
| 35 | + private final static long DAY_TIME = 1000 * 60 * 60 * 24; | ||
| 36 | + | ||
| 37 | + private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 38 | + | ||
| 39 | + @Autowired | ||
| 40 | + LineConfigData lineConfigData; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * | ||
| 44 | + * @Title: load | ||
| 45 | + * @Description: TODO(根据上次加载时间,查询之后的增量数据) | ||
| 46 | + */ | ||
| 47 | + public List<ArrivalEntity> load(){ | ||
| 48 | + List<ArrivalEntity> list = null; | ||
| 49 | + | ||
| 50 | + if(null == prveLoadTime) | ||
| 51 | + list = recovery(); | ||
| 52 | + else{ | ||
| 53 | + Calendar cal = Calendar.getInstance(); | ||
| 54 | + //周数,表分区字段 | ||
| 55 | + int weeks_year = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 56 | + | ||
| 57 | + Connection conn = null; | ||
| 58 | + PreparedStatement ps = null; | ||
| 59 | + ResultSet rs = null; | ||
| 60 | + | ||
| 61 | + String sql = "select * from bsth_c_arrival_info where weeks_year=? AND create_timestamp > ? AND create_timestamp <=? AND ABS(create_timestamp - ts) < 3600000 order by create_date"; | ||
| 62 | + try{ | ||
| 63 | + long t = System.currentTimeMillis(); | ||
| 64 | + | ||
| 65 | + conn = DBUtils_MS.getConnection(); | ||
| 66 | + ps = conn.prepareStatement(sql); | ||
| 67 | + ps.setInt(1, weeks_year); | ||
| 68 | + ps.setLong(2, prveLoadTime); | ||
| 69 | + ps.setLong(3, t); | ||
| 70 | + rs = ps.executeQuery(); | ||
| 71 | + | ||
| 72 | + list = resultSet2Set(rs); | ||
| 73 | + | ||
| 74 | + prveLoadTime = t; | ||
| 75 | + }catch(Exception e){ | ||
| 76 | + logger.error("", e); | ||
| 77 | + }finally { | ||
| 78 | + DBUtils_MS.close(rs, ps, conn); | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + return list; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * | ||
| 86 | + * @Title: recovery | ||
| 87 | + * @Description: TODO(从数据库恢复数据,按照线路的开始运营时间恢复) | ||
| 88 | + */ | ||
| 89 | + public List<ArrivalEntity> recovery(){ | ||
| 90 | + Collection<LineConfig> confs = lineConfigData.getAll(); | ||
| 91 | + long t = System.currentTimeMillis() | ||
| 92 | + ,st; | ||
| 93 | + | ||
| 94 | + List<ArrivalEntity> all = new ArrayList<>(); | ||
| 95 | + for(LineConfig conf : confs){ | ||
| 96 | + st = conf.getCurrStartTime(); | ||
| 97 | + if(t < st) | ||
| 98 | + st = st - DAY_TIME; | ||
| 99 | + try{ | ||
| 100 | + all.addAll(loadByLineAndTime(conf.getLine().getLineCode(), st, t)); | ||
| 101 | + }catch(Exception e){ | ||
| 102 | + logger.error("", e); | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + prveLoadTime = t; | ||
| 107 | + return all; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * | ||
| 112 | + * @Title: loadByLineAndStartTime | ||
| 113 | + * @Description: TODO(根据线路和时间戳加载数据) | ||
| 114 | + */ | ||
| 115 | + public List<ArrivalEntity> loadByLineAndTime(String lineCode, long st, long et){ | ||
| 116 | + Calendar cal = Calendar.getInstance(); | ||
| 117 | + cal.setTimeInMillis(st); | ||
| 118 | + int weeks_year = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 119 | + | ||
| 120 | + Connection conn = null; | ||
| 121 | + PreparedStatement ps = null; | ||
| 122 | + ResultSet rs = null; | ||
| 123 | + | ||
| 124 | + List<ArrivalEntity> list = new ArrayList<>(); | ||
| 125 | + String sql = "select * from bsth_c_arrival_info where weeks_year=? and line_id=? AND create_timestamp > ? AND create_timestamp <=? AND ABS(create_timestamp - ts) < 3600000 order by ts"; | ||
| 126 | + try{ | ||
| 127 | + conn = DBUtils_MS.getConnection(); | ||
| 128 | + ps = conn.prepareStatement(sql); | ||
| 129 | + ps.setInt(1, weeks_year); | ||
| 130 | + ps.setString(2, lineCode); | ||
| 131 | + ps.setLong(3, st); | ||
| 132 | + ps.setLong(4, et); | ||
| 133 | + rs = ps.executeQuery(); | ||
| 134 | + | ||
| 135 | + list = resultSet2Set(rs); | ||
| 136 | + }catch(Exception e){ | ||
| 137 | + logger.error("", e); | ||
| 138 | + }finally { | ||
| 139 | + DBUtils_MS.close(rs, ps, conn); | ||
| 140 | + } | ||
| 141 | + return list; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + /** | ||
| 145 | + * | ||
| 146 | + * @Title: loadByLineAndStartTime | ||
| 147 | + * @Description: TODO(根据线路,走向和时间戳加载数据) | ||
| 148 | + */ | ||
| 149 | + public List<ArrivalEntity> loadByLineAndTime(String lineCode, int updown, long st, long et){ | ||
| 150 | + Calendar cal = Calendar.getInstance(); | ||
| 151 | + cal.setTimeInMillis(st); | ||
| 152 | + int weeks_year = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 153 | + | ||
| 154 | + Connection conn = null; | ||
| 155 | + PreparedStatement ps = null; | ||
| 156 | + ResultSet rs = null; | ||
| 157 | + | ||
| 158 | + List<ArrivalEntity> list = new ArrayList<>(); | ||
| 159 | + String sql = "select * from bsth_c_arrival_info where weeks_year=? and line_id=? and up_down=? and in_out=0 AND create_timestamp > ? AND create_timestamp <=? AND ABS(create_timestamp - ts) < 3600000 order by ts"; | ||
| 160 | + try{ | ||
| 161 | + conn = DBUtils_MS.getConnection(); | ||
| 162 | + ps = conn.prepareStatement(sql); | ||
| 163 | + ps.setInt(1, weeks_year); | ||
| 164 | + ps.setString(2, lineCode); | ||
| 165 | + ps.setInt(3, updown); | ||
| 166 | + ps.setLong(4, st); | ||
| 167 | + ps.setLong(5, et); | ||
| 168 | + rs = ps.executeQuery(); | ||
| 169 | + | ||
| 170 | + list = resultSet2Set(rs); | ||
| 171 | + }catch(Exception e){ | ||
| 172 | + logger.error("", e); | ||
| 173 | + }finally { | ||
| 174 | + DBUtils_MS.close(rs, ps, conn); | ||
| 175 | + } | ||
| 176 | + return list; | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + public List<ArrivalEntity> resultSet2Set(ResultSet rs) throws SQLException{ | ||
| 180 | + List<ArrivalEntity> list = new ArrayList<>(); | ||
| 181 | + | ||
| 182 | + ArrivalEntity arr; | ||
| 183 | + while(rs.next()){ | ||
| 184 | + arr = new ArrivalEntity(); | ||
| 185 | + arr.setDeviceId(rs.getString("device_id")); | ||
| 186 | + arr.setNbbm(BasicData.deviceId2NbbmMap.get(arr.getDeviceId())); | ||
| 187 | + if(null == arr.getNbbm()){ | ||
| 188 | + logger.warn("未注册的设备号," + arr.getDeviceId()); | ||
| 189 | + continue; | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + arr.setTs(rs.getLong("ts")); | ||
| 193 | + arr.setLineCode(rs.getString("line_id")); | ||
| 194 | + arr.setUpDown(rs.getInt("up_down")); | ||
| 195 | + arr.setStopNo(rs.getString("stop_no")); | ||
| 196 | + arr.setStopName(BasicData.stationCode2NameMap.get(arr.getStopNo())); | ||
| 197 | + arr.setInOut(rs.getInt("in_out")); | ||
| 198 | + arr.setCreateDate(rs.getLong("create_timestamp")); | ||
| 199 | + arr.setWeeksYear(rs.getInt("weeks_year")); | ||
| 200 | + arr.setEnable(true); | ||
| 201 | + | ||
| 202 | + list.add(arr); | ||
| 203 | + } | ||
| 204 | + return list; | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + public static void setPrveLoadTime(long t){ | ||
| 208 | + prveLoadTime = t; | ||
| 209 | + } | ||
| 210 | +} |
src/main/java/com/bsth/data/forecast/entity/ArrivalEntity.java
| 1 | -package com.bsth.data.forecast.entity; | ||
| 2 | - | ||
| 3 | -import com.bsth.data.BasicData; | ||
| 4 | - | ||
| 5 | -import java.text.SimpleDateFormat; | ||
| 6 | -import java.util.Date; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * | ||
| 10 | - * @ClassName: ArrivalEntity | ||
| 11 | - * @Description: TODO(进出站实体) | ||
| 12 | - * @author PanZhao | ||
| 13 | - * @date 2016年8月19日 上午9:32:20 | ||
| 14 | - * | ||
| 15 | - */ | ||
| 16 | -public class ArrivalEntity { | ||
| 17 | - | ||
| 18 | - /** 设备号*/ | ||
| 19 | - private String deviceId; | ||
| 20 | - | ||
| 21 | - private String nbbm; | ||
| 22 | - | ||
| 23 | - /** 站点名称 */ | ||
| 24 | - private String stopName; | ||
| 25 | - | ||
| 26 | - /** 时间戳*/ | ||
| 27 | - private Long ts; | ||
| 28 | - | ||
| 29 | - /** 线路编码*/ | ||
| 30 | - private String lineCode; | ||
| 31 | - | ||
| 32 | - /** 上下行*/ | ||
| 33 | - private Integer upDown; | ||
| 34 | - | ||
| 35 | - /**站点编码*/ | ||
| 36 | - private String stopNo; | ||
| 37 | - | ||
| 38 | - /** 0: 进 1:出*/ | ||
| 39 | - private Integer inOut; | ||
| 40 | - | ||
| 41 | - private Long createDate; | ||
| 42 | - | ||
| 43 | - /** 是否有效 */ | ||
| 44 | - private boolean enable; | ||
| 45 | - | ||
| 46 | - /**分区字段,当年的第几周*/ | ||
| 47 | - private Integer weeksYear; | ||
| 48 | - | ||
| 49 | - private boolean tcc; | ||
| 50 | - | ||
| 51 | - //是否被纠正 | ||
| 52 | - private boolean correct; | ||
| 53 | - | ||
| 54 | - private String correctText; | ||
| 55 | - | ||
| 56 | - /** -1 则信号有效,但程序标记为不使用 */ | ||
| 57 | - private int flag = 0; | ||
| 58 | - | ||
| 59 | - public ArrivalEntity(){} | ||
| 60 | - | ||
| 61 | - public ArrivalEntity(String deviceId, long ts, String lineCode, int upDown, String stopNo, int inOut, long createDate, | ||
| 62 | - int weeksYear, String stopName) { | ||
| 63 | - | ||
| 64 | - this.deviceId = deviceId; | ||
| 65 | - this.ts = ts; | ||
| 66 | - this.lineCode = lineCode; | ||
| 67 | - this.upDown = upDown; | ||
| 68 | - this.stopNo = stopNo; | ||
| 69 | - this.stopName = stopName; | ||
| 70 | - this.inOut = inOut; | ||
| 71 | - this.createDate = createDate; | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | -/* @Override | ||
| 75 | - public boolean equals(Object obj) { | ||
| 76 | - ArrivalEntity a2 = (ArrivalEntity)obj; | ||
| 77 | - | ||
| 78 | - return this.toString().equals(a2.toString()) | ||
| 79 | - && Math.abs(this.ts - a2.ts) < EQ_RANGE; | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - @Override | ||
| 83 | - public int hashCode() { | ||
| 84 | - return this.toString().hashCode(); | ||
| 85 | - }*/ | ||
| 86 | - | ||
| 87 | - | ||
| 88 | - @Override | ||
| 89 | - public String toString() { | ||
| 90 | - try { | ||
| 91 | - SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm"); | ||
| 92 | - return "["+BasicData.deviceId2NbbmMap.get(this.deviceId)+", "+sdfHHmm.format(new Date(this.ts)) | ||
| 93 | - +","+(this.getUpDown()==0?"上行":"下行")+","+(this.inOut==0?"进":"出")+","+this.stopNo+" ("+this.stopName+")]"; | ||
| 94 | - } catch (Exception e) { | ||
| 95 | - return ""; | ||
| 96 | - } | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - public String getLineCode() { | ||
| 100 | - return lineCode; | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - public void setLineCode(String lineCode) { | ||
| 104 | - this.lineCode = lineCode; | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - public Integer getUpDown() { | ||
| 108 | - return upDown; | ||
| 109 | - } | ||
| 110 | - | ||
| 111 | - public void setUpDown(Integer upDown) { | ||
| 112 | - this.upDown = upDown; | ||
| 113 | - } | ||
| 114 | - | ||
| 115 | - public String getStopNo() { | ||
| 116 | - return stopNo; | ||
| 117 | - } | ||
| 118 | - | ||
| 119 | - public void setStopNo(String stopNo) { | ||
| 120 | - this.stopNo = stopNo; | ||
| 121 | - } | ||
| 122 | - | ||
| 123 | - public Integer getInOut() { | ||
| 124 | - return inOut; | ||
| 125 | - } | ||
| 126 | - | ||
| 127 | - public void setInOut(Integer inOut) { | ||
| 128 | - this.inOut = inOut; | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - public Long getCreateDate() { | ||
| 132 | - return createDate; | ||
| 133 | - } | ||
| 134 | - | ||
| 135 | - public void setCreateDate(Long createDate) { | ||
| 136 | - this.createDate = createDate; | ||
| 137 | - } | ||
| 138 | - | ||
| 139 | - public Integer getWeeksYear() { | ||
| 140 | - return weeksYear; | ||
| 141 | - } | ||
| 142 | - | ||
| 143 | - public void setWeeksYear(Integer weeksYear) { | ||
| 144 | - this.weeksYear = weeksYear; | ||
| 145 | - } | ||
| 146 | - | ||
| 147 | - public String getDeviceId() { | ||
| 148 | - return deviceId; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - public void setDeviceId(String deviceId) { | ||
| 152 | - this.deviceId = deviceId; | ||
| 153 | - } | ||
| 154 | - | ||
| 155 | - public Long getTs() { | ||
| 156 | - return ts; | ||
| 157 | - } | ||
| 158 | - | ||
| 159 | - public void setTs(Long ts) { | ||
| 160 | - this.ts = ts; | ||
| 161 | - } | ||
| 162 | - | ||
| 163 | - public String getStopName() { | ||
| 164 | - return stopName; | ||
| 165 | - } | ||
| 166 | - | ||
| 167 | - public void setStopName(String stopName) { | ||
| 168 | - this.stopName = stopName; | ||
| 169 | - } | ||
| 170 | - | ||
| 171 | - public String getId(){ | ||
| 172 | - return this.deviceId + "_" + this.ts; | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | - public String getNbbm() { | ||
| 176 | - return nbbm; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - public void setNbbm(String nbbm) { | ||
| 180 | - this.nbbm = nbbm; | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | - public boolean isEnable() { | ||
| 184 | - return enable; | ||
| 185 | - } | ||
| 186 | - | ||
| 187 | - public void setEnable(boolean enable) { | ||
| 188 | - this.enable = enable; | ||
| 189 | - } | ||
| 190 | - | ||
| 191 | - public boolean isTcc() { | ||
| 192 | - return tcc; | ||
| 193 | - } | ||
| 194 | - | ||
| 195 | - public void setTcc(boolean tcc) { | ||
| 196 | - this.tcc = tcc; | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - public boolean isOutTcc() { | ||
| 200 | - return isTcc() && inOut == 1; | ||
| 201 | - } | ||
| 202 | - | ||
| 203 | - public boolean isCorrect() { | ||
| 204 | - return correct; | ||
| 205 | - } | ||
| 206 | - | ||
| 207 | - public void setCorrect(boolean correct) { | ||
| 208 | - this.correct = correct; | ||
| 209 | - } | ||
| 210 | - | ||
| 211 | - public String getCorrectText() { | ||
| 212 | - return correctText; | ||
| 213 | - } | ||
| 214 | - | ||
| 215 | - public void setCorrectText(String correctText) { | ||
| 216 | - this.correctText = correctText; | ||
| 217 | - } | ||
| 218 | - | ||
| 219 | - public Integer getFlag() { | ||
| 220 | - return flag; | ||
| 221 | - } | ||
| 222 | - | ||
| 223 | - public void setFlag(Integer flag) { | ||
| 224 | - this.flag = flag; | ||
| 225 | - } | ||
| 226 | -} | 1 | +package com.bsth.data.forecast.entity; |
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | + | ||
| 5 | +import java.text.SimpleDateFormat; | ||
| 6 | +import java.util.Date; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * | ||
| 10 | + * @ClassName: ArrivalEntity | ||
| 11 | + * @Description: TODO(进出站实体) | ||
| 12 | + * @author PanZhao | ||
| 13 | + * @date 2016年8月19日 上午9:32:20 | ||
| 14 | + * | ||
| 15 | + */ | ||
| 16 | +public class ArrivalEntity { | ||
| 17 | + | ||
| 18 | + /** 设备号*/ | ||
| 19 | + private String deviceId; | ||
| 20 | + | ||
| 21 | + private String nbbm; | ||
| 22 | + | ||
| 23 | + /** 站点名称 */ | ||
| 24 | + private String stopName; | ||
| 25 | + | ||
| 26 | + /** 时间戳*/ | ||
| 27 | + private Long ts; | ||
| 28 | + | ||
| 29 | + /** 线路编码*/ | ||
| 30 | + private String lineCode; | ||
| 31 | + | ||
| 32 | + /** 上下行*/ | ||
| 33 | + private Integer upDown; | ||
| 34 | + | ||
| 35 | + /**站点编码*/ | ||
| 36 | + private String stopNo; | ||
| 37 | + | ||
| 38 | + /** 0: 进 1:出*/ | ||
| 39 | + private Integer inOut; | ||
| 40 | + | ||
| 41 | + private Long createDate; | ||
| 42 | + | ||
| 43 | + /** 是否有效 */ | ||
| 44 | + private boolean enable; | ||
| 45 | + | ||
| 46 | + /**分区字段,当年的第几周*/ | ||
| 47 | + private Integer weeksYear; | ||
| 48 | + | ||
| 49 | + private boolean tcc; | ||
| 50 | + | ||
| 51 | + //是否被纠正 | ||
| 52 | + private boolean correct; | ||
| 53 | + | ||
| 54 | + private String correctText; | ||
| 55 | + | ||
| 56 | + /** -1 则信号有效,但程序标记为不使用 */ | ||
| 57 | + private int flag = 0; | ||
| 58 | + | ||
| 59 | + public ArrivalEntity(){} | ||
| 60 | + | ||
| 61 | + public ArrivalEntity(String deviceId, long ts, String lineCode, int upDown, String stopNo, int inOut, long createDate, | ||
| 62 | + int weeksYear, String stopName) { | ||
| 63 | + | ||
| 64 | + this.deviceId = deviceId; | ||
| 65 | + this.ts = ts; | ||
| 66 | + this.lineCode = lineCode; | ||
| 67 | + this.upDown = upDown; | ||
| 68 | + this.stopNo = stopNo; | ||
| 69 | + this.stopName = stopName; | ||
| 70 | + this.inOut = inOut; | ||
| 71 | + this.createDate = createDate; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | +/* @Override | ||
| 75 | + public boolean equals(Object obj) { | ||
| 76 | + ArrivalEntity a2 = (ArrivalEntity)obj; | ||
| 77 | + | ||
| 78 | + return this.toString().equals(a2.toString()) | ||
| 79 | + && Math.abs(this.ts - a2.ts) < EQ_RANGE; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + @Override | ||
| 83 | + public int hashCode() { | ||
| 84 | + return this.toString().hashCode(); | ||
| 85 | + }*/ | ||
| 86 | + | ||
| 87 | + | ||
| 88 | + @Override | ||
| 89 | + public String toString() { | ||
| 90 | + try { | ||
| 91 | + SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm"); | ||
| 92 | + return "["+BasicData.deviceId2NbbmMap.get(this.deviceId)+", "+sdfHHmm.format(new Date(this.ts)) | ||
| 93 | + +","+(this.getUpDown()==0?"上行":"下行")+","+(this.inOut==0?"进":"出")+","+this.stopNo+" ("+this.stopName+")]"; | ||
| 94 | + } catch (Exception e) { | ||
| 95 | + return ""; | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + public String getLineCode() { | ||
| 100 | + return lineCode; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + public void setLineCode(String lineCode) { | ||
| 104 | + this.lineCode = lineCode; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + public Integer getUpDown() { | ||
| 108 | + return upDown; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + public void setUpDown(Integer upDown) { | ||
| 112 | + this.upDown = upDown; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + public String getStopNo() { | ||
| 116 | + return stopNo; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + public void setStopNo(String stopNo) { | ||
| 120 | + this.stopNo = stopNo; | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + public Integer getInOut() { | ||
| 124 | + return inOut; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + public void setInOut(Integer inOut) { | ||
| 128 | + this.inOut = inOut; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + public Long getCreateDate() { | ||
| 132 | + return createDate; | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + public void setCreateDate(Long createDate) { | ||
| 136 | + this.createDate = createDate; | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + public Integer getWeeksYear() { | ||
| 140 | + return weeksYear; | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + public void setWeeksYear(Integer weeksYear) { | ||
| 144 | + this.weeksYear = weeksYear; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + public String getDeviceId() { | ||
| 148 | + return deviceId; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + public void setDeviceId(String deviceId) { | ||
| 152 | + this.deviceId = deviceId; | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + public Long getTs() { | ||
| 156 | + return ts; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + public void setTs(Long ts) { | ||
| 160 | + this.ts = ts; | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + public String getStopName() { | ||
| 164 | + return stopName; | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + public void setStopName(String stopName) { | ||
| 168 | + this.stopName = stopName; | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + public String getId(){ | ||
| 172 | + return this.deviceId + "_" + this.ts; | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + public String getNbbm() { | ||
| 176 | + return nbbm; | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + public void setNbbm(String nbbm) { | ||
| 180 | + this.nbbm = nbbm; | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + public boolean isEnable() { | ||
| 184 | + return enable; | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + public void setEnable(boolean enable) { | ||
| 188 | + this.enable = enable; | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + public boolean isTcc() { | ||
| 192 | + return tcc; | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + public void setTcc(boolean tcc) { | ||
| 196 | + this.tcc = tcc; | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + public boolean isOutTcc() { | ||
| 200 | + return isTcc() && inOut == 1; | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + public boolean isCorrect() { | ||
| 204 | + return correct; | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + public void setCorrect(boolean correct) { | ||
| 208 | + this.correct = correct; | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + public String getCorrectText() { | ||
| 212 | + return correctText; | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + public void setCorrectText(String correctText) { | ||
| 216 | + this.correctText = correctText; | ||
| 217 | + } | ||
| 218 | + | ||
| 219 | + public Integer getFlag() { | ||
| 220 | + return flag; | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + public void setFlag(Integer flag) { | ||
| 224 | + this.flag = flag; | ||
| 225 | + } | ||
| 226 | +} |
src/main/java/com/bsth/data/gpsdata/client/ClientApp.java
| @@ -21,6 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -21,6 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
| 21 | import org.springframework.stereotype.Component; | 21 | import org.springframework.stereotype.Component; |
| 22 | 22 | ||
| 23 | import java.net.InetSocketAddress; | 23 | import java.net.InetSocketAddress; |
| 24 | +import java.util.concurrent.Executors; | ||
| 25 | +import java.util.concurrent.ScheduledExecutorService; | ||
| 26 | +import java.util.concurrent.ThreadFactory; | ||
| 27 | +import java.util.concurrent.TimeUnit; | ||
| 24 | 28 | ||
| 25 | /** | 29 | /** |
| 26 | * Created by panzhao on 2017/5/4. | 30 | * Created by panzhao on 2017/5/4. |
| @@ -40,6 +44,17 @@ public class ClientApp { | @@ -40,6 +44,17 @@ public class ClientApp { | ||
| 40 | 44 | ||
| 41 | static Logger logger = LoggerFactory.getLogger(ClientApp.class); | 45 | static Logger logger = LoggerFactory.getLogger(ClientApp.class); |
| 42 | 46 | ||
| 47 | + private ScheduledExecutorService sexec = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() { | ||
| 48 | + | ||
| 49 | + @Override | ||
| 50 | + public Thread newThread(Runnable r) { | ||
| 51 | + // TODO Auto-generated method stub | ||
| 52 | + Thread t = new Thread(r); | ||
| 53 | + t.setName("SessionCheckExecutor"); | ||
| 54 | + return t; | ||
| 55 | + } | ||
| 56 | + }); | ||
| 57 | + | ||
| 43 | public static boolean dconnect(String device) { | 58 | public static boolean dconnect(String device) { |
| 44 | boolean flag = false; | 59 | boolean flag = false; |
| 45 | try { | 60 | try { |
| @@ -62,6 +77,7 @@ public class ClientApp { | @@ -62,6 +77,7 @@ public class ClientApp { | ||
| 62 | flag = true; | 77 | flag = true; |
| 63 | 78 | ||
| 64 | logger.info("dconnect..."); | 79 | logger.info("dconnect..."); |
| 80 | + pdSession = session; | ||
| 65 | //SessionManager.getInstance().register(device, session); | 81 | //SessionManager.getInstance().register(device, session); |
| 66 | } catch (Exception e) { | 82 | } catch (Exception e) { |
| 67 | e.printStackTrace(); | 83 | e.printStackTrace(); |
| @@ -69,6 +85,14 @@ public class ClientApp { | @@ -69,6 +85,14 @@ public class ClientApp { | ||
| 69 | return flag; | 85 | return flag; |
| 70 | } | 86 | } |
| 71 | 87 | ||
| 88 | + public static void pdreconn(){ | ||
| 89 | + dconnect(ConfigUtil.get("forward.device.name")); | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public static void pfreconn(){ | ||
| 93 | + fconnect(ConfigUtil.get("forward.device.name")); | ||
| 94 | + } | ||
| 95 | + | ||
| 72 | public static boolean fconnect(String device) { | 96 | public static boolean fconnect(String device) { |
| 73 | boolean flag = false; | 97 | boolean flag = false; |
| 74 | try { | 98 | try { |
| @@ -79,6 +103,7 @@ public class ClientApp { | @@ -79,6 +103,7 @@ public class ClientApp { | ||
| 79 | flag = true; | 103 | flag = true; |
| 80 | 104 | ||
| 81 | logger.info("fconnect..."); | 105 | logger.info("fconnect..."); |
| 106 | + pfSession = session; | ||
| 82 | } catch (Exception e) { | 107 | } catch (Exception e) { |
| 83 | e.printStackTrace(); | 108 | e.printStackTrace(); |
| 84 | } | 109 | } |
| @@ -87,7 +112,7 @@ public class ClientApp { | @@ -87,7 +112,7 @@ public class ClientApp { | ||
| 87 | 112 | ||
| 88 | public void init() { | 113 | public void init() { |
| 89 | //exec = Executors.newFixedThreadPool(4); | 114 | //exec = Executors.newFixedThreadPool(4); |
| 90 | - //sexec.scheduleAtFixedRate(new SessionChecker(), 1, 1, TimeUnit.MINUTES); | 115 | + sexec.scheduleAtFixedRate(new SessionChecker(), 1, 1, TimeUnit.MINUTES); |
| 91 | /*******************************浦东********************************/ | 116 | /*******************************浦东********************************/ |
| 92 | pdDataConnector = new NioSocketConnector(); | 117 | pdDataConnector = new NioSocketConnector(); |
| 93 | 118 | ||
| @@ -133,4 +158,30 @@ public class ClientApp { | @@ -133,4 +158,30 @@ public class ClientApp { | ||
| 133 | 158 | ||
| 134 | gpsBeforeBuffer.init(); | 159 | gpsBeforeBuffer.init(); |
| 135 | } | 160 | } |
| 161 | + | ||
| 162 | + | ||
| 163 | + static IoSession pdSession; | ||
| 164 | + static IoSession pfSession; | ||
| 165 | + final class SessionChecker implements Runnable { | ||
| 166 | + | ||
| 167 | + @Override | ||
| 168 | + public void run() { | ||
| 169 | + // TODO Auto-generated method stub | ||
| 170 | + try { | ||
| 171 | + | ||
| 172 | + if(!pdSession.isActive()){ | ||
| 173 | + logger.warn("浦东设备注销"); | ||
| 174 | + ClientApp.pdreconn(); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + if(!pfSession.isActive()){ | ||
| 178 | + logger.warn("浦东转发设备注销"); | ||
| 179 | + ClientApp.pfreconn(); | ||
| 180 | + } | ||
| 181 | + } catch (Exception e) { | ||
| 182 | + logger.error("SessionChecker异常", e); | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + } | ||
| 136 | } | 187 | } |
| 137 | \ No newline at end of file | 188 | \ No newline at end of file |
src/main/java/com/bsth/data/gpsdata/client/DataMonitor.java
0 → 100644
src/main/java/com/bsth/data/gpsdata/client/GpsBeforeBuffer.java
| 1 | -package com.bsth.data.gpsdata.client; | ||
| 2 | - | ||
| 3 | -import com.bsth.Application; | ||
| 4 | -import com.bsth.data.BasicData; | ||
| 5 | -import com.bsth.data.gpsdata.GpsEntity; | ||
| 6 | -import com.bsth.data.gpsdata.arrival.GpsRealAnalyse; | ||
| 7 | -import com.bsth.data.gpsdata.client.pd.protocol.BasicInfo; | ||
| 8 | -import org.apache.commons.lang3.StringUtils; | ||
| 9 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | -import org.springframework.stereotype.Component; | ||
| 11 | - | ||
| 12 | -import java.util.ArrayList; | ||
| 13 | -import java.util.LinkedList; | ||
| 14 | -import java.util.List; | ||
| 15 | -import java.util.concurrent.TimeUnit; | ||
| 16 | - | ||
| 17 | -/** | ||
| 18 | - * 从 socket client 到 .. 的缓冲 | ||
| 19 | - * Created by panzhao on 2017/5/4. | ||
| 20 | - */ | ||
| 21 | -@Component | ||
| 22 | -public class GpsBeforeBuffer { | ||
| 23 | - | ||
| 24 | - static LinkedList<GpsEntity> linkedList = new LinkedList<>(); | ||
| 25 | - | ||
| 26 | - @Autowired | ||
| 27 | - GpsHandleThread gpsHandleThread; | ||
| 28 | - | ||
| 29 | - public void put(BasicInfo basicInfo){ | ||
| 30 | - //放弃补发数据 | ||
| 31 | - byte cacheData = getCacheState(basicInfo.getServiceState()); | ||
| 32 | - if(cacheData == 1) | ||
| 33 | - return; | ||
| 34 | - GpsEntity gps = new GpsEntity(); | ||
| 35 | - | ||
| 36 | - gps.setDeviceId(basicInfo.getDeviceId()); | ||
| 37 | - gps.setTimestamp(basicInfo.getTimestamp()); | ||
| 38 | - gps.setLat(basicInfo.getLat()); | ||
| 39 | - gps.setLon(basicInfo.getLon()); | ||
| 40 | - gps.setDirection((float)basicInfo.getDirection() / 10); | ||
| 41 | - gps.setValid(basicInfo.getGpsValid()); | ||
| 42 | - gps.setCompanyCode(basicInfo.getCompanyCode()); | ||
| 43 | - gps.setStopNo(basicInfo.getStopNo()); | ||
| 44 | - gps.setUpDown(basicInfo.getUpOrDown()); | ||
| 45 | - gps.setSpeed((float)basicInfo.getSpeedGps() / 10); | ||
| 46 | - gps.setLineId(String.valueOf(basicInfo.getLineId())); | ||
| 47 | - gps.setState((int) getService(basicInfo.getServiceState())); | ||
| 48 | - //没有设备号 | ||
| 49 | - if (StringUtils.isBlank(gps.getDeviceId())) | ||
| 50 | - return; | ||
| 51 | - | ||
| 52 | - String nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | ||
| 53 | - if (StringUtils.isBlank(nbbm)) | ||
| 54 | - gps.setIncomplete(true); | ||
| 55 | - else | ||
| 56 | - gps.setNbbm(nbbm); | ||
| 57 | - | ||
| 58 | - linkedList.addLast(gps); | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - public byte getCacheState(long serviceState) { | ||
| 62 | - return (byte)(((serviceState & 0x00100000) == 0x00100000) ? 1 : 0); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - public void init(){ | ||
| 66 | - Application.mainServices.scheduleWithFixedDelay(gpsHandleThread, 20 * 1000, 1100, TimeUnit.MILLISECONDS); | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - @Component | ||
| 70 | - public static class GpsHandleThread extends Thread{ | ||
| 71 | - | ||
| 72 | - List<GpsEntity> list; | ||
| 73 | - | ||
| 74 | - @Autowired | ||
| 75 | - GpsRealAnalyse gpsRealAnalyse; | ||
| 76 | - | ||
| 77 | - @Override | ||
| 78 | - public void run() { | ||
| 79 | - list = new ArrayList<>(100); | ||
| 80 | - | ||
| 81 | - GpsEntity gps; | ||
| 82 | - for(int i = 0; i < 2000; i ++){ | ||
| 83 | - gps = linkedList.poll(); | ||
| 84 | - if(gps == null) | ||
| 85 | - break; | ||
| 86 | - list.add(gps); | ||
| 87 | - } | ||
| 88 | - | ||
| 89 | - gpsRealAnalyse.analyse(list); | ||
| 90 | - } | ||
| 91 | - } | ||
| 92 | - | ||
| 93 | - /** | ||
| 94 | - * 获取运营状态 | ||
| 95 | - * | ||
| 96 | - * @return -1无效 0运营 1未运营 | ||
| 97 | - */ | ||
| 98 | - public static byte getService(long serviceState) { | ||
| 99 | - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000) | ||
| 100 | - return -1; | ||
| 101 | - return (byte) (((serviceState & 0x02000000) == 0x02000000) ? 1 : 0); | ||
| 102 | - } | 1 | +package com.bsth.data.gpsdata.client; |
| 2 | + | ||
| 3 | +import com.bsth.Application; | ||
| 4 | +import com.bsth.data.BasicData; | ||
| 5 | +import com.bsth.data.gpsdata.GpsEntity; | ||
| 6 | +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse; | ||
| 7 | +import com.bsth.data.gpsdata.client.pd.protocol.BasicInfo; | ||
| 8 | +import org.apache.commons.lang3.StringUtils; | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.stereotype.Component; | ||
| 11 | + | ||
| 12 | +import java.util.ArrayList; | ||
| 13 | +import java.util.LinkedList; | ||
| 14 | +import java.util.List; | ||
| 15 | +import java.util.concurrent.TimeUnit; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 从 socket client 到 .. 的缓冲 | ||
| 19 | + * Created by panzhao on 2017/5/4. | ||
| 20 | + */ | ||
| 21 | +@Component | ||
| 22 | +public class GpsBeforeBuffer { | ||
| 23 | + | ||
| 24 | + static LinkedList<GpsEntity> linkedList = new LinkedList<>(); | ||
| 25 | + | ||
| 26 | + @Autowired | ||
| 27 | + GpsHandleThread gpsHandleThread; | ||
| 28 | + | ||
| 29 | + public void put(BasicInfo basicInfo){ | ||
| 30 | + //放弃补发数据 | ||
| 31 | + byte cacheData = getCacheState(basicInfo.getServiceState()); | ||
| 32 | + if(cacheData == 1) | ||
| 33 | + return; | ||
| 34 | + GpsEntity gps = new GpsEntity(); | ||
| 35 | + | ||
| 36 | + gps.setDeviceId(basicInfo.getDeviceId()); | ||
| 37 | + gps.setTimestamp(basicInfo.getTimestamp()); | ||
| 38 | + gps.setLat(basicInfo.getLat()); | ||
| 39 | + gps.setLon(basicInfo.getLon()); | ||
| 40 | + gps.setDirection((float)basicInfo.getDirection() / 10); | ||
| 41 | + gps.setValid(basicInfo.getGpsValid()); | ||
| 42 | + gps.setCompanyCode(basicInfo.getCompanyCode()); | ||
| 43 | + gps.setStopNo(basicInfo.getStopNo()); | ||
| 44 | + gps.setUpDown(basicInfo.getUpOrDown()); | ||
| 45 | + gps.setSpeed((float)basicInfo.getSpeedGps() / 10); | ||
| 46 | + gps.setLineId(String.valueOf(basicInfo.getLineId())); | ||
| 47 | + gps.setState((int) getService(basicInfo.getServiceState())); | ||
| 48 | + //没有设备号 | ||
| 49 | + if (StringUtils.isBlank(gps.getDeviceId())) | ||
| 50 | + return; | ||
| 51 | + | ||
| 52 | + String nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | ||
| 53 | + if (StringUtils.isBlank(nbbm)) | ||
| 54 | + gps.setIncomplete(true); | ||
| 55 | + else | ||
| 56 | + gps.setNbbm(nbbm); | ||
| 57 | + | ||
| 58 | + linkedList.addLast(gps); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + public byte getCacheState(long serviceState) { | ||
| 62 | + return (byte)(((serviceState & 0x00100000) == 0x00100000) ? 1 : 0); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public void init(){ | ||
| 66 | + Application.mainServices.scheduleWithFixedDelay(gpsHandleThread, 20 * 1000, 1100, TimeUnit.MILLISECONDS); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + @Component | ||
| 70 | + public static class GpsHandleThread extends Thread{ | ||
| 71 | + | ||
| 72 | + List<GpsEntity> list; | ||
| 73 | + | ||
| 74 | + @Autowired | ||
| 75 | + GpsRealAnalyse gpsRealAnalyse; | ||
| 76 | + | ||
| 77 | + @Override | ||
| 78 | + public void run() { | ||
| 79 | + list = new ArrayList<>(100); | ||
| 80 | + | ||
| 81 | + GpsEntity gps; | ||
| 82 | + for(int i = 0; i < 2000; i ++){ | ||
| 83 | + gps = linkedList.poll(); | ||
| 84 | + if(gps == null) | ||
| 85 | + break; | ||
| 86 | + list.add(gps); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + gpsRealAnalyse.analyse(list); | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + /** | ||
| 94 | + * 获取运营状态 | ||
| 95 | + * | ||
| 96 | + * @return -1无效 0运营 1未运营 | ||
| 97 | + */ | ||
| 98 | + public static byte getService(long serviceState) { | ||
| 99 | + if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000) | ||
| 100 | + return -1; | ||
| 101 | + return (byte) (((serviceState & 0x02000000) == 0x02000000) ? 1 : 0); | ||
| 102 | + } | ||
| 103 | } | 103 | } |
| 104 | \ No newline at end of file | 104 | \ No newline at end of file |
src/main/java/com/bsth/data/gpsdata/client/pd/handler/PdClientHandler.java
| 1 | package com.bsth.data.gpsdata.client.pd.handler; | 1 | package com.bsth.data.gpsdata.client.pd.handler; |
| 2 | 2 | ||
| 3 | -import com.bsth.data.gpsdata.client.ClientApp; | ||
| 4 | import com.bsth.data.gpsdata.client.GpsBeforeBuffer; | 3 | import com.bsth.data.gpsdata.client.GpsBeforeBuffer; |
| 5 | import com.bsth.data.gpsdata.client.msg.IMessageBody; | 4 | import com.bsth.data.gpsdata.client.msg.IMessageBody; |
| 6 | import com.bsth.data.gpsdata.client.pd.protocol.PdMessage; | 5 | import com.bsth.data.gpsdata.client.pd.protocol.PdMessage; |
| @@ -45,7 +44,7 @@ public class PdClientHandler extends IoHandlerAdapter{ | @@ -45,7 +44,7 @@ public class PdClientHandler extends IoHandlerAdapter{ | ||
| 45 | log.info("连网关设备编号:" + deviceId + "断开连接"); | 44 | log.info("连网关设备编号:" + deviceId + "断开连接"); |
| 46 | log.warn(deviceId + "网关设备注销"); | 45 | log.warn(deviceId + "网关设备注销"); |
| 47 | 46 | ||
| 48 | - ClientApp.dconnect(deviceId); | 47 | + //ClientApp.dconnect(deviceId); |
| 49 | } else { | 48 | } else { |
| 50 | log.info("连网关设备编号:" + deviceId + "断开连接"); | 49 | log.info("连网关设备编号:" + deviceId + "断开连接"); |
| 51 | } | 50 | } |
src/main/java/com/bsth/data/gpsdata/client/pf/handler/PfClientHandler.java
| 1 | package com.bsth.data.gpsdata.client.pf.handler; | 1 | package com.bsth.data.gpsdata.client.pf.handler; |
| 2 | 2 | ||
| 3 | -import com.bsth.data.gpsdata.client.ClientApp; | ||
| 4 | import com.bsth.data.gpsdata.client.GpsBeforeBuffer; | 3 | import com.bsth.data.gpsdata.client.GpsBeforeBuffer; |
| 5 | import com.bsth.data.gpsdata.client.common.Protocol2BizUtil; | 4 | import com.bsth.data.gpsdata.client.common.Protocol2BizUtil; |
| 6 | import com.bsth.data.gpsdata.client.msg.IMessageBody; | 5 | import com.bsth.data.gpsdata.client.msg.IMessageBody; |
| @@ -44,7 +43,7 @@ public class PfClientHandler extends IoHandlerAdapter{ | @@ -44,7 +43,7 @@ public class PfClientHandler extends IoHandlerAdapter{ | ||
| 44 | //SessionManager.getInstance().unregister(deviceId); | 43 | //SessionManager.getInstance().unregister(deviceId); |
| 45 | log.info("连老网关设备编号:" + deviceId + "断开连接"); | 44 | log.info("连老网关设备编号:" + deviceId + "断开连接"); |
| 46 | log.warn(deviceId + "老网关设备注销"); | 45 | log.warn(deviceId + "老网关设备注销"); |
| 47 | - ClientApp.fconnect(deviceId); | 46 | + //ClientApp.fconnect(deviceId); |
| 48 | } | 47 | } |
| 49 | } | 48 | } |
| 50 | 49 |
src/main/java/com/bsth/data/schedule/SchModifyLog.java
0 → 100644
| 1 | +package com.bsth.data.schedule; | ||
| 2 | + | ||
| 3 | +import com.bsth.controller.realcontrol.dto.ChangePersonCar; | ||
| 4 | +import com.bsth.entity.mcy_forms.Changetochange; | ||
| 5 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 6 | +import com.bsth.entity.sys.SysUser; | ||
| 7 | +import com.bsth.repository.form.ChangetochangeRepository; | ||
| 8 | +import com.bsth.security.util.SecurityUtils; | ||
| 9 | +import org.apache.commons.lang3.StringUtils; | ||
| 10 | +import org.joda.time.format.DateTimeFormat; | ||
| 11 | +import org.joda.time.format.DateTimeFormatter; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.stereotype.Service; | ||
| 16 | + | ||
| 17 | +import java.util.Date; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * 线调实际排班修改日志记录 | ||
| 21 | + * Created by panzhao on 2017/5/7. | ||
| 22 | + */ | ||
| 23 | +@Service | ||
| 24 | +public class SchModifyLog { | ||
| 25 | + | ||
| 26 | + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm"); | ||
| 27 | + | ||
| 28 | + Logger log = LoggerFactory.getLogger(this.getClass()); | ||
| 29 | + | ||
| 30 | + @Autowired | ||
| 31 | + ChangetochangeRepository changetochangeRepository; | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 换人换车情况表 | ||
| 35 | + */ | ||
| 36 | + public void saveChangetochange(ScheduleRealInfo sch, ChangePersonCar cpc){ | ||
| 37 | + try { | ||
| 38 | + String newNbbm = cpc.getClZbh(); | ||
| 39 | + String newJsy = cpc.getJsy(); | ||
| 40 | + String oldJsy = sch.getjGh()+"/"+sch.getjName(); | ||
| 41 | + | ||
| 42 | + if(newNbbm == null && newJsy == null) | ||
| 43 | + return; | ||
| 44 | + | ||
| 45 | + if(newNbbm != null && newJsy != null | ||
| 46 | + && newNbbm.equals(sch.getClZbh()) && newJsy.equals(oldJsy)) | ||
| 47 | + return; | ||
| 48 | + | ||
| 49 | + Date d = new Date(); | ||
| 50 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 51 | + Changetochange cc = new Changetochange(); | ||
| 52 | + cc.setRq(sch.getScheduleDateStr()); | ||
| 53 | + cc.setGs(sch.getGsBm()); | ||
| 54 | + cc.setFgs(sch.getFgsBm()); | ||
| 55 | + cc.setXl(sch.getXlBm()); | ||
| 56 | + cc.setLp(sch.getLpName()); | ||
| 57 | + cc.setFssj(fmtHHmm.print(d.getTime())); | ||
| 58 | + cc.setXgsj(fmtHHmm.print(d.getTime())); | ||
| 59 | + if(user != null) | ||
| 60 | + cc.setXgr(user.getUserName()); | ||
| 61 | + | ||
| 62 | + cc.setPcch(sch.getClZbh()); | ||
| 63 | + cc.setPcry(oldJsy); | ||
| 64 | + cc.setJhch(sch.getClZbh()); | ||
| 65 | + cc.setJhgh(sch.getjGh()); | ||
| 66 | + | ||
| 67 | + if(StringUtils.isNotEmpty(newNbbm)) | ||
| 68 | + cc.setSjch(newNbbm); | ||
| 69 | + if(StringUtils.isNotEmpty(newJsy)) | ||
| 70 | + cc.setSjgh(newJsy); | ||
| 71 | + | ||
| 72 | + changetochangeRepository.save(cc); | ||
| 73 | + }catch (Exception e){ | ||
| 74 | + log.error("纪录换人换车情况表", e); | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + public void saveChangetochange(ScheduleRealInfo sch, String nbbm, String jsy){ | ||
| 79 | + ChangePersonCar cpc = new ChangePersonCar(); | ||
| 80 | + cpc.setClZbh(nbbm); | ||
| 81 | + cpc.setJsy(jsy); | ||
| 82 | + saveChangetochange(sch, cpc); | ||
| 83 | + } | ||
| 84 | +} |
src/main/java/com/bsth/entity/CarPark.java
| @@ -3,6 +3,9 @@ package com.bsth.entity; | @@ -3,6 +3,9 @@ package com.bsth.entity; | ||
| 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 4 | 4 | ||
| 5 | import javax.persistence.*; | 5 | import javax.persistence.*; |
| 6 | + | ||
| 7 | +import org.hibernate.annotations.Formula; | ||
| 8 | + | ||
| 6 | import java.util.Date; | 9 | import java.util.Date; |
| 7 | 10 | ||
| 8 | 11 | ||
| @@ -77,6 +80,10 @@ public class CarPark { | @@ -77,6 +80,10 @@ public class CarPark { | ||
| 77 | // 分公司 | 80 | // 分公司 |
| 78 | private String brancheCompany; | 81 | private String brancheCompany; |
| 79 | 82 | ||
| 83 | + /** 组合公司分公司编码 */ | ||
| 84 | + @Formula(" concat(company, '_', branche_company) ") | ||
| 85 | + private String cgsbm; | ||
| 86 | + | ||
| 80 | // 是否撤销 | 87 | // 是否撤销 |
| 81 | private Integer destroy; | 88 | private Integer destroy; |
| 82 | 89 | ||
| @@ -99,6 +106,14 @@ public class CarPark { | @@ -99,6 +106,14 @@ public class CarPark { | ||
| 99 | // 修改日期 | 106 | // 修改日期 |
| 100 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | 107 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 101 | private Date updateDate; | 108 | private Date updateDate; |
| 109 | + | ||
| 110 | + public String getCgsbm() { | ||
| 111 | + return cgsbm; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + public void setCgsbm(String cgsbm) { | ||
| 115 | + this.cgsbm = cgsbm; | ||
| 116 | + } | ||
| 102 | 117 | ||
| 103 | public Integer getId() { | 118 | public Integer getId() { |
| 104 | return id; | 119 | return id; |
src/main/java/com/bsth/repository/CarParkRepository.java
| @@ -107,4 +107,7 @@ public interface CarParkRepository extends BaseRepository<CarPark, Integer>{ | @@ -107,4 +107,7 @@ public interface CarParkRepository extends BaseRepository<CarPark, Integer>{ | ||
| 107 | 107 | ||
| 108 | @Query(value = "select st_astext(g_park_point), shapes_type, g_center_point, radius,park_code,park_name from bsth_c_car_park where park_code=?1", nativeQuery = true) | 108 | @Query(value = "select st_astext(g_park_point), shapes_type, g_center_point, radius,park_code,park_name from bsth_c_car_park where park_code=?1", nativeQuery = true) |
| 109 | public Object[][] bufferAera(String parkCode); | 109 | public Object[][] bufferAera(String parkCode); |
| 110 | + | ||
| 111 | + @Query(value ="SELECT p.park_name,p.park_code from bsth_c_car_park p where p.park_code = ?1", nativeQuery=true) | ||
| 112 | + List<Object[]> selectTccInfoByCode(String parkCode); | ||
| 110 | } | 113 | } |
src/main/java/com/bsth/repository/form/ChangetochangeRepository.java
0 → 100644
| 1 | +package com.bsth.repository.form; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.mcy_forms.Changetochange; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.stereotype.Repository; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Created by panzhao on 2017/5/7. | ||
| 9 | + */ | ||
| 10 | +@Repository | ||
| 11 | +public interface ChangetochangeRepository extends BaseRepository<Changetochange, Integer>{ | ||
| 12 | +} |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -90,11 +90,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -90,11 +90,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 90 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code); | 90 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code); |
| 91 | 91 | ||
| 92 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 92 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 93 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,dfsj") | 93 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj") |
| 94 | List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line); | 94 | List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line); |
| 95 | 95 | ||
| 96 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 96 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 97 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,dfsj") | 97 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj") |
| 98 | List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line); | 98 | List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line); |
| 99 | 99 | ||
| 100 | // @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 100 | // @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| @@ -105,9 +105,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -105,9 +105,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 105 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlBm,s.clZbh,s.jGh,s.adjustExps,s.fcsj") | 105 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlBm,s.clZbh,s.jGh,s.adjustExps,s.fcsj") |
| 106 | List<ScheduleRealInfo> scheduleByDateAndLineTjrb(String line,String date); | 106 | List<ScheduleRealInfo> scheduleByDateAndLineTjrb(String line,String date); |
| 107 | 107 | ||
| 108 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 109 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.xlDir=?3 and s.fcsjActual is not null and s.zdsjActual is not null order by s.realExecDate,s.fcsjActual") | ||
| 110 | + List<ScheduleRealInfo> scheduleByDateAndLineInOut(String line,String date,String zd); | ||
| 108 | 111 | ||
| 109 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 112 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 110 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDate = str_to_date(?2,'%Y-%m-%d') and xlBm =?3 order by realExecDate,dfsj") | 113 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDate = str_to_date(?2,'%Y-%m-%d') and xlBm =?3 order by realExecDate,fcsj") |
| 111 | List<ScheduleRealInfo> queryListWaybill2(String clZbh,String date,String line); | 114 | List<ScheduleRealInfo> queryListWaybill2(String clZbh,String date,String line); |
| 112 | 115 | ||
| 113 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 116 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
src/main/java/com/bsth/service/CarParkService.java
| @@ -28,5 +28,6 @@ public interface CarParkService extends BaseService<CarPark, Integer> { | @@ -28,5 +28,6 @@ public interface CarParkService extends BaseService<CarPark, Integer> { | ||
| 28 | * | 28 | * |
| 29 | */ | 29 | */ |
| 30 | Map<String, Object> carParkUpdate(Map<String, Object> map); | 30 | Map<String, Object> carParkUpdate(Map<String, Object> map); |
| 31 | - | 31 | + |
| 32 | + boolean selectTccInfoByCode(Map<String, Object> map); | ||
| 32 | } | 33 | } |
src/main/java/com/bsth/service/impl/CarParkServiceImpl.java
| @@ -26,55 +26,30 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | @@ -26,55 +26,30 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | public Map<String, Object> carParkSave(Map<String, Object> map) { | 28 | public Map<String, Object> carParkSave(Map<String, Object> map) { |
| 29 | - | ||
| 30 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 29 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 31 | - | ||
| 32 | try { | 30 | try { |
| 33 | - | ||
| 34 | // 停车场编码 | 31 | // 停车场编码 |
| 35 | String parkCode = map.get("parkCode").equals("") ? null : map.get("parkCode").toString(); | 32 | String parkCode = map.get("parkCode").equals("") ? null : map.get("parkCode").toString(); |
| 36 | - | ||
| 37 | - // 停车场id | ||
| 38 | - // Integer id = Integer.parseInt(parkCode); | ||
| 39 | - | ||
| 40 | // 停车场名称 | 33 | // 停车场名称 |
| 41 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); | 34 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); |
| 42 | - | ||
| 43 | // 地理位置(百度坐标集合) | 35 | // 地理位置(百度坐标集合) |
| 44 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); | 36 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); |
| 45 | - | ||
| 46 | - // 地理位置(WGS坐标集合) | ||
| 47 | - // String gParkPoint = map.get("gParkPoint").equals("") ? "" :map.get("gParkPoint").toString(); | ||
| 48 | - | ||
| 49 | // 多边形WGS坐标点集合 | 37 | // 多边形WGS坐标点集合 |
| 50 | String gParkPoint =""; | 38 | String gParkPoint =""; |
| 51 | - | ||
| 52 | if(!bParkPoint.equals("")) { | 39 | if(!bParkPoint.equals("")) { |
| 53 | - | ||
| 54 | String bPloygonGridArray[] = bParkPoint.split(","); | 40 | String bPloygonGridArray[] = bParkPoint.split(","); |
| 55 | - | ||
| 56 | int bLen_ = bPloygonGridArray.length; | 41 | int bLen_ = bPloygonGridArray.length; |
| 57 | - | ||
| 58 | for(int b = 0 ;b<bLen_;b++) { | 42 | for(int b = 0 ;b<bLen_;b++) { |
| 59 | - | ||
| 60 | String tempArray[]= bPloygonGridArray[b].split(" "); | 43 | String tempArray[]= bPloygonGridArray[b].split(" "); |
| 61 | - | ||
| 62 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); | 44 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); |
| 63 | - | ||
| 64 | if(b==0) { | 45 | if(b==0) { |
| 65 | - | ||
| 66 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); | 46 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); |
| 67 | - | ||
| 68 | }else { | 47 | }else { |
| 69 | - | ||
| 70 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); | 48 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); |
| 71 | - | ||
| 72 | } | 49 | } |
| 73 | - | ||
| 74 | } | 50 | } |
| 75 | 51 | ||
| 76 | } | 52 | } |
| 77 | - | ||
| 78 | if(bParkPoint.equals("")) | 53 | if(bParkPoint.equals("")) |
| 79 | bParkPoint = null; | 54 | bParkPoint = null; |
| 80 | else | 55 | else |
| @@ -84,169 +59,92 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | @@ -84,169 +59,92 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 84 | gParkPoint = null; | 59 | gParkPoint = null; |
| 85 | else | 60 | else |
| 86 | gParkPoint = "POLYGON((" + gParkPoint +"))"; | 61 | gParkPoint = "POLYGON((" + gParkPoint +"))"; |
| 87 | - | ||
| 88 | - /*bParkPoint = "POLYGON((" + bParkPoint +"))"; | ||
| 89 | - | ||
| 90 | - gParkPoint = "POLYGON((" + gParkPoint +"))";*/ | ||
| 91 | - | ||
| 92 | // 地理位置中心点(百度坐标) | 62 | // 地理位置中心点(百度坐标) |
| 93 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); | 63 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); |
| 94 | - | ||
| 95 | - // 地理位置中心点(WGS坐标) | ||
| 96 | - // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); | ||
| 97 | - | ||
| 98 | String bJwpointsArray[] =null; | 64 | String bJwpointsArray[] =null; |
| 99 | - | ||
| 100 | if(bCenterPoint!=null) { | 65 | if(bCenterPoint!=null) { |
| 101 | - | ||
| 102 | bJwpointsArray = bCenterPoint.split(" "); | 66 | bJwpointsArray = bCenterPoint.split(" "); |
| 103 | - | ||
| 104 | } | 67 | } |
| 105 | - | ||
| 106 | String gCenterPoint = null; | 68 | String gCenterPoint = null; |
| 107 | - | ||
| 108 | if(bJwpointsArray.length>0) { | 69 | if(bJwpointsArray.length>0) { |
| 109 | - | ||
| 110 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); | 70 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); |
| 111 | - | ||
| 112 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); | 71 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); |
| 113 | - | ||
| 114 | } | 72 | } |
| 115 | - | ||
| 116 | // 坐标类型 | 73 | // 坐标类型 |
| 117 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | 74 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); |
| 118 | - | ||
| 119 | // 图形类型 | 75 | // 图形类型 |
| 120 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | 76 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); |
| 121 | - | ||
| 122 | // 半径 | 77 | // 半径 |
| 123 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | 78 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); |
| 124 | - | ||
| 125 | // 面积 | 79 | // 面积 |
| 126 | Double area = map.get("area").equals("") ? 0.0 : Double.parseDouble(map.get("area").toString()); | 80 | Double area = map.get("area").equals("") ? 0.0 : Double.parseDouble(map.get("area").toString()); |
| 127 | - | ||
| 128 | // 公司 | 81 | // 公司 |
| 129 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); | 82 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); |
| 130 | - | ||
| 131 | // 分公司 | 83 | // 分公司 |
| 132 | - /*String brancheCompany = map.get("brancheCompany").equals("") ? "" : map.get("brancheCompany").toString();*/ | ||
| 133 | - String brancheCompany=""; | ||
| 134 | - | 84 | + String brancheCompany = map.get("brancheCompany").equals("") ? "" : map.get("brancheCompany").toString(); |
| 135 | // 是否撤销 | 85 | // 是否撤销 |
| 136 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | 86 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); |
| 137 | - | ||
| 138 | // 版本号 | 87 | // 版本号 |
| 139 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | 88 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); |
| 140 | - | ||
| 141 | // 描述与说明 | 89 | // 描述与说明 |
| 142 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | 90 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); |
| 143 | - | ||
| 144 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); | 91 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); |
| 145 | - | ||
| 146 | Date date = new Date(); | 92 | Date date = new Date(); |
| 147 | - | ||
| 148 | // 创建日期 | 93 | // 创建日期 |
| 149 | String createDate = formatter.format(date); | 94 | String createDate = formatter.format(date); |
| 150 | - | ||
| 151 | // 修改日期 | 95 | // 修改日期 |
| 152 | String updateDate = formatter.format(date); | 96 | String updateDate = formatter.format(date); |
| 153 | - | ||
| 154 | // 创建人 | 97 | // 创建人 |
| 155 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); | 98 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); |
| 156 | - | ||
| 157 | // 修改人 | 99 | // 修改人 |
| 158 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); | 100 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); |
| 159 | - | ||
| 160 | - | ||
| 161 | - | ||
| 162 | - | ||
| 163 | carParkRepository.carParkSave(area, company, parkCode, parkName, | 101 | carParkRepository.carParkSave(area, company, parkCode, parkName, |
| 164 | - | ||
| 165 | brancheCompany, createBy, createDate, descriptions, destroy, | 102 | brancheCompany, createBy, createDate, descriptions, destroy, |
| 166 | - | ||
| 167 | updateBy, updateDate, versions, bCenterPoint, bParkPoint, | 103 | updateBy, updateDate, versions, bCenterPoint, bParkPoint, |
| 168 | - | ||
| 169 | dbType, gCenterPoint, gParkPoint, radius, shapesType); | 104 | dbType, gCenterPoint, gParkPoint, radius, shapesType); |
| 170 | - | ||
| 171 | resultMap.put("status", ResponseCode.SUCCESS); | 105 | resultMap.put("status", ResponseCode.SUCCESS); |
| 172 | - | ||
| 173 | } catch (Exception e) { | 106 | } catch (Exception e) { |
| 174 | - | ||
| 175 | resultMap.put("status", ResponseCode.ERROR); | 107 | resultMap.put("status", ResponseCode.ERROR); |
| 176 | - | ||
| 177 | logger.error("save erro.", e); | 108 | logger.error("save erro.", e); |
| 178 | - | ||
| 179 | } | 109 | } |
| 180 | - | ||
| 181 | return resultMap; | 110 | return resultMap; |
| 182 | } | 111 | } |
| 183 | 112 | ||
| 184 | @Override | 113 | @Override |
| 185 | public List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map) { | 114 | public List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map) { |
| 186 | - | ||
| 187 | // 获取线路ID | 115 | // 获取线路ID |
| 188 | Integer id = map.get("id").equals("") ? 0 : Integer.parseInt(map.get("id").toString()); | 116 | Integer id = map.get("id").equals("") ? 0 : Integer.parseInt(map.get("id").toString()); |
| 189 | - | ||
| 190 | List<Object[]> objects = carParkRepository.findCarParkInfoFormId(id); | 117 | List<Object[]> objects = carParkRepository.findCarParkInfoFormId(id); |
| 191 | - | ||
| 192 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); | 118 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); |
| 193 | - | ||
| 194 | int len = objects.size(); | 119 | int len = objects.size(); |
| 195 | - | ||
| 196 | if(objects.size()>0) { | 120 | if(objects.size()>0) { |
| 197 | - | ||
| 198 | for(int i = 0 ; i < len; i++) { | 121 | for(int i = 0 ; i < len; i++) { |
| 199 | - | ||
| 200 | Map<String, Object> tempM = new HashMap<String,Object>(); | 122 | Map<String, Object> tempM = new HashMap<String,Object>(); |
| 201 | - | ||
| 202 | tempM.put("carParkId", objects.get(i)[0]); | 123 | tempM.put("carParkId", objects.get(i)[0]); |
| 203 | - | ||
| 204 | tempM.put("carParkArea", objects.get(i)[1]); | 124 | tempM.put("carParkArea", objects.get(i)[1]); |
| 205 | - | ||
| 206 | tempM.put("carParkCompany", objects.get(i)[2]); | 125 | tempM.put("carParkCompany", objects.get(i)[2]); |
| 207 | - | ||
| 208 | tempM.put("carParkCode", objects.get(i)[3]); | 126 | tempM.put("carParkCode", objects.get(i)[3]); |
| 209 | - | ||
| 210 | tempM.put("carParkName", objects.get(i)[4]); | 127 | tempM.put("carParkName", objects.get(i)[4]); |
| 211 | - | ||
| 212 | tempM.put("carParkBrancheCompany", objects.get(i)[5]); | 128 | tempM.put("carParkBrancheCompany", objects.get(i)[5]); |
| 213 | - | ||
| 214 | tempM.put("carParkCreateBy", objects.get(i)[6]); | 129 | tempM.put("carParkCreateBy", objects.get(i)[6]); |
| 215 | - | ||
| 216 | tempM.put("carParkCreateDate", objects.get(i)[7]); | 130 | tempM.put("carParkCreateDate", objects.get(i)[7]); |
| 217 | - | ||
| 218 | tempM.put("carParkDescriptions", objects.get(i)[8]); | 131 | tempM.put("carParkDescriptions", objects.get(i)[8]); |
| 219 | - | ||
| 220 | tempM.put("carParkDestroy", objects.get(i)[9]); | 132 | tempM.put("carParkDestroy", objects.get(i)[9]); |
| 221 | - | ||
| 222 | tempM.put("carParkUpdate", objects.get(i)[10]); | 133 | tempM.put("carParkUpdate", objects.get(i)[10]); |
| 223 | - | ||
| 224 | tempM.put("carParkUpdateDate", objects.get(i)[11]); | 134 | tempM.put("carParkUpdateDate", objects.get(i)[11]); |
| 225 | - | ||
| 226 | tempM.put("carParkVersions", objects.get(i)[12]); | 135 | tempM.put("carParkVersions", objects.get(i)[12]); |
| 227 | - | ||
| 228 | tempM.put("carParkBcenterPoint", objects.get(i)[13]); | 136 | tempM.put("carParkBcenterPoint", objects.get(i)[13]); |
| 229 | - | ||
| 230 | tempM.put("carParkBparkPoint", objects.get(i)[14]); | 137 | tempM.put("carParkBparkPoint", objects.get(i)[14]); |
| 231 | - | ||
| 232 | tempM.put("carParkGcenterPoint", objects.get(i)[15]); | 138 | tempM.put("carParkGcenterPoint", objects.get(i)[15]); |
| 233 | - | ||
| 234 | tempM.put("carParkGparkPoint", objects.get(i)[16]); | 139 | tempM.put("carParkGparkPoint", objects.get(i)[16]); |
| 235 | - | ||
| 236 | tempM.put("carParkDBtype", objects.get(i)[17]); | 140 | tempM.put("carParkDBtype", objects.get(i)[17]); |
| 237 | - | ||
| 238 | tempM.put("carParkRadius", objects.get(i)[18]); | 141 | tempM.put("carParkRadius", objects.get(i)[18]); |
| 239 | - | ||
| 240 | tempM.put("carParkShapesType", objects.get(i)[19]); | 142 | tempM.put("carParkShapesType", objects.get(i)[19]); |
| 241 | - | ||
| 242 | resultList.add(tempM); | 143 | resultList.add(tempM); |
| 243 | } | 144 | } |
| 244 | - | ||
| 245 | } | 145 | } |
| 246 | - | ||
| 247 | return resultList; | 146 | return resultList; |
| 248 | } | 147 | } |
| 249 | - | ||
| 250 | /** | 148 | /** |
| 251 | * 修改停车场信息 | 149 | * 修改停车场信息 |
| 252 | * | 150 | * |
| @@ -265,90 +163,54 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | @@ -265,90 +163,54 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 265 | @Override | 163 | @Override |
| 266 | public Map<String, Object> carParkUpdate(Map<String, Object> map) { | 164 | public Map<String, Object> carParkUpdate(Map<String, Object> map) { |
| 267 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 165 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 268 | - | ||
| 269 | try { | 166 | try { |
| 270 | - | ||
| 271 | // id | 167 | // id |
| 272 | Integer id = map.get("id").equals("") ? null : Integer.parseInt(map.get("id").toString()); | 168 | Integer id = map.get("id").equals("") ? null : Integer.parseInt(map.get("id").toString()); |
| 273 | - | ||
| 274 | if(id!=null) { | 169 | if(id!=null) { |
| 275 | - | ||
| 276 | // 面积 | 170 | // 面积 |
| 277 | Double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString()); | 171 | Double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString()); |
| 278 | - | ||
| 279 | // 中心点(百度坐标) | 172 | // 中心点(百度坐标) |
| 280 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); | 173 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); |
| 281 | - | ||
| 282 | // 图形坐标点集合(百度坐标) | 174 | // 图形坐标点集合(百度坐标) |
| 283 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); | 175 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); |
| 284 | - | ||
| 285 | // 分公司 | 176 | // 分公司 |
| 286 | - /*String brancheCompany = map.get("brancheCompany").equals("")? "" :map.get("brancheCompany").toString();*/ | ||
| 287 | - String brancheCompany = ""; | ||
| 288 | - | 177 | + String brancheCompany = map.get("brancheCompany").equals("")? "" :map.get("brancheCompany").toString(); |
| 178 | + //String brancheCompany = ""; | ||
| 289 | // 公司 | 179 | // 公司 |
| 290 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); | 180 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); |
| 291 | - | ||
| 292 | // 坐标类型 | 181 | // 坐标类型 |
| 293 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | 182 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); |
| 294 | - | ||
| 295 | // 描述与说明 | 183 | // 描述与说明 |
| 296 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | 184 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); |
| 297 | - | ||
| 298 | // 是否撤销 | 185 | // 是否撤销 |
| 299 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | 186 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); |
| 300 | - | ||
| 301 | // 中心点(WGS坐标) | 187 | // 中心点(WGS坐标) |
| 302 | // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); | 188 | // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); |
| 303 | - | ||
| 304 | String bJwpointsArray[] =null; | 189 | String bJwpointsArray[] =null; |
| 305 | - | ||
| 306 | if(bCenterPoint!=null) { | 190 | if(bCenterPoint!=null) { |
| 307 | - | ||
| 308 | bJwpointsArray = bCenterPoint.split(" "); | 191 | bJwpointsArray = bCenterPoint.split(" "); |
| 309 | - | ||
| 310 | } | 192 | } |
| 311 | - | ||
| 312 | String gCenterPoint =null; | 193 | String gCenterPoint =null; |
| 313 | - | ||
| 314 | if(bJwpointsArray.length>0) { | 194 | if(bJwpointsArray.length>0) { |
| 315 | - | ||
| 316 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); | 195 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); |
| 317 | - | ||
| 318 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); | 196 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); |
| 319 | - | ||
| 320 | } | 197 | } |
| 321 | - | ||
| 322 | // 图形坐标点集合(WGS坐标) | 198 | // 图形坐标点集合(WGS坐标) |
| 323 | // String gParkPoint = map.get("gParkPoint").equals("") ? "" : map.get("gParkPoint").toString(); | 199 | // String gParkPoint = map.get("gParkPoint").equals("") ? "" : map.get("gParkPoint").toString(); |
| 324 | - | ||
| 325 | // 多边形WGS坐标点集合 | 200 | // 多边形WGS坐标点集合 |
| 326 | String gParkPoint =""; | 201 | String gParkPoint =""; |
| 327 | - | ||
| 328 | if(!bParkPoint.equals("")) { | 202 | if(!bParkPoint.equals("")) { |
| 329 | - | ||
| 330 | String bPloygonGridArray[] = bParkPoint.split(","); | 203 | String bPloygonGridArray[] = bParkPoint.split(","); |
| 331 | - | ||
| 332 | int bLen_ = bPloygonGridArray.length; | 204 | int bLen_ = bPloygonGridArray.length; |
| 333 | - | ||
| 334 | for(int b = 0 ;b<bLen_;b++) { | 205 | for(int b = 0 ;b<bLen_;b++) { |
| 335 | - | ||
| 336 | String tempArray[]= bPloygonGridArray[b].split(" "); | 206 | String tempArray[]= bPloygonGridArray[b].split(" "); |
| 337 | - | ||
| 338 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); | 207 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); |
| 339 | - | ||
| 340 | if(b==0) { | 208 | if(b==0) { |
| 341 | - | ||
| 342 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); | 209 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); |
| 343 | - | ||
| 344 | }else { | 210 | }else { |
| 345 | - | ||
| 346 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); | 211 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); |
| 347 | - | ||
| 348 | } | 212 | } |
| 349 | - | ||
| 350 | } | 213 | } |
| 351 | - | ||
| 352 | } | 214 | } |
| 353 | if(bParkPoint.equals("")) | 215 | if(bParkPoint.equals("")) |
| 354 | bParkPoint = null; | 216 | bParkPoint = null; |
| @@ -362,69 +224,51 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | @@ -362,69 +224,51 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 362 | /*bParkPoint = "POLYGON((" + bParkPoint +"))"; | 224 | /*bParkPoint = "POLYGON((" + bParkPoint +"))"; |
| 363 | 225 | ||
| 364 | gParkPoint = "POLYGON((" + gParkPoint +"))";*/ | 226 | gParkPoint = "POLYGON((" + gParkPoint +"))";*/ |
| 365 | - | ||
| 366 | // 编码 | 227 | // 编码 |
| 367 | String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString(); | 228 | String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString(); |
| 368 | - | ||
| 369 | // 名称 | 229 | // 名称 |
| 370 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); | 230 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); |
| 371 | - | ||
| 372 | // 半径 | 231 | // 半径 |
| 373 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | 232 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); |
| 374 | - | ||
| 375 | // 图形类型 | 233 | // 图形类型 |
| 376 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | 234 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); |
| 377 | - | ||
| 378 | // 版本 | 235 | // 版本 |
| 379 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | 236 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); |
| 380 | - | ||
| 381 | // 创建人 | 237 | // 创建人 |
| 382 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); | 238 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); |
| 383 | - | ||
| 384 | // 创建日期 | 239 | // 创建日期 |
| 385 | String createDate = map.get("createDate").equals("") ? "" : map.get("createDate").toString(); | 240 | String createDate = map.get("createDate").equals("") ? "" : map.get("createDate").toString(); |
| 386 | - | ||
| 387 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); | 241 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); |
| 388 | - | ||
| 389 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); | 242 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); |
| 390 | - | ||
| 391 | Date date = new Date(); | 243 | Date date = new Date(); |
| 392 | - | ||
| 393 | // 修改日期 | 244 | // 修改日期 |
| 394 | String updateDate = formatter.format(date); | 245 | String updateDate = formatter.format(date); |
| 395 | - | ||
| 396 | carParkRepository.carParkUpdate(area, company, parkCode, parkName, brancheCompany, createBy, createDate, descriptions, destroy, updateBy, updateDate, versions, bCenterPoint, gCenterPoint, bParkPoint, gParkPoint, dbType, radius, shapesType, id); | 246 | carParkRepository.carParkUpdate(area, company, parkCode, parkName, brancheCompany, createBy, createDate, descriptions, destroy, updateBy, updateDate, versions, bCenterPoint, gCenterPoint, bParkPoint, gParkPoint, dbType, radius, shapesType, id); |
| 397 | - | ||
| 398 | } | 247 | } |
| 399 | - | ||
| 400 | resultMap.put("status", ResponseCode.SUCCESS); | 248 | resultMap.put("status", ResponseCode.SUCCESS); |
| 401 | - | ||
| 402 | } catch (Exception e) { | 249 | } catch (Exception e) { |
| 403 | - | ||
| 404 | resultMap.put("status", ResponseCode.ERROR); | 250 | resultMap.put("status", ResponseCode.ERROR); |
| 405 | - | ||
| 406 | logger.error("save erro.", e); | 251 | logger.error("save erro.", e); |
| 407 | - | ||
| 408 | } | 252 | } |
| 409 | - | ||
| 410 | return resultMap; | 253 | return resultMap; |
| 411 | } | 254 | } |
| 412 | - | ||
| 413 | /** 百度坐标转WGS坐标 */ | 255 | /** 百度坐标转WGS坐标 */ |
| 414 | public Location FromBDPointToWGSPoint(String bLonx,String bLatx) { | 256 | public Location FromBDPointToWGSPoint(String bLonx,String bLatx) { |
| 415 | - | ||
| 416 | double lng = Double.parseDouble(bLonx); | 257 | double lng = Double.parseDouble(bLonx); |
| 417 | - | ||
| 418 | double lat = Double.parseDouble(bLatx); | 258 | double lat = Double.parseDouble(bLatx); |
| 419 | - | ||
| 420 | Location bdLoc = TransGPS.LocationMake(lng, lat); | 259 | Location bdLoc = TransGPS.LocationMake(lng, lat); |
| 421 | - | ||
| 422 | Location location = TransGPS.bd_decrypt(bdLoc); | 260 | Location location = TransGPS.bd_decrypt(bdLoc); |
| 423 | - | ||
| 424 | Location WGSPoint = TransGPS.transformFromGCJToWGS(location); | 261 | Location WGSPoint = TransGPS.transformFromGCJToWGS(location); |
| 425 | - | ||
| 426 | return WGSPoint; | 262 | return WGSPoint; |
| 427 | - | ||
| 428 | } | 263 | } |
| 429 | - | 264 | + |
| 265 | + @Override | ||
| 266 | + public boolean selectTccInfoByCode(Map<String, Object> map) { | ||
| 267 | + List<Object[]> arrayObj = carParkRepository.selectTccInfoByCode(map.get("parkCode").equals("") ? "" : map.get("parkCode").toString()); | ||
| 268 | + boolean tag = true; | ||
| 269 | + if(arrayObj.size()>0) { | ||
| 270 | + tag= false; | ||
| 271 | + } | ||
| 272 | + return tag; | ||
| 273 | + } | ||
| 430 | } | 274 | } |
src/main/java/com/bsth/service/realcontrol/impl/RealChartsServiceImpl.java
| @@ -259,7 +259,7 @@ public class RealChartsServiceImpl implements RealChartsService { | @@ -259,7 +259,7 @@ public class RealChartsServiceImpl implements RealChartsService { | ||
| 259 | } | 259 | } |
| 260 | inStr = " (" + inStr.substring(1) + ")"; | 260 | inStr = " (" + inStr.substring(1) + ")"; |
| 261 | 261 | ||
| 262 | - String sql = "SELECT ID,DFSJ,FCSJ_ACTUAL,ZDSJ,ZDSJ_ACTUAL,`STATUS`,XL_BM FROM bsth_c_s_sp_info_real WHERE schedule_date_str=:date AND concat_ws('', real_exec_date, dfsj)<:cdate and xl_bm in "+inStr+" ORDER BY dfsj"; | 262 | + String sql = "SELECT ID,DFSJ,FCSJ_ACTUAL,ZDSJ,ZDSJ_ACTUAL,`STATUS`,XL_BM FROM bsth_c_s_sp_info_real WHERE bc_type!='in' and bc_type!='out' and schedule_date_str=:date AND concat_ws('', real_exec_date, dfsj)<:cdate and xl_bm in "+inStr+" ORDER BY dfsj"; |
| 263 | 263 | ||
| 264 | MapSqlParameterSource parameters = new MapSqlParameterSource(); | 264 | MapSqlParameterSource parameters = new MapSqlParameterSource(); |
| 265 | parameters.addValue("date", date); | 265 | parameters.addValue("date", date); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -12,6 +12,7 @@ import com.bsth.data.BasicData; | @@ -12,6 +12,7 @@ import com.bsth.data.BasicData; | ||
| 12 | import com.bsth.data.LineConfigData; | 12 | import com.bsth.data.LineConfigData; |
| 13 | import com.bsth.data.schedule.DayOfSchedule; | 13 | import com.bsth.data.schedule.DayOfSchedule; |
| 14 | import com.bsth.data.schedule.SchAttrCalculator; | 14 | import com.bsth.data.schedule.SchAttrCalculator; |
| 15 | +import com.bsth.data.schedule.SchModifyLog; | ||
| 15 | import com.bsth.data.schedule.ScheduleComparator; | 16 | import com.bsth.data.schedule.ScheduleComparator; |
| 16 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; | 17 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; |
| 17 | import com.bsth.entity.Cars; | 18 | import com.bsth.entity.Cars; |
| @@ -52,7 +53,6 @@ import com.google.common.base.Splitter; | @@ -52,7 +53,6 @@ import com.google.common.base.Splitter; | ||
| 52 | import com.google.common.collect.Lists; | 53 | import com.google.common.collect.Lists; |
| 53 | import org.apache.commons.lang3.StringEscapeUtils; | 54 | import org.apache.commons.lang3.StringEscapeUtils; |
| 54 | import org.apache.commons.lang3.StringUtils; | 55 | import org.apache.commons.lang3.StringUtils; |
| 55 | -import org.drools.compiler.lang.dsl.DSLMapParser.statement_return; | ||
| 56 | import org.joda.time.format.DateTimeFormat; | 56 | import org.joda.time.format.DateTimeFormat; |
| 57 | import org.joda.time.format.DateTimeFormatter; | 57 | import org.joda.time.format.DateTimeFormatter; |
| 58 | import org.slf4j.Logger; | 58 | import org.slf4j.Logger; |
| @@ -132,6 +132,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -132,6 +132,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 132 | @Autowired | 132 | @Autowired |
| 133 | CulateMileageService culateService; | 133 | CulateMileageService culateService; |
| 134 | 134 | ||
| 135 | + @Autowired | ||
| 136 | + SchModifyLog schModifyLog; | ||
| 137 | + | ||
| 135 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 138 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 136 | 139 | ||
| 137 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 140 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| @@ -1171,10 +1174,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1171,10 +1174,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1171 | return rs; | 1174 | return rs; |
| 1172 | } | 1175 | } |
| 1173 | 1176 | ||
| 1177 | + String clZbh = map.get("clZbh"); | ||
| 1178 | + String jsy = map.get("jsy"); | ||
| 1179 | + if(!clZbh.equals(sch.getClZbh()) | ||
| 1180 | + || !jsy.equals(sch.getjGh() + "/" + sch.getjName())) | ||
| 1181 | + schModifyLog.saveChangetochange(sch, clZbh, jsy);//为换人换车情况表写入数据 | ||
| 1174 | /** | 1182 | /** |
| 1175 | * 换车 | 1183 | * 换车 |
| 1176 | */ | 1184 | */ |
| 1177 | - String clZbh = map.get("clZbh"); | ||
| 1178 | if (StringUtils.isNotEmpty(clZbh)) { | 1185 | if (StringUtils.isNotEmpty(clZbh)) { |
| 1179 | //换车 | 1186 | //换车 |
| 1180 | if (!carExist(sch.getGsBm(), clZbh)) { | 1187 | if (!carExist(sch.getGsBm(), clZbh)) { |
| @@ -1189,7 +1196,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1189,7 +1196,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1189 | /** | 1196 | /** |
| 1190 | * 换驾驶员 | 1197 | * 换驾驶员 |
| 1191 | */ | 1198 | */ |
| 1192 | - String jsy = map.get("jsy"); | ||
| 1193 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { | 1199 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { |
| 1194 | String jGh = jsy.split("/")[0]; | 1200 | String jGh = jsy.split("/")[0]; |
| 1195 | String jName = getPersonName(sch.getGsBm(), jGh); | 1201 | String jName = getPersonName(sch.getGsBm(), jGh); |
| @@ -1978,11 +1984,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1978,11 +1984,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1978 | int dtbcZ = 0, dtbc_mZ = 0, dtbc_aZ = 0; | 1984 | int dtbcZ = 0, dtbc_mZ = 0, dtbc_aZ = 0; |
| 1979 | int djgZ = 0, djg_mZ = 0, djg_aZ = 0, djg_timeZ = 0; | 1985 | int djgZ = 0, djg_mZ = 0, djg_aZ = 0, djg_timeZ = 0; |
| 1980 | Map<String, Object> map = null; | 1986 | Map<String, Object> map = null; |
| 1981 | - | 1987 | + |
| 1982 | double xgssgl=0,xgljgl=0,lj=0,cj=0; | 1988 | double xgssgl=0,xgljgl=0,lj=0,cj=0; |
| 1983 | for (int i = 0; i < list.size(); i++) { | 1989 | for (int i = 0; i < list.size(); i++) { |
| 1984 | ScheduleRealInfo scheduleRealInfo = list.get(i); | 1990 | ScheduleRealInfo scheduleRealInfo = list.get(i); |
| 1985 | - | 1991 | + |
| 1986 | if (scheduleRealInfo != null) { | 1992 | if (scheduleRealInfo != null) { |
| 1987 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 1993 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 1988 | //计算实际里程,少驶里程,计划里程=实际里程+少驶里程 | 1994 | //计算实际里程,少驶里程,计划里程=实际里程+少驶里程 |
| @@ -1993,7 +1999,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1993,7 +1999,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1993 | if (childTaskPlans.isEmpty()) { | 1999 | if (childTaskPlans.isEmpty()) { |
| 1994 | tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | 2000 | tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); |
| 1995 | jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 : scheduleRealInfo.getJhlcOrig(); | 2001 | jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 : scheduleRealInfo.getJhlcOrig(); |
| 1996 | - | 2002 | + |
| 1997 | if(jhlcOrig-tempJhlc>0){ | 2003 | if(jhlcOrig-tempJhlc>0){ |
| 1998 | xgssgl +=jhlcOrig-tempJhlc; | 2004 | xgssgl +=jhlcOrig-tempJhlc; |
| 1999 | cj += jhlcOrig-tempJhlc; | 2005 | cj += jhlcOrig-tempJhlc; |
| @@ -2005,8 +2011,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2005,8 +2011,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2005 | if (scheduleRealInfo.isSflj()) { | 2011 | if (scheduleRealInfo.isSflj()) { |
| 2006 | ljgl += tempJhlc; | 2012 | ljgl += tempJhlc; |
| 2007 | ljglZ += tempJhlc; | 2013 | ljglZ += tempJhlc; |
| 2008 | - } | ||
| 2009 | - | 2014 | + } |
| 2015 | + | ||
| 2010 | if (scheduleRealInfo.getStatus() == -1) { | 2016 | if (scheduleRealInfo.getStatus() == -1) { |
| 2011 | ssgl += tempJhlc; | 2017 | ssgl += tempJhlc; |
| 2012 | ssglZ += tempJhlc; | 2018 | ssglZ += tempJhlc; |
| @@ -2771,7 +2777,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2771,7 +2777,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2771 | for(ScheduleRealInfo info:listInfo){ | 2777 | for(ScheduleRealInfo info:listInfo){ |
| 2772 | for(ScheduleRealInfo total:listTotal){ | 2778 | for(ScheduleRealInfo total:listTotal){ |
| 2773 | if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){ | 2779 | if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){ |
| 2774 | - | 2780 | + |
| 2775 | } | 2781 | } |
| 2776 | } | 2782 | } |
| 2777 | }*/ | 2783 | }*/ |
| @@ -2867,7 +2873,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2867,7 +2873,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2867 | for(ScheduleRealInfo info:listInfo){ | 2873 | for(ScheduleRealInfo info:listInfo){ |
| 2868 | for(ScheduleRealInfo total:listTotal){ | 2874 | for(ScheduleRealInfo total:listTotal){ |
| 2869 | if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){ | 2875 | if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){ |
| 2870 | - | 2876 | + |
| 2871 | } | 2877 | } |
| 2872 | } | 2878 | } |
| 2873 | }*/ | 2879 | }*/ |
| @@ -2944,7 +2950,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2944,7 +2950,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2944 | fage = false; | 2950 | fage = false; |
| 2945 | } | 2951 | } |
| 2946 | listS.add(scheduleRealInfo); | 2952 | listS.add(scheduleRealInfo); |
| 2947 | - | 2953 | + |
| 2948 | /* if (scheduleRealInfo != null) { | 2954 | /* if (scheduleRealInfo != null) { |
| 2949 | //计划里程(主任务过滤掉临加班次), | 2955 | //计划里程(主任务过滤掉临加班次), |
| 2950 | //烂班里程(主任务烂班), | 2956 | //烂班里程(主任务烂班), |
| @@ -2960,7 +2966,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2960,7 +2966,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2960 | || scheduleRealInfo.getBcType().equals("out"))) { | 2966 | || scheduleRealInfo.getBcType().equals("out"))) { |
| 2961 | jhlc =Arith.add(jhlc,tempJhlc); | 2967 | jhlc =Arith.add(jhlc,tempJhlc); |
| 2962 | } | 2968 | } |
| 2963 | - | 2969 | + |
| 2964 | if (scheduleRealInfo.getStatus() == -1) { | 2970 | if (scheduleRealInfo.getStatus() == -1) { |
| 2965 | remMileage =Arith.add(remMileage,tempJhlc); | 2971 | remMileage =Arith.add(remMileage,tempJhlc); |
| 2966 | } | 2972 | } |
| @@ -3046,7 +3052,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3046,7 +3052,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3046 | ScheduleRealInfo sch; | 3052 | ScheduleRealInfo sch; |
| 3047 | //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse(); | 3053 | //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse(); |
| 3048 | 3054 | ||
| 3049 | - String jGh,jName,sGh,sName; | 3055 | + String jGh = null,jName,sGh,sName; |
| 3050 | for (ChangePersonCar cpc : cpcs) { | 3056 | for (ChangePersonCar cpc : cpcs) { |
| 3051 | 3057 | ||
| 3052 | sch = dayOfSchedule.get(cpc.getSchId()); | 3058 | sch = dayOfSchedule.get(cpc.getSchId()); |
| @@ -3067,6 +3073,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3067,6 +3073,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3067 | rs.put("status", ResponseCode.ERROR); | 3073 | rs.put("status", ResponseCode.ERROR); |
| 3068 | return rs; | 3074 | return rs; |
| 3069 | } | 3075 | } |
| 3076 | + } | ||
| 3077 | + | ||
| 3078 | + //为换人换车情况表写入数据 | ||
| 3079 | + schModifyLog.saveChangetochange(sch, cpc); | ||
| 3080 | + | ||
| 3081 | + if (StringUtils.isNotEmpty(cpc.getJsy())) { | ||
| 3070 | //换驾驶员 | 3082 | //换驾驶员 |
| 3071 | persoChange(sch, jGh); | 3083 | persoChange(sch, jGh); |
| 3072 | set.add(sch); | 3084 | set.add(sch); |
| @@ -4012,13 +4024,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4012,13 +4024,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4012 | String xlName = map.get("xlName").toString(); | 4024 | String xlName = map.get("xlName").toString(); |
| 4013 | String state = map.get("state").toString(); | 4025 | String state = map.get("state").toString(); |
| 4014 | String type = map.get("type").toString(); | 4026 | String type = map.get("type").toString(); |
| 4015 | - | 4027 | + |
| 4016 | List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>(); | 4028 | List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>(); |
| 4017 | List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>(); | 4029 | List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>(); |
| 4018 | List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null); | 4030 | List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null); |
| 4019 | List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state); | 4031 | List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state); |
| 4020 | List<ScheduleRealInfo> list3 = this.realScheduleList(line, date); | 4032 | List<ScheduleRealInfo> list3 = this.realScheduleList(line, date); |
| 4021 | 4033 | ||
| 4034 | + Map<String, Object> nMap=new HashMap<String, Object>(); | ||
| 4035 | + nMap.put("date", date); | ||
| 4036 | + nMap.put("jls", list1.get(0).get("jls")); | ||
| 4037 | + nMap.put("sjgl", list1.get(0).get("sjgl")); | ||
| 4022 | for (Map<String, Object> m : list1) { | 4038 | for (Map<String, Object> m : list1) { |
| 4023 | // m.put("ssgl", m.get("ssgl")); | 4039 | // m.put("ssgl", m.get("ssgl")); |
| 4024 | // m.put("ssbc", m.get("ssbc")); | 4040 | // m.put("ssbc", m.get("ssbc")); |
| @@ -4132,7 +4148,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4132,7 +4148,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4132 | sdfSimple = new SimpleDateFormat("yyyyMM"); | 4148 | sdfSimple = new SimpleDateFormat("yyyyMM"); |
| 4133 | sourcePath = path + "mould/scheduleDaily_m.xls"; | 4149 | sourcePath = path + "mould/scheduleDaily_m.xls"; |
| 4134 | } | 4150 | } |
| 4135 | - ee.excelReplace(listI, new Object[]{m}, sourcePath, | 4151 | + ee.excelReplace(listI, new Object[]{nMap}, sourcePath, |
| 4136 | path + "export/调度日报" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | 4152 | path + "export/调度日报" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); |
| 4137 | } catch (Exception e) { | 4153 | } catch (Exception e) { |
| 4138 | // TODO: handle exception | 4154 | // TODO: handle exception |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -3,6 +3,7 @@ package com.bsth.service.report; | @@ -3,6 +3,7 @@ package com.bsth.service.report; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import java.util.Map; | 4 | import java.util.Map; |
| 5 | 5 | ||
| 6 | +import com.bsth.entity.StationRoute; | ||
| 6 | import com.bsth.entity.excep.ArrivalInfo; | 7 | import com.bsth.entity.excep.ArrivalInfo; |
| 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 8 | 9 | ||
| @@ -14,7 +15,8 @@ public interface ReportService { | @@ -14,7 +15,8 @@ public interface ReportService { | ||
| 14 | List<ArrivalInfo> queryListZdxx(String line,String date,String clzbh,String sjfc,String sjdd); | 15 | List<ArrivalInfo> queryListZdxx(String line,String date,String clzbh,String sjfc,String sjdd); |
| 15 | 16 | ||
| 16 | List<ArrivalInfo> queryListClzd(String line,String zd,String zdlx,String fcsj,String ddsj); | 17 | List<ArrivalInfo> queryListClzd(String line,String zd,String zdlx,String fcsj,String ddsj); |
| 17 | - | 18 | + List<StationRoute> queryStrinon(String line,int zd); |
| 19 | + List<Map<String, Object>> queryInOutStrtion(String line,String date,int zd,String lzsj); | ||
| 18 | List<Map<String, String>> sreachZd(String line,int zdlx,String zd); | 20 | List<Map<String, String>> sreachZd(String line,int zdlx,String zd); |
| 19 | 21 | ||
| 20 | List<Object[]> historyMessageCount(String line, String date, String code); | 22 | List<Object[]> historyMessageCount(String line, String date, String code); |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -59,6 +59,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -59,6 +59,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 59 | CulateMileageService culateService; | 59 | CulateMileageService culateService; |
| 60 | @Autowired | 60 | @Autowired |
| 61 | LineRepository lineRepository; | 61 | LineRepository lineRepository; |
| 62 | + @Autowired | ||
| 63 | + StationRouteRepository stationRouteRepository; | ||
| 62 | @Override | 64 | @Override |
| 63 | public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) { | 65 | public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) { |
| 64 | // TODO Auto-generated method stub | 66 | // TODO Auto-generated method stub |
| @@ -1469,4 +1471,185 @@ public class ReportServiceImpl implements ReportService{ | @@ -1469,4 +1471,185 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1469 | } | 1471 | } |
| 1470 | return list; | 1472 | return list; |
| 1471 | } | 1473 | } |
| 1474 | + | ||
| 1475 | + public List<ArrivalInfo> load3(String line, String date, int zd){ | ||
| 1476 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1477 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | ||
| 1478 | + Long date1=0L; | ||
| 1479 | + Long date2=0L; | ||
| 1480 | + Calendar cal = Calendar.getInstance(); | ||
| 1481 | + try { | ||
| 1482 | + Date dates1 = simpleDateFormat.parse(date+" 00:00:01"); | ||
| 1483 | + Date dates2=simpleDateFormat.parse(date+" 23:59:59"); | ||
| 1484 | + date1=dates1.getTime(); | ||
| 1485 | + date2=dates2.getTime(); | ||
| 1486 | + cal.setTime(dates1); | ||
| 1487 | + } catch (ParseException e1) { | ||
| 1488 | + // TODO Auto-generated catch block | ||
| 1489 | + e1.printStackTrace(); | ||
| 1490 | + } | ||
| 1491 | + //周数,表分区字段 | ||
| 1492 | + int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 1493 | + List<ArrivalInfo> list = null; | ||
| 1494 | + Connection conn = null; | ||
| 1495 | + PreparedStatement ps = null; | ||
| 1496 | + ResultSet rs = null; | ||
| 1497 | + | ||
| 1498 | + String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? " | ||
| 1499 | + + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; | ||
| 1500 | + try{ | ||
| 1501 | + conn = DBUtils_MS.getConnection(); | ||
| 1502 | + ps = conn.prepareStatement(sql); | ||
| 1503 | + ps.setString(1, line); | ||
| 1504 | + ps.setInt(2, weeks_year1); | ||
| 1505 | + ps.setLong(3, date1); | ||
| 1506 | + ps.setLong(4, date2); | ||
| 1507 | + ps.setInt(5, zd); | ||
| 1508 | + rs = ps.executeQuery(); | ||
| 1509 | + | ||
| 1510 | + list = resultSet2Set(rs); | ||
| 1511 | + }catch(Exception e){ | ||
| 1512 | + logger.error("", e); | ||
| 1513 | + }finally { | ||
| 1514 | + DBUtils_MS.close(rs, ps, conn); | ||
| 1515 | + } | ||
| 1516 | + return list; | ||
| 1517 | + } | ||
| 1518 | + @Override | ||
| 1519 | + public List<Map<String, Object>> queryInOutStrtion(String line, String date, int zd,String lzsj) { | ||
| 1520 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1521 | + //查询线路所有的站点 | ||
| 1522 | + List<ArrivalInfo> arrInfoList=this.load3(line, date, zd); | ||
| 1523 | + List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); | ||
| 1524 | + List<Map<String, Object>> inoutList=new ArrayList<Map<String,Object>>(); | ||
| 1525 | + //保存的所以的站点信息 | ||
| 1526 | + Map<String, Object> map1=new HashMap<String,Object>(); | ||
| 1527 | + map1.put("bc", ""); | ||
| 1528 | + map1.put("nbbm", ""); | ||
| 1529 | + | ||
| 1530 | + //所有的班次信息(实际排班排序) | ||
| 1531 | + List<ScheduleRealInfo> realList= scheduleRealInfoRepository.scheduleByDateAndLineInOut(line, date,zd+""); | ||
| 1532 | + for (int i = 0; i < listStation.size(); i++) { | ||
| 1533 | + map1.put(listStation.get(i).getStationCode()+"in" | ||
| 1534 | + , listStation.get(i).getStationName()); | ||
| 1535 | + map1.put(listStation.get(i).getStationCode()+"out" | ||
| 1536 | + , (i+1)); | ||
| 1537 | + } | ||
| 1538 | + inoutList.add(map1); | ||
| 1539 | + | ||
| 1540 | + for (int i = 0; i < realList.size(); i++) { | ||
| 1541 | + ScheduleRealInfo sinfo=realList.get(i); | ||
| 1542 | + String devuceId=BasicData.deviceId2NbbmMap.inverse().get(sinfo.getClZbh()); | ||
| 1543 | + String sjfcsj=sinfo.getRealExecDate()+" "+sinfo.getFcsjActual()+":00"; | ||
| 1544 | + String sjddsj=sinfo.getRealExecDate()+" "+sinfo.getZdsjActual()+":59"; | ||
| 1545 | + | ||
| 1546 | + try { | ||
| 1547 | + Date dates1 = simpleDateFormat.parse(sjfcsj); | ||
| 1548 | + Date dates2=simpleDateFormat.parse(sjddsj); | ||
| 1549 | + Long date1=dates1.getTime(); | ||
| 1550 | + Long date2=dates2.getTime(); | ||
| 1551 | + List<ArrivalInfo> arrList=new ArrayList<ArrivalInfo>(); | ||
| 1552 | + for (int j = 0; j < arrInfoList.size(); j++) { | ||
| 1553 | + ArrivalInfo a=arrInfoList.get(j); | ||
| 1554 | + if(a.getDeviceId().equals(devuceId) && a.getTs()>=date1 && a.getTs()<=date2){ | ||
| 1555 | + arrList.add(a); | ||
| 1556 | + } | ||
| 1557 | + } | ||
| 1558 | + | ||
| 1559 | + Map<String, Object> map2=new HashMap<String,Object>(); | ||
| 1560 | + map2.put("bc", (i+1)); | ||
| 1561 | + map2.put("nbbm", sinfo.getClZbh()); | ||
| 1562 | + | ||
| 1563 | + for (int j = 0; j < listStation.size(); j++) { | ||
| 1564 | + StationRoute s=listStation.get(j); | ||
| 1565 | + List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>(); | ||
| 1566 | + for (int j2 = 0; j2 < arrList.size(); j2++) { | ||
| 1567 | + ArrivalInfo a=arrList.get(j2); | ||
| 1568 | + if(s.getStationCode().equals(a.getStopNo())){ | ||
| 1569 | + arrivalList.add(a); | ||
| 1570 | + } | ||
| 1571 | + } | ||
| 1572 | + Map<String, String> m=this.strInOut(arrivalList,lzsj); | ||
| 1573 | + | ||
| 1574 | + map2.put(s.getStationCode()+"in", m.get("in")); | ||
| 1575 | + map2.put(s.getStationCode()+"out", m.get("out")); | ||
| 1576 | + map2.put(s.getStationCode(), m.get("type")); | ||
| 1577 | + } | ||
| 1578 | + inoutList.add(map2); | ||
| 1579 | + } catch (ParseException e) { | ||
| 1580 | + // TODO Auto-generated catch block | ||
| 1581 | + e.printStackTrace(); | ||
| 1582 | + } | ||
| 1583 | + } | ||
| 1584 | + return inoutList; | ||
| 1585 | + } | ||
| 1586 | + | ||
| 1587 | + public Map<String, String> strInOut(List<ArrivalInfo> lists,String lzsj){ | ||
| 1588 | + String inout=""; | ||
| 1589 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | ||
| 1590 | + Long in=0L; | ||
| 1591 | + Long out=0L; | ||
| 1592 | + for(int i=0;i<lists.size();i++){ | ||
| 1593 | + ArrivalInfo t1=lists.get(i); | ||
| 1594 | + if(t1.getInOut()==0){ | ||
| 1595 | + in=t1.getTs(); | ||
| 1596 | + t1.setJzsj(sdf.format(new Date(t1.getTs()))); | ||
| 1597 | + for(int j=0;j<lists.size();j++){ | ||
| 1598 | + ArrivalInfo t2=lists.get(j); | ||
| 1599 | + if(t2.getInOut()==1 && t2.getDeviceId().equals(t1.getDeviceId()) | ||
| 1600 | + && t2.getStopNo().equals(t1.getStopNo()) | ||
| 1601 | + && t2.getTs()>t1.getTs()){ | ||
| 1602 | + t1.setCzsj(sdf.format(new Date(t2.getTs()))); | ||
| 1603 | + out =t2.getTs(); | ||
| 1604 | + break; | ||
| 1605 | + } | ||
| 1606 | + } | ||
| 1607 | + | ||
| 1608 | + }else{ | ||
| 1609 | + out =t1.getTs(); | ||
| 1610 | + t1.setCzsj(sdf.format(new Date(t1.getTs()))); | ||
| 1611 | + for(int j=0;j<lists.size();j++){ | ||
| 1612 | + ArrivalInfo t2=lists.get(j); | ||
| 1613 | + if(t2.getInOut()==0 && t2.getDeviceId().equals(t1.getDeviceId()) | ||
| 1614 | + && t2.getStopNo().equals(t1.getStopNo()) | ||
| 1615 | + && t2.getTs()>t1.getTs()){ | ||
| 1616 | + in =t2.getTs(); | ||
| 1617 | + t1.setJzsj(sdf.format(new Date(t2.getTs()))); | ||
| 1618 | + break; | ||
| 1619 | + } | ||
| 1620 | + } | ||
| 1621 | + } | ||
| 1622 | + } | ||
| 1623 | + | ||
| 1624 | + Map<String, String> map=new HashMap<String,String>(); | ||
| 1625 | + if(in>0 ){ | ||
| 1626 | + map.put("in",sdf.format(new Date(in))); | ||
| 1627 | + | ||
| 1628 | + }else{ | ||
| 1629 | + map.put("in", ""); | ||
| 1630 | + } | ||
| 1631 | + if(out>0){ | ||
| 1632 | + map.put("out", sdf.format(new Date(out))); | ||
| 1633 | + }else{ | ||
| 1634 | + map.put("out", ""); | ||
| 1635 | + } | ||
| 1636 | + Long sj=1000000000L; | ||
| 1637 | + if(!lzsj.trim().equals("")){ | ||
| 1638 | + sj =Long.parseLong(lzsj); | ||
| 1639 | + } | ||
| 1640 | + if(in>0 && out >0){ | ||
| 1641 | + if((out-in)/1000>sj){ | ||
| 1642 | + map.put("type", "y"); | ||
| 1643 | + }else{ | ||
| 1644 | + map.put("type", "n"); | ||
| 1645 | + } | ||
| 1646 | + } | ||
| 1647 | + return map; | ||
| 1648 | + } | ||
| 1649 | + @Override | ||
| 1650 | + public List<StationRoute> queryStrinon(String line, int zd) { | ||
| 1651 | + // TODO Auto-generated method stub | ||
| 1652 | + List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); | ||
| 1653 | + return listStation; | ||
| 1654 | + } | ||
| 1472 | } | 1655 | } |
src/main/resources/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<transformation> | ||
| 3 | - <info> | ||
| 4 | - <name>时刻表明细导出元数据</name> | ||
| 5 | - <description/> | ||
| 6 | - <extended_description/> | ||
| 7 | - <trans_version/> | ||
| 8 | - <trans_type>Normal</trans_type> | ||
| 9 | - <trans_status>0</trans_status> | ||
| 10 | - <directory>/</directory> | ||
| 11 | - <parameters> | ||
| 12 | - <parameter> | ||
| 13 | - <name>filepath</name> | ||
| 14 | - <default_value>/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/ttinfodetail_test.xls</default_value> | ||
| 15 | - <description>时刻表excel导出文件路径名</description> | ||
| 16 | - </parameter> | ||
| 17 | - <parameter> | ||
| 18 | - <name>injectktrfile</name> | ||
| 19 | - <default_value>/Users/xu/resource/project_code/bsth_project/bsth_control/src/main/resources/datatools/ktrs/ttinfodetailDataOutput.ktr</default_value> | ||
| 20 | - <description>注入元数据的ktr文件</description> | ||
| 21 | - </parameter> | ||
| 22 | - <parameter> | ||
| 23 | - <name>ttinfoid</name> | ||
| 24 | - <default_value>56</default_value> | ||
| 25 | - <description>时刻表id</description> | ||
| 26 | - </parameter> | ||
| 27 | - </parameters> | ||
| 28 | - <log> | ||
| 29 | -<trans-log-table><connection/> | ||
| 30 | -<schema/> | ||
| 31 | -<table/> | ||
| 32 | -<size_limit_lines/> | ||
| 33 | -<interval/> | ||
| 34 | -<timeout_days/> | ||
| 35 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table> | ||
| 36 | -<perf-log-table><connection/> | ||
| 37 | -<schema/> | ||
| 38 | -<table/> | ||
| 39 | -<interval/> | ||
| 40 | -<timeout_days/> | ||
| 41 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table> | ||
| 42 | -<channel-log-table><connection/> | ||
| 43 | -<schema/> | ||
| 44 | -<table/> | ||
| 45 | -<timeout_days/> | ||
| 46 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table> | ||
| 47 | -<step-log-table><connection/> | ||
| 48 | -<schema/> | ||
| 49 | -<table/> | ||
| 50 | -<timeout_days/> | ||
| 51 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table> | ||
| 52 | -<metrics-log-table><connection/> | ||
| 53 | -<schema/> | ||
| 54 | -<table/> | ||
| 55 | -<timeout_days/> | ||
| 56 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table> | ||
| 57 | - </log> | ||
| 58 | - <maxdate> | ||
| 59 | - <connection/> | ||
| 60 | - <table/> | ||
| 61 | - <field/> | ||
| 62 | - <offset>0.0</offset> | ||
| 63 | - <maxdiff>0.0</maxdiff> | ||
| 64 | - </maxdate> | ||
| 65 | - <size_rowset>10000</size_rowset> | ||
| 66 | - <sleep_time_empty>50</sleep_time_empty> | ||
| 67 | - <sleep_time_full>50</sleep_time_full> | ||
| 68 | - <unique_connections>N</unique_connections> | ||
| 69 | - <feedback_shown>Y</feedback_shown> | ||
| 70 | - <feedback_size>50000</feedback_size> | ||
| 71 | - <using_thread_priorities>Y</using_thread_priorities> | ||
| 72 | - <shared_objects_file/> | ||
| 73 | - <capture_step_performance>N</capture_step_performance> | ||
| 74 | - <step_performance_capturing_delay>1000</step_performance_capturing_delay> | ||
| 75 | - <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit> | ||
| 76 | - <dependencies> | ||
| 77 | - </dependencies> | ||
| 78 | - <partitionschemas> | ||
| 79 | - </partitionschemas> | ||
| 80 | - <slaveservers> | ||
| 81 | - </slaveservers> | ||
| 82 | - <clusterschemas> | ||
| 83 | - </clusterschemas> | ||
| 84 | - <created_user>-</created_user> | ||
| 85 | - <created_date>2016/11/15 15:02:41.624</created_date> | ||
| 86 | - <modified_user>-</modified_user> | ||
| 87 | - <modified_date>2016/11/15 15:02:41.624</modified_date> | ||
| 88 | - <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key> | ||
| 89 | - <is_key_private>N</is_key_private> | ||
| 90 | - </info> | ||
| 91 | - <notepads> | ||
| 92 | - <notepad> | ||
| 93 | - <note>TODO:如果groupby 加入bctype,
则以发车顺序号,班次类型分组的数据可能重复,
应为班次类型可能不一样(导入之后人为修改的,如正常班次改成区间),
因为导出时必须数据不重复,这里的解决方法,只使用发车顺序号分组,
以后建议,还是原来的方式分组,然后把更新时间晚的去除

以后改成去除重复纪录</note> | ||
| 94 | - <xloc>37</xloc> | ||
| 95 | - <yloc>309</yloc> | ||
| 96 | - <width>406</width> | ||
| 97 | - <heigth>122</heigth> | ||
| 98 | - <fontname>YaHei Consolas Hybrid</fontname> | ||
| 99 | - <fontsize>12</fontsize> | ||
| 100 | - <fontbold>N</fontbold> | ||
| 101 | - <fontitalic>N</fontitalic> | ||
| 102 | - <fontcolorred>0</fontcolorred> | ||
| 103 | - <fontcolorgreen>0</fontcolorgreen> | ||
| 104 | - <fontcolorblue>0</fontcolorblue> | ||
| 105 | - <backgroundcolorred>255</backgroundcolorred> | ||
| 106 | - <backgroundcolorgreen>205</backgroundcolorgreen> | ||
| 107 | - <backgroundcolorblue>112</backgroundcolorblue> | ||
| 108 | - <bordercolorred>100</bordercolorred> | ||
| 109 | - <bordercolorgreen>100</bordercolorgreen> | ||
| 110 | - <bordercolorblue>100</bordercolorblue> | ||
| 111 | - <drawshadow>Y</drawshadow> | ||
| 112 | - </notepad> | ||
| 113 | - </notepads> | ||
| 114 | - <connection> | ||
| 115 | - <name>192.168.168.1_jwgl_dw</name> | ||
| 116 | - <server>192.168.168.1</server> | ||
| 117 | - <type>ORACLE</type> | ||
| 118 | - <access>Native</access> | ||
| 119 | - <database>orcl</database> | ||
| 120 | - <port>1521</port> | ||
| 121 | - <username>jwgl_dw</username> | ||
| 122 | - <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password> | ||
| 123 | - <servername/> | ||
| 124 | - <data_tablespace/> | ||
| 125 | - <index_tablespace/> | ||
| 126 | - <attributes> | ||
| 127 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 128 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 129 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 130 | - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 131 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 132 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 133 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 134 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 135 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 136 | - </attributes> | ||
| 137 | - </connection> | ||
| 138 | - <connection> | ||
| 139 | - <name>bus_control_variable</name> | ||
| 140 | - <server>${v_db_ip}</server> | ||
| 141 | - <type>MYSQL</type> | ||
| 142 | - <access>Native</access> | ||
| 143 | - <database>${v_db_dname}</database> | ||
| 144 | - <port>3306</port> | ||
| 145 | - <username>${v_db_uname}</username> | ||
| 146 | - <password>${v_db_pwd}</password> | ||
| 147 | - <servername/> | ||
| 148 | - <data_tablespace/> | ||
| 149 | - <index_tablespace/> | ||
| 150 | - <attributes> | ||
| 151 | - <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute> | ||
| 152 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 153 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 154 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 155 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 156 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 157 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 158 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 159 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 160 | - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 161 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 162 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 163 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 164 | - </attributes> | ||
| 165 | - </connection> | ||
| 166 | - <connection> | ||
| 167 | - <name>bus_control_公司_201</name> | ||
| 168 | - <server>localhost</server> | ||
| 169 | - <type>MYSQL</type> | ||
| 170 | - <access>Native</access> | ||
| 171 | - <database>control</database> | ||
| 172 | - <port>3306</port> | ||
| 173 | - <username>root</username> | ||
| 174 | - <password>Encrypted </password> | ||
| 175 | - <servername/> | ||
| 176 | - <data_tablespace/> | ||
| 177 | - <index_tablespace/> | ||
| 178 | - <attributes> | ||
| 179 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 180 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 181 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 182 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 183 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 184 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 185 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 186 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 187 | - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 188 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 189 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 190 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 191 | - </attributes> | ||
| 192 | - </connection> | ||
| 193 | - <connection> | ||
| 194 | - <name>bus_control_本机</name> | ||
| 195 | - <server>localhost</server> | ||
| 196 | - <type>MYSQL</type> | ||
| 197 | - <access>Native</access> | ||
| 198 | - <database>control</database> | ||
| 199 | - <port>3306</port> | ||
| 200 | - <username>root</username> | ||
| 201 | - <password>Encrypted </password> | ||
| 202 | - <servername/> | ||
| 203 | - <data_tablespace/> | ||
| 204 | - <index_tablespace/> | ||
| 205 | - <attributes> | ||
| 206 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 207 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 208 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 209 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 210 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 211 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 212 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 213 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 214 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 215 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 216 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 217 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 218 | - </attributes> | ||
| 219 | - </connection> | ||
| 220 | - <connection> | ||
| 221 | - <name>xlab_mysql_youle</name> | ||
| 222 | - <server>101.231.124.8</server> | ||
| 223 | - <type>MYSQL</type> | ||
| 224 | - <access>Native</access> | ||
| 225 | - <database>xlab_youle</database> | ||
| 226 | - <port>45687</port> | ||
| 227 | - <username>xlab-youle</username> | ||
| 228 | - <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password> | ||
| 229 | - <servername/> | ||
| 230 | - <data_tablespace/> | ||
| 231 | - <index_tablespace/> | ||
| 232 | - <attributes> | ||
| 233 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 234 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 235 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 236 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 237 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 238 | - <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute> | ||
| 239 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 240 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 241 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 242 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 243 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 244 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 245 | - </attributes> | ||
| 246 | - </connection> | ||
| 247 | - <connection> | ||
| 248 | - <name>xlab_mysql_youle(本机)</name> | ||
| 249 | - <server>localhost</server> | ||
| 250 | - <type>MYSQL</type> | ||
| 251 | - <access>Native</access> | ||
| 252 | - <database>xlab_youle</database> | ||
| 253 | - <port>3306</port> | ||
| 254 | - <username>root</username> | ||
| 255 | - <password>Encrypted </password> | ||
| 256 | - <servername/> | ||
| 257 | - <data_tablespace/> | ||
| 258 | - <index_tablespace/> | ||
| 259 | - <attributes> | ||
| 260 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 261 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 262 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 263 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 264 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 265 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 266 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 267 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 268 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 269 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 270 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 271 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 272 | - </attributes> | ||
| 273 | - </connection> | ||
| 274 | - <connection> | ||
| 275 | - <name>xlab_youle</name> | ||
| 276 | - <server/> | ||
| 277 | - <type>MYSQL</type> | ||
| 278 | - <access>JNDI</access> | ||
| 279 | - <database>xlab_youle</database> | ||
| 280 | - <port>1521</port> | ||
| 281 | - <username/> | ||
| 282 | - <password>Encrypted </password> | ||
| 283 | - <servername/> | ||
| 284 | - <data_tablespace/> | ||
| 285 | - <index_tablespace/> | ||
| 286 | - <attributes> | ||
| 287 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 288 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 289 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 290 | - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 291 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 292 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 293 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 294 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 295 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 296 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 297 | - </attributes> | ||
| 298 | - </connection> | ||
| 299 | - <order> | ||
| 300 | - <hop> <from>时刻表明细分组数据</from><to>过滤记录</to><enabled>Y</enabled> </hop> | ||
| 301 | - <hop> <from>过滤记录</from><to>计算站点</to><enabled>Y</enabled> </hop> | ||
| 302 | - <hop> <from>计算站点</from><to>查找站点名</to><enabled>Y</enabled> </hop> | ||
| 303 | - <hop> <from>查找站点名</from><to>计算反范式元数据</to><enabled>Y</enabled> </hop> | ||
| 304 | - <hop> <from>查找站点名</from><to>计算excel输出字段</to><enabled>Y</enabled> </hop> | ||
| 305 | - <hop> <from>计算excel输出字段</from><to>字段选择</to><enabled>Y</enabled> </hop> | ||
| 306 | - <hop> <from>字段选择</from><to>排序记录</to><enabled>Y</enabled> </hop> | ||
| 307 | - <hop> <from>生成路牌字段</from><to>排序记录</to><enabled>Y</enabled> </hop> | ||
| 308 | - <hop> <from>计算反范式元数据</from><to>ETL元数据注入</to><enabled>Y</enabled> </hop> | ||
| 309 | - <hop> <from>排序记录</from><to>ETL元数据注入</to><enabled>Y</enabled> </hop> | ||
| 310 | - </order> | ||
| 311 | - <step> | ||
| 312 | - <name>ETL元数据注入</name> | ||
| 313 | - <type>MetaInject</type> | ||
| 314 | - <description/> | ||
| 315 | - <distribute>Y</distribute> | ||
| 316 | - <custom_distribution/> | ||
| 317 | - <copies>1</copies> | ||
| 318 | - <partitioning> | ||
| 319 | - <method>none</method> | ||
| 320 | - <schema_name/> | ||
| 321 | - </partitioning> | ||
| 322 | - <specification_method>filename</specification_method> | ||
| 323 | - <trans_object_id/> | ||
| 324 | - <trans_name/> | ||
| 325 | - <filename>${injectktrfile}</filename> | ||
| 326 | - <directory_path/> | ||
| 327 | - <source_step/> | ||
| 328 | - <source_output_fields> </source_output_fields> <target_file/> | ||
| 329 | - <no_execution>N</no_execution> | ||
| 330 | - <stream_source_step/> | ||
| 331 | - <stream_target_step/> | ||
| 332 | - <mappings> <mapping> <target_step_name>列转行</target_step_name> | ||
| 333 | - <target_attribute_key>TARGET_TYPE</target_attribute_key> | ||
| 334 | - <target_detail>Y</target_detail> | ||
| 335 | - <source_step>计算反范式元数据</source_step> | ||
| 336 | - <source_field>targettype</source_field> | ||
| 337 | - </mapping> <mapping> <target_step_name>Excel输出</target_step_name> | ||
| 338 | - <target_attribute_key>TYPE</target_attribute_key> | ||
| 339 | - <target_detail>Y</target_detail> | ||
| 340 | - <source_step>排序记录</source_step> | ||
| 341 | - <source_field>fieldtype</source_field> | ||
| 342 | - </mapping> <mapping> <target_step_name>列转行</target_step_name> | ||
| 343 | - <target_attribute_key>NAME</target_attribute_key> | ||
| 344 | - <target_detail>Y</target_detail> | ||
| 345 | - <source_step>计算反范式元数据</source_step> | ||
| 346 | - <source_field>valuefieldname</source_field> | ||
| 347 | - </mapping> <mapping> <target_step_name>Excel输出</target_step_name> | ||
| 348 | - <target_attribute_key>NAME</target_attribute_key> | ||
| 349 | - <target_detail>Y</target_detail> | ||
| 350 | - <source_step>排序记录</source_step> | ||
| 351 | - <source_field>fieldname</source_field> | ||
| 352 | - </mapping> <mapping> <target_step_name>列转行</target_step_name> | ||
| 353 | - <target_attribute_key>TARGET_NAME</target_attribute_key> | ||
| 354 | - <target_detail>Y</target_detail> | ||
| 355 | - <source_step>计算反范式元数据</source_step> | ||
| 356 | - <source_field>targetfieldname</source_field> | ||
| 357 | - </mapping> <mapping> <target_step_name>列转行</target_step_name> | ||
| 358 | - <target_attribute_key>KEY_VALUE</target_attribute_key> | ||
| 359 | - <target_detail>Y</target_detail> | ||
| 360 | - <source_step>计算反范式元数据</source_step> | ||
| 361 | - <source_field>keyvalue</source_field> | ||
| 362 | - </mapping> </mappings> <cluster_schema/> | ||
| 363 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 364 | - <xloc>640</xloc> | ||
| 365 | - <yloc>64</yloc> | ||
| 366 | - <draw>Y</draw> | ||
| 367 | - </GUI> | ||
| 368 | - </step> | ||
| 369 | - | ||
| 370 | - <step> | ||
| 371 | - <name>字段选择</name> | ||
| 372 | - <type>SelectValues</type> | ||
| 373 | - <description/> | ||
| 374 | - <distribute>Y</distribute> | ||
| 375 | - <custom_distribution/> | ||
| 376 | - <copies>1</copies> | ||
| 377 | - <partitioning> | ||
| 378 | - <method>none</method> | ||
| 379 | - <schema_name/> | ||
| 380 | - </partitioning> | ||
| 381 | - <fields> <field> <name>fieldname</name> | ||
| 382 | - <rename/> | ||
| 383 | - <length>-2</length> | ||
| 384 | - <precision>-2</precision> | ||
| 385 | - </field> <field> <name>fieldtype</name> | ||
| 386 | - <rename/> | ||
| 387 | - <length>-2</length> | ||
| 388 | - <precision>-2</precision> | ||
| 389 | - </field> <field> <name>fcno</name> | ||
| 390 | - <rename/> | ||
| 391 | - <length>-2</length> | ||
| 392 | - <precision>-2</precision> | ||
| 393 | - </field> <select_unspecified>N</select_unspecified> | ||
| 394 | - </fields> <cluster_schema/> | ||
| 395 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 396 | - <xloc>533</xloc> | ||
| 397 | - <yloc>325</yloc> | ||
| 398 | - <draw>Y</draw> | ||
| 399 | - </GUI> | ||
| 400 | - </step> | ||
| 401 | - | ||
| 402 | - <step> | ||
| 403 | - <name>排序记录</name> | ||
| 404 | - <type>SortRows</type> | ||
| 405 | - <description/> | ||
| 406 | - <distribute>Y</distribute> | ||
| 407 | - <custom_distribution/> | ||
| 408 | - <copies>1</copies> | ||
| 409 | - <partitioning> | ||
| 410 | - <method>none</method> | ||
| 411 | - <schema_name/> | ||
| 412 | - </partitioning> | ||
| 413 | - <directory>%%java.io.tmpdir%%</directory> | ||
| 414 | - <prefix>out</prefix> | ||
| 415 | - <sort_size>1000000</sort_size> | ||
| 416 | - <free_memory/> | ||
| 417 | - <compress>N</compress> | ||
| 418 | - <compress_variable/> | ||
| 419 | - <unique_rows>N</unique_rows> | ||
| 420 | - <fields> | ||
| 421 | - <field> | ||
| 422 | - <name>fcno</name> | ||
| 423 | - <ascending>Y</ascending> | ||
| 424 | - <case_sensitive>N</case_sensitive> | ||
| 425 | - <presorted>N</presorted> | ||
| 426 | - </field> | ||
| 427 | - </fields> | ||
| 428 | - <cluster_schema/> | ||
| 429 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 430 | - <xloc>642</xloc> | ||
| 431 | - <yloc>325</yloc> | ||
| 432 | - <draw>Y</draw> | ||
| 433 | - </GUI> | ||
| 434 | - </step> | ||
| 435 | - | ||
| 436 | - <step> | ||
| 437 | - <name>时刻表明细分组数据</name> | ||
| 438 | - <type>TableInput</type> | ||
| 439 | - <description/> | ||
| 440 | - <distribute>Y</distribute> | ||
| 441 | - <custom_distribution/> | ||
| 442 | - <copies>1</copies> | ||
| 443 | - <partitioning> | ||
| 444 | - <method>none</method> | ||
| 445 | - <schema_name/> | ||
| 446 | - </partitioning> | ||
| 447 | - <connection>bus_control_variable</connection> | ||
| 448 | - <sql>select 
fcno
, min(xl) xl 
, min(xl_dir) xl_dir
, min(qdz_code) qdz
, min(zdz_code) zdz
, min(bc_type) bc_type 
from bsth_c_s_ttinfo_detail
where ttinfo = ${ttinfoid}
group by fcno</sql> | ||
| 449 | - <limit>0</limit> | ||
| 450 | - <lookup/> | ||
| 451 | - <execute_each_row>N</execute_each_row> | ||
| 452 | - <variables_active>Y</variables_active> | ||
| 453 | - <lazy_conversion_active>N</lazy_conversion_active> | ||
| 454 | - <cluster_schema/> | ||
| 455 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 456 | - <xloc>56</xloc> | ||
| 457 | - <yloc>185</yloc> | ||
| 458 | - <draw>Y</draw> | ||
| 459 | - </GUI> | ||
| 460 | - </step> | ||
| 461 | - | ||
| 462 | - <step> | ||
| 463 | - <name>查找站点名</name> | ||
| 464 | - <type>DBLookup</type> | ||
| 465 | - <description/> | ||
| 466 | - <distribute>N</distribute> | ||
| 467 | - <custom_distribution/> | ||
| 468 | - <copies>1</copies> | ||
| 469 | - <partitioning> | ||
| 470 | - <method>none</method> | ||
| 471 | - <schema_name/> | ||
| 472 | - </partitioning> | ||
| 473 | - <connection>bus_control_variable</connection> | ||
| 474 | - <cache>N</cache> | ||
| 475 | - <cache_load_all>Y</cache_load_all> | ||
| 476 | - <cache_size>0</cache_size> | ||
| 477 | - <lookup> | ||
| 478 | - <schema/> | ||
| 479 | - <table>bsth_c_stationroute</table> | ||
| 480 | - <orderby/> | ||
| 481 | - <fail_on_multiple>N</fail_on_multiple> | ||
| 482 | - <eat_row_on_failure>N</eat_row_on_failure> | ||
| 483 | - <key> | ||
| 484 | - <name>xl</name> | ||
| 485 | - <field>line</field> | ||
| 486 | - <condition>=</condition> | ||
| 487 | - <name2/> | ||
| 488 | - </key> | ||
| 489 | - <key> | ||
| 490 | - <name>xl_dir</name> | ||
| 491 | - <field>directions</field> | ||
| 492 | - <condition>=</condition> | ||
| 493 | - <name2/> | ||
| 494 | - </key> | ||
| 495 | - <key> | ||
| 496 | - <name>zd</name> | ||
| 497 | - <field>station_code</field> | ||
| 498 | - <condition>=</condition> | ||
| 499 | - <name2/> | ||
| 500 | - </key> | ||
| 501 | - <value> | ||
| 502 | - <name>station_name</name> | ||
| 503 | - <rename>zdname</rename> | ||
| 504 | - <default/> | ||
| 505 | - <type>String</type> | ||
| 506 | - </value> | ||
| 507 | - </lookup> | ||
| 508 | - <cluster_schema/> | ||
| 509 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 510 | - <xloc>410</xloc> | ||
| 511 | - <yloc>191</yloc> | ||
| 512 | - <draw>Y</draw> | ||
| 513 | - </GUI> | ||
| 514 | - </step> | ||
| 515 | - | ||
| 516 | - <step> | ||
| 517 | - <name>生成路牌字段</name> | ||
| 518 | - <type>RowGenerator</type> | ||
| 519 | - <description/> | ||
| 520 | - <distribute>Y</distribute> | ||
| 521 | - <custom_distribution/> | ||
| 522 | - <copies>1</copies> | ||
| 523 | - <partitioning> | ||
| 524 | - <method>none</method> | ||
| 525 | - <schema_name/> | ||
| 526 | - </partitioning> | ||
| 527 | - <fields> | ||
| 528 | - <field> | ||
| 529 | - <name>fieldname</name> | ||
| 530 | - <type>String</type> | ||
| 531 | - <format/> | ||
| 532 | - <currency/> | ||
| 533 | - <decimal/> | ||
| 534 | - <group/> | ||
| 535 | - <nullif>路牌</nullif> | ||
| 536 | - <length>-1</length> | ||
| 537 | - <precision>-1</precision> | ||
| 538 | - <set_empty_string>N</set_empty_string> | ||
| 539 | - </field> | ||
| 540 | - <field> | ||
| 541 | - <name>fieldtype</name> | ||
| 542 | - <type>String</type> | ||
| 543 | - <format/> | ||
| 544 | - <currency/> | ||
| 545 | - <decimal/> | ||
| 546 | - <group/> | ||
| 547 | - <nullif>String</nullif> | ||
| 548 | - <length>-1</length> | ||
| 549 | - <precision>-1</precision> | ||
| 550 | - <set_empty_string>N</set_empty_string> | ||
| 551 | - </field> | ||
| 552 | - <field> | ||
| 553 | - <name>fcno</name> | ||
| 554 | - <type>Integer</type> | ||
| 555 | - <format/> | ||
| 556 | - <currency/> | ||
| 557 | - <decimal/> | ||
| 558 | - <group/> | ||
| 559 | - <nullif>0</nullif> | ||
| 560 | - <length>-1</length> | ||
| 561 | - <precision>-1</precision> | ||
| 562 | - <set_empty_string>N</set_empty_string> | ||
| 563 | - </field> | ||
| 564 | - </fields> | ||
| 565 | - <limit>1</limit> | ||
| 566 | - <never_ending>N</never_ending> | ||
| 567 | - <interval_in_ms>5000</interval_in_ms> | ||
| 568 | - <row_time_field>now</row_time_field> | ||
| 569 | - <last_time_field>FiveSecondsAgo</last_time_field> | ||
| 570 | - <cluster_schema/> | ||
| 571 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 572 | - <xloc>530</xloc> | ||
| 573 | - <yloc>194</yloc> | ||
| 574 | - <draw>Y</draw> | ||
| 575 | - </GUI> | ||
| 576 | - </step> | ||
| 577 | - | ||
| 578 | - <step> | ||
| 579 | - <name>计算excel输出字段</name> | ||
| 580 | - <type>ScriptValueMod</type> | ||
| 581 | - <description/> | ||
| 582 | - <distribute>Y</distribute> | ||
| 583 | - <custom_distribution/> | ||
| 584 | - <copies>1</copies> | ||
| 585 | - <partitioning> | ||
| 586 | - <method>none</method> | ||
| 587 | - <schema_name/> | ||
| 588 | - </partitioning> | ||
| 589 | - <compatible>N</compatible> | ||
| 590 | - <optimizationLevel>9</optimizationLevel> | ||
| 591 | - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | ||
| 592 | - <jsScript_name>Script 1</jsScript_name> | ||
| 593 | - <jsScript_script>//Script here

var fieldname; // 字段名
var fieldtype; // 字段类型

if (bc_type == 'in') {
 fieldname = '进场' + fcno;
} else if (bc_type == 'out') {
 fieldname = '出场' + fcno;
} else if (bc_type == 'normal') {
 fieldname = zdname + fcno;
} else {
 fieldname = zdname + fcno;
} 

fieldtype = 'String';
</jsScript_script> | ||
| 594 | - </jsScript> </jsScripts> <fields> <field> <name>fieldname</name> | ||
| 595 | - <rename>fieldname</rename> | ||
| 596 | - <type>String</type> | ||
| 597 | - <length>-1</length> | ||
| 598 | - <precision>-1</precision> | ||
| 599 | - <replace>N</replace> | ||
| 600 | - </field> <field> <name>fieldtype</name> | ||
| 601 | - <rename>fieldtype</rename> | ||
| 602 | - <type>String</type> | ||
| 603 | - <length>-1</length> | ||
| 604 | - <precision>-1</precision> | ||
| 605 | - <replace>N</replace> | ||
| 606 | - </field> </fields> <cluster_schema/> | ||
| 607 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 608 | - <xloc>410</xloc> | ||
| 609 | - <yloc>326</yloc> | ||
| 610 | - <draw>Y</draw> | ||
| 611 | - </GUI> | ||
| 612 | - </step> | ||
| 613 | - | ||
| 614 | - <step> | ||
| 615 | - <name>计算反范式元数据</name> | ||
| 616 | - <type>ScriptValueMod</type> | ||
| 617 | - <description/> | ||
| 618 | - <distribute>Y</distribute> | ||
| 619 | - <custom_distribution/> | ||
| 620 | - <copies>1</copies> | ||
| 621 | - <partitioning> | ||
| 622 | - <method>none</method> | ||
| 623 | - <schema_name/> | ||
| 624 | - </partitioning> | ||
| 625 | - <compatible>N</compatible> | ||
| 626 | - <optimizationLevel>9</optimizationLevel> | ||
| 627 | - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | ||
| 628 | - <jsScript_name>Script 1</jsScript_name> | ||
| 629 | - <jsScript_script>//Script here

var targetfieldname; // 目标字段名
var targettype; // 目标类型
var valuefieldname; // 值字段名
var keyvalue; // 关键字值

if (bc_type == 'in') {
 targetfieldname = '进场' + fcno;
} else if (bc_type == 'out') {
 targetfieldname = '出场' + fcno;
} else if (bc_type == 'normal') {
 targetfieldname = zdname + fcno;
} else {
 targetfieldname = zdname + fcno;
} 

targettype = 'String';
valuefieldname = 'fcsj';
keyvalue = fcno;
</jsScript_script> | ||
| 630 | - </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name> | ||
| 631 | - <rename>targetfieldname</rename> | ||
| 632 | - <type>String</type> | ||
| 633 | - <length>-1</length> | ||
| 634 | - <precision>-1</precision> | ||
| 635 | - <replace>N</replace> | ||
| 636 | - </field> <field> <name>targettype</name> | ||
| 637 | - <rename>targettype</rename> | ||
| 638 | - <type>String</type> | ||
| 639 | - <length>-1</length> | ||
| 640 | - <precision>-1</precision> | ||
| 641 | - <replace>N</replace> | ||
| 642 | - </field> <field> <name>valuefieldname</name> | ||
| 643 | - <rename>valuefieldname</rename> | ||
| 644 | - <type>String</type> | ||
| 645 | - <length>-1</length> | ||
| 646 | - <precision>-1</precision> | ||
| 647 | - <replace>N</replace> | ||
| 648 | - </field> <field> <name>keyvalue</name> | ||
| 649 | - <rename>keyvalue</rename> | ||
| 650 | - <type>String</type> | ||
| 651 | - <length>-1</length> | ||
| 652 | - <precision>-1</precision> | ||
| 653 | - <replace>N</replace> | ||
| 654 | - </field> </fields> <cluster_schema/> | ||
| 655 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 656 | - <xloc>410</xloc> | ||
| 657 | - <yloc>64</yloc> | ||
| 658 | - <draw>Y</draw> | ||
| 659 | - </GUI> | ||
| 660 | - </step> | ||
| 661 | - | ||
| 662 | - <step> | ||
| 663 | - <name>计算站点</name> | ||
| 664 | - <type>ScriptValueMod</type> | ||
| 665 | - <description/> | ||
| 666 | - <distribute>Y</distribute> | ||
| 667 | - <custom_distribution/> | ||
| 668 | - <copies>1</copies> | ||
| 669 | - <partitioning> | ||
| 670 | - <method>none</method> | ||
| 671 | - <schema_name/> | ||
| 672 | - </partitioning> | ||
| 673 | - <compatible>N</compatible> | ||
| 674 | - <optimizationLevel>9</optimizationLevel> | ||
| 675 | - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | ||
| 676 | - <jsScript_name>Script 1</jsScript_name> | ||
| 677 | - <jsScript_script>//Script here

var zd;

if (bc_type == 'in') {
 zd = qdz;
} else if (bc_type == 'out') {
 zd = zdz;
} else if (bc_type == 'normal') {
 zd = qdz;
} else {
 zd = qdz;
}
</jsScript_script> | ||
| 678 | - </jsScript> </jsScripts> <fields> <field> <name>zd</name> | ||
| 679 | - <rename>zd</rename> | ||
| 680 | - <type>String</type> | ||
| 681 | - <length>-1</length> | ||
| 682 | - <precision>-1</precision> | ||
| 683 | - <replace>N</replace> | ||
| 684 | - </field> </fields> <cluster_schema/> | ||
| 685 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 686 | - <xloc>300</xloc> | ||
| 687 | - <yloc>190</yloc> | ||
| 688 | - <draw>Y</draw> | ||
| 689 | - </GUI> | ||
| 690 | - </step> | ||
| 691 | - | ||
| 692 | - <step> | ||
| 693 | - <name>过滤记录</name> | ||
| 694 | - <type>FilterRows</type> | ||
| 695 | - <description/> | ||
| 696 | - <distribute>Y</distribute> | ||
| 697 | - <custom_distribution/> | ||
| 698 | - <copies>1</copies> | ||
| 699 | - <partitioning> | ||
| 700 | - <method>none</method> | ||
| 701 | - <schema_name/> | ||
| 702 | - </partitioning> | ||
| 703 | -<send_true_to/> | ||
| 704 | -<send_false_to/> | ||
| 705 | - <compare> | ||
| 706 | -<condition> | ||
| 707 | - <negated>N</negated> | ||
| 708 | - <leftvalue>bc_type</leftvalue> | ||
| 709 | - <function>IS NOT NULL</function> | ||
| 710 | - <rightvalue/> | ||
| 711 | - </condition> | ||
| 712 | - </compare> | ||
| 713 | - <cluster_schema/> | ||
| 714 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 715 | - <xloc>182</xloc> | ||
| 716 | - <yloc>189</yloc> | ||
| 717 | - <draw>Y</draw> | ||
| 718 | - </GUI> | ||
| 719 | - </step> | ||
| 720 | - | ||
| 721 | - <step> | ||
| 722 | - <name>去除重复记录</name> | ||
| 723 | - <type>Unique</type> | ||
| 724 | - <description/> | ||
| 725 | - <distribute>Y</distribute> | ||
| 726 | - <custom_distribution/> | ||
| 727 | - <copies>1</copies> | ||
| 728 | - <partitioning> | ||
| 729 | - <method>none</method> | ||
| 730 | - <schema_name/> | ||
| 731 | - </partitioning> | ||
| 732 | - <count_rows>N</count_rows> | ||
| 733 | - <count_field/> | ||
| 734 | - <reject_duplicate_row>N</reject_duplicate_row> | ||
| 735 | - <error_description/> | ||
| 736 | - <fields> </fields> <cluster_schema/> | ||
| 737 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 738 | - <xloc>842</xloc> | ||
| 739 | - <yloc>592</yloc> | ||
| 740 | - <draw>Y</draw> | ||
| 741 | - </GUI> | ||
| 742 | - </step> | ||
| 743 | - | ||
| 744 | - <step_error_handling> | ||
| 745 | - </step_error_handling> | ||
| 746 | - <slave-step-copy-partition-distribution> | ||
| 747 | -</slave-step-copy-partition-distribution> | ||
| 748 | - <slave_transformation>N</slave_transformation> | ||
| 749 | - | ||
| 750 | -</transformation> | 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<transformation> | ||
| 3 | + <info> | ||
| 4 | + <name>时刻表明细导出元数据</name> | ||
| 5 | + <description/> | ||
| 6 | + <extended_description/> | ||
| 7 | + <trans_version/> | ||
| 8 | + <trans_type>Normal</trans_type> | ||
| 9 | + <trans_status>0</trans_status> | ||
| 10 | + <directory>/</directory> | ||
| 11 | + <parameters> | ||
| 12 | + <parameter> | ||
| 13 | + <name>filepath</name> | ||
| 14 | + <default_value>/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/ttinfodetail_test.xls</default_value> | ||
| 15 | + <description>时刻表excel导出文件路径名</description> | ||
| 16 | + </parameter> | ||
| 17 | + <parameter> | ||
| 18 | + <name>injectktrfile</name> | ||
| 19 | + <default_value>/Users/xu/resource/project_code/bsth_project/bsth_control/src/main/resources/datatools/ktrs/ttinfodetailDataOutput.ktr</default_value> | ||
| 20 | + <description>注入元数据的ktr文件</description> | ||
| 21 | + </parameter> | ||
| 22 | + <parameter> | ||
| 23 | + <name>ttinfoid</name> | ||
| 24 | + <default_value>56</default_value> | ||
| 25 | + <description>时刻表id</description> | ||
| 26 | + </parameter> | ||
| 27 | + </parameters> | ||
| 28 | + <log> | ||
| 29 | +<trans-log-table><connection/> | ||
| 30 | +<schema/> | ||
| 31 | +<table/> | ||
| 32 | +<size_limit_lines/> | ||
| 33 | +<interval/> | ||
| 34 | +<timeout_days/> | ||
| 35 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table> | ||
| 36 | +<perf-log-table><connection/> | ||
| 37 | +<schema/> | ||
| 38 | +<table/> | ||
| 39 | +<interval/> | ||
| 40 | +<timeout_days/> | ||
| 41 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table> | ||
| 42 | +<channel-log-table><connection/> | ||
| 43 | +<schema/> | ||
| 44 | +<table/> | ||
| 45 | +<timeout_days/> | ||
| 46 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table> | ||
| 47 | +<step-log-table><connection/> | ||
| 48 | +<schema/> | ||
| 49 | +<table/> | ||
| 50 | +<timeout_days/> | ||
| 51 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table> | ||
| 52 | +<metrics-log-table><connection/> | ||
| 53 | +<schema/> | ||
| 54 | +<table/> | ||
| 55 | +<timeout_days/> | ||
| 56 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table> | ||
| 57 | + </log> | ||
| 58 | + <maxdate> | ||
| 59 | + <connection/> | ||
| 60 | + <table/> | ||
| 61 | + <field/> | ||
| 62 | + <offset>0.0</offset> | ||
| 63 | + <maxdiff>0.0</maxdiff> | ||
| 64 | + </maxdate> | ||
| 65 | + <size_rowset>10000</size_rowset> | ||
| 66 | + <sleep_time_empty>50</sleep_time_empty> | ||
| 67 | + <sleep_time_full>50</sleep_time_full> | ||
| 68 | + <unique_connections>N</unique_connections> | ||
| 69 | + <feedback_shown>Y</feedback_shown> | ||
| 70 | + <feedback_size>50000</feedback_size> | ||
| 71 | + <using_thread_priorities>Y</using_thread_priorities> | ||
| 72 | + <shared_objects_file/> | ||
| 73 | + <capture_step_performance>N</capture_step_performance> | ||
| 74 | + <step_performance_capturing_delay>1000</step_performance_capturing_delay> | ||
| 75 | + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit> | ||
| 76 | + <dependencies> | ||
| 77 | + </dependencies> | ||
| 78 | + <partitionschemas> | ||
| 79 | + </partitionschemas> | ||
| 80 | + <slaveservers> | ||
| 81 | + </slaveservers> | ||
| 82 | + <clusterschemas> | ||
| 83 | + </clusterschemas> | ||
| 84 | + <created_user>-</created_user> | ||
| 85 | + <created_date>2016/11/15 15:02:41.624</created_date> | ||
| 86 | + <modified_user>-</modified_user> | ||
| 87 | + <modified_date>2016/11/15 15:02:41.624</modified_date> | ||
| 88 | + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key> | ||
| 89 | + <is_key_private>N</is_key_private> | ||
| 90 | + </info> | ||
| 91 | + <notepads> | ||
| 92 | + <notepad> | ||
| 93 | + <note>TODO:如果groupby 加入bctype,
则以发车顺序号,班次类型分组的数据可能重复,
应为班次类型可能不一样(导入之后人为修改的,如正常班次改成区间),
因为导出时必须数据不重复,这里的解决方法,只使用发车顺序号分组,
以后建议,还是原来的方式分组,然后把更新时间晚的去除

以后改成去除重复纪录</note> | ||
| 94 | + <xloc>37</xloc> | ||
| 95 | + <yloc>309</yloc> | ||
| 96 | + <width>406</width> | ||
| 97 | + <heigth>122</heigth> | ||
| 98 | + <fontname>YaHei Consolas Hybrid</fontname> | ||
| 99 | + <fontsize>12</fontsize> | ||
| 100 | + <fontbold>N</fontbold> | ||
| 101 | + <fontitalic>N</fontitalic> | ||
| 102 | + <fontcolorred>0</fontcolorred> | ||
| 103 | + <fontcolorgreen>0</fontcolorgreen> | ||
| 104 | + <fontcolorblue>0</fontcolorblue> | ||
| 105 | + <backgroundcolorred>255</backgroundcolorred> | ||
| 106 | + <backgroundcolorgreen>205</backgroundcolorgreen> | ||
| 107 | + <backgroundcolorblue>112</backgroundcolorblue> | ||
| 108 | + <bordercolorred>100</bordercolorred> | ||
| 109 | + <bordercolorgreen>100</bordercolorgreen> | ||
| 110 | + <bordercolorblue>100</bordercolorblue> | ||
| 111 | + <drawshadow>Y</drawshadow> | ||
| 112 | + </notepad> | ||
| 113 | + </notepads> | ||
| 114 | + <connection> | ||
| 115 | + <name>192.168.168.1_jwgl_dw</name> | ||
| 116 | + <server>192.168.168.1</server> | ||
| 117 | + <type>ORACLE</type> | ||
| 118 | + <access>Native</access> | ||
| 119 | + <database>orcl</database> | ||
| 120 | + <port>1521</port> | ||
| 121 | + <username>jwgl_dw</username> | ||
| 122 | + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password> | ||
| 123 | + <servername/> | ||
| 124 | + <data_tablespace/> | ||
| 125 | + <index_tablespace/> | ||
| 126 | + <attributes> | ||
| 127 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 128 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 129 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 130 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 131 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 132 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 133 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 134 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 135 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 136 | + </attributes> | ||
| 137 | + </connection> | ||
| 138 | + <connection> | ||
| 139 | + <name>bus_control_variable</name> | ||
| 140 | + <server>${v_db_ip}</server> | ||
| 141 | + <type>MYSQL</type> | ||
| 142 | + <access>Native</access> | ||
| 143 | + <database>${v_db_dname}</database> | ||
| 144 | + <port>3306</port> | ||
| 145 | + <username>${v_db_uname}</username> | ||
| 146 | + <password>${v_db_pwd}</password> | ||
| 147 | + <servername/> | ||
| 148 | + <data_tablespace/> | ||
| 149 | + <index_tablespace/> | ||
| 150 | + <attributes> | ||
| 151 | + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute> | ||
| 152 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 153 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 154 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 155 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 156 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 157 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 158 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 159 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 160 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 161 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 162 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 163 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 164 | + </attributes> | ||
| 165 | + </connection> | ||
| 166 | + <connection> | ||
| 167 | + <name>bus_control_公司_201</name> | ||
| 168 | + <server>localhost</server> | ||
| 169 | + <type>MYSQL</type> | ||
| 170 | + <access>Native</access> | ||
| 171 | + <database>control</database> | ||
| 172 | + <port>3306</port> | ||
| 173 | + <username>root</username> | ||
| 174 | + <password>Encrypted </password> | ||
| 175 | + <servername/> | ||
| 176 | + <data_tablespace/> | ||
| 177 | + <index_tablespace/> | ||
| 178 | + <attributes> | ||
| 179 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 180 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 181 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 182 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 183 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 184 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 185 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 186 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 187 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 188 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 189 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 190 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 191 | + </attributes> | ||
| 192 | + </connection> | ||
| 193 | + <connection> | ||
| 194 | + <name>bus_control_本机</name> | ||
| 195 | + <server>localhost</server> | ||
| 196 | + <type>MYSQL</type> | ||
| 197 | + <access>Native</access> | ||
| 198 | + <database>control</database> | ||
| 199 | + <port>3306</port> | ||
| 200 | + <username>root</username> | ||
| 201 | + <password>Encrypted </password> | ||
| 202 | + <servername/> | ||
| 203 | + <data_tablespace/> | ||
| 204 | + <index_tablespace/> | ||
| 205 | + <attributes> | ||
| 206 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 207 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 208 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 209 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 210 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 211 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 212 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 213 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 214 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 215 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 216 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 217 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 218 | + </attributes> | ||
| 219 | + </connection> | ||
| 220 | + <connection> | ||
| 221 | + <name>xlab_mysql_youle</name> | ||
| 222 | + <server>101.231.124.8</server> | ||
| 223 | + <type>MYSQL</type> | ||
| 224 | + <access>Native</access> | ||
| 225 | + <database>xlab_youle</database> | ||
| 226 | + <port>45687</port> | ||
| 227 | + <username>xlab-youle</username> | ||
| 228 | + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password> | ||
| 229 | + <servername/> | ||
| 230 | + <data_tablespace/> | ||
| 231 | + <index_tablespace/> | ||
| 232 | + <attributes> | ||
| 233 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 234 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 235 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 236 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 237 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 238 | + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute> | ||
| 239 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 240 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 241 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 242 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 243 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 244 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 245 | + </attributes> | ||
| 246 | + </connection> | ||
| 247 | + <connection> | ||
| 248 | + <name>xlab_mysql_youle(本机)</name> | ||
| 249 | + <server>localhost</server> | ||
| 250 | + <type>MYSQL</type> | ||
| 251 | + <access>Native</access> | ||
| 252 | + <database>xlab_youle</database> | ||
| 253 | + <port>3306</port> | ||
| 254 | + <username>root</username> | ||
| 255 | + <password>Encrypted </password> | ||
| 256 | + <servername/> | ||
| 257 | + <data_tablespace/> | ||
| 258 | + <index_tablespace/> | ||
| 259 | + <attributes> | ||
| 260 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 261 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 262 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 263 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 264 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 265 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 266 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 267 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 268 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 269 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 270 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 271 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 272 | + </attributes> | ||
| 273 | + </connection> | ||
| 274 | + <connection> | ||
| 275 | + <name>xlab_youle</name> | ||
| 276 | + <server/> | ||
| 277 | + <type>MYSQL</type> | ||
| 278 | + <access>JNDI</access> | ||
| 279 | + <database>xlab_youle</database> | ||
| 280 | + <port>1521</port> | ||
| 281 | + <username/> | ||
| 282 | + <password>Encrypted </password> | ||
| 283 | + <servername/> | ||
| 284 | + <data_tablespace/> | ||
| 285 | + <index_tablespace/> | ||
| 286 | + <attributes> | ||
| 287 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 288 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 289 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 290 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 291 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 292 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 293 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 294 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 295 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 296 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 297 | + </attributes> | ||
| 298 | + </connection> | ||
| 299 | + <order> | ||
| 300 | + <hop> <from>时刻表明细分组数据</from><to>过滤记录</to><enabled>Y</enabled> </hop> | ||
| 301 | + <hop> <from>过滤记录</from><to>计算站点</to><enabled>Y</enabled> </hop> | ||
| 302 | + <hop> <from>计算站点</from><to>查找站点名</to><enabled>Y</enabled> </hop> | ||
| 303 | + <hop> <from>查找站点名</from><to>计算反范式元数据</to><enabled>Y</enabled> </hop> | ||
| 304 | + <hop> <from>查找站点名</from><to>计算excel输出字段</to><enabled>Y</enabled> </hop> | ||
| 305 | + <hop> <from>计算excel输出字段</from><to>字段选择</to><enabled>Y</enabled> </hop> | ||
| 306 | + <hop> <from>字段选择</from><to>排序记录</to><enabled>Y</enabled> </hop> | ||
| 307 | + <hop> <from>生成路牌字段</from><to>排序记录</to><enabled>Y</enabled> </hop> | ||
| 308 | + <hop> <from>计算反范式元数据</from><to>ETL元数据注入</to><enabled>Y</enabled> </hop> | ||
| 309 | + <hop> <from>排序记录</from><to>ETL元数据注入</to><enabled>Y</enabled> </hop> | ||
| 310 | + </order> | ||
| 311 | + <step> | ||
| 312 | + <name>ETL元数据注入</name> | ||
| 313 | + <type>MetaInject</type> | ||
| 314 | + <description/> | ||
| 315 | + <distribute>Y</distribute> | ||
| 316 | + <custom_distribution/> | ||
| 317 | + <copies>1</copies> | ||
| 318 | + <partitioning> | ||
| 319 | + <method>none</method> | ||
| 320 | + <schema_name/> | ||
| 321 | + </partitioning> | ||
| 322 | + <specification_method>filename</specification_method> | ||
| 323 | + <trans_object_id/> | ||
| 324 | + <trans_name/> | ||
| 325 | + <filename>${injectktrfile}</filename> | ||
| 326 | + <directory_path/> | ||
| 327 | + <source_step/> | ||
| 328 | + <source_output_fields> </source_output_fields> <target_file/> | ||
| 329 | + <no_execution>N</no_execution> | ||
| 330 | + <stream_source_step/> | ||
| 331 | + <stream_target_step/> | ||
| 332 | + <mappings> <mapping> <target_step_name>列转行</target_step_name> | ||
| 333 | + <target_attribute_key>TARGET_TYPE</target_attribute_key> | ||
| 334 | + <target_detail>Y</target_detail> | ||
| 335 | + <source_step>计算反范式元数据</source_step> | ||
| 336 | + <source_field>targettype</source_field> | ||
| 337 | + </mapping> <mapping> <target_step_name>Excel输出</target_step_name> | ||
| 338 | + <target_attribute_key>TYPE</target_attribute_key> | ||
| 339 | + <target_detail>Y</target_detail> | ||
| 340 | + <source_step>排序记录</source_step> | ||
| 341 | + <source_field>fieldtype</source_field> | ||
| 342 | + </mapping> <mapping> <target_step_name>列转行</target_step_name> | ||
| 343 | + <target_attribute_key>NAME</target_attribute_key> | ||
| 344 | + <target_detail>Y</target_detail> | ||
| 345 | + <source_step>计算反范式元数据</source_step> | ||
| 346 | + <source_field>valuefieldname</source_field> | ||
| 347 | + </mapping> <mapping> <target_step_name>Excel输出</target_step_name> | ||
| 348 | + <target_attribute_key>NAME</target_attribute_key> | ||
| 349 | + <target_detail>Y</target_detail> | ||
| 350 | + <source_step>排序记录</source_step> | ||
| 351 | + <source_field>fieldname</source_field> | ||
| 352 | + </mapping> <mapping> <target_step_name>列转行</target_step_name> | ||
| 353 | + <target_attribute_key>TARGET_NAME</target_attribute_key> | ||
| 354 | + <target_detail>Y</target_detail> | ||
| 355 | + <source_step>计算反范式元数据</source_step> | ||
| 356 | + <source_field>targetfieldname</source_field> | ||
| 357 | + </mapping> <mapping> <target_step_name>列转行</target_step_name> | ||
| 358 | + <target_attribute_key>KEY_VALUE</target_attribute_key> | ||
| 359 | + <target_detail>Y</target_detail> | ||
| 360 | + <source_step>计算反范式元数据</source_step> | ||
| 361 | + <source_field>keyvalue</source_field> | ||
| 362 | + </mapping> </mappings> <cluster_schema/> | ||
| 363 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 364 | + <xloc>640</xloc> | ||
| 365 | + <yloc>64</yloc> | ||
| 366 | + <draw>Y</draw> | ||
| 367 | + </GUI> | ||
| 368 | + </step> | ||
| 369 | + | ||
| 370 | + <step> | ||
| 371 | + <name>字段选择</name> | ||
| 372 | + <type>SelectValues</type> | ||
| 373 | + <description/> | ||
| 374 | + <distribute>Y</distribute> | ||
| 375 | + <custom_distribution/> | ||
| 376 | + <copies>1</copies> | ||
| 377 | + <partitioning> | ||
| 378 | + <method>none</method> | ||
| 379 | + <schema_name/> | ||
| 380 | + </partitioning> | ||
| 381 | + <fields> <field> <name>fieldname</name> | ||
| 382 | + <rename/> | ||
| 383 | + <length>-2</length> | ||
| 384 | + <precision>-2</precision> | ||
| 385 | + </field> <field> <name>fieldtype</name> | ||
| 386 | + <rename/> | ||
| 387 | + <length>-2</length> | ||
| 388 | + <precision>-2</precision> | ||
| 389 | + </field> <field> <name>fcno</name> | ||
| 390 | + <rename/> | ||
| 391 | + <length>-2</length> | ||
| 392 | + <precision>-2</precision> | ||
| 393 | + </field> <select_unspecified>N</select_unspecified> | ||
| 394 | + </fields> <cluster_schema/> | ||
| 395 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 396 | + <xloc>533</xloc> | ||
| 397 | + <yloc>325</yloc> | ||
| 398 | + <draw>Y</draw> | ||
| 399 | + </GUI> | ||
| 400 | + </step> | ||
| 401 | + | ||
| 402 | + <step> | ||
| 403 | + <name>排序记录</name> | ||
| 404 | + <type>SortRows</type> | ||
| 405 | + <description/> | ||
| 406 | + <distribute>Y</distribute> | ||
| 407 | + <custom_distribution/> | ||
| 408 | + <copies>1</copies> | ||
| 409 | + <partitioning> | ||
| 410 | + <method>none</method> | ||
| 411 | + <schema_name/> | ||
| 412 | + </partitioning> | ||
| 413 | + <directory>%%java.io.tmpdir%%</directory> | ||
| 414 | + <prefix>out</prefix> | ||
| 415 | + <sort_size>1000000</sort_size> | ||
| 416 | + <free_memory/> | ||
| 417 | + <compress>N</compress> | ||
| 418 | + <compress_variable/> | ||
| 419 | + <unique_rows>N</unique_rows> | ||
| 420 | + <fields> | ||
| 421 | + <field> | ||
| 422 | + <name>fcno</name> | ||
| 423 | + <ascending>Y</ascending> | ||
| 424 | + <case_sensitive>N</case_sensitive> | ||
| 425 | + <presorted>N</presorted> | ||
| 426 | + </field> | ||
| 427 | + </fields> | ||
| 428 | + <cluster_schema/> | ||
| 429 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 430 | + <xloc>642</xloc> | ||
| 431 | + <yloc>325</yloc> | ||
| 432 | + <draw>Y</draw> | ||
| 433 | + </GUI> | ||
| 434 | + </step> | ||
| 435 | + | ||
| 436 | + <step> | ||
| 437 | + <name>时刻表明细分组数据</name> | ||
| 438 | + <type>TableInput</type> | ||
| 439 | + <description/> | ||
| 440 | + <distribute>Y</distribute> | ||
| 441 | + <custom_distribution/> | ||
| 442 | + <copies>1</copies> | ||
| 443 | + <partitioning> | ||
| 444 | + <method>none</method> | ||
| 445 | + <schema_name/> | ||
| 446 | + </partitioning> | ||
| 447 | + <connection>bus_control_variable</connection> | ||
| 448 | + <sql>select 
fcno
, min(xl) xl 
, min(xl_dir) xl_dir
, min(qdz_code) qdz
, min(zdz_code) zdz
, min(bc_type) bc_type 
from bsth_c_s_ttinfo_detail
where ttinfo = ${ttinfoid}
group by fcno</sql> | ||
| 449 | + <limit>0</limit> | ||
| 450 | + <lookup/> | ||
| 451 | + <execute_each_row>N</execute_each_row> | ||
| 452 | + <variables_active>Y</variables_active> | ||
| 453 | + <lazy_conversion_active>N</lazy_conversion_active> | ||
| 454 | + <cluster_schema/> | ||
| 455 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 456 | + <xloc>56</xloc> | ||
| 457 | + <yloc>185</yloc> | ||
| 458 | + <draw>Y</draw> | ||
| 459 | + </GUI> | ||
| 460 | + </step> | ||
| 461 | + | ||
| 462 | + <step> | ||
| 463 | + <name>查找站点名</name> | ||
| 464 | + <type>DBLookup</type> | ||
| 465 | + <description/> | ||
| 466 | + <distribute>N</distribute> | ||
| 467 | + <custom_distribution/> | ||
| 468 | + <copies>1</copies> | ||
| 469 | + <partitioning> | ||
| 470 | + <method>none</method> | ||
| 471 | + <schema_name/> | ||
| 472 | + </partitioning> | ||
| 473 | + <connection>bus_control_variable</connection> | ||
| 474 | + <cache>N</cache> | ||
| 475 | + <cache_load_all>Y</cache_load_all> | ||
| 476 | + <cache_size>0</cache_size> | ||
| 477 | + <lookup> | ||
| 478 | + <schema/> | ||
| 479 | + <table>bsth_c_stationroute</table> | ||
| 480 | + <orderby/> | ||
| 481 | + <fail_on_multiple>N</fail_on_multiple> | ||
| 482 | + <eat_row_on_failure>N</eat_row_on_failure> | ||
| 483 | + <key> | ||
| 484 | + <name>xl</name> | ||
| 485 | + <field>line</field> | ||
| 486 | + <condition>=</condition> | ||
| 487 | + <name2/> | ||
| 488 | + </key> | ||
| 489 | + <key> | ||
| 490 | + <name>xl_dir</name> | ||
| 491 | + <field>directions</field> | ||
| 492 | + <condition>=</condition> | ||
| 493 | + <name2/> | ||
| 494 | + </key> | ||
| 495 | + <key> | ||
| 496 | + <name>zd</name> | ||
| 497 | + <field>station_code</field> | ||
| 498 | + <condition>=</condition> | ||
| 499 | + <name2/> | ||
| 500 | + </key> | ||
| 501 | + <value> | ||
| 502 | + <name>station_name</name> | ||
| 503 | + <rename>zdname</rename> | ||
| 504 | + <default/> | ||
| 505 | + <type>String</type> | ||
| 506 | + </value> | ||
| 507 | + </lookup> | ||
| 508 | + <cluster_schema/> | ||
| 509 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 510 | + <xloc>410</xloc> | ||
| 511 | + <yloc>191</yloc> | ||
| 512 | + <draw>Y</draw> | ||
| 513 | + </GUI> | ||
| 514 | + </step> | ||
| 515 | + | ||
| 516 | + <step> | ||
| 517 | + <name>生成路牌字段</name> | ||
| 518 | + <type>RowGenerator</type> | ||
| 519 | + <description/> | ||
| 520 | + <distribute>Y</distribute> | ||
| 521 | + <custom_distribution/> | ||
| 522 | + <copies>1</copies> | ||
| 523 | + <partitioning> | ||
| 524 | + <method>none</method> | ||
| 525 | + <schema_name/> | ||
| 526 | + </partitioning> | ||
| 527 | + <fields> | ||
| 528 | + <field> | ||
| 529 | + <name>fieldname</name> | ||
| 530 | + <type>String</type> | ||
| 531 | + <format/> | ||
| 532 | + <currency/> | ||
| 533 | + <decimal/> | ||
| 534 | + <group/> | ||
| 535 | + <nullif>路牌</nullif> | ||
| 536 | + <length>-1</length> | ||
| 537 | + <precision>-1</precision> | ||
| 538 | + <set_empty_string>N</set_empty_string> | ||
| 539 | + </field> | ||
| 540 | + <field> | ||
| 541 | + <name>fieldtype</name> | ||
| 542 | + <type>String</type> | ||
| 543 | + <format/> | ||
| 544 | + <currency/> | ||
| 545 | + <decimal/> | ||
| 546 | + <group/> | ||
| 547 | + <nullif>String</nullif> | ||
| 548 | + <length>-1</length> | ||
| 549 | + <precision>-1</precision> | ||
| 550 | + <set_empty_string>N</set_empty_string> | ||
| 551 | + </field> | ||
| 552 | + <field> | ||
| 553 | + <name>fcno</name> | ||
| 554 | + <type>Integer</type> | ||
| 555 | + <format/> | ||
| 556 | + <currency/> | ||
| 557 | + <decimal/> | ||
| 558 | + <group/> | ||
| 559 | + <nullif>0</nullif> | ||
| 560 | + <length>-1</length> | ||
| 561 | + <precision>-1</precision> | ||
| 562 | + <set_empty_string>N</set_empty_string> | ||
| 563 | + </field> | ||
| 564 | + </fields> | ||
| 565 | + <limit>1</limit> | ||
| 566 | + <never_ending>N</never_ending> | ||
| 567 | + <interval_in_ms>5000</interval_in_ms> | ||
| 568 | + <row_time_field>now</row_time_field> | ||
| 569 | + <last_time_field>FiveSecondsAgo</last_time_field> | ||
| 570 | + <cluster_schema/> | ||
| 571 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 572 | + <xloc>530</xloc> | ||
| 573 | + <yloc>194</yloc> | ||
| 574 | + <draw>Y</draw> | ||
| 575 | + </GUI> | ||
| 576 | + </step> | ||
| 577 | + | ||
| 578 | + <step> | ||
| 579 | + <name>计算excel输出字段</name> | ||
| 580 | + <type>ScriptValueMod</type> | ||
| 581 | + <description/> | ||
| 582 | + <distribute>Y</distribute> | ||
| 583 | + <custom_distribution/> | ||
| 584 | + <copies>1</copies> | ||
| 585 | + <partitioning> | ||
| 586 | + <method>none</method> | ||
| 587 | + <schema_name/> | ||
| 588 | + </partitioning> | ||
| 589 | + <compatible>N</compatible> | ||
| 590 | + <optimizationLevel>9</optimizationLevel> | ||
| 591 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | ||
| 592 | + <jsScript_name>Script 1</jsScript_name> | ||
| 593 | + <jsScript_script>//Script here

var fieldname; // 字段名
var fieldtype; // 字段类型

if (bc_type == 'in') {
 fieldname = '进场' + fcno;
} else if (bc_type == 'out') {
 fieldname = '出场' + fcno;
} else if (bc_type == 'normal') {
 fieldname = zdname + fcno;
} else {
 fieldname = zdname + fcno;
} 

fieldtype = 'String';
</jsScript_script> | ||
| 594 | + </jsScript> </jsScripts> <fields> <field> <name>fieldname</name> | ||
| 595 | + <rename>fieldname</rename> | ||
| 596 | + <type>String</type> | ||
| 597 | + <length>-1</length> | ||
| 598 | + <precision>-1</precision> | ||
| 599 | + <replace>N</replace> | ||
| 600 | + </field> <field> <name>fieldtype</name> | ||
| 601 | + <rename>fieldtype</rename> | ||
| 602 | + <type>String</type> | ||
| 603 | + <length>-1</length> | ||
| 604 | + <precision>-1</precision> | ||
| 605 | + <replace>N</replace> | ||
| 606 | + </field> </fields> <cluster_schema/> | ||
| 607 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 608 | + <xloc>410</xloc> | ||
| 609 | + <yloc>326</yloc> | ||
| 610 | + <draw>Y</draw> | ||
| 611 | + </GUI> | ||
| 612 | + </step> | ||
| 613 | + | ||
| 614 | + <step> | ||
| 615 | + <name>计算反范式元数据</name> | ||
| 616 | + <type>ScriptValueMod</type> | ||
| 617 | + <description/> | ||
| 618 | + <distribute>Y</distribute> | ||
| 619 | + <custom_distribution/> | ||
| 620 | + <copies>1</copies> | ||
| 621 | + <partitioning> | ||
| 622 | + <method>none</method> | ||
| 623 | + <schema_name/> | ||
| 624 | + </partitioning> | ||
| 625 | + <compatible>N</compatible> | ||
| 626 | + <optimizationLevel>9</optimizationLevel> | ||
| 627 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | ||
| 628 | + <jsScript_name>Script 1</jsScript_name> | ||
| 629 | + <jsScript_script>//Script here

var targetfieldname; // 目标字段名
var targettype; // 目标类型
var valuefieldname; // 值字段名
var keyvalue; // 关键字值

if (bc_type == 'in') {
 targetfieldname = '进场' + fcno;
} else if (bc_type == 'out') {
 targetfieldname = '出场' + fcno;
} else if (bc_type == 'normal') {
 targetfieldname = zdname + fcno;
} else {
 targetfieldname = zdname + fcno;
} 

targettype = 'String';
valuefieldname = 'fcsj';
keyvalue = fcno;
</jsScript_script> | ||
| 630 | + </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name> | ||
| 631 | + <rename>targetfieldname</rename> | ||
| 632 | + <type>String</type> | ||
| 633 | + <length>-1</length> | ||
| 634 | + <precision>-1</precision> | ||
| 635 | + <replace>N</replace> | ||
| 636 | + </field> <field> <name>targettype</name> | ||
| 637 | + <rename>targettype</rename> | ||
| 638 | + <type>String</type> | ||
| 639 | + <length>-1</length> | ||
| 640 | + <precision>-1</precision> | ||
| 641 | + <replace>N</replace> | ||
| 642 | + </field> <field> <name>valuefieldname</name> | ||
| 643 | + <rename>valuefieldname</rename> | ||
| 644 | + <type>String</type> | ||
| 645 | + <length>-1</length> | ||
| 646 | + <precision>-1</precision> | ||
| 647 | + <replace>N</replace> | ||
| 648 | + </field> <field> <name>keyvalue</name> | ||
| 649 | + <rename>keyvalue</rename> | ||
| 650 | + <type>String</type> | ||
| 651 | + <length>-1</length> | ||
| 652 | + <precision>-1</precision> | ||
| 653 | + <replace>N</replace> | ||
| 654 | + </field> </fields> <cluster_schema/> | ||
| 655 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 656 | + <xloc>410</xloc> | ||
| 657 | + <yloc>64</yloc> | ||
| 658 | + <draw>Y</draw> | ||
| 659 | + </GUI> | ||
| 660 | + </step> | ||
| 661 | + | ||
| 662 | + <step> | ||
| 663 | + <name>计算站点</name> | ||
| 664 | + <type>ScriptValueMod</type> | ||
| 665 | + <description/> | ||
| 666 | + <distribute>Y</distribute> | ||
| 667 | + <custom_distribution/> | ||
| 668 | + <copies>1</copies> | ||
| 669 | + <partitioning> | ||
| 670 | + <method>none</method> | ||
| 671 | + <schema_name/> | ||
| 672 | + </partitioning> | ||
| 673 | + <compatible>N</compatible> | ||
| 674 | + <optimizationLevel>9</optimizationLevel> | ||
| 675 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | ||
| 676 | + <jsScript_name>Script 1</jsScript_name> | ||
| 677 | + <jsScript_script>//Script here

var zd;

if (bc_type == 'in') {
 zd = qdz;
} else if (bc_type == 'out') {
 zd = zdz;
} else if (bc_type == 'normal') {
 zd = qdz;
} else {
 zd = qdz;
}
</jsScript_script> | ||
| 678 | + </jsScript> </jsScripts> <fields> <field> <name>zd</name> | ||
| 679 | + <rename>zd</rename> | ||
| 680 | + <type>String</type> | ||
| 681 | + <length>-1</length> | ||
| 682 | + <precision>-1</precision> | ||
| 683 | + <replace>N</replace> | ||
| 684 | + </field> </fields> <cluster_schema/> | ||
| 685 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 686 | + <xloc>300</xloc> | ||
| 687 | + <yloc>190</yloc> | ||
| 688 | + <draw>Y</draw> | ||
| 689 | + </GUI> | ||
| 690 | + </step> | ||
| 691 | + | ||
| 692 | + <step> | ||
| 693 | + <name>过滤记录</name> | ||
| 694 | + <type>FilterRows</type> | ||
| 695 | + <description/> | ||
| 696 | + <distribute>Y</distribute> | ||
| 697 | + <custom_distribution/> | ||
| 698 | + <copies>1</copies> | ||
| 699 | + <partitioning> | ||
| 700 | + <method>none</method> | ||
| 701 | + <schema_name/> | ||
| 702 | + </partitioning> | ||
| 703 | +<send_true_to/> | ||
| 704 | +<send_false_to/> | ||
| 705 | + <compare> | ||
| 706 | +<condition> | ||
| 707 | + <negated>N</negated> | ||
| 708 | + <leftvalue>bc_type</leftvalue> | ||
| 709 | + <function>IS NOT NULL</function> | ||
| 710 | + <rightvalue/> | ||
| 711 | + </condition> | ||
| 712 | + </compare> | ||
| 713 | + <cluster_schema/> | ||
| 714 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 715 | + <xloc>182</xloc> | ||
| 716 | + <yloc>189</yloc> | ||
| 717 | + <draw>Y</draw> | ||
| 718 | + </GUI> | ||
| 719 | + </step> | ||
| 720 | + | ||
| 721 | + <step> | ||
| 722 | + <name>去除重复记录</name> | ||
| 723 | + <type>Unique</type> | ||
| 724 | + <description/> | ||
| 725 | + <distribute>Y</distribute> | ||
| 726 | + <custom_distribution/> | ||
| 727 | + <copies>1</copies> | ||
| 728 | + <partitioning> | ||
| 729 | + <method>none</method> | ||
| 730 | + <schema_name/> | ||
| 731 | + </partitioning> | ||
| 732 | + <count_rows>N</count_rows> | ||
| 733 | + <count_field/> | ||
| 734 | + <reject_duplicate_row>N</reject_duplicate_row> | ||
| 735 | + <error_description/> | ||
| 736 | + <fields> </fields> <cluster_schema/> | ||
| 737 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 738 | + <xloc>842</xloc> | ||
| 739 | + <yloc>592</yloc> | ||
| 740 | + <draw>Y</draw> | ||
| 741 | + </GUI> | ||
| 742 | + </step> | ||
| 743 | + | ||
| 744 | + <step_error_handling> | ||
| 745 | + </step_error_handling> | ||
| 746 | + <slave-step-copy-partition-distribution> | ||
| 747 | +</slave-step-copy-partition-distribution> | ||
| 748 | + <slave_transformation>N</slave_transformation> | ||
| 749 | + | ||
| 750 | +</transformation> |