Commit 8bde3e6c4d1ce9acb24053fbfc3e552ba3f78995
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
51 changed files
with
1687 additions
and
1565 deletions
src/main/java/com/bsth/XDApplication.java
| ... | ... | @@ -88,14 +88,14 @@ public class XDApplication implements CommandLineRunner { |
| 88 | 88 | ScheduledExecutorService sexec = Application.mainServices; |
| 89 | 89 | //抓取GPS数据 |
| 90 | 90 | gpsDataLoader.setFlag(-1); |
| 91 | - sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS); | |
| 91 | + //sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS); | |
| 92 | 92 | //实际排班更新线程 |
| 93 | - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | |
| 93 | + //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | |
| 94 | 94 | //实际排班延迟入库线程 |
| 95 | - sexec.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS); | |
| 95 | + //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS); | |
| 96 | 96 | |
| 97 | 97 | //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 98 | - sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS); | |
| 98 | + //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public void prodInit(){ |
| ... | ... | @@ -110,7 +110,7 @@ public class XDApplication implements CommandLineRunner { |
| 110 | 110 | //实际排班更新线程 |
| 111 | 111 | sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); |
| 112 | 112 | //实际排班延迟入库线程 |
| 113 | - sexec.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS); | |
| 113 | + sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS); | |
| 114 | 114 | //检查班次误点 |
| 115 | 115 | sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS); |
| 116 | 116 | //调度指令延迟入库 | ... | ... |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -48,8 +48,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 48 | 48 | */ |
| 49 | 49 | @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) |
| 50 | 50 | public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, |
| 51 | - @RequestParam String dfsj,String bcType) { | |
| 52 | - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType); | |
| 51 | + @RequestParam String dfsj,String bcType, | |
| 52 | + @RequestParam(defaultValue = "") String opType) { | |
| 53 | + return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType); | |
| 53 | 54 | } |
| 54 | 55 | |
| 55 | 56 | /** | ... | ... |
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
| ... | ... | @@ -6,9 +6,7 @@ import com.bsth.entity.schedule.GuideboardInfo; |
| 6 | 6 | import com.bsth.repository.schedule.GuideboardInfoRepository; |
| 7 | 7 | import com.bsth.service.schedule.GuideboardInfoService; |
| 8 | 8 | import com.bsth.service.schedule.exception.ScheduleException; |
| 9 | -import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 10 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 12 | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
| 13 | 11 | import org.springframework.web.bind.annotation.RequestMethod; |
| 14 | 12 | import org.springframework.web.bind.annotation.RequestParam; |
| ... | ... | @@ -23,7 +21,6 @@ import java.util.Map; |
| 23 | 21 | */ |
| 24 | 22 | @RestController |
| 25 | 23 | @RequestMapping("gic") |
| 26 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 27 | 24 | public class GuideboardInfoController extends BController<GuideboardInfo, Long> { |
| 28 | 25 | @Autowired |
| 29 | 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 | 3 | import com.bsth.common.ResponseCode; |
| 4 | 4 | import com.bsth.controller.schedule.BController; |
| 5 | 5 | import com.bsth.entity.schedule.TTInfo; |
| 6 | -import com.bsth.service.schedule.exception.ScheduleException; | |
| 7 | 6 | import com.bsth.service.schedule.TTInfoService; |
| 7 | +import com.bsth.service.schedule.exception.ScheduleException; | |
| 8 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | 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 | 270 | Map<String, String> code2SHcode = new HashMap<String, String>(); |
| 271 | 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 | 297 | while (iterator.hasNext()) { |
| 274 | 298 | line = iterator.next(); |
| 275 | 299 | biMap.put(line.getId(), line.getLineCode()); |
| 276 | 300 | code2name.put(line.getLineCode(), line.getName()); |
| 277 | 301 | id2SHcode.put(line.getId(), line.getShanghaiLinecode()); |
| 278 | 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 | 305 | lineId2CodeMap = biMap; | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/ReverseSignalHandle.java
| ... | ... | @@ -38,7 +38,7 @@ public class ReverseSignalHandle extends SignalHandle { |
| 38 | 38 | if (isReverse(gps, prev)) { |
| 39 | 39 | RouteReverse reverse = reverseSearch(prevs, gps); |
| 40 | 40 | |
| 41 | - if (reverse.getCount() >= 3 | |
| 41 | + if (reverse != null && reverse.getCount() >= 3 | |
| 42 | 42 | && reverse.isClose() |
| 43 | 43 | && !GeoCacheData.isEndStation(gps.getLineId(), gps.getUpDown(), reverse.getTurned())) { |
| 44 | 44 | scheduleSignalState.reverseAnalyse(reverse); | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -31,6 +31,7 @@ import org.springframework.stereotype.Component; |
| 31 | 31 | import java.text.ParseException; |
| 32 | 32 | import java.text.SimpleDateFormat; |
| 33 | 33 | import java.util.*; |
| 34 | +import java.util.concurrent.ConcurrentLinkedQueue; | |
| 34 | 35 | |
| 35 | 36 | /** |
| 36 | 37 | * @author PanZhao |
| ... | ... | @@ -59,7 +60,7 @@ public class DayOfSchedule { |
| 59 | 60 | private static Map<String, ScheduleRealInfo> carExecutePlanMap; |
| 60 | 61 | |
| 61 | 62 | // 持久化 |
| 62 | - public static LinkedList<ScheduleRealInfo> pstBuffer; | |
| 63 | + public static ConcurrentLinkedQueue<ScheduleRealInfo> pstBuffer; | |
| 63 | 64 | |
| 64 | 65 | // 排序器 |
| 65 | 66 | private static ScheduleComparator.FCSJ schFCSJComparator; |
| ... | ... | @@ -92,7 +93,7 @@ public class DayOfSchedule { |
| 92 | 93 | lpScheduleMap = ArrayListMultimap.create(); |
| 93 | 94 | |
| 94 | 95 | id2SchedulMap = new HashMap<>(); |
| 95 | - pstBuffer = new LinkedList<>(); | |
| 96 | + pstBuffer = new ConcurrentLinkedQueue<>(); | |
| 96 | 97 | schFCSJComparator = new ScheduleComparator.FCSJ(); |
| 97 | 98 | currSchDateMap = new HashMap<>(); |
| 98 | 99 | carExecutePlanMap = new HashMap<>(); |
| ... | ... | @@ -109,7 +110,7 @@ public class DayOfSchedule { |
| 109 | 110 | private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm"); |
| 110 | 111 | |
| 111 | 112 | //数据恢复 |
| 112 | - private void dataRecovery() { | |
| 113 | + public void dataRecovery() { | |
| 113 | 114 | GpsDataRecovery.run = true; |
| 114 | 115 | |
| 115 | 116 | Collection<LineConfig> confs = lineConfigs.getAll(); | ... | ... |
src/main/java/com/bsth/data/schedule/edit_logs/SchEditLogger.java
0 → 100644
| 1 | +package com.bsth.data.schedule.edit_logs; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 班次修正记录 | |
| 5 | + * Created by panzhao on 2017/5/16. | |
| 6 | + */ | |
| 7 | +public class SchEditLogger { | |
| 8 | + | |
| 9 | + /** | |
| 10 | + * 待发调整 | |
| 11 | + */ | |
| 12 | + public static void dftz(Long id, String remarks, String dfsj, String bcType, String opType){ | |
| 13 | + | |
| 14 | + } | |
| 15 | +} | ... | ... |
src/main/java/com/bsth/data/schedule/thread/SchedulePstThread.java
| ... | ... | @@ -10,7 +10,6 @@ import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; |
| 10 | 10 | import org.springframework.stereotype.Component; |
| 11 | 11 | |
| 12 | 12 | import javax.persistence.EntityNotFoundException; |
| 13 | -import java.util.LinkedList; | |
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * @author PanZhao |
| ... | ... | @@ -29,11 +28,11 @@ public class SchedulePstThread extends Thread { |
| 29 | 28 | @Override |
| 30 | 29 | public void run() { |
| 31 | 30 | |
| 32 | - LinkedList<ScheduleRealInfo> list = DayOfSchedule.pstBuffer; | |
| 31 | + //LinkedList<ScheduleRealInfo> list = DayOfSchedule.pstBuffer; | |
| 33 | 32 | |
| 34 | 33 | ScheduleRealInfo schedule; |
| 35 | 34 | for (int i = 0; i < 1000; i++) { |
| 36 | - schedule = list.poll(); | |
| 35 | + schedule = DayOfSchedule.pstBuffer.poll(); | |
| 37 | 36 | if (null == schedule) |
| 38 | 37 | break; |
| 39 | 38 | |
| ... | ... | @@ -47,7 +46,7 @@ public class SchedulePstThread extends Thread { |
| 47 | 46 | logger.error("EntityNotFoundException error.... 可忽略"); |
| 48 | 47 | } |
| 49 | 48 | catch (Exception e) { |
| 50 | - logger.error("", e); | |
| 49 | + logger.error("班次入库的时候出现未知异常!!", e); | |
| 51 | 50 | } |
| 52 | 51 | } |
| 53 | 52 | } | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| ... | ... | @@ -71,7 +71,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 71 | 71 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 72 | 72 | } |
| 73 | 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 | 77 | list = jdbcTemplate.query(sql, |
| ... | ... | @@ -158,7 +158,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 158 | 158 | |
| 159 | 159 | if(model.length() != 0){ |
| 160 | 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 | 163 | ttList = jdbcTemplate.query(sql, |
| 164 | 164 | new RowMapper<Long>(){ |
| ... | ... | @@ -452,8 +452,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 452 | 452 | if(statu.equals("1")){ |
| 453 | 453 | for(Long time : timeList){ |
| 454 | 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 | 465 | Collections.sort(fcsjs); |
| 458 | 466 | Collections.sort(fcsjAs); |
| 459 | 467 | String[] split = key.split("/"); |
| ... | ... | @@ -514,8 +522,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 514 | 522 | String[] split = key.split("/"); |
| 515 | 523 | if((long)Long.valueOf(split[0]) == xlBm){ |
| 516 | 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 | 535 | Collections.sort(fcsjs); |
| 520 | 536 | Collections.sort(fcsjAs); |
| 521 | 537 | long fcsj = 0l; |
| ... | ... | @@ -613,7 +629,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 613 | 629 | if(sfqr == 1){ |
| 614 | 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 | 634 | list = jdbcTemplate.query(sql, |
| 619 | 635 | new RowMapper<ScheduleRealInfo>(){ |
| ... | ... | @@ -707,7 +723,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 707 | 723 | }); |
| 708 | 724 | |
| 709 | 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 | 728 | ttList = jdbcTemplate.query(sql, |
| 713 | 729 | new RowMapper<Long>(){ |
| ... | ... | @@ -896,9 +912,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 896 | 912 | } |
| 897 | 913 | } |
| 898 | 914 | Collections.sort(keyList2); |
| 899 | - for(long l : keyList2){ | |
| 900 | - System.out.println(l); | |
| 901 | - } | |
| 915 | + | |
| 902 | 916 | for(int i = 1; i < keyList2.size(); i++){ |
| 903 | 917 | long fcsj1 = keyList2.get(i - 1); |
| 904 | 918 | long fcsj2 = keyList2.get(i); |
| ... | ... | @@ -911,7 +925,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 911 | 925 | sjyysj += fcsj2 - fcsj1; |
| 912 | 926 | } |
| 913 | 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 | 1735 | if(company.length() != 0){ |
| 1723 | 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 | 1740 | list = jdbcTemplate.query(sql, |
| 1728 | 1741 | new RowMapper<ScheduleRealInfo>(){ | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -16,6 +16,7 @@ import com.bsth.util.TimeUtils; |
| 16 | 16 | import com.bsth.util.db.DBUtils_MS; |
| 17 | 17 | import com.bsth.webService.trafficManage.geotool.services.InternalPortType; |
| 18 | 18 | import com.bsth.webService.trafficManage.geotool.services.Internal; |
| 19 | +import com.bsth.webService.trafficManage.org.tempuri.Results; | |
| 19 | 20 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; |
| 20 | 21 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 21 | 22 | import org.apache.commons.lang.time.DateUtils; |
| ... | ... | @@ -300,7 +301,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 300 | 301 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 301 | 302 | StringBuffer sf = new StringBuffer(); |
| 302 | 303 | try { |
| 303 | - sf.append("<DLDS>"); | |
| 304 | + int counter = 0; // 计数器 | |
| 305 | + int per = 10; // 每几条线路上传一次路单 | |
| 306 | + | |
| 304 | 307 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); |
| 305 | 308 | List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date); |
| 306 | 309 | Map<String,Object> map = new HashMap<String,Object>(); |
| ... | ... | @@ -314,6 +317,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 314 | 317 | if(line == null || line.getInUse() == null || line.getInUse() == 0){ |
| 315 | 318 | continue; |
| 316 | 319 | } |
| 320 | + if(counter % per == 0){ | |
| 321 | + sf = new StringBuffer(); | |
| 322 | + sf.append("<DLDS>"); | |
| 323 | + } | |
| 324 | + counter ++; | |
| 317 | 325 | sf.append("<DLD>"); |
| 318 | 326 | sf.append("<RQ>"+date+"</RQ>"); |
| 319 | 327 | sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"")+"</XLBM>"); |
| ... | ... | @@ -322,7 +330,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 322 | 330 | sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 323 | 331 | sf.append("<LDList>"); |
| 324 | 332 | |
| 325 | - int seqNumber = 0; | |
| 326 | 333 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 327 | 334 | if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") |
| 328 | 335 | .equals(scheduleRealInfo.getLpName()) |
| ... | ... | @@ -369,17 +376,33 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 369 | 376 | sf.append("</LDList>"); |
| 370 | 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 | 401 | } catch (Exception e) { |
| 378 | 402 | logger.error("setLD:",e); |
| 379 | 403 | e.printStackTrace(); |
| 380 | 404 | }finally{ |
| 381 | - logger.info("setLD:"+sf.toString()); | |
| 382 | - logger.info("setLD:"+result); | |
| 405 | + | |
| 383 | 406 | } |
| 384 | 407 | return result; |
| 385 | 408 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -16,7 +16,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 16 | 16 | |
| 17 | 17 | Map<String, Collection<ScheduleRealInfo>> findByLines(String lines); |
| 18 | 18 | |
| 19 | - Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType); | |
| 19 | + Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType); | |
| 20 | 20 | |
| 21 | 21 | Map<String, Object> destroy(String idsStr/*, int spaceAdjust*/, String remarks, String reason/*, int spaceNum*/); |
| 22 | 22 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -207,7 +207,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 207 | 207 | private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm"); |
| 208 | 208 | |
| 209 | 209 | @Override |
| 210 | - public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType) { | |
| 210 | + public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType) { | |
| 211 | 211 | Map<String, Object> map = new HashMap<>(); |
| 212 | 212 | try { |
| 213 | 213 | |
| ... | ... | @@ -1160,7 +1160,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1160 | 1160 | sch = list.get(i); |
| 1161 | 1161 | |
| 1162 | 1162 | //调整待发 |
| 1163 | - outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null); | |
| 1163 | + outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "间隔调整"); | |
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | rs.put("status", ResponseCode.SUCCESS); |
| ... | ... | @@ -1330,7 +1330,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1330 | 1330 | if (StringUtils.isNotEmpty(jhlc)) { |
| 1331 | 1331 | double jhlcNum = Double.parseDouble(jhlc); |
| 1332 | 1332 | //烂班 |
| 1333 | - if(jhlcNum == 0 && sch.getJhlcOrig() != 0) | |
| 1333 | + if(jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch._isInout()) | |
| 1334 | 1334 | destroy(sch.getId() + "", "", map.get("adjustExps").toString()); |
| 1335 | 1335 | else if(jhlcNum != sch.getJhlc()){ |
| 1336 | 1336 | sch.setJhlc(jhlcNum); |
| ... | ... | @@ -1380,7 +1380,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1380 | 1380 | schedule = dayOfSchedule.get(id); |
| 1381 | 1381 | |
| 1382 | 1382 | if(schedule != null) |
| 1383 | - outgoAdjust(id, null, dfsj, null); | |
| 1383 | + outgoAdjust(id, null, dfsj, null, "批量调整"); | |
| 1384 | 1384 | } |
| 1385 | 1385 | |
| 1386 | 1386 | rs.put("status", ResponseCode.SUCCESS); |
| ... | ... | @@ -3254,7 +3254,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3254 | 3254 | if (StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj())) |
| 3255 | 3255 | continue; |
| 3256 | 3256 | |
| 3257 | - tempMap = outgoAdjust(dc.getSchId(), "", dc.getNew_dfsj(), null); | |
| 3257 | + tempMap = outgoAdjust(dc.getSchId(), "", dc.getNew_dfsj(), null, "批量调整"); | |
| 3258 | 3258 | |
| 3259 | 3259 | if (tempMap.get("status").equals(ResponseCode.SUCCESS)) { |
| 3260 | 3260 | list.addAll((Collection<? extends ScheduleRealInfo>) tempMap.get("ts")); | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -793,260 +793,74 @@ public class ReportServiceImpl implements ReportService{ |
| 793 | 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 | 864 | return newList; |
| 1051 | 865 | } |
| 1052 | 866 | @Override | ... | ... |
src/main/java/com/bsth/service/schedule/datatools/CarConfigInfoDataToolsImpl.java
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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 | 5 | import com.bsth.service.schedule.BService; |
| 6 | 6 | import com.bsth.service.schedule.exception.ScheduleException; |
| 7 | 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 | 8 | import org.slf4j.Logger; |
| 15 | 9 | import org.slf4j.LoggerFactory; |
| 16 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -124,39 +118,16 @@ public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> |
| 124 | 118 | |
| 125 | 119 | @Override |
| 126 | 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 | 124 | @Override |
| 154 | 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 | 129 | @Override |
| 159 | 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 | 3 | import com.bsth.entity.schedule.CarConfigInfo; |
| 4 | 4 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 5 | 5 | import com.bsth.service.schedule.CarConfigInfoService; |
| 6 | -import com.bsth.service.schedule.exception.ScheduleException; | |
| 7 | 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 | 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 | 11 | import org.springframework.stereotype.Service; |
| 14 | 12 | import org.springframework.transaction.annotation.Transactional; |
| 15 | 13 | import org.springframework.util.CollectionUtils; |
| 16 | 14 | |
| 17 | 15 | import java.io.File; |
| 18 | -import java.io.PrintWriter; | |
| 19 | -import java.io.StringWriter; | |
| 20 | 16 | import java.util.HashMap; |
| 21 | 17 | import java.util.List; |
| 22 | 18 | import java.util.Map; |
| ... | ... | @@ -24,78 +20,28 @@ import java.util.Map; |
| 24 | 20 | /** |
| 25 | 21 | * Created by xu on 16/5/9. |
| 26 | 22 | */ |
| 27 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 28 | 23 | @Service |
| 29 | 24 | public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService { |
| 30 | - /** 日志记录器 */ | |
| 31 | - private static Logger LOGGER = LoggerFactory.getLogger(CarConfigInfoServiceImpl.class); | |
| 32 | - | |
| 33 | 25 | @Autowired |
| 34 | - private DataToolsProperties dataToolsProperties; | |
| 26 | + private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 35 | 27 | |
| 36 | 28 | @Autowired |
| 37 | - private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 29 | + @Qualifier(value = "carConfig_dataTool") | |
| 30 | + private DataToolsService dataToolsService; | |
| 38 | 31 | |
| 39 | 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 | 42 | @Override |
| 70 | 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 | 47 | @Transactional | ... | ... |
src/main/java/com/bsth/service/schedule/impl/CarsServiceImpl.java
| ... | ... | @@ -3,89 +3,39 @@ package com.bsth.service.schedule.impl; |
| 3 | 3 | import com.bsth.entity.Cars; |
| 4 | 4 | import com.bsth.service.schedule.CarsService; |
| 5 | 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 | 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 | 9 | import org.springframework.stereotype.Service; |
| 12 | 10 | import org.springframework.transaction.annotation.Transactional; |
| 13 | 11 | import org.springframework.util.CollectionUtils; |
| 14 | 12 | |
| 15 | 13 | import java.io.File; |
| 16 | -import java.io.PrintWriter; | |
| 17 | -import java.io.StringWriter; | |
| 18 | 14 | import java.util.HashMap; |
| 19 | 15 | import java.util.Map; |
| 20 | 16 | |
| 21 | 17 | /** |
| 22 | 18 | * Created by xu on 16/12/8. |
| 23 | 19 | */ |
| 24 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 25 | 20 | @Service(value = "carsServiceImpl_sc") |
| 26 | 21 | public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService { |
| 27 | - /** 日志记录器 */ | |
| 28 | - private static final Logger LOGGER = LoggerFactory.getLogger(CarsServiceImpl.class); | |
| 29 | - | |
| 30 | 22 | @Autowired |
| 31 | - private DataToolsProperties dataToolsProperties; | |
| 23 | + @Qualifier(value = "cars_dataTool") | |
| 24 | + private DataToolsService dataToolsService; | |
| 32 | 25 | |
| 33 | 26 | @Override |
| 34 | 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 | 31 | @Override |
| 62 | 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 | 41 | @Override | ... | ... |
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
| ... | ... | @@ -3,97 +3,43 @@ package com.bsth.service.schedule.impl; |
| 3 | 3 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| 4 | 4 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 5 | 5 | import com.bsth.service.schedule.EmployeeConfigInfoService; |
| 6 | -import com.bsth.service.schedule.exception.ScheduleException; | |
| 7 | 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 | 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 | 11 | import org.springframework.stereotype.Service; |
| 14 | 12 | import org.springframework.transaction.annotation.Transactional; |
| 15 | 13 | import org.springframework.util.CollectionUtils; |
| 16 | 14 | |
| 17 | 15 | import java.io.File; |
| 18 | -import java.io.PrintWriter; | |
| 19 | -import java.io.StringWriter; | |
| 20 | 16 | import java.util.*; |
| 21 | 17 | |
| 22 | 18 | /** |
| 23 | 19 | * Created by xu on 16/5/10. |
| 24 | 20 | */ |
| 25 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 26 | 21 | @Service |
| 27 | 22 | public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService { |
| 28 | - /** 日志记录器 */ | |
| 29 | - private static Logger LOGGER = LoggerFactory.getLogger(EmployeeConfigInfoServiceImpl.class); | |
| 30 | - | |
| 31 | 23 | @Autowired |
| 32 | - private DataToolsProperties dataToolsProperties; | |
| 24 | + private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 33 | 25 | |
| 34 | 26 | @Autowired |
| 35 | - private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 27 | + @Qualifier(value = "employeeConfig_dataTool") | |
| 28 | + private DataToolsService dataToolsService; | |
| 36 | 29 | |
| 37 | 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 | 40 | @Override |
| 68 | 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 | 45 | @Transactional | ... | ... |
src/main/java/com/bsth/service/schedule/impl/EmployeeServiceImpl.java
| ... | ... | @@ -3,89 +3,39 @@ package com.bsth.service.schedule.impl; |
| 3 | 3 | import com.bsth.entity.Personnel; |
| 4 | 4 | import com.bsth.service.schedule.EmployeeService; |
| 5 | 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 | 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 | 9 | import org.springframework.stereotype.Service; |
| 12 | 10 | import org.springframework.transaction.annotation.Transactional; |
| 13 | 11 | import org.springframework.util.CollectionUtils; |
| 14 | 12 | |
| 15 | 13 | import java.io.File; |
| 16 | -import java.io.PrintWriter; | |
| 17 | -import java.io.StringWriter; | |
| 18 | 14 | import java.util.HashMap; |
| 19 | 15 | import java.util.Map; |
| 20 | 16 | |
| 21 | 17 | /** |
| 22 | 18 | * Created by xu on 16/12/15. |
| 23 | 19 | */ |
| 24 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 25 | 20 | @Service |
| 26 | 21 | public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService { |
| 27 | - /** 日志记录器 */ | |
| 28 | - private static final Logger LOGGER = LoggerFactory.getLogger(EmployeeServiceImpl.class); | |
| 29 | - | |
| 30 | 22 | @Autowired |
| 31 | - private DataToolsProperties dataToolsProperties; | |
| 23 | + @Qualifier(value = "employee_dataTool") | |
| 24 | + private DataToolsService dataToolsService; | |
| 32 | 25 | |
| 33 | 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 | 36 | @Override |
| 62 | 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 | 41 | @Override | ... | ... |
src/main/java/com/bsth/service/schedule/impl/GuideboardInfoServiceImpl.java
| ... | ... | @@ -5,18 +5,14 @@ import com.bsth.entity.schedule.TTInfoDetail; |
| 5 | 5 | import com.bsth.service.schedule.GuideboardInfoService; |
| 6 | 6 | import com.bsth.service.schedule.TTInfoDetailService; |
| 7 | 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 | 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 | 11 | import org.springframework.stereotype.Service; |
| 14 | 12 | import org.springframework.util.CollectionUtils; |
| 15 | 13 | |
| 16 | 14 | import javax.transaction.Transactional; |
| 17 | 15 | import java.io.File; |
| 18 | -import java.io.PrintWriter; | |
| 19 | -import java.io.StringWriter; | |
| 20 | 16 | import java.util.HashMap; |
| 21 | 17 | import java.util.List; |
| 22 | 18 | import java.util.Map; |
| ... | ... | @@ -24,14 +20,11 @@ import java.util.Map; |
| 24 | 20 | /** |
| 25 | 21 | * 路牌信息服务。 |
| 26 | 22 | */ |
| 27 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 28 | 23 | @Service |
| 29 | 24 | public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService { |
| 30 | - /** 日志记录器 */ | |
| 31 | - private static final Logger LOGGER = LoggerFactory.getLogger(GuideboardInfoServiceImpl.class); | |
| 32 | - | |
| 33 | 25 | @Autowired |
| 34 | - private DataToolsProperties dataToolsProperties; | |
| 26 | + @Qualifier(value = "gbInfo_dataTool") | |
| 27 | + private DataToolsService dataToolsService; | |
| 35 | 28 | |
| 36 | 29 | @Autowired |
| 37 | 30 | private TTInfoDetailService ttInfoDetailService; |
| ... | ... | @@ -109,65 +102,18 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long |
| 109 | 102 | } |
| 110 | 103 | |
| 111 | 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 | 114 | @Override |
| 142 | 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 | 404 | } |
| 405 | 405 | |
| 406 | 406 | if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out") |
| 407 | - && schedule.getFcsjActual() != null){ | |
| 407 | + && !schedule.getBcType().equals("ldks") && schedule.getFcsjActual() != null){ | |
| 408 | 408 | // String clZbh = schedule.getClZbh(); |
| 409 | 409 | String xlDir = schedule.getXlDir(); |
| 410 | 410 | if(!listMap.containsKey(xlDir)) |
| ... | ... | @@ -526,7 +526,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 526 | 526 | // if(company.length() != 0){ |
| 527 | 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 | 531 | list = jdbcTemplate.query(sql, |
| 532 | 532 | new RowMapper<ScheduleRealInfo>(){ |
| ... | ... | @@ -579,7 +579,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 579 | 579 | |
| 580 | 580 | if(model.length() != 0){ |
| 581 | 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 | 584 | ttList = jdbcTemplate.query(sql, |
| 585 | 585 | new RowMapper<Long>(){ |
| ... | ... | @@ -807,7 +807,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 807 | 807 | // if(company.length() != 0){ |
| 808 | 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 | 812 | list = jdbcTemplate.query(sql, |
| 813 | 813 | new RowMapper<ScheduleRealInfo>(){ |
| ... | ... | @@ -1174,7 +1174,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1174 | 1174 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); |
| 1175 | 1175 | |
| 1176 | 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 | 1178 | continue; |
| 1179 | 1179 | if(schedule.getStatus() == -1){ |
| 1180 | 1180 | continue; |
| ... | ... | @@ -1353,7 +1353,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1353 | 1353 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); |
| 1354 | 1354 | |
| 1355 | 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 | 1357 | continue; |
| 1358 | 1358 | if(schedule.getStatus() == -1){ |
| 1359 | 1359 | continue; | ... | ... |
src/main/java/com/bsth/service/schedule/impl/ScheduleRule1FlatServiceImpl.java
| ... | ... | @@ -3,90 +3,35 @@ package com.bsth.service.schedule.impl; |
| 3 | 3 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 4 | 4 | import com.bsth.service.schedule.ScheduleRule1FlatService; |
| 5 | 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 | 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 | 9 | import org.springframework.stereotype.Service; |
| 12 | 10 | |
| 13 | 11 | import java.io.File; |
| 14 | -import java.io.PrintWriter; | |
| 15 | -import java.io.StringWriter; | |
| 16 | -import java.util.HashMap; | |
| 17 | 12 | import java.util.Map; |
| 18 | 13 | |
| 19 | 14 | /** |
| 20 | 15 | * Created by xu on 16/7/4. |
| 21 | 16 | */ |
| 22 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 23 | 17 | @Service |
| 24 | 18 | public class ScheduleRule1FlatServiceImpl extends BServiceImpl<ScheduleRule1Flat, Long> implements ScheduleRule1FlatService { |
| 25 | - /** 日志记录器 */ | |
| 26 | - private static Logger LOGGER = LoggerFactory.getLogger(ScheduleRule1FlatServiceImpl.class); | |
| 27 | - | |
| 28 | 19 | @Autowired |
| 29 | - private DataToolsProperties dataToolsProperties; | |
| 20 | + @Qualifier(value = "scheduleRule_dataTool") | |
| 21 | + private DataToolsService dataToolsService; | |
| 30 | 22 | |
| 31 | 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 | 33 | @Override |
| 62 | 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 | 21 | import com.bsth.service.StationRouteService; |
| 22 | 22 | import com.bsth.service.schedule.GuideboardInfoService; |
| 23 | 23 | import com.bsth.service.schedule.TTInfoDetailService; |
| 24 | +import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | |
| 24 | 25 | import com.bsth.service.schedule.exception.ScheduleException; |
| 25 | 26 | import com.bsth.service.schedule.utils.DataToolsProperties; |
| 26 | 27 | import com.bsth.service.schedule.utils.DataToolsService; |
| ... | ... | @@ -53,7 +54,6 @@ import java.util.regex.Pattern; |
| 53 | 54 | * Created by xu on 17/1/3. |
| 54 | 55 | */ |
| 55 | 56 | @Service |
| 56 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 57 | 57 | public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> implements TTInfoDetailService { |
| 58 | 58 | /** 日志记录器 */ |
| 59 | 59 | private static final Logger LOGGER = LoggerFactory.getLogger(TTInfoDetailServiceImpl.class); |
| ... | ... | @@ -82,11 +82,16 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 82 | 82 | private SysUserRepository sysUserRepository; |
| 83 | 83 | @Autowired |
| 84 | 84 | private GuideboardInfoRepository guideboardInfoRepository; |
| 85 | + | |
| 85 | 86 | @Autowired |
| 86 | - @Qualifier(value = "dataToolsServiceImpl") | |
| 87 | + @Qualifier(value = "ttInfoDetail_dataTool") | |
| 87 | 88 | private DataToolsService dataToolsService; |
| 88 | 89 | |
| 89 | 90 | @Autowired |
| 91 | + @Qualifier(value = "ttInfoDetail_dataTool") | |
| 92 | + private TTInfoDetailForEdit ttInfoDetailForEdit; | |
| 93 | + | |
| 94 | + @Autowired | |
| 90 | 95 | private JdbcTemplate jdbcTemplate; |
| 91 | 96 | |
| 92 | 97 | /** |
| ... | ... | @@ -115,7 +120,6 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 115 | 120 | |
| 116 | 121 | @Override |
| 117 | 122 | public File uploadFile(String filename, byte[] filedata) throws ScheduleException { |
| 118 | - | |
| 119 | 123 | return dataToolsService.uploadFile(filename, filedata); |
| 120 | 124 | } |
| 121 | 125 | |
| ... | ... | @@ -123,175 +127,26 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 123 | 127 | public void importData( |
| 124 | 128 | File file, |
| 125 | 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 | 133 | @Override |
| 235 | 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 | 138 | @Override |
| 271 | - public EditInfo getEditInfo(Integer xlid, Long ttid) throws ScheduleException { | |
| 139 | + public TTInfoDetailService.EditInfo getEditInfo(Integer xlid, Long ttid) throws ScheduleException { | |
| 272 | 140 | try { |
| 273 | 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 | 144 | String outputFilePath = String.format("ttinfodetail_(id=%s)_foredit-%s", |
| 286 | 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 | 151 | // 1.6、获取最大的发车数,用于输出数据的数量 |
| 297 | 152 | Long maxfcno = ttInfoDetailRepository.findMaxFcno(xlid, ttid); |
| ... | ... | @@ -315,9 +170,9 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 315 | 170 | headarrays[maxfcno.intValue() + 2] = "运营班次/运营里程"; |
| 316 | 171 | |
| 317 | 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 | 177 | int bc_ks = 0; // 空驶班次 |
| 323 | 178 | int bc_yy = 0; // 营运班次 |
| ... | ... | @@ -340,7 +195,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 340 | 195 | String qdzCode = content == null ? "" : content[7]; // 起点站编码 |
| 341 | 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 | 200 | if (StringUtils.isNotEmpty(fzdname)) |
| 346 | 201 | headarrays[c] = fzdname; |
| ... | ... | @@ -374,10 +229,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 374 | 229 | } |
| 375 | 230 | |
| 376 | 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 | 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 | 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
| ... | ... | @@ -475,7 +475,7 @@ |
| 475 | 475 | <name2/> |
| 476 | 476 | </key> |
| 477 | 477 | <value> |
| 478 | - <name>car_gride</name> | |
| 478 | + <name>car_plate</name> | |
| 479 | 479 | <rename>车牌号</rename> |
| 480 | 480 | <update>Y</update> |
| 481 | 481 | </value> |
| ... | ... | @@ -645,7 +645,7 @@ |
| 645 | 645 | <format/> |
| 646 | 646 | </field> |
| 647 | 647 | <field> |
| 648 | - <name>供应商名称</name> | |
| 648 | + <name>设备供应厂商</name> | |
| 649 | 649 | <type>String</type> |
| 650 | 650 | <format/> |
| 651 | 651 | </field> | ... | ... |
src/main/resources/datatools/ktrs/ttinfodetailDataInputMetaData.ktr
| ... | ... | @@ -30,6 +30,11 @@ |
| 30 | 30 | <description>注入元数据的ktr文件</description> |
| 31 | 31 | </parameter> |
| 32 | 32 | <parameter> |
| 33 | + <name>lineinfoid</name> | |
| 34 | + <default_value>1000</default_value> | |
| 35 | + <description>线路标准id</description> | |
| 36 | + </parameter> | |
| 37 | + <parameter> | |
| 33 | 38 | <name>normalizefieldnames</name> |
| 34 | 39 | <default_value>出场,东川路地铁站1,塘泾路尚义路1,东川路地铁站2,塘泾路尚义路2,东川路地铁站3,塘泾路尚义路3,东川路地铁站4,塘泾路尚义路4,东川路地铁站5,塘泾路尚义路5,东川路地铁站6,塘泾路尚义路6,东川路地铁站7,塘泾路尚义路7,东川路地铁站8,塘泾路尚义路8,东川路地铁站9,塘泾路尚义路9,东川路地铁站10,塘泾路尚义路10,进场</default_value> |
| 35 | 40 | <description>数据范式化字段名,以逗号连接</description> |
| ... | ... | @@ -126,6 +131,30 @@ |
| 126 | 131 | <notepads> |
| 127 | 132 | </notepads> |
| 128 | 133 | <connection> |
| 134 | + <name>192.168.168.1_jwgl_dw</name> | |
| 135 | + <server>192.168.168.1</server> | |
| 136 | + <type>ORACLE</type> | |
| 137 | + <access>Native</access> | |
| 138 | + <database>orcl</database> | |
| 139 | + <port>1521</port> | |
| 140 | + <username>jwgl_dw</username> | |
| 141 | + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password> | |
| 142 | + <servername/> | |
| 143 | + <data_tablespace/> | |
| 144 | + <index_tablespace/> | |
| 145 | + <attributes> | |
| 146 | + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> | |
| 147 | + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> | |
| 148 | + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute> | |
| 149 | + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute> | |
| 150 | + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute> | |
| 151 | + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute> | |
| 152 | + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 153 | + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute> | |
| 154 | + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> | |
| 155 | + </attributes> | |
| 156 | + </connection> | |
| 157 | + <connection> | |
| 129 | 158 | <name>bus_control_variable</name> |
| 130 | 159 | <server>${v_db_ip}</server> |
| 131 | 160 | <type>MYSQL</type> |
| ... | ... | @@ -297,7 +326,6 @@ |
| 297 | 326 | <hop> <from>获取线路名称</from><to>增加线路名称metadata</to><enabled>Y</enabled> </hop> |
| 298 | 327 | <hop> <from>增加线路名称metadata</from><to>替换线路名称</to><enabled>Y</enabled> </hop> |
| 299 | 328 | <hop> <from>替换线路名称</from><to>线路名称metadata字段</to><enabled>Y</enabled> </hop> |
| 300 | - <hop> <from>获取停车场名称</from><to>增加停车场名称metadata</to><enabled>Y</enabled> </hop> | |
| 301 | 329 | <hop> <from>增加停车场名称metadata</from><to>替换停车厂名字 </to><enabled>Y</enabled> </hop> |
| 302 | 330 | <hop> <from>替换停车厂名字 </from><to>停车场名称metadata字段</to><enabled>Y</enabled> </hop> |
| 303 | 331 | <hop> <from>获取时刻表名称</from><to>增加时刻表名称metadata</to><enabled>Y</enabled> </hop> |
| ... | ... | @@ -308,6 +336,9 @@ |
| 308 | 336 | <hop> <from>时刻表名称metadata字段</from><to>合并增加常量数据metadata</to><enabled>Y</enabled> </hop> |
| 309 | 337 | <hop> <from>合并增加常量数据metadata</from><to>ETL元数据注入</to><enabled>Y</enabled> </hop> |
| 310 | 338 | <hop> <from>获取时刻表id</from><to>删除之前的明细信息</to><enabled>Y</enabled> </hop> |
| 339 | + <hop> <from>获取线路标准id</from><to>停车场编码</to><enabled>Y</enabled> </hop> | |
| 340 | + <hop> <from>停车场编码</from><to>停车场名称</to><enabled>Y</enabled> </hop> | |
| 341 | + <hop> <from>停车场名称</from><to>增加停车场名称metadata</to><enabled>Y</enabled> </hop> | |
| 311 | 342 | </order> |
| 312 | 343 | <step> |
| 313 | 344 | <name>ETL元数据注入</name> |
| ... | ... | @@ -391,15 +422,15 @@ |
| 391 | 422 | <source_step>增加normalize元数据</source_step> |
| 392 | 423 | <source_field>nfieldname</source_field> |
| 393 | 424 | </mapping> <mapping> <target_step_name>时刻表明细信息Excel输入</target_step_name> |
| 394 | - <target_attribute_key>SHEET_NAME</target_attribute_key> | |
| 395 | - <target_detail>Y</target_detail> | |
| 396 | - <source_step>获取excel文件名</source_step> | |
| 397 | - <source_field>sheetname_</source_field> | |
| 398 | - </mapping> <mapping> <target_step_name>时刻表明细信息Excel输入</target_step_name> | |
| 399 | 425 | <target_attribute_key>LENGTH</target_attribute_key> |
| 400 | 426 | <target_detail>Y</target_detail> |
| 401 | 427 | <source_step>增加excel字段其他元数据</source_step> |
| 402 | 428 | <source_field>length</source_field> |
| 429 | + </mapping> <mapping> <target_step_name>时刻表明细信息Excel输入</target_step_name> | |
| 430 | + <target_attribute_key>SHEET_NAME</target_attribute_key> | |
| 431 | + <target_detail>Y</target_detail> | |
| 432 | + <source_step>获取excel文件名</source_step> | |
| 433 | + <source_field>sheetname_</source_field> | |
| 403 | 434 | </mapping> <mapping> <target_step_name>增加时刻表名字,线路名字,停车场名字</target_step_name> |
| 404 | 435 | <target_attribute_key>NAME</target_attribute_key> |
| 405 | 436 | <target_detail>Y</target_detail> |
| ... | ... | @@ -415,41 +446,41 @@ |
| 415 | 446 | <target_detail>Y</target_detail> |
| 416 | 447 | <source_step>列拆分为多行</source_step> |
| 417 | 448 | <source_field>fieldName</source_field> |
| 449 | + </mapping> <mapping> <target_step_name>行转列</target_step_name> | |
| 450 | + <target_attribute_key>VALUE</target_attribute_key> | |
| 451 | + <target_detail>Y</target_detail> | |
| 452 | + <source_step>列拆分为多行 2</source_step> | |
| 453 | + <source_field>fieldName</source_field> | |
| 418 | 454 | </mapping> <mapping> <target_step_name>Excel输入</target_step_name> |
| 419 | 455 | <target_attribute_key>TRIM_TYPE</target_attribute_key> |
| 420 | 456 | <target_detail>Y</target_detail> |
| 421 | 457 | <source_step>列拆分为多行</source_step> |
| 422 | 458 | <source_field>trim_type</source_field> |
| 423 | 459 | </mapping> <mapping> <target_step_name>行转列</target_step_name> |
| 424 | - <target_attribute_key>VALUE</target_attribute_key> | |
| 460 | + <target_attribute_key>NORMALISED</target_attribute_key> | |
| 425 | 461 | <target_detail>Y</target_detail> |
| 426 | 462 | <source_step>列拆分为多行 2</source_step> |
| 427 | - <source_field>fieldName</source_field> | |
| 463 | + <source_field>value</source_field> | |
| 428 | 464 | </mapping> <mapping> <target_step_name>时刻表明细信息Excel输入</target_step_name> |
| 429 | 465 | <target_attribute_key>REPEAT</target_attribute_key> |
| 430 | 466 | <target_detail>Y</target_detail> |
| 431 | 467 | <source_step>增加excel字段其他元数据</source_step> |
| 432 | 468 | <source_field>repeat</source_field> |
| 433 | - </mapping> <mapping> <target_step_name>行转列</target_step_name> | |
| 434 | - <target_attribute_key>NORMALISED</target_attribute_key> | |
| 435 | - <target_detail>Y</target_detail> | |
| 436 | - <source_step>列拆分为多行 2</source_step> | |
| 437 | - <source_field>value</source_field> | |
| 438 | 469 | </mapping> <mapping> <target_step_name>班次数据范式化</target_step_name> |
| 439 | 470 | <target_attribute_key>NORMALISED</target_attribute_key> |
| 440 | 471 | <target_detail>Y</target_detail> |
| 441 | 472 | <source_step>增加normalize元数据</source_step> |
| 442 | 473 | <source_field>valuefield</source_field> |
| 443 | - </mapping> <mapping> <target_step_name>时刻表明细信息Excel输入</target_step_name> | |
| 444 | - <target_attribute_key>FORMAT</target_attribute_key> | |
| 445 | - <target_detail>Y</target_detail> | |
| 446 | - <source_step>增加excel字段其他元数据</source_step> | |
| 447 | - <source_field>format</source_field> | |
| 448 | 474 | </mapping> <mapping> <target_step_name>班次数据范式化</target_step_name> |
| 449 | 475 | <target_attribute_key>VALUE</target_attribute_key> |
| 450 | 476 | <target_detail>Y</target_detail> |
| 451 | 477 | <source_step>增加normalize元数据</source_step> |
| 452 | 478 | <source_field>nfieldname</source_field> |
| 479 | + </mapping> <mapping> <target_step_name>时刻表明细信息Excel输入</target_step_name> | |
| 480 | + <target_attribute_key>FORMAT</target_attribute_key> | |
| 481 | + <target_detail>Y</target_detail> | |
| 482 | + <source_step>增加excel字段其他元数据</source_step> | |
| 483 | + <source_field>format</source_field> | |
| 453 | 484 | </mapping> <mapping> <target_step_name>Excel输入</target_step_name> |
| 454 | 485 | <target_attribute_key>PRECISION</target_attribute_key> |
| 455 | 486 | <target_detail>Y</target_detail> |
| ... | ... | @@ -457,8 +488,8 @@ |
| 457 | 488 | <source_field>precision</source_field> |
| 458 | 489 | </mapping> </mappings> <cluster_schema/> |
| 459 | 490 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 460 | - <xloc>695</xloc> | |
| 461 | - <yloc>177</yloc> | |
| 491 | + <xloc>876</xloc> | |
| 492 | + <yloc>167</yloc> | |
| 462 | 493 | <draw>Y</draw> |
| 463 | 494 | </GUI> |
| 464 | 495 | </step> |
| ... | ... | @@ -489,8 +520,8 @@ |
| 489 | 520 | </field> <select_unspecified>N</select_unspecified> |
| 490 | 521 | </fields> <cluster_schema/> |
| 491 | 522 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 492 | - <xloc>490</xloc> | |
| 493 | - <yloc>429</yloc> | |
| 523 | + <xloc>743</xloc> | |
| 524 | + <yloc>470</yloc> | |
| 494 | 525 | <draw>Y</draw> |
| 495 | 526 | </GUI> |
| 496 | 527 | </step> |
| ... | ... | @@ -522,8 +553,8 @@ |
| 522 | 553 | </arguments> |
| 523 | 554 | <cluster_schema/> |
| 524 | 555 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 525 | - <xloc>627</xloc> | |
| 526 | - <yloc>26</yloc> | |
| 556 | + <xloc>808</xloc> | |
| 557 | + <yloc>16</yloc> | |
| 527 | 558 | <draw>Y</draw> |
| 528 | 559 | </GUI> |
| 529 | 560 | </step> |
| ... | ... | @@ -541,8 +572,8 @@ |
| 541 | 572 | </partitioning> |
| 542 | 573 | <cluster_schema/> |
| 543 | 574 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 544 | - <xloc>702</xloc> | |
| 545 | - <yloc>383</yloc> | |
| 575 | + <xloc>883</xloc> | |
| 576 | + <yloc>373</yloc> | |
| 546 | 577 | <draw>Y</draw> |
| 547 | 578 | </GUI> |
| 548 | 579 | </step> |
| ... | ... | @@ -634,8 +665,8 @@ |
| 634 | 665 | </fields> |
| 635 | 666 | <cluster_schema/> |
| 636 | 667 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 637 | - <xloc>441</xloc> | |
| 638 | - <yloc>172</yloc> | |
| 668 | + <xloc>622</xloc> | |
| 669 | + <yloc>162</yloc> | |
| 639 | 670 | <draw>Y</draw> |
| 640 | 671 | </GUI> |
| 641 | 672 | </step> |
| ... | ... | @@ -667,8 +698,8 @@ |
| 667 | 698 | </fields> |
| 668 | 699 | <cluster_schema/> |
| 669 | 700 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 670 | - <xloc>447</xloc> | |
| 671 | - <yloc>257</yloc> | |
| 701 | + <xloc>628</xloc> | |
| 702 | + <yloc>247</yloc> | |
| 672 | 703 | <draw>Y</draw> |
| 673 | 704 | </GUI> |
| 674 | 705 | </step> |
| ... | ... | @@ -724,8 +755,8 @@ |
| 724 | 755 | </fields> |
| 725 | 756 | <cluster_schema/> |
| 726 | 757 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 727 | - <xloc>208</xloc> | |
| 728 | - <yloc>428</yloc> | |
| 758 | + <xloc>461</xloc> | |
| 759 | + <yloc>469</yloc> | |
| 729 | 760 | <draw>Y</draw> |
| 730 | 761 | </GUI> |
| 731 | 762 | </step> |
| ... | ... | @@ -781,8 +812,8 @@ |
| 781 | 812 | </fields> |
| 782 | 813 | <cluster_schema/> |
| 783 | 814 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 784 | - <xloc>216</xloc> | |
| 785 | - <yloc>508</yloc> | |
| 815 | + <xloc>608</xloc> | |
| 816 | + <yloc>601</yloc> | |
| 786 | 817 | <draw>Y</draw> |
| 787 | 818 | </GUI> |
| 788 | 819 | </step> |
| ... | ... | @@ -838,8 +869,8 @@ |
| 838 | 869 | </fields> |
| 839 | 870 | <cluster_schema/> |
| 840 | 871 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 841 | - <xloc>202</xloc> | |
| 842 | - <yloc>351</yloc> | |
| 872 | + <xloc>383</xloc> | |
| 873 | + <yloc>341</yloc> | |
| 843 | 874 | <draw>Y</draw> |
| 844 | 875 | </GUI> |
| 845 | 876 | </step> |
| ... | ... | @@ -870,8 +901,8 @@ |
| 870 | 901 | </field> <select_unspecified>N</select_unspecified> |
| 871 | 902 | </fields> <cluster_schema/> |
| 872 | 903 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 873 | - <xloc>496</xloc> | |
| 874 | - <yloc>508</yloc> | |
| 904 | + <xloc>888</xloc> | |
| 905 | + <yloc>601</yloc> | |
| 875 | 906 | <draw>Y</draw> |
| 876 | 907 | </GUI> |
| 877 | 908 | </step> |
| ... | ... | @@ -895,8 +926,8 @@ |
| 895 | 926 | </fields> |
| 896 | 927 | <cluster_schema/> |
| 897 | 928 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 898 | - <xloc>345</xloc> | |
| 899 | - <yloc>430</yloc> | |
| 929 | + <xloc>598</xloc> | |
| 930 | + <yloc>471</yloc> | |
| 900 | 931 | <draw>Y</draw> |
| 901 | 932 | </GUI> |
| 902 | 933 | </step> |
| ... | ... | @@ -920,8 +951,8 @@ |
| 920 | 951 | </fields> |
| 921 | 952 | <cluster_schema/> |
| 922 | 953 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 923 | - <xloc>354</xloc> | |
| 924 | - <yloc>509</yloc> | |
| 954 | + <xloc>746</xloc> | |
| 955 | + <yloc>602</yloc> | |
| 925 | 956 | <draw>Y</draw> |
| 926 | 957 | </GUI> |
| 927 | 958 | </step> |
| ... | ... | @@ -945,8 +976,8 @@ |
| 945 | 976 | </fields> |
| 946 | 977 | <cluster_schema/> |
| 947 | 978 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 948 | - <xloc>340</xloc> | |
| 949 | - <yloc>352</yloc> | |
| 979 | + <xloc>521</xloc> | |
| 980 | + <yloc>342</yloc> | |
| 950 | 981 | <draw>Y</draw> |
| 951 | 982 | </GUI> |
| 952 | 983 | </step> |
| ... | ... | @@ -977,8 +1008,8 @@ |
| 977 | 1008 | </field> <select_unspecified>N</select_unspecified> |
| 978 | 1009 | </fields> <cluster_schema/> |
| 979 | 1010 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 980 | - <xloc>487</xloc> | |
| 981 | - <yloc>353</yloc> | |
| 1011 | + <xloc>668</xloc> | |
| 1012 | + <yloc>343</yloc> | |
| 982 | 1013 | <draw>Y</draw> |
| 983 | 1014 | </GUI> |
| 984 | 1015 | </step> |
| ... | ... | @@ -1010,8 +1041,8 @@ |
| 1010 | 1041 | </fields> |
| 1011 | 1042 | <cluster_schema/> |
| 1012 | 1043 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1013 | - <xloc>71</xloc> | |
| 1014 | - <yloc>163</yloc> | |
| 1044 | + <xloc>252</xloc> | |
| 1045 | + <yloc>153</yloc> | |
| 1015 | 1046 | <draw>Y</draw> |
| 1016 | 1047 | </GUI> |
| 1017 | 1048 | </step> |
| ... | ... | @@ -1067,8 +1098,8 @@ |
| 1067 | 1098 | </fields> |
| 1068 | 1099 | <cluster_schema/> |
| 1069 | 1100 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1070 | - <xloc>120</xloc> | |
| 1071 | - <yloc>62</yloc> | |
| 1101 | + <xloc>301</xloc> | |
| 1102 | + <yloc>52</yloc> | |
| 1072 | 1103 | <draw>Y</draw> |
| 1073 | 1104 | </GUI> |
| 1074 | 1105 | </step> |
| ... | ... | @@ -1100,41 +1131,8 @@ |
| 1100 | 1131 | </fields> |
| 1101 | 1132 | <cluster_schema/> |
| 1102 | 1133 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1103 | - <xloc>80</xloc> | |
| 1104 | - <yloc>261</yloc> | |
| 1105 | - <draw>Y</draw> | |
| 1106 | - </GUI> | |
| 1107 | - </step> | |
| 1108 | - | |
| 1109 | - <step> | |
| 1110 | - <name>获取停车场名称</name> | |
| 1111 | - <type>GetVariable</type> | |
| 1112 | - <description/> | |
| 1113 | - <distribute>Y</distribute> | |
| 1114 | - <custom_distribution/> | |
| 1115 | - <copies>1</copies> | |
| 1116 | - <partitioning> | |
| 1117 | - <method>none</method> | |
| 1118 | - <schema_name/> | |
| 1119 | - </partitioning> | |
| 1120 | - <fields> | |
| 1121 | - <field> | |
| 1122 | - <name>tccname_</name> | |
| 1123 | - <variable>${tccname}</variable> | |
| 1124 | - <type>String</type> | |
| 1125 | - <format/> | |
| 1126 | - <currency/> | |
| 1127 | - <decimal/> | |
| 1128 | - <group/> | |
| 1129 | - <length>-1</length> | |
| 1130 | - <precision>-1</precision> | |
| 1131 | - <trim_type>none</trim_type> | |
| 1132 | - </field> | |
| 1133 | - </fields> | |
| 1134 | - <cluster_schema/> | |
| 1135 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1136 | - <xloc>80</xloc> | |
| 1137 | - <yloc>430</yloc> | |
| 1134 | + <xloc>261</xloc> | |
| 1135 | + <yloc>251</yloc> | |
| 1138 | 1136 | <draw>Y</draw> |
| 1139 | 1137 | </GUI> |
| 1140 | 1138 | </step> |
| ... | ... | @@ -1166,8 +1164,8 @@ |
| 1166 | 1164 | </fields> |
| 1167 | 1165 | <cluster_schema/> |
| 1168 | 1166 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1169 | - <xloc>427</xloc> | |
| 1170 | - <yloc>26</yloc> | |
| 1167 | + <xloc>608</xloc> | |
| 1168 | + <yloc>16</yloc> | |
| 1171 | 1169 | <draw>Y</draw> |
| 1172 | 1170 | </GUI> |
| 1173 | 1171 | </step> |
| ... | ... | @@ -1199,8 +1197,8 @@ |
| 1199 | 1197 | </fields> |
| 1200 | 1198 | <cluster_schema/> |
| 1201 | 1199 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1202 | - <xloc>82</xloc> | |
| 1203 | - <yloc>508</yloc> | |
| 1200 | + <xloc>474</xloc> | |
| 1201 | + <yloc>601</yloc> | |
| 1204 | 1202 | <draw>Y</draw> |
| 1205 | 1203 | </GUI> |
| 1206 | 1204 | </step> |
| ... | ... | @@ -1232,8 +1230,8 @@ |
| 1232 | 1230 | </fields> |
| 1233 | 1231 | <cluster_schema/> |
| 1234 | 1232 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1235 | - <xloc>78</xloc> | |
| 1236 | - <yloc>351</yloc> | |
| 1233 | + <xloc>184</xloc> | |
| 1234 | + <yloc>342</yloc> | |
| 1237 | 1235 | <draw>Y</draw> |
| 1238 | 1236 | </GUI> |
| 1239 | 1237 | </step> |
| ... | ... | @@ -1258,8 +1256,8 @@ |
| 1258 | 1256 | <delimiter_is_regex>N</delimiter_is_regex> |
| 1259 | 1257 | <cluster_schema/> |
| 1260 | 1258 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1261 | - <xloc>261</xloc> | |
| 1262 | - <yloc>163</yloc> | |
| 1259 | + <xloc>442</xloc> | |
| 1260 | + <yloc>153</yloc> | |
| 1263 | 1261 | <draw>Y</draw> |
| 1264 | 1262 | </GUI> |
| 1265 | 1263 | </step> |
| ... | ... | @@ -1284,8 +1282,125 @@ |
| 1284 | 1282 | <delimiter_is_regex>N</delimiter_is_regex> |
| 1285 | 1283 | <cluster_schema/> |
| 1286 | 1284 | <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> |
| 1287 | - <xloc>263</xloc> | |
| 1288 | - <yloc>257</yloc> | |
| 1285 | + <xloc>444</xloc> | |
| 1286 | + <yloc>247</yloc> | |
| 1287 | + <draw>Y</draw> | |
| 1288 | + </GUI> | |
| 1289 | + </step> | |
| 1290 | + | |
| 1291 | + <step> | |
| 1292 | + <name>获取线路标准id</name> | |
| 1293 | + <type>GetVariable</type> | |
| 1294 | + <description/> | |
| 1295 | + <distribute>Y</distribute> | |
| 1296 | + <custom_distribution/> | |
| 1297 | + <copies>1</copies> | |
| 1298 | + <partitioning> | |
| 1299 | + <method>none</method> | |
| 1300 | + <schema_name/> | |
| 1301 | + </partitioning> | |
| 1302 | + <fields> | |
| 1303 | + <field> | |
| 1304 | + <name>lineinfoid_</name> | |
| 1305 | + <variable>${lineinfoid}</variable> | |
| 1306 | + <type>Integer</type> | |
| 1307 | + <format/> | |
| 1308 | + <currency/> | |
| 1309 | + <decimal/> | |
| 1310 | + <group/> | |
| 1311 | + <length>-1</length> | |
| 1312 | + <precision>-1</precision> | |
| 1313 | + <trim_type>none</trim_type> | |
| 1314 | + </field> | |
| 1315 | + </fields> | |
| 1316 | + <cluster_schema/> | |
| 1317 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1318 | + <xloc>74</xloc> | |
| 1319 | + <yloc>468</yloc> | |
| 1320 | + <draw>Y</draw> | |
| 1321 | + </GUI> | |
| 1322 | + </step> | |
| 1323 | + | |
| 1324 | + <step> | |
| 1325 | + <name>停车场编码</name> | |
| 1326 | + <type>DBLookup</type> | |
| 1327 | + <description/> | |
| 1328 | + <distribute>Y</distribute> | |
| 1329 | + <custom_distribution/> | |
| 1330 | + <copies>1</copies> | |
| 1331 | + <partitioning> | |
| 1332 | + <method>none</method> | |
| 1333 | + <schema_name/> | |
| 1334 | + </partitioning> | |
| 1335 | + <connection>bus_control_variable</connection> | |
| 1336 | + <cache>N</cache> | |
| 1337 | + <cache_load_all>N</cache_load_all> | |
| 1338 | + <cache_size>0</cache_size> | |
| 1339 | + <lookup> | |
| 1340 | + <schema/> | |
| 1341 | + <table>bsth_c_line_information</table> | |
| 1342 | + <orderby/> | |
| 1343 | + <fail_on_multiple>N</fail_on_multiple> | |
| 1344 | + <eat_row_on_failure>N</eat_row_on_failure> | |
| 1345 | + <key> | |
| 1346 | + <name>lineinfoid_</name> | |
| 1347 | + <field>id</field> | |
| 1348 | + <condition>=</condition> | |
| 1349 | + <name2/> | |
| 1350 | + </key> | |
| 1351 | + <value> | |
| 1352 | + <name>car_park</name> | |
| 1353 | + <rename>car_park</rename> | |
| 1354 | + <default/> | |
| 1355 | + <type>String</type> | |
| 1356 | + </value> | |
| 1357 | + </lookup> | |
| 1358 | + <cluster_schema/> | |
| 1359 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1360 | + <xloc>182</xloc> | |
| 1361 | + <yloc>467</yloc> | |
| 1362 | + <draw>Y</draw> | |
| 1363 | + </GUI> | |
| 1364 | + </step> | |
| 1365 | + | |
| 1366 | + <step> | |
| 1367 | + <name>停车场名称</name> | |
| 1368 | + <type>DBLookup</type> | |
| 1369 | + <description/> | |
| 1370 | + <distribute>Y</distribute> | |
| 1371 | + <custom_distribution/> | |
| 1372 | + <copies>1</copies> | |
| 1373 | + <partitioning> | |
| 1374 | + <method>none</method> | |
| 1375 | + <schema_name/> | |
| 1376 | + </partitioning> | |
| 1377 | + <connection>bus_control_variable</connection> | |
| 1378 | + <cache>N</cache> | |
| 1379 | + <cache_load_all>N</cache_load_all> | |
| 1380 | + <cache_size>0</cache_size> | |
| 1381 | + <lookup> | |
| 1382 | + <schema/> | |
| 1383 | + <table>bsth_c_car_park</table> | |
| 1384 | + <orderby/> | |
| 1385 | + <fail_on_multiple>N</fail_on_multiple> | |
| 1386 | + <eat_row_on_failure>N</eat_row_on_failure> | |
| 1387 | + <key> | |
| 1388 | + <name>car_park</name> | |
| 1389 | + <field>park_code</field> | |
| 1390 | + <condition>=</condition> | |
| 1391 | + <name2/> | |
| 1392 | + </key> | |
| 1393 | + <value> | |
| 1394 | + <name>park_name</name> | |
| 1395 | + <rename>tccname_</rename> | |
| 1396 | + <default/> | |
| 1397 | + <type>String</type> | |
| 1398 | + </value> | |
| 1399 | + </lookup> | |
| 1400 | + <cluster_schema/> | |
| 1401 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 1402 | + <xloc>319</xloc> | |
| 1403 | + <yloc>468</yloc> | |
| 1289 | 1404 | <draw>Y</draw> |
| 1290 | 1405 | </GUI> |
| 1291 | 1406 | </step> | ... | ... |
src/main/resources/static/pages/report/timetable/timetable.html
| ... | ... | @@ -165,13 +165,14 @@ |
| 165 | 165 | <div class="col-md-6" > |
| 166 | 166 | <table class="table table-bordered table-checkable" id="formsTime5"> |
| 167 | 167 | <tr> |
| 168 | - <td colspan="5">全日分组行驶时间(区间除外)</td> | |
| 168 | + <td colspan="6">全日分组行驶时间(区间除外)</td> | |
| 169 | 169 | </tr> |
| 170 | 170 | <tr> |
| 171 | - <td width="25%" rowspan="2" style="text-align:center;vertical-align:middle;">分组 时间</td> | |
| 172 | - <td width="30%" colspan="2" style="text-align:center;vertical-align:middle;">实驶(分)</td> | |
| 171 | + <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">分组 时间</td> | |
| 172 | + <td width="25%" colspan="2" style="text-align:center;vertical-align:middle;">计划行驶(分)</td> | |
| 173 | 173 | <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">分圈 时间</td> |
| 174 | - <td width="25%" rowspan="2" style="text-align:center;vertical-align:middle;">车距</td> | |
| 174 | + <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">车距区间</td> | |
| 175 | + <td width="15%" rowspan="2" style="text-align:center;vertical-align:middle;">平均车距</td> | |
| 175 | 176 | </tr> |
| 176 | 177 | <tr> |
| 177 | 178 | <td>上行</td> |
| ... | ... | @@ -398,12 +399,13 @@ |
| 398 | 399 | <td align="center">{{result.sxsj}}</td> |
| 399 | 400 | <td align="center">{{result.xxsj}}</td> |
| 400 | 401 | <td align="center">{{result.fqsj}}</td> |
| 401 | - <td align="center">{{result.cj}}</td> | |
| 402 | + <td align="center">{{result.cjqj}}</td> | |
| 403 | + <td align="center">{{result.pjcj}}</td> | |
| 402 | 404 | </tr> |
| 403 | 405 | {{/each}} |
| 404 | 406 | {{if list.length == 0}} |
| 405 | 407 | <tr> |
| 406 | - <td colspan="5"><h6 class="muted">没有找到相关数据</h6></td> | |
| 408 | + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | |
| 407 | 409 | </tr> |
| 408 | 410 | {{/if}} |
| 409 | 411 | </script> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | |
| 14 | 14 | <div class="fixDiv"> |
| 15 | 15 | <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" |
| 16 | - style="width: 1800px; min-height: 500px;"> | |
| 16 | + style="width: 1600px; min-height: 500px;"> | |
| 17 | 17 | <thead> |
| 18 | 18 | <tr role="row" class="heading"> |
| 19 | 19 | <th style="width: 50px;">序号</th> |
| ... | ... | @@ -24,10 +24,8 @@ |
| 24 | 24 | <th style="width: 100px;">车辆</th> |
| 25 | 25 | <th style="width: 80px;">出场时间</th> |
| 26 | 26 | <th style="width: 80px;">进场时间</th> |
| 27 | - <th style="width: 100px;">驾驶员姓名</th> | |
| 28 | - <th style="width: 100px;">驾驶员工号</th> | |
| 29 | - <th style="width: 100px;">售票员姓名</th> | |
| 30 | - <th style="width: 100px;">售票员工号</th> | |
| 27 | + <th style="width: 130px;">驾驶员</th> | |
| 28 | + <th style="width: 130px;">售票员</th> | |
| 31 | 29 | <th>时刻表</th> |
| 32 | 30 | <th style="width: 150px;">修改时间</th> |
| 33 | 31 | <th style="width: 100px;">修改人</th> |
| ... | ... | @@ -72,8 +70,6 @@ |
| 72 | 70 | <td></td> |
| 73 | 71 | <td></td> |
| 74 | 72 | <td></td> |
| 75 | - <td></td> | |
| 76 | - <td></td> | |
| 77 | 73 | </tr> |
| 78 | 74 | </thead> |
| 79 | 75 | <tbody> |
| ... | ... | @@ -114,35 +110,43 @@ |
| 114 | 110 | </a> |
| 115 | 111 | </div> |
| 116 | 112 | </td> |
| 117 | - <td> | |
| 118 | - <div ng-repeat="jsyname in info.jsyNames"> | |
| 119 | - <a href="#"> | |
| 120 | - {{jsyname}} | |
| 121 | - </a> | |
| 122 | - </div> | |
| 123 | - </td> | |
| 124 | - <td> | |
| 125 | - <div ng-repeat="jsygh in info.jsyGhs"> | |
| 126 | - <a href="#"> | |
| 127 | - {{jsygh}} | |
| 128 | - </a> | |
| 129 | - </div> | |
| 130 | - </td> | |
| 131 | - <td> | |
| 132 | - <div ng-repeat="spyname in info.spyNames"> | |
| 133 | - <a href="#"> | |
| 134 | - {{spyname}} | |
| 135 | - </a> | |
| 113 | + <td class="container-fluid"> | |
| 114 | + <div class="row"> | |
| 115 | + <div style="padding-right: 0px;" class="col-md-6"> | |
| 116 | + <div ng-repeat="jsyname in info.jsyNames"> | |
| 117 | + <a href="#"> | |
| 118 | + {{jsyname}} | |
| 119 | + </a> | |
| 120 | + </div> | |
| 121 | + </div> | |
| 122 | + <div style="padding-left: 0px;" class="col-md-6"> | |
| 123 | + <div ng-repeat="jsygh in info.jsyGhs"> | |
| 124 | + <a href="#"> | |
| 125 | + {{jsygh}} | |
| 126 | + </a> | |
| 127 | + </div> | |
| 128 | + </div> | |
| 136 | 129 | </div> |
| 137 | 130 | </td> |
| 138 | - <td> | |
| 139 | - <div ng-repeat="spygh in info.spyGhs"> | |
| 140 | - <a href="#"> | |
| 141 | - {{spygh}} | |
| 142 | - </a> | |
| 131 | + <td class="container-fluid"> | |
| 132 | + <div class="row"> | |
| 133 | + <div style="padding-right: 0px;" class="col-md-6"> | |
| 134 | + <div ng-repeat="spyname in info.spyNames"> | |
| 135 | + <a href="#"> | |
| 136 | + {{spyname}} | |
| 137 | + </a> | |
| 138 | + </div> | |
| 139 | + </div> | |
| 140 | + <div style="padding-left: 0px;" class="col-md-6"> | |
| 141 | + <div ng-repeat="spygh in info.spyGhs"> | |
| 142 | + <a href="#"> | |
| 143 | + {{spygh}} | |
| 144 | + </a> | |
| 145 | + </div> | |
| 146 | + </div> | |
| 143 | 147 | </div> |
| 144 | - </td> | |
| 145 | 148 | |
| 149 | + </td> | |
| 146 | 150 | <td> |
| 147 | 151 | <span ng-bind="info.ttInfoName"></span> |
| 148 | 152 | </td> | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
src/main/resources/static/real_control_v2/fragments/line_schedule/badge_tooltip.html
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
| ... | ... | @@ -115,6 +115,10 @@ |
| 115 | 115 | (function() { |
| 116 | 116 | var modal = '#schedule-dftz-modal' |
| 117 | 117 | ,sch; |
| 118 | + | |
| 119 | + var isInout = function (code) { | |
| 120 | + return code=='out' || code=='in'; | |
| 121 | + }; | |
| 118 | 122 | $(modal).on('init', function(e, data) { |
| 119 | 123 | e.stopPropagation(); |
| 120 | 124 | sch=data.sch; |
| ... | ... | @@ -125,12 +129,12 @@ |
| 125 | 129 | var bctypes=dictionaryUtils.getByGroup('ScheduleType') |
| 126 | 130 | ,opts=''; |
| 127 | 131 | |
| 128 | - if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 132 | + if(isInout(sch.bcType)){ | |
| 129 | 133 | $('[name=bcType]', modal).html('<option value="'+sch.bcType+'">'+bctypes[sch.bcType]+'</option>'); |
| 130 | 134 | } |
| 131 | 135 | else{ |
| 132 | 136 | for(var code in bctypes){ |
| 133 | - if(code!='venting' && code!='major' && code != 'normal') | |
| 137 | + if(isInout(code)) | |
| 134 | 138 | continue; |
| 135 | 139 | opts+='<option value="'+code+'">'+bctypes[code]+'</option>'; |
| 136 | 140 | } |
| ... | ... | @@ -166,10 +170,12 @@ |
| 166 | 170 | url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html'; |
| 167 | 171 | detailModal='#bctype-venting-modal'; |
| 168 | 172 | } |
| 169 | - else{ | |
| 173 | + else if(type=='major'){ | |
| 170 | 174 | detailModal='#bctype-major-modal'; |
| 171 | 175 | url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html'; |
| 172 | 176 | } |
| 177 | + else | |
| 178 | + return; | |
| 173 | 179 | |
| 174 | 180 | $.get(url, function(htmlStr){ |
| 175 | 181 | $(document.body).append(htmlStr); | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| ... | ... | @@ -99,6 +99,8 @@ |
| 99 | 99 | <span class="uk-badge uk-badge-danger">放站</span> |
| 100 | 100 | {{else if sch.bcType == "region"}} |
| 101 | 101 | <span class="uk-badge">区间</span> |
| 102 | + {{else if sch.bcType == "ldks"}} | |
| 103 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 102 | 104 | {{/if}} |
| 103 | 105 | {{if sch.sflj}} |
| 104 | 106 | <span class="uk-badge uk-badge-danger">临加</span> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| ... | ... | @@ -74,6 +74,8 @@ |
| 74 | 74 | <span class="uk-badge uk-badge-danger">放站</span> |
| 75 | 75 | {{else if sch.bcType == "region"}} |
| 76 | 76 | <span class="uk-badge sch_region">区间</span> |
| 77 | + {{else if sch.bcType == "ldks"}} | |
| 78 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 77 | 79 | {{/if}} |
| 78 | 80 | {{if sch.sflj}} |
| 79 | 81 | <span class="uk-badge uk-badge-danger">临加</span> |
| ... | ... | @@ -126,6 +128,8 @@ |
| 126 | 128 | <span class="uk-badge uk-badge-danger">放站</span> |
| 127 | 129 | {{else if bcType == "region"}} |
| 128 | 130 | <span class="uk-badge sch_region">区间</span> |
| 131 | + {{else if bcType == "ldks"}} | |
| 132 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 129 | 133 | {{/if}} |
| 130 | 134 | {{if sflj}} |
| 131 | 135 | <span class="uk-badge uk-badge-danger">临加</span> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/edit.html deleted
100644 → 0
| 1 | -<div class="uk-modal ct-form-modal ct_move_modal" id="history-sch-edit-modal"> | |
| 2 | - <div class="uk-modal-dialog" style="width: 900px;"> | |
| 3 | - <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | - <div class="uk-modal-header"> | |
| 5 | - <h2>历史班次编辑</h2></div> | |
| 6 | - <form class="uk-form uk-form-horizontal"> | |
| 7 | - </form> | |
| 8 | - </div> | |
| 9 | - | |
| 10 | - <script id="history-sch-edit-form-temp" type="text/html"> | |
| 11 | - <input type="hidden" name="id" value="{{id}}"/> | |
| 12 | - | |
| 13 | - <div class="uk-grid"> | |
| 14 | - <div class="uk-width-1-3"> | |
| 15 | - <div class="uk-form-row"> | |
| 16 | - <label class="uk-form-label" >班次类型</label> | |
| 17 | - <div class="uk-form-controls"> | |
| 18 | - <select class="form-control nt-dictionary" disabled data-code="{{bcType}}" name="bcType" data-group=ScheduleType></select> | |
| 19 | - </div> | |
| 20 | - </div> | |
| 21 | - </div> | |
| 22 | - <div class="uk-width-1-3"> | |
| 23 | - <div class="uk-form-row"> | |
| 24 | - <label class="uk-form-label" >起点</label> | |
| 25 | - <div class="uk-form-controls"> | |
| 26 | - <input type="text" value="{{qdzName}}" disabled> | |
| 27 | - </div> | |
| 28 | - </div> | |
| 29 | - </div> | |
| 30 | - <div class="uk-width-1-3"> | |
| 31 | - <div class="uk-form-row"> | |
| 32 | - <label class="uk-form-label" >终点</label> | |
| 33 | - <div class="uk-form-controls"> | |
| 34 | - <input type="text" value="{{zdzName}}" disabled> | |
| 35 | - </div> | |
| 36 | - </div> | |
| 37 | - </div> | |
| 38 | - </div> | |
| 39 | - | |
| 40 | - <div class="uk-grid"> | |
| 41 | - <div class="uk-width-1-3"> | |
| 42 | - <div class="uk-form-row"> | |
| 43 | - <label class="uk-form-label" >车辆</label> | |
| 44 | - <div class="uk-form-controls"> | |
| 45 | - <div class="uk-autocomplete uk-form car-autocom"> | |
| 46 | - <input type="text" value="{{clZbh}}" name="clZbh" required> | |
| 47 | - </div> | |
| 48 | - </div> | |
| 49 | - </div> | |
| 50 | - </div> | |
| 51 | - <div class="uk-width-1-3"> | |
| 52 | - <div class="uk-form-row"> | |
| 53 | - <label class="uk-form-label" >驾驶员</label> | |
| 54 | - <div class="uk-form-controls"> | |
| 55 | - <div class="uk-autocomplete uk-form jsy-autocom"> | |
| 56 | - <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | |
| 57 | - </div> | |
| 58 | - </div> | |
| 59 | - </div> | |
| 60 | - </div> | |
| 61 | - </div> | |
| 62 | - | |
| 63 | - <div class="uk-grid"> | |
| 64 | - <div class="uk-width-1-3"> | |
| 65 | - <div class="uk-form-row"> | |
| 66 | - <label class="uk-form-label" >计发</label> | |
| 67 | - <div class="uk-form-controls"> | |
| 68 | - <input type="text" value="{{fcsj}}" disabled> | |
| 69 | - </div> | |
| 70 | - </div> | |
| 71 | - </div> | |
| 72 | - <div class="uk-width-1-3"> | |
| 73 | - <div class="uk-form-row"> | |
| 74 | - <label class="uk-form-label" >待发</label> | |
| 75 | - <div class="uk-form-controls"> | |
| 76 | - <input type="text" name="dfsj" value="{{dfsj}}" required> | |
| 77 | - </div> | |
| 78 | - </div> | |
| 79 | - </div> | |
| 80 | - <div class="uk-width-1-3"> | |
| 81 | - <div class="uk-form-row"> | |
| 82 | - <label class="uk-form-label" >实发</label> | |
| 83 | - <div class="uk-form-controls"> | |
| 84 | - <input type="text" name="fcsjActual" value="{{fcsjActual}}" > | |
| 85 | - </div> | |
| 86 | - </div> | |
| 87 | - </div> | |
| 88 | - </div> | |
| 89 | - | |
| 90 | - <div class="uk-grid"> | |
| 91 | - <div class="uk-width-1-3"> | |
| 92 | - <div class="uk-form-row"> | |
| 93 | - <label class="uk-form-label" >计划里程</label> | |
| 94 | - <div class="uk-form-controls"> | |
| 95 | - <input type="text" value="{{jhlc}}" disabled> | |
| 96 | - </div> | |
| 97 | - </div> | |
| 98 | - </div> | |
| 99 | - <div class="uk-width-1-3"> | |
| 100 | - <div class="uk-form-row"> | |
| 101 | - <label class="uk-form-label" >计划终点</label> | |
| 102 | - <div class="uk-form-controls"> | |
| 103 | - <input type="text" value="{{zdsj}}" disabled> | |
| 104 | - </div> | |
| 105 | - </div> | |
| 106 | - </div> | |
| 107 | - <div class="uk-width-1-3"> | |
| 108 | - <div class="uk-form-row"> | |
| 109 | - <label class="uk-form-label" >实际终点</label> | |
| 110 | - <div class="uk-form-controls"> | |
| 111 | - <input type="text" name="zdsjActual" value="{{zdsjActual}}" > | |
| 112 | - </div> | |
| 113 | - </div> | |
| 114 | - </div> | |
| 115 | - </div> | |
| 116 | - | |
| 117 | - <div class="uk-grid"> | |
| 118 | - <div class="uk-width-1-1"> | |
| 119 | - <div class="uk-form-row ct-stacked"> | |
| 120 | - <label class="uk-form-label" >备注</label> | |
| 121 | - <div class="uk-form-controls" style="margin-top: 5px;"> | |
| 122 | - <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="100" placeholder="备注">{{remarks}}</textarea> | |
| 123 | - </div> | |
| 124 | - </div> | |
| 125 | - </div> | |
| 126 | - </div> | |
| 127 | - <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 128 | - <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 129 | - <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 130 | - </div> | |
| 131 | - </script> | |
| 132 | - | |
| 133 | - <script> | |
| 134 | - (function() { | |
| 135 | - var modal = '#history-sch-edit-modal' | |
| 136 | - ,sch,parentModal; | |
| 137 | - $(modal).on('init', function(e, data) { | |
| 138 | - var id = data.id; | |
| 139 | - parentModal=data.parentModal; | |
| 140 | - | |
| 141 | - $.get('/realSchedule/'+id, function (sch) { | |
| 142 | - var htmlStr = template('history-sch-edit-form-temp', sch); | |
| 143 | - $('form', modal).html(htmlStr); | |
| 144 | - | |
| 145 | - //字典转换 | |
| 146 | - dictionaryUtils.transformDom($('.nt-dictionary', modal)); | |
| 147 | - | |
| 148 | - //----------- Autocomplete -------------- | |
| 149 | - $.get('/basic/cars', function(rs) { | |
| 150 | - //车辆 | |
| 151 | - gb_common.carAutocomplete($('.car-autocom', modal), rs); | |
| 152 | - }); | |
| 153 | - $.get('/basic/all_personnel', function(rs) { | |
| 154 | - //驾驶员 | |
| 155 | - gb_common.personAutocomplete($('.jsy-autocom', modal), rs); | |
| 156 | - //售票员 | |
| 157 | - gb_common.personAutocomplete($('.spy-autocom', modal), rs); | |
| 158 | - }); | |
| 159 | - | |
| 160 | - | |
| 161 | - //submit | |
| 162 | - var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 163 | - f.on('success.form.fv', function(e) { | |
| 164 | - e.preventDefault(); | |
| 165 | - var data = $(this).serializeJSON(); | |
| 166 | - | |
| 167 | - //拆分驾驶员工号和姓名 | |
| 168 | - data.jGh = data.jsy.split('/')[0]; | |
| 169 | - data.jName = data.jsy.split('/')[1]; | |
| 170 | - delete data.jsy; | |
| 171 | - //拆分售票员工号和姓名 | |
| 172 | - if(data.sGh != null){ | |
| 173 | - data.sGh = data.spy.split('/')[0]; | |
| 174 | - data.sName = data.spy.split('/')[1]; | |
| 175 | - delete data.spy; | |
| 176 | - } | |
| 177 | - | |
| 178 | - gb_common.$post('/realSchedule/history', data, function (rs) { | |
| 179 | - //console.log(rs); | |
| 180 | - UIkit.modal(modal).hide(); | |
| 181 | - $(parentModal).trigger('refresh'); | |
| 182 | - }); | |
| 183 | - }); | |
| 184 | - }); | |
| 185 | - }); | |
| 186 | - })(); | |
| 187 | - </script> | |
| 188 | -</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch_maintain.html
| ... | ... | @@ -86,6 +86,8 @@ |
| 86 | 86 | <span class="uk-badge uk-badge-danger">放站</span> |
| 87 | 87 | {{else if sch.bcType == "region"}} |
| 88 | 88 | <span class="uk-badge sch_region">区间</span> |
| 89 | + {{else if sch.bcType == "ldks"}} | |
| 90 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 89 | 91 | {{/if}} |
| 90 | 92 | {{if sch.sflj}} |
| 91 | 93 | <span class="uk-badge uk-badge-danger">临加</span> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
| ... | ... | @@ -55,7 +55,7 @@ |
| 55 | 55 | </li> |
| 56 | 56 | {{/each}} |
| 57 | 57 | </ul> |
| 58 | - <a class="uk-navbar-brand op-beijingtime-time" title="每次秒数到0与服务器同步一次,睡眠状态唤醒会短暂异常,可鼠标右击横幅任意区域立刻同步!"> | |
| 58 | + <a class="uk-navbar-brand op-beijingtime-time" > | |
| 59 | 59 | <span></span> |
| 60 | 60 | </a> |
| 61 | 61 | <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;"> | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/badge_tooltip.js
| ... | ... | @@ -2,6 +2,36 @@ |
| 2 | 2 | /** badge 悬停 tip 相关 */ |
| 3 | 3 | var gb_schedule_badge_tootip = (function () { |
| 4 | 4 | |
| 5 | + var _opts = { | |
| 6 | + show:{ | |
| 7 | + ready: true, | |
| 8 | + delay: 300 | |
| 9 | + }, | |
| 10 | + position: { | |
| 11 | + viewport: $(window), | |
| 12 | + my: 'center left', | |
| 13 | + at: 'center right' | |
| 14 | + }, | |
| 15 | + hide: { | |
| 16 | + fixed: true, | |
| 17 | + delay: 300 | |
| 18 | + }, | |
| 19 | + events: { | |
| 20 | + hidden: function(event, api) { | |
| 21 | + //destroy dom | |
| 22 | + $(this).qtip('destroy', true); | |
| 23 | + } | |
| 24 | + } | |
| 25 | + }; | |
| 26 | + | |
| 27 | + var getSch = function (e) { | |
| 28 | + var id = $(e).parents('dl').data('id'), | |
| 29 | + lineCode = $(e).parents('li.line_schedule').data('id'), | |
| 30 | + sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 31 | + return sch; | |
| 32 | + }; | |
| 33 | + | |
| 34 | + var _badge = '.schedule-wrap .ct_table_body .uk-badge'; | |
| 5 | 35 | var temps; |
| 6 | 36 | //html 模板 |
| 7 | 37 | $.get('/real_control_v2/fragments/line_schedule/badge_tooltip.html', function(dom) { |
| ... | ... | @@ -9,18 +39,13 @@ var gb_schedule_badge_tootip = (function () { |
| 9 | 39 | }); |
| 10 | 40 | |
| 11 | 41 | //子任务 tootip |
| 12 | - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.c_task', function() { | |
| 42 | + $(document).on('mouseenter', _badge + '.c_task', function() { | |
| 13 | 43 | $(this).qtip({ |
| 14 | - show: { | |
| 15 | - ready: true, | |
| 16 | - delay: 300 | |
| 17 | - }, | |
| 44 | + show: _opts.show, | |
| 18 | 45 | content: { |
| 19 | 46 | text: function() { |
| 20 | - var id = $(this).parents('dl').data('id'), | |
| 21 | - lineCode = $(this).parents('li.line_schedule').data('id'), | |
| 22 | - sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 23 | - //排序 | |
| 47 | + var sch = getSch(this); | |
| 48 | + //子任务排序 | |
| 24 | 49 | var array = sch.cTasks.sort(function (a, b) { |
| 25 | 50 | var an = (a.mileageType=='service'?1:0)+''+(a.destroy?0:1); |
| 26 | 51 | var bn = (b.mileageType=='service'?1:0)+''+(b.destroy?0:1); |
| ... | ... | @@ -29,134 +54,86 @@ var gb_schedule_badge_tootip = (function () { |
| 29 | 54 | return temps['sch-table-task-tootip-temp']({tasks: array}); |
| 30 | 55 | } |
| 31 | 56 | }, |
| 32 | - position: { | |
| 33 | - viewport: $(window), | |
| 34 | - my: 'center left', | |
| 35 | - at: 'center right' | |
| 36 | - }, | |
| 57 | + position: _opts.position, | |
| 37 | 58 | style: { |
| 38 | 59 | classes: 'qtip-light qtip-rounded qtip-shadow sch-badge-tip' |
| 39 | 60 | }, |
| 40 | - hide: { | |
| 41 | - fixed: true, | |
| 42 | - delay: 300 | |
| 43 | - }, | |
| 44 | - events: { | |
| 45 | - hidden: function(event, api) { | |
| 46 | - //destroy dom | |
| 47 | - $(this).qtip('destroy', true); | |
| 48 | - } | |
| 49 | - } | |
| 61 | + hide: _opts.hide, | |
| 62 | + events: _opts.events | |
| 50 | 63 | }); |
| 51 | 64 | }); |
| 52 | 65 | |
| 53 | 66 | //区间 tootip |
| 54 | - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.sch_region', function() { | |
| 67 | + $(document).on('mouseenter', _badge+'.sch_region', function() { | |
| 55 | 68 | $(this).qtip({ |
| 56 | - show: { | |
| 57 | - ready: true, | |
| 58 | - delay: 300 | |
| 59 | - }, | |
| 69 | + show: _opts.show, | |
| 60 | 70 | content: { |
| 61 | 71 | text: function() { |
| 62 | - var id = $(this).parents('dl').data('id'), | |
| 63 | - lineCode = $(this).parents('li.line_schedule').data('id'), | |
| 64 | - sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 65 | - return temps['sch-table-region-tootip-temp'](sch); | |
| 72 | + return temps['sch-table-region-tootip-temp'](getSch(this)); | |
| 66 | 73 | } |
| 67 | 74 | }, |
| 68 | - position: { | |
| 69 | - viewport: $(window), | |
| 70 | - my: 'center left', | |
| 71 | - at: 'center right' | |
| 72 | - }, | |
| 75 | + position: _opts.position, | |
| 73 | 76 | style: { |
| 74 | 77 | classes: 'qtip-youtube sch-badge-tip' |
| 75 | 78 | }, |
| 76 | - hide: { | |
| 77 | - fixed: true, | |
| 78 | - delay: 300 | |
| 79 | - }, | |
| 80 | - events: { | |
| 81 | - hidden: function(event, api) { | |
| 82 | - //destroy dom | |
| 83 | - $(this).qtip('destroy', true); | |
| 84 | - } | |
| 85 | - } | |
| 79 | + hide: _opts.hide, | |
| 80 | + events: _opts.events | |
| 86 | 81 | }); |
| 87 | 82 | }); |
| 88 | 83 | |
| 89 | 84 | |
| 90 | 85 | //出场 tootip |
| 91 | - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.out', function() { | |
| 86 | + $(document).on('mouseenter', _badge+'.out', function() { | |
| 92 | 87 | $(this).qtip({ |
| 93 | - show: { | |
| 94 | - ready: true, | |
| 95 | - delay: 300 | |
| 96 | - }, | |
| 88 | + show: _opts.show, | |
| 97 | 89 | content: { |
| 98 | 90 | text: function() { |
| 99 | - var id = $(this).parents('dl').data('id'), | |
| 100 | - lineCode = $(this).parents('li.line_schedule').data('id'), | |
| 101 | - sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 102 | - return temps['sch-table-out-tootip-temp'](sch); | |
| 91 | + return temps['sch-table-out-tootip-temp'](getSch(this)); | |
| 103 | 92 | } |
| 104 | 93 | }, |
| 105 | - position: { | |
| 106 | - viewport: $(window), | |
| 107 | - my: 'center left', | |
| 108 | - at: 'center right' | |
| 109 | - }, | |
| 94 | + position: _opts.position, | |
| 110 | 95 | style: { |
| 111 | 96 | classes: 'qtip-youtube sch-badge-tip' |
| 112 | 97 | }, |
| 113 | - hide: { | |
| 114 | - fixed: true, | |
| 115 | - delay: 300 | |
| 116 | - }, | |
| 117 | - events: { | |
| 118 | - hidden: function(event, api) { | |
| 119 | - //destroy dom | |
| 120 | - $(this).qtip('destroy', true); | |
| 121 | - } | |
| 122 | - } | |
| 98 | + hide: _opts.hide, | |
| 99 | + events: _opts.events | |
| 123 | 100 | }); |
| 124 | 101 | }); |
| 125 | 102 | |
| 126 | 103 | |
| 127 | 104 | //进场 tootip |
| 128 | - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.in', function() { | |
| 105 | + $(document).on('mouseenter', _badge+'.in', function() { | |
| 129 | 106 | $(this).qtip({ |
| 130 | - show: { | |
| 131 | - ready: true, | |
| 132 | - delay: 300 | |
| 133 | - }, | |
| 107 | + show: _opts.show, | |
| 134 | 108 | content: { |
| 135 | 109 | text: function() { |
| 136 | - var id = $(this).parents('dl').data('id'), | |
| 137 | - lineCode = $(this).parents('li.line_schedule').data('id'), | |
| 138 | - sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 139 | - return temps['sch-table-in-tootip-temp'](sch); | |
| 110 | + return temps['sch-table-in-tootip-temp'](getSch(this)); | |
| 140 | 111 | } |
| 141 | 112 | }, |
| 142 | - position: { | |
| 143 | - viewport: $(window), | |
| 144 | - my: 'center left', | |
| 145 | - at: 'center right' | |
| 146 | - }, | |
| 113 | + position: _opts.position, | |
| 147 | 114 | style: { |
| 148 | 115 | classes: 'qtip-youtube sch-badge-tip' |
| 149 | 116 | }, |
| 150 | - hide: { | |
| 151 | - fixed: true, | |
| 152 | - delay: 300 | |
| 153 | - }, | |
| 154 | - events: { | |
| 155 | - hidden: function(event, api) { | |
| 156 | - //destroy dom | |
| 157 | - $(this).qtip('destroy', true); | |
| 117 | + hide: _opts.hide, | |
| 118 | + events: _opts.events | |
| 119 | + }); | |
| 120 | + }); | |
| 121 | + | |
| 122 | + //2点间空放 | |
| 123 | + $(document).on('mouseenter', _badge+'.sch_ldks', function() { | |
| 124 | + $(this).qtip({ | |
| 125 | + show: _opts.show, | |
| 126 | + content: { | |
| 127 | + text: function() { | |
| 128 | + return temps['sch-table-ldks-tootip-temp'](getSch(this)); | |
| 158 | 129 | } |
| 159 | - } | |
| 130 | + }, | |
| 131 | + position: _opts.position, | |
| 132 | + style: { | |
| 133 | + classes: 'qtip-shadow qtip-bootstrap sch-badge-tip' | |
| 134 | + }, | |
| 135 | + hide: _opts.hide, | |
| 136 | + events: _opts.events | |
| 160 | 137 | }); |
| 161 | 138 | }); |
| 162 | 139 | })(); |
| 163 | 140 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/main.js
src/main/resources/static/real_control_v2/js/minute_timer.js deleted
100644 → 0
| 1 | -/** 时钟 */ | |
| 2 | -var gb_minute_timer = (function () { | |
| 3 | - | |
| 4 | - | |
| 5 | - var getServerTime = function (cb) { | |
| 6 | - function oncallback(jqXHR) { | |
| 7 | - var time = jqXHR && jqXHR.getResponseHeader("Date"); | |
| 8 | - if (time) | |
| 9 | - callback(new Date(time)) | |
| 10 | - } | |
| 11 | - | |
| 12 | - if ("function" == typeof callback) | |
| 13 | - $.ajax({ | |
| 14 | - url: "/real_control_v2/assets/imgs/time.gif", | |
| 15 | - type: "HEAD" | |
| 16 | - }).done(function (data, textStatus, jqXHR) { | |
| 17 | - oncallback(jqXHR) | |
| 18 | - }).fail(function (jqXHR, textStatus, errorThrown) { | |
| 19 | - oncallback(jqXHR) | |
| 20 | - }) | |
| 21 | - }; | |
| 22 | - | |
| 23 | - | |
| 24 | - setTimeout(function () { | |
| 25 | - getServerTime(function () { | |
| 26 | - console.log('cb,,', cb); | |
| 27 | - }); | |
| 28 | - }, 5000); | |
| 29 | - | |
| 30 | -})(); | |
| 31 | 0 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/north/second_timer.js
| ... | ... | @@ -19,7 +19,7 @@ var gb_second_timer = (function () { |
| 19 | 19 | setTime(); |
| 20 | 20 | |
| 21 | 21 | secondTimer = window.setInterval(function () { |
| 22 | - if(0 == now.getSeconds() || true == contextFlag){ | |
| 22 | + if (0 == now.getSeconds() || true == contextFlag) { | |
| 23 | 23 | minuteTimer(); |
| 24 | 24 | contextFlag = false; |
| 25 | 25 | } |
| ... | ... | @@ -48,7 +48,7 @@ var gb_second_timer = (function () { |
| 48 | 48 | }) |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | - var timeFormat = function(str) { | |
| 51 | + var timeFormat = function (str) { | |
| 52 | 52 | return ("0" + str).slice(-2) |
| 53 | 53 | }; |
| 54 | 54 | |
| ... | ... | @@ -57,11 +57,41 @@ var gb_second_timer = (function () { |
| 57 | 57 | }; |
| 58 | 58 | |
| 59 | 59 | var minuteTimer = function () { |
| 60 | - getServerTime(function(time) { | |
| 60 | + getServerTime(function (time) { | |
| 61 | 61 | now = time; |
| 62 | 62 | setTime() |
| 63 | 63 | }) |
| 64 | 64 | }; |
| 65 | 65 | |
| 66 | 66 | window.setTimeout(init, 6000); |
| 67 | + | |
| 68 | +/* $(document).on('mouseenter', '.op-beijingtime-time', function () { | |
| 69 | + $(this).qtip({ | |
| 70 | + show: {ready: true, delay: 300}, | |
| 71 | + content: { | |
| 72 | + text: function () { | |
| 73 | + return '<div class="tl-tip-panel">' + | |
| 74 | + '<div style="font-size: 13px;">' + | |
| 75 | + '每次秒数到0与服务器同步一次<br>服务器每10分钟与国家授时中心标准时间同步一次<br>睡眠状态唤醒会短暂异常,可鼠标右击横幅任意区域立刻同步' + | |
| 76 | + '</div>' + | |
| 77 | + '</div>'; | |
| 78 | + } | |
| 79 | + }, | |
| 80 | + position: { | |
| 81 | + viewport: $(window), | |
| 82 | + my: 'top center', | |
| 83 | + at: 'bottom center' | |
| 84 | + }, | |
| 85 | + style: { | |
| 86 | + classes: 'qtip-shadow qtip-tipped sch-badge-tip' | |
| 87 | + }, | |
| 88 | + hide: {fixed: true, delay: 300}, | |
| 89 | + events: { | |
| 90 | + hidden: function(event, api) { | |
| 91 | + //destroy dom | |
| 92 | + $(this).qtip('destroy', true); | |
| 93 | + } | |
| 94 | + } | |
| 95 | + }); | |
| 96 | + });*/ | |
| 67 | 97 | })(); |
| 68 | 98 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/main.html
| ... | ... | @@ -184,8 +184,6 @@ |
| 184 | 184 | <script src="/real_control_v2/js/websocket/sch_websocket.js" merge="custom_js"></script> |
| 185 | 185 | <!-- tts --> |
| 186 | 186 | <script src="/real_control_v2/js/utils/tts.js" merge="custom_js"></script> |
| 187 | -<!-- minute_timer.js --> | |
| 188 | -<script src="/real_control_v2/js/minute_timer.js" merge="custom_js"></script> | |
| 189 | 187 | |
| 190 | 188 | <!-- echart --> |
| 191 | 189 | <script src="/real_control_v2/assets/echarts-3/echarts.js" merge="plugins"></script> | ... | ... |
src/test/resources/testdata/test6.txt