Commit e660b6ca5a5945b854552c853bcd12d66fa63714
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
# Conflicts: # src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
Showing
31 changed files
with
2097 additions
and
1903 deletions
Too many changes to show.
To preserve performance only 31 of 36 files are displayed.
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
| @@ -6,9 +6,7 @@ import com.bsth.entity.schedule.GuideboardInfo; | @@ -6,9 +6,7 @@ import com.bsth.entity.schedule.GuideboardInfo; | ||
| 6 | import com.bsth.repository.schedule.GuideboardInfoRepository; | 6 | import com.bsth.repository.schedule.GuideboardInfoRepository; |
| 7 | import com.bsth.service.schedule.GuideboardInfoService; | 7 | import com.bsth.service.schedule.GuideboardInfoService; |
| 8 | import com.bsth.service.schedule.exception.ScheduleException; | 8 | import com.bsth.service.schedule.exception.ScheduleException; |
| 9 | -import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 12 | import org.springframework.web.bind.annotation.RequestMapping; | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
| 13 | import org.springframework.web.bind.annotation.RequestMethod; | 11 | import org.springframework.web.bind.annotation.RequestMethod; |
| 14 | import org.springframework.web.bind.annotation.RequestParam; | 12 | import org.springframework.web.bind.annotation.RequestParam; |
| @@ -23,7 +21,6 @@ import java.util.Map; | @@ -23,7 +21,6 @@ import java.util.Map; | ||
| 23 | */ | 21 | */ |
| 24 | @RestController | 22 | @RestController |
| 25 | @RequestMapping("gic") | 23 | @RequestMapping("gic") |
| 26 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 27 | public class GuideboardInfoController extends BController<GuideboardInfo, Long> { | 24 | public class GuideboardInfoController extends BController<GuideboardInfo, Long> { |
| 28 | @Autowired | 25 | @Autowired |
| 29 | private GuideboardInfoService guideboardInfoService; | 26 | private GuideboardInfoService guideboardInfoService; |
src/main/java/com/bsth/controller/schedule/core/TTInfoController.java
| @@ -3,8 +3,8 @@ package com.bsth.controller.schedule.core; | @@ -3,8 +3,8 @@ package com.bsth.controller.schedule.core; | ||
| 3 | import com.bsth.common.ResponseCode; | 3 | import com.bsth.common.ResponseCode; |
| 4 | import com.bsth.controller.schedule.BController; | 4 | import com.bsth.controller.schedule.BController; |
| 5 | import com.bsth.entity.schedule.TTInfo; | 5 | import com.bsth.entity.schedule.TTInfo; |
| 6 | -import com.bsth.service.schedule.exception.ScheduleException; | ||
| 7 | import com.bsth.service.schedule.TTInfoService; | 6 | import com.bsth.service.schedule.TTInfoService; |
| 7 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.web.bind.annotation.RequestMapping; | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | import org.springframework.web.bind.annotation.RequestMethod; | 10 | import org.springframework.web.bind.annotation.RequestMethod; |
src/main/java/com/bsth/data/BasicData.java
| @@ -270,36 +270,36 @@ public class BasicData implements CommandLineRunner { | @@ -270,36 +270,36 @@ public class BasicData implements CommandLineRunner { | ||
| 270 | Map<String, String> code2SHcode = new HashMap<String, String>(); | 270 | Map<String, String> code2SHcode = new HashMap<String, String>(); |
| 271 | Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); | 271 | Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); |
| 272 | 272 | ||
| 273 | + /** | ||
| 274 | + * 加载运管处的站点及序号 | ||
| 275 | + * 上行从1开始,下行顺序续编 | ||
| 276 | + */ | ||
| 277 | + List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc(); | ||
| 278 | + if(ygcLines != null && ygcLines.size() > 0){ | ||
| 279 | + int size = ygcLines.size(); | ||
| 280 | + Object[] tempArray ; | ||
| 281 | + int num = 1; | ||
| 282 | + String key; | ||
| 283 | + String lineCode = ""; | ||
| 284 | + for (int i = 0; i < size; i ++){ | ||
| 285 | + tempArray = ygcLines.get(i); | ||
| 286 | + if(lineCode.equals("")){ | ||
| 287 | + lineCode = tempArray[0]+""; | ||
| 288 | + }else if(!lineCode.equals(tempArray[0]+"")){ | ||
| 289 | + num = 1; | ||
| 290 | + lineCode = tempArray[0]+""; | ||
| 291 | + } | ||
| 292 | + key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; | ||
| 293 | + tempStationName2YgcNumber.put(key,num++); | ||
| 294 | + } | ||
| 295 | + } | ||
| 296 | + | ||
| 273 | while (iterator.hasNext()) { | 297 | while (iterator.hasNext()) { |
| 274 | line = iterator.next(); | 298 | line = iterator.next(); |
| 275 | biMap.put(line.getId(), line.getLineCode()); | 299 | biMap.put(line.getId(), line.getLineCode()); |
| 276 | code2name.put(line.getLineCode(), line.getName()); | 300 | code2name.put(line.getLineCode(), line.getName()); |
| 277 | id2SHcode.put(line.getId(), line.getShanghaiLinecode()); | 301 | id2SHcode.put(line.getId(), line.getShanghaiLinecode()); |
| 278 | code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); | 302 | code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); |
| 279 | - | ||
| 280 | - /** | ||
| 281 | - * 加载运管处的站点及序号 | ||
| 282 | - * 上行从1开始,下行顺序续编 | ||
| 283 | - */ | ||
| 284 | - List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc(); | ||
| 285 | - if(ygcLines != null && ygcLines.size() > 0){ | ||
| 286 | - int size = ygcLines.size(); | ||
| 287 | - Object[] tempArray ; | ||
| 288 | - int num = 1; | ||
| 289 | - String key; | ||
| 290 | - String lineCode = ""; | ||
| 291 | - for (int i = 0; i < size; i ++){ | ||
| 292 | - tempArray = ygcLines.get(i); | ||
| 293 | - if(lineCode.equals("")){ | ||
| 294 | - lineCode = tempArray[0]+""; | ||
| 295 | - }else if(!lineCode.equals(tempArray[0]+"")){ | ||
| 296 | - num = 1; | ||
| 297 | - lineCode = tempArray[0]+""; | ||
| 298 | - } | ||
| 299 | - key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; | ||
| 300 | - tempStationName2YgcNumber.put(key,num++); | ||
| 301 | - } | ||
| 302 | - } | ||
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | lineId2CodeMap = biMap; | 305 | lineId2CodeMap = biMap; |
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
| @@ -12,4 +12,4 @@ public class ScheduleModifyLogger { | @@ -12,4 +12,4 @@ public class ScheduleModifyLogger { | ||
| 12 | public static void dftz(Long id, String remarks, String dfsj, String bcType, String opType){ | 12 | public static void dftz(Long id, String remarks, String dfsj, String bcType, String opType){ |
| 13 | 13 | ||
| 14 | } | 14 | } |
| 15 | -} | 15 | -} |
| 16 | +} | ||
| 16 | \ No newline at end of file | 17 | \ No newline at end of file |
src/main/java/com/bsth/repository/oil/YlbRepository.java
| @@ -86,7 +86,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -86,7 +86,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 86 | + " ssgsdm like %?2% " | 86 | + " ssgsdm like %?2% " |
| 87 | + " and fgsdm like %?3%" | 87 | + " and fgsdm like %?3%" |
| 88 | + " and xlbm like %?4% and nbbm like %?5% " | 88 | + " and xlbm like %?4% and nbbm like %?5% " |
| 89 | - + " group by nbbm,rq,ssgsdm,fgsdm,xlbm",nativeQuery=true) | 89 | + + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true) |
| 90 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); | 90 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); |
| 91 | 91 | ||
| 92 | 92 |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -71,7 +71,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -71,7 +71,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 71 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | 71 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 72 | } | 72 | } |
| 73 | if(normal){ | 73 | if(normal){ |
| 74 | - sql += " and bc_type != 'in' and bc_type != 'out'"; | 74 | + sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | list = jdbcTemplate.query(sql, | 77 | list = jdbcTemplate.query(sql, |
| @@ -158,7 +158,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -158,7 +158,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 158 | 158 | ||
| 159 | if(model.length() != 0){ | 159 | if(model.length() != 0){ |
| 160 | // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'"; | 160 | // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'"; |
| 161 | - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'"; | 161 | + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 162 | 162 | ||
| 163 | ttList = jdbcTemplate.query(sql, | 163 | ttList = jdbcTemplate.query(sql, |
| 164 | new RowMapper<Long>(){ | 164 | new RowMapper<Long>(){ |
| @@ -452,8 +452,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -452,8 +452,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 452 | if(statu.equals("1")){ | 452 | if(statu.equals("1")){ |
| 453 | for(Long time : timeList){ | 453 | for(Long time : timeList){ |
| 454 | Map<String, Object> tempMap = new HashMap<String, Object>(); | 454 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 455 | - List<Long> fcsjs = timeMap0.get(time); | ||
| 456 | - List<Long> fcsjAs = timeMap1.get(time); | 455 | + List<Long> fcsjs = new ArrayList<Long>(); |
| 456 | + List<Long> fcsjAs = new ArrayList<Long>(); | ||
| 457 | + for(Long l : timeMap0.get(time)){ | ||
| 458 | + if(l < 90) | ||
| 459 | + fcsjs.add(l); | ||
| 460 | + } | ||
| 461 | + for(Long l : timeMap1.get(time)){ | ||
| 462 | + if(l < 90) | ||
| 463 | + fcsjAs.add(l); | ||
| 464 | + } | ||
| 457 | Collections.sort(fcsjs); | 465 | Collections.sort(fcsjs); |
| 458 | Collections.sort(fcsjAs); | 466 | Collections.sort(fcsjAs); |
| 459 | String[] split = key.split("/"); | 467 | String[] split = key.split("/"); |
| @@ -514,8 +522,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -514,8 +522,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 514 | String[] split = key.split("/"); | 522 | String[] split = key.split("/"); |
| 515 | if((long)Long.valueOf(split[0]) == xlBm){ | 523 | if((long)Long.valueOf(split[0]) == xlBm){ |
| 516 | Map<String, Object> tempMap = new HashMap<String, Object>(); | 524 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 517 | - List<Long> fcsjs = temp0.get(key); | ||
| 518 | - List<Long> fcsjAs = temp1.get(key); | 525 | + List<Long> fcsjs = new ArrayList<Long>(); |
| 526 | + List<Long> fcsjAs = new ArrayList<Long>(); | ||
| 527 | + for(Long l : temp0.get(key)){ | ||
| 528 | + if(l < 90) | ||
| 529 | + fcsjs.add(l); | ||
| 530 | + } | ||
| 531 | + for(Long l : temp1.get(key)){ | ||
| 532 | + if(l < 90) | ||
| 533 | + fcsjAs.add(l); | ||
| 534 | + } | ||
| 519 | Collections.sort(fcsjs); | 535 | Collections.sort(fcsjs); |
| 520 | Collections.sort(fcsjAs); | 536 | Collections.sort(fcsjAs); |
| 521 | long fcsj = 0l; | 537 | long fcsj = 0l; |
| @@ -613,7 +629,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -613,7 +629,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 613 | if(sfqr == 1){ | 629 | if(sfqr == 1){ |
| 614 | sql += " and zdsj >= '"+times1+"' and fcsj <= '"+times2+"'"; | 630 | sql += " and zdsj >= '"+times1+"' and fcsj <= '"+times2+"'"; |
| 615 | } | 631 | } |
| 616 | - sql += " and bc_type != 'in' and bc_type != 'out' order by fcsj"; | 632 | + sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' order by fcsj"; |
| 617 | 633 | ||
| 618 | list = jdbcTemplate.query(sql, | 634 | list = jdbcTemplate.query(sql, |
| 619 | new RowMapper<ScheduleRealInfo>(){ | 635 | new RowMapper<ScheduleRealInfo>(){ |
| @@ -707,7 +723,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -707,7 +723,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 707 | }); | 723 | }); |
| 708 | 724 | ||
| 709 | if(model.length() != 0){ | 725 | if(model.length() != 0){ |
| 710 | - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'"; | 726 | + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 711 | 727 | ||
| 712 | ttList = jdbcTemplate.query(sql, | 728 | ttList = jdbcTemplate.query(sql, |
| 713 | new RowMapper<Long>(){ | 729 | new RowMapper<Long>(){ |
| @@ -896,9 +912,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -896,9 +912,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 896 | } | 912 | } |
| 897 | } | 913 | } |
| 898 | Collections.sort(keyList2); | 914 | Collections.sort(keyList2); |
| 899 | - for(long l : keyList2){ | ||
| 900 | - System.out.println(l); | ||
| 901 | - } | 915 | + |
| 902 | for(int i = 1; i < keyList2.size(); i++){ | 916 | for(int i = 1; i < keyList2.size(); i++){ |
| 903 | long fcsj1 = keyList2.get(i - 1); | 917 | long fcsj1 = keyList2.get(i - 1); |
| 904 | long fcsj2 = keyList2.get(i); | 918 | long fcsj2 = keyList2.get(i); |
| @@ -911,7 +925,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -911,7 +925,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 911 | sjyysj += fcsj2 - fcsj1; | 925 | sjyysj += fcsj2 - fcsj1; |
| 912 | } | 926 | } |
| 913 | sjyysj1 += fcsj2 - fcsj1; | 927 | sjyysj1 += fcsj2 - fcsj1; |
| 914 | - System.out.println("---"+(fcsj2-fcsj1)+"---"+sjyysj+"---"+sjyysj1); | ||
| 915 | } | 928 | } |
| 916 | } | 929 | } |
| 917 | 930 | ||
| @@ -1722,7 +1735,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1722,7 +1735,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1722 | if(company.length() != 0){ | 1735 | if(company.length() != 0){ |
| 1723 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | 1736 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 1724 | } | 1737 | } |
| 1725 | - sql += " and bc_type != 'in' and bc_type != 'out'"; | 1738 | + sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 1726 | 1739 | ||
| 1727 | list = jdbcTemplate.query(sql, | 1740 | list = jdbcTemplate.query(sql, |
| 1728 | new RowMapper<ScheduleRealInfo>(){ | 1741 | new RowMapper<ScheduleRealInfo>(){ |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| @@ -16,6 +16,7 @@ import com.bsth.util.TimeUtils; | @@ -16,6 +16,7 @@ import com.bsth.util.TimeUtils; | ||
| 16 | import com.bsth.util.db.DBUtils_MS; | 16 | import com.bsth.util.db.DBUtils_MS; |
| 17 | import com.bsth.webService.trafficManage.geotool.services.InternalPortType; | 17 | import com.bsth.webService.trafficManage.geotool.services.InternalPortType; |
| 18 | import com.bsth.webService.trafficManage.geotool.services.Internal; | 18 | import com.bsth.webService.trafficManage.geotool.services.Internal; |
| 19 | +import com.bsth.webService.trafficManage.org.tempuri.Results; | ||
| 19 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; | 20 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; |
| 20 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; | 21 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 21 | import org.apache.commons.lang.time.DateUtils; | 22 | import org.apache.commons.lang.time.DateUtils; |
| @@ -300,7 +301,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -300,7 +301,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 300 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | 301 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 301 | StringBuffer sf = new StringBuffer(); | 302 | StringBuffer sf = new StringBuffer(); |
| 302 | try { | 303 | try { |
| 303 | - sf.append("<DLDS>"); | 304 | + int counter = 0; // 计数器 |
| 305 | + int per = 10; // 每几条线路上传一次路单 | ||
| 306 | + | ||
| 304 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); | 307 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); |
| 305 | List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date); | 308 | List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date); |
| 306 | Map<String,Object> map = new HashMap<String,Object>(); | 309 | Map<String,Object> map = new HashMap<String,Object>(); |
| @@ -314,6 +317,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -314,6 +317,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 314 | if(line == null || line.getInUse() == null || line.getInUse() == 0){ | 317 | if(line == null || line.getInUse() == null || line.getInUse() == 0){ |
| 315 | continue; | 318 | continue; |
| 316 | } | 319 | } |
| 320 | + if(counter % per == 0){ | ||
| 321 | + sf = new StringBuffer(); | ||
| 322 | + sf.append("<DLDS>"); | ||
| 323 | + } | ||
| 324 | + counter ++; | ||
| 317 | sf.append("<DLD>"); | 325 | sf.append("<DLD>"); |
| 318 | sf.append("<RQ>"+date+"</RQ>"); | 326 | sf.append("<RQ>"+date+"</RQ>"); |
| 319 | sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"")+"</XLBM>"); | 327 | sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"")+"</XLBM>"); |
| @@ -322,7 +330,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -322,7 +330,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 322 | sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); | 330 | sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 323 | sf.append("<LDList>"); | 331 | sf.append("<LDList>"); |
| 324 | 332 | ||
| 325 | - int seqNumber = 0; | ||
| 326 | for(ScheduleRealInfo scheduleRealInfo:list){ | 333 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 327 | if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") | 334 | if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") |
| 328 | .equals(scheduleRealInfo.getLpName()) | 335 | .equals(scheduleRealInfo.getLpName()) |
| @@ -369,17 +376,33 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -369,17 +376,33 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 369 | sf.append("</LDList>"); | 376 | sf.append("</LDList>"); |
| 370 | sf.append("</DLD>"); | 377 | sf.append("</DLD>"); |
| 371 | } | 378 | } |
| 379 | + if(counter % per == per - 1){ | ||
| 380 | + counter = 0; | ||
| 381 | + sf.append("</DLDS>"); | ||
| 382 | + Results results = ssop.setLD(userNameOther, passwordOther, sf.toString()); | ||
| 383 | + if(results.isSuccess()){ | ||
| 384 | + result = "success"; | ||
| 385 | + } | ||
| 386 | + logger.info("setLD:"+sf.toString()); | ||
| 387 | + logger.info("setLD:"+result); | ||
| 388 | + } | ||
| 372 | } | 389 | } |
| 373 | - sf.append("</DLDS>"); | ||
| 374 | - if(ssop.setLD(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 375 | - result = "success"; | 390 | + // 每per条线路上传后剩下的数据再上传 |
| 391 | + if(counter > 0){ | ||
| 392 | + sf.append("</DLDS>"); | ||
| 393 | + Results results = ssop.setLD(userNameOther, passwordOther, sf.toString()); | ||
| 394 | + if(results.isSuccess()){ | ||
| 395 | + result = "success"; | ||
| 396 | + } | ||
| 397 | + logger.info("setLD:"+sf.toString()); | ||
| 398 | + logger.info("setLD:"+result); | ||
| 376 | } | 399 | } |
| 400 | + | ||
| 377 | } catch (Exception e) { | 401 | } catch (Exception e) { |
| 378 | logger.error("setLD:",e); | 402 | logger.error("setLD:",e); |
| 379 | e.printStackTrace(); | 403 | e.printStackTrace(); |
| 380 | }finally{ | 404 | }finally{ |
| 381 | - logger.info("setLD:"+sf.toString()); | ||
| 382 | - logger.info("setLD:"+result); | 405 | + |
| 383 | } | 406 | } |
| 384 | return result; | 407 | return result; |
| 385 | } | 408 | } |
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
| @@ -291,7 +291,8 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw | @@ -291,7 +291,8 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw | ||
| 291 | + "from bsth_c_ylb where to_days(rq)= to_days('"+rq+"' ) " | 291 | + "from bsth_c_ylb where to_days(rq)= to_days('"+rq+"' ) " |
| 292 | + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"' group by nbbm "+ | 292 | + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"' group by nbbm "+ |
| 293 | " ) c on a.nbbm=c.nbbm " | 293 | " ) c on a.nbbm=c.nbbm " |
| 294 | - + "where a.nbbm like '%"+nbbm+"%' and a.gsdm='"+gsdm+"' and a.fgsdm ='"+fgsdm+"'"; | 294 | + + "where a.nbbm like '%"+nbbm+"%' and a.gsdm='"+gsdm+"' and a.fgsdm ='"+fgsdm+"'" |
| 295 | + + " order by a.nbbm"; | ||
| 295 | 296 | ||
| 296 | List<Ylxxb> yList= jdbcTemplate.query(sql, | 297 | List<Ylxxb> yList= jdbcTemplate.query(sql, |
| 297 | new RowMapper<Ylxxb>(){ | 298 | new RowMapper<Ylxxb>(){ |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -1000,6 +1000,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1000,6 +1000,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1000 | return sumMap; | 1000 | return sumMap; |
| 1001 | } | 1001 | } |
| 1002 | 1002 | ||
| 1003 | + | ||
| 1004 | + | ||
| 1003 | @Override | 1005 | @Override |
| 1004 | public List<Ylb> listYlb(Map<String, Object> map) { | 1006 | public List<Ylb> listYlb(Map<String, Object> map) { |
| 1005 | // TODO Auto-generated method stub | 1007 | // TODO Auto-generated method stub |
| @@ -1013,7 +1015,19 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1013,7 +1015,19 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1013 | String sxtj=map.get("sxtj").toString(); | 1015 | String sxtj=map.get("sxtj").toString(); |
| 1014 | if(nbbm.trim()!=""){ | 1016 | if(nbbm.trim()!=""){ |
| 1015 | stringList.add(nbbm); | 1017 | stringList.add(nbbm); |
| 1016 | - listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | 1018 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); |
| 1019 | + int cs=Integer.parseInt(objectLists.get(0)[1].toString()); | ||
| 1020 | + if(sxtj.equals("1")){ | ||
| 1021 | + if(cs==1){ | ||
| 1022 | + listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1023 | + } | ||
| 1024 | + } | ||
| 1025 | + | ||
| 1026 | + if(sxtj.equals("2")){ | ||
| 1027 | + if(cs>1){ | ||
| 1028 | + listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1029 | + } | ||
| 1030 | + } | ||
| 1017 | }else{ | 1031 | }else{ |
| 1018 | //全部 | 1032 | //全部 |
| 1019 | if(sxtj.equals("0")){ | 1033 | if(sxtj.equals("0")){ |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -819,8 +819,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -819,8 +819,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 819 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | 819 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); |
| 820 | for (int i = 0; i < scheduleRealInfos.size(); i++) { | 820 | for (int i = 0; i < scheduleRealInfos.size(); i++) { |
| 821 | ScheduleRealInfo s=scheduleRealInfos.get(i); | 821 | ScheduleRealInfo s=scheduleRealInfos.get(i); |
| 822 | - if(s.getZdsjActual()!=null){ | ||
| 823 | - lists.add(s); | 822 | + Set<ChildTaskPlan> cts = s.getcTasks(); |
| 823 | + if(cts != null && cts.size() > 0){ | ||
| 824 | + lists.add(s); | ||
| 825 | + }else{ | ||
| 826 | + if(s.getZdsjActual()!=null){ | ||
| 827 | + lists.add(s); | ||
| 828 | + } | ||
| 824 | } | 829 | } |
| 825 | } | 830 | } |
| 826 | DecimalFormat format = new DecimalFormat("0.00"); | 831 | DecimalFormat format = new DecimalFormat("0.00"); |
| @@ -1670,8 +1675,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1670,8 +1675,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1670 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | 1675 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); |
| 1671 | for (int i = 0; i < list.size(); i++) { | 1676 | for (int i = 0; i < list.size(); i++) { |
| 1672 | ScheduleRealInfo s=list.get(i); | 1677 | ScheduleRealInfo s=list.get(i); |
| 1673 | - if(s.getZdsjActual()!=null){ | ||
| 1674 | - lists.add(s); | 1678 | + Set<ChildTaskPlan> cts = s.getcTasks(); |
| 1679 | + if(cts != null && cts.size() > 0){ | ||
| 1680 | + lists.add(s); | ||
| 1681 | + }else{ | ||
| 1682 | + if(s.getZdsjActual()!=null){ | ||
| 1683 | + lists.add(s); | ||
| 1684 | + } | ||
| 1675 | } | 1685 | } |
| 1676 | } | 1686 | } |
| 1677 | double ksgl=culateService.culateKsgl(list); | 1687 | double ksgl=culateService.culateKsgl(list); |
| @@ -1956,8 +1966,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1956,8 +1966,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1956 | List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>(); | 1966 | List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>(); |
| 1957 | for (int i = 0; i < list_s.size(); i++) { | 1967 | for (int i = 0; i < list_s.size(); i++) { |
| 1958 | ScheduleRealInfo s=list_s.get(i); | 1968 | ScheduleRealInfo s=list_s.get(i); |
| 1959 | - if(s.getZdsjActual()!=null){ | ||
| 1960 | - lists.add(s); | 1969 | + Set<ChildTaskPlan> cts = s.getcTasks(); |
| 1970 | + if(cts != null && cts.size() > 0){ | ||
| 1971 | + lists.add(s); | ||
| 1972 | + }else{ | ||
| 1973 | + if(s.getZdsjActual()!=null){ | ||
| 1974 | + lists.add(s); | ||
| 1975 | + } | ||
| 1961 | } | 1976 | } |
| 1962 | } | 1977 | } |
| 1963 | Map<String, Object> map = new HashMap<String, Object>(); | 1978 | Map<String, Object> map = new HashMap<String, Object>(); |
| @@ -2559,8 +2574,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2559,8 +2574,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2559 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | 2574 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); |
| 2560 | for(int i=0;i<list.size();i++){ | 2575 | for(int i=0;i<list.size();i++){ |
| 2561 | ScheduleRealInfo s=list.get(i); | 2576 | ScheduleRealInfo s=list.get(i); |
| 2562 | - if(s.getZdsjActual()!=null){ | ||
| 2563 | - lists.add(s); | 2577 | + Set<ChildTaskPlan> cts = s.getcTasks(); |
| 2578 | + if(cts != null && cts.size() > 0){ | ||
| 2579 | + lists.add(s); | ||
| 2580 | + }else{ | ||
| 2581 | + if(s.getZdsjActual()!=null){ | ||
| 2582 | + lists.add(s); | ||
| 2583 | + } | ||
| 2564 | } | 2584 | } |
| 2565 | } | 2585 | } |
| 2566 | Map<String, Object> map = new HashMap<String, Object>(); | 2586 | Map<String, Object> map = new HashMap<String, Object>(); |
| @@ -2634,8 +2654,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2634,8 +2654,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2634 | } | 2654 | } |
| 2635 | for (int i = 0; i < list.size(); i++) { | 2655 | for (int i = 0; i < list.size(); i++) { |
| 2636 | ScheduleRealInfo s=list.get(i); | 2656 | ScheduleRealInfo s=list.get(i); |
| 2637 | - if(s.getZdsjActual()!=null){ | ||
| 2638 | - list_s.add(s); | 2657 | + Set<ChildTaskPlan> cts = s.getcTasks(); |
| 2658 | + if(cts != null && cts.size() > 0){ | ||
| 2659 | + list_s.add(s); | ||
| 2660 | + }else{ | ||
| 2661 | + if(s.getZdsjActual()!=null){ | ||
| 2662 | + list_s.add(s); | ||
| 2663 | + } | ||
| 2639 | } | 2664 | } |
| 2640 | } | 2665 | } |
| 2641 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); | 2666 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); |
| @@ -4238,8 +4263,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4238,8 +4263,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4238 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | 4263 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); |
| 4239 | for (int i = 0; i < scheduleRealInfos.size(); i++) { | 4264 | for (int i = 0; i < scheduleRealInfos.size(); i++) { |
| 4240 | ScheduleRealInfo s=scheduleRealInfos.get(i); | 4265 | ScheduleRealInfo s=scheduleRealInfos.get(i); |
| 4241 | - if(s.getZdsjActual()!=null){ | ||
| 4242 | - lists.add(s); | 4266 | + Set<ChildTaskPlan> cts = s.getcTasks(); |
| 4267 | + if(cts != null && cts.size() > 0){ | ||
| 4268 | + lists.add(s); | ||
| 4269 | + }else{ | ||
| 4270 | + if(s.getZdsjActual()!=null){ | ||
| 4271 | + lists.add(s); | ||
| 4272 | + } | ||
| 4243 | } | 4273 | } |
| 4244 | } | 4274 | } |
| 4245 | DecimalFormat format = new DecimalFormat("0.00"); | 4275 | DecimalFormat format = new DecimalFormat("0.00"); |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| @@ -568,8 +568,16 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -568,8 +568,16 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 568 | //有子任务 | 568 | //有子任务 |
| 569 | if (cts != null && cts.size() > 0) { | 569 | if (cts != null && cts.size() > 0) { |
| 570 | for(ChildTaskPlan c : cts){ | 570 | for(ChildTaskPlan c : cts){ |
| 571 | - if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | ||
| 572 | - sum = Arith.add(sum, c.getMileage()); | 571 | + if(item.equals("其他")){ |
| 572 | + if(c.isDestroy() && | ||
| 573 | + ((c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)|| | ||
| 574 | + (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(""))) | ||
| 575 | + sum = Arith.add(sum, c.getMileage()); | ||
| 576 | + }else{ | ||
| 577 | + if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | ||
| 578 | + sum = Arith.add(sum, c.getMileage()); | ||
| 579 | + } | ||
| 580 | + | ||
| 573 | } | 581 | } |
| 574 | } | 582 | } |
| 575 | else if(isInOut(sch)) | 583 | else if(isInOut(sch)) |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -793,260 +793,74 @@ public class ReportServiceImpl implements ReportService{ | @@ -793,260 +793,74 @@ public class ReportServiceImpl implements ReportService{ | ||
| 793 | return m; | 793 | return m; |
| 794 | } | 794 | } |
| 795 | }); | 795 | }); |
| 796 | - | ||
| 797 | - //班次 | ||
| 798 | - int sj_0 = 6*60+31,sj_1 = 8*60+30,sj_2 = 16*60+1,sj_3 = 18*60; | ||
| 799 | - | ||
| 800 | - //顺序 出场--早高峰---中午---晚高峰---进场 | ||
| 801 | - //实驶时间时间(分),0为上行,1为下行 | ||
| 802 | - int ccsj0=0,ccsj1=0,zgf0=0,zgf1=0,zw0=0,zw1=0,wgf0=0,wgf1=0,jcsj0=0,jcsj1=0; | ||
| 803 | - | ||
| 804 | - //记录上一个发车时间(方便记录间距) | ||
| 805 | - int cfc0=0,cfc1=0,zfc0=0,zfc1=0,zwfc0=0,zwfc1=0,wfc0=0,wfc1=0,jcfc0Z=0,jcfc1Z=0,jcfc0W=0,jcfc1W=0; | ||
| 806 | - //车距 (发车时间的间距) i--MIN a--MAX | ||
| 807 | - int iC=999,aC=-1,iZg=999,aZg=-1,iZw=999,aZw=-1,iWg=999,aWg=-1,iJcZ=999,aJcZ=-1,iJcW=999,aJcW=-1; | ||
| 808 | - int iC1=999,aC1=-1,iZg1=999,aZg1=-1,iZw1=999,aZw1=-1,iWg1=999,aWg1=-1,iJc1Z=999,aJc1Z=-1,iJc1W=999,aJc1W=-1; | 796 | + |
| 797 | + List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>(); | ||
| 798 | + Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>(); | ||
| 799 | + Map<String, Map<String, Object>> maps = new HashMap<String, Map<String, Object>>(); | ||
| 800 | + keyMap.put("(首)——6:30", new ArrayList<Map<String, Object>>()); | ||
| 801 | + keyMap.put("6:31——8:30", new ArrayList<Map<String, Object>>()); | ||
| 802 | + keyMap.put("8:31——16:00", new ArrayList<Map<String, Object>>()); | ||
| 803 | + keyMap.put("16:01——18:00", new ArrayList<Map<String, Object>>()); | ||
| 804 | + keyMap.put("18:01——(末)", new ArrayList<Map<String, Object>>()); | ||
| 805 | + for(int i = 0; i < list.size(); i++){ | ||
| 806 | + Map<String, Object> ttMap = list.get(i); | ||
| 807 | + String fcsj = ttMap.get("fcsj").toString(); | ||
| 808 | + String[] split = fcsj.split(":"); | ||
| 809 | + int fcsjT = Integer.valueOf(split[0])*60+Integer.valueOf(split[1]); | ||
| 810 | + if(fcsjT >= minSj && fcsjT <= 6*60+30){ | ||
| 811 | + keyMap.get("(首)——6:30").add(ttMap); | ||
| 812 | + } else if(fcsjT > 6*60+30 && fcsjT <= 8*60+30){ | ||
| 813 | + keyMap.get("6:31——8:30").add(ttMap); | ||
| 814 | + } else if(fcsjT > 8*60+30 && fcsjT <= 16*60){ | ||
| 815 | + keyMap.get("8:31——16:00").add(ttMap); | ||
| 816 | + } else if(fcsjT > 16*60 && fcsjT <= 18*60){ | ||
| 817 | + keyMap.get("16:01——18:00").add(ttMap); | ||
| 818 | + } else { | ||
| 819 | + keyMap.get("18:01——(末)").add(ttMap); | ||
| 820 | + } | ||
| 821 | + } | ||
| 809 | 822 | ||
| 810 | - for(int i=0;i<list.size();i++){ | ||
| 811 | - Map<String, Object> ttMap=list.get(i); | ||
| 812 | - String xlDir=ttMap.get("dir").toString(); | ||
| 813 | - int bcsj=Integer.parseInt(ttMap.get("bcsj").toString()); | ||
| 814 | - String fcsj=ttMap.get("fcsj").toString(); | ||
| 815 | - String[] fcsjs=fcsj.split(":"); | ||
| 816 | - int fcsjNum=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]); | ||
| 817 | - | ||
| 818 | - if(xlDir.equals("0")){ | ||
| 819 | - if(fcsjNum>=minSj && fcsjNum<sj_0){ | ||
| 820 | - ccsj0 +=bcsj; | ||
| 821 | - if(aC<0){ | ||
| 822 | - cfc0 =fcsjNum; | ||
| 823 | - aC=0; | ||
| 824 | - }else{ | ||
| 825 | - if(fcsjNum-cfc0<iC){ | ||
| 826 | - iC=fcsjNum-cfc0; | ||
| 827 | - } | ||
| 828 | - if(fcsjNum-cfc0>aC){ | ||
| 829 | - aC=fcsjNum-cfc0; | ||
| 830 | - } | ||
| 831 | - | ||
| 832 | - cfc0=fcsjNum; | ||
| 833 | - } | ||
| 834 | - | ||
| 835 | - }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | ||
| 836 | - zgf0 +=bcsj; | ||
| 837 | - if(aZg<0){ | ||
| 838 | - zfc0 =fcsjNum; | ||
| 839 | - aZg=0; | ||
| 840 | - }else{ | ||
| 841 | - if(fcsjNum-zfc0<iZg){ | ||
| 842 | - iZg=fcsjNum-zfc0; | ||
| 843 | - } | ||
| 844 | - | ||
| 845 | - if(fcsjNum-zfc0>aZg){ | ||
| 846 | - aZg=fcsjNum-zfc0; | ||
| 847 | - } | ||
| 848 | - | ||
| 849 | - zfc0=fcsjNum; | ||
| 850 | - } | ||
| 851 | - }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | ||
| 852 | - zw0 +=bcsj; | ||
| 853 | - if(aZw<0){ | ||
| 854 | - zwfc0 =fcsjNum; | ||
| 855 | - aZw=0; | ||
| 856 | - }else{ | ||
| 857 | - if(fcsjNum-zwfc0<iZw){ | ||
| 858 | - iZw=fcsjNum-zwfc0; | ||
| 859 | - } | ||
| 860 | - if(fcsjNum-zwfc0>aZw){ | ||
| 861 | - aZw=fcsjNum-zwfc0; | ||
| 862 | - } | ||
| 863 | - zwfc0=fcsjNum; | ||
| 864 | - } | ||
| 865 | - | ||
| 866 | - }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | ||
| 867 | - wgf0 +=bcsj; | ||
| 868 | - if(aWg<0){ | ||
| 869 | - wfc0=fcsjNum; | ||
| 870 | - aWg=0; | ||
| 871 | - }else{ | ||
| 872 | - if(fcsjNum-wfc0<iWg){ | ||
| 873 | - iWg=fcsjNum-wfc0; | ||
| 874 | - } | ||
| 875 | - if(fcsjNum-wfc0>aWg){ | ||
| 876 | - aWg=fcsjNum-wfc0; | ||
| 877 | - } | ||
| 878 | - wfc0=fcsjNum; | ||
| 879 | - } | ||
| 880 | - }else if(fcsjNum>sj_3){ | ||
| 881 | - jcsj0 +=bcsj; | ||
| 882 | - if(aJcW<0){ | ||
| 883 | - jcfc0W=fcsjNum; | ||
| 884 | - aJcW=0; | ||
| 885 | - }else{ | ||
| 886 | - if(fcsjNum-jcfc0W<iJcW){ | ||
| 887 | - iJcW=fcsjNum-jcfc0W; | ||
| 888 | - } | ||
| 889 | - if(fcsjNum-jcfc0W>aJcW){ | ||
| 890 | - aJcW=fcsjNum-jcfc0W; | ||
| 891 | - } | ||
| 892 | - jcfc0W=fcsjNum; | ||
| 893 | - } | ||
| 894 | - }else if(fcsjNum<minSj){ | ||
| 895 | - jcsj0 +=bcsj; | ||
| 896 | - if(aJcZ<0){ | ||
| 897 | - jcfc0Z=fcsjNum; | ||
| 898 | - aJcZ=0; | ||
| 899 | - }else{ | ||
| 900 | - if(fcsjNum-jcfc0Z<iJcZ){ | ||
| 901 | - iJcZ=fcsjNum-jcfc0Z; | ||
| 902 | - } | ||
| 903 | - if(fcsjNum-jcfc0Z>aJcZ){ | ||
| 904 | - aJcZ=fcsjNum-jcfc0Z; | ||
| 905 | - } | ||
| 906 | - jcfc0Z=fcsjNum; | ||
| 907 | - } | 823 | + for(String key : keyMap.keySet()){ |
| 824 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 825 | + List<Map<String, Object>> list2 = keyMap.get(key); | ||
| 826 | + List<Integer> cjs = new ArrayList<Integer>(); | ||
| 827 | + int sxsj = 0, xxsj = 0, zcj = 0; | ||
| 828 | + int temp = 24*60+1; | ||
| 829 | + for(Map<String, Object> m : list2){ | ||
| 830 | + String[] split = m.get("fcsj").toString().split(":"); | ||
| 831 | + int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 832 | + int xlDir = Integer.valueOf(m.get("dir").toString()); | ||
| 833 | + int bcsj = Integer.valueOf(m.get("bcsj").toString()); | ||
| 834 | + if(xlDir == 0){ | ||
| 835 | + sxsj += bcsj; | ||
| 836 | + } else { | ||
| 837 | + xxsj += bcsj; | ||
| 908 | } | 838 | } |
| 909 | - | ||
| 910 | - | ||
| 911 | - }else{ | ||
| 912 | - if(fcsjNum>=minSj && fcsjNum<sj_0){ | ||
| 913 | - ccsj1 +=bcsj; | ||
| 914 | - if(aC1<0){ | ||
| 915 | - cfc1=fcsjNum; | ||
| 916 | - aC1=0; | ||
| 917 | - }else{ | ||
| 918 | - if(fcsjNum-cfc1<iC1){ | ||
| 919 | - iC1=fcsjNum-cfc1; | ||
| 920 | - } | ||
| 921 | - if(fcsjNum-cfc1>aC1){ | ||
| 922 | - aC1=fcsjNum-cfc1; | ||
| 923 | - } | ||
| 924 | - cfc1=fcsjNum; | ||
| 925 | - } | ||
| 926 | - }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | ||
| 927 | - zgf1 +=bcsj; | ||
| 928 | - if(aZg1<0){ | ||
| 929 | - zfc1=fcsjNum; | ||
| 930 | - aZg1=0; | ||
| 931 | - }else{ | ||
| 932 | - if(fcsjNum-zfc1<iZg1){ | ||
| 933 | - iZg1=fcsjNum-zfc1; | ||
| 934 | - } | ||
| 935 | - if(fcsjNum-zfc1>aZg1){ | ||
| 936 | - aZg1=fcsjNum-zfc1; | ||
| 937 | - } | ||
| 938 | - | ||
| 939 | - zfc1=fcsjNum; | ||
| 940 | - } | ||
| 941 | - }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | ||
| 942 | - zw1 +=bcsj; | ||
| 943 | - if(aZw1<0){ | ||
| 944 | - zwfc1=fcsjNum; | ||
| 945 | - aZw1=0; | ||
| 946 | - }else{ | ||
| 947 | - if(fcsjNum-zwfc1<iZw1){ | ||
| 948 | - iZw1=fcsjNum-zwfc1; | ||
| 949 | - } | ||
| 950 | - if(fcsjNum-zwfc1>aZw1){ | ||
| 951 | - aZw1=fcsjNum-zwfc1; | ||
| 952 | - } | ||
| 953 | - zwfc1=fcsjNum; | ||
| 954 | - } | ||
| 955 | - }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | ||
| 956 | - wgf1 +=bcsj; | ||
| 957 | - if(aWg1<0){ | ||
| 958 | - wfc1=fcsjNum; | ||
| 959 | - aWg1=0; | ||
| 960 | - }else{ | ||
| 961 | - if(fcsjNum-wfc1<iWg1){ | ||
| 962 | - iWg1=fcsjNum-wfc1; | ||
| 963 | - } | ||
| 964 | - if(fcsjNum-wfc1<aWg1){ | ||
| 965 | - aWg1=fcsjNum-wfc1; | ||
| 966 | - } | ||
| 967 | - wfc1=fcsjNum; | ||
| 968 | - } | ||
| 969 | - }else if(fcsjNum>sj_3){ | ||
| 970 | - jcsj1 +=bcsj; | ||
| 971 | - if(aJc1W<0){ | ||
| 972 | - jcfc1W=fcsjNum; | ||
| 973 | - aJc1W=0; | ||
| 974 | - }else{ | ||
| 975 | - if(fcsjNum-jcfc1W<iJc1W){ | ||
| 976 | - aJc1W=fcsjNum-jcfc1W; | ||
| 977 | - } | ||
| 978 | - if(fcsjNum-jcfc1W>aJc1W){ | ||
| 979 | - aJc1W=fcsjNum-jcfc1W; | ||
| 980 | - } | ||
| 981 | - | ||
| 982 | - jcfc1W=fcsjNum; | ||
| 983 | - } | ||
| 984 | - }else if(fcsjNum<minSj){ | ||
| 985 | - jcsj1 +=bcsj; | ||
| 986 | - if(aJc1Z<0){ | ||
| 987 | - jcfc1Z=fcsjNum; | ||
| 988 | - aJc1Z=0; | ||
| 989 | - }else{ | ||
| 990 | - if(fcsjNum-jcfc1Z<iJc1Z){ | ||
| 991 | - aJc1Z=fcsjNum-jcfc1Z; | ||
| 992 | - } | ||
| 993 | - if(fcsjNum-jcfc1Z>aJc1Z){ | ||
| 994 | - aJc1Z=fcsjNum-jcfc1Z; | ||
| 995 | - } | ||
| 996 | - | ||
| 997 | - jcfc1Z=fcsjNum; | ||
| 998 | - } | 839 | + if(temp >= fcsj){ |
| 840 | + temp = fcsj; | ||
| 841 | + } else { | ||
| 842 | + cjs.add(fcsj - temp); | ||
| 843 | + temp = fcsj; | ||
| 999 | } | 844 | } |
| 1000 | } | 845 | } |
| 1001 | - | 846 | + Collections.sort(cjs); |
| 847 | + for(int i : cjs){ | ||
| 848 | + zcj += i; | ||
| 849 | + } | ||
| 850 | + tempMap.put("sjd", key); | ||
| 851 | + tempMap.put("sxsj", sxsj); | ||
| 852 | + tempMap.put("xxsj", xxsj); | ||
| 853 | + tempMap.put("fqsj", sxsj + xxsj); | ||
| 854 | + tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——"); | ||
| 855 | + tempMap.put("pjcj", cjs.size()>0?zcj/(cjs.size()-1):"/"); | ||
| 856 | + maps.put(key, tempMap); | ||
| 1002 | } | 857 | } |
| 858 | + newList.add(maps.get("(首)——6:30")); | ||
| 859 | + newList.add(maps.get("6:31——8:30")); | ||
| 860 | + newList.add(maps.get("8:31——16:00")); | ||
| 861 | + newList.add(maps.get("16:01——18:00")); | ||
| 862 | + newList.add(maps.get("18:01——(末)")); | ||
| 1003 | 863 | ||
| 1004 | - | ||
| 1005 | - List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>(); | ||
| 1006 | - Map<String, Object> newmap1=new HashMap<String,Object>(); | ||
| 1007 | - Map<String, Object> newmap2=new HashMap<String,Object>(); | ||
| 1008 | - Map<String, Object> newmap3=new HashMap<String,Object>(); | ||
| 1009 | - Map<String, Object> newmap4=new HashMap<String,Object>(); | ||
| 1010 | - Map<String, Object> newmap5=new HashMap<String,Object>(); | ||
| 1011 | - newmap1.put("sjd", "(首)——6:30"); | ||
| 1012 | - newmap1.put("sxsj", ccsj0); | ||
| 1013 | - newmap1.put("xxsj", ccsj1); | ||
| 1014 | - newmap1.put("fqsj", ccsj0+ccsj1); | ||
| 1015 | - newmap1.put("cj", (iC-iC1>0?iC1:iC)+"——"+(aC-aC1>0?aC:aC1)); | ||
| 1016 | - | ||
| 1017 | - newmap2.put("sjd", "6:31——8:30"); | ||
| 1018 | - newmap2.put("sxsj", zgf0); | ||
| 1019 | - newmap2.put("xxsj", zgf1); | ||
| 1020 | - newmap2.put("fqsj", zgf1+zgf0); | ||
| 1021 | - newmap2.put("cj", (iZg-iZg1>0?iZg1:iZg)+"——"+(aZg-aZg1>0?aZg:aZg1)); | ||
| 1022 | - | ||
| 1023 | - newmap3.put("sjd", "8:30——16:00"); | ||
| 1024 | - newmap3.put("sxsj", zw0); | ||
| 1025 | - newmap3.put("xxsj", zw1); | ||
| 1026 | - newmap3.put("fqsj", zw0+zw1); | ||
| 1027 | - newmap3.put("cj", (iZw-iZw1>0?iZw1:iZw)+"——"+(aZw-aZw1>0?aZw:aZw1)); | ||
| 1028 | - | ||
| 1029 | - newmap4.put("sjd", "16:01——18:00"); | ||
| 1030 | - newmap4.put("sxsj", wgf0); | ||
| 1031 | - newmap4.put("xxsj", wgf1); | ||
| 1032 | - newmap4.put("fqsj", wgf0+wgf1); | ||
| 1033 | - newmap4.put("cj", (iWg-iWg1>0?iWg1:iWg)+"——"+(aWg-aWg1>0?aWg:aWg1)); | ||
| 1034 | - | ||
| 1035 | - newmap5.put("sjd", "18:00——(末)"); | ||
| 1036 | - newmap5.put("sxsj", jcsj0); | ||
| 1037 | - newmap5.put("xxsj", jcsj1); | ||
| 1038 | - newmap5.put("fqsj", jcsj0+jcsj1); | ||
| 1039 | - int min0=iJcZ-iJcW>0?iJcW:iJcZ; | ||
| 1040 | - int max0=aJcZ-aJcW>0?aJcZ:aJcW; | ||
| 1041 | - int min1=iJc1Z-iJc1W>0?iJc1W:iJc1Z; | ||
| 1042 | - int max1=aJc1Z-aJc1W>0?aJc1Z:aJc1W; | ||
| 1043 | - newmap5.put("cj", (min0-min1>0?min1:min0)+"——"+(max0-max1>0?max0:max1)); | ||
| 1044 | - | ||
| 1045 | - newList.add(newmap1); | ||
| 1046 | - newList.add(newmap2); | ||
| 1047 | - newList.add(newmap3); | ||
| 1048 | - newList.add(newmap4); | ||
| 1049 | - newList.add(newmap5); | ||
| 1050 | return newList; | 864 | return newList; |
| 1051 | } | 865 | } |
| 1052 | @Override | 866 | @Override |
| @@ -1167,7 +981,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -1167,7 +981,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1167 | for (int i = 0; i < sList.size(); i++) { | 981 | for (int i = 0; i < sList.size(); i++) { |
| 1168 | ScheduleRealInfo scheduleRealInfo = sList.get(i); | 982 | ScheduleRealInfo scheduleRealInfo = sList.get(i); |
| 1169 | if (!(scheduleRealInfo.getBcType().equals("in") | 983 | if (!(scheduleRealInfo.getBcType().equals("in") |
| 1170 | - || scheduleRealInfo.getBcType().equals("out"))) { | 984 | + || scheduleRealInfo.getBcType().equals("out") |
| 985 | + ||scheduleRealInfo.getBcType().equals("ldks"))) { | ||
| 1171 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 986 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 1172 | if (childTaskPlans.isEmpty()) { | 987 | if (childTaskPlans.isEmpty()) { |
| 1173 | Map<String, Object> newMap = new HashMap<String, Object>(); | 988 | Map<String, Object> newMap = new HashMap<String, Object>(); |
| @@ -1195,32 +1010,62 @@ public class ReportServiceImpl implements ReportService{ | @@ -1195,32 +1010,62 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1195 | 1010 | ||
| 1196 | } else { | 1011 | } else { |
| 1197 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 1012 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 1198 | - while (it.hasNext()) { | ||
| 1199 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 1200 | - if (childTaskPlan.isDestroy()) { | ||
| 1201 | - String destroyReason = ""; | ||
| 1202 | - if ( childTaskPlan.getDestroyReason() == null) { | ||
| 1203 | - destroyReason = "其他"; | ||
| 1204 | - }else if(childTaskPlan.getDestroyReason().equals("")){ | ||
| 1205 | - destroyReason = "其他"; | ||
| 1206 | - } else { | ||
| 1207 | - destroyReason = childTaskPlan.getDestroyReason(); | 1013 | + if (scheduleRealInfo.getStatus() == -1) { |
| 1014 | + while (it.hasNext()) { | ||
| 1015 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 1016 | + if (childTaskPlan.isDestroy()) { | ||
| 1017 | + String destroyReason = ""; | ||
| 1018 | + if ( childTaskPlan.getDestroyReason() == null) { | ||
| 1019 | + destroyReason = "其他"; | ||
| 1020 | + }else if(childTaskPlan.getDestroyReason().equals("")){ | ||
| 1021 | + destroyReason = "其他"; | ||
| 1022 | + } else { | ||
| 1023 | + destroyReason = childTaskPlan.getDestroyReason(); | ||
| 1024 | + } | ||
| 1025 | + Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 1026 | + newMap.put("nr", destroyReason); | ||
| 1027 | + newMap.put("lp", scheduleRealInfo.getLpName()); | ||
| 1028 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | ||
| 1029 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | ||
| 1030 | + newMap.put("dz", childTaskPlan.getStartStationName()); | ||
| 1031 | + newMap.put("sj", childTaskPlan.getStartDate()); | ||
| 1032 | + newMap.put("gzf", " "); | ||
| 1033 | + newMap.put("lbbc", 1); | ||
| 1034 | + newMap.put("lblc", childTaskPlan.getMileage()); | ||
| 1035 | + newMap.put("jyqp", childTaskPlan.getRemarks()); | ||
| 1036 | + list.add(newMap); | ||
| 1037 | + | ||
| 1208 | } | 1038 | } |
| 1209 | - Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 1210 | - newMap.put("nr", destroyReason); | ||
| 1211 | - newMap.put("lp", scheduleRealInfo.getLpName()); | ||
| 1212 | - newMap.put("nbbm", scheduleRealInfo.getClZbh()); | ||
| 1213 | - newMap.put("jgh", scheduleRealInfo.getjGh()); | ||
| 1214 | - newMap.put("dz", childTaskPlan.getStartStationName()); | ||
| 1215 | - newMap.put("sj", childTaskPlan.getStartDate()); | ||
| 1216 | - newMap.put("gzf", " "); | ||
| 1217 | - newMap.put("lbbc", 0); | ||
| 1218 | - newMap.put("lblc", childTaskPlan.getMileage()); | ||
| 1219 | - newMap.put("jyqp", childTaskPlan.getRemarks()); | ||
| 1220 | - list.add(newMap); | 1039 | + } |
| 1040 | + }else{ | ||
| 1041 | + while (it.hasNext()) { | ||
| 1042 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 1043 | + if (childTaskPlan.isDestroy()) { | ||
| 1044 | + String destroyReason = ""; | ||
| 1045 | + if ( childTaskPlan.getDestroyReason() == null) { | ||
| 1046 | + destroyReason = "其他"; | ||
| 1047 | + }else if(childTaskPlan.getDestroyReason().equals("")){ | ||
| 1048 | + destroyReason = "其他"; | ||
| 1049 | + } else { | ||
| 1050 | + destroyReason = childTaskPlan.getDestroyReason(); | ||
| 1051 | + } | ||
| 1052 | + Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 1053 | + newMap.put("nr", destroyReason); | ||
| 1054 | + newMap.put("lp", scheduleRealInfo.getLpName()); | ||
| 1055 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | ||
| 1056 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | ||
| 1057 | + newMap.put("dz", childTaskPlan.getStartStationName()); | ||
| 1058 | + newMap.put("sj", childTaskPlan.getStartDate()); | ||
| 1059 | + newMap.put("gzf", " "); | ||
| 1060 | + newMap.put("lbbc", 0); | ||
| 1061 | + newMap.put("lblc", childTaskPlan.getMileage()); | ||
| 1062 | + newMap.put("jyqp", childTaskPlan.getRemarks()); | ||
| 1063 | + list.add(newMap); | ||
| 1221 | 1064 | ||
| 1065 | + } | ||
| 1222 | } | 1066 | } |
| 1223 | } | 1067 | } |
| 1068 | + | ||
| 1224 | } | 1069 | } |
| 1225 | } | 1070 | } |
| 1226 | } | 1071 | } |
| @@ -1272,7 +1117,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -1272,7 +1117,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1272 | for (int i = 0; i < sList.size(); i++) { | 1117 | for (int i = 0; i < sList.size(); i++) { |
| 1273 | ScheduleRealInfo scheduleRealInfo=sList.get(i); | 1118 | ScheduleRealInfo scheduleRealInfo=sList.get(i); |
| 1274 | if (!(scheduleRealInfo.getBcType().equals("in") | 1119 | if (!(scheduleRealInfo.getBcType().equals("in") |
| 1275 | - || scheduleRealInfo.getBcType().equals("out"))) { | 1120 | + || scheduleRealInfo.getBcType().equals("out") |
| 1121 | + || scheduleRealInfo.getBcType().equals("ldks"))) { | ||
| 1276 | // Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 1122 | // Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 1277 | // if(childTaskPlans.isEmpty()){ | 1123 | // if(childTaskPlans.isEmpty()){ |
| 1278 | if(scheduleRealInfo.isSflj()){ | 1124 | if(scheduleRealInfo.isSflj()){ |
src/main/java/com/bsth/service/schedule/datatools/CarConfigInfoDataToolsImpl.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public class CarConfigInfoDataToolsImpl { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 5 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 6 | +import jxl.Cell; | ||
| 7 | +import jxl.Sheet; | ||
| 8 | +import jxl.Workbook; | ||
| 9 | +import jxl.write.Label; | ||
| 10 | +import jxl.write.WritableSheet; | ||
| 11 | +import jxl.write.WritableWorkbook; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
| 16 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 17 | +import org.springframework.stereotype.Service; | ||
| 18 | + | ||
| 19 | +import java.io.File; | ||
| 20 | +import java.io.PrintWriter; | ||
| 21 | +import java.io.StringWriter; | ||
| 22 | +import java.util.HashMap; | ||
| 23 | +import java.util.Map; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by xu on 17/5/16. | ||
| 27 | + */ | ||
| 28 | +@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 29 | +@Service(value = "carConfig_dataTool") | ||
| 30 | +public class CarConfigInfoDataToolsImpl implements DataToolsService { | ||
| 31 | + /** 日志记录器 */ | ||
| 32 | + private final static Logger LOGGER = LoggerFactory.getLogger(CarConfigInfoDataToolsImpl.class); | ||
| 33 | + | ||
| 34 | + @Autowired | ||
| 35 | + @Qualifier(value = "dataToolsServiceImpl") | ||
| 36 | + private DataToolsService dataToolsService; | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + private DataToolsProperties dataToolsProperties; | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 43 | + try { | ||
| 44 | + // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 45 | + File file = dataToolsService.uploadFile(filename, filedata); | ||
| 46 | + Workbook workbook = Workbook.getWorkbook(file); | ||
| 47 | + Sheet sheet = workbook.getSheet(0); | ||
| 48 | + | ||
| 49 | + File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 50 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 51 | + WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 52 | + for (int i = 0; i < sheet.getRows(); i++) { | ||
| 53 | + Cell[] cells = sheet.getRow(i); | ||
| 54 | + for (int j = 0; j < cells.length; j++) { | ||
| 55 | + writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + writableWorkbook.write(); | ||
| 59 | + writableWorkbook.close(); | ||
| 60 | + | ||
| 61 | + return fileCal; | ||
| 62 | + | ||
| 63 | + } catch (Exception exp) { | ||
| 64 | + throw new ScheduleException(exp); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 70 | + try { | ||
| 71 | + LOGGER.info("//---------------- 导入车辆配置信息 start... ----------------//"); | ||
| 72 | + // 创建ktr转换所需参数 | ||
| 73 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 74 | + File ktrFile = new File(this.getClass().getResource( | ||
| 75 | + dataToolsProperties.getCarsconfigDatainputktr()).toURI()); | ||
| 76 | + | ||
| 77 | + // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 78 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 79 | + ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 80 | + ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 81 | + | ||
| 82 | + ktrParms.putAll(params); | ||
| 83 | + | ||
| 84 | + dataToolsService.importData(file, ktrParms); | ||
| 85 | + | ||
| 86 | + LOGGER.info("//---------------- 导入车辆配置信息 success... ----------------//"); | ||
| 87 | + } catch (Exception exp) { | ||
| 88 | + LOGGER.info("//---------------- 导入车辆配置信息 failed... ----------------//"); | ||
| 89 | + | ||
| 90 | + StringWriter sw = new StringWriter(); | ||
| 91 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 92 | + LOGGER.info(sw.toString()); | ||
| 93 | + | ||
| 94 | + throw new ScheduleException(exp.getMessage()); | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + @Override | ||
| 99 | + public File exportData(Map<String, Object> params) throws ScheduleException { | ||
| 100 | + try { | ||
| 101 | + LOGGER.info("//---------------- 导出车辆配置信息 start... ----------------//"); | ||
| 102 | + // 创建ktr转换所需参数 | ||
| 103 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 104 | + File ktrFile = new File(this.getClass().getResource( | ||
| 105 | + dataToolsProperties.getCarsconfigDataoutputktr()).toURI()); | ||
| 106 | + | ||
| 107 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 108 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 109 | + ktrParms.put("filename", "车辆配置信息_download-"); | ||
| 110 | + | ||
| 111 | + ktrParms.putAll(params); | ||
| 112 | + | ||
| 113 | + File file = dataToolsService.exportData(ktrParms); | ||
| 114 | + | ||
| 115 | + LOGGER.info("//---------------- 导出车辆配置信息 success... ----------------//"); | ||
| 116 | + | ||
| 117 | + return file; | ||
| 118 | + | ||
| 119 | + } catch (Exception exp) { | ||
| 120 | + LOGGER.info("//---------------- 导出车辆配置信息 failed... ----------------//"); | ||
| 121 | + | ||
| 122 | + StringWriter sw = new StringWriter(); | ||
| 123 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 124 | + LOGGER.info(sw.toString()); | ||
| 125 | + | ||
| 126 | + throw new ScheduleException(exp.getMessage()); | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | +} |
src/main/java/com/bsth/service/schedule/datatools/CarsDataToolsImpl.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public class CarsDataToolsImpl { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 5 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 6 | +import jxl.Cell; | ||
| 7 | +import jxl.Sheet; | ||
| 8 | +import jxl.Workbook; | ||
| 9 | +import jxl.write.Label; | ||
| 10 | +import jxl.write.WritableSheet; | ||
| 11 | +import jxl.write.WritableWorkbook; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
| 16 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 17 | +import org.springframework.stereotype.Service; | ||
| 18 | + | ||
| 19 | +import java.io.File; | ||
| 20 | +import java.io.PrintWriter; | ||
| 21 | +import java.io.StringWriter; | ||
| 22 | +import java.util.HashMap; | ||
| 23 | +import java.util.Map; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by xu on 17/5/16. | ||
| 27 | + */ | ||
| 28 | +@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 29 | +@Service(value = "cars_dataTool") | ||
| 30 | +public class CarsDataToolsImpl implements DataToolsService { | ||
| 31 | + /** 日志记录器 */ | ||
| 32 | + private final static Logger LOGGER = LoggerFactory.getLogger(CarsDataToolsImpl.class); | ||
| 33 | + | ||
| 34 | + @Autowired | ||
| 35 | + @Qualifier(value = "dataToolsServiceImpl") | ||
| 36 | + private DataToolsService dataToolsService; | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + private DataToolsProperties dataToolsProperties; | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 43 | + try { | ||
| 44 | + // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 45 | + File file = dataToolsService.uploadFile(filename, filedata); | ||
| 46 | + Workbook workbook = Workbook.getWorkbook(file); | ||
| 47 | + Sheet sheet = workbook.getSheet(0); | ||
| 48 | + | ||
| 49 | + File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 50 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 51 | + WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 52 | + for (int i = 0; i < sheet.getRows(); i++) { | ||
| 53 | + Cell[] cells = sheet.getRow(i); | ||
| 54 | + for (int j = 0; j < cells.length; j++) { | ||
| 55 | + writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + writableWorkbook.write(); | ||
| 59 | + writableWorkbook.close(); | ||
| 60 | + | ||
| 61 | + return fileCal; | ||
| 62 | + | ||
| 63 | + } catch (Exception exp) { | ||
| 64 | + throw new ScheduleException(exp); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 70 | + try { | ||
| 71 | + LOGGER.info("//---------------- 导入车辆基础信息 start... ----------------//"); | ||
| 72 | + // 创建ktr转换所需参数 | ||
| 73 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 74 | + File ktrFile = new File(this.getClass().getResource( | ||
| 75 | + dataToolsProperties.getCarsDatainputktr()).toURI()); | ||
| 76 | + | ||
| 77 | + // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 78 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 79 | + ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 80 | + ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 81 | + | ||
| 82 | + dataToolsService.importData(file, ktrParms); | ||
| 83 | + | ||
| 84 | + LOGGER.info("//---------------- 导入车辆基础信息 success... ----------------//"); | ||
| 85 | + } catch (Exception exp) { | ||
| 86 | + LOGGER.info("//---------------- 导入车辆基础信息 failed... ----------------//"); | ||
| 87 | + | ||
| 88 | + StringWriter sw = new StringWriter(); | ||
| 89 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 90 | + LOGGER.info(sw.toString()); | ||
| 91 | + | ||
| 92 | + throw new ScheduleException(exp.getMessage()); | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + @Override | ||
| 97 | + public File exportData(Map<String, Object> params) throws ScheduleException { | ||
| 98 | + try { | ||
| 99 | + LOGGER.info("//---------------- 导出车辆基础信息 start... ----------------//"); | ||
| 100 | + // 创建ktr转换所需参数 | ||
| 101 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 102 | + File ktrFile = new File(this.getClass().getResource( | ||
| 103 | + dataToolsProperties.getCarsDataoutputktr()).toURI()); | ||
| 104 | + | ||
| 105 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 106 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 107 | + ktrParms.put("filename", "车辆基础信息_download-"); | ||
| 108 | + | ||
| 109 | + File file = dataToolsService.exportData(ktrParms); | ||
| 110 | + | ||
| 111 | + LOGGER.info("//---------------- 导出车辆基础信息 success... ----------------//"); | ||
| 112 | + | ||
| 113 | + return file; | ||
| 114 | + | ||
| 115 | + } catch (Exception exp) { | ||
| 116 | + LOGGER.info("//---------------- 导出车辆基础信息 failed... ----------------//"); | ||
| 117 | + | ||
| 118 | + StringWriter sw = new StringWriter(); | ||
| 119 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 120 | + LOGGER.info(sw.toString()); | ||
| 121 | + | ||
| 122 | + throw new ScheduleException(exp.getMessage()); | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | +} |
src/main/java/com/bsth/service/schedule/datatools/EmployeeConfigInfoDataToolsImpl.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public class EmployeeConfigInfoDataToolsImpl { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 5 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 6 | +import jxl.Cell; | ||
| 7 | +import jxl.Sheet; | ||
| 8 | +import jxl.Workbook; | ||
| 9 | +import jxl.write.Label; | ||
| 10 | +import jxl.write.WritableSheet; | ||
| 11 | +import jxl.write.WritableWorkbook; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
| 16 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 17 | +import org.springframework.stereotype.Service; | ||
| 18 | + | ||
| 19 | +import java.io.File; | ||
| 20 | +import java.io.PrintWriter; | ||
| 21 | +import java.io.StringWriter; | ||
| 22 | +import java.util.HashMap; | ||
| 23 | +import java.util.Map; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by xu on 17/5/16. | ||
| 27 | + */ | ||
| 28 | +@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 29 | +@Service(value = "employeeConfig_dataTool") | ||
| 30 | +public class EmployeeConfigInfoDataToolsImpl implements DataToolsService { | ||
| 31 | + /** 日志记录器 */ | ||
| 32 | + private static final Logger LOGGER = LoggerFactory.getLogger(EmployeeConfigInfoDataToolsImpl.class); | ||
| 33 | + | ||
| 34 | + @Autowired | ||
| 35 | + @Qualifier(value = "dataToolsServiceImpl") | ||
| 36 | + private DataToolsService dataToolsService; | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + private DataToolsProperties dataToolsProperties; | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 43 | + try { | ||
| 44 | + // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 45 | + File file = dataToolsService.uploadFile(filename, filedata); | ||
| 46 | + Workbook workbook = Workbook.getWorkbook(file); | ||
| 47 | + Sheet sheet = workbook.getSheet(0); | ||
| 48 | + | ||
| 49 | + File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 50 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 51 | + WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 52 | + for (int i = 0; i < sheet.getRows(); i++) { | ||
| 53 | + Cell[] cells = sheet.getRow(i); | ||
| 54 | + for (int j = 0; j < cells.length; j++) { | ||
| 55 | + writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + writableWorkbook.write(); | ||
| 59 | + writableWorkbook.close(); | ||
| 60 | + | ||
| 61 | + return fileCal; | ||
| 62 | + | ||
| 63 | + } catch (Exception exp) { | ||
| 64 | + throw new ScheduleException(exp); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 70 | + try { | ||
| 71 | + LOGGER.info("//---------------- 导入人员配置信息 start... ----------------//"); | ||
| 72 | + // 创建ktr转换所需参数 | ||
| 73 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 74 | + File ktrFile = new File(this.getClass().getResource( | ||
| 75 | + dataToolsProperties.getEmployeesconfigDatainputktr()).toURI()); | ||
| 76 | + | ||
| 77 | + // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 78 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 79 | + ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 80 | + ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 81 | + | ||
| 82 | + ktrParms.putAll(params); | ||
| 83 | + | ||
| 84 | + dataToolsService.importData(file, ktrParms); | ||
| 85 | + | ||
| 86 | + LOGGER.info("//---------------- 导入人员配置信息 success... ----------------//"); | ||
| 87 | + } catch (Exception exp) { | ||
| 88 | + LOGGER.info("//---------------- 导入人员配置信息 failed... ----------------//"); | ||
| 89 | + | ||
| 90 | + StringWriter sw = new StringWriter(); | ||
| 91 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 92 | + LOGGER.info(sw.toString()); | ||
| 93 | + | ||
| 94 | + throw new ScheduleException(exp.getMessage()); | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + @Override | ||
| 99 | + public File exportData(Map<String, Object> params) throws ScheduleException { | ||
| 100 | + try { | ||
| 101 | + LOGGER.info("//---------------- 导出人员配置信息 start... ----------------//"); | ||
| 102 | + // 创建ktr转换所需参数 | ||
| 103 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 104 | + File ktrFile = new File(this.getClass().getResource( | ||
| 105 | + dataToolsProperties.getEmployeesconfigDataoutputktr()).toURI()); | ||
| 106 | + | ||
| 107 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 108 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 109 | + ktrParms.put("filename", "人员配置信息_download-"); | ||
| 110 | + | ||
| 111 | + ktrParms.putAll(params); | ||
| 112 | + | ||
| 113 | + File file = dataToolsService.exportData(ktrParms); | ||
| 114 | + | ||
| 115 | + LOGGER.info("//---------------- 导出人员配置信息 success... ----------------//"); | ||
| 116 | + | ||
| 117 | + return file; | ||
| 118 | + | ||
| 119 | + } catch (Exception exp) { | ||
| 120 | + LOGGER.info("//---------------- 导出人员配置信息 failed... ----------------//"); | ||
| 121 | + | ||
| 122 | + StringWriter sw = new StringWriter(); | ||
| 123 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 124 | + LOGGER.info(sw.toString()); | ||
| 125 | + | ||
| 126 | + throw new ScheduleException(exp.getMessage()); | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | +} |
src/main/java/com/bsth/service/schedule/datatools/EmployeeDataToolsImpl.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public class EmployeeDataToolsImpl { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 5 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 6 | +import jxl.Cell; | ||
| 7 | +import jxl.Sheet; | ||
| 8 | +import jxl.Workbook; | ||
| 9 | +import jxl.write.Label; | ||
| 10 | +import jxl.write.WritableSheet; | ||
| 11 | +import jxl.write.WritableWorkbook; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
| 16 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 17 | +import org.springframework.stereotype.Service; | ||
| 18 | + | ||
| 19 | +import java.io.File; | ||
| 20 | +import java.io.PrintWriter; | ||
| 21 | +import java.io.StringWriter; | ||
| 22 | +import java.util.HashMap; | ||
| 23 | +import java.util.Map; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by xu on 17/5/16. | ||
| 27 | + */ | ||
| 28 | +@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 29 | +@Service(value = "employee_dataTool") | ||
| 30 | +public class EmployeeDataToolsImpl implements DataToolsService { | ||
| 31 | + /** 日志记录器 */ | ||
| 32 | + private final static Logger LOGGER = LoggerFactory.getLogger(EmployeeDataToolsImpl.class); | ||
| 33 | + | ||
| 34 | + @Autowired | ||
| 35 | + @Qualifier(value = "dataToolsServiceImpl") | ||
| 36 | + private DataToolsService dataToolsService; | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + private DataToolsProperties dataToolsProperties; | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 43 | + try { | ||
| 44 | + // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 45 | + File file = dataToolsService.uploadFile(filename, filedata); | ||
| 46 | + Workbook workbook = Workbook.getWorkbook(file); | ||
| 47 | + Sheet sheet = workbook.getSheet(0); | ||
| 48 | + | ||
| 49 | + File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 50 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 51 | + WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 52 | + for (int i = 0; i < sheet.getRows(); i++) { | ||
| 53 | + Cell[] cells = sheet.getRow(i); | ||
| 54 | + for (int j = 0; j < cells.length; j++) { | ||
| 55 | + writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + writableWorkbook.write(); | ||
| 59 | + writableWorkbook.close(); | ||
| 60 | + | ||
| 61 | + return fileCal; | ||
| 62 | + | ||
| 63 | + } catch (Exception exp) { | ||
| 64 | + throw new ScheduleException(exp); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 70 | + try { | ||
| 71 | + LOGGER.info("//---------------- 导入人员基础信息 start... ----------------//"); | ||
| 72 | + // 创建ktr转换所需参数 | ||
| 73 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 74 | + File ktrFile = new File(this.getClass().getResource( | ||
| 75 | + dataToolsProperties.getEmployeesDatainputktr()).toURI()); | ||
| 76 | + | ||
| 77 | + // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 78 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 79 | + ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 80 | + ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 81 | + | ||
| 82 | + dataToolsService.importData(file, ktrParms); | ||
| 83 | + | ||
| 84 | + LOGGER.info("//---------------- 导入人员基础信息 success... ----------------//"); | ||
| 85 | + } catch (Exception exp) { | ||
| 86 | + LOGGER.info("//---------------- 导入人员基础信息 failed... ----------------//"); | ||
| 87 | + | ||
| 88 | + StringWriter sw = new StringWriter(); | ||
| 89 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 90 | + LOGGER.info(sw.toString()); | ||
| 91 | + | ||
| 92 | + throw new ScheduleException(exp.getMessage()); | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + @Override | ||
| 97 | + public File exportData(Map<String, Object> params) throws ScheduleException { | ||
| 98 | + try { | ||
| 99 | + LOGGER.info("//---------------- 导出人员基础信息 start... ----------------//"); | ||
| 100 | + // 创建ktr转换所需参数 | ||
| 101 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 102 | + File ktrFile = new File(this.getClass().getResource( | ||
| 103 | + dataToolsProperties.getEmployeesDataoutputktr()).toURI()); | ||
| 104 | + | ||
| 105 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 106 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 107 | + ktrParms.put("filename", "人员基础信息_download-"); | ||
| 108 | + | ||
| 109 | + File file = dataToolsService.exportData(ktrParms); | ||
| 110 | + | ||
| 111 | + LOGGER.info("//---------------- 导出人员基础信息 success... ----------------//"); | ||
| 112 | + | ||
| 113 | + return file; | ||
| 114 | + | ||
| 115 | + } catch (Exception exp) { | ||
| 116 | + LOGGER.info("//---------------- 导出人员基础信息 failed... ----------------//"); | ||
| 117 | + | ||
| 118 | + StringWriter sw = new StringWriter(); | ||
| 119 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 120 | + LOGGER.info(sw.toString()); | ||
| 121 | + | ||
| 122 | + throw new ScheduleException(exp.getMessage()); | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | +} |
src/main/java/com/bsth/service/schedule/datatools/GuideboardInfoDataToolsImpl.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public class GuideboardInfoDataToolsImpl { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 5 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 6 | +import jxl.Cell; | ||
| 7 | +import jxl.Sheet; | ||
| 8 | +import jxl.Workbook; | ||
| 9 | +import jxl.write.Label; | ||
| 10 | +import jxl.write.WritableSheet; | ||
| 11 | +import jxl.write.WritableWorkbook; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
| 16 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 17 | +import org.springframework.stereotype.Service; | ||
| 18 | + | ||
| 19 | +import java.io.File; | ||
| 20 | +import java.io.PrintWriter; | ||
| 21 | +import java.io.StringWriter; | ||
| 22 | +import java.util.HashMap; | ||
| 23 | +import java.util.Map; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by xu on 17/5/16. | ||
| 27 | + */ | ||
| 28 | +@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 29 | +@Service(value = "gbInfo_dataTool") | ||
| 30 | +public class GuideboardInfoDataToolsImpl implements DataToolsService { | ||
| 31 | + /** 日志记录器 */ | ||
| 32 | + private final static Logger LOGGER = LoggerFactory.getLogger(GuideboardInfoDataToolsImpl.class); | ||
| 33 | + | ||
| 34 | + @Autowired | ||
| 35 | + @Qualifier(value = "dataToolsServiceImpl") | ||
| 36 | + private DataToolsService dataToolsService; | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + private DataToolsProperties dataToolsProperties; | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 43 | + try { | ||
| 44 | + // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 45 | + File file = dataToolsService.uploadFile(filename, filedata); | ||
| 46 | + Workbook workbook = Workbook.getWorkbook(file); | ||
| 47 | + Sheet sheet = workbook.getSheet(0); | ||
| 48 | + | ||
| 49 | + File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 50 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 51 | + WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 52 | + for (int i = 0; i < sheet.getRows(); i++) { | ||
| 53 | + Cell[] cells = sheet.getRow(i); | ||
| 54 | + for (int j = 0; j < cells.length; j++) { | ||
| 55 | + writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + writableWorkbook.write(); | ||
| 59 | + writableWorkbook.close(); | ||
| 60 | + | ||
| 61 | + return fileCal; | ||
| 62 | + | ||
| 63 | + } catch (Exception exp) { | ||
| 64 | + throw new ScheduleException(exp); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 70 | + try { | ||
| 71 | + LOGGER.info("//---------------- 导入路牌信息 start... ----------------//"); | ||
| 72 | + // 创建ktr转换所需参数 | ||
| 73 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 74 | + File ktrFile = new File(this.getClass().getResource( | ||
| 75 | + dataToolsProperties.getGuideboardsDatainputktr()).toURI()); | ||
| 76 | + | ||
| 77 | + // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 78 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 79 | + ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 80 | + ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 81 | + | ||
| 82 | + ktrParms.putAll(params); | ||
| 83 | + | ||
| 84 | + dataToolsService.importData(file, ktrParms); | ||
| 85 | + | ||
| 86 | + LOGGER.info("//---------------- 导入路牌信息 success... ----------------//"); | ||
| 87 | + } catch (Exception exp) { | ||
| 88 | + LOGGER.info("//---------------- 导入路牌信息 failed... ----------------//"); | ||
| 89 | + | ||
| 90 | + StringWriter sw = new StringWriter(); | ||
| 91 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 92 | + LOGGER.info(sw.toString()); | ||
| 93 | + | ||
| 94 | + throw new ScheduleException(exp.getMessage()); | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + @Override | ||
| 99 | + public File exportData(Map<String, Object> params) throws ScheduleException { | ||
| 100 | + try { | ||
| 101 | + LOGGER.info("//---------------- 导出路牌信息 start... ----------------//"); | ||
| 102 | + // 创建ktr转换所需参数 | ||
| 103 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 104 | + File ktrFile = new File(this.getClass().getResource( | ||
| 105 | + dataToolsProperties.getGuideboardsDataoutputktr()).toURI()); | ||
| 106 | + | ||
| 107 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 108 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 109 | + ktrParms.put("filename", "路牌信息_download-"); | ||
| 110 | + | ||
| 111 | + ktrParms.putAll(params); | ||
| 112 | + | ||
| 113 | + File file = dataToolsService.exportData(ktrParms); | ||
| 114 | + | ||
| 115 | + LOGGER.info("//---------------- 导出路牌信息 success... ----------------//"); | ||
| 116 | + | ||
| 117 | + return file; | ||
| 118 | + | ||
| 119 | + } catch (Exception exp) { | ||
| 120 | + LOGGER.info("//---------------- 导出路牌信息 failed... ----------------//"); | ||
| 121 | + | ||
| 122 | + StringWriter sw = new StringWriter(); | ||
| 123 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 124 | + LOGGER.info(sw.toString()); | ||
| 125 | + | ||
| 126 | + throw new ScheduleException(exp.getMessage()); | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | +} |
src/main/java/com/bsth/service/schedule/datatools/ScheduleRule1FlatDataToolsImpl.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public class ScheduleRule1FlatDataToolsImpl { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 5 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 6 | +import jxl.Cell; | ||
| 7 | +import jxl.Sheet; | ||
| 8 | +import jxl.Workbook; | ||
| 9 | +import jxl.write.Label; | ||
| 10 | +import jxl.write.WritableSheet; | ||
| 11 | +import jxl.write.WritableWorkbook; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
| 16 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 17 | +import org.springframework.stereotype.Service; | ||
| 18 | + | ||
| 19 | +import java.io.File; | ||
| 20 | +import java.io.PrintWriter; | ||
| 21 | +import java.io.StringWriter; | ||
| 22 | +import java.util.HashMap; | ||
| 23 | +import java.util.Map; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by xu on 17/5/16. | ||
| 27 | + */ | ||
| 28 | +@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 29 | +@Service(value = "scheduleRule_dataTool") | ||
| 30 | +public class ScheduleRule1FlatDataToolsImpl implements DataToolsService { | ||
| 31 | + /** 日志记录器 */ | ||
| 32 | + private final static Logger LOGGER = LoggerFactory.getLogger(ScheduleRule1FlatDataToolsImpl.class); | ||
| 33 | + | ||
| 34 | + @Autowired | ||
| 35 | + @Qualifier(value = "dataToolsServiceImpl") | ||
| 36 | + private DataToolsService dataToolsService; | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + private DataToolsProperties dataToolsProperties; | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 43 | + try { | ||
| 44 | + // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 45 | + File file = dataToolsService.uploadFile(filename, filedata); | ||
| 46 | + Workbook workbook = Workbook.getWorkbook(file); | ||
| 47 | + Sheet sheet = workbook.getSheet(0); | ||
| 48 | + | ||
| 49 | + File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 50 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 51 | + WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 52 | + for (int i = 0; i < sheet.getRows(); i++) { | ||
| 53 | + Cell[] cells = sheet.getRow(i); | ||
| 54 | + for (int j = 0; j < cells.length; j++) { | ||
| 55 | + writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + writableWorkbook.write(); | ||
| 59 | + writableWorkbook.close(); | ||
| 60 | + | ||
| 61 | + return fileCal; | ||
| 62 | + | ||
| 63 | + } catch (Exception exp) { | ||
| 64 | + throw new ScheduleException(exp); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 70 | + try { | ||
| 71 | + LOGGER.info("//---------------- 导入排版规则信息 start... ----------------//"); | ||
| 72 | + // 创建ktr转换所需参数 | ||
| 73 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 74 | + File ktrFile = new File(this.getClass().getResource( | ||
| 75 | + dataToolsProperties.getScheduleruleDatainputktr()).toURI()); | ||
| 76 | + | ||
| 77 | + // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 78 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 79 | + ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 80 | + ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 81 | + | ||
| 82 | + ktrParms.putAll(params); | ||
| 83 | + | ||
| 84 | + dataToolsService.importData(file, ktrParms); | ||
| 85 | + | ||
| 86 | + LOGGER.info("//---------------- 导入排版规则信息 success... ----------------//"); | ||
| 87 | + } catch (Exception exp) { | ||
| 88 | + LOGGER.info("//---------------- 导入排版规则信息 failed... ----------------//"); | ||
| 89 | + | ||
| 90 | + StringWriter sw = new StringWriter(); | ||
| 91 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 92 | + LOGGER.info(sw.toString()); | ||
| 93 | + | ||
| 94 | + throw new ScheduleException(exp.getMessage()); | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + @Override | ||
| 99 | + public File exportData(Map<String, Object> params) throws ScheduleException { | ||
| 100 | + try { | ||
| 101 | + LOGGER.info("//---------------- 导出排版规则信息 start... ----------------//"); | ||
| 102 | + // 创建ktr转换所需参数 | ||
| 103 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 104 | + File ktrFile = new File(this.getClass().getResource( | ||
| 105 | + dataToolsProperties.getScheduleruleOutput()).toURI()); | ||
| 106 | + | ||
| 107 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 108 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 109 | + ktrParms.put("filename", "排版规则信息_download-"); | ||
| 110 | + | ||
| 111 | + ktrParms.putAll(params); | ||
| 112 | + | ||
| 113 | + File file = dataToolsService.exportData(ktrParms); | ||
| 114 | + | ||
| 115 | + LOGGER.info("//---------------- 导出排版规则信息 success... ----------------//"); | ||
| 116 | + | ||
| 117 | + return file; | ||
| 118 | + | ||
| 119 | + } catch (Exception exp) { | ||
| 120 | + LOGGER.info("//---------------- 导出排版规则信息 failed... ----------------//"); | ||
| 121 | + | ||
| 122 | + StringWriter sw = new StringWriter(); | ||
| 123 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 124 | + LOGGER.info(sw.toString()); | ||
| 125 | + | ||
| 126 | + throw new ScheduleException(exp.getMessage()); | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | +} |
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public class TTInfoDetailDataToolsImpl { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 5 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 6 | +import jxl.Cell; | ||
| 7 | +import jxl.Sheet; | ||
| 8 | +import jxl.Workbook; | ||
| 9 | +import jxl.write.Label; | ||
| 10 | +import jxl.write.WritableSheet; | ||
| 11 | +import jxl.write.WritableWorkbook; | ||
| 12 | +import org.apache.commons.lang3.StringUtils; | ||
| 13 | +import org.joda.time.DateTime; | ||
| 14 | +import org.slf4j.Logger; | ||
| 15 | +import org.slf4j.LoggerFactory; | ||
| 16 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
| 18 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| 19 | +import org.springframework.stereotype.Service; | ||
| 20 | + | ||
| 21 | +import java.io.File; | ||
| 22 | +import java.io.PrintWriter; | ||
| 23 | +import java.io.StringWriter; | ||
| 24 | +import java.util.ArrayList; | ||
| 25 | +import java.util.HashMap; | ||
| 26 | +import java.util.List; | ||
| 27 | +import java.util.Map; | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * Created by xu on 17/5/16. | ||
| 31 | + */ | ||
| 32 | +@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 33 | +@Service(value = "ttInfoDetail_dataTool") | ||
| 34 | +public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetailForEdit { | ||
| 35 | + /** 日志记录器 */ | ||
| 36 | + private final static Logger LOGGER = LoggerFactory.getLogger(TTInfoDetailDataToolsImpl.class); | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + @Qualifier(value = "dataToolsServiceImpl") | ||
| 40 | + private DataToolsService dataToolsService; | ||
| 41 | + | ||
| 42 | + @Autowired | ||
| 43 | + private DataToolsProperties dataToolsProperties; | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 47 | + try { | ||
| 48 | + // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 49 | + File file = dataToolsService.uploadFile(filename, filedata); | ||
| 50 | + Workbook workbook = Workbook.getWorkbook(file); | ||
| 51 | + Sheet sheet = workbook.getSheet(0); | ||
| 52 | + | ||
| 53 | + File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 54 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 55 | + WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 56 | + for (int i = 0; i < sheet.getRows(); i++) { | ||
| 57 | + Cell[] cells = sheet.getRow(i); | ||
| 58 | + for (int j = 0; j < cells.length; j++) { | ||
| 59 | + writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + writableWorkbook.write(); | ||
| 63 | + writableWorkbook.close(); | ||
| 64 | + | ||
| 65 | + return fileCal; | ||
| 66 | + | ||
| 67 | + } catch (Exception exp) { | ||
| 68 | + throw new ScheduleException(exp); | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + @Override | ||
| 73 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 74 | + try { | ||
| 75 | + LOGGER.info("//---------------- 导入时刻表明细 start... ----------------//"); | ||
| 76 | + | ||
| 77 | + String filename = file.getAbsolutePath(); // xls文件名 | ||
| 78 | + String sheetname = String.valueOf(params.get("sheetname")); // sheet名字 | ||
| 79 | + Long ttid = Long.valueOf(String.valueOf(params.get("ttid"))); // 时刻表id | ||
| 80 | + Long xlid = Long.valueOf(String.valueOf(params.get("xlid"))); // 线路id | ||
| 81 | + Integer lineid = Integer.valueOf(String.valueOf(params.get("lineinfo"))); // 线路标准id | ||
| 82 | + String xlname = String.valueOf(params.get("xlname")); // 线路名字 | ||
| 83 | + String ttname = String.valueOf(params.get("ttname")); // 时刻表名字 | ||
| 84 | + | ||
| 85 | + LOGGER.info("参数1, xls文件名={},sheet名字={}", filename, sheetname); | ||
| 86 | + LOGGER.info("参数2, 线路id={},线路名字={}", xlid, xlname); | ||
| 87 | + LOGGER.info("参数3, 时刻表id={},时刻表名字={}", ttid, ttname); | ||
| 88 | + | ||
| 89 | + LOGGER.info("转换xls文件格式成文本格式..."); | ||
| 90 | + // 1、修改已经上传的excel文件,在每个起点站后标示数字,表示第几个班次 | ||
| 91 | + // 2、由于格式问题,需要把内容都转换成字符串 | ||
| 92 | + List<String> colList = new ArrayList<>(); | ||
| 93 | + Workbook workbook = Workbook.getWorkbook(new File(filename)); | ||
| 94 | + Sheet sheet = workbook.getSheet(sheetname); | ||
| 95 | + Cell[] cells = sheet.getRow(0); | ||
| 96 | + for (int i = 0; i < cells.length; i++) { | ||
| 97 | + if (i == 0) { | ||
| 98 | + colList.add(cells[i].getContents().trim()); | ||
| 99 | + } else { | ||
| 100 | + colList.add(cells[i].getContents() + i); | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + File fileCal = new File(filename + "_stringType.xls"); | ||
| 105 | + WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal, workbook); | ||
| 106 | + WritableSheet sheet1 = writableWorkbook.getSheet(sheetname); | ||
| 107 | + for (int i = 0; i < sheet1.getColumns(); i++) { // 第一行数据 | ||
| 108 | + sheet1.addCell(new Label(i, 0, colList.get(i))); | ||
| 109 | + } | ||
| 110 | + for (int i = 1; i < sheet1.getRows(); i++) { // 第二行开始 | ||
| 111 | + Cell[] cells1 = sheet.getRow(i); | ||
| 112 | + for (int j = 0; j < cells1.length; j++) { | ||
| 113 | + sheet1.addCell(new Label(j, i, cells1[j].getContents())); | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + writableWorkbook.write(); | ||
| 117 | + writableWorkbook.close(); | ||
| 118 | + | ||
| 119 | + // 2、删除原有数据 | ||
| 120 | + // 操作在ktr内部执行 | ||
| 121 | + | ||
| 122 | + // 3、导入时刻表 | ||
| 123 | + | ||
| 124 | + // 计算表头参数 | ||
| 125 | + Workbook book = Workbook.getWorkbook(fileCal); | ||
| 126 | + Sheet sheet_exp = book.getSheet(sheetname); | ||
| 127 | + List<String> columnames = new ArrayList<>(); | ||
| 128 | + for (int i = 0; i < sheet_exp.getColumns(); i++) { // 获取第一行,数据,作为列名 | ||
| 129 | + columnames.add(sheet_exp.getCell(i, 0).getContents()); | ||
| 130 | + } | ||
| 131 | + LOGGER.info("表头={}", StringUtils.join(columnames.toArray(), ",")); | ||
| 132 | + | ||
| 133 | + // 创建ktr转换所需参数 | ||
| 134 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 135 | + File ktrFile = new File(this.getClass().getResource( | ||
| 136 | + dataToolsProperties.getTtinfodetailMetadatainputktr()).toURI()); | ||
| 137 | +// File ktrFile2 = new File(this.getClass().getResource( | ||
| 138 | +// dataToolsProperties.getTtinfodetailDatainputktr()).toURI()); | ||
| 139 | + File ktrFile2 = new File(this.getClass().getResource( | ||
| 140 | + dataToolsProperties.getTtinfodetailDatainputktr2()).toURI()); | ||
| 141 | + | ||
| 142 | + // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 143 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 144 | + ktrParms.put("filepath", fileCal.getAbsolutePath()); | ||
| 145 | + ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 146 | + | ||
| 147 | + // 附加参数 | ||
| 148 | + ktrParms.put("injectktrfile", ktrFile2.getAbsolutePath()); // 注入元数据的ktr文件 | ||
| 149 | + ktrParms.put("sheetname", sheetname); // sheet工作区的名字 | ||
| 150 | + ktrParms.put("lineinfoid", lineid); // 线路标准id | ||
| 151 | + ktrParms.put("xlname", xlname); // 线路名称 | ||
| 152 | + ktrParms.put("ttinfoname", ttname); // 时刻表名称 | ||
| 153 | + ktrParms.put("ttid", ttid.intValue()); // 时刻表id | ||
| 154 | + ktrParms.put("excelfieldnames", StringUtils.join(columnames.toArray(), ",")); // 时刻表excel输入字段名,以逗号连接 | ||
| 155 | + columnames.remove(0); | ||
| 156 | + ktrParms.put("normalizefieldnames", StringUtils.join(columnames.toArray(), ",")); // 数据范式化字段名,以逗号连接 | ||
| 157 | + | ||
| 158 | + dataToolsService.importData(fileCal, ktrParms); | ||
| 159 | + | ||
| 160 | + LOGGER.info("//---------------- 导入时刻表明细 success... ----------------//"); | ||
| 161 | + } catch (Exception exp) { | ||
| 162 | + LOGGER.info("//---------------- 导入时刻表明细 failed... ----------------//"); | ||
| 163 | + | ||
| 164 | + StringWriter sw = new StringWriter(); | ||
| 165 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 166 | + LOGGER.info(sw.toString()); | ||
| 167 | + | ||
| 168 | + throw new ScheduleException(exp.getMessage()); | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + @Override | ||
| 173 | + public File exportData(Map<String, Object> params) throws ScheduleException { | ||
| 174 | + try { | ||
| 175 | + LOGGER.info("//---------------- 导出时刻表明细 start... ----------------//"); | ||
| 176 | + | ||
| 177 | + // 创建ktr转换所需参数 | ||
| 178 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 179 | + File ktrFile = new File(this.getClass().getResource( | ||
| 180 | + dataToolsProperties.getTtinfodetailMetaoutput()).toURI()); | ||
| 181 | + File ktrFile2 = new File(this.getClass().getResource( | ||
| 182 | + dataToolsProperties.getTtinfodetailOutput()).toURI()); | ||
| 183 | + | ||
| 184 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 185 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 186 | + ktrParms.put("filename", String.format("时刻表_(id=%s)_download-", String.valueOf(params.get("ttinfoid")))); | ||
| 187 | + | ||
| 188 | + // 附加参数 | ||
| 189 | + ktrParms.put("injectktrfile", ktrFile2.getAbsolutePath()); // 注入元数据的ktr文件 | ||
| 190 | + ktrParms.put("ttinfoid", String.valueOf(params.get("ttinfoid"))); | ||
| 191 | + | ||
| 192 | + File file = dataToolsService.exportData(ktrParms); | ||
| 193 | + | ||
| 194 | + LOGGER.info("//---------------- 导出时刻表明细 success... ----------------//"); | ||
| 195 | + | ||
| 196 | + return file; | ||
| 197 | + } catch (Exception exp) { | ||
| 198 | + LOGGER.info("//---------------- 导出时刻表明细 failed... ----------------//"); | ||
| 199 | + | ||
| 200 | + StringWriter sw = new StringWriter(); | ||
| 201 | + exp.printStackTrace(new PrintWriter(sw)); | ||
| 202 | + LOGGER.info(sw.toString()); | ||
| 203 | + | ||
| 204 | + throw new ScheduleException(exp.getMessage()); | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + @Override | ||
| 209 | + public File exportDataForEdit(Integer xlid, Long ttid) throws ScheduleException { | ||
| 210 | + try { | ||
| 211 | + // 创建ktr转换所需参数 | ||
| 212 | + Map<String, Object> ktrParms = new HashMap<>(); | ||
| 213 | + File ktrFile = new File(this.getClass().getResource( | ||
| 214 | + dataToolsProperties.getTtinfodetailForeditktr()).toURI()); | ||
| 215 | + | ||
| 216 | + // 通用参数,转换文件路径,excel输出文件名,错误输出文件路径 | ||
| 217 | + ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 218 | + ktrParms.put("filename", "todo"); | ||
| 219 | + | ||
| 220 | + // 附加参数 | ||
| 221 | + String outputFilePath = String.format("ttinfodetail_(id=%s)_foredit-%s", | ||
| 222 | + String.valueOf(ttid), new DateTime().toString("yyyyMMddHHmmss")); | ||
| 223 | + | ||
| 224 | + ktrParms.put("tempfilepath", dataToolsProperties.getTransTempdir() + File.separator + outputFilePath); // 数据输出文件路径 | ||
| 225 | + ktrParms.put("xlid", String.valueOf(xlid)); | ||
| 226 | + ktrParms.put("ttid", String.valueOf(ttid)); | ||
| 227 | + | ||
| 228 | + return dataToolsService.exportData(ktrParms); | ||
| 229 | + } catch (Exception exp) { | ||
| 230 | + throw new ScheduleException(exp); | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | +} |
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailForEdit.java
| 1 | -package com.bsth.service.schedule.datatools; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * Created by xu on 17/5/16. | ||
| 5 | - */ | ||
| 6 | -public interface TTInfoDetailForEdit { | ||
| 7 | -} | 1 | +package com.bsth.service.schedule.datatools; |
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 4 | + | ||
| 5 | +import java.io.File; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Created by xu on 17/5/16. | ||
| 9 | + */ | ||
| 10 | +public interface TTInfoDetailForEdit { | ||
| 11 | + File exportDataForEdit(Integer xlid, Long ttid) throws ScheduleException; | ||
| 12 | +} |
src/main/java/com/bsth/service/schedule/impl/BServiceImpl.java
| @@ -5,12 +5,6 @@ import com.bsth.repository.BaseRepository; | @@ -5,12 +5,6 @@ import com.bsth.repository.BaseRepository; | ||
| 5 | import com.bsth.service.schedule.BService; | 5 | import com.bsth.service.schedule.BService; |
| 6 | import com.bsth.service.schedule.exception.ScheduleException; | 6 | import com.bsth.service.schedule.exception.ScheduleException; |
| 7 | import com.bsth.service.schedule.utils.DataToolsService; | 7 | import com.bsth.service.schedule.utils.DataToolsService; |
| 8 | -import jxl.Cell; | ||
| 9 | -import jxl.Sheet; | ||
| 10 | -import jxl.Workbook; | ||
| 11 | -import jxl.write.Label; | ||
| 12 | -import jxl.write.WritableSheet; | ||
| 13 | -import jxl.write.WritableWorkbook; | ||
| 14 | import org.slf4j.Logger; | 8 | import org.slf4j.Logger; |
| 15 | import org.slf4j.LoggerFactory; | 9 | import org.slf4j.LoggerFactory; |
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -124,39 +118,16 @@ public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> | @@ -124,39 +118,16 @@ public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> | ||
| 124 | 118 | ||
| 125 | @Override | 119 | @Override |
| 126 | public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | 120 | public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 127 | - try { | ||
| 128 | - // 对上传的excel文件做处理,将第一个sheet名字设定为工作表1 | ||
| 129 | - File file = dataToolsService.uploadFile(filename, filedata); | ||
| 130 | - Workbook workbook = Workbook.getWorkbook(file); | ||
| 131 | - Sheet sheet = workbook.getSheet(0); | ||
| 132 | - | ||
| 133 | - File fileCal = new File(file.getAbsolutePath() + "_sheetChange.xls"); | ||
| 134 | - WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal); | ||
| 135 | - WritableSheet writableSheet = writableWorkbook.createSheet("工作表1", 0); | ||
| 136 | - for (int i = 0; i < sheet.getRows(); i++) { | ||
| 137 | - Cell[] cells = sheet.getRow(i); | ||
| 138 | - for (int j = 0; j < cells.length; j++) { | ||
| 139 | - writableSheet.addCell(new Label(j, i, cells[j].getContents())); | ||
| 140 | - } | ||
| 141 | - } | ||
| 142 | - writableWorkbook.write(); | ||
| 143 | - writableWorkbook.close(); | ||
| 144 | - | ||
| 145 | - return fileCal; | ||
| 146 | - | ||
| 147 | - } catch (Exception exp) { | ||
| 148 | - throw new ScheduleException(exp); | ||
| 149 | - } | ||
| 150 | - | 121 | + throw new ScheduleException("子类自己复写此方法!"); |
| 151 | } | 122 | } |
| 152 | 123 | ||
| 153 | @Override | 124 | @Override |
| 154 | public void importData(File file, Map<String, Object> params) throws ScheduleException { | 125 | public void importData(File file, Map<String, Object> params) throws ScheduleException { |
| 155 | - dataToolsService.importData(file, params); | 126 | + throw new ScheduleException("子类自己复写此方法!"); |
| 156 | } | 127 | } |
| 157 | 128 | ||
| 158 | @Override | 129 | @Override |
| 159 | public File exportData(Map<String, Object> params) throws ScheduleException { | 130 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 160 | - return dataToolsService.exportData(params); | 131 | + throw new ScheduleException("子类自己复写此方法!"); |
| 161 | } | 132 | } |
| 162 | } | 133 | } |
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
| @@ -3,20 +3,16 @@ package com.bsth.service.schedule.impl; | @@ -3,20 +3,16 @@ package com.bsth.service.schedule.impl; | ||
| 3 | import com.bsth.entity.schedule.CarConfigInfo; | 3 | import com.bsth.entity.schedule.CarConfigInfo; |
| 4 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | 4 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 5 | import com.bsth.service.schedule.CarConfigInfoService; | 5 | import com.bsth.service.schedule.CarConfigInfoService; |
| 6 | -import com.bsth.service.schedule.exception.ScheduleException; | ||
| 7 | import com.bsth.service.schedule.ScheduleRule1FlatService; | 6 | import com.bsth.service.schedule.ScheduleRule1FlatService; |
| 8 | -import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 9 | -import org.slf4j.Logger; | ||
| 10 | -import org.slf4j.LoggerFactory; | 7 | +import com.bsth.service.schedule.exception.ScheduleException; |
| 8 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | 10 | +import org.springframework.beans.factory.annotation.Qualifier; |
| 13 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 14 | import org.springframework.transaction.annotation.Transactional; | 12 | import org.springframework.transaction.annotation.Transactional; |
| 15 | import org.springframework.util.CollectionUtils; | 13 | import org.springframework.util.CollectionUtils; |
| 16 | 14 | ||
| 17 | import java.io.File; | 15 | import java.io.File; |
| 18 | -import java.io.PrintWriter; | ||
| 19 | -import java.io.StringWriter; | ||
| 20 | import java.util.HashMap; | 16 | import java.util.HashMap; |
| 21 | import java.util.List; | 17 | import java.util.List; |
| 22 | import java.util.Map; | 18 | import java.util.Map; |
| @@ -24,78 +20,28 @@ import java.util.Map; | @@ -24,78 +20,28 @@ import java.util.Map; | ||
| 24 | /** | 20 | /** |
| 25 | * Created by xu on 16/5/9. | 21 | * Created by xu on 16/5/9. |
| 26 | */ | 22 | */ |
| 27 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 28 | @Service | 23 | @Service |
| 29 | public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService { | 24 | public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService { |
| 30 | - /** 日志记录器 */ | ||
| 31 | - private static Logger LOGGER = LoggerFactory.getLogger(CarConfigInfoServiceImpl.class); | ||
| 32 | - | ||
| 33 | @Autowired | 25 | @Autowired |
| 34 | - private DataToolsProperties dataToolsProperties; | 26 | + private ScheduleRule1FlatService scheduleRule1FlatService; |
| 35 | 27 | ||
| 36 | @Autowired | 28 | @Autowired |
| 37 | - private ScheduleRule1FlatService scheduleRule1FlatService; | 29 | + @Qualifier(value = "carConfig_dataTool") |
| 30 | + private DataToolsService dataToolsService; | ||
| 38 | 31 | ||
| 39 | @Override | 32 | @Override |
| 40 | - public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 41 | - try { | ||
| 42 | - LOGGER.info("//---------------- 导入车辆配置信息 start... ----------------//"); | ||
| 43 | - // 创建ktr转换所需参数 | ||
| 44 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 45 | - File ktrFile = new File(this.getClass().getResource( | ||
| 46 | - dataToolsProperties.getCarsconfigDatainputktr()).toURI()); | ||
| 47 | - | ||
| 48 | - // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 49 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 50 | - ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 51 | - ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 52 | - | ||
| 53 | - ktrParms.putAll(params); | ||
| 54 | - | ||
| 55 | - super.importData(file, ktrParms); | ||
| 56 | - | ||
| 57 | - LOGGER.info("//---------------- 导入车辆配置信息 success... ----------------//"); | ||
| 58 | - } catch (Exception exp) { | ||
| 59 | - LOGGER.info("//---------------- 导入车辆配置信息 failed... ----------------//"); | ||
| 60 | - | ||
| 61 | - StringWriter sw = new StringWriter(); | ||
| 62 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 63 | - LOGGER.info(sw.toString()); | 33 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 34 | + return dataToolsService.uploadFile(filename, filedata); | ||
| 35 | + } | ||
| 64 | 36 | ||
| 65 | - throw new ScheduleException(exp.getMessage()); | ||
| 66 | - } | 37 | + @Override |
| 38 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 39 | + dataToolsService.importData(file, params); | ||
| 67 | } | 40 | } |
| 68 | 41 | ||
| 69 | @Override | 42 | @Override |
| 70 | public File exportData(Map<String, Object> params) throws ScheduleException { | 43 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 71 | - try { | ||
| 72 | - LOGGER.info("//---------------- 导出车辆配置信息 start... ----------------//"); | ||
| 73 | - // 创建ktr转换所需参数 | ||
| 74 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 75 | - File ktrFile = new File(this.getClass().getResource( | ||
| 76 | - dataToolsProperties.getCarsconfigDataoutputktr()).toURI()); | ||
| 77 | - | ||
| 78 | - // 通用参数,转换文件路径,excel输出文件名 | ||
| 79 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 80 | - ktrParms.put("filename", "车辆配置信息_download-"); | ||
| 81 | - | ||
| 82 | - ktrParms.putAll(params); | ||
| 83 | - | ||
| 84 | - File file = super.exportData(ktrParms); | ||
| 85 | - | ||
| 86 | - LOGGER.info("//---------------- 导出车辆配置信息 success... ----------------//"); | ||
| 87 | - | ||
| 88 | - return file; | ||
| 89 | - | ||
| 90 | - } catch (Exception exp) { | ||
| 91 | - LOGGER.info("//---------------- 导出车辆配置信息 failed... ----------------//"); | ||
| 92 | - | ||
| 93 | - StringWriter sw = new StringWriter(); | ||
| 94 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 95 | - LOGGER.info(sw.toString()); | ||
| 96 | - | ||
| 97 | - throw new ScheduleException(exp.getMessage()); | ||
| 98 | - } | 44 | + return dataToolsService.exportData(params); |
| 99 | } | 45 | } |
| 100 | 46 | ||
| 101 | @Transactional | 47 | @Transactional |
src/main/java/com/bsth/service/schedule/impl/CarsServiceImpl.java
| @@ -3,89 +3,39 @@ package com.bsth.service.schedule.impl; | @@ -3,89 +3,39 @@ package com.bsth.service.schedule.impl; | ||
| 3 | import com.bsth.entity.Cars; | 3 | import com.bsth.entity.Cars; |
| 4 | import com.bsth.service.schedule.CarsService; | 4 | import com.bsth.service.schedule.CarsService; |
| 5 | import com.bsth.service.schedule.exception.ScheduleException; | 5 | import com.bsth.service.schedule.exception.ScheduleException; |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 7 | -import org.slf4j.Logger; | ||
| 8 | -import org.slf4j.LoggerFactory; | 6 | +import com.bsth.service.schedule.utils.DataToolsService; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | 8 | +import org.springframework.beans.factory.annotation.Qualifier; |
| 11 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 12 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 13 | import org.springframework.util.CollectionUtils; | 11 | import org.springframework.util.CollectionUtils; |
| 14 | 12 | ||
| 15 | import java.io.File; | 13 | import java.io.File; |
| 16 | -import java.io.PrintWriter; | ||
| 17 | -import java.io.StringWriter; | ||
| 18 | import java.util.HashMap; | 14 | import java.util.HashMap; |
| 19 | import java.util.Map; | 15 | import java.util.Map; |
| 20 | 16 | ||
| 21 | /** | 17 | /** |
| 22 | * Created by xu on 16/12/8. | 18 | * Created by xu on 16/12/8. |
| 23 | */ | 19 | */ |
| 24 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 25 | @Service(value = "carsServiceImpl_sc") | 20 | @Service(value = "carsServiceImpl_sc") |
| 26 | public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService { | 21 | public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService { |
| 27 | - /** 日志记录器 */ | ||
| 28 | - private static final Logger LOGGER = LoggerFactory.getLogger(CarsServiceImpl.class); | ||
| 29 | - | ||
| 30 | @Autowired | 22 | @Autowired |
| 31 | - private DataToolsProperties dataToolsProperties; | 23 | + @Qualifier(value = "cars_dataTool") |
| 24 | + private DataToolsService dataToolsService; | ||
| 32 | 25 | ||
| 33 | @Override | 26 | @Override |
| 34 | public void importData(File file, Map<String, Object> params) throws ScheduleException { | 27 | public void importData(File file, Map<String, Object> params) throws ScheduleException { |
| 35 | - try { | ||
| 36 | - LOGGER.info("//---------------- 导入车辆基础信息 start... ----------------//"); | ||
| 37 | - // 创建ktr转换所需参数 | ||
| 38 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 39 | - File ktrFile = new File(this.getClass().getResource( | ||
| 40 | - dataToolsProperties.getCarsDatainputktr()).toURI()); | ||
| 41 | - | ||
| 42 | - // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 43 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 44 | - ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 45 | - ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 46 | - | ||
| 47 | - super.importData(file, ktrParms); | ||
| 48 | - | ||
| 49 | - LOGGER.info("//---------------- 导入车辆基础信息 success... ----------------//"); | ||
| 50 | - } catch (Exception exp) { | ||
| 51 | - LOGGER.info("//---------------- 导入车辆基础信息 failed... ----------------//"); | ||
| 52 | - | ||
| 53 | - StringWriter sw = new StringWriter(); | ||
| 54 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 55 | - LOGGER.info(sw.toString()); | ||
| 56 | - | ||
| 57 | - throw new ScheduleException(exp.getMessage()); | ||
| 58 | - } | 28 | + dataToolsService.importData(file, params); |
| 59 | } | 29 | } |
| 60 | 30 | ||
| 61 | @Override | 31 | @Override |
| 62 | public File exportData(Map<String, Object> params) throws ScheduleException { | 32 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 63 | - try { | ||
| 64 | - LOGGER.info("//---------------- 导出车辆基础信息 start... ----------------//"); | ||
| 65 | - // 创建ktr转换所需参数 | ||
| 66 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 67 | - File ktrFile = new File(this.getClass().getResource( | ||
| 68 | - dataToolsProperties.getCarsDataoutputktr()).toURI()); | ||
| 69 | - | ||
| 70 | - // 通用参数,转换文件路径,excel输出文件名 | ||
| 71 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 72 | - ktrParms.put("filename", "车辆基础信息_download-"); | ||
| 73 | - | ||
| 74 | - File file = super.exportData(ktrParms); | ||
| 75 | - | ||
| 76 | - LOGGER.info("//---------------- 导出车辆基础信息 success... ----------------//"); | ||
| 77 | - | ||
| 78 | - return file; | ||
| 79 | - | ||
| 80 | - } catch (Exception exp) { | ||
| 81 | - LOGGER.info("//---------------- 导出车辆基础信息 failed... ----------------//"); | ||
| 82 | - | ||
| 83 | - StringWriter sw = new StringWriter(); | ||
| 84 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 85 | - LOGGER.info(sw.toString()); | 33 | + return dataToolsService.exportData(params); |
| 34 | + } | ||
| 86 | 35 | ||
| 87 | - throw new ScheduleException(exp.getMessage()); | ||
| 88 | - } | 36 | + @Override |
| 37 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | ||
| 38 | + return dataToolsService.uploadFile(filename, filedata); | ||
| 89 | } | 39 | } |
| 90 | 40 | ||
| 91 | @Override | 41 | @Override |
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
| @@ -3,97 +3,43 @@ package com.bsth.service.schedule.impl; | @@ -3,97 +3,43 @@ package com.bsth.service.schedule.impl; | ||
| 3 | import com.bsth.entity.schedule.EmployeeConfigInfo; | 3 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| 4 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | 4 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 5 | import com.bsth.service.schedule.EmployeeConfigInfoService; | 5 | import com.bsth.service.schedule.EmployeeConfigInfoService; |
| 6 | -import com.bsth.service.schedule.exception.ScheduleException; | ||
| 7 | import com.bsth.service.schedule.ScheduleRule1FlatService; | 6 | import com.bsth.service.schedule.ScheduleRule1FlatService; |
| 8 | -import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 9 | -import org.slf4j.Logger; | ||
| 10 | -import org.slf4j.LoggerFactory; | 7 | +import com.bsth.service.schedule.exception.ScheduleException; |
| 8 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | 10 | +import org.springframework.beans.factory.annotation.Qualifier; |
| 13 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 14 | import org.springframework.transaction.annotation.Transactional; | 12 | import org.springframework.transaction.annotation.Transactional; |
| 15 | import org.springframework.util.CollectionUtils; | 13 | import org.springframework.util.CollectionUtils; |
| 16 | 14 | ||
| 17 | import java.io.File; | 15 | import java.io.File; |
| 18 | -import java.io.PrintWriter; | ||
| 19 | -import java.io.StringWriter; | ||
| 20 | import java.util.*; | 16 | import java.util.*; |
| 21 | 17 | ||
| 22 | /** | 18 | /** |
| 23 | * Created by xu on 16/5/10. | 19 | * Created by xu on 16/5/10. |
| 24 | */ | 20 | */ |
| 25 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 26 | @Service | 21 | @Service |
| 27 | public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService { | 22 | public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService { |
| 28 | - /** 日志记录器 */ | ||
| 29 | - private static Logger LOGGER = LoggerFactory.getLogger(EmployeeConfigInfoServiceImpl.class); | ||
| 30 | - | ||
| 31 | @Autowired | 23 | @Autowired |
| 32 | - private DataToolsProperties dataToolsProperties; | 24 | + private ScheduleRule1FlatService scheduleRule1FlatService; |
| 33 | 25 | ||
| 34 | @Autowired | 26 | @Autowired |
| 35 | - private ScheduleRule1FlatService scheduleRule1FlatService; | 27 | + @Qualifier(value = "employeeConfig_dataTool") |
| 28 | + private DataToolsService dataToolsService; | ||
| 36 | 29 | ||
| 37 | @Override | 30 | @Override |
| 38 | - public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 39 | - try { | ||
| 40 | - LOGGER.info("//---------------- 导入人员配置信息 start... ----------------//"); | ||
| 41 | - // 创建ktr转换所需参数 | ||
| 42 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 43 | - File ktrFile = new File(this.getClass().getResource( | ||
| 44 | - dataToolsProperties.getEmployeesconfigDatainputktr()).toURI()); | ||
| 45 | - | ||
| 46 | - // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 47 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 48 | - ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 49 | - ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 50 | - | ||
| 51 | - ktrParms.putAll(params); | ||
| 52 | - | ||
| 53 | - super.importData(file, ktrParms); | ||
| 54 | - | ||
| 55 | - LOGGER.info("//---------------- 导入人员配置信息 success... ----------------//"); | ||
| 56 | - } catch (Exception exp) { | ||
| 57 | - LOGGER.info("//---------------- 导入人员配置信息 failed... ----------------//"); | ||
| 58 | - | ||
| 59 | - StringWriter sw = new StringWriter(); | ||
| 60 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 61 | - LOGGER.info(sw.toString()); | 31 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 32 | + return dataToolsService.uploadFile(filename, filedata); | ||
| 33 | + } | ||
| 62 | 34 | ||
| 63 | - throw new ScheduleException(exp.getMessage()); | ||
| 64 | - } | 35 | + @Override |
| 36 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 37 | + dataToolsService.importData(file, params); | ||
| 65 | } | 38 | } |
| 66 | 39 | ||
| 67 | @Override | 40 | @Override |
| 68 | public File exportData(Map<String, Object> params) throws ScheduleException { | 41 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 69 | - try { | ||
| 70 | - LOGGER.info("//---------------- 导出人员配置信息 start... ----------------//"); | ||
| 71 | - // 创建ktr转换所需参数 | ||
| 72 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 73 | - File ktrFile = new File(this.getClass().getResource( | ||
| 74 | - dataToolsProperties.getEmployeesconfigDataoutputktr()).toURI()); | ||
| 75 | - | ||
| 76 | - // 通用参数,转换文件路径,excel输出文件名 | ||
| 77 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 78 | - ktrParms.put("filename", "人员配置信息_download-"); | ||
| 79 | - | ||
| 80 | - ktrParms.putAll(params); | ||
| 81 | - | ||
| 82 | - File file = super.exportData(ktrParms); | ||
| 83 | - | ||
| 84 | - LOGGER.info("//---------------- 导出人员配置信息 success... ----------------//"); | ||
| 85 | - | ||
| 86 | - return file; | ||
| 87 | - | ||
| 88 | - } catch (Exception exp) { | ||
| 89 | - LOGGER.info("//---------------- 导出人员配置信息 failed... ----------------//"); | ||
| 90 | - | ||
| 91 | - StringWriter sw = new StringWriter(); | ||
| 92 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 93 | - LOGGER.info(sw.toString()); | ||
| 94 | - | ||
| 95 | - throw new ScheduleException(exp.getMessage()); | ||
| 96 | - } | 42 | + return dataToolsService.exportData(params); |
| 97 | } | 43 | } |
| 98 | 44 | ||
| 99 | @Transactional | 45 | @Transactional |
src/main/java/com/bsth/service/schedule/impl/EmployeeServiceImpl.java
| @@ -3,89 +3,39 @@ package com.bsth.service.schedule.impl; | @@ -3,89 +3,39 @@ package com.bsth.service.schedule.impl; | ||
| 3 | import com.bsth.entity.Personnel; | 3 | import com.bsth.entity.Personnel; |
| 4 | import com.bsth.service.schedule.EmployeeService; | 4 | import com.bsth.service.schedule.EmployeeService; |
| 5 | import com.bsth.service.schedule.exception.ScheduleException; | 5 | import com.bsth.service.schedule.exception.ScheduleException; |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 7 | -import org.slf4j.Logger; | ||
| 8 | -import org.slf4j.LoggerFactory; | 6 | +import com.bsth.service.schedule.utils.DataToolsService; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | 8 | +import org.springframework.beans.factory.annotation.Qualifier; |
| 11 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 12 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 13 | import org.springframework.util.CollectionUtils; | 11 | import org.springframework.util.CollectionUtils; |
| 14 | 12 | ||
| 15 | import java.io.File; | 13 | import java.io.File; |
| 16 | -import java.io.PrintWriter; | ||
| 17 | -import java.io.StringWriter; | ||
| 18 | import java.util.HashMap; | 14 | import java.util.HashMap; |
| 19 | import java.util.Map; | 15 | import java.util.Map; |
| 20 | 16 | ||
| 21 | /** | 17 | /** |
| 22 | * Created by xu on 16/12/15. | 18 | * Created by xu on 16/12/15. |
| 23 | */ | 19 | */ |
| 24 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 25 | @Service | 20 | @Service |
| 26 | public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService { | 21 | public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService { |
| 27 | - /** 日志记录器 */ | ||
| 28 | - private static final Logger LOGGER = LoggerFactory.getLogger(EmployeeServiceImpl.class); | ||
| 29 | - | ||
| 30 | @Autowired | 22 | @Autowired |
| 31 | - private DataToolsProperties dataToolsProperties; | 23 | + @Qualifier(value = "employee_dataTool") |
| 24 | + private DataToolsService dataToolsService; | ||
| 32 | 25 | ||
| 33 | @Override | 26 | @Override |
| 34 | - public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 35 | - try { | ||
| 36 | - LOGGER.info("//---------------- 导入人员基础信息 start... ----------------//"); | ||
| 37 | - // 创建ktr转换所需参数 | ||
| 38 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 39 | - File ktrFile = new File(this.getClass().getResource( | ||
| 40 | - dataToolsProperties.getEmployeesDatainputktr()).toURI()); | ||
| 41 | - | ||
| 42 | - // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 43 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 44 | - ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 45 | - ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 46 | - | ||
| 47 | - super.importData(file, ktrParms); | ||
| 48 | - | ||
| 49 | - LOGGER.info("//---------------- 导入人员基础信息 success... ----------------//"); | ||
| 50 | - } catch (Exception exp) { | ||
| 51 | - LOGGER.info("//---------------- 导入人员基础信息 failed... ----------------//"); | ||
| 52 | - | ||
| 53 | - StringWriter sw = new StringWriter(); | ||
| 54 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 55 | - LOGGER.info(sw.toString()); | 27 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 28 | + return dataToolsService.uploadFile(filename, filedata); | ||
| 29 | + } | ||
| 56 | 30 | ||
| 57 | - throw new ScheduleException(exp.getMessage()); | ||
| 58 | - } | 31 | + @Override |
| 32 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 33 | + dataToolsService.importData(file, params); | ||
| 59 | } | 34 | } |
| 60 | 35 | ||
| 61 | @Override | 36 | @Override |
| 62 | public File exportData(Map<String, Object> params) throws ScheduleException { | 37 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 63 | - try { | ||
| 64 | - LOGGER.info("//---------------- 导出人员基础信息 start... ----------------//"); | ||
| 65 | - // 创建ktr转换所需参数 | ||
| 66 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 67 | - File ktrFile = new File(this.getClass().getResource( | ||
| 68 | - dataToolsProperties.getEmployeesDataoutputktr()).toURI()); | ||
| 69 | - | ||
| 70 | - // 通用参数,转换文件路径,excel输出文件名 | ||
| 71 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 72 | - ktrParms.put("filename", "人员基础信息_download-"); | ||
| 73 | - | ||
| 74 | - File file = super.exportData(ktrParms); | ||
| 75 | - | ||
| 76 | - LOGGER.info("//---------------- 导出人员基础信息 success... ----------------//"); | ||
| 77 | - | ||
| 78 | - return file; | ||
| 79 | - | ||
| 80 | - } catch (Exception exp) { | ||
| 81 | - LOGGER.info("//---------------- 导出人员基础信息 failed... ----------------//"); | ||
| 82 | - | ||
| 83 | - StringWriter sw = new StringWriter(); | ||
| 84 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 85 | - LOGGER.info(sw.toString()); | ||
| 86 | - | ||
| 87 | - throw new ScheduleException(exp.getMessage()); | ||
| 88 | - } | 38 | + return dataToolsService.exportData(params); |
| 89 | } | 39 | } |
| 90 | 40 | ||
| 91 | @Override | 41 | @Override |
src/main/java/com/bsth/service/schedule/impl/GuideboardInfoServiceImpl.java
| @@ -5,18 +5,14 @@ import com.bsth.entity.schedule.TTInfoDetail; | @@ -5,18 +5,14 @@ import com.bsth.entity.schedule.TTInfoDetail; | ||
| 5 | import com.bsth.service.schedule.GuideboardInfoService; | 5 | import com.bsth.service.schedule.GuideboardInfoService; |
| 6 | import com.bsth.service.schedule.TTInfoDetailService; | 6 | import com.bsth.service.schedule.TTInfoDetailService; |
| 7 | import com.bsth.service.schedule.exception.ScheduleException; | 7 | import com.bsth.service.schedule.exception.ScheduleException; |
| 8 | -import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 9 | -import org.slf4j.Logger; | ||
| 10 | -import org.slf4j.LoggerFactory; | 8 | +import com.bsth.service.schedule.utils.DataToolsService; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | 10 | +import org.springframework.beans.factory.annotation.Qualifier; |
| 13 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 14 | import org.springframework.util.CollectionUtils; | 12 | import org.springframework.util.CollectionUtils; |
| 15 | 13 | ||
| 16 | import javax.transaction.Transactional; | 14 | import javax.transaction.Transactional; |
| 17 | import java.io.File; | 15 | import java.io.File; |
| 18 | -import java.io.PrintWriter; | ||
| 19 | -import java.io.StringWriter; | ||
| 20 | import java.util.HashMap; | 16 | import java.util.HashMap; |
| 21 | import java.util.List; | 17 | import java.util.List; |
| 22 | import java.util.Map; | 18 | import java.util.Map; |
| @@ -24,14 +20,11 @@ import java.util.Map; | @@ -24,14 +20,11 @@ import java.util.Map; | ||
| 24 | /** | 20 | /** |
| 25 | * 路牌信息服务。 | 21 | * 路牌信息服务。 |
| 26 | */ | 22 | */ |
| 27 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 28 | @Service | 23 | @Service |
| 29 | public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService { | 24 | public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService { |
| 30 | - /** 日志记录器 */ | ||
| 31 | - private static final Logger LOGGER = LoggerFactory.getLogger(GuideboardInfoServiceImpl.class); | ||
| 32 | - | ||
| 33 | @Autowired | 25 | @Autowired |
| 34 | - private DataToolsProperties dataToolsProperties; | 26 | + @Qualifier(value = "gbInfo_dataTool") |
| 27 | + private DataToolsService dataToolsService; | ||
| 35 | 28 | ||
| 36 | @Autowired | 29 | @Autowired |
| 37 | private TTInfoDetailService ttInfoDetailService; | 30 | private TTInfoDetailService ttInfoDetailService; |
| @@ -109,65 +102,18 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | @@ -109,65 +102,18 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | ||
| 109 | } | 102 | } |
| 110 | 103 | ||
| 111 | @Override | 104 | @Override |
| 112 | - public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 113 | - try { | ||
| 114 | - LOGGER.info("//---------------- 导入路牌信息 start... ----------------//"); | ||
| 115 | - // 创建ktr转换所需参数 | ||
| 116 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 117 | - File ktrFile = new File(this.getClass().getResource( | ||
| 118 | - dataToolsProperties.getGuideboardsDatainputktr()).toURI()); | ||
| 119 | - | ||
| 120 | - // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 121 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 122 | - ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 123 | - ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 124 | - | ||
| 125 | - ktrParms.putAll(params); | ||
| 126 | - | ||
| 127 | - super.importData(file, ktrParms); | ||
| 128 | - | ||
| 129 | - LOGGER.info("//---------------- 导入路牌信息 success... ----------------//"); | ||
| 130 | - } catch (Exception exp) { | ||
| 131 | - LOGGER.info("//---------------- 导入路牌信息 failed... ----------------//"); | ||
| 132 | - | ||
| 133 | - StringWriter sw = new StringWriter(); | ||
| 134 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 135 | - LOGGER.info(sw.toString()); | 105 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 106 | + return dataToolsService.uploadFile(filename, filedata); | ||
| 107 | + } | ||
| 136 | 108 | ||
| 137 | - throw new ScheduleException(exp.getMessage()); | ||
| 138 | - } | 109 | + @Override |
| 110 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 111 | + dataToolsService.importData(file, params); | ||
| 139 | } | 112 | } |
| 140 | 113 | ||
| 141 | @Override | 114 | @Override |
| 142 | public File exportData(Map<String, Object> params) throws ScheduleException { | 115 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 143 | - try { | ||
| 144 | - LOGGER.info("//---------------- 导出路牌信息 start... ----------------//"); | ||
| 145 | - // 创建ktr转换所需参数 | ||
| 146 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 147 | - File ktrFile = new File(this.getClass().getResource( | ||
| 148 | - dataToolsProperties.getGuideboardsDataoutputktr()).toURI()); | ||
| 149 | - | ||
| 150 | - // 通用参数,转换文件路径,excel输出文件名 | ||
| 151 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 152 | - ktrParms.put("filename", "路牌信息_download-"); | ||
| 153 | - | ||
| 154 | - ktrParms.putAll(params); | ||
| 155 | - | ||
| 156 | - File file = super.exportData(ktrParms); | ||
| 157 | - | ||
| 158 | - LOGGER.info("//---------------- 导出路牌信息 success... ----------------//"); | ||
| 159 | - | ||
| 160 | - return file; | ||
| 161 | - | ||
| 162 | - } catch (Exception exp) { | ||
| 163 | - LOGGER.info("//---------------- 导出路牌信息 failed... ----------------//"); | ||
| 164 | - | ||
| 165 | - StringWriter sw = new StringWriter(); | ||
| 166 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 167 | - LOGGER.info(sw.toString()); | ||
| 168 | - | ||
| 169 | - throw new ScheduleException(exp.getMessage()); | ||
| 170 | - } | 116 | + return dataToolsService.exportData(params); |
| 171 | } | 117 | } |
| 172 | 118 | ||
| 173 | } | 119 | } |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| @@ -404,7 +404,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -404,7 +404,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out") | 406 | if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out") |
| 407 | - && schedule.getFcsjActual() != null){ | 407 | + && !schedule.getBcType().equals("ldks") && schedule.getFcsjActual() != null){ |
| 408 | // String clZbh = schedule.getClZbh(); | 408 | // String clZbh = schedule.getClZbh(); |
| 409 | String xlDir = schedule.getXlDir(); | 409 | String xlDir = schedule.getXlDir(); |
| 410 | if(!listMap.containsKey(xlDir)) | 410 | if(!listMap.containsKey(xlDir)) |
| @@ -526,7 +526,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -526,7 +526,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 526 | // if(company.length() != 0){ | 526 | // if(company.length() != 0){ |
| 527 | sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'"; | 527 | sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'"; |
| 528 | // } | 528 | // } |
| 529 | - sql += " and bc_type != 'in' and bc_type != 'out'"; | 529 | + sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 530 | 530 | ||
| 531 | list = jdbcTemplate.query(sql, | 531 | list = jdbcTemplate.query(sql, |
| 532 | new RowMapper<ScheduleRealInfo>(){ | 532 | new RowMapper<ScheduleRealInfo>(){ |
| @@ -579,7 +579,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -579,7 +579,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 579 | 579 | ||
| 580 | if(model.length() != 0){ | 580 | if(model.length() != 0){ |
| 581 | // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'"; | 581 | // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'"; |
| 582 | - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'"; | 582 | + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 583 | 583 | ||
| 584 | ttList = jdbcTemplate.query(sql, | 584 | ttList = jdbcTemplate.query(sql, |
| 585 | new RowMapper<Long>(){ | 585 | new RowMapper<Long>(){ |
| @@ -807,7 +807,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -807,7 +807,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 807 | // if(company.length() != 0){ | 807 | // if(company.length() != 0){ |
| 808 | sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'"; | 808 | sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'"; |
| 809 | // } | 809 | // } |
| 810 | - sql += " and bc_type != 'in' and bc_type != 'out'"; | 810 | + sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 811 | 811 | ||
| 812 | list = jdbcTemplate.query(sql, | 812 | list = jdbcTemplate.query(sql, |
| 813 | new RowMapper<ScheduleRealInfo>(){ | 813 | new RowMapper<ScheduleRealInfo>(){ |
| @@ -1174,7 +1174,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1174,7 +1174,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1174 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); | 1174 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); |
| 1175 | 1175 | ||
| 1176 | for(ScheduleRealInfo schedule : list){ | 1176 | for(ScheduleRealInfo schedule : list){ |
| 1177 | - if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) | 1177 | + if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out") || schedule.getBcType().equals("ldks")) |
| 1178 | continue; | 1178 | continue; |
| 1179 | if(schedule.getStatus() == -1){ | 1179 | if(schedule.getStatus() == -1){ |
| 1180 | continue; | 1180 | continue; |
| @@ -1353,7 +1353,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1353,7 +1353,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1353 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); | 1353 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); |
| 1354 | 1354 | ||
| 1355 | for(ScheduleRealInfo schedule : list){ | 1355 | for(ScheduleRealInfo schedule : list){ |
| 1356 | - if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) | 1356 | + if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out") || schedule.getBcType().equals("ldks")) |
| 1357 | continue; | 1357 | continue; |
| 1358 | if(schedule.getStatus() == -1){ | 1358 | if(schedule.getStatus() == -1){ |
| 1359 | continue; | 1359 | continue; |
src/main/java/com/bsth/service/schedule/impl/ScheduleRule1FlatServiceImpl.java
| @@ -3,90 +3,35 @@ package com.bsth.service.schedule.impl; | @@ -3,90 +3,35 @@ package com.bsth.service.schedule.impl; | ||
| 3 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | 3 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 4 | import com.bsth.service.schedule.ScheduleRule1FlatService; | 4 | import com.bsth.service.schedule.ScheduleRule1FlatService; |
| 5 | import com.bsth.service.schedule.exception.ScheduleException; | 5 | import com.bsth.service.schedule.exception.ScheduleException; |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 7 | -import org.slf4j.Logger; | ||
| 8 | -import org.slf4j.LoggerFactory; | 6 | +import com.bsth.service.schedule.utils.DataToolsService; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | 8 | +import org.springframework.beans.factory.annotation.Qualifier; |
| 11 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 12 | 10 | ||
| 13 | import java.io.File; | 11 | import java.io.File; |
| 14 | -import java.io.PrintWriter; | ||
| 15 | -import java.io.StringWriter; | ||
| 16 | -import java.util.HashMap; | ||
| 17 | import java.util.Map; | 12 | import java.util.Map; |
| 18 | 13 | ||
| 19 | /** | 14 | /** |
| 20 | * Created by xu on 16/7/4. | 15 | * Created by xu on 16/7/4. |
| 21 | */ | 16 | */ |
| 22 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 23 | @Service | 17 | @Service |
| 24 | public class ScheduleRule1FlatServiceImpl extends BServiceImpl<ScheduleRule1Flat, Long> implements ScheduleRule1FlatService { | 18 | public class ScheduleRule1FlatServiceImpl extends BServiceImpl<ScheduleRule1Flat, Long> implements ScheduleRule1FlatService { |
| 25 | - /** 日志记录器 */ | ||
| 26 | - private static Logger LOGGER = LoggerFactory.getLogger(ScheduleRule1FlatServiceImpl.class); | ||
| 27 | - | ||
| 28 | @Autowired | 19 | @Autowired |
| 29 | - private DataToolsProperties dataToolsProperties; | 20 | + @Qualifier(value = "scheduleRule_dataTool") |
| 21 | + private DataToolsService dataToolsService; | ||
| 30 | 22 | ||
| 31 | @Override | 23 | @Override |
| 32 | - public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 33 | - try { | ||
| 34 | - LOGGER.info("//---------------- 导入排版规则信息 start... ----------------//"); | ||
| 35 | - // 创建ktr转换所需参数 | ||
| 36 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 37 | - File ktrFile = new File(this.getClass().getResource( | ||
| 38 | - dataToolsProperties.getScheduleruleDatainputktr()).toURI()); | ||
| 39 | - | ||
| 40 | - // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 41 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 42 | - ktrParms.put("filepath", file.getAbsolutePath()); | ||
| 43 | - ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 44 | - | ||
| 45 | - ktrParms.putAll(params); | ||
| 46 | - | ||
| 47 | - super.importData(file, ktrParms); | ||
| 48 | - | ||
| 49 | - LOGGER.info("//---------------- 导入排版规则信息 success... ----------------//"); | ||
| 50 | - } catch (Exception exp) { | ||
| 51 | - LOGGER.info("//---------------- 导入排版规则信息 failed... ----------------//"); | ||
| 52 | - | ||
| 53 | - StringWriter sw = new StringWriter(); | ||
| 54 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 55 | - LOGGER.info(sw.toString()); | 24 | + public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 25 | + return dataToolsService.uploadFile(filename, filedata); | ||
| 26 | + } | ||
| 56 | 27 | ||
| 57 | - throw new ScheduleException(exp.getMessage()); | ||
| 58 | - } | 28 | + @Override |
| 29 | + public void importData(File file, Map<String, Object> params) throws ScheduleException { | ||
| 30 | + dataToolsService.importData(file, params); | ||
| 59 | } | 31 | } |
| 60 | 32 | ||
| 61 | @Override | 33 | @Override |
| 62 | public File exportData(Map<String, Object> params) throws ScheduleException { | 34 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 63 | - try { | ||
| 64 | - LOGGER.info("//---------------- 导出排版规则信息 start... ----------------//"); | ||
| 65 | - // 创建ktr转换所需参数 | ||
| 66 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 67 | - File ktrFile = new File(this.getClass().getResource( | ||
| 68 | - dataToolsProperties.getScheduleruleOutput()).toURI()); | ||
| 69 | - | ||
| 70 | - // 通用参数,转换文件路径,excel输出文件名 | ||
| 71 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 72 | - ktrParms.put("filename", "排版规则信息_download-"); | ||
| 73 | - | ||
| 74 | - ktrParms.putAll(params); | ||
| 75 | - | ||
| 76 | - File file = super.exportData(ktrParms); | ||
| 77 | - | ||
| 78 | - LOGGER.info("//---------------- 导出排版规则信息 success... ----------------//"); | ||
| 79 | - | ||
| 80 | - return file; | ||
| 81 | - | ||
| 82 | - } catch (Exception exp) { | ||
| 83 | - LOGGER.info("//---------------- 导出排版规则信息 failed... ----------------//"); | ||
| 84 | - | ||
| 85 | - StringWriter sw = new StringWriter(); | ||
| 86 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 87 | - LOGGER.info(sw.toString()); | ||
| 88 | - | ||
| 89 | - throw new ScheduleException(exp.getMessage()); | ||
| 90 | - } | 35 | + return dataToolsService.exportData(params); |
| 91 | } | 36 | } |
| 92 | } | 37 | } |
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| @@ -21,6 +21,7 @@ import com.bsth.service.LineInformationService; | @@ -21,6 +21,7 @@ import com.bsth.service.LineInformationService; | ||
| 21 | import com.bsth.service.StationRouteService; | 21 | import com.bsth.service.StationRouteService; |
| 22 | import com.bsth.service.schedule.GuideboardInfoService; | 22 | import com.bsth.service.schedule.GuideboardInfoService; |
| 23 | import com.bsth.service.schedule.TTInfoDetailService; | 23 | import com.bsth.service.schedule.TTInfoDetailService; |
| 24 | +import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | ||
| 24 | import com.bsth.service.schedule.exception.ScheduleException; | 25 | import com.bsth.service.schedule.exception.ScheduleException; |
| 25 | import com.bsth.service.schedule.utils.DataToolsProperties; | 26 | import com.bsth.service.schedule.utils.DataToolsProperties; |
| 26 | import com.bsth.service.schedule.utils.DataToolsService; | 27 | import com.bsth.service.schedule.utils.DataToolsService; |
| @@ -53,7 +54,6 @@ import java.util.regex.Pattern; | @@ -53,7 +54,6 @@ import java.util.regex.Pattern; | ||
| 53 | * Created by xu on 17/1/3. | 54 | * Created by xu on 17/1/3. |
| 54 | */ | 55 | */ |
| 55 | @Service | 56 | @Service |
| 56 | -@EnableConfigurationProperties(DataToolsProperties.class) | ||
| 57 | public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> implements TTInfoDetailService { | 57 | public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> implements TTInfoDetailService { |
| 58 | /** 日志记录器 */ | 58 | /** 日志记录器 */ |
| 59 | private static final Logger LOGGER = LoggerFactory.getLogger(TTInfoDetailServiceImpl.class); | 59 | private static final Logger LOGGER = LoggerFactory.getLogger(TTInfoDetailServiceImpl.class); |
| @@ -82,11 +82,16 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -82,11 +82,16 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 82 | private SysUserRepository sysUserRepository; | 82 | private SysUserRepository sysUserRepository; |
| 83 | @Autowired | 83 | @Autowired |
| 84 | private GuideboardInfoRepository guideboardInfoRepository; | 84 | private GuideboardInfoRepository guideboardInfoRepository; |
| 85 | + | ||
| 85 | @Autowired | 86 | @Autowired |
| 86 | - @Qualifier(value = "dataToolsServiceImpl") | 87 | + @Qualifier(value = "ttInfoDetail_dataTool") |
| 87 | private DataToolsService dataToolsService; | 88 | private DataToolsService dataToolsService; |
| 88 | 89 | ||
| 89 | @Autowired | 90 | @Autowired |
| 91 | + @Qualifier(value = "ttInfoDetail_dataTool") | ||
| 92 | + private TTInfoDetailForEdit ttInfoDetailForEdit; | ||
| 93 | + | ||
| 94 | + @Autowired | ||
| 90 | private JdbcTemplate jdbcTemplate; | 95 | private JdbcTemplate jdbcTemplate; |
| 91 | 96 | ||
| 92 | /** | 97 | /** |
| @@ -115,7 +120,6 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -115,7 +120,6 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 115 | 120 | ||
| 116 | @Override | 121 | @Override |
| 117 | public File uploadFile(String filename, byte[] filedata) throws ScheduleException { | 122 | public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 118 | - | ||
| 119 | return dataToolsService.uploadFile(filename, filedata); | 123 | return dataToolsService.uploadFile(filename, filedata); |
| 120 | } | 124 | } |
| 121 | 125 | ||
| @@ -123,175 +127,26 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -123,175 +127,26 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 123 | public void importData( | 127 | public void importData( |
| 124 | File file, | 128 | File file, |
| 125 | Map<String, Object> params) throws ScheduleException { | 129 | Map<String, Object> params) throws ScheduleException { |
| 126 | - | ||
| 127 | - try { | ||
| 128 | - LOGGER.info("//---------------- 导入时刻表明细 start... ----------------//"); | ||
| 129 | - | ||
| 130 | - String filename = file.getAbsolutePath(); // xls文件名 | ||
| 131 | - String sheetname = String.valueOf(params.get("sheetname")); // sheet名字 | ||
| 132 | - Long ttid = Long.valueOf(String.valueOf(params.get("ttid"))); // 时刻表id | ||
| 133 | - Long xlid = Long.valueOf(String.valueOf(params.get("xlid"))); // 线路id | ||
| 134 | - Integer lineid = Integer.valueOf(String.valueOf(params.get("lineinfo"))); // 线路标准id | ||
| 135 | - String xlname = String.valueOf(params.get("xlname")); // 线路名字 | ||
| 136 | - String ttname = String.valueOf(params.get("ttname")); // 时刻表名字 | ||
| 137 | - | ||
| 138 | - LOGGER.info("参数1, xls文件名={},sheet名字={}", filename, sheetname); | ||
| 139 | - LOGGER.info("参数2, 线路id={},线路名字={}", xlid, xlname); | ||
| 140 | - LOGGER.info("参数3, 时刻表id={},时刻表名字={}", ttid, ttname); | ||
| 141 | - | ||
| 142 | - LOGGER.info("转换xls文件格式成文本格式..."); | ||
| 143 | - // 1、修改已经上传的excel文件,在每个起点站后标示数字,表示第几个班次 | ||
| 144 | - // 2、由于格式问题,需要把内容都转换成字符串 | ||
| 145 | - List<String> colList = new ArrayList<>(); | ||
| 146 | - Workbook workbook = Workbook.getWorkbook(new File(filename)); | ||
| 147 | - Sheet sheet = workbook.getSheet(sheetname); | ||
| 148 | - Cell[] cells = sheet.getRow(0); | ||
| 149 | - for (int i = 0; i < cells.length; i++) { | ||
| 150 | - if (i == 0) { | ||
| 151 | - colList.add(cells[i].getContents().trim()); | ||
| 152 | - } else { | ||
| 153 | - colList.add(cells[i].getContents() + i); | ||
| 154 | - } | ||
| 155 | - } | ||
| 156 | - | ||
| 157 | - File fileCal = new File(filename + "_stringType.xls"); | ||
| 158 | - WritableWorkbook writableWorkbook = Workbook.createWorkbook(fileCal, workbook); | ||
| 159 | - WritableSheet sheet1 = writableWorkbook.getSheet(sheetname); | ||
| 160 | - for (int i = 0; i < sheet1.getColumns(); i++) { // 第一行数据 | ||
| 161 | - sheet1.addCell(new Label(i, 0, colList.get(i))); | ||
| 162 | - } | ||
| 163 | - for (int i = 1; i < sheet1.getRows(); i++) { // 第二行开始 | ||
| 164 | - Cell[] cells1 = sheet.getRow(i); | ||
| 165 | - for (int j = 0; j < cells1.length; j++) { | ||
| 166 | - sheet1.addCell(new Label(j, i, cells1[j].getContents())); | ||
| 167 | - } | ||
| 168 | - } | ||
| 169 | - writableWorkbook.write(); | ||
| 170 | - writableWorkbook.close(); | ||
| 171 | - | ||
| 172 | - // 2、删除原有数据 | ||
| 173 | - // 操作在ktr内部执行 | ||
| 174 | - | ||
| 175 | - // 3、导入时刻表 | ||
| 176 | - // 获取停车场名字 | ||
| 177 | - LOGGER.info("获取停车场名字..."); | ||
| 178 | - LineInformation lineInformation = lineInformationService.findById(lineid); | ||
| 179 | - Map<String, Object> p1 = new HashMap<>(); | ||
| 180 | - p1.put("parkCode_eq", lineInformation.getCarPark()); | ||
| 181 | - List<CarPark> carParkList = (List<CarPark>) carParkService.list(p1); | ||
| 182 | - String tccname = carParkList.get(0).getParkName(); | ||
| 183 | - LOGGER.info("停车场名字={}", tccname); | ||
| 184 | - | ||
| 185 | - | ||
| 186 | - // 计算表头参数 | ||
| 187 | - Workbook book = Workbook.getWorkbook(fileCal); | ||
| 188 | - Sheet sheet_exp = book.getSheet(sheetname); | ||
| 189 | - List<String> columnames = new ArrayList<>(); | ||
| 190 | - for (int i = 0; i < sheet_exp.getColumns(); i++) { // 获取第一行,数据,作为列名 | ||
| 191 | - columnames.add(sheet_exp.getCell(i, 0).getContents()); | ||
| 192 | - } | ||
| 193 | - LOGGER.info("表头={}", StringUtils.join(columnames.toArray(), ",")); | ||
| 194 | - | ||
| 195 | - // 创建ktr转换所需参数 | ||
| 196 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 197 | - File ktrFile = new File(this.getClass().getResource( | ||
| 198 | - dataToolsProperties.getTtinfodetailMetadatainputktr()).toURI()); | ||
| 199 | -// File ktrFile2 = new File(this.getClass().getResource( | ||
| 200 | -// dataToolsProperties.getTtinfodetailDatainputktr()).toURI()); | ||
| 201 | - File ktrFile2 = new File(this.getClass().getResource( | ||
| 202 | - dataToolsProperties.getTtinfodetailDatainputktr2()).toURI()); | ||
| 203 | - | ||
| 204 | - // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径 | ||
| 205 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 206 | - ktrParms.put("filepath", fileCal.getAbsolutePath()); | ||
| 207 | - ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir()); | ||
| 208 | - | ||
| 209 | - // 附加参数 | ||
| 210 | - ktrParms.put("injectktrfile", ktrFile2.getAbsolutePath()); // 注入元数据的ktr文件 | ||
| 211 | - ktrParms.put("sheetname", sheetname); // sheet工作区的名字 | ||
| 212 | - ktrParms.put("xlname", xlname); // 线路名称 | ||
| 213 | - ktrParms.put("ttinfoname", ttname); // 时刻表名称 | ||
| 214 | - ktrParms.put("ttid", ttid.intValue()); // 时刻表id | ||
| 215 | - ktrParms.put("tccname", tccname); // 停车场名字 | ||
| 216 | - ktrParms.put("excelfieldnames", StringUtils.join(columnames.toArray(), ",")); // 时刻表excel输入字段名,以逗号连接 | ||
| 217 | - columnames.remove(0); | ||
| 218 | - ktrParms.put("normalizefieldnames", StringUtils.join(columnames.toArray(), ",")); // 数据范式化字段名,以逗号连接 | ||
| 219 | - | ||
| 220 | - super.importData(fileCal, ktrParms); | ||
| 221 | - | ||
| 222 | - LOGGER.info("//---------------- 导入时刻表明细 success... ----------------//"); | ||
| 223 | - } catch (Exception exp) { | ||
| 224 | - LOGGER.info("//---------------- 导入时刻表明细 failed... ----------------//"); | ||
| 225 | - | ||
| 226 | - StringWriter sw = new StringWriter(); | ||
| 227 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 228 | - LOGGER.info(sw.toString()); | ||
| 229 | - | ||
| 230 | - throw new ScheduleException(exp.getMessage()); | ||
| 231 | - } | 130 | + dataToolsService.importData(file, params); |
| 232 | } | 131 | } |
| 233 | 132 | ||
| 234 | @Override | 133 | @Override |
| 235 | public File exportData(Map<String, Object> params) throws ScheduleException { | 134 | public File exportData(Map<String, Object> params) throws ScheduleException { |
| 236 | - try { | ||
| 237 | - LOGGER.info("//---------------- 导出时刻表明细 start... ----------------//"); | ||
| 238 | - | ||
| 239 | - // 创建ktr转换所需参数 | ||
| 240 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 241 | - File ktrFile = new File(this.getClass().getResource( | ||
| 242 | - dataToolsProperties.getTtinfodetailMetaoutput()).toURI()); | ||
| 243 | - File ktrFile2 = new File(this.getClass().getResource( | ||
| 244 | - dataToolsProperties.getTtinfodetailOutput()).toURI()); | ||
| 245 | - | ||
| 246 | - // 通用参数,转换文件路径,excel输出文件名 | ||
| 247 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 248 | - ktrParms.put("filename", String.format("时刻表_(id=%s)_download-", String.valueOf(params.get("ttinfoid")))); | ||
| 249 | - | ||
| 250 | - // 附加参数 | ||
| 251 | - ktrParms.put("injectktrfile", ktrFile2.getAbsolutePath()); // 注入元数据的ktr文件 | ||
| 252 | - ktrParms.put("ttinfoid", String.valueOf(params.get("ttinfoid"))); | ||
| 253 | - | ||
| 254 | - File file = super.exportData(ktrParms); | ||
| 255 | - | ||
| 256 | - LOGGER.info("//---------------- 导出时刻表明细 success... ----------------//"); | ||
| 257 | - | ||
| 258 | - return file; | ||
| 259 | - } catch (Exception exp) { | ||
| 260 | - LOGGER.info("//---------------- 导出时刻表明细 failed... ----------------//"); | ||
| 261 | - | ||
| 262 | - StringWriter sw = new StringWriter(); | ||
| 263 | - exp.printStackTrace(new PrintWriter(sw)); | ||
| 264 | - LOGGER.info(sw.toString()); | ||
| 265 | - | ||
| 266 | - throw new ScheduleException(exp.getMessage()); | ||
| 267 | - } | 135 | + return dataToolsService.exportData(params); |
| 268 | } | 136 | } |
| 269 | 137 | ||
| 270 | @Override | 138 | @Override |
| 271 | - public EditInfo getEditInfo(Integer xlid, Long ttid) throws ScheduleException { | 139 | + public TTInfoDetailService.EditInfo getEditInfo(Integer xlid, Long ttid) throws ScheduleException { |
| 272 | try { | 140 | try { |
| 273 | LOGGER.info("//---------------- 时刻表编辑用数据输出 start... ----------------//"); | 141 | LOGGER.info("//---------------- 时刻表编辑用数据输出 start... ----------------//"); |
| 274 | 142 | ||
| 275 | - // 创建ktr转换所需参数 | ||
| 276 | - Map<String, Object> ktrParms = new HashMap<>(); | ||
| 277 | - File ktrFile = new File(this.getClass().getResource( | ||
| 278 | - dataToolsProperties.getTtinfodetailForeditktr()).toURI()); | ||
| 279 | - | ||
| 280 | - // 通用参数,转换文件路径,excel输出文件名,错误输出文件路径 | ||
| 281 | - ktrParms.put("transpath", ktrFile.getAbsolutePath()); | ||
| 282 | - ktrParms.put("filename", "todo"); | ||
| 283 | - | ||
| 284 | // 附加参数 | 143 | // 附加参数 |
| 285 | String outputFilePath = String.format("ttinfodetail_(id=%s)_foredit-%s", | 144 | String outputFilePath = String.format("ttinfodetail_(id=%s)_foredit-%s", |
| 286 | String.valueOf(ttid), new DateTime().toString("yyyyMMddHHmmss")); | 145 | String.valueOf(ttid), new DateTime().toString("yyyyMMddHHmmss")); |
| 287 | 146 | ||
| 288 | - ktrParms.put("tempfilepath", dataToolsProperties.getTransTempdir() + File.separator + outputFilePath); // 数据输出文件路径 | ||
| 289 | - ktrParms.put("xlid", String.valueOf(xlid)); | ||
| 290 | - ktrParms.put("ttid", String.valueOf(ttid)); | ||
| 291 | - | ||
| 292 | - super.exportData(ktrParms); | 147 | + ttInfoDetailForEdit.exportDataForEdit(xlid, ttid); |
| 293 | 148 | ||
| 294 | - EditInfo editInfo = new EditInfo(); // 输出数据 | 149 | + TTInfoDetailService.EditInfo editInfo = new TTInfoDetailService.EditInfo(); // 输出数据 |
| 295 | 150 | ||
| 296 | // 1.6、获取最大的发车数,用于输出数据的数量 | 151 | // 1.6、获取最大的发车数,用于输出数据的数量 |
| 297 | Long maxfcno = ttInfoDetailRepository.findMaxFcno(xlid, ttid); | 152 | Long maxfcno = ttInfoDetailRepository.findMaxFcno(xlid, ttid); |
| @@ -315,9 +170,9 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -315,9 +170,9 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 315 | headarrays[maxfcno.intValue() + 2] = "运营班次/运营里程"; | 170 | headarrays[maxfcno.intValue() + 2] = "运营班次/运营里程"; |
| 316 | 171 | ||
| 317 | for (int r = 1; r < sheet.getRows(); r++) { | 172 | for (int r = 1; r < sheet.getRows(); r++) { |
| 318 | - List<FcInfo> fcInfos = new ArrayList<>(); | 173 | + List<TTInfoDetailService.FcInfo> fcInfos = new ArrayList<>(); |
| 319 | // 每行第一列都是路牌 | 174 | // 每行第一列都是路牌 |
| 320 | - fcInfos.add(new FcInfo(null, null, sheet.getCell(0, r).getContents(), null, null, null, null)); // 用fcsj放置路牌显示 | 175 | + fcInfos.add(new TTInfoDetailService.FcInfo(null, null, sheet.getCell(0, r).getContents(), null, null, null, null)); // 用fcsj放置路牌显示 |
| 321 | 176 | ||
| 322 | int bc_ks = 0; // 空驶班次 | 177 | int bc_ks = 0; // 空驶班次 |
| 323 | int bc_yy = 0; // 营运班次 | 178 | int bc_yy = 0; // 营运班次 |
| @@ -340,7 +195,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -340,7 +195,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 340 | String qdzCode = content == null ? "" : content[7]; // 起点站编码 | 195 | String qdzCode = content == null ? "" : content[7]; // 起点站编码 |
| 341 | String zdzCode = content == null ? "" : content[8]; // 终点站编码 | 196 | String zdzCode = content == null ? "" : content[8]; // 终点站编码 |
| 342 | 197 | ||
| 343 | - FcInfo fcInfo = new FcInfo(ttdid_str, bctype, fcsj, xldir, isfb, qdzCode, zdzCode); | 198 | + TTInfoDetailService.FcInfo fcInfo = new TTInfoDetailService.FcInfo(ttdid_str, bctype, fcsj, xldir, isfb, qdzCode, zdzCode); |
| 344 | 199 | ||
| 345 | if (StringUtils.isNotEmpty(fzdname)) | 200 | if (StringUtils.isNotEmpty(fzdname)) |
| 346 | headarrays[c] = fzdname; | 201 | headarrays[c] = fzdname; |
| @@ -374,10 +229,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -374,10 +229,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 374 | } | 229 | } |
| 375 | 230 | ||
| 376 | // 添加一列 空驶班次/空驶里程,fcsj放置数据 | 231 | // 添加一列 空驶班次/空驶里程,fcsj放置数据 |
| 377 | - fcInfos.add(new FcInfo(null, null, String.format("%d/%.3f", bc_ks, lc_ks), null, null, null, null)); | 232 | + fcInfos.add(new TTInfoDetailService.FcInfo(null, null, String.format("%d/%.3f", bc_ks, lc_ks), null, null, null, null)); |
| 378 | 233 | ||
| 379 | // 添加一列 营运班次/营运里程,fcsj放置数据 | 234 | // 添加一列 营运班次/营运里程,fcsj放置数据 |
| 380 | - fcInfos.add(new FcInfo(null, null, String.format("%d/%.3f", bc_yy, lc_yy), null, null, null, null)); | 235 | + fcInfos.add(new TTInfoDetailService.FcInfo(null, null, String.format("%d/%.3f", bc_yy, lc_yy), null, null, null, null)); |
| 381 | 236 | ||
| 382 | editInfo.getContents().add(fcInfos); | 237 | editInfo.getContents().add(fcInfos); |
| 383 | } | 238 | } |
src/main/java/com/bsth/service/schedule/rules/strategy/IStrategyImpl.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.rules.strategy; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.Line; | ||
| 4 | -import com.bsth.entity.schedule.CarConfigInfo; | ||
| 5 | -import com.bsth.entity.schedule.EmployeeConfigInfo; | ||
| 6 | -import com.bsth.entity.schedule.TTInfo; | ||
| 7 | -import com.bsth.entity.schedule.TTInfoDetail; | ||
| 8 | -import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | ||
| 9 | -import com.bsth.service.LineService; | ||
| 10 | -import com.bsth.service.schedule.*; | ||
| 11 | -import com.bsth.service.schedule.rules.ttinfo.TTInfoCalcuParam_input; | ||
| 12 | -import com.bsth.service.schedule.rules.ttinfo.TTInfoResult_output; | ||
| 13 | -import com.bsth.service.schedule.rules.ttinfo.TTInfoResults_output; | ||
| 14 | -import com.bsth.service.schedule.rules.ttinfo.TTInfo_input; | ||
| 15 | -import com.google.common.collect.ArrayListMultimap; | ||
| 16 | -import com.google.common.collect.Multimap; | ||
| 17 | -import org.joda.time.DateTime; | ||
| 18 | -import org.kie.api.KieBase; | ||
| 19 | -import org.kie.api.runtime.KieSession; | ||
| 20 | -import org.slf4j.Logger; | ||
| 21 | -import org.slf4j.LoggerFactory; | ||
| 22 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 23 | -import org.springframework.stereotype.Service; | ||
| 24 | -import org.springframework.util.CollectionUtils; | ||
| 25 | - | ||
| 26 | -import java.util.*; | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * Created by xu on 16/7/10. | ||
| 30 | - */ | ||
| 31 | -@Service | ||
| 32 | -public class IStrategyImpl implements IStrategy { | ||
| 33 | - @Autowired | ||
| 34 | - private TTInfoService ttInfoService; | ||
| 35 | - @Autowired | ||
| 36 | - private CarConfigInfoService carConfigInfoService; | ||
| 37 | - @Autowired | ||
| 38 | - private EmployeeConfigInfoService employeeConfigInfoService; | ||
| 39 | - @Autowired | ||
| 40 | - private TTInfoDetailService ttInfoDetailService; | ||
| 41 | - @Autowired | ||
| 42 | - private LineService lineService; | ||
| 43 | - @Autowired | ||
| 44 | - private ScheduleRule1FlatService scheduleRule1FlatService; | ||
| 45 | - | ||
| 46 | - /** 日志记录器 */ | ||
| 47 | - private Logger logger = LoggerFactory.getLogger(IStrategyImpl.class); | ||
| 48 | - | ||
| 49 | - @Autowired | ||
| 50 | - private KieBase kieBase; | ||
| 51 | - | ||
| 52 | - @Override | ||
| 53 | - public Line getLine(Integer xlId) { | ||
| 54 | - Map<String, Object> param = new HashMap<>(); | ||
| 55 | - param.put("id_eq", xlId); | ||
| 56 | - param.put("destroy_eq", 0); // 未撤销 | ||
| 57 | - List<Line> lines = (List<Line>) lineService.list(param); | ||
| 58 | - if (CollectionUtils.isEmpty(lines)) { | ||
| 59 | - throw new RuntimeException("线路找不到,可能已经撤销!"); | ||
| 60 | - } | ||
| 61 | - return lines.get(0); | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - @Override | ||
| 65 | - public List<TTInfo> getTTInfo(Integer xlId) { | ||
| 66 | - // 查询参数 | ||
| 67 | - Map<String, Object> param = new HashMap<>(); | ||
| 68 | - param.put("xl.id_eq", xlId); // 线路Id | ||
| 69 | - param.put("isCancel_eq", false); // 作废的过滤掉 | ||
| 70 | - Iterator<TTInfo> ttInfoIterator = ttInfoService.list(param).iterator(); | ||
| 71 | - if (!ttInfoIterator.hasNext()) { | ||
| 72 | - throw new RuntimeException("线路id=" + xlId + " 没有时刻表!"); | ||
| 73 | - } | ||
| 74 | - List<TTInfo> ttInfos = new ArrayList<>(); | ||
| 75 | - while (ttInfoIterator.hasNext()) { | ||
| 76 | - TTInfo ttInfo = ttInfoIterator.next(); | ||
| 77 | - ttInfos.add(ttInfo); | ||
| 78 | - } | ||
| 79 | - return ttInfos; | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - @Override | ||
| 83 | - public List<TTInfoDetail> getTTInfoDetail(Integer xlId) { | ||
| 84 | - List<TTInfoDetail> ttInfoDetails = new ArrayList<>(); | ||
| 85 | - | ||
| 86 | - List<TTInfo> ttInfos = getTTInfo(xlId); | ||
| 87 | - Map<String, Object> param = new HashMap<>(); | ||
| 88 | - for (TTInfo ttInfo : ttInfos) { | ||
| 89 | - param.clear(); | ||
| 90 | - param.put("ttinfo.id_eq", ttInfo.getId()); | ||
| 91 | - Iterator<TTInfoDetail> ttInfoDetailIterator = ttInfoDetailService.list(param).iterator(); | ||
| 92 | - while (ttInfoDetailIterator.hasNext()) { | ||
| 93 | - ttInfoDetails.add(ttInfoDetailIterator.next()); | ||
| 94 | - } | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - return ttInfoDetails; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - @Override | ||
| 101 | - public Iterable<ScheduleRule1Flat> getScheduleRule(Integer xlId) { | ||
| 102 | - Map<String, Object> param = new HashMap<>(); // 查询参数 | ||
| 103 | - Line xl = lineService.findById(xlId); // 查找线路具体信息 | ||
| 104 | - param.clear(); | ||
| 105 | - param.put("xl.id_eq", xl.getId()); | ||
| 106 | - Iterable<ScheduleRule1Flat> scheduleRule1FlatIterable = scheduleRule1FlatService.list(param); | ||
| 107 | - if (!scheduleRule1FlatIterable.iterator().hasNext()) | ||
| 108 | - throw new RuntimeException("线路:" + xl.getName() + " 没有配置规则!"); | ||
| 109 | - | ||
| 110 | - return scheduleRule1FlatIterable; | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - @Override | ||
| 114 | - public Map<Date, Multimap<Long, TTInfoDetail>> getGuideboardXlTTInfoDetailMaps( | ||
| 115 | - Integer xlId, Date fromDate, Date toDate) { | ||
| 116 | - // 获取线路的所有时刻表 | ||
| 117 | - List<TTInfo> ttInfos = getTTInfo(xlId); | ||
| 118 | - | ||
| 119 | - // 执行规则,判定每天使用的时刻表 | ||
| 120 | - KieSession session = kieBase.newKieSession(); | ||
| 121 | - | ||
| 122 | - session.setGlobal("log", logger); | ||
| 123 | - TTInfoResults_output ttInfoResults_output = new TTInfoResults_output(); | ||
| 124 | - session.setGlobal("results", ttInfoResults_output); | ||
| 125 | - | ||
| 126 | - TTInfoCalcuParam_input ttInfoCalcuParam_input = new TTInfoCalcuParam_input( | ||
| 127 | - new DateTime(fromDate), new DateTime(toDate), String.valueOf(xlId)); | ||
| 128 | - session.insert(ttInfoCalcuParam_input); | ||
| 129 | - for (TTInfo ttInfo : ttInfos) { | ||
| 130 | - TTInfo_input ttInfo_input = new TTInfo_input(ttInfo); | ||
| 131 | - session.insert(ttInfo_input); | ||
| 132 | - } | ||
| 133 | - | ||
| 134 | - session.fireAllRules(); | ||
| 135 | - session.dispose(); | ||
| 136 | - | ||
| 137 | - // 获取ttinfoDetail | ||
| 138 | - List<TTInfoDetail> ttInfoDetails = getTTInfoDetail(xlId); | ||
| 139 | - | ||
| 140 | - // 规则输出结果 | ||
| 141 | - Multimap<DateTime, TTInfoResult_output> outputMultimap = | ||
| 142 | - ttInfoResults_output.getResults().get(String.valueOf(xlId)); | ||
| 143 | - // return结果输出 | ||
| 144 | - Map<Date, Multimap<Long, TTInfoDetail>> ttInfoDetailMultimap = new HashMap<>(); | ||
| 145 | - | ||
| 146 | - for (DateTime dateTime : outputMultimap.keySet()) { | ||
| 147 | - Collection<TTInfoResult_output> ttInfoResult_outputs = outputMultimap.get(dateTime); | ||
| 148 | - // 如果有多个,使用第一个 | ||
| 149 | - Iterator<TTInfoResult_output> ttInfoResult_outputIterator = ttInfoResult_outputs.iterator(); | ||
| 150 | - if (ttInfoResult_outputIterator.hasNext()) { | ||
| 151 | - // 同一天,多张时刻表只取第一张 | ||
| 152 | - TTInfoResult_output ttInfoResult_output = ttInfoResult_outputIterator.next(); | ||
| 153 | - // 查找时刻表明细 | ||
| 154 | - Multimap<Long, TTInfoDetail> ttinfodetailMap2 = ArrayListMultimap.create(); | ||
| 155 | - for (TTInfoDetail ttInfoDetail : ttInfoDetails) { | ||
| 156 | - if (ttInfoDetail.getTtinfo().getId().equals(Long.valueOf(ttInfoResult_output.getTtInfoId()))) { | ||
| 157 | - ttinfodetailMap2.put(ttInfoDetail.getLp().getId(), ttInfoDetail); | ||
| 158 | - } | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | - ttInfoDetailMultimap.put(dateTime.toDate(), ttinfodetailMap2); | ||
| 162 | - } | ||
| 163 | - } | ||
| 164 | - | ||
| 165 | - return ttInfoDetailMultimap; | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - @Override | ||
| 169 | - public Map<Long, CarConfigInfo> getCarConfigMaps(Integer xlId) { | ||
| 170 | - // 查询参数 | ||
| 171 | - Map<String, Object> param = new HashMap<>(); | ||
| 172 | - param.put("xl.id_eq", xlId); | ||
| 173 | - Iterable<CarConfigInfo> carConfigInfoIterable = carConfigInfoService.list(param); | ||
| 174 | - Iterator<CarConfigInfo> carConfigInfoIterator = carConfigInfoIterable.iterator(); | ||
| 175 | - if (!carConfigInfoIterator.hasNext()) | ||
| 176 | - throw new RuntimeException("线路id=" + xlId + ",下没有车辆配置信息!"); | ||
| 177 | - | ||
| 178 | - Map<Long, CarConfigInfo> carConfigInfoMap = new HashMap<>(); | ||
| 179 | - while (carConfigInfoIterator.hasNext()) { | ||
| 180 | - CarConfigInfo carConfigInfo = carConfigInfoIterator.next(); | ||
| 181 | - carConfigInfoMap.put(carConfigInfo.getId(), carConfigInfo); | ||
| 182 | - } | ||
| 183 | - return carConfigInfoMap; | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - @Override | ||
| 187 | - public Map<Long, EmployeeConfigInfo> getEmployeeConfigMaps(Integer xlId) { | ||
| 188 | - // 查询参数 | ||
| 189 | - Map<String, Object> param = new HashMap<>(); | ||
| 190 | - param.put("xl.id_eq", xlId); | ||
| 191 | - Iterable<EmployeeConfigInfo> employeeConfigInfoIterable = employeeConfigInfoService.list(param); | ||
| 192 | - Iterator<EmployeeConfigInfo> employeeConfigInfoIterator = employeeConfigInfoIterable.iterator(); | ||
| 193 | - if (!employeeConfigInfoIterator.hasNext()) | ||
| 194 | - throw new RuntimeException("线路id=" + xlId + ",下没有人员配置信息!"); | ||
| 195 | - | ||
| 196 | - Map<Long, EmployeeConfigInfo> employeeConfigInfoMap = new HashMap<>(); | ||
| 197 | - while (employeeConfigInfoIterator.hasNext()) { | ||
| 198 | - EmployeeConfigInfo employeeConfigInfo = employeeConfigInfoIterator.next(); | ||
| 199 | - employeeConfigInfoMap.put(employeeConfigInfo.getId(), employeeConfigInfo); | ||
| 200 | - } | ||
| 201 | - return employeeConfigInfoMap; | ||
| 202 | - } | ||
| 203 | -} |
src/main/resources/datatools/ktrs/carsDataInput.ktr
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<transformation> | ||
| 3 | - <info> | ||
| 4 | - <name>车辆信息导入</name> | ||
| 5 | - <description>车辆信息导入</description> | ||
| 6 | - <extended_description>车辆基础信息</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>erroroutputdir</name> | ||
| 14 | - <default_value/> | ||
| 15 | - <description>ktr step配置的错误输出目录</description> | ||
| 16 | - </parameter> | ||
| 17 | - <parameter> | ||
| 18 | - <name>filepath</name> | ||
| 19 | - <default_value/> | ||
| 20 | - <description>待处理导入的excel文件</description> | ||
| 21 | - </parameter> | ||
| 22 | - </parameters> | ||
| 23 | - <log> | ||
| 24 | -<trans-log-table><connection/> | ||
| 25 | -<schema/> | ||
| 26 | -<table/> | ||
| 27 | -<size_limit_lines/> | ||
| 28 | -<interval/> | ||
| 29 | -<timeout_days/> | ||
| 30 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table> | ||
| 31 | -<perf-log-table><connection/> | ||
| 32 | -<schema/> | ||
| 33 | -<table/> | ||
| 34 | -<interval/> | ||
| 35 | -<timeout_days/> | ||
| 36 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table> | ||
| 37 | -<channel-log-table><connection/> | ||
| 38 | -<schema/> | ||
| 39 | -<table/> | ||
| 40 | -<timeout_days/> | ||
| 41 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table> | ||
| 42 | -<step-log-table><connection/> | ||
| 43 | -<schema/> | ||
| 44 | -<table/> | ||
| 45 | -<timeout_days/> | ||
| 46 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table> | ||
| 47 | -<metrics-log-table><connection/> | ||
| 48 | -<schema/> | ||
| 49 | -<table/> | ||
| 50 | -<timeout_days/> | ||
| 51 | -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table> | ||
| 52 | - </log> | ||
| 53 | - <maxdate> | ||
| 54 | - <connection/> | ||
| 55 | - <table/> | ||
| 56 | - <field/> | ||
| 57 | - <offset>0.0</offset> | ||
| 58 | - <maxdiff>0.0</maxdiff> | ||
| 59 | - </maxdate> | ||
| 60 | - <size_rowset>10000</size_rowset> | ||
| 61 | - <sleep_time_empty>50</sleep_time_empty> | ||
| 62 | - <sleep_time_full>50</sleep_time_full> | ||
| 63 | - <unique_connections>N</unique_connections> | ||
| 64 | - <feedback_shown>Y</feedback_shown> | ||
| 65 | - <feedback_size>50000</feedback_size> | ||
| 66 | - <using_thread_priorities>Y</using_thread_priorities> | ||
| 67 | - <shared_objects_file/> | ||
| 68 | - <capture_step_performance>N</capture_step_performance> | ||
| 69 | - <step_performance_capturing_delay>1000</step_performance_capturing_delay> | ||
| 70 | - <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit> | ||
| 71 | - <dependencies> | ||
| 72 | - </dependencies> | ||
| 73 | - <partitionschemas> | ||
| 74 | - </partitionschemas> | ||
| 75 | - <slaveservers> | ||
| 76 | - </slaveservers> | ||
| 77 | - <clusterschemas> | ||
| 78 | - </clusterschemas> | ||
| 79 | - <created_user>-</created_user> | ||
| 80 | - <created_date>2016/06/23 17:44:46.781</created_date> | ||
| 81 | - <modified_user>-</modified_user> | ||
| 82 | - <modified_date>2016/06/23 17:44:46.781</modified_date> | ||
| 83 | - <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key> | ||
| 84 | - <is_key_private>N</is_key_private> | ||
| 85 | - </info> | ||
| 86 | - <notepads> | ||
| 87 | - </notepads> | ||
| 88 | - <connection> | ||
| 89 | - <name>192.168.168.1_jwgl_dw</name> | ||
| 90 | - <server>192.168.168.1</server> | ||
| 91 | - <type>ORACLE</type> | ||
| 92 | - <access>Native</access> | ||
| 93 | - <database>orcl</database> | ||
| 94 | - <port>1521</port> | ||
| 95 | - <username>jwgl_dw</username> | ||
| 96 | - <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password> | ||
| 97 | - <servername/> | ||
| 98 | - <data_tablespace/> | ||
| 99 | - <index_tablespace/> | ||
| 100 | - <attributes> | ||
| 101 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 102 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 103 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 104 | - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 105 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 106 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 107 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 108 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 109 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 110 | - </attributes> | ||
| 111 | - </connection> | ||
| 112 | - <connection> | ||
| 113 | - <name>bus_control_variable</name> | ||
| 114 | - <server>${v_db_ip}</server> | ||
| 115 | - <type>MYSQL</type> | ||
| 116 | - <access>Native</access> | ||
| 117 | - <database>${v_db_dname}</database> | ||
| 118 | - <port>3306</port> | ||
| 119 | - <username>${v_db_uname}</username> | ||
| 120 | - <password>${v_db_pwd}</password> | ||
| 121 | - <servername/> | ||
| 122 | - <data_tablespace/> | ||
| 123 | - <index_tablespace/> | ||
| 124 | - <attributes> | ||
| 125 | - <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute> | ||
| 126 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 127 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 128 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 129 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 130 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 131 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 132 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 133 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 134 | - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 135 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 136 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 137 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 138 | - </attributes> | ||
| 139 | - </connection> | ||
| 140 | - <connection> | ||
| 141 | - <name>bus_control_公司_201</name> | ||
| 142 | - <server>localhost</server> | ||
| 143 | - <type>MYSQL</type> | ||
| 144 | - <access>Native</access> | ||
| 145 | - <database>control</database> | ||
| 146 | - <port>3306</port> | ||
| 147 | - <username>root</username> | ||
| 148 | - <password>Encrypted </password> | ||
| 149 | - <servername/> | ||
| 150 | - <data_tablespace/> | ||
| 151 | - <index_tablespace/> | ||
| 152 | - <attributes> | ||
| 153 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 154 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 155 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 156 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 157 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 158 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 159 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 160 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 161 | - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 162 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 163 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 164 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 165 | - </attributes> | ||
| 166 | - </connection> | ||
| 167 | - <connection> | ||
| 168 | - <name>bus_control_本机</name> | ||
| 169 | - <server>localhost</server> | ||
| 170 | - <type>MYSQL</type> | ||
| 171 | - <access>Native</access> | ||
| 172 | - <database>control</database> | ||
| 173 | - <port>3306</port> | ||
| 174 | - <username>root</username> | ||
| 175 | - <password>Encrypted </password> | ||
| 176 | - <servername/> | ||
| 177 | - <data_tablespace/> | ||
| 178 | - <index_tablespace/> | ||
| 179 | - <attributes> | ||
| 180 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 181 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 182 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 183 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 184 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 185 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 186 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 187 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 188 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 189 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 190 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 191 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 192 | - </attributes> | ||
| 193 | - </connection> | ||
| 194 | - <connection> | ||
| 195 | - <name>xlab_mysql_youle</name> | ||
| 196 | - <server>101.231.124.8</server> | ||
| 197 | - <type>MYSQL</type> | ||
| 198 | - <access>Native</access> | ||
| 199 | - <database>xlab_youle</database> | ||
| 200 | - <port>45687</port> | ||
| 201 | - <username>xlab-youle</username> | ||
| 202 | - <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password> | ||
| 203 | - <servername/> | ||
| 204 | - <data_tablespace/> | ||
| 205 | - <index_tablespace/> | ||
| 206 | - <attributes> | ||
| 207 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 208 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 209 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 210 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 211 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 212 | - <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute> | ||
| 213 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 214 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 215 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 216 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 217 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 218 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 219 | - </attributes> | ||
| 220 | - </connection> | ||
| 221 | - <connection> | ||
| 222 | - <name>xlab_mysql_youle(本机)</name> | ||
| 223 | - <server>localhost</server> | ||
| 224 | - <type>MYSQL</type> | ||
| 225 | - <access>Native</access> | ||
| 226 | - <database>xlab_youle</database> | ||
| 227 | - <port>3306</port> | ||
| 228 | - <username>root</username> | ||
| 229 | - <password>Encrypted </password> | ||
| 230 | - <servername/> | ||
| 231 | - <data_tablespace/> | ||
| 232 | - <index_tablespace/> | ||
| 233 | - <attributes> | ||
| 234 | - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 235 | - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 236 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 237 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 238 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 239 | - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 240 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 241 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 242 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 243 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 244 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 245 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 246 | - </attributes> | ||
| 247 | - </connection> | ||
| 248 | - <connection> | ||
| 249 | - <name>xlab_youle</name> | ||
| 250 | - <server/> | ||
| 251 | - <type>MYSQL</type> | ||
| 252 | - <access>JNDI</access> | ||
| 253 | - <database>xlab_youle</database> | ||
| 254 | - <port>1521</port> | ||
| 255 | - <username/> | ||
| 256 | - <password>Encrypted </password> | ||
| 257 | - <servername/> | ||
| 258 | - <data_tablespace/> | ||
| 259 | - <index_tablespace/> | ||
| 260 | - <attributes> | ||
| 261 | - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 262 | - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 263 | - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 264 | - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 265 | - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 266 | - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 267 | - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 268 | - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 269 | - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 270 | - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 271 | - </attributes> | ||
| 272 | - </connection> | ||
| 273 | - <order> | ||
| 274 | - <hop> <from>获取变量</from><to>原始系统导出的Excel输入</to><enabled>Y</enabled> </hop> | ||
| 275 | - <hop> <from>插入/更新bsth_c_cars 2</from><to>错误输出 2</to><enabled>Y</enabled> </hop> | ||
| 276 | - <hop> <from>原始系统导出的Excel输入</from><to>插入/更新bsth_c_cars 2</to><enabled>Y</enabled> </hop> | ||
| 277 | - </order> | ||
| 278 | - <step> | ||
| 279 | - <name>原始系统导出的Excel输入</name> | ||
| 280 | - <type>ExcelInput</type> | ||
| 281 | - <description/> | ||
| 282 | - <distribute>Y</distribute> | ||
| 283 | - <custom_distribution/> | ||
| 284 | - <copies>1</copies> | ||
| 285 | - <partitioning> | ||
| 286 | - <method>none</method> | ||
| 287 | - <schema_name/> | ||
| 288 | - </partitioning> | ||
| 289 | - <header>Y</header> | ||
| 290 | - <noempty>Y</noempty> | ||
| 291 | - <stoponempty>N</stoponempty> | ||
| 292 | - <filefield/> | ||
| 293 | - <sheetfield/> | ||
| 294 | - <sheetrownumfield/> | ||
| 295 | - <rownumfield/> | ||
| 296 | - <sheetfield/> | ||
| 297 | - <filefield/> | ||
| 298 | - <limit>0</limit> | ||
| 299 | - <encoding/> | ||
| 300 | - <add_to_result_filenames>Y</add_to_result_filenames> | ||
| 301 | - <accept_filenames>Y</accept_filenames> | ||
| 302 | - <accept_field>filepath_</accept_field> | ||
| 303 | - <accept_stepname>获取变量</accept_stepname> | ||
| 304 | - <file> | ||
| 305 | - <name/> | ||
| 306 | - <filemask/> | ||
| 307 | - <exclude_filemask/> | ||
| 308 | - <file_required>N</file_required> | ||
| 309 | - <include_subfolders>N</include_subfolders> | ||
| 310 | - </file> | ||
| 311 | - <fields> | ||
| 312 | - <field> | ||
| 313 | - <name>车牌号</name> | ||
| 314 | - <type>String</type> | ||
| 315 | - <length>-1</length> | ||
| 316 | - <precision>-1</precision> | ||
| 317 | - <trim_type>none</trim_type> | ||
| 318 | - <repeat>N</repeat> | ||
| 319 | - <format/> | ||
| 320 | - <currency/> | ||
| 321 | - <decimal/> | ||
| 322 | - <group/> | ||
| 323 | - </field> | ||
| 324 | - <field> | ||
| 325 | - <name>车辆编码</name> | ||
| 326 | - <type>String</type> | ||
| 327 | - <length>-1</length> | ||
| 328 | - <precision>-1</precision> | ||
| 329 | - <trim_type>none</trim_type> | ||
| 330 | - <repeat>N</repeat> | ||
| 331 | - <format/> | ||
| 332 | - <currency/> | ||
| 333 | - <decimal/> | ||
| 334 | - <group/> | ||
| 335 | - </field> | ||
| 336 | - <field> | ||
| 337 | - <name>内部编码</name> | ||
| 338 | - <type>String</type> | ||
| 339 | - <length>-1</length> | ||
| 340 | - <precision>-1</precision> | ||
| 341 | - <trim_type>none</trim_type> | ||
| 342 | - <repeat>N</repeat> | ||
| 343 | - <format/> | ||
| 344 | - <currency/> | ||
| 345 | - <decimal/> | ||
| 346 | - <group/> | ||
| 347 | - </field> | ||
| 348 | - <field> | ||
| 349 | - <name>所属公司</name> | ||
| 350 | - <type>String</type> | ||
| 351 | - <length>-1</length> | ||
| 352 | - <precision>-1</precision> | ||
| 353 | - <trim_type>none</trim_type> | ||
| 354 | - <repeat>N</repeat> | ||
| 355 | - <format/> | ||
| 356 | - <currency/> | ||
| 357 | - <decimal/> | ||
| 358 | - <group/> | ||
| 359 | - </field> | ||
| 360 | - <field> | ||
| 361 | - <name>所属公司代码</name> | ||
| 362 | - <type>String</type> | ||
| 363 | - <length>-1</length> | ||
| 364 | - <precision>-1</precision> | ||
| 365 | - <trim_type>none</trim_type> | ||
| 366 | - <repeat>N</repeat> | ||
| 367 | - <format/> | ||
| 368 | - <currency/> | ||
| 369 | - <decimal/> | ||
| 370 | - <group/> | ||
| 371 | - </field> | ||
| 372 | - <field> | ||
| 373 | - <name>所属分公司</name> | ||
| 374 | - <type>String</type> | ||
| 375 | - <length>-1</length> | ||
| 376 | - <precision>-1</precision> | ||
| 377 | - <trim_type>none</trim_type> | ||
| 378 | - <repeat>N</repeat> | ||
| 379 | - <format/> | ||
| 380 | - <currency/> | ||
| 381 | - <decimal/> | ||
| 382 | - <group/> | ||
| 383 | - </field> | ||
| 384 | - <field> | ||
| 385 | - <name>所属分公司代码</name> | ||
| 386 | - <type>String</type> | ||
| 387 | - <length>-1</length> | ||
| 388 | - <precision>-1</precision> | ||
| 389 | - <trim_type>none</trim_type> | ||
| 390 | - <repeat>N</repeat> | ||
| 391 | - <format/> | ||
| 392 | - <currency/> | ||
| 393 | - <decimal/> | ||
| 394 | - <group/> | ||
| 395 | - </field> | ||
| 396 | - <field> | ||
| 397 | - <name>设备供应厂商</name> | ||
| 398 | - <type>String</type> | ||
| 399 | - <length>-1</length> | ||
| 400 | - <precision>-1</precision> | ||
| 401 | - <trim_type>none</trim_type> | ||
| 402 | - <repeat>N</repeat> | ||
| 403 | - <format/> | ||
| 404 | - <currency/> | ||
| 405 | - <decimal/> | ||
| 406 | - <group/> | ||
| 407 | - </field> | ||
| 408 | - <field> | ||
| 409 | - <name>设备终端号</name> | ||
| 410 | - <type>String</type> | ||
| 411 | - <length>-1</length> | ||
| 412 | - <precision>-1</precision> | ||
| 413 | - <trim_type>none</trim_type> | ||
| 414 | - <repeat>N</repeat> | ||
| 415 | - <format/> | ||
| 416 | - <currency/> | ||
| 417 | - <decimal/> | ||
| 418 | - <group/> | ||
| 419 | - </field> | ||
| 420 | - </fields> | ||
| 421 | - <sheets> | ||
| 422 | - <sheet> | ||
| 423 | - <name>工作表1</name> | ||
| 424 | - <startrow>0</startrow> | ||
| 425 | - <startcol>0</startcol> | ||
| 426 | - </sheet> | ||
| 427 | - </sheets> | ||
| 428 | - <strict_types>N</strict_types> | ||
| 429 | - <error_ignored>N</error_ignored> | ||
| 430 | - <error_line_skipped>N</error_line_skipped> | ||
| 431 | - <bad_line_files_destination_directory/> | ||
| 432 | - <bad_line_files_extension>warning</bad_line_files_extension> | ||
| 433 | - <error_line_files_destination_directory/> | ||
| 434 | - <error_line_files_extension>error</error_line_files_extension> | ||
| 435 | - <line_number_files_destination_directory/> | ||
| 436 | - <line_number_files_extension>line</line_number_files_extension> | ||
| 437 | - <shortFileFieldName/> | ||
| 438 | - <pathFieldName/> | ||
| 439 | - <hiddenFieldName/> | ||
| 440 | - <lastModificationTimeFieldName/> | ||
| 441 | - <uriNameFieldName/> | ||
| 442 | - <rootUriNameFieldName/> | ||
| 443 | - <extensionFieldName/> | ||
| 444 | - <sizeFieldName/> | ||
| 445 | - <spreadsheet_type>JXL</spreadsheet_type> | ||
| 446 | - <cluster_schema/> | ||
| 447 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 448 | - <xloc>131</xloc> | ||
| 449 | - <yloc>58</yloc> | ||
| 450 | - <draw>Y</draw> | ||
| 451 | - </GUI> | ||
| 452 | - </step> | ||
| 453 | - | ||
| 454 | - <step> | ||
| 455 | - <name>插入/更新bsth_c_cars 2</name> | ||
| 456 | - <type>InsertUpdate</type> | ||
| 457 | - <description/> | ||
| 458 | - <distribute>Y</distribute> | ||
| 459 | - <custom_distribution/> | ||
| 460 | - <copies>1</copies> | ||
| 461 | - <partitioning> | ||
| 462 | - <method>none</method> | ||
| 463 | - <schema_name/> | ||
| 464 | - </partitioning> | ||
| 465 | - <connection>bus_control_variable</connection> | ||
| 466 | - <commit>1000</commit> | ||
| 467 | - <update_bypassed>N</update_bypassed> | ||
| 468 | - <lookup> | ||
| 469 | - <schema/> | ||
| 470 | - <table>bsth_c_cars</table> | ||
| 471 | - <key> | ||
| 472 | - <name>内部编码</name> | ||
| 473 | - <field>inside_code</field> | ||
| 474 | - <condition>=</condition> | ||
| 475 | - <name2/> | ||
| 476 | - </key> | ||
| 477 | - <value> | ||
| 478 | - <name>car_plate</name> | ||
| 479 | - <rename>车牌号</rename> | ||
| 480 | - <update>Y</update> | ||
| 481 | - </value> | ||
| 482 | - <value> | ||
| 483 | - <name>car_code</name> | ||
| 484 | - <rename>车辆编码</rename> | ||
| 485 | - <update>Y</update> | ||
| 486 | - </value> | ||
| 487 | - <value> | ||
| 488 | - <name>inside_code</name> | ||
| 489 | - <rename>内部编码</rename> | ||
| 490 | - <update>Y</update> | ||
| 491 | - </value> | ||
| 492 | - <value> | ||
| 493 | - <name>company</name> | ||
| 494 | - <rename>所属公司</rename> | ||
| 495 | - <update>Y</update> | ||
| 496 | - </value> | ||
| 497 | - <value> | ||
| 498 | - <name>business_code</name> | ||
| 499 | - <rename>所属公司代码</rename> | ||
| 500 | - <update>Y</update> | ||
| 501 | - </value> | ||
| 502 | - <value> | ||
| 503 | - <name>branche_company</name> | ||
| 504 | - <rename>所属分公司</rename> | ||
| 505 | - <update>Y</update> | ||
| 506 | - </value> | ||
| 507 | - <value> | ||
| 508 | - <name>branche_company_code</name> | ||
| 509 | - <rename>所属分公司代码</rename> | ||
| 510 | - <update>Y</update> | ||
| 511 | - </value> | ||
| 512 | - <value> | ||
| 513 | - <name>supplier_name</name> | ||
| 514 | - <rename>设备供应厂商</rename> | ||
| 515 | - <update>Y</update> | ||
| 516 | - </value> | ||
| 517 | - <value> | ||
| 518 | - <name>equipment_code</name> | ||
| 519 | - <rename>设备终端号</rename> | ||
| 520 | - <update>Y</update> | ||
| 521 | - </value> | ||
| 522 | - </lookup> | ||
| 523 | - <cluster_schema/> | ||
| 524 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 525 | - <xloc>516</xloc> | ||
| 526 | - <yloc>138</yloc> | ||
| 527 | - <draw>Y</draw> | ||
| 528 | - </GUI> | ||
| 529 | - </step> | ||
| 530 | - | ||
| 531 | - <step> | ||
| 532 | - <name>获取变量</name> | ||
| 533 | - <type>GetVariable</type> | ||
| 534 | - <description/> | ||
| 535 | - <distribute>Y</distribute> | ||
| 536 | - <custom_distribution/> | ||
| 537 | - <copies>1</copies> | ||
| 538 | - <partitioning> | ||
| 539 | - <method>none</method> | ||
| 540 | - <schema_name/> | ||
| 541 | - </partitioning> | ||
| 542 | - <fields> | ||
| 543 | - <field> | ||
| 544 | - <name>filepath_</name> | ||
| 545 | - <variable>${filepath}</variable> | ||
| 546 | - <type>String</type> | ||
| 547 | - <format/> | ||
| 548 | - <currency/> | ||
| 549 | - <decimal/> | ||
| 550 | - <group/> | ||
| 551 | - <length>-1</length> | ||
| 552 | - <precision>-1</precision> | ||
| 553 | - <trim_type>none</trim_type> | ||
| 554 | - </field> | ||
| 555 | - <field> | ||
| 556 | - <name>erroroutputdir_</name> | ||
| 557 | - <variable>${erroroutputdir}</variable> | ||
| 558 | - <type>String</type> | ||
| 559 | - <format/> | ||
| 560 | - <currency/> | ||
| 561 | - <decimal/> | ||
| 562 | - <group/> | ||
| 563 | - <length>-1</length> | ||
| 564 | - <precision>-1</precision> | ||
| 565 | - <trim_type>none</trim_type> | ||
| 566 | - </field> | ||
| 567 | - </fields> | ||
| 568 | - <cluster_schema/> | ||
| 569 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 570 | - <xloc>134</xloc> | ||
| 571 | - <yloc>183</yloc> | ||
| 572 | - <draw>Y</draw> | ||
| 573 | - </GUI> | ||
| 574 | - </step> | ||
| 575 | - | ||
| 576 | - <step> | ||
| 577 | - <name>错误输出 2</name> | ||
| 578 | - <type>ExcelOutput</type> | ||
| 579 | - <description/> | ||
| 580 | - <distribute>Y</distribute> | ||
| 581 | - <custom_distribution/> | ||
| 582 | - <copies>1</copies> | ||
| 583 | - <partitioning> | ||
| 584 | - <method>none</method> | ||
| 585 | - <schema_name/> | ||
| 586 | - </partitioning> | ||
| 587 | - <header>Y</header> | ||
| 588 | - <footer>N</footer> | ||
| 589 | - <encoding/> | ||
| 590 | - <append>N</append> | ||
| 591 | - <add_to_result_filenames>Y</add_to_result_filenames> | ||
| 592 | - <file> | ||
| 593 | - <name>${erroroutputdir}/车辆基础信息_错误</name> | ||
| 594 | - <extention>xls</extention> | ||
| 595 | - <do_not_open_newfile_init>N</do_not_open_newfile_init> | ||
| 596 | - <create_parent_folder>N</create_parent_folder> | ||
| 597 | - <split>N</split> | ||
| 598 | - <add_date>N</add_date> | ||
| 599 | - <add_time>N</add_time> | ||
| 600 | - <SpecifyFormat>N</SpecifyFormat> | ||
| 601 | - <date_time_format/> | ||
| 602 | - <sheetname>Sheet1</sheetname> | ||
| 603 | - <autosizecolums>N</autosizecolums> | ||
| 604 | - <nullisblank>N</nullisblank> | ||
| 605 | - <protect_sheet>N</protect_sheet> | ||
| 606 | - <password>Encrypted </password> | ||
| 607 | - <splitevery>0</splitevery> | ||
| 608 | - <usetempfiles>N</usetempfiles> | ||
| 609 | - <tempdirectory/> | ||
| 610 | - </file> | ||
| 611 | - <template> | ||
| 612 | - <enabled>N</enabled> | ||
| 613 | - <append>N</append> | ||
| 614 | - <filename>template.xls</filename> | ||
| 615 | - </template> | ||
| 616 | - <fields> | ||
| 617 | - <field> | ||
| 618 | - <name>车牌号</name> | ||
| 619 | - <type>String</type> | ||
| 620 | - <format/> | ||
| 621 | - </field> | ||
| 622 | - <field> | ||
| 623 | - <name>内部编码</name> | ||
| 624 | - <type>String</type> | ||
| 625 | - <format/> | ||
| 626 | - </field> | ||
| 627 | - <field> | ||
| 628 | - <name>所属公司</name> | ||
| 629 | - <type>String</type> | ||
| 630 | - <format/> | ||
| 631 | - </field> | ||
| 632 | - <field> | ||
| 633 | - <name>所属公司代码</name> | ||
| 634 | - <type>String</type> | ||
| 635 | - <format/> | ||
| 636 | - </field> | ||
| 637 | - <field> | ||
| 638 | - <name>所属分公司</name> | ||
| 639 | - <type>String</type> | ||
| 640 | - <format/> | ||
| 641 | - </field> | ||
| 642 | - <field> | ||
| 643 | - <name>所属分公司代码</name> | ||
| 644 | - <type>String</type> | ||
| 645 | - <format/> | ||
| 646 | - </field> | ||
| 647 | - <field> | ||
| 648 | - <name>设备供应厂商</name> | ||
| 649 | - <type>String</type> | ||
| 650 | - <format/> | ||
| 651 | - </field> | ||
| 652 | - <field> | ||
| 653 | - <name>设备终端号</name> | ||
| 654 | - <type>String</type> | ||
| 655 | - <format/> | ||
| 656 | - </field> | ||
| 657 | - <field> | ||
| 658 | - <name>error_count</name> | ||
| 659 | - <type>Integer</type> | ||
| 660 | - <format/> | ||
| 661 | - </field> | ||
| 662 | - <field> | ||
| 663 | - <name>error_desc</name> | ||
| 664 | - <type>String</type> | ||
| 665 | - <format/> | ||
| 666 | - </field> | ||
| 667 | - <field> | ||
| 668 | - <name>error_column1</name> | ||
| 669 | - <type>String</type> | ||
| 670 | - <format/> | ||
| 671 | - </field> | ||
| 672 | - <field> | ||
| 673 | - <name>error_column2</name> | ||
| 674 | - <type>String</type> | ||
| 675 | - <format/> | ||
| 676 | - </field> | ||
| 677 | - </fields> | ||
| 678 | - <custom> | ||
| 679 | - <header_font_name>arial</header_font_name> | ||
| 680 | - <header_font_size>10</header_font_size> | ||
| 681 | - <header_font_bold>N</header_font_bold> | ||
| 682 | - <header_font_italic>N</header_font_italic> | ||
| 683 | - <header_font_underline>no</header_font_underline> | ||
| 684 | - <header_font_orientation>horizontal</header_font_orientation> | ||
| 685 | - <header_font_color>black</header_font_color> | ||
| 686 | - <header_background_color>none</header_background_color> | ||
| 687 | - <header_row_height>255</header_row_height> | ||
| 688 | - <header_alignment>left</header_alignment> | ||
| 689 | - <header_image/> | ||
| 690 | - <row_font_name>arial</row_font_name> | ||
| 691 | - <row_font_size>10</row_font_size> | ||
| 692 | - <row_font_color>black</row_font_color> | ||
| 693 | - <row_background_color>none</row_background_color> | ||
| 694 | - </custom> | ||
| 695 | - <cluster_schema/> | ||
| 696 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 697 | - <xloc>328</xloc> | ||
| 698 | - <yloc>140</yloc> | ||
| 699 | - <draw>Y</draw> | ||
| 700 | - </GUI> | ||
| 701 | - </step> | ||
| 702 | - | ||
| 703 | - <step_error_handling> | ||
| 704 | - <error> | ||
| 705 | - <source_step>插入/更新bsth_c_cars 2</source_step> | ||
| 706 | - <target_step>错误输出 2</target_step> | ||
| 707 | - <is_enabled>Y</is_enabled> | ||
| 708 | - <nr_valuename>error_count</nr_valuename> | ||
| 709 | - <descriptions_valuename>error_desc</descriptions_valuename> | ||
| 710 | - <fields_valuename>error_column1</fields_valuename> | ||
| 711 | - <codes_valuename>error_column2</codes_valuename> | ||
| 712 | - <max_errors/> | ||
| 713 | - <max_pct_errors/> | ||
| 714 | - <min_pct_rows/> | ||
| 715 | - </error> | ||
| 716 | - </step_error_handling> | ||
| 717 | - <slave-step-copy-partition-distribution> | ||
| 718 | -</slave-step-copy-partition-distribution> | ||
| 719 | - <slave_transformation>N</slave_transformation> | ||
| 720 | - | ||
| 721 | -</transformation> | 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<transformation> | ||
| 3 | + <info> | ||
| 4 | + <name>车辆信息导入</name> | ||
| 5 | + <description>车辆信息导入</description> | ||
| 6 | + <extended_description>车辆基础信息</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>erroroutputdir</name> | ||
| 14 | + <default_value/> | ||
| 15 | + <description>ktr step配置的错误输出目录</description> | ||
| 16 | + </parameter> | ||
| 17 | + <parameter> | ||
| 18 | + <name>filepath</name> | ||
| 19 | + <default_value/> | ||
| 20 | + <description>待处理导入的excel文件</description> | ||
| 21 | + </parameter> | ||
| 22 | + </parameters> | ||
| 23 | + <log> | ||
| 24 | +<trans-log-table><connection/> | ||
| 25 | +<schema/> | ||
| 26 | +<table/> | ||
| 27 | +<size_limit_lines/> | ||
| 28 | +<interval/> | ||
| 29 | +<timeout_days/> | ||
| 30 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table> | ||
| 31 | +<perf-log-table><connection/> | ||
| 32 | +<schema/> | ||
| 33 | +<table/> | ||
| 34 | +<interval/> | ||
| 35 | +<timeout_days/> | ||
| 36 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table> | ||
| 37 | +<channel-log-table><connection/> | ||
| 38 | +<schema/> | ||
| 39 | +<table/> | ||
| 40 | +<timeout_days/> | ||
| 41 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table> | ||
| 42 | +<step-log-table><connection/> | ||
| 43 | +<schema/> | ||
| 44 | +<table/> | ||
| 45 | +<timeout_days/> | ||
| 46 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table> | ||
| 47 | +<metrics-log-table><connection/> | ||
| 48 | +<schema/> | ||
| 49 | +<table/> | ||
| 50 | +<timeout_days/> | ||
| 51 | +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table> | ||
| 52 | + </log> | ||
| 53 | + <maxdate> | ||
| 54 | + <connection/> | ||
| 55 | + <table/> | ||
| 56 | + <field/> | ||
| 57 | + <offset>0.0</offset> | ||
| 58 | + <maxdiff>0.0</maxdiff> | ||
| 59 | + </maxdate> | ||
| 60 | + <size_rowset>10000</size_rowset> | ||
| 61 | + <sleep_time_empty>50</sleep_time_empty> | ||
| 62 | + <sleep_time_full>50</sleep_time_full> | ||
| 63 | + <unique_connections>N</unique_connections> | ||
| 64 | + <feedback_shown>Y</feedback_shown> | ||
| 65 | + <feedback_size>50000</feedback_size> | ||
| 66 | + <using_thread_priorities>Y</using_thread_priorities> | ||
| 67 | + <shared_objects_file/> | ||
| 68 | + <capture_step_performance>N</capture_step_performance> | ||
| 69 | + <step_performance_capturing_delay>1000</step_performance_capturing_delay> | ||
| 70 | + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit> | ||
| 71 | + <dependencies> | ||
| 72 | + </dependencies> | ||
| 73 | + <partitionschemas> | ||
| 74 | + </partitionschemas> | ||
| 75 | + <slaveservers> | ||
| 76 | + </slaveservers> | ||
| 77 | + <clusterschemas> | ||
| 78 | + </clusterschemas> | ||
| 79 | + <created_user>-</created_user> | ||
| 80 | + <created_date>2016/06/23 17:44:46.781</created_date> | ||
| 81 | + <modified_user>-</modified_user> | ||
| 82 | + <modified_date>2016/06/23 17:44:46.781</modified_date> | ||
| 83 | + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key> | ||
| 84 | + <is_key_private>N</is_key_private> | ||
| 85 | + </info> | ||
| 86 | + <notepads> | ||
| 87 | + </notepads> | ||
| 88 | + <connection> | ||
| 89 | + <name>192.168.168.1_jwgl_dw</name> | ||
| 90 | + <server>192.168.168.1</server> | ||
| 91 | + <type>ORACLE</type> | ||
| 92 | + <access>Native</access> | ||
| 93 | + <database>orcl</database> | ||
| 94 | + <port>1521</port> | ||
| 95 | + <username>jwgl_dw</username> | ||
| 96 | + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password> | ||
| 97 | + <servername/> | ||
| 98 | + <data_tablespace/> | ||
| 99 | + <index_tablespace/> | ||
| 100 | + <attributes> | ||
| 101 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 102 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 103 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 104 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 105 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 106 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 107 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 108 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 109 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 110 | + </attributes> | ||
| 111 | + </connection> | ||
| 112 | + <connection> | ||
| 113 | + <name>bus_control_variable</name> | ||
| 114 | + <server>${v_db_ip}</server> | ||
| 115 | + <type>MYSQL</type> | ||
| 116 | + <access>Native</access> | ||
| 117 | + <database>${v_db_dname}</database> | ||
| 118 | + <port>3306</port> | ||
| 119 | + <username>${v_db_uname}</username> | ||
| 120 | + <password>${v_db_pwd}</password> | ||
| 121 | + <servername/> | ||
| 122 | + <data_tablespace/> | ||
| 123 | + <index_tablespace/> | ||
| 124 | + <attributes> | ||
| 125 | + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute> | ||
| 126 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 127 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 128 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 129 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 130 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 131 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 132 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 133 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 134 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 135 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 136 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 137 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 138 | + </attributes> | ||
| 139 | + </connection> | ||
| 140 | + <connection> | ||
| 141 | + <name>bus_control_公司_201</name> | ||
| 142 | + <server>localhost</server> | ||
| 143 | + <type>MYSQL</type> | ||
| 144 | + <access>Native</access> | ||
| 145 | + <database>control</database> | ||
| 146 | + <port>3306</port> | ||
| 147 | + <username>root</username> | ||
| 148 | + <password>Encrypted </password> | ||
| 149 | + <servername/> | ||
| 150 | + <data_tablespace/> | ||
| 151 | + <index_tablespace/> | ||
| 152 | + <attributes> | ||
| 153 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 154 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 155 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 156 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 157 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 158 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 159 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 160 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 161 | + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute> | ||
| 162 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 163 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 164 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 165 | + </attributes> | ||
| 166 | + </connection> | ||
| 167 | + <connection> | ||
| 168 | + <name>bus_control_本机</name> | ||
| 169 | + <server>localhost</server> | ||
| 170 | + <type>MYSQL</type> | ||
| 171 | + <access>Native</access> | ||
| 172 | + <database>control</database> | ||
| 173 | + <port>3306</port> | ||
| 174 | + <username>root</username> | ||
| 175 | + <password>Encrypted </password> | ||
| 176 | + <servername/> | ||
| 177 | + <data_tablespace/> | ||
| 178 | + <index_tablespace/> | ||
| 179 | + <attributes> | ||
| 180 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 181 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 182 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 183 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 184 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 185 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 186 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 187 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 188 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 189 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 190 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 191 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 192 | + </attributes> | ||
| 193 | + </connection> | ||
| 194 | + <connection> | ||
| 195 | + <name>xlab_mysql_youle</name> | ||
| 196 | + <server>101.231.124.8</server> | ||
| 197 | + <type>MYSQL</type> | ||
| 198 | + <access>Native</access> | ||
| 199 | + <database>xlab_youle</database> | ||
| 200 | + <port>45687</port> | ||
| 201 | + <username>xlab-youle</username> | ||
| 202 | + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password> | ||
| 203 | + <servername/> | ||
| 204 | + <data_tablespace/> | ||
| 205 | + <index_tablespace/> | ||
| 206 | + <attributes> | ||
| 207 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 208 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 209 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 210 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 211 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 212 | + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute> | ||
| 213 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 214 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 215 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 216 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 217 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 218 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 219 | + </attributes> | ||
| 220 | + </connection> | ||
| 221 | + <connection> | ||
| 222 | + <name>xlab_mysql_youle(本机)</name> | ||
| 223 | + <server>localhost</server> | ||
| 224 | + <type>MYSQL</type> | ||
| 225 | + <access>Native</access> | ||
| 226 | + <database>xlab_youle</database> | ||
| 227 | + <port>3306</port> | ||
| 228 | + <username>root</username> | ||
| 229 | + <password>Encrypted </password> | ||
| 230 | + <servername/> | ||
| 231 | + <data_tablespace/> | ||
| 232 | + <index_tablespace/> | ||
| 233 | + <attributes> | ||
| 234 | + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute> | ||
| 235 | + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute> | ||
| 236 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 237 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 238 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 239 | + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> | ||
| 240 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 241 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 242 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 243 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 244 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute> | ||
| 245 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 246 | + </attributes> | ||
| 247 | + </connection> | ||
| 248 | + <connection> | ||
| 249 | + <name>xlab_youle</name> | ||
| 250 | + <server/> | ||
| 251 | + <type>MYSQL</type> | ||
| 252 | + <access>JNDI</access> | ||
| 253 | + <database>xlab_youle</database> | ||
| 254 | + <port>1521</port> | ||
| 255 | + <username/> | ||
| 256 | + <password>Encrypted </password> | ||
| 257 | + <servername/> | ||
| 258 | + <data_tablespace/> | ||
| 259 | + <index_tablespace/> | ||
| 260 | + <attributes> | ||
| 261 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | ||
| 262 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | ||
| 263 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | ||
| 264 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | ||
| 265 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | ||
| 266 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | ||
| 267 | + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute> | ||
| 268 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 269 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | ||
| 270 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | ||
| 271 | + </attributes> | ||
| 272 | + </connection> | ||
| 273 | + <order> | ||
| 274 | + <hop> <from>获取变量</from><to>原始系统导出的Excel输入</to><enabled>Y</enabled> </hop> | ||
| 275 | + <hop> <from>插入/更新bsth_c_cars 2</from><to>错误输出 2</to><enabled>Y</enabled> </hop> | ||
| 276 | + <hop> <from>原始系统导出的Excel输入</from><to>插入/更新bsth_c_cars 2</to><enabled>Y</enabled> </hop> | ||
| 277 | + </order> | ||
| 278 | + <step> | ||
| 279 | + <name>原始系统导出的Excel输入</name> | ||
| 280 | + <type>ExcelInput</type> | ||
| 281 | + <description/> | ||
| 282 | + <distribute>Y</distribute> | ||
| 283 | + <custom_distribution/> | ||
| 284 | + <copies>1</copies> | ||
| 285 | + <partitioning> | ||
| 286 | + <method>none</method> | ||
| 287 | + <schema_name/> | ||
| 288 | + </partitioning> | ||
| 289 | + <header>Y</header> | ||
| 290 | + <noempty>Y</noempty> | ||
| 291 | + <stoponempty>N</stoponempty> | ||
| 292 | + <filefield/> | ||
| 293 | + <sheetfield/> | ||
| 294 | + <sheetrownumfield/> | ||
| 295 | + <rownumfield/> | ||
| 296 | + <sheetfield/> | ||
| 297 | + <filefield/> | ||
| 298 | + <limit>0</limit> | ||
| 299 | + <encoding/> | ||
| 300 | + <add_to_result_filenames>Y</add_to_result_filenames> | ||
| 301 | + <accept_filenames>Y</accept_filenames> | ||
| 302 | + <accept_field>filepath_</accept_field> | ||
| 303 | + <accept_stepname>获取变量</accept_stepname> | ||
| 304 | + <file> | ||
| 305 | + <name/> | ||
| 306 | + <filemask/> | ||
| 307 | + <exclude_filemask/> | ||
| 308 | + <file_required>N</file_required> | ||
| 309 | + <include_subfolders>N</include_subfolders> | ||
| 310 | + </file> | ||
| 311 | + <fields> | ||
| 312 | + <field> | ||
| 313 | + <name>车牌号</name> | ||
| 314 | + <type>String</type> | ||
| 315 | + <length>-1</length> | ||
| 316 | + <precision>-1</precision> | ||
| 317 | + <trim_type>none</trim_type> | ||
| 318 | + <repeat>N</repeat> | ||
| 319 | + <format/> | ||
| 320 | + <currency/> | ||
| 321 | + <decimal/> | ||
| 322 | + <group/> | ||
| 323 | + </field> | ||
| 324 | + <field> | ||
| 325 | + <name>车辆编码</name> | ||
| 326 | + <type>String</type> | ||
| 327 | + <length>-1</length> | ||
| 328 | + <precision>-1</precision> | ||
| 329 | + <trim_type>none</trim_type> | ||
| 330 | + <repeat>N</repeat> | ||
| 331 | + <format/> | ||
| 332 | + <currency/> | ||
| 333 | + <decimal/> | ||
| 334 | + <group/> | ||
| 335 | + </field> | ||
| 336 | + <field> | ||
| 337 | + <name>内部编码</name> | ||
| 338 | + <type>String</type> | ||
| 339 | + <length>-1</length> | ||
| 340 | + <precision>-1</precision> | ||
| 341 | + <trim_type>none</trim_type> | ||
| 342 | + <repeat>N</repeat> | ||
| 343 | + <format/> | ||
| 344 | + <currency/> | ||
| 345 | + <decimal/> | ||
| 346 | + <group/> | ||
| 347 | + </field> | ||
| 348 | + <field> | ||
| 349 | + <name>所属公司</name> | ||
| 350 | + <type>String</type> | ||
| 351 | + <length>-1</length> | ||
| 352 | + <precision>-1</precision> | ||
| 353 | + <trim_type>none</trim_type> | ||
| 354 | + <repeat>N</repeat> | ||
| 355 | + <format/> | ||
| 356 | + <currency/> | ||
| 357 | + <decimal/> | ||
| 358 | + <group/> | ||
| 359 | + </field> | ||
| 360 | + <field> | ||
| 361 | + <name>所属公司代码</name> | ||
| 362 | + <type>String</type> | ||
| 363 | + <length>-1</length> | ||
| 364 | + <precision>-1</precision> | ||
| 365 | + <trim_type>none</trim_type> | ||
| 366 | + <repeat>N</repeat> | ||
| 367 | + <format/> | ||
| 368 | + <currency/> | ||
| 369 | + <decimal/> | ||
| 370 | + <group/> | ||
| 371 | + </field> | ||
| 372 | + <field> | ||
| 373 | + <name>所属分公司</name> | ||
| 374 | + <type>String</type> | ||
| 375 | + <length>-1</length> | ||
| 376 | + <precision>-1</precision> | ||
| 377 | + <trim_type>none</trim_type> | ||
| 378 | + <repeat>N</repeat> | ||
| 379 | + <format/> | ||
| 380 | + <currency/> | ||
| 381 | + <decimal/> | ||
| 382 | + <group/> | ||
| 383 | + </field> | ||
| 384 | + <field> | ||
| 385 | + <name>所属分公司代码</name> | ||
| 386 | + <type>String</type> | ||
| 387 | + <length>-1</length> | ||
| 388 | + <precision>-1</precision> | ||
| 389 | + <trim_type>none</trim_type> | ||
| 390 | + <repeat>N</repeat> | ||
| 391 | + <format/> | ||
| 392 | + <currency/> | ||
| 393 | + <decimal/> | ||
| 394 | + <group/> | ||
| 395 | + </field> | ||
| 396 | + <field> | ||
| 397 | + <name>设备供应厂商</name> | ||
| 398 | + <type>String</type> | ||
| 399 | + <length>-1</length> | ||
| 400 | + <precision>-1</precision> | ||
| 401 | + <trim_type>none</trim_type> | ||
| 402 | + <repeat>N</repeat> | ||
| 403 | + <format/> | ||
| 404 | + <currency/> | ||
| 405 | + <decimal/> | ||
| 406 | + <group/> | ||
| 407 | + </field> | ||
| 408 | + <field> | ||
| 409 | + <name>设备终端号</name> | ||
| 410 | + <type>String</type> | ||
| 411 | + <length>-1</length> | ||
| 412 | + <precision>-1</precision> | ||
| 413 | + <trim_type>none</trim_type> | ||
| 414 | + <repeat>N</repeat> | ||
| 415 | + <format/> | ||
| 416 | + <currency/> | ||
| 417 | + <decimal/> | ||
| 418 | + <group/> | ||
| 419 | + </field> | ||
| 420 | + </fields> | ||
| 421 | + <sheets> | ||
| 422 | + <sheet> | ||
| 423 | + <name>工作表1</name> | ||
| 424 | + <startrow>0</startrow> | ||
| 425 | + <startcol>0</startcol> | ||
| 426 | + </sheet> | ||
| 427 | + </sheets> | ||
| 428 | + <strict_types>N</strict_types> | ||
| 429 | + <error_ignored>N</error_ignored> | ||
| 430 | + <error_line_skipped>N</error_line_skipped> | ||
| 431 | + <bad_line_files_destination_directory/> | ||
| 432 | + <bad_line_files_extension>warning</bad_line_files_extension> | ||
| 433 | + <error_line_files_destination_directory/> | ||
| 434 | + <error_line_files_extension>error</error_line_files_extension> | ||
| 435 | + <line_number_files_destination_directory/> | ||
| 436 | + <line_number_files_extension>line</line_number_files_extension> | ||
| 437 | + <shortFileFieldName/> | ||
| 438 | + <pathFieldName/> | ||
| 439 | + <hiddenFieldName/> | ||
| 440 | + <lastModificationTimeFieldName/> | ||
| 441 | + <uriNameFieldName/> | ||
| 442 | + <rootUriNameFieldName/> | ||
| 443 | + <extensionFieldName/> | ||
| 444 | + <sizeFieldName/> | ||
| 445 | + <spreadsheet_type>JXL</spreadsheet_type> | ||
| 446 | + <cluster_schema/> | ||
| 447 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 448 | + <xloc>131</xloc> | ||
| 449 | + <yloc>58</yloc> | ||
| 450 | + <draw>Y</draw> | ||
| 451 | + </GUI> | ||
| 452 | + </step> | ||
| 453 | + | ||
| 454 | + <step> | ||
| 455 | + <name>插入/更新bsth_c_cars 2</name> | ||
| 456 | + <type>InsertUpdate</type> | ||
| 457 | + <description/> | ||
| 458 | + <distribute>Y</distribute> | ||
| 459 | + <custom_distribution/> | ||
| 460 | + <copies>1</copies> | ||
| 461 | + <partitioning> | ||
| 462 | + <method>none</method> | ||
| 463 | + <schema_name/> | ||
| 464 | + </partitioning> | ||
| 465 | + <connection>bus_control_variable</connection> | ||
| 466 | + <commit>1000</commit> | ||
| 467 | + <update_bypassed>N</update_bypassed> | ||
| 468 | + <lookup> | ||
| 469 | + <schema/> | ||
| 470 | + <table>bsth_c_cars</table> | ||
| 471 | + <key> | ||
| 472 | + <name>内部编码</name> | ||
| 473 | + <field>inside_code</field> | ||
| 474 | + <condition>=</condition> | ||
| 475 | + <name2/> | ||
| 476 | + </key> | ||
| 477 | + <value> | ||
| 478 | + <name>car_plate</name> | ||
| 479 | + <rename>车牌号</rename> | ||
| 480 | + <update>Y</update> | ||
| 481 | + </value> | ||
| 482 | + <value> | ||
| 483 | + <name>car_code</name> | ||
| 484 | + <rename>车辆编码</rename> | ||
| 485 | + <update>Y</update> | ||
| 486 | + </value> | ||
| 487 | + <value> | ||
| 488 | + <name>inside_code</name> | ||
| 489 | + <rename>内部编码</rename> | ||
| 490 | + <update>Y</update> | ||
| 491 | + </value> | ||
| 492 | + <value> | ||
| 493 | + <name>company</name> | ||
| 494 | + <rename>所属公司</rename> | ||
| 495 | + <update>Y</update> | ||
| 496 | + </value> | ||
| 497 | + <value> | ||
| 498 | + <name>business_code</name> | ||
| 499 | + <rename>所属公司代码</rename> | ||
| 500 | + <update>Y</update> | ||
| 501 | + </value> | ||
| 502 | + <value> | ||
| 503 | + <name>branche_company</name> | ||
| 504 | + <rename>所属分公司</rename> | ||
| 505 | + <update>Y</update> | ||
| 506 | + </value> | ||
| 507 | + <value> | ||
| 508 | + <name>branche_company_code</name> | ||
| 509 | + <rename>所属分公司代码</rename> | ||
| 510 | + <update>Y</update> | ||
| 511 | + </value> | ||
| 512 | + <value> | ||
| 513 | + <name>supplier_name</name> | ||
| 514 | + <rename>设备供应厂商</rename> | ||
| 515 | + <update>Y</update> | ||
| 516 | + </value> | ||
| 517 | + <value> | ||
| 518 | + <name>equipment_code</name> | ||
| 519 | + <rename>设备终端号</rename> | ||
| 520 | + <update>Y</update> | ||
| 521 | + </value> | ||
| 522 | + </lookup> | ||
| 523 | + <cluster_schema/> | ||
| 524 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 525 | + <xloc>516</xloc> | ||
| 526 | + <yloc>138</yloc> | ||
| 527 | + <draw>Y</draw> | ||
| 528 | + </GUI> | ||
| 529 | + </step> | ||
| 530 | + | ||
| 531 | + <step> | ||
| 532 | + <name>获取变量</name> | ||
| 533 | + <type>GetVariable</type> | ||
| 534 | + <description/> | ||
| 535 | + <distribute>Y</distribute> | ||
| 536 | + <custom_distribution/> | ||
| 537 | + <copies>1</copies> | ||
| 538 | + <partitioning> | ||
| 539 | + <method>none</method> | ||
| 540 | + <schema_name/> | ||
| 541 | + </partitioning> | ||
| 542 | + <fields> | ||
| 543 | + <field> | ||
| 544 | + <name>filepath_</name> | ||
| 545 | + <variable>${filepath}</variable> | ||
| 546 | + <type>String</type> | ||
| 547 | + <format/> | ||
| 548 | + <currency/> | ||
| 549 | + <decimal/> | ||
| 550 | + <group/> | ||
| 551 | + <length>-1</length> | ||
| 552 | + <precision>-1</precision> | ||
| 553 | + <trim_type>none</trim_type> | ||
| 554 | + </field> | ||
| 555 | + <field> | ||
| 556 | + <name>erroroutputdir_</name> | ||
| 557 | + <variable>${erroroutputdir}</variable> | ||
| 558 | + <type>String</type> | ||
| 559 | + <format/> | ||
| 560 | + <currency/> | ||
| 561 | + <decimal/> | ||
| 562 | + <group/> | ||
| 563 | + <length>-1</length> | ||
| 564 | + <precision>-1</precision> | ||
| 565 | + <trim_type>none</trim_type> | ||
| 566 | + </field> | ||
| 567 | + </fields> | ||
| 568 | + <cluster_schema/> | ||
| 569 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 570 | + <xloc>134</xloc> | ||
| 571 | + <yloc>183</yloc> | ||
| 572 | + <draw>Y</draw> | ||
| 573 | + </GUI> | ||
| 574 | + </step> | ||
| 575 | + | ||
| 576 | + <step> | ||
| 577 | + <name>错误输出 2</name> | ||
| 578 | + <type>ExcelOutput</type> | ||
| 579 | + <description/> | ||
| 580 | + <distribute>Y</distribute> | ||
| 581 | + <custom_distribution/> | ||
| 582 | + <copies>1</copies> | ||
| 583 | + <partitioning> | ||
| 584 | + <method>none</method> | ||
| 585 | + <schema_name/> | ||
| 586 | + </partitioning> | ||
| 587 | + <header>Y</header> | ||
| 588 | + <footer>N</footer> | ||
| 589 | + <encoding/> | ||
| 590 | + <append>N</append> | ||
| 591 | + <add_to_result_filenames>Y</add_to_result_filenames> | ||
| 592 | + <file> | ||
| 593 | + <name>${erroroutputdir}/车辆基础信息_错误</name> | ||
| 594 | + <extention>xls</extention> | ||
| 595 | + <do_not_open_newfile_init>N</do_not_open_newfile_init> | ||
| 596 | + <create_parent_folder>N</create_parent_folder> | ||
| 597 | + <split>N</split> | ||
| 598 | + <add_date>N</add_date> | ||
| 599 | + <add_time>N</add_time> | ||
| 600 | + <SpecifyFormat>N</SpecifyFormat> | ||
| 601 | + <date_time_format/> | ||
| 602 | + <sheetname>Sheet1</sheetname> | ||
| 603 | + <autosizecolums>N</autosizecolums> | ||
| 604 | + <nullisblank>N</nullisblank> | ||
| 605 | + <protect_sheet>N</protect_sheet> | ||
| 606 | + <password>Encrypted </password> | ||
| 607 | + <splitevery>0</splitevery> | ||
| 608 | + <usetempfiles>N</usetempfiles> | ||
| 609 | + <tempdirectory/> | ||
| 610 | + </file> | ||
| 611 | + <template> | ||
| 612 | + <enabled>N</enabled> | ||
| 613 | + <append>N</append> | ||
| 614 | + <filename>template.xls</filename> | ||
| 615 | + </template> | ||
| 616 | + <fields> | ||
| 617 | + <field> | ||
| 618 | + <name>车牌号</name> | ||
| 619 | + <type>String</type> | ||
| 620 | + <format/> | ||
| 621 | + </field> | ||
| 622 | + <field> | ||
| 623 | + <name>内部编码</name> | ||
| 624 | + <type>String</type> | ||
| 625 | + <format/> | ||
| 626 | + </field> | ||
| 627 | + <field> | ||
| 628 | + <name>所属公司</name> | ||
| 629 | + <type>String</type> | ||
| 630 | + <format/> | ||
| 631 | + </field> | ||
| 632 | + <field> | ||
| 633 | + <name>所属公司代码</name> | ||
| 634 | + <type>String</type> | ||
| 635 | + <format/> | ||
| 636 | + </field> | ||
| 637 | + <field> | ||
| 638 | + <name>所属分公司</name> | ||
| 639 | + <type>String</type> | ||
| 640 | + <format/> | ||
| 641 | + </field> | ||
| 642 | + <field> | ||
| 643 | + <name>所属分公司代码</name> | ||
| 644 | + <type>String</type> | ||
| 645 | + <format/> | ||
| 646 | + </field> | ||
| 647 | + <field> | ||
| 648 | + <name>设备供应厂商</name> | ||
| 649 | + <type>String</type> | ||
| 650 | + <format/> | ||
| 651 | + </field> | ||
| 652 | + <field> | ||
| 653 | + <name>设备终端号</name> | ||
| 654 | + <type>String</type> | ||
| 655 | + <format/> | ||
| 656 | + </field> | ||
| 657 | + <field> | ||
| 658 | + <name>error_count</name> | ||
| 659 | + <type>Integer</type> | ||
| 660 | + <format/> | ||
| 661 | + </field> | ||
| 662 | + <field> | ||
| 663 | + <name>error_desc</name> | ||
| 664 | + <type>String</type> | ||
| 665 | + <format/> | ||
| 666 | + </field> | ||
| 667 | + <field> | ||
| 668 | + <name>error_column1</name> | ||
| 669 | + <type>String</type> | ||
| 670 | + <format/> | ||
| 671 | + </field> | ||
| 672 | + <field> | ||
| 673 | + <name>error_column2</name> | ||
| 674 | + <type>String</type> | ||
| 675 | + <format/> | ||
| 676 | + </field> | ||
| 677 | + </fields> | ||
| 678 | + <custom> | ||
| 679 | + <header_font_name>arial</header_font_name> | ||
| 680 | + <header_font_size>10</header_font_size> | ||
| 681 | + <header_font_bold>N</header_font_bold> | ||
| 682 | + <header_font_italic>N</header_font_italic> | ||
| 683 | + <header_font_underline>no</header_font_underline> | ||
| 684 | + <header_font_orientation>horizontal</header_font_orientation> | ||
| 685 | + <header_font_color>black</header_font_color> | ||
| 686 | + <header_background_color>none</header_background_color> | ||
| 687 | + <header_row_height>255</header_row_height> | ||
| 688 | + <header_alignment>left</header_alignment> | ||
| 689 | + <header_image/> | ||
| 690 | + <row_font_name>arial</row_font_name> | ||
| 691 | + <row_font_size>10</row_font_size> | ||
| 692 | + <row_font_color>black</row_font_color> | ||
| 693 | + <row_background_color>none</row_background_color> | ||
| 694 | + </custom> | ||
| 695 | + <cluster_schema/> | ||
| 696 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 697 | + <xloc>328</xloc> | ||
| 698 | + <yloc>140</yloc> | ||
| 699 | + <draw>Y</draw> | ||
| 700 | + </GUI> | ||
| 701 | + </step> | ||
| 702 | + | ||
| 703 | + <step_error_handling> | ||
| 704 | + <error> | ||
| 705 | + <source_step>插入/更新bsth_c_cars 2</source_step> | ||
| 706 | + <target_step>错误输出 2</target_step> | ||
| 707 | + <is_enabled>Y</is_enabled> | ||
| 708 | + <nr_valuename>error_count</nr_valuename> | ||
| 709 | + <descriptions_valuename>error_desc</descriptions_valuename> | ||
| 710 | + <fields_valuename>error_column1</fields_valuename> | ||
| 711 | + <codes_valuename>error_column2</codes_valuename> | ||
| 712 | + <max_errors/> | ||
| 713 | + <max_pct_errors/> | ||
| 714 | + <min_pct_rows/> | ||
| 715 | + </error> | ||
| 716 | + </step_error_handling> | ||
| 717 | + <slave-step-copy-partition-distribution> | ||
| 718 | +</slave-step-copy-partition-distribution> | ||
| 719 | + <slave_transformation>N</slave_transformation> | ||
| 720 | + | ||
| 721 | +</transformation> |