Commit 795b49059c4d4dfa5a941d86e87e48de31907a25
Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into
minhang
Showing
43 changed files
with
3779 additions
and
448 deletions
Too many changes to show.
To preserve performance only 43 of 103 files are displayed.
pom.xml
| ... | ... | @@ -220,11 +220,11 @@ |
| 220 | 220 | <version>1.1</version> |
| 221 | 221 | </dependency> |
| 222 | 222 | |
| 223 | - <dependency> | |
| 223 | +<!-- <dependency> | |
| 224 | 224 | <groupId>org.springframework.boot</groupId> |
| 225 | 225 | <artifactId>spring-boot-devtools</artifactId> |
| 226 | 226 | <optional>true</optional> |
| 227 | - </dependency> | |
| 227 | + </dependency>--> | |
| 228 | 228 | </dependencies> |
| 229 | 229 | |
| 230 | 230 | <dependencyManagement> | ... | ... |
src/main/java/com/bsth/common/Constants.java
| ... | ... | @@ -24,8 +24,9 @@ public class Constants { |
| 24 | 24 | /** |
| 25 | 25 | * 线调部分子页面不做拦截,便于浏览器缓存 |
| 26 | 26 | */ |
| 27 | - public static final String XD_CHILD_PAGES = "/real_control_v2/**"; | |
| 28 | - public static final String XD_TEMPS = "/pages/control/line/temps/**"; | |
| 27 | + public static final String XD_CHILD_PAGES = "/real_control_v2/**"; | |
| 28 | + public static final String XD_REAL_GPS = "/gps/real/line"; | |
| 29 | + //public static final String XD_TEMPS = "/pages/control/line/temps/**"; | |
| 29 | 30 | |
| 30 | 31 | //车载网关上行接口 |
| 31 | 32 | public static final String UPSTREAM_URL = "/control/upstream"; | ... | ... |
src/main/java/com/bsth/controller/BaseController.java
| ... | ... | @@ -9,6 +9,7 @@ import org.springframework.data.domain.Page; |
| 9 | 9 | import org.springframework.data.domain.PageRequest; |
| 10 | 10 | import org.springframework.data.domain.Sort; |
| 11 | 11 | import org.springframework.data.domain.Sort.Direction; |
| 12 | +import org.springframework.util.CollectionUtils; | |
| 12 | 13 | import org.springframework.web.bind.annotation.PathVariable; |
| 13 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| 14 | 15 | import org.springframework.web.bind.annotation.RequestMethod; |
| ... | ... | @@ -167,11 +168,24 @@ public class BaseController<T, ID extends Serializable> { |
| 167 | 168 | */ |
| 168 | 169 | @RequestMapping(value = "/dataExport", method = RequestMethod.GET) |
| 169 | 170 | public void dataExport(HttpServletResponse response) throws Exception { |
| 171 | + dataExport(response, null); | |
| 172 | + } | |
| 173 | + | |
| 174 | + @RequestMapping(value = "/dataExportExt", method = RequestMethod.GET) | |
| 175 | + public void dataExport(HttpServletResponse response, @RequestParam Map<String, Object> param) throws Exception { | |
| 170 | 176 | // 1、使用ktr转换获取输出文件 |
| 171 | 177 | File ktrfile = new File(this.getClass().getResource(getDataExportKtrClasspath()).toURI()); |
| 172 | - File outputfile = dataImportExportService.fileDataOutput( | |
| 173 | - getDataExportFilename(), | |
| 174 | - ktrfile); | |
| 178 | + File outputfile = null; | |
| 179 | + if (!CollectionUtils.isEmpty(param)) { | |
| 180 | + outputfile = dataImportExportService.fileDataOutput( | |
| 181 | + getDataExportFilename(), | |
| 182 | + ktrfile, | |
| 183 | + param); | |
| 184 | + } else { | |
| 185 | + outputfile = dataImportExportService.fileDataOutput( | |
| 186 | + getDataExportFilename(), | |
| 187 | + ktrfile); | |
| 188 | + } | |
| 175 | 189 | |
| 176 | 190 | System.out.println(outputfile.getName()); |
| 177 | 191 | String filePath = outputfile.getAbsolutePath(); | ... | ... |
src/main/java/com/bsth/controller/schedule/TTInfoDetailController.java
| ... | ... | @@ -14,6 +14,7 @@ import com.bsth.service.StationRouteService; |
| 14 | 14 | import com.bsth.service.schedule.GuideboardInfoService; |
| 15 | 15 | import com.bsth.service.schedule.TTInfoDetailService; |
| 16 | 16 | import com.bsth.service.schedule.utils.DataImportExportService; |
| 17 | +import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 17 | 18 | import jxl.Cell; |
| 18 | 19 | import jxl.Sheet; |
| 19 | 20 | import jxl.Workbook; |
| ... | ... | @@ -26,6 +27,7 @@ import org.springframework.util.CollectionUtils; |
| 26 | 27 | import org.springframework.web.bind.annotation.*; |
| 27 | 28 | import org.springframework.web.multipart.MultipartFile; |
| 28 | 29 | |
| 30 | +import javax.servlet.http.HttpServletResponse; | |
| 29 | 31 | import java.io.File; |
| 30 | 32 | import java.util.*; |
| 31 | 33 | import java.util.regex.Matcher; |
| ... | ... | @@ -51,6 +53,8 @@ public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> { |
| 51 | 53 | private StationRouteService stationRouteService; |
| 52 | 54 | @Autowired |
| 53 | 55 | private GuideboardInfoService guideboardInfoService; |
| 56 | + @Autowired | |
| 57 | + private DataToolsProperties dataToolsProperties; | |
| 54 | 58 | |
| 55 | 59 | |
| 56 | 60 | public static class ExcelFileOutput { |
| ... | ... | @@ -126,11 +130,15 @@ public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> { |
| 126 | 130 | Cell[] cells = sheet.getRow(0); // 获取第一行数据列 |
| 127 | 131 | for (int i = 0; i < cells.length; i++) { |
| 128 | 132 | String cell_con = cells[i].getContents(); |
| 133 | + | |
| 129 | 134 | if (StringUtils.isEmpty(cell_con)) { |
| 130 | 135 | rtn.put("status", ResponseCode.ERROR); |
| 131 | 136 | rtn.put("msg", String.format("第1行,第%d列数据不能为空", i + 1)); |
| 132 | 137 | return rtn; |
| 133 | 138 | } else { |
| 139 | + // 正则表达式去除数字 | |
| 140 | + cell_con = cell_con.replaceAll("[\\d+]", ""); | |
| 141 | + | |
| 134 | 142 | if (i == 0) { // 第一列必须是路牌2个字 |
| 135 | 143 | if (!"路牌".equals(cell_con.trim())) { |
| 136 | 144 | rtn.put("status", ResponseCode.ERROR); |
| ... | ... | @@ -457,4 +465,25 @@ public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> { |
| 457 | 465 | public List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId) { |
| 458 | 466 | return ttInfoDetailRepository.findBcdetails(xlId, ttinfoId, lpId); |
| 459 | 467 | } |
| 468 | + | |
| 469 | + @Override | |
| 470 | + public void dataExport(HttpServletResponse response, @RequestParam Map<String, Object> param) throws Exception { | |
| 471 | + // 获取injectktr | |
| 472 | + File ktrFile2 = new File(this.getClass().getResource( | |
| 473 | + dataToolsProperties.getTtinfodetailOutput()).toURI()); | |
| 474 | + param.put("injectktrfile", ktrFile2.getAbsolutePath()); | |
| 475 | + param.put("ttinfoid", param.get("ttinfoid")); | |
| 476 | + | |
| 477 | + super.dataExport(response, param); | |
| 478 | + } | |
| 479 | + | |
| 480 | + @Override | |
| 481 | + protected String getDataExportKtrClasspath() { | |
| 482 | + return dataToolsProperties.getTtinfodetailMetaoutput(); | |
| 483 | + } | |
| 484 | + | |
| 485 | + @Override | |
| 486 | + protected String getDataExportFilename() { | |
| 487 | + return "时刻表"; | |
| 488 | + } | |
| 460 | 489 | } | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -7,6 +7,7 @@ import java.util.List; |
| 7 | 7 | import java.util.Map; |
| 8 | 8 | import java.util.concurrent.TimeUnit; |
| 9 | 9 | |
| 10 | +import org.apache.commons.lang3.StringUtils; | |
| 10 | 11 | import org.slf4j.Logger; |
| 11 | 12 | import org.slf4j.LoggerFactory; |
| 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -33,258 +34,275 @@ import com.google.common.collect.HashBiMap; |
| 33 | 34 | import com.google.common.collect.TreeMultimap; |
| 34 | 35 | |
| 35 | 36 | /** |
| 36 | - * | |
| 37 | + * @author PanZhao | |
| 37 | 38 | * @ClassName: BasicData |
| 38 | 39 | * @Description: TODO(基础的映射数据) |
| 39 | - * @author PanZhao | |
| 40 | 40 | * @date 2016年8月10日 下午3:27:45 |
| 41 | - * | |
| 42 | 41 | */ |
| 43 | 42 | @Component |
| 44 | -public class BasicData implements CommandLineRunner{ | |
| 45 | - | |
| 46 | - //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号) | |
| 47 | - public static BiMap<String, String> deviceId2NbbmMap; | |
| 48 | - | |
| 49 | - //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) | |
| 50 | - public static Map<String, String> nbbm2CompanyCodeMap; | |
| 51 | - | |
| 52 | - //站点编码和名称对照,包括停车场 (K: 站点编码 ,V:站点名称) | |
| 53 | - public static Map<String, String> stationCode2NameMap; | |
| 54 | - | |
| 55 | - //车辆和线路对照 | |
| 56 | - public static Map<String, Line> nbbm2LineMap; | |
| 57 | - | |
| 58 | - //线路和用户对照 用于webSocket定向推送消息(用户进入线调时写入数据) | |
| 59 | - public static TreeMultimap<String, String> lineCode2SocketUserMap = TreeMultimap.create(); | |
| 60 | - | |
| 61 | - //线路ID和code 对照 | |
| 62 | - public static BiMap<Integer, String> lineId2CodeMap; | |
| 63 | - | |
| 64 | - //线路编码和名称对照 | |
| 65 | - public static Map<String, String> lineCode2NameMap; | |
| 66 | - | |
| 67 | - //线路编码_站点编码 == 0|1 上下行 | |
| 68 | - public static Map<String, Integer> lineStationUpDownMap; | |
| 69 | - | |
| 70 | - //停车场 | |
| 71 | - public static List<String> parkCodeList; | |
| 72 | - | |
| 73 | - //线路ID和shangHaiLinecode 对照 | |
| 74 | - public static Map<Integer, String> lineId2ShangHaiCodeMap; | |
| 75 | - | |
| 76 | - //线路Code和shangHaiLinecode 对照 | |
| 77 | - public static Map<String, String> lineCode2ShangHaiCodeMap; | |
| 78 | - | |
| 79 | - //驾驶员工号 和 personnel 对象映射 | |
| 80 | - public static Map<String, Personnel> jsyMap; | |
| 81 | - //售票员工号 和 personnel 对象映射 | |
| 82 | - public static Map<String, Personnel> spyMap; | |
| 83 | - //全量员工 工号和姓名对照 | |
| 84 | - public static Map<String, String> allPerson; | |
| 85 | - | |
| 86 | - | |
| 87 | - static Logger logger = LoggerFactory.getLogger(BasicData.class); | |
| 88 | - | |
| 89 | - @Autowired | |
| 90 | - BasicDataLoader dataLoader; | |
| 91 | - | |
| 92 | - @Override | |
| 93 | - public void run(String... arg0) throws Exception { | |
| 94 | - Application.mainServices.scheduleWithFixedDelay(dataLoader, 0, 1, TimeUnit.HOURS); | |
| 95 | - } | |
| 96 | - | |
| 97 | - | |
| 98 | - @Component | |
| 99 | - public static class BasicDataLoader extends Thread{ | |
| 100 | - | |
| 101 | - @Autowired | |
| 102 | - CarsRepository carsRepository; | |
| 103 | - | |
| 104 | - @Autowired | |
| 105 | - StationRepository stationRepository; | |
| 106 | - | |
| 107 | - @Autowired | |
| 108 | - CarParkRepository carParkRepository; | |
| 109 | - | |
| 110 | - @Autowired | |
| 111 | - CarConfigInfoRepository carConfigInfoRepository; | |
| 112 | - | |
| 113 | - @Autowired | |
| 114 | - LineRepository lineRepository; | |
| 115 | - | |
| 116 | - @Autowired | |
| 117 | - StationRouteRepository stationRouteRepository; | |
| 118 | - | |
| 119 | - @Autowired | |
| 120 | - PersonnelRepository personnelRepository; | |
| 121 | - | |
| 122 | - | |
| 123 | - @Override | |
| 124 | - public void run() { | |
| 125 | - loadAllData(); | |
| 126 | - } | |
| 127 | - | |
| 128 | - /** | |
| 129 | - * @Title: loadAllData | |
| 130 | - * @Description: TODO(加载所有数据) | |
| 131 | - */ | |
| 132 | - public int loadAllData(){ | |
| 133 | - try{ | |
| 134 | - //设备信息 | |
| 135 | - loadDeviceInfo(); | |
| 136 | - //站点信息 | |
| 137 | - loadStationInfo(); | |
| 138 | - //线路信息 | |
| 139 | - loadLineInfo(); | |
| 140 | - //车辆和线路映射信息 | |
| 141 | - loadNbbm2LineInfo(); | |
| 142 | - //站点路由信息 | |
| 143 | - loadStationRouteInfo(); | |
| 144 | - //人员信息 | |
| 145 | - loadPersonnelInfo(); | |
| 146 | - logger.info("加载基础数据成功!," ); | |
| 147 | - }catch(Exception e){ | |
| 148 | - logger.error("加载基础数据时出现异常," , e); | |
| 149 | - } | |
| 150 | - return 0; | |
| 151 | - } | |
| 152 | - | |
| 153 | - | |
| 154 | - private void loadStationRouteInfo() { | |
| 155 | - Iterator<StationRoute> iterator = stationRouteRepository.findAllEffective().iterator(); | |
| 156 | - Map<String, Integer> map = new HashMap<>(); | |
| 157 | - StationRoute route; | |
| 158 | - | |
| 159 | - while(iterator.hasNext()){ | |
| 160 | - route = iterator.next(); | |
| 161 | - map.put(route.getLineCode() + "_" + route.getStationCode(), route.getDirections()); | |
| 162 | - } | |
| 163 | - lineStationUpDownMap = map; | |
| 164 | - } | |
| 165 | - | |
| 166 | - /** | |
| 167 | - * @Title: loadDeviceInfo | |
| 168 | - * @Description: TODO(加载设备相关信息) | |
| 169 | - */ | |
| 170 | - public void loadDeviceInfo(){ | |
| 171 | - BiMap<String, String> deviceId2Nbbm = HashBiMap.create(); | |
| 172 | - //车辆和公司代码对照 | |
| 173 | - Map<String, String> nbbm2CompanyCode = new HashMap<>(); | |
| 174 | - Iterator<Cars> carIterator = carsRepository.findAll().iterator(); | |
| 175 | - Cars car; | |
| 176 | - while(carIterator.hasNext()){ | |
| 177 | - car = carIterator.next(); | |
| 178 | - deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); | |
| 179 | - nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode()); | |
| 180 | - } | |
| 181 | - | |
| 182 | - deviceId2NbbmMap = deviceId2Nbbm; | |
| 183 | - nbbm2CompanyCodeMap = nbbm2CompanyCode; | |
| 184 | - } | |
| 185 | - | |
| 186 | - /** | |
| 187 | - * @Title: loadStationInfo | |
| 188 | - * @Description: TODO(加载站点信息) | |
| 189 | - */ | |
| 190 | - public void loadStationInfo(){ | |
| 191 | - Map<String, String> stationCode2Name = new HashMap<>(); | |
| 192 | - Iterator<Station> iterator = stationRepository.findAll().iterator(); | |
| 193 | - //站点 | |
| 194 | - Station station; | |
| 195 | - while(iterator.hasNext()){ | |
| 196 | - station = iterator.next(); | |
| 197 | - stationCode2Name.put(station.getStationCod(), station.getStationName()); | |
| 198 | - } | |
| 199 | - //停车场 | |
| 200 | - Iterator<CarPark> iterator2 = carParkRepository.findAll().iterator(); | |
| 201 | - | |
| 202 | - List<String> parkCodes = new ArrayList<>(); | |
| 203 | - | |
| 204 | - CarPark carPark; | |
| 205 | - while(iterator2.hasNext()){ | |
| 206 | - carPark = iterator2.next(); | |
| 207 | - stationCode2Name.put(carPark.getParkCode(), carPark.getParkName()); | |
| 208 | - | |
| 209 | - parkCodes.add(carPark.getParkCode()); | |
| 210 | - } | |
| 211 | - parkCodeList = parkCodes; | |
| 212 | - stationCode2NameMap = stationCode2Name; | |
| 213 | - } | |
| 214 | - | |
| 215 | - /** | |
| 216 | - * @Title: loadNbbm2LineInfo | |
| 217 | - * @Description: TODO(车辆和线路对照) | |
| 218 | - */ | |
| 219 | - public void loadNbbm2LineInfo(){ | |
| 220 | - Iterator<CarConfigInfo> allIterator = carConfigInfoRepository.findAll().iterator(); | |
| 221 | - Map<String, Line> ccMap = new HashMap<>(); | |
| 222 | - | |
| 223 | - CarConfigInfo cci; | |
| 224 | - while(allIterator.hasNext()){ | |
| 225 | - cci = allIterator.next(); | |
| 226 | - ccMap.put(cci.getCl().getInsideCode(), cci.getXl()); | |
| 227 | - } | |
| 228 | - nbbm2LineMap = ccMap; | |
| 229 | - } | |
| 230 | - | |
| 231 | - /** | |
| 232 | - * @Title: loadLineInfo | |
| 233 | - * @Description: TODO(加载线路相关信息) | |
| 234 | - */ | |
| 235 | - public void loadLineInfo(){ | |
| 236 | - Iterator<Line> iterator = lineRepository.findAll().iterator(); | |
| 237 | - | |
| 238 | - Line line; | |
| 239 | - BiMap<Integer, String> biMap = HashBiMap.create(); | |
| 240 | - Map<String, String> code2name = new HashMap<>(); | |
| 241 | - Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); | |
| 242 | - Map<String, String> code2SHcode = new HashMap<String, String>(); | |
| 243 | - | |
| 244 | - while(iterator.hasNext()){ | |
| 245 | - line = iterator.next(); | |
| 246 | - biMap.put(line.getId(), line.getLineCode()); | |
| 247 | - code2name.put(line.getLineCode(), line.getName()); | |
| 248 | - id2SHcode.put(line.getId(),line.getShanghaiLinecode()); | |
| 249 | - code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); | |
| 250 | - } | |
| 251 | - | |
| 252 | - lineId2CodeMap = biMap; | |
| 253 | - lineCode2NameMap = code2name; | |
| 254 | - lineId2ShangHaiCodeMap = id2SHcode; | |
| 255 | - lineCode2ShangHaiCodeMap = code2SHcode; | |
| 256 | - } | |
| 257 | - | |
| 258 | - /** | |
| 259 | - * | |
| 260 | - * @Title: loadPersonnelInfo | |
| 261 | - * @Description: TODO(加载人员信息) | |
| 262 | - */ | |
| 263 | - public void loadPersonnelInfo() { | |
| 264 | - Iterator<Personnel> iterator = personnelRepository.findAll().iterator(); | |
| 265 | - | |
| 266 | - Map<String, Personnel> jsyTempMap=new HashMap<>() | |
| 267 | - , spyTempMap=new HashMap<>(); | |
| 268 | - Map<String, String> allPersonMap=new HashMap<>(); | |
| 269 | - | |
| 270 | - Personnel p; | |
| 271 | - | |
| 272 | - while(iterator.hasNext()){ | |
| 273 | - p = iterator.next(); | |
| 274 | - | |
| 275 | - if(p.getPosts() != null){ | |
| 276 | - if(p.getPosts().equals("1")) | |
| 277 | - jsyTempMap.put(p.getJobCode(), p); | |
| 278 | - else if(p.getPosts().equals("2")) | |
| 279 | - spyTempMap.put(p.getJobCode(), p); | |
| 280 | - } | |
| 281 | - | |
| 282 | - allPersonMap.put(p.getJobCode(), p.getPersonnelName()); | |
| 283 | - } | |
| 284 | - | |
| 285 | - jsyMap=jsyTempMap; | |
| 286 | - spyMap=spyTempMap; | |
| 287 | - allPerson=allPersonMap; | |
| 288 | - } | |
| 289 | - } | |
| 43 | +public class BasicData implements CommandLineRunner { | |
| 44 | + | |
| 45 | + //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号) | |
| 46 | + public static BiMap<String, String> deviceId2NbbmMap; | |
| 47 | + | |
| 48 | + //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) | |
| 49 | + public static Map<String, String> nbbm2CompanyCodeMap; | |
| 50 | + | |
| 51 | + //站点编码和名称对照,包括停车场 (K: 站点编码 ,V:站点名称) | |
| 52 | + public static Map<String, String> stationCode2NameMap; | |
| 53 | + | |
| 54 | + //线路起终点对照(线路编码_上下行_起终点) 1024_0_B (1024上行起点) | |
| 55 | + public static Map<String, String> lineSEPointMap; | |
| 56 | + | |
| 57 | + //车辆和线路对照 | |
| 58 | + public static Map<String, Line> nbbm2LineMap; | |
| 59 | + | |
| 60 | + //线路和用户对照 用于webSocket定向推送消息(用户进入线调时写入数据) | |
| 61 | + //public static TreeMultimap<String, String> lineCode2SocketUserMap = TreeMultimap.create(); | |
| 62 | + | |
| 63 | + //线路ID和code 对照 | |
| 64 | + public static BiMap<Integer, String> lineId2CodeMap; | |
| 65 | + | |
| 66 | + //线路编码和名称对照 | |
| 67 | + public static Map<String, String> lineCode2NameMap; | |
| 68 | + | |
| 69 | + //线路编码_站点编码 == 0|1 上下行 | |
| 70 | + public static Map<String, Integer> lineStationUpDownMap; | |
| 71 | + | |
| 72 | + //停车场 | |
| 73 | + public static List<String> parkCodeList; | |
| 74 | + | |
| 75 | + //线路ID和shangHaiLinecode 对照 | |
| 76 | + public static Map<Integer, String> lineId2ShangHaiCodeMap; | |
| 77 | + | |
| 78 | + //线路Code和shangHaiLinecode 对照 | |
| 79 | + public static Map<String, String> lineCode2ShangHaiCodeMap; | |
| 80 | + | |
| 81 | + //驾驶员工号 和 personnel 对象映射 | |
| 82 | + public static Map<String, Personnel> jsyMap; | |
| 83 | + //售票员工号 和 personnel 对象映射 | |
| 84 | + public static Map<String, Personnel> spyMap; | |
| 85 | + //全量员工 工号和姓名对照 | |
| 86 | + public static Map<String, String> allPerson; | |
| 87 | + | |
| 88 | + | |
| 89 | + static Logger logger = LoggerFactory.getLogger(BasicData.class); | |
| 90 | + | |
| 91 | + @Autowired | |
| 92 | + BasicDataLoader dataLoader; | |
| 93 | + | |
| 94 | + @Override | |
| 95 | + public void run(String... arg0) throws Exception { | |
| 96 | + Application.mainServices.scheduleWithFixedDelay(dataLoader, 0, 1, TimeUnit.HOURS); | |
| 97 | + } | |
| 98 | + | |
| 99 | + | |
| 100 | + @Component | |
| 101 | + public static class BasicDataLoader extends Thread { | |
| 102 | + | |
| 103 | + @Autowired | |
| 104 | + CarsRepository carsRepository; | |
| 105 | + | |
| 106 | + @Autowired | |
| 107 | + StationRepository stationRepository; | |
| 108 | + | |
| 109 | + @Autowired | |
| 110 | + CarParkRepository carParkRepository; | |
| 111 | + | |
| 112 | + @Autowired | |
| 113 | + CarConfigInfoRepository carConfigInfoRepository; | |
| 114 | + | |
| 115 | + @Autowired | |
| 116 | + LineRepository lineRepository; | |
| 117 | + | |
| 118 | + @Autowired | |
| 119 | + StationRouteRepository stationRouteRepository; | |
| 120 | + | |
| 121 | + @Autowired | |
| 122 | + PersonnelRepository personnelRepository; | |
| 123 | + | |
| 124 | + | |
| 125 | + @Override | |
| 126 | + public void run() { | |
| 127 | + loadAllData(); | |
| 128 | + } | |
| 129 | + | |
| 130 | + /** | |
| 131 | + * @Title: loadAllData | |
| 132 | + * @Description: TODO(加载所有数据) | |
| 133 | + */ | |
| 134 | + public int loadAllData() { | |
| 135 | + try { | |
| 136 | + //设备信息 | |
| 137 | + loadDeviceInfo(); | |
| 138 | + //站点信息 | |
| 139 | + loadStationInfo(); | |
| 140 | + //线路信息 | |
| 141 | + loadLineInfo(); | |
| 142 | + //车辆和线路映射信息 | |
| 143 | + loadNbbm2LineInfo(); | |
| 144 | + //站点路由信息 | |
| 145 | + loadStationRouteInfo(); | |
| 146 | + //人员信息 | |
| 147 | + loadPersonnelInfo(); | |
| 148 | + logger.info("加载基础数据成功!,"); | |
| 149 | + } catch (Exception e) { | |
| 150 | + logger.error("加载基础数据时出现异常,", e); | |
| 151 | + } | |
| 152 | + return 0; | |
| 153 | + } | |
| 154 | + | |
| 155 | + | |
| 156 | + private void loadStationRouteInfo() { | |
| 157 | + Iterator<StationRoute> iterator = stationRouteRepository.findAllEffective().iterator(); | |
| 158 | + | |
| 159 | + Map<String, String> sePointMap = new HashMap<>(); | |
| 160 | + //lineSEPointMap | |
| 161 | + Map<String, Integer> map = new HashMap<>(); | |
| 162 | + | |
| 163 | + StationRoute route; | |
| 164 | + while (iterator.hasNext()) { | |
| 165 | + route = iterator.next(); | |
| 166 | + map.put(route.getLineCode() + "_" + route.getStationCode(), route.getDirections()); | |
| 167 | + | |
| 168 | + if (route.getStationMark() != null && | |
| 169 | + (route.getStationMark().equals("B") || route.getStationMark().equals("E"))) { | |
| 170 | + sePointMap.put(route.getLineCode() + "_" | |
| 171 | + + route.getDirections() | |
| 172 | + + "_" + route.getStationMark(), route.getStationCode()); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + lineStationUpDownMap = map; | |
| 176 | + lineSEPointMap = sePointMap; | |
| 177 | + } | |
| 178 | + | |
| 179 | + /** | |
| 180 | + * @Title: loadDeviceInfo | |
| 181 | + * @Description: TODO(加载设备相关信息) | |
| 182 | + */ | |
| 183 | + public void loadDeviceInfo() { | |
| 184 | + BiMap<String, String> deviceId2Nbbm = HashBiMap.create(); | |
| 185 | + //车辆和公司代码对照 | |
| 186 | + Map<String, String> nbbm2CompanyCode = new HashMap<>(); | |
| 187 | + Iterator<Cars> carIterator = carsRepository.findAll().iterator(); | |
| 188 | + Cars car; | |
| 189 | + while (carIterator.hasNext()) { | |
| 190 | + car = carIterator.next(); | |
| 191 | + deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); | |
| 192 | + nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode()); | |
| 193 | + } | |
| 194 | + | |
| 195 | + deviceId2NbbmMap = deviceId2Nbbm; | |
| 196 | + nbbm2CompanyCodeMap = nbbm2CompanyCode; | |
| 197 | + } | |
| 198 | + | |
| 199 | + /** | |
| 200 | + * @Title: loadStationInfo | |
| 201 | + * @Description: TODO(加载站点信息) | |
| 202 | + */ | |
| 203 | + public void loadStationInfo() { | |
| 204 | + Map<String, String> stationCode2Name = new HashMap<>(); | |
| 205 | + Iterator<Station> iterator = stationRepository.findAll().iterator(); | |
| 206 | + //站点 | |
| 207 | + Station station; | |
| 208 | + while (iterator.hasNext()) { | |
| 209 | + station = iterator.next(); | |
| 210 | + stationCode2Name.put(station.getStationCod(), station.getStationName()); | |
| 211 | + } | |
| 212 | + //停车场 | |
| 213 | + Iterator<CarPark> iterator2 = carParkRepository.findAll().iterator(); | |
| 214 | + | |
| 215 | + List<String> parkCodes = new ArrayList<>(); | |
| 216 | + | |
| 217 | + CarPark carPark; | |
| 218 | + while (iterator2.hasNext()) { | |
| 219 | + carPark = iterator2.next(); | |
| 220 | + stationCode2Name.put(carPark.getParkCode(), carPark.getParkName()); | |
| 221 | + | |
| 222 | + parkCodes.add(carPark.getParkCode()); | |
| 223 | + } | |
| 224 | + parkCodeList = parkCodes; | |
| 225 | + stationCode2NameMap = stationCode2Name; | |
| 226 | + } | |
| 227 | + | |
| 228 | + /** | |
| 229 | + * @Title: loadNbbm2LineInfo | |
| 230 | + * @Description: TODO(车辆和线路对照) | |
| 231 | + */ | |
| 232 | + public void loadNbbm2LineInfo() { | |
| 233 | + Iterator<CarConfigInfo> allIterator = carConfigInfoRepository.findAll().iterator(); | |
| 234 | + Map<String, Line> ccMap = new HashMap<>(); | |
| 235 | + | |
| 236 | + CarConfigInfo cci; | |
| 237 | + while (allIterator.hasNext()) { | |
| 238 | + cci = allIterator.next(); | |
| 239 | + ccMap.put(cci.getCl().getInsideCode(), cci.getXl()); | |
| 240 | + } | |
| 241 | + nbbm2LineMap = ccMap; | |
| 242 | + } | |
| 243 | + | |
| 244 | + /** | |
| 245 | + * @Title: loadLineInfo | |
| 246 | + * @Description: TODO(加载线路相关信息) | |
| 247 | + */ | |
| 248 | + public void loadLineInfo() { | |
| 249 | + Iterator<Line> iterator = lineRepository.findAll().iterator(); | |
| 250 | + | |
| 251 | + Line line; | |
| 252 | + BiMap<Integer, String> biMap = HashBiMap.create(); | |
| 253 | + Map<String, String> code2name = new HashMap<>(); | |
| 254 | + Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); | |
| 255 | + Map<String, String> code2SHcode = new HashMap<String, String>(); | |
| 256 | + | |
| 257 | + while (iterator.hasNext()) { | |
| 258 | + line = iterator.next(); | |
| 259 | + biMap.put(line.getId(), line.getLineCode()); | |
| 260 | + code2name.put(line.getLineCode(), line.getName()); | |
| 261 | + id2SHcode.put(line.getId(), line.getShanghaiLinecode()); | |
| 262 | + code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); | |
| 263 | + } | |
| 264 | + | |
| 265 | + lineId2CodeMap = biMap; | |
| 266 | + lineCode2NameMap = code2name; | |
| 267 | + lineId2ShangHaiCodeMap = id2SHcode; | |
| 268 | + lineCode2ShangHaiCodeMap = code2SHcode; | |
| 269 | + } | |
| 270 | + | |
| 271 | + /** | |
| 272 | + * @Title: loadPersonnelInfo | |
| 273 | + * @Description: TODO(加载人员信息) | |
| 274 | + */ | |
| 275 | + public void loadPersonnelInfo() { | |
| 276 | + Iterator<Personnel> iterator = personnelRepository.findAll().iterator(); | |
| 277 | + | |
| 278 | + Map<String, Personnel> jsyTempMap = new HashMap<>(), spyTempMap = new HashMap<>(); | |
| 279 | + Map<String, String> allPersonMap = new HashMap<>(); | |
| 280 | + | |
| 281 | + Personnel p; | |
| 282 | + String jobCode; | |
| 283 | + while (iterator.hasNext()) { | |
| 284 | + p = iterator.next(); | |
| 285 | + | |
| 286 | + jobCode = p.getJobCode(); | |
| 287 | + if (StringUtils.isEmpty(jobCode)) | |
| 288 | + continue; | |
| 289 | + | |
| 290 | + if (jobCode.indexOf("-") != -1) { | |
| 291 | + jobCode = jobCode.split("-")[1]; | |
| 292 | + } | |
| 293 | + if (p.getPosts() != null) { | |
| 294 | + if (p.getPosts().equals("1")) | |
| 295 | + jsyTempMap.put(jobCode, p); | |
| 296 | + else if (p.getPosts().equals("2")) | |
| 297 | + spyTempMap.put(jobCode, p); | |
| 298 | + } | |
| 299 | + | |
| 300 | + allPersonMap.put(jobCode, p.getPersonnelName()); | |
| 301 | + } | |
| 302 | + | |
| 303 | + jsyMap = jsyTempMap; | |
| 304 | + spyMap = spyTempMap; | |
| 305 | + allPerson = allPersonMap; | |
| 306 | + } | |
| 307 | + } | |
| 290 | 308 | } | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
| ... | ... | @@ -71,6 +71,9 @@ public class GpsEntity { |
| 71 | 71 | |
| 72 | 72 | private int version; |
| 73 | 73 | |
| 74 | + /** 是否起终点站 */ | |
| 75 | + private boolean sEPoint; | |
| 76 | + | |
| 74 | 77 | public Integer getCompanyCode() { |
| 75 | 78 | return companyCode; |
| 76 | 79 | } |
| ... | ... | @@ -238,4 +241,12 @@ public class GpsEntity { |
| 238 | 241 | public void setVersion(int version) { |
| 239 | 242 | this.version = version; |
| 240 | 243 | } |
| 244 | + | |
| 245 | + public boolean issEPoint() { | |
| 246 | + return sEPoint; | |
| 247 | + } | |
| 248 | + | |
| 249 | + public void setsEPoint(boolean sEPoint) { | |
| 250 | + this.sEPoint = sEPoint; | |
| 251 | + } | |
| 241 | 252 | } | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| ... | ... | @@ -28,7 +28,7 @@ import com.bsth.util.ConfigUtil; |
| 28 | 28 | import com.google.common.collect.TreeMultimap; |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * | |
| 31 | + * | |
| 32 | 32 | * @ClassName: GpsRealData |
| 33 | 33 | * @Description: TODO(实时GPS数据集合) |
| 34 | 34 | * @author PanZhao |
| ... | ... | @@ -37,25 +37,25 @@ import com.google.common.collect.TreeMultimap; |
| 37 | 37 | */ |
| 38 | 38 | @Component |
| 39 | 39 | public class GpsRealData implements CommandLineRunner{ |
| 40 | - | |
| 40 | + | |
| 41 | 41 | static Logger logger = LoggerFactory.getLogger(GpsRealData.class); |
| 42 | - | |
| 42 | + | |
| 43 | 43 | private static Map<String, GpsEntity> gpsMap; |
| 44 | - | |
| 44 | + | |
| 45 | 45 | //按线路分组设备号 |
| 46 | 46 | private static TreeMultimap<String, String> lineCode2Devices; |
| 47 | 47 | |
| 48 | 48 | // 网关数据接口地址 |
| 49 | 49 | private static String url; |
| 50 | - | |
| 50 | + | |
| 51 | 51 | @Autowired |
| 52 | 52 | GpsDataLoader gpsDataLoader; |
| 53 | - | |
| 53 | + | |
| 54 | 54 | @Autowired |
| 55 | 55 | DayOfSchedule dayOfSchedule; |
| 56 | - | |
| 56 | + | |
| 57 | 57 | @Autowired |
| 58 | - ForecastRealServer forecastRealServer; | |
| 58 | + ForecastRealServer forecastRealServer; | |
| 59 | 59 | /** |
| 60 | 60 | * 构造函数 |
| 61 | 61 | */ |
| ... | ... | @@ -64,49 +64,52 @@ public class GpsRealData implements CommandLineRunner{ |
| 64 | 64 | lineCode2Devices = TreeMultimap.create(); |
| 65 | 65 | url = ConfigUtil.get("http.gps.real.url"); |
| 66 | 66 | } |
| 67 | - | |
| 67 | + | |
| 68 | 68 | @Override |
| 69 | 69 | public void run(String... arg0) throws Exception { |
| 70 | 70 | logger.info("gpsDataLoader,20,6"); |
| 71 | - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 6, TimeUnit.SECONDS); | |
| 71 | + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public GpsEntity add(GpsEntity gps) { |
| 75 | 75 | String device = gps.getDeviceId(); |
| 76 | 76 | GpsEntity old = gpsMap.get(device); |
| 77 | - | |
| 78 | - //定时定距数据附带站点编码改变 | |
| 79 | - if(null == old || !old.getStopNo().equals(gps.getStopNo())){ | |
| 80 | - gps.setArrTime(gps.getTimestamp()); | |
| 81 | - //预测到达终点时间 | |
| 82 | - forecastRealServer.forecast(gps.getNbbm(), gps); | |
| 83 | - } | |
| 84 | - else{ | |
| 85 | - gps.setArrTime(old.getArrTime()); | |
| 86 | - //不预测, 重新计算终点时间 | |
| 87 | - gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm())); | |
| 77 | + | |
| 78 | + if(!StringUtils.isEmpty(gps.getStopNo())){ | |
| 79 | + //定时定距数据附带站点编码改变 | |
| 80 | + if(null == old || !gps.getStopNo().equals(old.getStopNo())){ | |
| 81 | + gps.setArrTime(gps.getTimestamp()); | |
| 82 | + //预测到达终点时间 | |
| 83 | + forecastRealServer.forecast(gps.getNbbm(), gps); | |
| 84 | + } | |
| 85 | + else{ | |
| 86 | + gps.setArrTime(old.getArrTime()); | |
| 87 | + //不预测, 重新计算终点时间 | |
| 88 | + gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm())); | |
| 89 | + } | |
| 88 | 90 | } |
| 89 | - | |
| 91 | + | |
| 90 | 92 | gpsMap.put(device, gps); |
| 91 | - lineCode2Devices.put(gps.getLineId(), device); | |
| 93 | + if(StringUtils.isNotBlank(gps.getLineId())) | |
| 94 | + lineCode2Devices.put(gps.getLineId(), device); | |
| 92 | 95 | return gps; |
| 93 | 96 | } |
| 94 | 97 | |
| 95 | 98 | /** |
| 96 | - * | |
| 99 | + * | |
| 97 | 100 | * @Title: get @Description: TODO(设备号获取GPS) |
| 98 | 101 | */ |
| 99 | 102 | public GpsEntity get(String deviceId) { |
| 100 | 103 | return gpsMap.get(deviceId); |
| 101 | 104 | } |
| 102 | - | |
| 105 | + | |
| 103 | 106 | /** |
| 104 | - * | |
| 107 | + * | |
| 105 | 108 | * @Title: get @Description: TODO(线路编码获取GPS集合) @throws |
| 106 | 109 | */ |
| 107 | 110 | public List<GpsEntity> getByLine(String lineCode) { |
| 108 | 111 | NavigableSet<String> set = lineCode2Devices.get(lineCode); |
| 109 | - | |
| 112 | + | |
| 110 | 113 | List<GpsEntity> rs = new ArrayList<>(); |
| 111 | 114 | GpsEntity gps; |
| 112 | 115 | ScheduleRealInfo sch; |
| ... | ... | @@ -115,19 +118,19 @@ public class GpsRealData implements CommandLineRunner{ |
| 115 | 118 | //过滤异常GPS数据 |
| 116 | 119 | if(gps.isAbnormal()) |
| 117 | 120 | continue; |
| 118 | - | |
| 121 | + | |
| 119 | 122 | sch = dayOfSchedule.execPlamMap().get(gps.getNbbm()); |
| 120 | 123 | if(null != sch) |
| 121 | 124 | gps.setSchId(sch.getId()); |
| 122 | 125 | rs.add(gps); |
| 123 | 126 | } |
| 124 | - | |
| 127 | + | |
| 125 | 128 | return rs; |
| 126 | 129 | } |
| 127 | - | |
| 130 | + | |
| 128 | 131 | public List<GpsEntity> get(List<String> pArray){ |
| 129 | 132 | List<GpsEntity> list = new ArrayList<>(); |
| 130 | - | |
| 133 | + | |
| 131 | 134 | for(String code : pArray) |
| 132 | 135 | list.addAll(getByLine(code)); |
| 133 | 136 | return list; |
| ... | ... | @@ -136,11 +139,11 @@ public class GpsRealData implements CommandLineRunner{ |
| 136 | 139 | public Set<String> allDevices(){ |
| 137 | 140 | return gpsMap.keySet(); |
| 138 | 141 | } |
| 139 | - | |
| 142 | + | |
| 140 | 143 | public GpsEntity findByDeviceId(String deviceId) { |
| 141 | 144 | return gpsMap.get(deviceId); |
| 142 | 145 | } |
| 143 | - | |
| 146 | + | |
| 144 | 147 | public Collection<GpsEntity> all(){ |
| 145 | 148 | return gpsMap.values(); |
| 146 | 149 | } |
| ... | ... | @@ -150,9 +153,9 @@ public class GpsRealData implements CommandLineRunner{ |
| 150 | 153 | } |
| 151 | 154 | @Component |
| 152 | 155 | public static class GpsDataLoader extends Thread{ |
| 153 | - | |
| 156 | + | |
| 154 | 157 | Logger logger = LoggerFactory.getLogger(GpsDataLoader.class); |
| 155 | - | |
| 158 | + | |
| 156 | 159 | @Autowired |
| 157 | 160 | GpsRealData gpsRealData; |
| 158 | 161 | |
| ... | ... | @@ -164,7 +167,7 @@ public class GpsRealData implements CommandLineRunner{ |
| 164 | 167 | logger.error("", e); |
| 165 | 168 | } |
| 166 | 169 | } |
| 167 | - | |
| 170 | + | |
| 168 | 171 | public void load() throws Exception { |
| 169 | 172 | List<GpsEntity> list = new ArrayList<>(); |
| 170 | 173 | CloseableHttpClient httpClient = null; |
| ... | ... | @@ -172,7 +175,7 @@ public class GpsRealData implements CommandLineRunner{ |
| 172 | 175 | try { |
| 173 | 176 | httpClient = HttpClients.createDefault(); |
| 174 | 177 | HttpGet get = new HttpGet(url); |
| 175 | - | |
| 178 | + | |
| 176 | 179 | response = httpClient.execute(get); |
| 177 | 180 | |
| 178 | 181 | HttpEntity entity = response.getEntity(); |
| ... | ... | @@ -181,32 +184,45 @@ public class GpsRealData implements CommandLineRunner{ |
| 181 | 184 | BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); |
| 182 | 185 | StringBuffer stringBuffer = new StringBuffer(); |
| 183 | 186 | String str = ""; |
| 184 | - while ((str = br.readLine()) != null) | |
| 187 | + while ((str = br.readLine()) != null) | |
| 185 | 188 | stringBuffer.append(str); |
| 186 | 189 | |
| 187 | 190 | JSONObject jsonObj = JSON.parseObject(stringBuffer.toString()); |
| 188 | 191 | |
| 189 | - if (jsonObj != null) | |
| 192 | + if (jsonObj != null) | |
| 190 | 193 | list = JSON.parseArray(jsonObj.getString("data"), GpsEntity.class); |
| 191 | - | |
| 194 | + | |
| 192 | 195 | String nbbm; |
| 193 | - //附加车辆内部编码 | |
| 194 | - Integer updown; | |
| 195 | 196 | for(GpsEntity gps : list){ |
| 197 | + //没有设备号 | |
| 198 | + if(StringUtils.isBlank(gps.getDeviceId())) | |
| 199 | + continue; | |
| 200 | + | |
| 196 | 201 | nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); |
| 197 | 202 | if(StringUtils.isBlank(nbbm)) |
| 198 | 203 | gps.setAbnormal(true);//标记为异常数据 |
| 199 | 204 | else |
| 200 | 205 | gps.setNbbm(nbbm); |
| 201 | - | |
| 206 | + | |
| 202 | 207 | gps.setStationName(BasicData.stationCode2NameMap.get(gps.getStopNo())); |
| 208 | + gpsRealData.add(gps); | |
| 209 | + | |
| 210 | + //纠正走向 | |
| 211 | + correctUpdown(gps); | |
| 212 | + /*if(issEPoint(gps)) | |
| 213 | + continue; | |
| 214 | + | |
| 215 | + //如果走向未知,尝试根据站点纠正走向 | |
| 203 | 216 | if(gps.getUpDown() == -1){ |
| 204 | - //如果走向未知,尝试根据站点纠正走向 | |
| 205 | - updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); | |
| 217 | + updown=stationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); | |
| 206 | 218 | if(updown != null) |
| 207 | 219 | gps.setUpDown(updown); |
| 208 | 220 | } |
| 209 | - gpsRealData.add(gps); | |
| 221 | + //如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向 | |
| 222 | + updown=stationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); | |
| 223 | + if(updown != null && !gps.getUpDown().equals(updown)){ | |
| 224 | + gps.setUpDown(updown); | |
| 225 | + }*/ | |
| 210 | 226 | } |
| 211 | 227 | } else |
| 212 | 228 | logger.error("result is null"); |
| ... | ... | @@ -220,5 +236,55 @@ public class GpsRealData implements CommandLineRunner{ |
| 220 | 236 | response.close(); |
| 221 | 237 | } |
| 222 | 238 | } |
| 239 | + | |
| 240 | + /** | |
| 241 | + * 是否是起终点 | |
| 242 | + * @param gps | |
| 243 | + * @return | |
| 244 | + */ | |
| 245 | + public boolean isSEPoint(GpsEntity gps){ | |
| 246 | + String key = gps.getLineId()+"_"+gps.getUpDown()+"_" | |
| 247 | + ,stationCode; | |
| 248 | + | |
| 249 | + if(BasicData.lineSEPointMap.containsKey(key+"B")){ | |
| 250 | + stationCode = BasicData.lineSEPointMap.get(key+"B"); | |
| 251 | + if(gps.getStopNo().equals(stationCode)){ | |
| 252 | + gps.setsEPoint(true); | |
| 253 | + return true; | |
| 254 | + } | |
| 255 | + } | |
| 256 | + | |
| 257 | + if(BasicData.lineSEPointMap.containsKey(key+"E")){ | |
| 258 | + stationCode = BasicData.lineSEPointMap.get(key+"E"); | |
| 259 | + if(gps.getStopNo().equals(stationCode)){ | |
| 260 | + gps.setsEPoint(true); | |
| 261 | + return true; | |
| 262 | + } | |
| 263 | + } | |
| 264 | + return false; | |
| 265 | + } | |
| 266 | + | |
| 267 | + /** | |
| 268 | + * 纠正上下行 | |
| 269 | + * @param gps | |
| 270 | + */ | |
| 271 | + public void correctUpdown(GpsEntity gps){ | |
| 272 | + Integer updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); | |
| 273 | + if(updown != null && !updown.equals(gps.getUpDown())) | |
| 274 | + gps.setUpDown(updown); | |
| 275 | + /*//如果走向未知,尝试根据站点纠正走向 | |
| 276 | + if(gps.getUpDown() == -1){ | |
| 277 | + | |
| 278 | + }*/ | |
| 279 | + | |
| 280 | + if(isSEPoint(gps)) | |
| 281 | + return; | |
| 282 | + | |
| 283 | + /*//如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向 | |
| 284 | + updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); | |
| 285 | + if(updown != null && !gps.getUpDown().equals(updown)){ | |
| 286 | + gps.setUpDown(updown); | |
| 287 | + }*/ | |
| 288 | + } | |
| 223 | 289 | } |
| 224 | 290 | } | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -130,11 +130,11 @@ public class DayOfSchedule implements CommandLineRunner { |
| 130 | 130 | //翻班线程 |
| 131 | 131 | Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); |
| 132 | 132 | //入库 |
| 133 | - //Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); | |
| 133 | + Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); | |
| 134 | 134 | //首班出场指令补发器 |
| 135 | - //Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); | |
| 135 | + Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); | |
| 136 | 136 | //班次误点扫描 |
| 137 | - //Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | |
| 137 | + Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | |
| 138 | 138 | |
| 139 | 139 | //每天凌晨2点20提交数据到运管处 |
| 140 | 140 | long diff = (DateUtils.getTimestamp() + 1000*60*140) - System.currentTimeMillis(); | ... | ... |
src/main/java/com/bsth/entity/Station.java
| ... | ... | @@ -97,7 +97,16 @@ public class Station { |
| 97 | 97 | |
| 98 | 98 | // 版本号 |
| 99 | 99 | private Integer versions; |
| 100 | - | |
| 100 | + | |
| 101 | + /** 是否有电子站牌 这里是老调度系统的原始字段,暂时保留该字段。 */ | |
| 102 | + private Integer isHaveLed; | |
| 103 | + | |
| 104 | + /** 是否有候车亭 这里是老调度系统的原始字段,暂时保留该字段。*/ | |
| 105 | + private Integer isHaveShelter; | |
| 106 | + | |
| 107 | + /** 是否港湾式公交站 这里是老调度系统的原始字段,暂时保留该字段。*/ | |
| 108 | + private Integer isHarbourStation; | |
| 109 | + | |
| 101 | 110 | // 描述 |
| 102 | 111 | private String descriptions; |
| 103 | 112 | |
| ... | ... | @@ -115,6 +124,30 @@ public class Station { |
| 115 | 124 | @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 116 | 125 | private Date updateDate; |
| 117 | 126 | |
| 127 | + public Integer getIsHaveLed() { | |
| 128 | + return isHaveLed; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void setIsHaveLed(Integer isHaveLed) { | |
| 132 | + this.isHaveLed = isHaveLed; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public Integer getIsHaveShelter() { | |
| 136 | + return isHaveShelter; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setIsHaveShelter(Integer isHaveShelter) { | |
| 140 | + this.isHaveShelter = isHaveShelter; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public Integer getIsHarbourStation() { | |
| 144 | + return isHarbourStation; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setIsHarbourStation(Integer isHarbourStation) { | |
| 148 | + this.isHarbourStation = isHarbourStation; | |
| 149 | + } | |
| 150 | + | |
| 118 | 151 | public String getAddr() { |
| 119 | 152 | return addr; |
| 120 | 153 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
| ... | ... | @@ -3,6 +3,7 @@ package com.bsth.entity.schedule; |
| 3 | 3 | import com.bsth.entity.Line; |
| 4 | 4 | import com.bsth.entity.sys.SysUser; |
| 5 | 5 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; |
| 6 | +import org.apache.commons.lang3.StringUtils; | |
| 6 | 7 | |
| 7 | 8 | import javax.persistence.*; |
| 8 | 9 | import java.util.Date; |
| ... | ... | @@ -199,12 +200,29 @@ public class SchedulePlanInfo { |
| 199 | 200 | } |
| 200 | 201 | |
| 201 | 202 | this.j = employeeConfigInfo.getJsy().getId(); |
| 202 | - this.jGh = employeeConfigInfo.getJsy().getJobCode(); | |
| 203 | +// this.jGh = employeeConfigInfo.getJsy().getJobCode(); | |
| 204 | + if (StringUtils.isNotEmpty(employeeConfigInfo.getJsy().getJobCode())) { | |
| 205 | + String[] jsy_temp = employeeConfigInfo.getJsy().getJobCode().split("-"); | |
| 206 | + if (jsy_temp.length > 1) { | |
| 207 | + this.jGh = jsy_temp[1]; | |
| 208 | + } else { | |
| 209 | + this.jGh = jsy_temp[0]; | |
| 210 | + } | |
| 211 | + } | |
| 203 | 212 | this.jName = employeeConfigInfo.getJsy().getPersonnelName(); |
| 204 | 213 | // 关联的售票员 |
| 205 | 214 | if (employeeConfigInfo.getSpy() != null) { |
| 206 | 215 | this.s = employeeConfigInfo.getSpy().getId(); |
| 207 | - this.sGh = employeeConfigInfo.getSpy().getJobCode(); | |
| 216 | +// this.sGh = employeeConfigInfo.getSpy().getJobCode(); | |
| 217 | + if (StringUtils.isNotEmpty(employeeConfigInfo.getSpy().getJobCode())) { | |
| 218 | + String[] spy_temp = employeeConfigInfo.getSpy().getJobCode().split("-"); | |
| 219 | + if (spy_temp.length > 1) { | |
| 220 | + this.sGh = spy_temp[1]; | |
| 221 | + } else { | |
| 222 | + this.sGh = spy_temp[0]; | |
| 223 | + } | |
| 224 | + } | |
| 225 | + | |
| 208 | 226 | this.sName = employeeConfigInfo.getSpy().getPersonnelName(); |
| 209 | 227 | } |
| 210 | 228 | ... | ... |
src/main/java/com/bsth/filter/BaseFilter.java
| ... | ... | @@ -24,7 +24,7 @@ public abstract class BaseFilter implements Filter { |
| 24 | 24 | * 白名单 |
| 25 | 25 | */ |
| 26 | 26 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, |
| 27 | - Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_TEMPS }; | |
| 27 | + Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS }; | |
| 28 | 28 | |
| 29 | 29 | @Override |
| 30 | 30 | public void destroy() { | ... | ... |
src/main/java/com/bsth/oplog/http/HttpOpLogInterceptor.java
| ... | ... | @@ -3,8 +3,8 @@ package com.bsth.oplog.http; |
| 3 | 3 | import javax.servlet.http.HttpServletRequest; |
| 4 | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | |
| 6 | +import com.bsth.common.Constants; | |
| 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | -import org.springframework.stereotype.Component; | |
| 8 | 8 | import org.springframework.util.AntPathMatcher; |
| 9 | 9 | import org.springframework.util.PathMatcher; |
| 10 | 10 | import org.springframework.web.method.HandlerMethod; |
| ... | ... | @@ -25,7 +25,7 @@ public class HttpOpLogInterceptor implements HandlerInterceptor { |
| 25 | 25 | private final PathMatcher pathMatcher = new AntPathMatcher(); |
| 26 | 26 | |
| 27 | 27 | // GET 白名单 |
| 28 | - private String[] httpGetWhiteList = { "/user/login/**", "/user/currentUser","/dictionary/**", "/module/findByCurrentUser", "/gps/**", "/error/**" }; | |
| 28 | + private String[] httpGetWhiteList = { "/user/login/**", "/user/currentUser","/dictionary/**", "/module/findByCurrentUser", "/gps/**", "/error/**", Constants.XD_CHILD_PAGES}; | |
| 29 | 29 | |
| 30 | 30 | // POST 白名单 |
| 31 | 31 | private String[] httpPostWhiteList = { | ... | ... |
src/main/java/com/bsth/repository/CarParkRepository.java
| ... | ... | @@ -33,9 +33,9 @@ public interface CarParkRepository extends BaseRepository<CarPark, Integer>{ |
| 33 | 33 | |
| 34 | 34 | "?6 , str_to_date(?7,'%Y-%m-%d %H:%i:%s') , ?8 , ?9 , ?10," + |
| 35 | 35 | |
| 36 | - "str_to_date(?11,'%Y-%m-%d %H:%i:%s'), ?12 ,?13,GeomFromText(?14), ?15, " + | |
| 36 | + "str_to_date(?11,'%Y-%m-%d %H:%i:%s'), ?12 ,?13,ST_GeomFromText(?14), ?15, " + | |
| 37 | 37 | |
| 38 | - "?16, GeomFromText(?17), ?18,?19)", nativeQuery=true) | |
| 38 | + "?16, ST_GeomFromText(?17), ?18,?19)", nativeQuery=true) | |
| 39 | 39 | public void carParkSave(Double area,String company,String parkCode,String parkName, |
| 40 | 40 | |
| 41 | 41 | String brancheCompany,Integer createBy,String createDate,String descriptions,Integer destroy, |
| ... | ... | @@ -91,8 +91,8 @@ public interface CarParkRepository extends BaseRepository<CarPark, Integer>{ |
| 91 | 91 | "versions = ?12 , " + |
| 92 | 92 | "b_center_point = ?13 , " + |
| 93 | 93 | "g_center_point = ?14 , " + |
| 94 | - "b_park_point = GeomFromText(?15) , " + | |
| 95 | - "g_park_point = GeomFromText(?16) , " + | |
| 94 | + "b_park_point = ST_GeomFromText(?15) , " + | |
| 95 | + "g_park_point = ST_GeomFromText(?16) , " + | |
| 96 | 96 | "db_type = ?17 , " + |
| 97 | 97 | "radius = ?18 , " + |
| 98 | 98 | "shapes_type = ?19 " + | ... | ... |
src/main/java/com/bsth/repository/SectionRepository.java
| ... | ... | @@ -83,33 +83,32 @@ public interface SectionRepository extends BaseRepository<Section, Integer> { |
| 83 | 83 | @Transactional |
| 84 | 84 | @Modifying |
| 85 | 85 | @Query(value="UPDATE bsth_c_section SET " + |
| 86 | - "gsection_vector = ST_GeomFromText(?2) , " + | |
| 87 | - "bsection_vector = ST_GeomFromText(?3)," + | |
| 88 | - "section_code = ?4," + | |
| 89 | - "section_name = ?5," + | |
| 90 | - "croses_road = ?6," + | |
| 91 | - "end_node = ?7," + | |
| 92 | - "start_node = ?8," + | |
| 93 | - "middle_node = ?9," + | |
| 94 | - "section_type = ?10," + | |
| 95 | - "csection_vector = ?11," + | |
| 96 | - "road_coding = ?12," + | |
| 97 | - "section_distance = ?13," + | |
| 98 | - "section_time = ?14," + | |
| 99 | - "db_type = ?15," + | |
| 100 | - "speed_limit = ?16," + | |
| 101 | - "descriptions = ?17," + | |
| 102 | - "versions = ?18," + | |
| 103 | - "create_by = ?19," + | |
| 104 | - "create_date = str_to_date(?20,'%Y-%m-%d %H:%i:%s')," + | |
| 105 | - "update_by = ?21," + | |
| 106 | - "update_date = str_to_date(?22,'%Y-%m-%d %H:%i:%s')" + | |
| 86 | + " gsection_vector = ST_GeomFromText(?2) , " + | |
| 87 | + " bsection_vector = ST_GeomFromText(?3)," + | |
| 88 | + " section_code = ?4," + | |
| 89 | + " section_name = ?5," + | |
| 90 | + " croses_road = ?6," + | |
| 91 | + " end_node = ?7," + | |
| 92 | + " start_node = ?8," + | |
| 93 | + " middle_node = ?9," + | |
| 94 | + " section_type = ?10," + | |
| 95 | + " road_coding = ?11," + | |
| 96 | + " section_distance = ?12," + | |
| 97 | + " section_time = ?13," + | |
| 98 | + " db_type = ?14," + | |
| 99 | + " speed_limit = ?15," + | |
| 100 | + " descriptions = ?16," + | |
| 101 | + " versions = ?17," + | |
| 102 | + " create_by = ?18," + | |
| 103 | + " create_date = str_to_date(?19,'%Y-%m-%d %H:%i:%s')," + | |
| 104 | + " update_by = ?20," + | |
| 105 | + " update_date = str_to_date(?21,'%Y-%m-%d %H:%i:%s')" + | |
| 107 | 106 | " WHERE id = ?1", nativeQuery=true) |
| 108 | 107 | public void sectionUpdate(Integer sectionId,String gsectionVector,String bsectionVector,String sectionCode,String sectionName, |
| 109 | 108 | |
| 110 | 109 | String crosesRoad,String endNode,String startNode,String middleNode,String sectionType, |
| 111 | 110 | |
| 112 | - String csectionVector,String roadCoding,Double sectionDistance,Double sectionTime,String dbType, | |
| 111 | + String roadCoding,Double sectionDistance,Double sectionTime,String dbType, | |
| 113 | 112 | |
| 114 | 113 | Double speedLimit,String descriptions,Integer version,Integer createBy,String createDate, |
| 115 | 114 | ... | ... |
src/main/java/com/bsth/repository/SectionRouteRepository.java
| ... | ... | @@ -69,7 +69,7 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int |
| 69 | 69 | "r.versions AS versions," + |
| 70 | 70 | "r.descriptions AS descriptions" + |
| 71 | 71 | " FROM bsth_c_sectionroute r where r.line = ?1 and r.directions = ?2 and r.destroy=0 ) a " + |
| 72 | - " LEFT JOIN bsth_c_section b ON a.sectionrouteSection = b.id", nativeQuery=true) | |
| 72 | + " LEFT JOIN bsth_c_section b ON a.sectionrouteSection = b.id order by a.sectionrouteCode asc", nativeQuery=true) | |
| 73 | 73 | List<Object[]> getSectionRoute(int lineId, int directions); |
| 74 | 74 | |
| 75 | 75 | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -110,9 +110,12 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 110 | 110 | * |
| 111 | 111 | * @return List<Object[]> |
| 112 | 112 | */ |
| 113 | - @Query(value = "SELECT s.b_jwpoints,s.station_name FROM (" + | |
| 113 | + /*@Query(value = "SELECT s.b_jwpoints,s.station_name FROM (" + | |
| 114 | 114 | "SELECT b.station FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + |
| 115 | - "LEFT JOIN bsth_c_station s on r.station = s.id", nativeQuery=true) | |
| 115 | + "LEFT JOIN bsth_c_station s on r.station = s.id", nativeQuery=true)*/ | |
| 116 | + @Query(value = "SELECT s.b_jwpoints,s.station_name,r.station_route_code FROM (" + | |
| 117 | + "SELECT b.station,b.station_route_code FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + | |
| 118 | + "LEFT JOIN bsth_c_station s on r.station = s.id order by r.station_route_code asc", nativeQuery=true) | |
| 116 | 119 | List<Object[]> getSelectStationRouteCenterPoints(Integer lineId,Integer direction); |
| 117 | 120 | |
| 118 | 121 | /** | ... | ... |
src/main/java/com/bsth/security/WebSecurityConfig.java
| ... | ... | @@ -36,7 +36,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { |
| 36 | 36 | public void configure(WebSecurity web) throws Exception { |
| 37 | 37 | // 白名单 |
| 38 | 38 | web.ignoring().antMatchers(Constants.LOGIN_PAGE, Constants.LOGIN, Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.CAPTCHA, |
| 39 | - Constants.METRONIC_URL, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_TEMPS); | |
| 39 | + Constants.METRONIC_URL, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | @Override | ... | ... |
src/main/java/com/bsth/service/impl/CarParkServiceImpl.java
| ... | ... | @@ -75,9 +75,19 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 75 | 75 | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - bParkPoint = "POLYGON((" + bParkPoint +"))"; | |
| 78 | + if(bParkPoint.equals("")) | |
| 79 | + bParkPoint = null; | |
| 80 | + else | |
| 81 | + bParkPoint = "POLYGON((" + bParkPoint +"))"; | |
| 82 | + | |
| 83 | + if(gParkPoint.equals("")) | |
| 84 | + gParkPoint = null; | |
| 85 | + else | |
| 86 | + gParkPoint = "POLYGON((" + gParkPoint +"))"; | |
| 79 | 87 | |
| 80 | - gParkPoint = "POLYGON((" + gParkPoint +"))"; | |
| 88 | + /*bParkPoint = "POLYGON((" + bParkPoint +"))"; | |
| 89 | + | |
| 90 | + gParkPoint = "POLYGON((" + gParkPoint +"))";*/ | |
| 81 | 91 | |
| 82 | 92 | // 地理位置中心点(百度坐标) |
| 83 | 93 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); |
| ... | ... | @@ -93,7 +103,7 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 93 | 103 | |
| 94 | 104 | } |
| 95 | 105 | |
| 96 | - String gCenterPoint = ""; | |
| 106 | + String gCenterPoint = null; | |
| 97 | 107 | |
| 98 | 108 | if(bJwpointsArray.length>0) { |
| 99 | 109 | |
| ... | ... | @@ -147,6 +157,9 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 147 | 157 | // 修改人 |
| 148 | 158 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); |
| 149 | 159 | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 150 | 163 | carParkRepository.carParkSave(area, company, parkCode, parkName, |
| 151 | 164 | |
| 152 | 165 | brancheCompany, createBy, createDate, descriptions, destroy, |
| ... | ... | @@ -296,7 +309,7 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 296 | 309 | |
| 297 | 310 | } |
| 298 | 311 | |
| 299 | - String gCenterPoint = ""; | |
| 312 | + String gCenterPoint =null; | |
| 300 | 313 | |
| 301 | 314 | if(bJwpointsArray.length>0) { |
| 302 | 315 | |
| ... | ... | @@ -337,10 +350,18 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 337 | 350 | } |
| 338 | 351 | |
| 339 | 352 | } |
| 353 | + if(bParkPoint.equals("")) | |
| 354 | + bParkPoint = null; | |
| 355 | + else | |
| 356 | + bParkPoint = "POLYGON((" + bParkPoint +"))"; | |
| 357 | + | |
| 358 | + if(gParkPoint.equals("")) | |
| 359 | + gParkPoint = null; | |
| 360 | + else | |
| 361 | + gParkPoint = "POLYGON((" + gParkPoint +"))"; | |
| 362 | + /*bParkPoint = "POLYGON((" + bParkPoint +"))"; | |
| 340 | 363 | |
| 341 | - bParkPoint = "POLYGON((" + bParkPoint +"))"; | |
| 342 | - | |
| 343 | - gParkPoint = "POLYGON((" + gParkPoint +"))"; | |
| 364 | + gParkPoint = "POLYGON((" + gParkPoint +"))";*/ | |
| 344 | 365 | |
| 345 | 366 | // 编码 |
| 346 | 367 | String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString(); | ... | ... |
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
| ... | ... | @@ -213,10 +213,11 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem |
| 213 | 213 | |
| 214 | 214 | String sectionType=""; |
| 215 | 215 | |
| 216 | - String csectionVector=""; | |
| 216 | + // String csectionVector=""; | |
| 217 | 217 | |
| 218 | 218 | // 更新 |
| 219 | - repository.sectionUpdate(sectionId, gsectionVector, bsectionVectorS, sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, sectionType, csectionVector, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, version, createBy, createDate, updateBy, updateDate); | |
| 219 | + /*repository.sectionUpdate(sectionId, gsectionVector, bsectionVectorS, sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, sectionType, csectionVector, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, version, createBy, createDate, updateBy, updateDate);*/ | |
| 220 | + repository.sectionUpdate(sectionId, gsectionVector, bsectionVectorS, sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, sectionType, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, version, createBy, createDate, updateBy, updateDate); | |
| 220 | 221 | |
| 221 | 222 | SectionRoute route = new SectionRoute(); |
| 222 | 223 | |
| ... | ... | @@ -393,7 +394,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem |
| 393 | 394 | |
| 394 | 395 | String sectionType=""; |
| 395 | 396 | |
| 396 | - String csectionVector=""; | |
| 397 | + String csectionVector=null; | |
| 397 | 398 | |
| 398 | 399 | Integer id = Integer.valueOf(sectionCode); |
| 399 | 400 | ... | ... |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| ... | ... | @@ -977,9 +977,9 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 977 | 977 | |
| 978 | 978 | } |
| 979 | 979 | |
| 980 | - bPloygonGrid = "POLYGON((" + bPloygonGrid +"))"; | |
| 980 | + /* bPloygonGrid = "POLYGON((" + bPloygonGrid +"))"; | |
| 981 | 981 | |
| 982 | - gPloygonGrid = "POLYGON((" + gPloygonGrid +"))"; | |
| 982 | + gPloygonGrid = "POLYGON((" + gPloygonGrid +"))";*/ | |
| 983 | 983 | |
| 984 | 984 | // 是否撤销 |
| 985 | 985 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | ... | ... |
src/main/java/com/bsth/service/schedule/utils/DataImportExportService.java
| ... | ... | @@ -3,6 +3,7 @@ package com.bsth.service.schedule.utils; |
| 3 | 3 | import org.springframework.web.multipart.MultipartFile; |
| 4 | 4 | |
| 5 | 5 | import java.io.File; |
| 6 | +import java.util.Map; | |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * 数据导入导出服务。 |
| ... | ... | @@ -32,4 +33,7 @@ public interface DataImportExportService { |
| 32 | 33 | * @throws Exception |
| 33 | 34 | */ |
| 34 | 35 | File fileDataOutput(String fileName, File ktrFile) throws Exception; |
| 36 | + | |
| 37 | + | |
| 38 | + File fileDataOutput(String fileName, File ktrFile, Map<String, Object> param) throws Exception; | |
| 35 | 39 | } | ... | ... |
src/main/java/com/bsth/service/schedule/utils/DataImportExportServiceImpl.java
| ... | ... | @@ -10,6 +10,7 @@ import org.springframework.beans.factory.InitializingBean; |
| 10 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | 11 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| 12 | 12 | import org.springframework.stereotype.Service; |
| 13 | +import org.springframework.util.CollectionUtils; | |
| 13 | 14 | import org.springframework.web.multipart.MultipartFile; |
| 14 | 15 | |
| 15 | 16 | import java.io.File; |
| ... | ... | @@ -111,6 +112,11 @@ public class DataImportExportServiceImpl implements DataImportExportService, Ini |
| 111 | 112 | |
| 112 | 113 | @Override |
| 113 | 114 | public File fileDataOutput(String fileName, File ktrFile) throws Exception { |
| 115 | + return fileDataOutput(fileName, ktrFile, null); | |
| 116 | + } | |
| 117 | + | |
| 118 | + @Override | |
| 119 | + public File fileDataOutput(String fileName, File ktrFile, Map<String, Object> param) throws Exception { | |
| 114 | 120 | // 初始化转换,元数据,转换对象 |
| 115 | 121 | TransMeta transMeta = new TransMeta(ktrFile.getAbsolutePath()); |
| 116 | 122 | Trans trans = new Trans(transMeta); |
| ... | ... | @@ -120,6 +126,14 @@ public class DataImportExportServiceImpl implements DataImportExportService, Ini |
| 120 | 126 | fileName + |
| 121 | 127 | new DateTime().toString("yyyyMMddHHmmss") + ".xls"; |
| 122 | 128 | trans.setParameterValue("filepath", filepath); |
| 129 | + | |
| 130 | + // 添加其他参数 | |
| 131 | + if (!CollectionUtils.isEmpty(param)) { | |
| 132 | + for (String key : param.keySet()) { | |
| 133 | + trans.setParameterValue(key, String.valueOf(param.get(key))); | |
| 134 | + } | |
| 135 | + } | |
| 136 | + | |
| 123 | 137 | // 执行转换 |
| 124 | 138 | trans.execute(null); |
| 125 | 139 | // 等待转换结束 | ... | ... |
src/main/java/com/bsth/service/schedule/utils/DataToolsProperties.java
| ... | ... | @@ -83,6 +83,10 @@ public class DataToolsProperties { |
| 83 | 83 | /** 人员信息导出ktr转换 */ |
| 84 | 84 | @NotNull |
| 85 | 85 | private String employeesDataoutputktr; |
| 86 | + /** 时刻表导出元数据ktr转换 */ | |
| 87 | + private String ttinfodetailMetaoutput; | |
| 88 | + /** 时刻表导出数据ktr转换 */ | |
| 89 | + private String ttinfodetailOutput; | |
| 86 | 90 | |
| 87 | 91 | // TODO: |
| 88 | 92 | |
| ... | ... | @@ -253,4 +257,20 @@ public class DataToolsProperties { |
| 253 | 257 | public void setKvarsDbdname(String kvarsDbdname) { |
| 254 | 258 | this.kvarsDbdname = kvarsDbdname; |
| 255 | 259 | } |
| 260 | + | |
| 261 | + public String getTtinfodetailMetaoutput() { | |
| 262 | + return ttinfodetailMetaoutput; | |
| 263 | + } | |
| 264 | + | |
| 265 | + public void setTtinfodetailMetaoutput(String ttinfodetailMetaoutput) { | |
| 266 | + this.ttinfodetailMetaoutput = ttinfodetailMetaoutput; | |
| 267 | + } | |
| 268 | + | |
| 269 | + public String getTtinfodetailOutput() { | |
| 270 | + return ttinfodetailOutput; | |
| 271 | + } | |
| 272 | + | |
| 273 | + public void setTtinfodetailOutput(String ttinfodetailOutput) { | |
| 274 | + this.ttinfodetailOutput = ttinfodetailOutput; | |
| 275 | + } | |
| 256 | 276 | } | ... | ... |
src/main/java/com/bsth/util/Geo/SHCJ2BDJW.java
| ... | ... | @@ -25,9 +25,11 @@ public class SHCJ2BDJW { |
| 25 | 25 | |
| 26 | 26 | ResultSet rs = null; |
| 27 | 27 | |
| 28 | - String sqlSelect = "SELECT b.SHAPESTRING as SHAPE , b.id as ID FROM jjwgps_t_gjldb b where SHAPESTRING is not null order by b.ldbh asc "; | |
| 28 | + /*String sqlSelect = "SELECT b.SHAPESTRING as SHAPE , b.id as ID FROM jjwgps_t_gjldb b where SHAPESTRING is not null order by b.ldbh asc ";*/ | |
| 29 | + /*String sqlSelect = "select s.id,s.descriptions from bsth_c_station s order by s.id asc ";*/ | |
| 30 | + String sqlSelect = "SELECT s.id,s.descriptions FROM bsth_c_section s order by s.id asc "; | |
| 29 | 31 | |
| 30 | - String sqlUpdate = "UPDATE jjwgps_t_gjldb SET bdjw = GeomFromText(?),SHAPE = GeomFromText(?) where id = ?"; | |
| 32 | + String sqlUpdate = "UPDATE bsth_c_section SET csection_vector = ST_GeomFromText(?) , bsection_vector=ST_GeomFromText(?) , gsection_vector=ST_GeomFromText(?) where id = ?"; | |
| 31 | 33 | |
| 32 | 34 | List<Map<String, Object>> list = new ArrayList<>(); |
| 33 | 35 | |
| ... | ... | @@ -42,9 +44,9 @@ public class SHCJ2BDJW { |
| 42 | 44 | |
| 43 | 45 | Map<String, Object> map = new HashMap<String, Object>(); |
| 44 | 46 | |
| 45 | - map.put("shape", rs.getString("SHAPE")); | |
| 47 | + map.put("descriptions", rs.getString("descriptions")); | |
| 46 | 48 | |
| 47 | - map.put("id", rs.getInt("ID")); | |
| 49 | + map.put("id", rs.getInt("id")); | |
| 48 | 50 | |
| 49 | 51 | list.add(map); |
| 50 | 52 | } |
| ... | ... | @@ -52,15 +54,29 @@ public class SHCJ2BDJW { |
| 52 | 54 | for(int i =0;i<list.size();i++) { |
| 53 | 55 | |
| 54 | 56 | Map<String, Object> temp = list.get(i); |
| 55 | - | |
| 56 | - String lineString = temp.get("shape").toString(); | |
| 57 | - /*String lineString = "LINESTRING (13532.5305161702 -3677.63275264995, 13433.22401617 -3881.74765264988)";*/ | |
| 58 | - | |
| 57 | + // POINT (8229.30921617 -933.16425265) | |
| 58 | + String lineString = temp.get("descriptions").toString(); | |
| 59 | + int id = Integer.parseInt(temp.get("id").toString()); | |
| 59 | 60 | |
| 60 | 61 | String arrayP[] = lineString.substring(lineString.indexOf("(")+1, lineString.length()-1).split(", "); |
| 61 | - | |
| 62 | - int id = Integer.parseInt(temp.get("id").toString()); | |
| 63 | - String geometry = ""; | |
| 62 | + /*String arrayP[] = lineString.substring(lineString.indexOf("(")+1, lineString.length()-1).split(" "); | |
| 63 | + String b_jwpoints = ""; | |
| 64 | + Float g_lonx=0.0f,g_laty=0.0f,x=0.0f,y=0.0f;*/ | |
| 65 | + | |
| 66 | + /*Double lng = Double.parseDouble(arrayP[0]); | |
| 67 | + Double lat = Double.parseDouble(arrayP[1]); | |
| 68 | + x = Float.parseFloat(arrayP[0]); | |
| 69 | + y = Float.parseFloat(arrayP[1]); | |
| 70 | + // WGS84 | |
| 71 | + Map map_2 = JWDUtil.ConvertSHToJW(lng,lat); | |
| 72 | + g_lonx = Float.parseFloat(map_2.get("x").toString()); | |
| 73 | + g_laty = Float.parseFloat(map_2.get("y").toString()); | |
| 74 | + Location location = TransGPS.LocationMake(Float.parseFloat(map_2.get("x").toString()), Float.parseFloat(map_2.get("y").toString())); | |
| 75 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location)); | |
| 76 | + b_jwpoints = (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624);*/ | |
| 77 | + //b_jwpoints = (location.getLng()) + " " + (location.getLat()); | |
| 78 | + | |
| 79 | + String csection_vector="",bsection_vector="",gsection_vector=""; | |
| 64 | 80 | |
| 65 | 81 | for(int k =0;k<arrayP.length;k++) { |
| 66 | 82 | |
| ... | ... | @@ -76,28 +92,42 @@ public class SHCJ2BDJW { |
| 76 | 92 | |
| 77 | 93 | location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location)); |
| 78 | 94 | |
| 79 | - if(k==arrayP.length-1) | |
| 80 | - geometry = geometry + (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624); | |
| 81 | - else | |
| 82 | - geometry = geometry + (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624) + ","; | |
| 95 | + if(k==arrayP.length-1) { | |
| 96 | + bsection_vector = bsection_vector + (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624); | |
| 97 | + csection_vector = csection_vector + arrayXY[0] + " " + arrayXY[1]; | |
| 98 | + gsection_vector = gsection_vector + map_2.get("x").toString() + " " + map_2.get("y").toString(); | |
| 99 | + }else { | |
| 100 | + bsection_vector = bsection_vector + (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624) + ","; | |
| 101 | + csection_vector = csection_vector + arrayXY[0] + " " + arrayXY[1] +","; | |
| 102 | + gsection_vector = gsection_vector + map_2.get("x").toString() + " " + map_2.get("y").toString()+","; | |
| 103 | + } | |
| 83 | 104 | |
| 84 | 105 | |
| 85 | 106 | } |
| 86 | 107 | |
| 87 | 108 | ps = null; |
| 88 | - | |
| 89 | - geometry = "LINESTRING(" + geometry +")"; | |
| 109 | + bsection_vector = "LINESTRING(" + bsection_vector +")"; | |
| 110 | + csection_vector = "LINESTRING(" + csection_vector +")"; | |
| 111 | + gsection_vector = "LINESTRING(" + gsection_vector +")"; | |
| 90 | 112 | |
| 91 | 113 | ps = conn.prepareStatement(sqlUpdate); |
| 92 | 114 | |
| 93 | - ps.setString(1, geometry); | |
| 94 | - | |
| 95 | - ps.setString(2, lineString); | |
| 96 | - | |
| 97 | - ps.setInt(3, id); | |
| 98 | - | |
| 115 | + // String sqlUpdate = "UPDATE bsth_c_section SET csection_vector = ? , bsection_vector=? , gsection_vector=? where id = ?"; | |
| 116 | + ps.setString(1, csection_vector); | |
| 117 | + ps.setString(2, bsection_vector); | |
| 118 | + ps.setString(3, gsection_vector); | |
| 119 | + ps.setInt(4, id); | |
| 120 | + | |
| 121 | + //int stauts = ps.executeUpdate(); | |
| 122 | + // String sqlUpdate = "UPDATE bsth_c_station SET b_jwpoints = ?1 , g_lonx=?2 , g_laty=?3 , x = ?4 , y = ?5 where id = ?6"; | |
| 123 | + /*ps.setString(1, b_jwpoints); | |
| 124 | + ps.setFloat(2, g_lonx); | |
| 125 | + ps.setFloat(3, g_laty); | |
| 126 | + ps.setFloat(4, x); | |
| 127 | + ps.setFloat(5, y); | |
| 128 | + ps.setFloat(6, id);*/ | |
| 99 | 129 | int stauts = ps.executeUpdate(); |
| 100 | - | |
| 130 | + System.out.println(stauts); | |
| 101 | 131 | } |
| 102 | 132 | |
| 103 | 133 | } catch (SQLException e) { | ... | ... |
src/main/resources/datatools/config-dev.properties
| ... | ... | @@ -48,13 +48,19 @@ datatools.employeesconfig_datainputktr=/datatools/ktrs/employeesConfigDataInput. |
| 48 | 48 | |
| 49 | 49 | # 4、数据导出配置信息 |
| 50 | 50 | # 导出数据文件目录配置(根据不同的环境需要修正) |
| 51 | -datatools.fileoutput_dir=/Users/xu/resource/project/bsth_control_u_d_files | |
| 51 | +datatools.fileoutput_dir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files | |
| 52 | 52 | |
| 53 | 53 | ##---------------------------- 导出数据ktr -----------------------------## |
| 54 | 54 | # 车辆信息导出ktr转换 |
| 55 | 55 | datatools.cars_dataoutputktr=/datatools/ktrs/carsDataOutput.ktr |
| 56 | 56 | # 人员信息导出ktr转换 |
| 57 | 57 | datatools.employees_dataoutputktr=/datatools/ktrs/employeesDataOutput.ktr |
| 58 | +# 时刻表导出元数据ktr转换 | |
| 59 | +datatools.ttinfodetail_metaoutput=/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr | |
| 60 | +# 时刻表导出数据ktr转换 | |
| 61 | +datatools.ttinfodetail_output=/datatools/ktrs/ttinfodetailDataOutput.ktr | |
| 62 | + | |
| 63 | + | |
| 58 | 64 | |
| 59 | 65 | # TODO: |
| 60 | 66 | ... | ... |
src/main/resources/datatools/config-prod.properties
| ... | ... | @@ -56,5 +56,9 @@ datatools.fileoutput_dir=/opt/bsth_control_u_d_files |
| 56 | 56 | datatools.cars_dataoutputktr=/datatools/ktrs/carsDataOutput.ktr |
| 57 | 57 | # 人员信息导出ktr转换 |
| 58 | 58 | datatools.employees_dataoutputktr=/datatools/ktrs/employeesDataOutput.ktr |
| 59 | +# 时刻表导出元数据ktr转换 | |
| 60 | +datatools.ttinfodetail_metaoutput=/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr | |
| 61 | +# 时刻表导出数据ktr转换 | |
| 62 | +datatools.ttinfodetail_output=/datatools/ktrs/ttinfodetailDataOutput.ktr | |
| 59 | 63 | |
| 60 | 64 | # TODO: |
| 61 | 65 | \ No newline at end of file | ... | ... |
src/main/resources/datatools/ktrs/ttinfodetailDataOutput.ktr
0 → 100644
| 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 | + </parameters> | |
| 13 | + <log> | |
| 14 | +<trans-log-table><connection/> | |
| 15 | +<schema/> | |
| 16 | +<table/> | |
| 17 | +<size_limit_lines/> | |
| 18 | +<interval/> | |
| 19 | +<timeout_days/> | |
| 20 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table> | |
| 21 | +<perf-log-table><connection/> | |
| 22 | +<schema/> | |
| 23 | +<table/> | |
| 24 | +<interval/> | |
| 25 | +<timeout_days/> | |
| 26 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table> | |
| 27 | +<channel-log-table><connection/> | |
| 28 | +<schema/> | |
| 29 | +<table/> | |
| 30 | +<timeout_days/> | |
| 31 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table> | |
| 32 | +<step-log-table><connection/> | |
| 33 | +<schema/> | |
| 34 | +<table/> | |
| 35 | +<timeout_days/> | |
| 36 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table> | |
| 37 | +<metrics-log-table><connection/> | |
| 38 | +<schema/> | |
| 39 | +<table/> | |
| 40 | +<timeout_days/> | |
| 41 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table> | |
| 42 | + </log> | |
| 43 | + <maxdate> | |
| 44 | + <connection/> | |
| 45 | + <table/> | |
| 46 | + <field/> | |
| 47 | + <offset>0.0</offset> | |
| 48 | + <maxdiff>0.0</maxdiff> | |
| 49 | + </maxdate> | |
| 50 | + <size_rowset>10000</size_rowset> | |
| 51 | + <sleep_time_empty>50</sleep_time_empty> | |
| 52 | + <sleep_time_full>50</sleep_time_full> | |
| 53 | + <unique_connections>N</unique_connections> | |
| 54 | + <feedback_shown>Y</feedback_shown> | |
| 55 | + <feedback_size>50000</feedback_size> | |
| 56 | + <using_thread_priorities>Y</using_thread_priorities> | |
| 57 | + <shared_objects_file/> | |
| 58 | + <capture_step_performance>N</capture_step_performance> | |
| 59 | + <step_performance_capturing_delay>1000</step_performance_capturing_delay> | |
| 60 | + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit> | |
| 61 | + <dependencies> | |
| 62 | + </dependencies> | |
| 63 | + <partitionschemas> | |
| 64 | + </partitionschemas> | |
| 65 | + <slaveservers> | |
| 66 | + </slaveservers> | |
| 67 | + <clusterschemas> | |
| 68 | + </clusterschemas> | |
| 69 | + <created_user>-</created_user> | |
| 70 | + <created_date>2016/11/15 13:00:52.076</created_date> | |
| 71 | + <modified_user>-</modified_user> | |
| 72 | + <modified_date>2016/11/15 13:00:52.076</modified_date> | |
| 73 | + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key> | |
| 74 | + <is_key_private>N</is_key_private> | |
| 75 | + </info> | |
| 76 | + <notepads> | |
| 77 | + </notepads> | |
| 78 | + <connection> | |
| 79 | + <name>bus_control_variable</name> | |
| 80 | + <server>${v_db_ip}</server> | |
| 81 | + <type>MYSQL</type> | |
| 82 | + <access>Native</access> | |
| 83 | + <database>${v_db_dname}</database> | |
| 84 | + <port>3306</port> | |
| 85 | + <username>${v_db_uname}</username> | |
| 86 | + <password>${v_db_pwd}</password> | |
| 87 | + <servername/> | |
| 88 | + <data_tablespace/> | |
| 89 | + <index_tablespace/> | |
| 90 | + <attributes> | |
| 91 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 92 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 93 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 94 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 95 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 96 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 97 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 98 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 99 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | |
| 100 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 101 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 102 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 103 | + </attributes> | |
| 104 | + </connection> | |
| 105 | + <connection> | |
| 106 | + <name>bus_control_公司_201</name> | |
| 107 | + <server>localhost</server> | |
| 108 | + <type>MYSQL</type> | |
| 109 | + <access>Native</access> | |
| 110 | + <database>control</database> | |
| 111 | + <port>3306</port> | |
| 112 | + <username>root</username> | |
| 113 | + <password>Encrypted </password> | |
| 114 | + <servername/> | |
| 115 | + <data_tablespace/> | |
| 116 | + <index_tablespace/> | |
| 117 | + <attributes> | |
| 118 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 119 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 120 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 121 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 122 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 123 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 124 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 125 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 126 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | |
| 127 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 128 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 129 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 130 | + </attributes> | |
| 131 | + </connection> | |
| 132 | + <connection> | |
| 133 | + <name>bus_control_本机</name> | |
| 134 | + <server>localhost</server> | |
| 135 | + <type>MYSQL</type> | |
| 136 | + <access>Native</access> | |
| 137 | + <database>control</database> | |
| 138 | + <port>3306</port> | |
| 139 | + <username>root</username> | |
| 140 | + <password>Encrypted </password> | |
| 141 | + <servername/> | |
| 142 | + <data_tablespace/> | |
| 143 | + <index_tablespace/> | |
| 144 | + <attributes> | |
| 145 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 146 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 147 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 148 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 149 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 150 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 151 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 152 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 153 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 154 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 155 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 156 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 157 | + </attributes> | |
| 158 | + </connection> | |
| 159 | + <connection> | |
| 160 | + <name>xlab_mysql_youle</name> | |
| 161 | + <server>101.231.124.8</server> | |
| 162 | + <type>MYSQL</type> | |
| 163 | + <access>Native</access> | |
| 164 | + <database>xlab_youle</database> | |
| 165 | + <port>45687</port> | |
| 166 | + <username>xlab-youle</username> | |
| 167 | + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password> | |
| 168 | + <servername/> | |
| 169 | + <data_tablespace/> | |
| 170 | + <index_tablespace/> | |
| 171 | + <attributes> | |
| 172 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 173 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 174 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 175 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 176 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 177 | + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute> | |
| 178 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 179 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 180 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 181 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 182 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 183 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 184 | + </attributes> | |
| 185 | + </connection> | |
| 186 | + <connection> | |
| 187 | + <name>xlab_mysql_youle(本机)</name> | |
| 188 | + <server>localhost</server> | |
| 189 | + <type>MYSQL</type> | |
| 190 | + <access>Native</access> | |
| 191 | + <database>xlab_youle</database> | |
| 192 | + <port>3306</port> | |
| 193 | + <username>root</username> | |
| 194 | + <password>Encrypted </password> | |
| 195 | + <servername/> | |
| 196 | + <data_tablespace/> | |
| 197 | + <index_tablespace/> | |
| 198 | + <attributes> | |
| 199 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 200 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 201 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 202 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 203 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 204 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 205 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 206 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 207 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 208 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 209 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 210 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 211 | + </attributes> | |
| 212 | + </connection> | |
| 213 | + <connection> | |
| 214 | + <name>xlab_youle</name> | |
| 215 | + <server/> | |
| 216 | + <type>MYSQL</type> | |
| 217 | + <access>JNDI</access> | |
| 218 | + <database>xlab_youle</database> | |
| 219 | + <port>1521</port> | |
| 220 | + <username/> | |
| 221 | + <password>Encrypted </password> | |
| 222 | + <servername/> | |
| 223 | + <data_tablespace/> | |
| 224 | + <index_tablespace/> | |
| 225 | + <attributes> | |
| 226 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 227 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 228 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 229 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | |
| 230 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 231 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 232 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 233 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 234 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 235 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 236 | + </attributes> | |
| 237 | + </connection> | |
| 238 | + <order> | |
| 239 | + <hop> <from>排序记录</from><to>列转行</to><enabled>Y</enabled> </hop> | |
| 240 | + <hop> <from>列转行</from><to>字段选择</to><enabled>Y</enabled> </hop> | |
| 241 | + <hop> <from>字段选择</from><to>Excel输出</to><enabled>Y</enabled> </hop> | |
| 242 | + <hop> <from>时刻表明细数据表</from><to>路牌名字查找</to><enabled>Y</enabled> </hop> | |
| 243 | + <hop> <from>路牌名字查找</from><to>排序记录</to><enabled>Y</enabled> </hop> | |
| 244 | + </order> | |
| 245 | + <step> | |
| 246 | + <name>列转行</name> | |
| 247 | + <type>Denormaliser</type> | |
| 248 | + <description/> | |
| 249 | + <distribute>Y</distribute> | |
| 250 | + <custom_distribution/> | |
| 251 | + <copies>1</copies> | |
| 252 | + <partitioning> | |
| 253 | + <method>none</method> | |
| 254 | + <schema_name/> | |
| 255 | + </partitioning> | |
| 256 | + <key_field>fcno</key_field> | |
| 257 | + <group> | |
| 258 | + <field> | |
| 259 | + <name>lp</name> | |
| 260 | + </field> | |
| 261 | + </group> | |
| 262 | + <fields> | |
| 263 | + <field> | |
| 264 | + <field_name>fcsj</field_name> | |
| 265 | + <key_value>1</key_value> | |
| 266 | + <target_name>出场1</target_name> | |
| 267 | + <target_type>String</target_type> | |
| 268 | + <target_format/> | |
| 269 | + <target_length>-1</target_length> | |
| 270 | + <target_precision>-1</target_precision> | |
| 271 | + <target_decimal_symbol/> | |
| 272 | + <target_grouping_symbol/> | |
| 273 | + <target_currency_symbol/> | |
| 274 | + <target_null_string/> | |
| 275 | + <target_aggregation_type>-</target_aggregation_type> | |
| 276 | + </field> | |
| 277 | + <field> | |
| 278 | + <field_name>fcsj</field_name> | |
| 279 | + <key_value>2</key_value> | |
| 280 | + <target_name>青安路汽车站2</target_name> | |
| 281 | + <target_type>String</target_type> | |
| 282 | + <target_format/> | |
| 283 | + <target_length>-1</target_length> | |
| 284 | + <target_precision>-1</target_precision> | |
| 285 | + <target_decimal_symbol/> | |
| 286 | + <target_grouping_symbol/> | |
| 287 | + <target_currency_symbol/> | |
| 288 | + <target_null_string/> | |
| 289 | + <target_aggregation_type>-</target_aggregation_type> | |
| 290 | + </field> | |
| 291 | + <field> | |
| 292 | + <field_name>fcsj</field_name> | |
| 293 | + <key_value>3</key_value> | |
| 294 | + <target_name>青安路汽车站3</target_name> | |
| 295 | + <target_type>String</target_type> | |
| 296 | + <target_format/> | |
| 297 | + <target_length>-1</target_length> | |
| 298 | + <target_precision>-1</target_precision> | |
| 299 | + <target_decimal_symbol/> | |
| 300 | + <target_grouping_symbol/> | |
| 301 | + <target_currency_symbol/> | |
| 302 | + <target_null_string/> | |
| 303 | + <target_aggregation_type>-</target_aggregation_type> | |
| 304 | + </field> | |
| 305 | + <field> | |
| 306 | + <field_name>fcsj</field_name> | |
| 307 | + <key_value>4</key_value> | |
| 308 | + <target_name>青安路汽车站4</target_name> | |
| 309 | + <target_type>String</target_type> | |
| 310 | + <target_format/> | |
| 311 | + <target_length>-1</target_length> | |
| 312 | + <target_precision>-1</target_precision> | |
| 313 | + <target_decimal_symbol/> | |
| 314 | + <target_grouping_symbol/> | |
| 315 | + <target_currency_symbol/> | |
| 316 | + <target_null_string/> | |
| 317 | + <target_aggregation_type>-</target_aggregation_type> | |
| 318 | + </field> | |
| 319 | + <field> | |
| 320 | + <field_name>fcsj</field_name> | |
| 321 | + <key_value>5</key_value> | |
| 322 | + <target_name>青安路汽车站5</target_name> | |
| 323 | + <target_type>String</target_type> | |
| 324 | + <target_format/> | |
| 325 | + <target_length>-1</target_length> | |
| 326 | + <target_precision>-1</target_precision> | |
| 327 | + <target_decimal_symbol/> | |
| 328 | + <target_grouping_symbol/> | |
| 329 | + <target_currency_symbol/> | |
| 330 | + <target_null_string/> | |
| 331 | + <target_aggregation_type>-</target_aggregation_type> | |
| 332 | + </field> | |
| 333 | + <field> | |
| 334 | + <field_name>fcsj</field_name> | |
| 335 | + <key_value>6</key_value> | |
| 336 | + <target_name>青安路汽车站6</target_name> | |
| 337 | + <target_type>String</target_type> | |
| 338 | + <target_format/> | |
| 339 | + <target_length>-1</target_length> | |
| 340 | + <target_precision>-1</target_precision> | |
| 341 | + <target_decimal_symbol/> | |
| 342 | + <target_grouping_symbol/> | |
| 343 | + <target_currency_symbol/> | |
| 344 | + <target_null_string/> | |
| 345 | + <target_aggregation_type>-</target_aggregation_type> | |
| 346 | + </field> | |
| 347 | + <field> | |
| 348 | + <field_name>fcsj</field_name> | |
| 349 | + <key_value>7</key_value> | |
| 350 | + <target_name>进场7</target_name> | |
| 351 | + <target_type>String</target_type> | |
| 352 | + <target_format/> | |
| 353 | + <target_length>-1</target_length> | |
| 354 | + <target_precision>-1</target_precision> | |
| 355 | + <target_decimal_symbol/> | |
| 356 | + <target_grouping_symbol/> | |
| 357 | + <target_currency_symbol/> | |
| 358 | + <target_null_string/> | |
| 359 | + <target_aggregation_type>-</target_aggregation_type> | |
| 360 | + </field> | |
| 361 | + </fields> | |
| 362 | + <cluster_schema/> | |
| 363 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 364 | + <xloc>531</xloc> | |
| 365 | + <yloc>65</yloc> | |
| 366 | + <draw>Y</draw> | |
| 367 | + </GUI> | |
| 368 | + </step> | |
| 369 | + | |
| 370 | + <step> | |
| 371 | + <name>排序记录</name> | |
| 372 | + <type>SortRows</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 | + <directory>%%java.io.tmpdir%%</directory> | |
| 382 | + <prefix>out</prefix> | |
| 383 | + <sort_size>1000000</sort_size> | |
| 384 | + <free_memory/> | |
| 385 | + <compress>N</compress> | |
| 386 | + <compress_variable/> | |
| 387 | + <unique_rows>N</unique_rows> | |
| 388 | + <fields> | |
| 389 | + <field> | |
| 390 | + <name>lp</name> | |
| 391 | + <ascending>Y</ascending> | |
| 392 | + <case_sensitive>N</case_sensitive> | |
| 393 | + <presorted>N</presorted> | |
| 394 | + </field> | |
| 395 | + <field> | |
| 396 | + <name>fcno</name> | |
| 397 | + <ascending>Y</ascending> | |
| 398 | + <case_sensitive>N</case_sensitive> | |
| 399 | + <presorted>N</presorted> | |
| 400 | + </field> | |
| 401 | + </fields> | |
| 402 | + <cluster_schema/> | |
| 403 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 404 | + <xloc>331</xloc> | |
| 405 | + <yloc>65</yloc> | |
| 406 | + <draw>Y</draw> | |
| 407 | + </GUI> | |
| 408 | + </step> | |
| 409 | + | |
| 410 | + <step> | |
| 411 | + <name>时刻表明细数据表</name> | |
| 412 | + <type>TableInput</type> | |
| 413 | + <description/> | |
| 414 | + <distribute>Y</distribute> | |
| 415 | + <custom_distribution/> | |
| 416 | + <copies>1</copies> | |
| 417 | + <partitioning> | |
| 418 | + <method>none</method> | |
| 419 | + <schema_name/> | |
| 420 | + </partitioning> | |
| 421 | + <connection>bus_control_variable</connection> | |
| 422 | + <sql>select * from bsth_c_s_ttinfo_detail
where ttinfo = ${ttinfoid}</sql> | |
| 423 | + <limit>0</limit> | |
| 424 | + <lookup/> | |
| 425 | + <execute_each_row>N</execute_each_row> | |
| 426 | + <variables_active>Y</variables_active> | |
| 427 | + <lazy_conversion_active>N</lazy_conversion_active> | |
| 428 | + <cluster_schema/> | |
| 429 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 430 | + <xloc>131</xloc> | |
| 431 | + <yloc>65</yloc> | |
| 432 | + <draw>Y</draw> | |
| 433 | + </GUI> | |
| 434 | + </step> | |
| 435 | + | |
| 436 | + <step> | |
| 437 | + <name>Excel输出</name> | |
| 438 | + <type>ExcelOutput</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 | + <header>Y</header> | |
| 448 | + <footer>N</footer> | |
| 449 | + <encoding/> | |
| 450 | + <append>N</append> | |
| 451 | + <add_to_result_filenames>Y</add_to_result_filenames> | |
| 452 | + <file> | |
| 453 | + <name>${filepath}</name> | |
| 454 | + <extention/> | |
| 455 | + <do_not_open_newfile_init>N</do_not_open_newfile_init> | |
| 456 | + <create_parent_folder>N</create_parent_folder> | |
| 457 | + <split>N</split> | |
| 458 | + <add_date>N</add_date> | |
| 459 | + <add_time>N</add_time> | |
| 460 | + <SpecifyFormat>N</SpecifyFormat> | |
| 461 | + <date_time_format/> | |
| 462 | + <sheetname>Sheet1</sheetname> | |
| 463 | + <autosizecolums>N</autosizecolums> | |
| 464 | + <nullisblank>N</nullisblank> | |
| 465 | + <protect_sheet>N</protect_sheet> | |
| 466 | + <password>Encrypted </password> | |
| 467 | + <splitevery>0</splitevery> | |
| 468 | + <usetempfiles>N</usetempfiles> | |
| 469 | + <tempdirectory/> | |
| 470 | + </file> | |
| 471 | + <template> | |
| 472 | + <enabled>N</enabled> | |
| 473 | + <append>N</append> | |
| 474 | + <filename>template.xls</filename> | |
| 475 | + </template> | |
| 476 | + <fields> | |
| 477 | + </fields> | |
| 478 | + <custom> | |
| 479 | + <header_font_name>arial</header_font_name> | |
| 480 | + <header_font_size>10</header_font_size> | |
| 481 | + <header_font_bold>N</header_font_bold> | |
| 482 | + <header_font_italic>N</header_font_italic> | |
| 483 | + <header_font_underline>no</header_font_underline> | |
| 484 | + <header_font_orientation>horizontal</header_font_orientation> | |
| 485 | + <header_font_color>black</header_font_color> | |
| 486 | + <header_background_color>none</header_background_color> | |
| 487 | + <header_row_height>255</header_row_height> | |
| 488 | + <header_alignment>left</header_alignment> | |
| 489 | + <header_image/> | |
| 490 | + <row_font_name>arial</row_font_name> | |
| 491 | + <row_font_size>10</row_font_size> | |
| 492 | + <row_font_color>black</row_font_color> | |
| 493 | + <row_background_color>none</row_background_color> | |
| 494 | + </custom> | |
| 495 | + <cluster_schema/> | |
| 496 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 497 | + <xloc>731</xloc> | |
| 498 | + <yloc>65</yloc> | |
| 499 | + <draw>Y</draw> | |
| 500 | + </GUI> | |
| 501 | + </step> | |
| 502 | + | |
| 503 | + <step> | |
| 504 | + <name>字段选择</name> | |
| 505 | + <type>SelectValues</type> | |
| 506 | + <description/> | |
| 507 | + <distribute>Y</distribute> | |
| 508 | + <custom_distribution/> | |
| 509 | + <copies>1</copies> | |
| 510 | + <partitioning> | |
| 511 | + <method>none</method> | |
| 512 | + <schema_name/> | |
| 513 | + </partitioning> | |
| 514 | + <fields> <field> <name>lp_name</name> | |
| 515 | + <rename>路牌</rename> | |
| 516 | + <length>-2</length> | |
| 517 | + <precision>-2</precision> | |
| 518 | + </field> <select_unspecified>Y</select_unspecified> | |
| 519 | + </fields> <cluster_schema/> | |
| 520 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 521 | + <xloc>534</xloc> | |
| 522 | + <yloc>243</yloc> | |
| 523 | + <draw>Y</draw> | |
| 524 | + </GUI> | |
| 525 | + </step> | |
| 526 | + | |
| 527 | + <step> | |
| 528 | + <name>路牌名字查找</name> | |
| 529 | + <type>DBLookup</type> | |
| 530 | + <description/> | |
| 531 | + <distribute>Y</distribute> | |
| 532 | + <custom_distribution/> | |
| 533 | + <copies>1</copies> | |
| 534 | + <partitioning> | |
| 535 | + <method>none</method> | |
| 536 | + <schema_name/> | |
| 537 | + </partitioning> | |
| 538 | + <connection>bus_control_variable</connection> | |
| 539 | + <cache>N</cache> | |
| 540 | + <cache_load_all>N</cache_load_all> | |
| 541 | + <cache_size>0</cache_size> | |
| 542 | + <lookup> | |
| 543 | + <schema/> | |
| 544 | + <table>bsth_c_s_gbi</table> | |
| 545 | + <orderby/> | |
| 546 | + <fail_on_multiple>N</fail_on_multiple> | |
| 547 | + <eat_row_on_failure>N</eat_row_on_failure> | |
| 548 | + <key> | |
| 549 | + <name>lp</name> | |
| 550 | + <field>id</field> | |
| 551 | + <condition>=</condition> | |
| 552 | + <name2/> | |
| 553 | + </key> | |
| 554 | + <value> | |
| 555 | + <name>lp_name</name> | |
| 556 | + <rename>lp_name</rename> | |
| 557 | + <default/> | |
| 558 | + <type>String</type> | |
| 559 | + </value> | |
| 560 | + </lookup> | |
| 561 | + <cluster_schema/> | |
| 562 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 563 | + <xloc>237</xloc> | |
| 564 | + <yloc>156</yloc> | |
| 565 | + <draw>Y</draw> | |
| 566 | + </GUI> | |
| 567 | + </step> | |
| 568 | + | |
| 569 | + <step_error_handling> | |
| 570 | + </step_error_handling> | |
| 571 | + <slave-step-copy-partition-distribution> | |
| 572 | +</slave-step-copy-partition-distribution> | |
| 573 | + <slave_transformation>N</slave_transformation> | |
| 574 | + | |
| 575 | +</transformation> | ... | ... |
src/main/resources/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr
0 → 100644
| 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 | + </notepads> | |
| 93 | + <connection> | |
| 94 | + <name>bus_control_variable</name> | |
| 95 | + <server>${v_db_ip}</server> | |
| 96 | + <type>MYSQL</type> | |
| 97 | + <access>Native</access> | |
| 98 | + <database>${v_db_dname}</database> | |
| 99 | + <port>3306</port> | |
| 100 | + <username>${v_db_uname}</username> | |
| 101 | + <password>${v_db_pwd}</password> | |
| 102 | + <servername/> | |
| 103 | + <data_tablespace/> | |
| 104 | + <index_tablespace/> | |
| 105 | + <attributes> | |
| 106 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 107 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 108 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 109 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 110 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 111 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 112 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 113 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 114 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | |
| 115 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 116 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 117 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 118 | + </attributes> | |
| 119 | + </connection> | |
| 120 | + <connection> | |
| 121 | + <name>bus_control_公司_201</name> | |
| 122 | + <server>localhost</server> | |
| 123 | + <type>MYSQL</type> | |
| 124 | + <access>Native</access> | |
| 125 | + <database>control</database> | |
| 126 | + <port>3306</port> | |
| 127 | + <username>root</username> | |
| 128 | + <password>Encrypted </password> | |
| 129 | + <servername/> | |
| 130 | + <data_tablespace/> | |
| 131 | + <index_tablespace/> | |
| 132 | + <attributes> | |
| 133 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 134 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 135 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 136 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 137 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 138 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 139 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 140 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 141 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | |
| 142 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 143 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 144 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 145 | + </attributes> | |
| 146 | + </connection> | |
| 147 | + <connection> | |
| 148 | + <name>bus_control_本机</name> | |
| 149 | + <server>localhost</server> | |
| 150 | + <type>MYSQL</type> | |
| 151 | + <access>Native</access> | |
| 152 | + <database>control</database> | |
| 153 | + <port>3306</port> | |
| 154 | + <username>root</username> | |
| 155 | + <password>Encrypted </password> | |
| 156 | + <servername/> | |
| 157 | + <data_tablespace/> | |
| 158 | + <index_tablespace/> | |
| 159 | + <attributes> | |
| 160 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 161 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 162 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 163 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 164 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 165 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 166 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 167 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 168 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 169 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 170 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 171 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 172 | + </attributes> | |
| 173 | + </connection> | |
| 174 | + <connection> | |
| 175 | + <name>xlab_mysql_youle</name> | |
| 176 | + <server>101.231.124.8</server> | |
| 177 | + <type>MYSQL</type> | |
| 178 | + <access>Native</access> | |
| 179 | + <database>xlab_youle</database> | |
| 180 | + <port>45687</port> | |
| 181 | + <username>xlab-youle</username> | |
| 182 | + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password> | |
| 183 | + <servername/> | |
| 184 | + <data_tablespace/> | |
| 185 | + <index_tablespace/> | |
| 186 | + <attributes> | |
| 187 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 188 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 189 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 190 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 191 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 192 | + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute> | |
| 193 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 194 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 195 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 196 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 197 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 198 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 199 | + </attributes> | |
| 200 | + </connection> | |
| 201 | + <connection> | |
| 202 | + <name>xlab_mysql_youle(本机)</name> | |
| 203 | + <server>localhost</server> | |
| 204 | + <type>MYSQL</type> | |
| 205 | + <access>Native</access> | |
| 206 | + <database>xlab_youle</database> | |
| 207 | + <port>3306</port> | |
| 208 | + <username>root</username> | |
| 209 | + <password>Encrypted </password> | |
| 210 | + <servername/> | |
| 211 | + <data_tablespace/> | |
| 212 | + <index_tablespace/> | |
| 213 | + <attributes> | |
| 214 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | |
| 215 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | |
| 216 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 217 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 218 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 219 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | |
| 220 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 221 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 222 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 223 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 224 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | |
| 225 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 226 | + </attributes> | |
| 227 | + </connection> | |
| 228 | + <connection> | |
| 229 | + <name>xlab_youle</name> | |
| 230 | + <server/> | |
| 231 | + <type>MYSQL</type> | |
| 232 | + <access>JNDI</access> | |
| 233 | + <database>xlab_youle</database> | |
| 234 | + <port>1521</port> | |
| 235 | + <username/> | |
| 236 | + <password>Encrypted </password> | |
| 237 | + <servername/> | |
| 238 | + <data_tablespace/> | |
| 239 | + <index_tablespace/> | |
| 240 | + <attributes> | |
| 241 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 242 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 243 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 244 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | |
| 245 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 246 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 247 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | |
| 248 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 249 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 250 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 251 | + </attributes> | |
| 252 | + </connection> | |
| 253 | + <order> | |
| 254 | + <hop> <from>时刻表明细分组数据</from><to>过滤记录</to><enabled>Y</enabled> </hop> | |
| 255 | + <hop> <from>过滤记录</from><to>计算站点</to><enabled>Y</enabled> </hop> | |
| 256 | + <hop> <from>计算站点</from><to>查找站点名</to><enabled>Y</enabled> </hop> | |
| 257 | + <hop> <from>查找站点名</from><to>计算反范式元数据</to><enabled>Y</enabled> </hop> | |
| 258 | + <hop> <from>查找站点名</from><to>计算excel输出字段</to><enabled>Y</enabled> </hop> | |
| 259 | + <hop> <from>计算excel输出字段</from><to>字段选择</to><enabled>Y</enabled> </hop> | |
| 260 | + <hop> <from>字段选择</from><to>排序记录</to><enabled>Y</enabled> </hop> | |
| 261 | + <hop> <from>生成路牌字段</from><to>排序记录</to><enabled>Y</enabled> </hop> | |
| 262 | + <hop> <from>计算反范式元数据</from><to>ETL元数据注入</to><enabled>Y</enabled> </hop> | |
| 263 | + <hop> <from>排序记录</from><to>ETL元数据注入</to><enabled>Y</enabled> </hop> | |
| 264 | + </order> | |
| 265 | + <step> | |
| 266 | + <name>ETL元数据注入</name> | |
| 267 | + <type>MetaInject</type> | |
| 268 | + <description/> | |
| 269 | + <distribute>Y</distribute> | |
| 270 | + <custom_distribution/> | |
| 271 | + <copies>1</copies> | |
| 272 | + <partitioning> | |
| 273 | + <method>none</method> | |
| 274 | + <schema_name/> | |
| 275 | + </partitioning> | |
| 276 | + <specification_method>filename</specification_method> | |
| 277 | + <trans_object_id/> | |
| 278 | + <trans_name/> | |
| 279 | + <filename>${injectktrfile}</filename> | |
| 280 | + <directory_path/> | |
| 281 | + <source_step/> | |
| 282 | + <source_output_fields> </source_output_fields> <target_file/> | |
| 283 | + <no_execution>N</no_execution> | |
| 284 | + <stream_source_step/> | |
| 285 | + <stream_target_step/> | |
| 286 | + <mappings> <mapping> <target_step_name>列转行</target_step_name> | |
| 287 | + <target_attribute_key>TARGET_TYPE</target_attribute_key> | |
| 288 | + <target_detail>Y</target_detail> | |
| 289 | + <source_step>计算反范式元数据</source_step> | |
| 290 | + <source_field>targettype</source_field> | |
| 291 | + </mapping> <mapping> <target_step_name>Excel输出</target_step_name> | |
| 292 | + <target_attribute_key>TYPE</target_attribute_key> | |
| 293 | + <target_detail>Y</target_detail> | |
| 294 | + <source_step>排序记录</source_step> | |
| 295 | + <source_field>fieldtype</source_field> | |
| 296 | + </mapping> <mapping> <target_step_name>列转行</target_step_name> | |
| 297 | + <target_attribute_key>NAME</target_attribute_key> | |
| 298 | + <target_detail>Y</target_detail> | |
| 299 | + <source_step>计算反范式元数据</source_step> | |
| 300 | + <source_field>valuefieldname</source_field> | |
| 301 | + </mapping> <mapping> <target_step_name>Excel输出</target_step_name> | |
| 302 | + <target_attribute_key>NAME</target_attribute_key> | |
| 303 | + <target_detail>Y</target_detail> | |
| 304 | + <source_step>排序记录</source_step> | |
| 305 | + <source_field>fieldname</source_field> | |
| 306 | + </mapping> <mapping> <target_step_name>列转行</target_step_name> | |
| 307 | + <target_attribute_key>TARGET_NAME</target_attribute_key> | |
| 308 | + <target_detail>Y</target_detail> | |
| 309 | + <source_step>计算反范式元数据</source_step> | |
| 310 | + <source_field>targetfieldname</source_field> | |
| 311 | + </mapping> <mapping> <target_step_name>列转行</target_step_name> | |
| 312 | + <target_attribute_key>KEY_VALUE</target_attribute_key> | |
| 313 | + <target_detail>Y</target_detail> | |
| 314 | + <source_step>计算反范式元数据</source_step> | |
| 315 | + <source_field>keyvalue</source_field> | |
| 316 | + </mapping> </mappings> <cluster_schema/> | |
| 317 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 318 | + <xloc>640</xloc> | |
| 319 | + <yloc>64</yloc> | |
| 320 | + <draw>Y</draw> | |
| 321 | + </GUI> | |
| 322 | + </step> | |
| 323 | + | |
| 324 | + <step> | |
| 325 | + <name>时刻表明细分组数据</name> | |
| 326 | + <type>TableInput</type> | |
| 327 | + <description/> | |
| 328 | + <distribute>Y</distribute> | |
| 329 | + <custom_distribution/> | |
| 330 | + <copies>1</copies> | |
| 331 | + <partitioning> | |
| 332 | + <method>none</method> | |
| 333 | + <schema_name/> | |
| 334 | + </partitioning> | |
| 335 | + <connection>bus_control_variable</connection> | |
| 336 | + <sql>select 
fcno
, min(xl_dir) xl_dir
,min(qdz) qdz
,min(zdz) zdz
,bc_type 
from bsth_c_s_ttinfo_detail
where ttinfo = ${ttinfoid}
group by fcno,bc_type</sql> | |
| 337 | + <limit>0</limit> | |
| 338 | + <lookup/> | |
| 339 | + <execute_each_row>N</execute_each_row> | |
| 340 | + <variables_active>Y</variables_active> | |
| 341 | + <lazy_conversion_active>N</lazy_conversion_active> | |
| 342 | + <cluster_schema/> | |
| 343 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 344 | + <xloc>56</xloc> | |
| 345 | + <yloc>185</yloc> | |
| 346 | + <draw>Y</draw> | |
| 347 | + </GUI> | |
| 348 | + </step> | |
| 349 | + | |
| 350 | + <step> | |
| 351 | + <name>过滤记录</name> | |
| 352 | + <type>FilterRows</type> | |
| 353 | + <description/> | |
| 354 | + <distribute>Y</distribute> | |
| 355 | + <custom_distribution/> | |
| 356 | + <copies>1</copies> | |
| 357 | + <partitioning> | |
| 358 | + <method>none</method> | |
| 359 | + <schema_name/> | |
| 360 | + </partitioning> | |
| 361 | +<send_true_to/> | |
| 362 | +<send_false_to/> | |
| 363 | + <compare> | |
| 364 | +<condition> | |
| 365 | + <negated>N</negated> | |
| 366 | + <leftvalue>bc_type</leftvalue> | |
| 367 | + <function>IS NOT NULL</function> | |
| 368 | + <rightvalue/> | |
| 369 | + </condition> | |
| 370 | + </compare> | |
| 371 | + <cluster_schema/> | |
| 372 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 373 | + <xloc>182</xloc> | |
| 374 | + <yloc>189</yloc> | |
| 375 | + <draw>Y</draw> | |
| 376 | + </GUI> | |
| 377 | + </step> | |
| 378 | + | |
| 379 | + <step> | |
| 380 | + <name>计算站点</name> | |
| 381 | + <type>ScriptValueMod</type> | |
| 382 | + <description/> | |
| 383 | + <distribute>Y</distribute> | |
| 384 | + <custom_distribution/> | |
| 385 | + <copies>1</copies> | |
| 386 | + <partitioning> | |
| 387 | + <method>none</method> | |
| 388 | + <schema_name/> | |
| 389 | + </partitioning> | |
| 390 | + <compatible>N</compatible> | |
| 391 | + <optimizationLevel>9</optimizationLevel> | |
| 392 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 393 | + <jsScript_name>Script 1</jsScript_name> | |
| 394 | + <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> | |
| 395 | + </jsScript> </jsScripts> <fields> <field> <name>zd</name> | |
| 396 | + <rename>zd</rename> | |
| 397 | + <type>String</type> | |
| 398 | + <length>-1</length> | |
| 399 | + <precision>-1</precision> | |
| 400 | + <replace>N</replace> | |
| 401 | + </field> </fields> <cluster_schema/> | |
| 402 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 403 | + <xloc>300</xloc> | |
| 404 | + <yloc>190</yloc> | |
| 405 | + <draw>Y</draw> | |
| 406 | + </GUI> | |
| 407 | + </step> | |
| 408 | + | |
| 409 | + <step> | |
| 410 | + <name>查找站点名</name> | |
| 411 | + <type>DBLookup</type> | |
| 412 | + <description/> | |
| 413 | + <distribute>N</distribute> | |
| 414 | + <custom_distribution/> | |
| 415 | + <copies>1</copies> | |
| 416 | + <partitioning> | |
| 417 | + <method>none</method> | |
| 418 | + <schema_name/> | |
| 419 | + </partitioning> | |
| 420 | + <connection>bus_control_variable</connection> | |
| 421 | + <cache>N</cache> | |
| 422 | + <cache_load_all>N</cache_load_all> | |
| 423 | + <cache_size>0</cache_size> | |
| 424 | + <lookup> | |
| 425 | + <schema/> | |
| 426 | + <table>bsth_c_stationroute</table> | |
| 427 | + <orderby/> | |
| 428 | + <fail_on_multiple>N</fail_on_multiple> | |
| 429 | + <eat_row_on_failure>N</eat_row_on_failure> | |
| 430 | + <key> | |
| 431 | + <name>zd</name> | |
| 432 | + <field>station</field> | |
| 433 | + <condition>=</condition> | |
| 434 | + <name2/> | |
| 435 | + </key> | |
| 436 | + <key> | |
| 437 | + <name>xl_dir</name> | |
| 438 | + <field>directions</field> | |
| 439 | + <condition>=</condition> | |
| 440 | + <name2/> | |
| 441 | + </key> | |
| 442 | + <value> | |
| 443 | + <name>station_name</name> | |
| 444 | + <rename>zdname</rename> | |
| 445 | + <default/> | |
| 446 | + <type>String</type> | |
| 447 | + </value> | |
| 448 | + </lookup> | |
| 449 | + <cluster_schema/> | |
| 450 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 451 | + <xloc>410</xloc> | |
| 452 | + <yloc>191</yloc> | |
| 453 | + <draw>Y</draw> | |
| 454 | + </GUI> | |
| 455 | + </step> | |
| 456 | + | |
| 457 | + <step> | |
| 458 | + <name>计算反范式元数据</name> | |
| 459 | + <type>ScriptValueMod</type> | |
| 460 | + <description/> | |
| 461 | + <distribute>Y</distribute> | |
| 462 | + <custom_distribution/> | |
| 463 | + <copies>1</copies> | |
| 464 | + <partitioning> | |
| 465 | + <method>none</method> | |
| 466 | + <schema_name/> | |
| 467 | + </partitioning> | |
| 468 | + <compatible>N</compatible> | |
| 469 | + <optimizationLevel>9</optimizationLevel> | |
| 470 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 471 | + <jsScript_name>Script 1</jsScript_name> | |
| 472 | + <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> | |
| 473 | + </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name> | |
| 474 | + <rename>targetfieldname</rename> | |
| 475 | + <type>String</type> | |
| 476 | + <length>-1</length> | |
| 477 | + <precision>-1</precision> | |
| 478 | + <replace>N</replace> | |
| 479 | + </field> <field> <name>targettype</name> | |
| 480 | + <rename>targettype</rename> | |
| 481 | + <type>String</type> | |
| 482 | + <length>-1</length> | |
| 483 | + <precision>-1</precision> | |
| 484 | + <replace>N</replace> | |
| 485 | + </field> <field> <name>valuefieldname</name> | |
| 486 | + <rename>valuefieldname</rename> | |
| 487 | + <type>String</type> | |
| 488 | + <length>-1</length> | |
| 489 | + <precision>-1</precision> | |
| 490 | + <replace>N</replace> | |
| 491 | + </field> <field> <name>keyvalue</name> | |
| 492 | + <rename>keyvalue</rename> | |
| 493 | + <type>String</type> | |
| 494 | + <length>-1</length> | |
| 495 | + <precision>-1</precision> | |
| 496 | + <replace>N</replace> | |
| 497 | + </field> </fields> <cluster_schema/> | |
| 498 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 499 | + <xloc>410</xloc> | |
| 500 | + <yloc>64</yloc> | |
| 501 | + <draw>Y</draw> | |
| 502 | + </GUI> | |
| 503 | + </step> | |
| 504 | + | |
| 505 | + <step> | |
| 506 | + <name>计算excel输出字段</name> | |
| 507 | + <type>ScriptValueMod</type> | |
| 508 | + <description/> | |
| 509 | + <distribute>Y</distribute> | |
| 510 | + <custom_distribution/> | |
| 511 | + <copies>1</copies> | |
| 512 | + <partitioning> | |
| 513 | + <method>none</method> | |
| 514 | + <schema_name/> | |
| 515 | + </partitioning> | |
| 516 | + <compatible>N</compatible> | |
| 517 | + <optimizationLevel>9</optimizationLevel> | |
| 518 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 519 | + <jsScript_name>Script 1</jsScript_name> | |
| 520 | + <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> | |
| 521 | + </jsScript> </jsScripts> <fields> <field> <name>fieldname</name> | |
| 522 | + <rename>fieldname</rename> | |
| 523 | + <type>String</type> | |
| 524 | + <length>-1</length> | |
| 525 | + <precision>-1</precision> | |
| 526 | + <replace>N</replace> | |
| 527 | + </field> <field> <name>fieldtype</name> | |
| 528 | + <rename>fieldtype</rename> | |
| 529 | + <type>String</type> | |
| 530 | + <length>-1</length> | |
| 531 | + <precision>-1</precision> | |
| 532 | + <replace>N</replace> | |
| 533 | + </field> </fields> <cluster_schema/> | |
| 534 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 535 | + <xloc>410</xloc> | |
| 536 | + <yloc>326</yloc> | |
| 537 | + <draw>Y</draw> | |
| 538 | + </GUI> | |
| 539 | + </step> | |
| 540 | + | |
| 541 | + <step> | |
| 542 | + <name>字段选择</name> | |
| 543 | + <type>SelectValues</type> | |
| 544 | + <description/> | |
| 545 | + <distribute>Y</distribute> | |
| 546 | + <custom_distribution/> | |
| 547 | + <copies>1</copies> | |
| 548 | + <partitioning> | |
| 549 | + <method>none</method> | |
| 550 | + <schema_name/> | |
| 551 | + </partitioning> | |
| 552 | + <fields> <field> <name>fieldname</name> | |
| 553 | + <rename/> | |
| 554 | + <length>-2</length> | |
| 555 | + <precision>-2</precision> | |
| 556 | + </field> <field> <name>fieldtype</name> | |
| 557 | + <rename/> | |
| 558 | + <length>-2</length> | |
| 559 | + <precision>-2</precision> | |
| 560 | + </field> <field> <name>fcno</name> | |
| 561 | + <rename/> | |
| 562 | + <length>-2</length> | |
| 563 | + <precision>-2</precision> | |
| 564 | + </field> <select_unspecified>N</select_unspecified> | |
| 565 | + </fields> <cluster_schema/> | |
| 566 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 567 | + <xloc>533</xloc> | |
| 568 | + <yloc>325</yloc> | |
| 569 | + <draw>Y</draw> | |
| 570 | + </GUI> | |
| 571 | + </step> | |
| 572 | + | |
| 573 | + <step> | |
| 574 | + <name>生成路牌字段</name> | |
| 575 | + <type>RowGenerator</type> | |
| 576 | + <description/> | |
| 577 | + <distribute>Y</distribute> | |
| 578 | + <custom_distribution/> | |
| 579 | + <copies>1</copies> | |
| 580 | + <partitioning> | |
| 581 | + <method>none</method> | |
| 582 | + <schema_name/> | |
| 583 | + </partitioning> | |
| 584 | + <fields> | |
| 585 | + <field> | |
| 586 | + <name>fieldname</name> | |
| 587 | + <type>String</type> | |
| 588 | + <format/> | |
| 589 | + <currency/> | |
| 590 | + <decimal/> | |
| 591 | + <group/> | |
| 592 | + <nullif>路牌</nullif> | |
| 593 | + <length>-1</length> | |
| 594 | + <precision>-1</precision> | |
| 595 | + <set_empty_string>N</set_empty_string> | |
| 596 | + </field> | |
| 597 | + <field> | |
| 598 | + <name>fieldtype</name> | |
| 599 | + <type>String</type> | |
| 600 | + <format/> | |
| 601 | + <currency/> | |
| 602 | + <decimal/> | |
| 603 | + <group/> | |
| 604 | + <nullif>String</nullif> | |
| 605 | + <length>-1</length> | |
| 606 | + <precision>-1</precision> | |
| 607 | + <set_empty_string>N</set_empty_string> | |
| 608 | + </field> | |
| 609 | + <field> | |
| 610 | + <name>fcno</name> | |
| 611 | + <type>Integer</type> | |
| 612 | + <format/> | |
| 613 | + <currency/> | |
| 614 | + <decimal/> | |
| 615 | + <group/> | |
| 616 | + <nullif>0</nullif> | |
| 617 | + <length>-1</length> | |
| 618 | + <precision>-1</precision> | |
| 619 | + <set_empty_string>N</set_empty_string> | |
| 620 | + </field> | |
| 621 | + </fields> | |
| 622 | + <limit>1</limit> | |
| 623 | + <never_ending>N</never_ending> | |
| 624 | + <interval_in_ms>5000</interval_in_ms> | |
| 625 | + <row_time_field>now</row_time_field> | |
| 626 | + <last_time_field>FiveSecondsAgo</last_time_field> | |
| 627 | + <cluster_schema/> | |
| 628 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 629 | + <xloc>530</xloc> | |
| 630 | + <yloc>194</yloc> | |
| 631 | + <draw>Y</draw> | |
| 632 | + </GUI> | |
| 633 | + </step> | |
| 634 | + | |
| 635 | + <step> | |
| 636 | + <name>排序记录</name> | |
| 637 | + <type>SortRows</type> | |
| 638 | + <description/> | |
| 639 | + <distribute>Y</distribute> | |
| 640 | + <custom_distribution/> | |
| 641 | + <copies>1</copies> | |
| 642 | + <partitioning> | |
| 643 | + <method>none</method> | |
| 644 | + <schema_name/> | |
| 645 | + </partitioning> | |
| 646 | + <directory>%%java.io.tmpdir%%</directory> | |
| 647 | + <prefix>out</prefix> | |
| 648 | + <sort_size>1000000</sort_size> | |
| 649 | + <free_memory/> | |
| 650 | + <compress>N</compress> | |
| 651 | + <compress_variable/> | |
| 652 | + <unique_rows>N</unique_rows> | |
| 653 | + <fields> | |
| 654 | + <field> | |
| 655 | + <name>fcno</name> | |
| 656 | + <ascending>Y</ascending> | |
| 657 | + <case_sensitive>N</case_sensitive> | |
| 658 | + <presorted>N</presorted> | |
| 659 | + </field> | |
| 660 | + </fields> | |
| 661 | + <cluster_schema/> | |
| 662 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 663 | + <xloc>642</xloc> | |
| 664 | + <yloc>325</yloc> | |
| 665 | + <draw>Y</draw> | |
| 666 | + </GUI> | |
| 667 | + </step> | |
| 668 | + | |
| 669 | + <step_error_handling> | |
| 670 | + </step_error_handling> | |
| 671 | + <slave-step-copy-partition-distribution> | |
| 672 | +</slave-step-copy-partition-distribution> | |
| 673 | + <slave_transformation>N</slave_transformation> | |
| 674 | + | |
| 675 | +</transformation> | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-function.js
| ... | ... | @@ -59,11 +59,11 @@ var PublicFunctions = function () { |
| 59 | 59 | |
| 60 | 60 | var shapesV = ''; |
| 61 | 61 | |
| 62 | - if(r[0].carParkShapesType='d') { | |
| 62 | + if(r[0].carParkShapesType=='d') { | |
| 63 | 63 | |
| 64 | 64 | shapesV = '多边形'; |
| 65 | 65 | |
| 66 | - }else if(r[0].carParkShapesType='r') { | |
| 66 | + }else if(r[0].carParkShapesType=='r') { | |
| 67 | 67 | |
| 68 | 68 | shapesV = '圆形'; |
| 69 | 69 | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-map.js
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
| ... | ... | @@ -438,10 +438,10 @@ var PublicFunctions = function () { |
| 438 | 438 | // 刷行左边树 |
| 439 | 439 | PublicFunctions.resjtreeDate(Line.id,stationRouteDirections); |
| 440 | 440 | |
| 441 | - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:上行路段数据 */ | |
| 441 | + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | |
| 442 | 442 | GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) { |
| 443 | 443 | |
| 444 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:上行路段数据> */ | |
| 444 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | |
| 445 | 445 | PublicFunctions.linePanlThree(Line.id,data,stationRouteDirections); |
| 446 | 446 | |
| 447 | 447 | }); |
| ... | ... | @@ -594,8 +594,45 @@ var PublicFunctions = function () { |
| 594 | 594 | $('#descriptionsTextarea').val(Section.descriptions); |
| 595 | 595 | |
| 596 | 596 | }, |
| 597 | + //lineId,data,direction | |
| 598 | + treeSectionClick: function(lineId,data,direction){ | |
| 599 | + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | |
| 600 | + WorldsBMap.clearMarkAndOverlays(); | |
| 601 | + // 编辑路段数据 | |
| 602 | + for(var d= 0; d<data.length;d++){ | |
| 603 | + | |
| 604 | + // 地图折线坐标点集合 | |
| 605 | + var polylineArray = []; | |
| 606 | + // 获取路段折线坐标字符串 | |
| 607 | + var sectionBsectionVectorStr = data[d].sectionBsectionVector; | |
| 608 | + | |
| 609 | + if(sectionBsectionVectorStr==null) { | |
| 610 | + | |
| 611 | + continue; | |
| 612 | + | |
| 613 | + } | |
| 614 | + | |
| 615 | + // 切割段折线坐标字符串 | |
| 616 | + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | |
| 617 | + | |
| 618 | + // 分割折线坐标字符串 | |
| 619 | + var lineArray = tempStr.split(','); | |
| 620 | + | |
| 621 | + for(var i = 0;i<lineArray.length;i++) { | |
| 622 | + | |
| 623 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | |
| 624 | + | |
| 625 | + } | |
| 626 | + var index = parseInt(polylineArray.length/2); | |
| 627 | + var center = polylineArray[index]; | |
| 628 | + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | |
| 629 | + WorldsBMap.drawingUpline(polylineArray,center); | |
| 630 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | |
| 631 | + WorldsBMap.drawingUpStationPoint(center,data[d].name,d+1); | |
| 632 | + } | |
| 633 | + }, | |
| 597 | 634 | |
| 598 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:上行路段数据> */ | |
| 635 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | |
| 599 | 636 | linePanlThree : function(lineId,data,direction) { |
| 600 | 637 | |
| 601 | 638 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ |
| ... | ... | @@ -603,18 +640,52 @@ var PublicFunctions = function () { |
| 603 | 640 | |
| 604 | 641 | WorldsBMap.clearMarkAndOverlays(); |
| 605 | 642 | |
| 643 | + var polyline_center; | |
| 644 | + | |
| 645 | + // 如果站点路由数据不为空 | |
| 646 | + if(resultdata.length>0) { | |
| 647 | + | |
| 648 | + var ceter_index = Math.round(resultdata.length / 2); | |
| 649 | + | |
| 650 | + var ceterPointsStr = resultdata[ceter_index].bJwpoints; | |
| 651 | + | |
| 652 | + var ceterPointsArray = ceterPointsStr.split(' '); | |
| 653 | + | |
| 654 | + polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); | |
| 655 | + | |
| 656 | + // 遍历站点路由数据 | |
| 657 | + for(var s = 0 ; s<resultdata.length;s++) { | |
| 658 | + | |
| 659 | + // 中心点坐标字符串 | |
| 660 | + var bJwpointsStr = resultdata[s].bJwpoints; | |
| 661 | + | |
| 662 | + var stationName = resultdata[s].stationName; | |
| 663 | + | |
| 664 | + // 起个中心点坐标字符串 | |
| 665 | + var bJwpointsArray = bJwpointsStr.split(' '); | |
| 666 | + | |
| 667 | + // 设置中心点 | |
| 668 | + var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); | |
| 669 | + | |
| 670 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | |
| 671 | + WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1); | |
| 672 | + | |
| 673 | + } | |
| 674 | + | |
| 675 | + } | |
| 676 | + | |
| 606 | 677 | // 路段数据长度 |
| 607 | 678 | var dataLen = data.length; |
| 608 | - | |
| 679 | + //debugger; | |
| 609 | 680 | // 如果大于零 |
| 610 | 681 | if(dataLen>0) { |
| 611 | 682 | |
| 612 | - // 地图折线坐标点集合 | |
| 613 | - var polylineArray = []; | |
| 614 | - | |
| 615 | 683 | // 编辑路段数据 |
| 616 | 684 | for(var d= 0; d<dataLen;d++){ |
| 617 | 685 | |
| 686 | + // 地图折线坐标点集合 | |
| 687 | + var polylineArray = []; | |
| 688 | + | |
| 618 | 689 | // 获取路段折线坐标字符串 |
| 619 | 690 | var sectionBsectionVectorStr = data[d].sectionBsectionVector; |
| 620 | 691 | |
| ... | ... | @@ -635,36 +706,10 @@ var PublicFunctions = function () { |
| 635 | 706 | polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); |
| 636 | 707 | |
| 637 | 708 | } |
| 709 | + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | |
| 710 | + WorldsBMap.drawingUpline(polylineArray,polyline_center); | |
| 638 | 711 | |
| 639 | 712 | } |
| 640 | - | |
| 641 | - /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | |
| 642 | - WorldsBMap.drawingUpline(polylineArray,resultdata); | |
| 643 | - | |
| 644 | - // 如果站点路由数据不为空 | |
| 645 | - if(resultdata.length>0) { | |
| 646 | - | |
| 647 | - // 遍历站点路由数据 | |
| 648 | - for(var s = 0 ; s<resultdata.length;s++) { | |
| 649 | - | |
| 650 | - // 中心点坐标字符串 | |
| 651 | - var bJwpointsStr = resultdata[s].bJwpoints; | |
| 652 | - | |
| 653 | - var stationName = resultdata[s].stationName; | |
| 654 | - | |
| 655 | - // 起个中心点坐标字符串 | |
| 656 | - var bJwpointsArray = bJwpointsStr.split(' '); | |
| 657 | - | |
| 658 | - // 设置中心点 | |
| 659 | - var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); | |
| 660 | - | |
| 661 | - /** 在地图上画点 @param:<point_center:中心坐标点> */ | |
| 662 | - WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1); | |
| 663 | - | |
| 664 | - } | |
| 665 | - | |
| 666 | - } | |
| 667 | - | |
| 668 | 713 | } |
| 669 | 714 | |
| 670 | 715 | }); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
| ... | ... | @@ -651,10 +651,9 @@ var WorldsBMap = function () { |
| 651 | 651 | }, |
| 652 | 652 | |
| 653 | 653 | // 在地图上画出上行线路走向 |
| 654 | - drawingUpline : function (polylineArray,resultdata) { | |
| 655 | - | |
| 656 | - WorldsBMap.clearMarkAndOverlays(); | |
| 654 | + drawingUpline : function (polylineArray,polyline_center) { | |
| 657 | 655 | |
| 656 | + /*WorldsBMap.clearMarkAndOverlays();*/ | |
| 658 | 657 | polyUpline = ''; |
| 659 | 658 | |
| 660 | 659 | // 创建线路走向 |
| ... | ... | @@ -663,13 +662,13 @@ var WorldsBMap = function () { |
| 663 | 662 | // 把折线添加到地图上 |
| 664 | 663 | mapBValue.addOverlay(polyUpline); |
| 665 | 664 | |
| 666 | - var ceter_index = Math.round(resultdata.length / 2); | |
| 665 | + /*var ceter_index = Math.round(resultdata.length / 2); | |
| 667 | 666 | |
| 668 | 667 | var ceterPointsStr = resultdata[ceter_index].bJwpoints; |
| 669 | 668 | |
| 670 | 669 | var ceterPointsArray = ceterPointsStr.split(' '); |
| 671 | 670 | |
| 672 | - var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); | |
| 671 | + var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/ | |
| 673 | 672 | |
| 674 | 673 | var PanOptions_ ={noAnimation :true}; |
| 675 | 674 | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-reload.js
| ... | ... | @@ -62,10 +62,10 @@ $(function(){ |
| 62 | 62 | /** 初始化下行树 @param:<Line.id:线路Id;0:下行> */ |
| 63 | 63 | PublicFunctions.TreeUpOrDown(Line.id,'1'); |
| 64 | 64 | |
| 65 | - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:上行路段数据 */ | |
| 65 | + /** 查询路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | |
| 66 | 66 | GetAjaxData.getSectionRouteInfo(Line.id,'0',function(data) { |
| 67 | 67 | |
| 68 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:上行路段数据> */ | |
| 68 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | |
| 69 | 69 | PublicFunctions.linePanlThree(Line.id,data,'0'); |
| 70 | 70 | |
| 71 | 71 | }); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-treedata.js
| ... | ... | @@ -57,8 +57,10 @@ var StationTreeData = function(){ |
| 57 | 57 | // 线路ID |
| 58 | 58 | var Line = LineObj.getLineObj(); |
| 59 | 59 | |
| 60 | + /*// 百度地图画路段 | |
| 61 | + PublicFunctions.linePanlThree(Line.id,polylineArray,dire_);*/ | |
| 60 | 62 | // 百度地图画路段 |
| 61 | - PublicFunctions.linePanlThree(Line.id,polylineArray,dire_); | |
| 63 | + PublicFunctions.treeSectionClick(Line.id,polylineArray,dire_); | |
| 62 | 64 | |
| 63 | 65 | } |
| 64 | 66 | |
| ... | ... | @@ -151,7 +153,8 @@ var StationTreeData = function(){ |
| 151 | 153 | var polylineArray_ = [edtste]; |
| 152 | 154 | |
| 153 | 155 | // 百度地图画路段 |
| 154 | - PublicFunctions.linePanlThree(edtste.sectionrouteLine,polylineArray_,edtste.sectionrouteDirections); | |
| 156 | + // PublicFunctions.linePanlThree(edtste.sectionrouteLine,polylineArray_,edtste.sectionrouteDirections); | |
| 157 | + PublicFunctions.treeSectionClick(Line.id,polylineArray,dire_); | |
| 155 | 158 | |
| 156 | 159 | parmasObj(); |
| 157 | 160 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -403,6 +403,22 @@ angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resou |
| 403 | 403 | isArray: true |
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | + ), | |
| 407 | + dataTools: $resource( | |
| 408 | + '/tidc/:type', | |
| 409 | + {}, | |
| 410 | + { | |
| 411 | + dataExport: { | |
| 412 | + method: 'GET', | |
| 413 | + responseType: "arraybuffer", | |
| 414 | + params: { | |
| 415 | + type: "dataExportExt" | |
| 416 | + }, | |
| 417 | + transformResponse: function(data, headers){ | |
| 418 | + return {data : data}; | |
| 419 | + } | |
| 420 | + } | |
| 421 | + } | |
| 406 | 422 | ) |
| 407 | 423 | |
| 408 | 424 | // TODO:导入数据 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
| ... | ... | @@ -64,19 +64,18 @@ |
| 64 | 64 | <div class="form-group has-success has-feedback"> |
| 65 | 65 | <label class="col-md-2 control-label">车辆*:</label> |
| 66 | 66 | <div class="col-md-3"> |
| 67 | - <sa-Select3 model="ctrl.busConfigForSave" | |
| 68 | - name="cl" | |
| 69 | - placeholder="请输拼音..." | |
| 70 | - dcvalue="{{ctrl.busConfigForSave.cl.id}}" | |
| 67 | + <sa-Select5 name="cl" | |
| 68 | + model="ctrl.busConfigForSave" | |
| 69 | + cmaps="{'cl.id': 'id'}" | |
| 71 | 70 | dcname="cl.id" |
| 72 | 71 | icname="id" |
| 73 | - icnames="insideCode" | |
| 74 | - datatype="cl" | |
| 75 | - dataassociate="true" | |
| 76 | - dataparam="{{ {'businessCode_eq': ctrl.busConfigForSave.xl.company} | json }}" | |
| 77 | - mlp="true" | |
| 72 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}" | |
| 73 | + iterobjname="item" | |
| 74 | + iterobjexp="item.insideCode" | |
| 75 | + searchph="请输拼音..." | |
| 76 | + searchexp="this.insideCode" | |
| 78 | 77 | required > |
| 79 | - </sa-Select3> | |
| 78 | + </sa-Select5> | |
| 80 | 79 | </div> |
| 81 | 80 | <!-- 隐藏块,显示验证信息 --> |
| 82 | 81 | <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required"> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/form.html
| ... | ... | @@ -64,19 +64,18 @@ |
| 64 | 64 | <div class="form-group has-success has-feedback"> |
| 65 | 65 | <label class="col-md-2 control-label">车辆*:</label> |
| 66 | 66 | <div class="col-md-3"> |
| 67 | - <sa-Select3 model="ctrl.busConfigForSave" | |
| 68 | - name="cl" | |
| 69 | - placeholder="请输拼音..." | |
| 70 | - dcvalue="{{ctrl.busConfigForSave.cl.id}}" | |
| 67 | + <sa-Select5 name="cl" | |
| 68 | + model="ctrl.busConfigForSave" | |
| 69 | + cmaps="{'cl.id': 'id'}" | |
| 71 | 70 | dcname="cl.id" |
| 72 | 71 | icname="id" |
| 73 | - icnames="insideCode" | |
| 74 | - datatype="cl" | |
| 75 | - dataassociate="true" | |
| 76 | - dataparam="{{ {'businessCode_eq': ctrl.busConfigForSave.xl.company} | json }}" | |
| 77 | - mlp="true" | |
| 72 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}" | |
| 73 | + iterobjname="item" | |
| 74 | + iterobjexp="item.insideCode" | |
| 75 | + searchph="请输拼音..." | |
| 76 | + searchexp="this.insideCode" | |
| 78 | 77 | required > |
| 79 | - </sa-Select3> | |
| 78 | + </sa-Select5> | |
| 80 | 79 | </div> |
| 81 | 80 | <!-- 隐藏块,显示验证信息 --> |
| 82 | 81 | <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required"> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
| ... | ... | @@ -77,7 +77,7 @@ |
| 77 | 77 | class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> |
| 78 | 78 | <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" |
| 79 | 79 | class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 导入 </a> |
| 80 | - <a href="javascript:" class="btn btn-info btn-sm"> 导出 </a> | |
| 80 | + <a href="javascript:" class="btn btn-info btn-sm" ng-click="ctrl.exportData(info.id)"> 导出 </a> | |
| 81 | 81 | </td> |
| 82 | 82 | <td> |
| 83 | 83 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/main.js
| ... | ... | @@ -3,7 +3,8 @@ angular.module('ScheduleApp').factory( |
| 3 | 3 | 'TtInfoManageService', |
| 4 | 4 | [ |
| 5 | 5 | 'TimeTableManageService_g', |
| 6 | - function(service) { | |
| 6 | + 'TimeTableDetailManageService_g', | |
| 7 | + function(service, dservice) { | |
| 7 | 8 | // 当前查询的内容条件搜索对象 |
| 8 | 9 | var currentSearchCondition = {page: 0}; |
| 9 | 10 | // 当前查询返回的信息 |
| ... | ... | @@ -42,6 +43,16 @@ angular.module('ScheduleApp').factory( |
| 42 | 43 | content: [], |
| 43 | 44 | uiNumber: 1 |
| 44 | 45 | }; |
| 46 | + }, | |
| 47 | + /** | |
| 48 | + * 数据导出。 | |
| 49 | + * @returns {*|Function|promise|n} | |
| 50 | + */ | |
| 51 | + dataExport: function(ttinfoid) { | |
| 52 | + var param = {}; | |
| 53 | + param.type = 'dataExportExt'; | |
| 54 | + param.ttinfoid = ttinfoid; | |
| 55 | + return dservice.dataTools.dataExport(param).$promise; | |
| 45 | 56 | } |
| 46 | 57 | |
| 47 | 58 | |
| ... | ... | @@ -73,7 +84,8 @@ angular.module('ScheduleApp').controller( |
| 73 | 84 | 'TtInfoManageListCtrl', |
| 74 | 85 | [ |
| 75 | 86 | 'TtInfoManageService', |
| 76 | - function(service) { | |
| 87 | + 'FileDownload_g', | |
| 88 | + function(service, fileDownload) { | |
| 77 | 89 | var self = this; |
| 78 | 90 | var TtInfo = service.getTtInfoQueryClass(); |
| 79 | 91 | |
| ... | ... | @@ -105,6 +117,17 @@ angular.module('ScheduleApp').controller( |
| 105 | 117 | } |
| 106 | 118 | }); |
| 107 | 119 | }; |
| 120 | + // 导出excel | |
| 121 | + self.exportData = function(ttinfoid) { | |
| 122 | + service.dataExport(ttinfoid).then( | |
| 123 | + function(result) { | |
| 124 | + fileDownload.downloadFile(result.data, "application/octet-stream", "时刻表.xls"); | |
| 125 | + }, | |
| 126 | + function(result) { | |
| 127 | + console.log("exportData failed:" + result); | |
| 128 | + } | |
| 129 | + ); | |
| 130 | + }; | |
| 108 | 131 | |
| 109 | 132 | self.doPage(); |
| 110 | 133 | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery.ui/core.js
0 → 100644
| 1 | +/*! | |
| 2 | + * jQuery UI Core 1.11.1 | |
| 3 | + * http://jqueryui.com | |
| 4 | + * | |
| 5 | + * Copyright 2014 jQuery Foundation and other contributors | |
| 6 | + * Released under the MIT license. | |
| 7 | + * http://jquery.org/license | |
| 8 | + * | |
| 9 | + * http://api.jqueryui.com/category/ui-core/ | |
| 10 | + */ | |
| 11 | +(function( factory ) { | |
| 12 | + if ( typeof define === "function" && define.amd ) { | |
| 13 | + | |
| 14 | + // AMD. Register as an anonymous module. | |
| 15 | + define( [ "jquery" ], factory ); | |
| 16 | + } else { | |
| 17 | + | |
| 18 | + // Browser globals | |
| 19 | + factory( jQuery ); | |
| 20 | + } | |
| 21 | +}(function( $ ) { | |
| 22 | + | |
| 23 | +// $.ui might exist from components with no dependencies, e.g., $.ui.position | |
| 24 | +$.ui = $.ui || {}; | |
| 25 | + | |
| 26 | +$.extend( $.ui, { | |
| 27 | + version: "1.11.1", | |
| 28 | + | |
| 29 | + keyCode: { | |
| 30 | + BACKSPACE: 8, | |
| 31 | + COMMA: 188, | |
| 32 | + DELETE: 46, | |
| 33 | + DOWN: 40, | |
| 34 | + END: 35, | |
| 35 | + ENTER: 13, | |
| 36 | + ESCAPE: 27, | |
| 37 | + HOME: 36, | |
| 38 | + LEFT: 37, | |
| 39 | + PAGE_DOWN: 34, | |
| 40 | + PAGE_UP: 33, | |
| 41 | + PERIOD: 190, | |
| 42 | + RIGHT: 39, | |
| 43 | + SPACE: 32, | |
| 44 | + TAB: 9, | |
| 45 | + UP: 38 | |
| 46 | + } | |
| 47 | +}); | |
| 48 | + | |
| 49 | +// plugins | |
| 50 | +$.fn.extend({ | |
| 51 | + scrollParent: function( includeHidden ) { | |
| 52 | + var position = this.css( "position" ), | |
| 53 | + excludeStaticParent = position === "absolute", | |
| 54 | + overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, | |
| 55 | + scrollParent = this.parents().filter( function() { | |
| 56 | + var parent = $( this ); | |
| 57 | + if ( excludeStaticParent && parent.css( "position" ) === "static" ) { | |
| 58 | + return false; | |
| 59 | + } | |
| 60 | + return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); | |
| 61 | + }).eq( 0 ); | |
| 62 | + | |
| 63 | + return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; | |
| 64 | + }, | |
| 65 | + | |
| 66 | + uniqueId: (function() { | |
| 67 | + var uuid = 0; | |
| 68 | + | |
| 69 | + return function() { | |
| 70 | + return this.each(function() { | |
| 71 | + if ( !this.id ) { | |
| 72 | + this.id = "ui-id-" + ( ++uuid ); | |
| 73 | + } | |
| 74 | + }); | |
| 75 | + }; | |
| 76 | + })(), | |
| 77 | + | |
| 78 | + removeUniqueId: function() { | |
| 79 | + return this.each(function() { | |
| 80 | + if ( /^ui-id-\d+$/.test( this.id ) ) { | |
| 81 | + $( this ).removeAttr( "id" ); | |
| 82 | + } | |
| 83 | + }); | |
| 84 | + } | |
| 85 | +}); | |
| 86 | + | |
| 87 | +// selectors | |
| 88 | +function focusable( element, isTabIndexNotNaN ) { | |
| 89 | + var map, mapName, img, | |
| 90 | + nodeName = element.nodeName.toLowerCase(); | |
| 91 | + if ( "area" === nodeName ) { | |
| 92 | + map = element.parentNode; | |
| 93 | + mapName = map.name; | |
| 94 | + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { | |
| 95 | + return false; | |
| 96 | + } | |
| 97 | + img = $( "img[usemap='#" + mapName + "']" )[ 0 ]; | |
| 98 | + return !!img && visible( img ); | |
| 99 | + } | |
| 100 | + return ( /input|select|textarea|button|object/.test( nodeName ) ? | |
| 101 | + !element.disabled : | |
| 102 | + "a" === nodeName ? | |
| 103 | + element.href || isTabIndexNotNaN : | |
| 104 | + isTabIndexNotNaN) && | |
| 105 | + // the element and all of its ancestors must be visible | |
| 106 | + visible( element ); | |
| 107 | +} | |
| 108 | + | |
| 109 | +function visible( element ) { | |
| 110 | + return $.expr.filters.visible( element ) && | |
| 111 | + !$( element ).parents().addBack().filter(function() { | |
| 112 | + return $.css( this, "visibility" ) === "hidden"; | |
| 113 | + }).length; | |
| 114 | +} | |
| 115 | + | |
| 116 | +$.extend( $.expr[ ":" ], { | |
| 117 | + data: $.expr.createPseudo ? | |
| 118 | + $.expr.createPseudo(function( dataName ) { | |
| 119 | + return function( elem ) { | |
| 120 | + return !!$.data( elem, dataName ); | |
| 121 | + }; | |
| 122 | + }) : | |
| 123 | + // support: jQuery <1.8 | |
| 124 | + function( elem, i, match ) { | |
| 125 | + return !!$.data( elem, match[ 3 ] ); | |
| 126 | + }, | |
| 127 | + | |
| 128 | + focusable: function( element ) { | |
| 129 | + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); | |
| 130 | + }, | |
| 131 | + | |
| 132 | + tabbable: function( element ) { | |
| 133 | + var tabIndex = $.attr( element, "tabindex" ), | |
| 134 | + isTabIndexNaN = isNaN( tabIndex ); | |
| 135 | + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); | |
| 136 | + } | |
| 137 | +}); | |
| 138 | + | |
| 139 | +// support: jQuery <1.8 | |
| 140 | +if ( !$( "<a>" ).outerWidth( 1 ).jquery ) { | |
| 141 | + $.each( [ "Width", "Height" ], function( i, name ) { | |
| 142 | + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], | |
| 143 | + type = name.toLowerCase(), | |
| 144 | + orig = { | |
| 145 | + innerWidth: $.fn.innerWidth, | |
| 146 | + innerHeight: $.fn.innerHeight, | |
| 147 | + outerWidth: $.fn.outerWidth, | |
| 148 | + outerHeight: $.fn.outerHeight | |
| 149 | + }; | |
| 150 | + | |
| 151 | + function reduce( elem, size, border, margin ) { | |
| 152 | + $.each( side, function() { | |
| 153 | + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; | |
| 154 | + if ( border ) { | |
| 155 | + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; | |
| 156 | + } | |
| 157 | + if ( margin ) { | |
| 158 | + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; | |
| 159 | + } | |
| 160 | + }); | |
| 161 | + return size; | |
| 162 | + } | |
| 163 | + | |
| 164 | + $.fn[ "inner" + name ] = function( size ) { | |
| 165 | + if ( size === undefined ) { | |
| 166 | + return orig[ "inner" + name ].call( this ); | |
| 167 | + } | |
| 168 | + | |
| 169 | + return this.each(function() { | |
| 170 | + $( this ).css( type, reduce( this, size ) + "px" ); | |
| 171 | + }); | |
| 172 | + }; | |
| 173 | + | |
| 174 | + $.fn[ "outer" + name] = function( size, margin ) { | |
| 175 | + if ( typeof size !== "number" ) { | |
| 176 | + return orig[ "outer" + name ].call( this, size ); | |
| 177 | + } | |
| 178 | + | |
| 179 | + return this.each(function() { | |
| 180 | + $( this).css( type, reduce( this, size, true, margin ) + "px" ); | |
| 181 | + }); | |
| 182 | + }; | |
| 183 | + }); | |
| 184 | +} | |
| 185 | + | |
| 186 | +// support: jQuery <1.8 | |
| 187 | +if ( !$.fn.addBack ) { | |
| 188 | + $.fn.addBack = function( selector ) { | |
| 189 | + return this.add( selector == null ? | |
| 190 | + this.prevObject : this.prevObject.filter( selector ) | |
| 191 | + ); | |
| 192 | + }; | |
| 193 | +} | |
| 194 | + | |
| 195 | +// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) | |
| 196 | +if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { | |
| 197 | + $.fn.removeData = (function( removeData ) { | |
| 198 | + return function( key ) { | |
| 199 | + if ( arguments.length ) { | |
| 200 | + return removeData.call( this, $.camelCase( key ) ); | |
| 201 | + } else { | |
| 202 | + return removeData.call( this ); | |
| 203 | + } | |
| 204 | + }; | |
| 205 | + })( $.fn.removeData ); | |
| 206 | +} | |
| 207 | + | |
| 208 | +// deprecated | |
| 209 | +$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); | |
| 210 | + | |
| 211 | +$.fn.extend({ | |
| 212 | + focus: (function( orig ) { | |
| 213 | + return function( delay, fn ) { | |
| 214 | + return typeof delay === "number" ? | |
| 215 | + this.each(function() { | |
| 216 | + var elem = this; | |
| 217 | + setTimeout(function() { | |
| 218 | + $( elem ).focus(); | |
| 219 | + if ( fn ) { | |
| 220 | + fn.call( elem ); | |
| 221 | + } | |
| 222 | + }, delay ); | |
| 223 | + }) : | |
| 224 | + orig.apply( this, arguments ); | |
| 225 | + }; | |
| 226 | + })( $.fn.focus ), | |
| 227 | + | |
| 228 | + disableSelection: (function() { | |
| 229 | + var eventType = "onselectstart" in document.createElement( "div" ) ? | |
| 230 | + "selectstart" : | |
| 231 | + "mousedown"; | |
| 232 | + | |
| 233 | + return function() { | |
| 234 | + return this.bind( eventType + ".ui-disableSelection", function( event ) { | |
| 235 | + event.preventDefault(); | |
| 236 | + }); | |
| 237 | + }; | |
| 238 | + })(), | |
| 239 | + | |
| 240 | + enableSelection: function() { | |
| 241 | + return this.unbind( ".ui-disableSelection" ); | |
| 242 | + }, | |
| 243 | + | |
| 244 | + zIndex: function( zIndex ) { | |
| 245 | + if ( zIndex !== undefined ) { | |
| 246 | + return this.css( "zIndex", zIndex ); | |
| 247 | + } | |
| 248 | + | |
| 249 | + if ( this.length ) { | |
| 250 | + var elem = $( this[ 0 ] ), position, value; | |
| 251 | + while ( elem.length && elem[ 0 ] !== document ) { | |
| 252 | + // Ignore z-index if position is set to a value where z-index is ignored by the browser | |
| 253 | + // This makes behavior of this function consistent across browsers | |
| 254 | + // WebKit always returns auto if the element is positioned | |
| 255 | + position = elem.css( "position" ); | |
| 256 | + if ( position === "absolute" || position === "relative" || position === "fixed" ) { | |
| 257 | + // IE returns 0 when zIndex is not specified | |
| 258 | + // other browsers return a string | |
| 259 | + // we ignore the case of nested elements with an explicit value of 0 | |
| 260 | + // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> | |
| 261 | + value = parseInt( elem.css( "zIndex" ), 10 ); | |
| 262 | + if ( !isNaN( value ) && value !== 0 ) { | |
| 263 | + return value; | |
| 264 | + } | |
| 265 | + } | |
| 266 | + elem = elem.parent(); | |
| 267 | + } | |
| 268 | + } | |
| 269 | + | |
| 270 | + return 0; | |
| 271 | + } | |
| 272 | +}); | |
| 273 | + | |
| 274 | +// $.ui.plugin is deprecated. Use $.widget() extensions instead. | |
| 275 | +$.ui.plugin = { | |
| 276 | + add: function( module, option, set ) { | |
| 277 | + var i, | |
| 278 | + proto = $.ui[ module ].prototype; | |
| 279 | + for ( i in set ) { | |
| 280 | + proto.plugins[ i ] = proto.plugins[ i ] || []; | |
| 281 | + proto.plugins[ i ].push( [ option, set[ i ] ] ); | |
| 282 | + } | |
| 283 | + }, | |
| 284 | + call: function( instance, name, args, allowDisconnected ) { | |
| 285 | + var i, | |
| 286 | + set = instance.plugins[ name ]; | |
| 287 | + | |
| 288 | + if ( !set ) { | |
| 289 | + return; | |
| 290 | + } | |
| 291 | + | |
| 292 | + if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { | |
| 293 | + return; | |
| 294 | + } | |
| 295 | + | |
| 296 | + for ( i = 0; i < set.length; i++ ) { | |
| 297 | + if ( instance.options[ set[ i ][ 0 ] ] ) { | |
| 298 | + set[ i ][ 1 ].apply( instance.element, args ); | |
| 299 | + } | |
| 300 | + } | |
| 301 | + } | |
| 302 | +}; | |
| 303 | + | |
| 304 | +})); | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery.ui/mouse.js
0 → 100644
| 1 | +/*! | |
| 2 | + * jQuery UI Mouse 1.11.1 | |
| 3 | + * http://jqueryui.com | |
| 4 | + * | |
| 5 | + * Copyright 2014 jQuery Foundation and other contributors | |
| 6 | + * Released under the MIT license. | |
| 7 | + * http://jquery.org/license | |
| 8 | + * | |
| 9 | + * http://api.jqueryui.com/mouse/ | |
| 10 | + */ | |
| 11 | +(function( factory ) { | |
| 12 | + if ( typeof define === "function" && define.amd ) { | |
| 13 | + | |
| 14 | + // AMD. Register as an anonymous module. | |
| 15 | + define([ | |
| 16 | + "jquery", | |
| 17 | + "./widget" | |
| 18 | + ], factory ); | |
| 19 | + } else { | |
| 20 | + | |
| 21 | + // Browser globals | |
| 22 | + factory( jQuery ); | |
| 23 | + } | |
| 24 | +}(function( $ ) { | |
| 25 | + | |
| 26 | +var mouseHandled = false; | |
| 27 | +$( document ).mouseup( function() { | |
| 28 | + mouseHandled = false; | |
| 29 | +}); | |
| 30 | + | |
| 31 | +return $.widget("ui.mouse", { | |
| 32 | + version: "1.11.1", | |
| 33 | + options: { | |
| 34 | + cancel: "input,textarea,button,select,option", | |
| 35 | + distance: 1, | |
| 36 | + delay: 0 | |
| 37 | + }, | |
| 38 | + _mouseInit: function() { | |
| 39 | + var that = this; | |
| 40 | + | |
| 41 | + this.element | |
| 42 | + .bind("mousedown." + this.widgetName, function(event) { | |
| 43 | + return that._mouseDown(event); | |
| 44 | + }) | |
| 45 | + .bind("click." + this.widgetName, function(event) { | |
| 46 | + if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) { | |
| 47 | + $.removeData(event.target, that.widgetName + ".preventClickEvent"); | |
| 48 | + event.stopImmediatePropagation(); | |
| 49 | + return false; | |
| 50 | + } | |
| 51 | + }); | |
| 52 | + | |
| 53 | + this.started = false; | |
| 54 | + }, | |
| 55 | + | |
| 56 | + // TODO: make sure destroying one instance of mouse doesn't mess with | |
| 57 | + // other instances of mouse | |
| 58 | + _mouseDestroy: function() { | |
| 59 | + this.element.unbind("." + this.widgetName); | |
| 60 | + if ( this._mouseMoveDelegate ) { | |
| 61 | + this.document | |
| 62 | + .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) | |
| 63 | + .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); | |
| 64 | + } | |
| 65 | + }, | |
| 66 | + | |
| 67 | + _mouseDown: function(event) { | |
| 68 | + // don't let more than one widget handle mouseStart | |
| 69 | + if ( mouseHandled ) { | |
| 70 | + return; | |
| 71 | + } | |
| 72 | + | |
| 73 | + // we may have missed mouseup (out of window) | |
| 74 | + (this._mouseStarted && this._mouseUp(event)); | |
| 75 | + | |
| 76 | + this._mouseDownEvent = event; | |
| 77 | + | |
| 78 | + var that = this, | |
| 79 | + btnIsLeft = (event.which === 1), | |
| 80 | + // event.target.nodeName works around a bug in IE 8 with | |
| 81 | + // disabled inputs (#7620) | |
| 82 | + elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); | |
| 83 | + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { | |
| 84 | + return true; | |
| 85 | + } | |
| 86 | + | |
| 87 | + this.mouseDelayMet = !this.options.delay; | |
| 88 | + if (!this.mouseDelayMet) { | |
| 89 | + this._mouseDelayTimer = setTimeout(function() { | |
| 90 | + that.mouseDelayMet = true; | |
| 91 | + }, this.options.delay); | |
| 92 | + } | |
| 93 | + | |
| 94 | + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { | |
| 95 | + this._mouseStarted = (this._mouseStart(event) !== false); | |
| 96 | + if (!this._mouseStarted) { | |
| 97 | + event.preventDefault(); | |
| 98 | + return true; | |
| 99 | + } | |
| 100 | + } | |
| 101 | + | |
| 102 | + // Click event may never have fired (Gecko & Opera) | |
| 103 | + if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) { | |
| 104 | + $.removeData(event.target, this.widgetName + ".preventClickEvent"); | |
| 105 | + } | |
| 106 | + | |
| 107 | + // these delegates are required to keep context | |
| 108 | + this._mouseMoveDelegate = function(event) { | |
| 109 | + return that._mouseMove(event); | |
| 110 | + }; | |
| 111 | + this._mouseUpDelegate = function(event) { | |
| 112 | + return that._mouseUp(event); | |
| 113 | + }; | |
| 114 | + | |
| 115 | + this.document | |
| 116 | + .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) | |
| 117 | + .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); | |
| 118 | + | |
| 119 | + event.preventDefault(); | |
| 120 | + | |
| 121 | + mouseHandled = true; | |
| 122 | + return true; | |
| 123 | + }, | |
| 124 | + | |
| 125 | + _mouseMove: function(event) { | |
| 126 | + // IE mouseup check - mouseup happened when mouse was out of window | |
| 127 | + if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) { | |
| 128 | + return this._mouseUp(event); | |
| 129 | + | |
| 130 | + // Iframe mouseup check - mouseup occurred in another document | |
| 131 | + } else if ( !event.which ) { | |
| 132 | + return this._mouseUp( event ); | |
| 133 | + } | |
| 134 | + | |
| 135 | + if (this._mouseStarted) { | |
| 136 | + this._mouseDrag(event); | |
| 137 | + return event.preventDefault(); | |
| 138 | + } | |
| 139 | + | |
| 140 | + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { | |
| 141 | + this._mouseStarted = | |
| 142 | + (this._mouseStart(this._mouseDownEvent, event) !== false); | |
| 143 | + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); | |
| 144 | + } | |
| 145 | + | |
| 146 | + return !this._mouseStarted; | |
| 147 | + }, | |
| 148 | + | |
| 149 | + _mouseUp: function(event) { | |
| 150 | + this.document | |
| 151 | + .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) | |
| 152 | + .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); | |
| 153 | + | |
| 154 | + if (this._mouseStarted) { | |
| 155 | + this._mouseStarted = false; | |
| 156 | + | |
| 157 | + if (event.target === this._mouseDownEvent.target) { | |
| 158 | + $.data(event.target, this.widgetName + ".preventClickEvent", true); | |
| 159 | + } | |
| 160 | + | |
| 161 | + this._mouseStop(event); | |
| 162 | + } | |
| 163 | + | |
| 164 | + mouseHandled = false; | |
| 165 | + return false; | |
| 166 | + }, | |
| 167 | + | |
| 168 | + _mouseDistanceMet: function(event) { | |
| 169 | + return (Math.max( | |
| 170 | + Math.abs(this._mouseDownEvent.pageX - event.pageX), | |
| 171 | + Math.abs(this._mouseDownEvent.pageY - event.pageY) | |
| 172 | + ) >= this.options.distance | |
| 173 | + ); | |
| 174 | + }, | |
| 175 | + | |
| 176 | + _mouseDelayMet: function(/* event */) { | |
| 177 | + return this.mouseDelayMet; | |
| 178 | + }, | |
| 179 | + | |
| 180 | + // These are placeholder methods, to be overriden by extending plugin | |
| 181 | + _mouseStart: function(/* event */) {}, | |
| 182 | + _mouseDrag: function(/* event */) {}, | |
| 183 | + _mouseStop: function(/* event */) {}, | |
| 184 | + _mouseCapture: function(/* event */) { return true; } | |
| 185 | +}); | |
| 186 | + | |
| 187 | +})); | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery.ui/resizable.js
0 → 100644
| 1 | +/*! | |
| 2 | + * jQuery UI Resizable 1.11.1 | |
| 3 | + * http://jqueryui.com | |
| 4 | + * | |
| 5 | + * Copyright 2014 jQuery Foundation and other contributors | |
| 6 | + * Released under the MIT license. | |
| 7 | + * http://jquery.org/license | |
| 8 | + * | |
| 9 | + * http://api.jqueryui.com/resizable/ | |
| 10 | + */ | |
| 11 | +(function( factory ) { | |
| 12 | + if ( typeof define === "function" && define.amd ) { | |
| 13 | + | |
| 14 | + // AMD. Register as an anonymous module. | |
| 15 | + define([ | |
| 16 | + "jquery", | |
| 17 | + "./core", | |
| 18 | + "./mouse", | |
| 19 | + "./widget" | |
| 20 | + ], factory ); | |
| 21 | + } else { | |
| 22 | + | |
| 23 | + // Browser globals | |
| 24 | + factory( jQuery ); | |
| 25 | + } | |
| 26 | +}(function( $ ) { | |
| 27 | + | |
| 28 | +$.widget("ui.resizable", $.ui.mouse, { | |
| 29 | + version: "1.11.1", | |
| 30 | + widgetEventPrefix: "resize", | |
| 31 | + options: { | |
| 32 | + alsoResize: false, | |
| 33 | + animate: false, | |
| 34 | + animateDuration: "slow", | |
| 35 | + animateEasing: "swing", | |
| 36 | + aspectRatio: false, | |
| 37 | + autoHide: false, | |
| 38 | + containment: false, | |
| 39 | + ghost: false, | |
| 40 | + grid: false, | |
| 41 | + handles: "e,s,se", | |
| 42 | + helper: false, | |
| 43 | + maxHeight: null, | |
| 44 | + maxWidth: null, | |
| 45 | + minHeight: 10, | |
| 46 | + minWidth: 10, | |
| 47 | + // See #7960 | |
| 48 | + zIndex: 90, | |
| 49 | + | |
| 50 | + // callbacks | |
| 51 | + resize: null, | |
| 52 | + start: null, | |
| 53 | + stop: null | |
| 54 | + }, | |
| 55 | + | |
| 56 | + _num: function( value ) { | |
| 57 | + return parseInt( value, 10 ) || 0; | |
| 58 | + }, | |
| 59 | + | |
| 60 | + _isNumber: function( value ) { | |
| 61 | + return !isNaN( parseInt( value, 10 ) ); | |
| 62 | + }, | |
| 63 | + | |
| 64 | + _hasScroll: function( el, a ) { | |
| 65 | + | |
| 66 | + if ( $( el ).css( "overflow" ) === "hidden") { | |
| 67 | + return false; | |
| 68 | + } | |
| 69 | + | |
| 70 | + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", | |
| 71 | + has = false; | |
| 72 | + | |
| 73 | + if ( el[ scroll ] > 0 ) { | |
| 74 | + return true; | |
| 75 | + } | |
| 76 | + | |
| 77 | + // TODO: determine which cases actually cause this to happen | |
| 78 | + // if the element doesn't have the scroll set, see if it's possible to | |
| 79 | + // set the scroll | |
| 80 | + el[ scroll ] = 1; | |
| 81 | + has = ( el[ scroll ] > 0 ); | |
| 82 | + el[ scroll ] = 0; | |
| 83 | + return has; | |
| 84 | + }, | |
| 85 | + | |
| 86 | + _create: function() { | |
| 87 | + | |
| 88 | + var n, i, handle, axis, hname, | |
| 89 | + that = this, | |
| 90 | + o = this.options; | |
| 91 | + this.element.addClass("ui-resizable"); | |
| 92 | + | |
| 93 | + $.extend(this, { | |
| 94 | + _aspectRatio: !!(o.aspectRatio), | |
| 95 | + aspectRatio: o.aspectRatio, | |
| 96 | + originalElement: this.element, | |
| 97 | + _proportionallyResizeElements: [], | |
| 98 | + _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null | |
| 99 | + }); | |
| 100 | + | |
| 101 | + // Wrap the element if it cannot hold child nodes | |
| 102 | + if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { | |
| 103 | + | |
| 104 | + this.element.wrap( | |
| 105 | + $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({ | |
| 106 | + position: this.element.css("position"), | |
| 107 | + width: this.element.outerWidth(), | |
| 108 | + height: this.element.outerHeight(), | |
| 109 | + top: this.element.css("top"), | |
| 110 | + left: this.element.css("left") | |
| 111 | + }) | |
| 112 | + ); | |
| 113 | + | |
| 114 | + this.element = this.element.parent().data( | |
| 115 | + "ui-resizable", this.element.resizable( "instance" ) | |
| 116 | + ); | |
| 117 | + | |
| 118 | + this.elementIsWrapper = true; | |
| 119 | + | |
| 120 | + this.element.css({ | |
| 121 | + marginLeft: this.originalElement.css("marginLeft"), | |
| 122 | + marginTop: this.originalElement.css("marginTop"), | |
| 123 | + marginRight: this.originalElement.css("marginRight"), | |
| 124 | + marginBottom: this.originalElement.css("marginBottom") | |
| 125 | + }); | |
| 126 | + this.originalElement.css({ | |
| 127 | + marginLeft: 0, | |
| 128 | + marginTop: 0, | |
| 129 | + marginRight: 0, | |
| 130 | + marginBottom: 0 | |
| 131 | + }); | |
| 132 | + // support: Safari | |
| 133 | + // Prevent Safari textarea resize | |
| 134 | + this.originalResizeStyle = this.originalElement.css("resize"); | |
| 135 | + this.originalElement.css("resize", "none"); | |
| 136 | + | |
| 137 | + this._proportionallyResizeElements.push( this.originalElement.css({ | |
| 138 | + position: "static", | |
| 139 | + zoom: 1, | |
| 140 | + display: "block" | |
| 141 | + }) ); | |
| 142 | + | |
| 143 | + // support: IE9 | |
| 144 | + // avoid IE jump (hard set the margin) | |
| 145 | + this.originalElement.css({ margin: this.originalElement.css("margin") }); | |
| 146 | + | |
| 147 | + this._proportionallyResize(); | |
| 148 | + } | |
| 149 | + | |
| 150 | + this.handles = o.handles || | |
| 151 | + ( !$(".ui-resizable-handle", this.element).length ? | |
| 152 | + "e,s,se" : { | |
| 153 | + n: ".ui-resizable-n", | |
| 154 | + e: ".ui-resizable-e", | |
| 155 | + s: ".ui-resizable-s", | |
| 156 | + w: ".ui-resizable-w", | |
| 157 | + se: ".ui-resizable-se", | |
| 158 | + sw: ".ui-resizable-sw", | |
| 159 | + ne: ".ui-resizable-ne", | |
| 160 | + nw: ".ui-resizable-nw" | |
| 161 | + } ); | |
| 162 | + | |
| 163 | + if (this.handles.constructor === String) { | |
| 164 | + | |
| 165 | + if ( this.handles === "all") { | |
| 166 | + this.handles = "n,e,s,w,se,sw,ne,nw"; | |
| 167 | + } | |
| 168 | + | |
| 169 | + n = this.handles.split(","); | |
| 170 | + this.handles = {}; | |
| 171 | + | |
| 172 | + for (i = 0; i < n.length; i++) { | |
| 173 | + | |
| 174 | + handle = $.trim(n[i]); | |
| 175 | + hname = "ui-resizable-" + handle; | |
| 176 | + axis = $("<div class='ui-resizable-handle " + hname + "'></div>"); | |
| 177 | + | |
| 178 | + axis.css({ zIndex: o.zIndex }); | |
| 179 | + | |
| 180 | + // TODO : What's going on here? | |
| 181 | + if ("se" === handle) { | |
| 182 | + axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se"); | |
| 183 | + } | |
| 184 | + | |
| 185 | + this.handles[handle] = ".ui-resizable-" + handle; | |
| 186 | + this.element.append(axis); | |
| 187 | + } | |
| 188 | + | |
| 189 | + } | |
| 190 | + | |
| 191 | + this._renderAxis = function(target) { | |
| 192 | + | |
| 193 | + var i, axis, padPos, padWrapper; | |
| 194 | + | |
| 195 | + target = target || this.element; | |
| 196 | + | |
| 197 | + for (i in this.handles) { | |
| 198 | + | |
| 199 | + if (this.handles[i].constructor === String) { | |
| 200 | + this.handles[i] = this.element.children( this.handles[ i ] ).first().show(); | |
| 201 | + } | |
| 202 | + | |
| 203 | + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { | |
| 204 | + | |
| 205 | + axis = $(this.handles[i], this.element); | |
| 206 | + | |
| 207 | + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); | |
| 208 | + | |
| 209 | + padPos = [ "padding", | |
| 210 | + /ne|nw|n/.test(i) ? "Top" : | |
| 211 | + /se|sw|s/.test(i) ? "Bottom" : | |
| 212 | + /^e$/.test(i) ? "Right" : "Left" ].join(""); | |
| 213 | + | |
| 214 | + target.css(padPos, padWrapper); | |
| 215 | + | |
| 216 | + this._proportionallyResize(); | |
| 217 | + | |
| 218 | + } | |
| 219 | + | |
| 220 | + // TODO: What's that good for? There's not anything to be executed left | |
| 221 | + if (!$(this.handles[i]).length) { | |
| 222 | + continue; | |
| 223 | + } | |
| 224 | + } | |
| 225 | + }; | |
| 226 | + | |
| 227 | + // TODO: make renderAxis a prototype function | |
| 228 | + this._renderAxis(this.element); | |
| 229 | + | |
| 230 | + this._handles = $(".ui-resizable-handle", this.element) | |
| 231 | + .disableSelection(); | |
| 232 | + | |
| 233 | + this._handles.mouseover(function() { | |
| 234 | + if (!that.resizing) { | |
| 235 | + if (this.className) { | |
| 236 | + axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); | |
| 237 | + } | |
| 238 | + that.axis = axis && axis[1] ? axis[1] : "se"; | |
| 239 | + } | |
| 240 | + }); | |
| 241 | + | |
| 242 | + if (o.autoHide) { | |
| 243 | + this._handles.hide(); | |
| 244 | + $(this.element) | |
| 245 | + .addClass("ui-resizable-autohide") | |
| 246 | + .mouseenter(function() { | |
| 247 | + if (o.disabled) { | |
| 248 | + return; | |
| 249 | + } | |
| 250 | + $(this).removeClass("ui-resizable-autohide"); | |
| 251 | + that._handles.show(); | |
| 252 | + }) | |
| 253 | + .mouseleave(function() { | |
| 254 | + if (o.disabled) { | |
| 255 | + return; | |
| 256 | + } | |
| 257 | + if (!that.resizing) { | |
| 258 | + $(this).addClass("ui-resizable-autohide"); | |
| 259 | + that._handles.hide(); | |
| 260 | + } | |
| 261 | + }); | |
| 262 | + } | |
| 263 | + | |
| 264 | + this._mouseInit(); | |
| 265 | + | |
| 266 | + }, | |
| 267 | + | |
| 268 | + _destroy: function() { | |
| 269 | + | |
| 270 | + this._mouseDestroy(); | |
| 271 | + | |
| 272 | + var wrapper, | |
| 273 | + _destroy = function(exp) { | |
| 274 | + $(exp) | |
| 275 | + .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") | |
| 276 | + .removeData("resizable") | |
| 277 | + .removeData("ui-resizable") | |
| 278 | + .unbind(".resizable") | |
| 279 | + .find(".ui-resizable-handle") | |
| 280 | + .remove(); | |
| 281 | + }; | |
| 282 | + | |
| 283 | + // TODO: Unwrap at same DOM position | |
| 284 | + if (this.elementIsWrapper) { | |
| 285 | + _destroy(this.element); | |
| 286 | + wrapper = this.element; | |
| 287 | + this.originalElement.css({ | |
| 288 | + position: wrapper.css("position"), | |
| 289 | + width: wrapper.outerWidth(), | |
| 290 | + height: wrapper.outerHeight(), | |
| 291 | + top: wrapper.css("top"), | |
| 292 | + left: wrapper.css("left") | |
| 293 | + }).insertAfter( wrapper ); | |
| 294 | + wrapper.remove(); | |
| 295 | + } | |
| 296 | + | |
| 297 | + this.originalElement.css("resize", this.originalResizeStyle); | |
| 298 | + _destroy(this.originalElement); | |
| 299 | + | |
| 300 | + return this; | |
| 301 | + }, | |
| 302 | + | |
| 303 | + _mouseCapture: function(event) { | |
| 304 | + var i, handle, | |
| 305 | + capture = false; | |
| 306 | + | |
| 307 | + for (i in this.handles) { | |
| 308 | + handle = $(this.handles[i])[0]; | |
| 309 | + if (handle === event.target || $.contains(handle, event.target)) { | |
| 310 | + capture = true; | |
| 311 | + } | |
| 312 | + } | |
| 313 | + | |
| 314 | + return !this.options.disabled && capture; | |
| 315 | + }, | |
| 316 | + | |
| 317 | + _mouseStart: function(event) { | |
| 318 | + | |
| 319 | + var curleft, curtop, cursor, | |
| 320 | + o = this.options, | |
| 321 | + el = this.element; | |
| 322 | + | |
| 323 | + this.resizing = true; | |
| 324 | + | |
| 325 | + this._renderProxy(); | |
| 326 | + | |
| 327 | + curleft = this._num(this.helper.css("left")); | |
| 328 | + curtop = this._num(this.helper.css("top")); | |
| 329 | + | |
| 330 | + if (o.containment) { | |
| 331 | + curleft += $(o.containment).scrollLeft() || 0; | |
| 332 | + curtop += $(o.containment).scrollTop() || 0; | |
| 333 | + } | |
| 334 | + | |
| 335 | + this.offset = this.helper.offset(); | |
| 336 | + this.position = { left: curleft, top: curtop }; | |
| 337 | + | |
| 338 | + this.size = this._helper ? { | |
| 339 | + width: this.helper.width(), | |
| 340 | + height: this.helper.height() | |
| 341 | + } : { | |
| 342 | + width: el.width(), | |
| 343 | + height: el.height() | |
| 344 | + }; | |
| 345 | + | |
| 346 | + this.originalSize = this._helper ? { | |
| 347 | + width: el.outerWidth(), | |
| 348 | + height: el.outerHeight() | |
| 349 | + } : { | |
| 350 | + width: el.width(), | |
| 351 | + height: el.height() | |
| 352 | + }; | |
| 353 | + | |
| 354 | + this.sizeDiff = { | |
| 355 | + width: el.outerWidth() - el.width(), | |
| 356 | + height: el.outerHeight() - el.height() | |
| 357 | + }; | |
| 358 | + | |
| 359 | + this.originalPosition = { left: curleft, top: curtop }; | |
| 360 | + this.originalMousePosition = { left: event.pageX, top: event.pageY }; | |
| 361 | + | |
| 362 | + this.aspectRatio = (typeof o.aspectRatio === "number") ? | |
| 363 | + o.aspectRatio : | |
| 364 | + ((this.originalSize.width / this.originalSize.height) || 1); | |
| 365 | + | |
| 366 | + cursor = $(".ui-resizable-" + this.axis).css("cursor"); | |
| 367 | + $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor); | |
| 368 | + | |
| 369 | + el.addClass("ui-resizable-resizing"); | |
| 370 | + this._propagate("start", event); | |
| 371 | + return true; | |
| 372 | + }, | |
| 373 | + | |
| 374 | + _mouseDrag: function(event) { | |
| 375 | + | |
| 376 | + var data, props, | |
| 377 | + smp = this.originalMousePosition, | |
| 378 | + a = this.axis, | |
| 379 | + dx = (event.pageX - smp.left) || 0, | |
| 380 | + dy = (event.pageY - smp.top) || 0, | |
| 381 | + trigger = this._change[a]; | |
| 382 | + | |
| 383 | + this._updatePrevProperties(); | |
| 384 | + | |
| 385 | + if (!trigger) { | |
| 386 | + return false; | |
| 387 | + } | |
| 388 | + | |
| 389 | + data = trigger.apply(this, [ event, dx, dy ]); | |
| 390 | + | |
| 391 | + this._updateVirtualBoundaries(event.shiftKey); | |
| 392 | + if (this._aspectRatio || event.shiftKey) { | |
| 393 | + data = this._updateRatio(data, event); | |
| 394 | + } | |
| 395 | + | |
| 396 | + data = this._respectSize(data, event); | |
| 397 | + | |
| 398 | + this._updateCache(data); | |
| 399 | + | |
| 400 | + this._propagate("resize", event); | |
| 401 | + | |
| 402 | + props = this._applyChanges(); | |
| 403 | + | |
| 404 | + if ( !this._helper && this._proportionallyResizeElements.length ) { | |
| 405 | + this._proportionallyResize(); | |
| 406 | + } | |
| 407 | + | |
| 408 | + if ( !$.isEmptyObject( props ) ) { | |
| 409 | + this._updatePrevProperties(); | |
| 410 | + this._trigger( "resize", event, this.ui() ); | |
| 411 | + this._applyChanges(); | |
| 412 | + } | |
| 413 | + | |
| 414 | + return false; | |
| 415 | + }, | |
| 416 | + | |
| 417 | + _mouseStop: function(event) { | |
| 418 | + | |
| 419 | + this.resizing = false; | |
| 420 | + var pr, ista, soffseth, soffsetw, s, left, top, | |
| 421 | + o = this.options, that = this; | |
| 422 | + | |
| 423 | + if (this._helper) { | |
| 424 | + | |
| 425 | + pr = this._proportionallyResizeElements; | |
| 426 | + ista = pr.length && (/textarea/i).test(pr[0].nodeName); | |
| 427 | + soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height; | |
| 428 | + soffsetw = ista ? 0 : that.sizeDiff.width; | |
| 429 | + | |
| 430 | + s = { | |
| 431 | + width: (that.helper.width() - soffsetw), | |
| 432 | + height: (that.helper.height() - soffseth) | |
| 433 | + }; | |
| 434 | + left = (parseInt(that.element.css("left"), 10) + | |
| 435 | + (that.position.left - that.originalPosition.left)) || null; | |
| 436 | + top = (parseInt(that.element.css("top"), 10) + | |
| 437 | + (that.position.top - that.originalPosition.top)) || null; | |
| 438 | + | |
| 439 | + if (!o.animate) { | |
| 440 | + this.element.css($.extend(s, { top: top, left: left })); | |
| 441 | + } | |
| 442 | + | |
| 443 | + that.helper.height(that.size.height); | |
| 444 | + that.helper.width(that.size.width); | |
| 445 | + | |
| 446 | + if (this._helper && !o.animate) { | |
| 447 | + this._proportionallyResize(); | |
| 448 | + } | |
| 449 | + } | |
| 450 | + | |
| 451 | + $("body").css("cursor", "auto"); | |
| 452 | + | |
| 453 | + this.element.removeClass("ui-resizable-resizing"); | |
| 454 | + | |
| 455 | + this._propagate("stop", event); | |
| 456 | + | |
| 457 | + if (this._helper) { | |
| 458 | + this.helper.remove(); | |
| 459 | + } | |
| 460 | + | |
| 461 | + return false; | |
| 462 | + | |
| 463 | + }, | |
| 464 | + | |
| 465 | + _updatePrevProperties: function() { | |
| 466 | + this.prevPosition = { | |
| 467 | + top: this.position.top, | |
| 468 | + left: this.position.left | |
| 469 | + }; | |
| 470 | + this.prevSize = { | |
| 471 | + width: this.size.width, | |
| 472 | + height: this.size.height | |
| 473 | + }; | |
| 474 | + }, | |
| 475 | + | |
| 476 | + _applyChanges: function() { | |
| 477 | + var props = {}; | |
| 478 | + | |
| 479 | + if ( this.position.top !== this.prevPosition.top ) { | |
| 480 | + props.top = this.position.top + "px"; | |
| 481 | + } | |
| 482 | + if ( this.position.left !== this.prevPosition.left ) { | |
| 483 | + props.left = this.position.left + "px"; | |
| 484 | + } | |
| 485 | + if ( this.size.width !== this.prevSize.width ) { | |
| 486 | + props.width = this.size.width + "px"; | |
| 487 | + } | |
| 488 | + if ( this.size.height !== this.prevSize.height ) { | |
| 489 | + props.height = this.size.height + "px"; | |
| 490 | + } | |
| 491 | + | |
| 492 | + this.helper.css( props ); | |
| 493 | + | |
| 494 | + return props; | |
| 495 | + }, | |
| 496 | + | |
| 497 | + _updateVirtualBoundaries: function(forceAspectRatio) { | |
| 498 | + var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, | |
| 499 | + o = this.options; | |
| 500 | + | |
| 501 | + b = { | |
| 502 | + minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0, | |
| 503 | + maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity, | |
| 504 | + minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0, | |
| 505 | + maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity | |
| 506 | + }; | |
| 507 | + | |
| 508 | + if (this._aspectRatio || forceAspectRatio) { | |
| 509 | + pMinWidth = b.minHeight * this.aspectRatio; | |
| 510 | + pMinHeight = b.minWidth / this.aspectRatio; | |
| 511 | + pMaxWidth = b.maxHeight * this.aspectRatio; | |
| 512 | + pMaxHeight = b.maxWidth / this.aspectRatio; | |
| 513 | + | |
| 514 | + if (pMinWidth > b.minWidth) { | |
| 515 | + b.minWidth = pMinWidth; | |
| 516 | + } | |
| 517 | + if (pMinHeight > b.minHeight) { | |
| 518 | + b.minHeight = pMinHeight; | |
| 519 | + } | |
| 520 | + if (pMaxWidth < b.maxWidth) { | |
| 521 | + b.maxWidth = pMaxWidth; | |
| 522 | + } | |
| 523 | + if (pMaxHeight < b.maxHeight) { | |
| 524 | + b.maxHeight = pMaxHeight; | |
| 525 | + } | |
| 526 | + } | |
| 527 | + this._vBoundaries = b; | |
| 528 | + }, | |
| 529 | + | |
| 530 | + _updateCache: function(data) { | |
| 531 | + this.offset = this.helper.offset(); | |
| 532 | + if (this._isNumber(data.left)) { | |
| 533 | + this.position.left = data.left; | |
| 534 | + } | |
| 535 | + if (this._isNumber(data.top)) { | |
| 536 | + this.position.top = data.top; | |
| 537 | + } | |
| 538 | + if (this._isNumber(data.height)) { | |
| 539 | + this.size.height = data.height; | |
| 540 | + } | |
| 541 | + if (this._isNumber(data.width)) { | |
| 542 | + this.size.width = data.width; | |
| 543 | + } | |
| 544 | + }, | |
| 545 | + | |
| 546 | + _updateRatio: function( data ) { | |
| 547 | + | |
| 548 | + var cpos = this.position, | |
| 549 | + csize = this.size, | |
| 550 | + a = this.axis; | |
| 551 | + | |
| 552 | + if (this._isNumber(data.height)) { | |
| 553 | + data.width = (data.height * this.aspectRatio); | |
| 554 | + } else if (this._isNumber(data.width)) { | |
| 555 | + data.height = (data.width / this.aspectRatio); | |
| 556 | + } | |
| 557 | + | |
| 558 | + if (a === "sw") { | |
| 559 | + data.left = cpos.left + (csize.width - data.width); | |
| 560 | + data.top = null; | |
| 561 | + } | |
| 562 | + if (a === "nw") { | |
| 563 | + data.top = cpos.top + (csize.height - data.height); | |
| 564 | + data.left = cpos.left + (csize.width - data.width); | |
| 565 | + } | |
| 566 | + | |
| 567 | + return data; | |
| 568 | + }, | |
| 569 | + | |
| 570 | + _respectSize: function( data ) { | |
| 571 | + | |
| 572 | + var o = this._vBoundaries, | |
| 573 | + a = this.axis, | |
| 574 | + ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), | |
| 575 | + ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), | |
| 576 | + isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width), | |
| 577 | + isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height), | |
| 578 | + dw = this.originalPosition.left + this.originalSize.width, | |
| 579 | + dh = this.position.top + this.size.height, | |
| 580 | + cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); | |
| 581 | + if (isminw) { | |
| 582 | + data.width = o.minWidth; | |
| 583 | + } | |
| 584 | + if (isminh) { | |
| 585 | + data.height = o.minHeight; | |
| 586 | + } | |
| 587 | + if (ismaxw) { | |
| 588 | + data.width = o.maxWidth; | |
| 589 | + } | |
| 590 | + if (ismaxh) { | |
| 591 | + data.height = o.maxHeight; | |
| 592 | + } | |
| 593 | + | |
| 594 | + if (isminw && cw) { | |
| 595 | + data.left = dw - o.minWidth; | |
| 596 | + } | |
| 597 | + if (ismaxw && cw) { | |
| 598 | + data.left = dw - o.maxWidth; | |
| 599 | + } | |
| 600 | + if (isminh && ch) { | |
| 601 | + data.top = dh - o.minHeight; | |
| 602 | + } | |
| 603 | + if (ismaxh && ch) { | |
| 604 | + data.top = dh - o.maxHeight; | |
| 605 | + } | |
| 606 | + | |
| 607 | + // Fixing jump error on top/left - bug #2330 | |
| 608 | + if (!data.width && !data.height && !data.left && data.top) { | |
| 609 | + data.top = null; | |
| 610 | + } else if (!data.width && !data.height && !data.top && data.left) { | |
| 611 | + data.left = null; | |
| 612 | + } | |
| 613 | + | |
| 614 | + return data; | |
| 615 | + }, | |
| 616 | + | |
| 617 | + _getPaddingPlusBorderDimensions: function( element ) { | |
| 618 | + var i = 0, | |
| 619 | + widths = [], | |
| 620 | + borders = [ | |
| 621 | + element.css( "borderTopWidth" ), | |
| 622 | + element.css( "borderRightWidth" ), | |
| 623 | + element.css( "borderBottomWidth" ), | |
| 624 | + element.css( "borderLeftWidth" ) | |
| 625 | + ], | |
| 626 | + paddings = [ | |
| 627 | + element.css( "paddingTop" ), | |
| 628 | + element.css( "paddingRight" ), | |
| 629 | + element.css( "paddingBottom" ), | |
| 630 | + element.css( "paddingLeft" ) | |
| 631 | + ]; | |
| 632 | + | |
| 633 | + for ( ; i < 4; i++ ) { | |
| 634 | + widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 ); | |
| 635 | + widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 ); | |
| 636 | + } | |
| 637 | + | |
| 638 | + return { | |
| 639 | + height: widths[ 0 ] + widths[ 2 ], | |
| 640 | + width: widths[ 1 ] + widths[ 3 ] | |
| 641 | + }; | |
| 642 | + }, | |
| 643 | + | |
| 644 | + _proportionallyResize: function() { | |
| 645 | + | |
| 646 | + if (!this._proportionallyResizeElements.length) { | |
| 647 | + return; | |
| 648 | + } | |
| 649 | + | |
| 650 | + var prel, | |
| 651 | + i = 0, | |
| 652 | + element = this.helper || this.element; | |
| 653 | + | |
| 654 | + for ( ; i < this._proportionallyResizeElements.length; i++) { | |
| 655 | + | |
| 656 | + prel = this._proportionallyResizeElements[i]; | |
| 657 | + | |
| 658 | + // TODO: Seems like a bug to cache this.outerDimensions | |
| 659 | + // considering that we are in a loop. | |
| 660 | + if (!this.outerDimensions) { | |
| 661 | + this.outerDimensions = this._getPaddingPlusBorderDimensions( prel ); | |
| 662 | + } | |
| 663 | + | |
| 664 | + prel.css({ | |
| 665 | + height: (element.height() - this.outerDimensions.height) || 0, | |
| 666 | + width: (element.width() - this.outerDimensions.width) || 0 | |
| 667 | + }); | |
| 668 | + | |
| 669 | + } | |
| 670 | + | |
| 671 | + }, | |
| 672 | + | |
| 673 | + _renderProxy: function() { | |
| 674 | + | |
| 675 | + var el = this.element, o = this.options; | |
| 676 | + this.elementOffset = el.offset(); | |
| 677 | + | |
| 678 | + if (this._helper) { | |
| 679 | + | |
| 680 | + this.helper = this.helper || $("<div style='overflow:hidden;'></div>"); | |
| 681 | + | |
| 682 | + this.helper.addClass(this._helper).css({ | |
| 683 | + width: this.element.outerWidth() - 1, | |
| 684 | + height: this.element.outerHeight() - 1, | |
| 685 | + position: "absolute", | |
| 686 | + left: this.elementOffset.left + "px", | |
| 687 | + top: this.elementOffset.top + "px", | |
| 688 | + zIndex: ++o.zIndex //TODO: Don't modify option | |
| 689 | + }); | |
| 690 | + | |
| 691 | + this.helper | |
| 692 | + .appendTo("body") | |
| 693 | + .disableSelection(); | |
| 694 | + | |
| 695 | + } else { | |
| 696 | + this.helper = this.element; | |
| 697 | + } | |
| 698 | + | |
| 699 | + }, | |
| 700 | + | |
| 701 | + _change: { | |
| 702 | + e: function(event, dx) { | |
| 703 | + return { width: this.originalSize.width + dx }; | |
| 704 | + }, | |
| 705 | + w: function(event, dx) { | |
| 706 | + var cs = this.originalSize, sp = this.originalPosition; | |
| 707 | + return { left: sp.left + dx, width: cs.width - dx }; | |
| 708 | + }, | |
| 709 | + n: function(event, dx, dy) { | |
| 710 | + var cs = this.originalSize, sp = this.originalPosition; | |
| 711 | + return { top: sp.top + dy, height: cs.height - dy }; | |
| 712 | + }, | |
| 713 | + s: function(event, dx, dy) { | |
| 714 | + return { height: this.originalSize.height + dy }; | |
| 715 | + }, | |
| 716 | + se: function(event, dx, dy) { | |
| 717 | + return $.extend(this._change.s.apply(this, arguments), | |
| 718 | + this._change.e.apply(this, [ event, dx, dy ])); | |
| 719 | + }, | |
| 720 | + sw: function(event, dx, dy) { | |
| 721 | + return $.extend(this._change.s.apply(this, arguments), | |
| 722 | + this._change.w.apply(this, [ event, dx, dy ])); | |
| 723 | + }, | |
| 724 | + ne: function(event, dx, dy) { | |
| 725 | + return $.extend(this._change.n.apply(this, arguments), | |
| 726 | + this._change.e.apply(this, [ event, dx, dy ])); | |
| 727 | + }, | |
| 728 | + nw: function(event, dx, dy) { | |
| 729 | + return $.extend(this._change.n.apply(this, arguments), | |
| 730 | + this._change.w.apply(this, [ event, dx, dy ])); | |
| 731 | + } | |
| 732 | + }, | |
| 733 | + | |
| 734 | + _propagate: function(n, event) { | |
| 735 | + $.ui.plugin.call(this, n, [ event, this.ui() ]); | |
| 736 | + (n !== "resize" && this._trigger(n, event, this.ui())); | |
| 737 | + }, | |
| 738 | + | |
| 739 | + plugins: {}, | |
| 740 | + | |
| 741 | + ui: function() { | |
| 742 | + return { | |
| 743 | + originalElement: this.originalElement, | |
| 744 | + element: this.element, | |
| 745 | + helper: this.helper, | |
| 746 | + position: this.position, | |
| 747 | + size: this.size, | |
| 748 | + originalSize: this.originalSize, | |
| 749 | + originalPosition: this.originalPosition | |
| 750 | + }; | |
| 751 | + } | |
| 752 | + | |
| 753 | +}); | |
| 754 | + | |
| 755 | +/* | |
| 756 | + * Resizable Extensions | |
| 757 | + */ | |
| 758 | + | |
| 759 | +$.ui.plugin.add("resizable", "animate", { | |
| 760 | + | |
| 761 | + stop: function( event ) { | |
| 762 | + var that = $(this).resizable( "instance" ), | |
| 763 | + o = that.options, | |
| 764 | + pr = that._proportionallyResizeElements, | |
| 765 | + ista = pr.length && (/textarea/i).test(pr[0].nodeName), | |
| 766 | + soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height, | |
| 767 | + soffsetw = ista ? 0 : that.sizeDiff.width, | |
| 768 | + style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, | |
| 769 | + left = (parseInt(that.element.css("left"), 10) + | |
| 770 | + (that.position.left - that.originalPosition.left)) || null, | |
| 771 | + top = (parseInt(that.element.css("top"), 10) + | |
| 772 | + (that.position.top - that.originalPosition.top)) || null; | |
| 773 | + | |
| 774 | + that.element.animate( | |
| 775 | + $.extend(style, top && left ? { top: top, left: left } : {}), { | |
| 776 | + duration: o.animateDuration, | |
| 777 | + easing: o.animateEasing, | |
| 778 | + step: function() { | |
| 779 | + | |
| 780 | + var data = { | |
| 781 | + width: parseInt(that.element.css("width"), 10), | |
| 782 | + height: parseInt(that.element.css("height"), 10), | |
| 783 | + top: parseInt(that.element.css("top"), 10), | |
| 784 | + left: parseInt(that.element.css("left"), 10) | |
| 785 | + }; | |
| 786 | + | |
| 787 | + if (pr && pr.length) { | |
| 788 | + $(pr[0]).css({ width: data.width, height: data.height }); | |
| 789 | + } | |
| 790 | + | |
| 791 | + // propagating resize, and updating values for each animation step | |
| 792 | + that._updateCache(data); | |
| 793 | + that._propagate("resize", event); | |
| 794 | + | |
| 795 | + } | |
| 796 | + } | |
| 797 | + ); | |
| 798 | + } | |
| 799 | + | |
| 800 | +}); | |
| 801 | + | |
| 802 | +$.ui.plugin.add( "resizable", "containment", { | |
| 803 | + | |
| 804 | + start: function() { | |
| 805 | + var element, p, co, ch, cw, width, height, | |
| 806 | + that = $( this ).resizable( "instance" ), | |
| 807 | + o = that.options, | |
| 808 | + el = that.element, | |
| 809 | + oc = o.containment, | |
| 810 | + ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc; | |
| 811 | + | |
| 812 | + if ( !ce ) { | |
| 813 | + return; | |
| 814 | + } | |
| 815 | + | |
| 816 | + that.containerElement = $( ce ); | |
| 817 | + | |
| 818 | + if ( /document/.test( oc ) || oc === document ) { | |
| 819 | + that.containerOffset = { | |
| 820 | + left: 0, | |
| 821 | + top: 0 | |
| 822 | + }; | |
| 823 | + that.containerPosition = { | |
| 824 | + left: 0, | |
| 825 | + top: 0 | |
| 826 | + }; | |
| 827 | + | |
| 828 | + that.parentData = { | |
| 829 | + element: $( document ), | |
| 830 | + left: 0, | |
| 831 | + top: 0, | |
| 832 | + width: $( document ).width(), | |
| 833 | + height: $( document ).height() || document.body.parentNode.scrollHeight | |
| 834 | + }; | |
| 835 | + } else { | |
| 836 | + element = $( ce ); | |
| 837 | + p = []; | |
| 838 | + $([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) { | |
| 839 | + p[ i ] = that._num( element.css( "padding" + name ) ); | |
| 840 | + }); | |
| 841 | + | |
| 842 | + that.containerOffset = element.offset(); | |
| 843 | + that.containerPosition = element.position(); | |
| 844 | + that.containerSize = { | |
| 845 | + height: ( element.innerHeight() - p[ 3 ] ), | |
| 846 | + width: ( element.innerWidth() - p[ 1 ] ) | |
| 847 | + }; | |
| 848 | + | |
| 849 | + co = that.containerOffset; | |
| 850 | + ch = that.containerSize.height; | |
| 851 | + cw = that.containerSize.width; | |
| 852 | + width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw ); | |
| 853 | + height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ; | |
| 854 | + | |
| 855 | + that.parentData = { | |
| 856 | + element: ce, | |
| 857 | + left: co.left, | |
| 858 | + top: co.top, | |
| 859 | + width: width, | |
| 860 | + height: height | |
| 861 | + }; | |
| 862 | + } | |
| 863 | + }, | |
| 864 | + | |
| 865 | + resize: function( event ) { | |
| 866 | + var woset, hoset, isParent, isOffsetRelative, | |
| 867 | + that = $( this ).resizable( "instance" ), | |
| 868 | + o = that.options, | |
| 869 | + co = that.containerOffset, | |
| 870 | + cp = that.position, | |
| 871 | + pRatio = that._aspectRatio || event.shiftKey, | |
| 872 | + cop = { | |
| 873 | + top: 0, | |
| 874 | + left: 0 | |
| 875 | + }, | |
| 876 | + ce = that.containerElement, | |
| 877 | + continueResize = true; | |
| 878 | + | |
| 879 | + if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) { | |
| 880 | + cop = co; | |
| 881 | + } | |
| 882 | + | |
| 883 | + if ( cp.left < ( that._helper ? co.left : 0 ) ) { | |
| 884 | + that.size.width = that.size.width + | |
| 885 | + ( that._helper ? | |
| 886 | + ( that.position.left - co.left ) : | |
| 887 | + ( that.position.left - cop.left ) ); | |
| 888 | + | |
| 889 | + if ( pRatio ) { | |
| 890 | + that.size.height = that.size.width / that.aspectRatio; | |
| 891 | + continueResize = false; | |
| 892 | + } | |
| 893 | + that.position.left = o.helper ? co.left : 0; | |
| 894 | + } | |
| 895 | + | |
| 896 | + if ( cp.top < ( that._helper ? co.top : 0 ) ) { | |
| 897 | + that.size.height = that.size.height + | |
| 898 | + ( that._helper ? | |
| 899 | + ( that.position.top - co.top ) : | |
| 900 | + that.position.top ); | |
| 901 | + | |
| 902 | + if ( pRatio ) { | |
| 903 | + that.size.width = that.size.height * that.aspectRatio; | |
| 904 | + continueResize = false; | |
| 905 | + } | |
| 906 | + that.position.top = that._helper ? co.top : 0; | |
| 907 | + } | |
| 908 | + | |
| 909 | + isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 ); | |
| 910 | + isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) ); | |
| 911 | + | |
| 912 | + if ( isParent && isOffsetRelative ) { | |
| 913 | + that.offset.left = that.parentData.left + that.position.left; | |
| 914 | + that.offset.top = that.parentData.top + that.position.top; | |
| 915 | + } else { | |
| 916 | + that.offset.left = that.element.offset().left; | |
| 917 | + that.offset.top = that.element.offset().top; | |
| 918 | + } | |
| 919 | + | |
| 920 | + woset = Math.abs( that.sizeDiff.width + | |
| 921 | + (that._helper ? | |
| 922 | + that.offset.left - cop.left : | |
| 923 | + (that.offset.left - co.left)) ); | |
| 924 | + | |
| 925 | + hoset = Math.abs( that.sizeDiff.height + | |
| 926 | + (that._helper ? | |
| 927 | + that.offset.top - cop.top : | |
| 928 | + (that.offset.top - co.top)) ); | |
| 929 | + | |
| 930 | + if ( woset + that.size.width >= that.parentData.width ) { | |
| 931 | + that.size.width = that.parentData.width - woset; | |
| 932 | + if ( pRatio ) { | |
| 933 | + that.size.height = that.size.width / that.aspectRatio; | |
| 934 | + continueResize = false; | |
| 935 | + } | |
| 936 | + } | |
| 937 | + | |
| 938 | + if ( hoset + that.size.height >= that.parentData.height ) { | |
| 939 | + that.size.height = that.parentData.height - hoset; | |
| 940 | + if ( pRatio ) { | |
| 941 | + that.size.width = that.size.height * that.aspectRatio; | |
| 942 | + continueResize = false; | |
| 943 | + } | |
| 944 | + } | |
| 945 | + | |
| 946 | + if ( !continueResize ){ | |
| 947 | + that.position.left = that.prevPosition.left; | |
| 948 | + that.position.top = that.prevPosition.top; | |
| 949 | + that.size.width = that.prevSize.width; | |
| 950 | + that.size.height = that.prevSize.height; | |
| 951 | + } | |
| 952 | + }, | |
| 953 | + | |
| 954 | + stop: function() { | |
| 955 | + var that = $( this ).resizable( "instance" ), | |
| 956 | + o = that.options, | |
| 957 | + co = that.containerOffset, | |
| 958 | + cop = that.containerPosition, | |
| 959 | + ce = that.containerElement, | |
| 960 | + helper = $( that.helper ), | |
| 961 | + ho = helper.offset(), | |
| 962 | + w = helper.outerWidth() - that.sizeDiff.width, | |
| 963 | + h = helper.outerHeight() - that.sizeDiff.height; | |
| 964 | + | |
| 965 | + if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) { | |
| 966 | + $( this ).css({ | |
| 967 | + left: ho.left - cop.left - co.left, | |
| 968 | + width: w, | |
| 969 | + height: h | |
| 970 | + }); | |
| 971 | + } | |
| 972 | + | |
| 973 | + if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) { | |
| 974 | + $( this ).css({ | |
| 975 | + left: ho.left - cop.left - co.left, | |
| 976 | + width: w, | |
| 977 | + height: h | |
| 978 | + }); | |
| 979 | + } | |
| 980 | + } | |
| 981 | +}); | |
| 982 | + | |
| 983 | +$.ui.plugin.add("resizable", "alsoResize", { | |
| 984 | + | |
| 985 | + start: function() { | |
| 986 | + var that = $(this).resizable( "instance" ), | |
| 987 | + o = that.options, | |
| 988 | + _store = function(exp) { | |
| 989 | + $(exp).each(function() { | |
| 990 | + var el = $(this); | |
| 991 | + el.data("ui-resizable-alsoresize", { | |
| 992 | + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), | |
| 993 | + left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10) | |
| 994 | + }); | |
| 995 | + }); | |
| 996 | + }; | |
| 997 | + | |
| 998 | + if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) { | |
| 999 | + if (o.alsoResize.length) { | |
| 1000 | + o.alsoResize = o.alsoResize[0]; | |
| 1001 | + _store(o.alsoResize); | |
| 1002 | + } else { | |
| 1003 | + $.each(o.alsoResize, function(exp) { | |
| 1004 | + _store(exp); | |
| 1005 | + }); | |
| 1006 | + } | |
| 1007 | + } else { | |
| 1008 | + _store(o.alsoResize); | |
| 1009 | + } | |
| 1010 | + }, | |
| 1011 | + | |
| 1012 | + resize: function(event, ui) { | |
| 1013 | + var that = $(this).resizable( "instance" ), | |
| 1014 | + o = that.options, | |
| 1015 | + os = that.originalSize, | |
| 1016 | + op = that.originalPosition, | |
| 1017 | + delta = { | |
| 1018 | + height: (that.size.height - os.height) || 0, | |
| 1019 | + width: (that.size.width - os.width) || 0, | |
| 1020 | + top: (that.position.top - op.top) || 0, | |
| 1021 | + left: (that.position.left - op.left) || 0 | |
| 1022 | + }, | |
| 1023 | + | |
| 1024 | + _alsoResize = function(exp, c) { | |
| 1025 | + $(exp).each(function() { | |
| 1026 | + var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {}, | |
| 1027 | + css = c && c.length ? | |
| 1028 | + c : | |
| 1029 | + el.parents(ui.originalElement[0]).length ? | |
| 1030 | + [ "width", "height" ] : | |
| 1031 | + [ "width", "height", "top", "left" ]; | |
| 1032 | + | |
| 1033 | + $.each(css, function(i, prop) { | |
| 1034 | + var sum = (start[prop] || 0) + (delta[prop] || 0); | |
| 1035 | + if (sum && sum >= 0) { | |
| 1036 | + style[prop] = sum || null; | |
| 1037 | + } | |
| 1038 | + }); | |
| 1039 | + | |
| 1040 | + el.css(style); | |
| 1041 | + }); | |
| 1042 | + }; | |
| 1043 | + | |
| 1044 | + if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) { | |
| 1045 | + $.each(o.alsoResize, function(exp, c) { | |
| 1046 | + _alsoResize(exp, c); | |
| 1047 | + }); | |
| 1048 | + } else { | |
| 1049 | + _alsoResize(o.alsoResize); | |
| 1050 | + } | |
| 1051 | + }, | |
| 1052 | + | |
| 1053 | + stop: function() { | |
| 1054 | + $(this).removeData("resizable-alsoresize"); | |
| 1055 | + } | |
| 1056 | +}); | |
| 1057 | + | |
| 1058 | +$.ui.plugin.add("resizable", "ghost", { | |
| 1059 | + | |
| 1060 | + start: function() { | |
| 1061 | + | |
| 1062 | + var that = $(this).resizable( "instance" ), o = that.options, cs = that.size; | |
| 1063 | + | |
| 1064 | + that.ghost = that.originalElement.clone(); | |
| 1065 | + that.ghost | |
| 1066 | + .css({ | |
| 1067 | + opacity: 0.25, | |
| 1068 | + display: "block", | |
| 1069 | + position: "relative", | |
| 1070 | + height: cs.height, | |
| 1071 | + width: cs.width, | |
| 1072 | + margin: 0, | |
| 1073 | + left: 0, | |
| 1074 | + top: 0 | |
| 1075 | + }) | |
| 1076 | + .addClass("ui-resizable-ghost") | |
| 1077 | + .addClass(typeof o.ghost === "string" ? o.ghost : ""); | |
| 1078 | + | |
| 1079 | + that.ghost.appendTo(that.helper); | |
| 1080 | + | |
| 1081 | + }, | |
| 1082 | + | |
| 1083 | + resize: function() { | |
| 1084 | + var that = $(this).resizable( "instance" ); | |
| 1085 | + if (that.ghost) { | |
| 1086 | + that.ghost.css({ | |
| 1087 | + position: "relative", | |
| 1088 | + height: that.size.height, | |
| 1089 | + width: that.size.width | |
| 1090 | + }); | |
| 1091 | + } | |
| 1092 | + }, | |
| 1093 | + | |
| 1094 | + stop: function() { | |
| 1095 | + var that = $(this).resizable( "instance" ); | |
| 1096 | + if (that.ghost && that.helper) { | |
| 1097 | + that.helper.get(0).removeChild(that.ghost.get(0)); | |
| 1098 | + } | |
| 1099 | + } | |
| 1100 | + | |
| 1101 | +}); | |
| 1102 | + | |
| 1103 | +$.ui.plugin.add("resizable", "grid", { | |
| 1104 | + | |
| 1105 | + resize: function() { | |
| 1106 | + var outerDimensions, | |
| 1107 | + that = $(this).resizable( "instance" ), | |
| 1108 | + o = that.options, | |
| 1109 | + cs = that.size, | |
| 1110 | + os = that.originalSize, | |
| 1111 | + op = that.originalPosition, | |
| 1112 | + a = that.axis, | |
| 1113 | + grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid, | |
| 1114 | + gridX = (grid[0] || 1), | |
| 1115 | + gridY = (grid[1] || 1), | |
| 1116 | + ox = Math.round((cs.width - os.width) / gridX) * gridX, | |
| 1117 | + oy = Math.round((cs.height - os.height) / gridY) * gridY, | |
| 1118 | + newWidth = os.width + ox, | |
| 1119 | + newHeight = os.height + oy, | |
| 1120 | + isMaxWidth = o.maxWidth && (o.maxWidth < newWidth), | |
| 1121 | + isMaxHeight = o.maxHeight && (o.maxHeight < newHeight), | |
| 1122 | + isMinWidth = o.minWidth && (o.minWidth > newWidth), | |
| 1123 | + isMinHeight = o.minHeight && (o.minHeight > newHeight); | |
| 1124 | + | |
| 1125 | + o.grid = grid; | |
| 1126 | + | |
| 1127 | + if (isMinWidth) { | |
| 1128 | + newWidth += gridX; | |
| 1129 | + } | |
| 1130 | + if (isMinHeight) { | |
| 1131 | + newHeight += gridY; | |
| 1132 | + } | |
| 1133 | + if (isMaxWidth) { | |
| 1134 | + newWidth -= gridX; | |
| 1135 | + } | |
| 1136 | + if (isMaxHeight) { | |
| 1137 | + newHeight -= gridY; | |
| 1138 | + } | |
| 1139 | + | |
| 1140 | + if (/^(se|s|e)$/.test(a)) { | |
| 1141 | + that.size.width = newWidth; | |
| 1142 | + that.size.height = newHeight; | |
| 1143 | + } else if (/^(ne)$/.test(a)) { | |
| 1144 | + that.size.width = newWidth; | |
| 1145 | + that.size.height = newHeight; | |
| 1146 | + that.position.top = op.top - oy; | |
| 1147 | + } else if (/^(sw)$/.test(a)) { | |
| 1148 | + that.size.width = newWidth; | |
| 1149 | + that.size.height = newHeight; | |
| 1150 | + that.position.left = op.left - ox; | |
| 1151 | + } else { | |
| 1152 | + if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) { | |
| 1153 | + outerDimensions = that._getPaddingPlusBorderDimensions( this ); | |
| 1154 | + } | |
| 1155 | + | |
| 1156 | + if ( newHeight - gridY > 0 ) { | |
| 1157 | + that.size.height = newHeight; | |
| 1158 | + that.position.top = op.top - oy; | |
| 1159 | + } else { | |
| 1160 | + newHeight = gridY - outerDimensions.height; | |
| 1161 | + that.size.height = newHeight; | |
| 1162 | + that.position.top = op.top + os.height - newHeight; | |
| 1163 | + } | |
| 1164 | + if ( newWidth - gridX > 0 ) { | |
| 1165 | + that.size.width = newWidth; | |
| 1166 | + that.position.left = op.left - ox; | |
| 1167 | + } else { | |
| 1168 | + newWidth = gridY - outerDimensions.height; | |
| 1169 | + that.size.width = newWidth; | |
| 1170 | + that.position.left = op.left + os.width - newWidth; | |
| 1171 | + } | |
| 1172 | + } | |
| 1173 | + } | |
| 1174 | + | |
| 1175 | +}); | |
| 1176 | + | |
| 1177 | +return $.ui.resizable; | |
| 1178 | + | |
| 1179 | +})); | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery.ui/themes/base/accordion.css
0 → 100644
| 1 | +/*! | |
| 2 | + * jQuery UI Accordion 1.11.1 | |
| 3 | + * http://jqueryui.com | |
| 4 | + * | |
| 5 | + * Copyright 2014 jQuery Foundation and other contributors | |
| 6 | + * Released under the MIT license. | |
| 7 | + * http://jquery.org/license | |
| 8 | + * | |
| 9 | + * http://api.jqueryui.com/accordion/#theming | |
| 10 | + */ | |
| 11 | +.ui-accordion .ui-accordion-header { | |
| 12 | + display: block; | |
| 13 | + cursor: pointer; | |
| 14 | + position: relative; | |
| 15 | + margin: 2px 0 0 0; | |
| 16 | + padding: .5em .5em .5em .7em; | |
| 17 | + min-height: 0; /* support: IE7 */ | |
| 18 | + font-size: 100%; | |
| 19 | +} | |
| 20 | +.ui-accordion .ui-accordion-icons { | |
| 21 | + padding-left: 2.2em; | |
| 22 | +} | |
| 23 | +.ui-accordion .ui-accordion-icons .ui-accordion-icons { | |
| 24 | + padding-left: 2.2em; | |
| 25 | +} | |
| 26 | +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { | |
| 27 | + position: absolute; | |
| 28 | + left: .5em; | |
| 29 | + top: 50%; | |
| 30 | + margin-top: -8px; | |
| 31 | +} | |
| 32 | +.ui-accordion .ui-accordion-content { | |
| 33 | + padding: 1em 2.2em; | |
| 34 | + border-top: 0; | |
| 35 | + overflow: auto; | |
| 36 | +} | ... | ... |