Commit 6fbc2a7e2355aedda4d89ef34db5bda6415fad99
Committed by
游瑞烽
1 parent
d29c6740
bsthlq <2519941818@qq.com>
Showing
21 changed files
with
1587 additions
and
129 deletions
src/main/java/com/bsth/controller/SectionRouteController.java
| ... | ... | @@ -35,6 +35,16 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer |
| 35 | 35 | @Autowired |
| 36 | 36 | SectionRouteService routeService; |
| 37 | 37 | |
| 38 | + /** | |
| 39 | + * @param String | |
| 40 | + * @throws | |
| 41 | + * @Description: TODO(批量撤销路段) | |
| 42 | + */ | |
| 43 | + @RequestMapping(value = "/batchDestroy", method = RequestMethod.GET) | |
| 44 | + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) { | |
| 45 | + return routeService.updateSectionRouteInfoFormId(map); | |
| 46 | + } | |
| 47 | + | |
| 38 | 48 | /** |
| 39 | 49 | * @param @param map |
| 40 | 50 | * @throws | ... | ... |
src/main/java/com/bsth/controller/StationRouteController.java
| ... | ... | @@ -47,6 +47,16 @@ public class StationRouteController extends BaseController<StationRoute, Integer |
| 47 | 47 | return service.list(map); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | + /** | |
| 51 | + * @param String | |
| 52 | + * @throws | |
| 53 | + * @Description: TODO(批量撤销站点) | |
| 54 | + */ | |
| 55 | + @RequestMapping(value = "/batchDestroy", method = RequestMethod.GET) | |
| 56 | + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) { | |
| 57 | + return service.updateStationRouteInfoFormId(map); | |
| 58 | + } | |
| 59 | + | |
| 50 | 60 | /** |
| 51 | 61 | * @Description :TODO(查询树站点与路段数据) |
| 52 | 62 | * | ... | ... |
src/main/java/com/bsth/repository/SectionRouteRepository.java
| ... | ... | @@ -175,6 +175,10 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int |
| 175 | 175 | @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+10) where line = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true) |
| 176 | 176 | public void sectionUpdSectionRouteCode(Integer line,Integer dir,Integer routeCod); |
| 177 | 177 | |
| 178 | + @Modifying | |
| 179 | + @Query(value="UPDATE bsth_c_sectionroute set destroy = 1 where id = ?1", nativeQuery=true) | |
| 180 | + public void sectionRouteIsDestroyUpdBatch(Integer ids); | |
| 181 | + | |
| 178 | 182 | @Modifying |
| 179 | 183 | @Query(value="update bsth_c_sectionroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true) |
| 180 | 184 | public void sectionRouteDir(Integer line); | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -282,4 +282,8 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 282 | 282 | @Modifying |
| 283 | 283 | @Query(value="UPDATE bsth_c_stationroute set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true) |
| 284 | 284 | public void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod); |
| 285 | + | |
| 286 | + @Modifying | |
| 287 | + @Query(value="UPDATE bsth_c_stationroute set destroy = 1 where id = ?1", nativeQuery=true) | |
| 288 | + public void stationRouteIsDestroyUpdBatch(Integer ids); | |
| 285 | 289 | } | ... | ... |
src/main/java/com/bsth/service/SectionRouteService.java
| ... | ... | @@ -33,6 +33,15 @@ public interface SectionRouteService extends BaseService<SectionRoute, Integer> |
| 33 | 33 | List<Map<String, Object>> getSectionRoute(Map<String, Object> map); |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | + * @Description : TODO(根据路段路由Id批量撤销路段) | |
| 37 | + * | |
| 38 | + * @param map <id:路段路由ID> | |
| 39 | + * | |
| 40 | + * @return List<Map<String, Object>> | |
| 41 | + */ | |
| 42 | + Map<String, Object> updateSectionRouteInfoFormId(Map<String, Object> map); | |
| 43 | + | |
| 44 | + /** | |
| 36 | 45 | * @Description : TODO(根据路段路由Id查询详情) |
| 37 | 46 | * |
| 38 | 47 | * @param map <id:路段路由ID> | ... | ... |
src/main/java/com/bsth/service/StationRouteService.java
| ... | ... | @@ -31,6 +31,15 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> |
| 31 | 31 | Iterable<StationRoute> list(Map<String, Object> map); |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | + * @Description : TODO(根据路段站点Id批量撤销站点) | |
| 35 | + * | |
| 36 | + * @param map <id:站点路由ID> | |
| 37 | + * | |
| 38 | + * @return List<Map<String, Object>> | |
| 39 | + */ | |
| 40 | + Map<String, Object> updateStationRouteInfoFormId(Map<String, Object> map); | |
| 41 | + | |
| 42 | + /** | |
| 34 | 43 | * @Description :TODO(查询树站点与路段数据) |
| 35 | 44 | * |
| 36 | 45 | * @param map <line.id_eq:线路ID; directions_eq:方向> |
| ... | ... | @@ -92,4 +101,5 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> |
| 92 | 101 | Map<String, Object> updSwitchDir(String lineIds); |
| 93 | 102 | |
| 94 | 103 | Map<String, Object> upddis(Map<String, Object> map); |
| 104 | + | |
| 95 | 105 | } | ... | ... |
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
| ... | ... | @@ -5,10 +5,15 @@ import java.util.HashMap; |
| 5 | 5 | import java.util.List; |
| 6 | 6 | import java.util.Map; |
| 7 | 7 | |
| 8 | +import javax.persistence.EntityManager; | |
| 9 | +import javax.transaction.Transactional; | |
| 10 | + | |
| 8 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | +import org.springframework.beans.factory.annotation.Value; | |
| 9 | 13 | import org.springframework.data.domain.Sort; |
| 10 | 14 | import org.springframework.data.domain.Sort.Direction; |
| 11 | 15 | import org.springframework.stereotype.Service; |
| 16 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 12 | 17 | |
| 13 | 18 | import com.bsth.common.ResponseCode; |
| 14 | 19 | import com.bsth.entity.Line; |
| ... | ... | @@ -49,6 +54,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ |
| 49 | 54 | @Autowired |
| 50 | 55 | LineRepository lineRepository; |
| 51 | 56 | |
| 57 | + @Autowired | |
| 58 | + private EntityManager entityManager; | |
| 59 | + | |
| 60 | + @Value("${hibernate.jdbc.batch_size}") | |
| 61 | + private int batchSize; | |
| 62 | + | |
| 52 | 63 | @Override |
| 53 | 64 | public Iterable<SectionRoute> list(Map<String, Object> map) { |
| 54 | 65 | List<Sort.Order> orderList = new ArrayList<>(); |
| ... | ... | @@ -106,6 +117,9 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ |
| 106 | 117 | return resultList; |
| 107 | 118 | } |
| 108 | 119 | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 109 | 123 | /** |
| 110 | 124 | * @Description : TODO(根据路段路由Id查询详情) |
| 111 | 125 | * |
| ... | ... | @@ -297,4 +311,33 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ |
| 297 | 311 | } |
| 298 | 312 | return resultMap; |
| 299 | 313 | } |
| 314 | + | |
| 315 | + /** | |
| 316 | + * @Description : TODO(根据路段路由Id批量撤销路段) | |
| 317 | + * | |
| 318 | + * @param map <id:路段路由ID> | |
| 319 | + */ | |
| 320 | + @Override | |
| 321 | + @Transactional | |
| 322 | + public Map<String, Object> updateSectionRouteInfoFormId(Map<String, Object> map) { | |
| 323 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | |
| 324 | + try { | |
| 325 | + //int i = 0; | |
| 326 | + String[] idsStr = map.get("ids").toString().split(",") ; | |
| 327 | + for (String id : idsStr) { | |
| 328 | + /* entityManager.persist(Integer.parseInt(id));*/ | |
| 329 | + repository.sectionRouteIsDestroyUpdBatch(Integer.parseInt(id)); | |
| 330 | +/* i++; | |
| 331 | + if (i % batchSize == 0) { | |
| 332 | + entityManager.flush(); | |
| 333 | + entityManager.clear(); | |
| 334 | + }*/ | |
| 335 | + } | |
| 336 | + resultMap.put("status", ResponseCode.SUCCESS); | |
| 337 | + } catch (Exception e) { | |
| 338 | + resultMap.put("status", ResponseCode.ERROR); | |
| 339 | + logger.error("save erro.", e); | |
| 340 | + } | |
| 341 | + return resultMap; | |
| 342 | + } | |
| 300 | 343 | } |
| 301 | 344 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| ... | ... | @@ -24,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional; |
| 24 | 24 | |
| 25 | 25 | import java.io.ByteArrayInputStream; |
| 26 | 26 | import java.io.File; |
| 27 | -import java.io.FileOutputStream; | |
| 28 | 27 | import java.io.InputStream; |
| 29 | 28 | import java.text.DecimalFormat; |
| 30 | 29 | import java.util.*; |
| ... | ... | @@ -68,6 +67,29 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 68 | 67 | return repository.findAll(new CustomerSpecs<StationRoute>(map), new Sort(orderList)); |
| 69 | 68 | } |
| 70 | 69 | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * @Description : TODO(根据路段路由Id批量撤销路段) | |
| 73 | + * | |
| 74 | + * @param map <id:路段路由ID> | |
| 75 | + */ | |
| 76 | + @Override | |
| 77 | + @Transactional | |
| 78 | + public Map<String, Object> updateStationRouteInfoFormId(Map<String, Object> map) { | |
| 79 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | |
| 80 | + try { | |
| 81 | + String[] idsStr = map.get("ids").toString().split(",") ; | |
| 82 | + for (String id : idsStr) { | |
| 83 | + repository.stationRouteIsDestroyUpdBatch(Integer.parseInt(id)); | |
| 84 | + } | |
| 85 | + resultMap.put("status", ResponseCode.SUCCESS); | |
| 86 | + } catch (Exception e) { | |
| 87 | + resultMap.put("status", ResponseCode.ERROR); | |
| 88 | + logger.error("save erro.", e); | |
| 89 | + } | |
| 90 | + return resultMap; | |
| 91 | + } | |
| 92 | + | |
| 71 | 93 | /** |
| 72 | 94 | * @Description :TODO(查询树站点与路段数据) |
| 73 | 95 | * |
| ... | ... | @@ -512,38 +534,57 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 512 | 534 | */ |
| 513 | 535 | @Override |
| 514 | 536 | public Map<String, Object> usingSingle(Map<String, Object> map) { |
| 537 | + | |
| 515 | 538 | // 返回值map |
| 516 | 539 | Map<String, Object> resultMap = new HashMap<String,Object>(); |
| 540 | + | |
| 517 | 541 | try { |
| 542 | + | |
| 518 | 543 | // 获取线路ID |
| 519 | 544 | Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); |
| 545 | + | |
| 520 | 546 | /** 查询线路信息 @param:<lineId:线路ID> */ |
| 521 | 547 | Line line = lineRepository.findOne(lineId); |
| 548 | + | |
| 522 | 549 | /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */ |
| 523 | 550 | List<Object[]> objects = repository.usingSingle(lineId); |
| 551 | + | |
| 524 | 552 | if (objects.size()>0) { |
| 553 | + | |
| 525 | 554 | /** 获取配置文件里的ftp登录参数 */ |
| 526 | 555 | Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); |
| 556 | + | |
| 527 | 557 | // 压缩文件名 |
| 528 | 558 | String odlGzFileName = line.getLineCode() + ".txt.gz"; |
| 559 | + | |
| 529 | 560 | // txt文件名 |
| 530 | 561 | String textFileName = line.getLineCode() + ".txt"; |
| 562 | + | |
| 531 | 563 | // 创建一个ftp上传实例 |
| 532 | 564 | FTPClientUtils clientUtils = new FTPClientUtils(); |
| 565 | + | |
| 533 | 566 | // IP |
| 534 | 567 | String url = FTPParamMap.get("url").toString(); |
| 568 | + | |
| 535 | 569 | // 端口 |
| 536 | 570 | int port = Integer.valueOf(FTPParamMap.get("port").toString()); |
| 571 | + | |
| 537 | 572 | // 用户名 |
| 538 | 573 | String username = FTPParamMap.get("username").toString(); |
| 574 | + | |
| 539 | 575 | // 密码 |
| 540 | 576 | String password = FTPParamMap.get("password").toString(); |
| 577 | + | |
| 541 | 578 | // 相对路径 |
| 542 | 579 | String remotePath = FTPParamMap.get("remotePath").toString(); |
| 580 | + | |
| 543 | 581 | /** 如果已存在相同行单文件名则先删除 */ |
| 544 | 582 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName); |
| 583 | + | |
| 545 | 584 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName); |
| 585 | + | |
| 546 | 586 | String textStr = ""; |
| 587 | + | |
| 547 | 588 | boolean tempTag = ishxType(objects); |
| 548 | 589 | |
| 549 | 590 | if(tempTag) |
| ... | ... | @@ -557,12 +598,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 557 | 598 | |
| 558 | 599 | InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk")); |
| 559 | 600 | |
| 560 | - // FileOutputStream fos = new FileOutputStream("test.txt"); | |
| 561 | - /*int len = 0 ; | |
| 562 | - byte[] cbuf = new byte[1024]; | |
| 563 | - while((len = input.read(cbuf)) != -1) { | |
| 564 | - fos.write(cbuf, 0, len); | |
| 565 | - }*/ | |
| 566 | 601 | /** 生成txt文件,上传ftp */ |
| 567 | 602 | clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input); |
| 568 | 603 | |
| ... | ... | @@ -633,23 +668,25 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 633 | 668 | * @return String |
| 634 | 669 | */ |
| 635 | 670 | public String newTextFileToFTP(List<Object[]> objects,Integer lineId) { |
| 671 | + | |
| 636 | 672 | // 返回值String |
| 637 | 673 | String stationRStr = ""; |
| 674 | + | |
| 638 | 675 | // windows下的文本文件换行符 |
| 639 | 676 | //String enterStr = "\r\n"; |
| 677 | + | |
| 640 | 678 | // linux/unix下的文本文件换行符 |
| 641 | 679 | String enterStr = "\r"; |
| 642 | - int defaultZdxh = 0; | |
| 680 | + | |
| 643 | 681 | if(objects.size()>0) { |
| 682 | + | |
| 644 | 683 | for(int i = 0; i<objects.size();i++) { |
| 645 | - defaultZdxh ++ ; | |
| 684 | + | |
| 646 | 685 | // 经度 |
| 647 | - String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString(); | |
| 686 | + String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); | |
| 648 | 687 | |
| 649 | 688 | // 纬度 |
| 650 | - String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString(); | |
| 651 | - | |
| 652 | - Point point = new Point(Double.valueOf(lng), Double.valueOf(lat)); | |
| 689 | + String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); | |
| 653 | 690 | |
| 654 | 691 | lat = "\t" + lat; |
| 655 | 692 | |
| ... | ... | @@ -659,32 +696,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 659 | 696 | String stationMake = ""; |
| 660 | 697 | |
| 661 | 698 | if(stationMakeStr.equals("E")) { |
| 699 | + | |
| 662 | 700 | stationMake = "\t2"; |
| 701 | + | |
| 663 | 702 | }else { |
| 703 | + | |
| 664 | 704 | stationMake ="\t1"; |
| 705 | + | |
| 665 | 706 | } |
| 666 | 707 | |
| 667 | 708 | // 站点序号 |
| 668 | - // String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString(); | |
| 669 | - String stationNo = String.valueOf(defaultZdxh); | |
| 709 | + String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString(); | |
| 670 | 710 | |
| 671 | 711 | stationNo = "\t" + stationNo; |
| 672 | 712 | |
| 673 | 713 | // 站点编码 |
| 674 | 714 | String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); |
| 675 | 715 | |
| 676 | - int len = stationCode.length(); | |
| 677 | - if(len<8) { | |
| 678 | - int dx = 8 - len; | |
| 679 | - String addStr = ""; | |
| 680 | - for(int p =0;p<dx;p++) { | |
| 681 | - addStr = addStr + "0"; | |
| 682 | - } | |
| 683 | - stationCode = addStr + stationCode; | |
| 684 | - }else if(len>8){ | |
| 685 | - stationCode = stationCode.substring(8); | |
| 686 | - } | |
| 687 | - | |
| 688 | 716 | stationCode = "\t" +stationCode; |
| 689 | 717 | |
| 690 | 718 | double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; |
| ... | ... | @@ -704,33 +732,41 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 704 | 732 | |
| 705 | 733 | // 限速 |
| 706 | 734 | String sleepStr = ""; |
| 735 | + | |
| 707 | 736 | // 方向 |
| 708 | 737 | int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString()); |
| 738 | + | |
| 709 | 739 | /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ |
| 710 | 740 | List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); |
| 741 | + | |
| 711 | 742 | if(sobje.size()==1) { |
| 712 | - int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString()); | |
| 713 | - sleepStr = "\t" + String.valueOf(dsleepStr); | |
| 743 | + | |
| 744 | + double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString()); | |
| 745 | + | |
| 746 | + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr); | |
| 747 | + | |
| 714 | 748 | }else if(sobje.size()>1){ |
| 749 | + | |
| 750 | + /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */ | |
| 715 | 751 | for(int j =0;j<sobje.size();j++) { |
| 716 | - double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString()); | |
| 717 | - String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString(); | |
| 718 | - pointsStr = pointsStr.substring(11, pointsStr.length()-1); | |
| 719 | - List<Point> ps = new ArrayList<>(); | |
| 720 | - String[] pArray = pointsStr.split(","); | |
| 721 | - for(int a = 0; a <pArray.length; a++) { | |
| 722 | - String[] tmepA = pArray[a].split(" "); | |
| 723 | - Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1])); | |
| 724 | - ps.add(temp); | |
| 725 | - } | |
| 726 | - if(GeoUtils.isInSection(ps, point)) { | |
| 727 | - sleepStr = "\t" + String.valueOf((int)dsleepStrt); | |
| 728 | - break; | |
| 752 | + | |
| 753 | + String sectionName = sobje.get(j)[3].toString(); | |
| 754 | + | |
| 755 | + String sectionNameA[] = sectionName.split("至"); | |
| 756 | + | |
| 757 | + if(stationName.equals(sectionNameA[0])){ | |
| 758 | + | |
| 759 | + /*sleepStr = sobje.get(j)[2].toString();*/ | |
| 760 | + | |
| 761 | + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString()); | |
| 762 | + | |
| 763 | + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt); | |
| 764 | + | |
| 729 | 765 | } |
| 766 | + | |
| 730 | 767 | } |
| 731 | 768 | } |
| 732 | - if(sleepStr.equals("")) | |
| 733 | - sleepStr = "\t" + "60"; | |
| 769 | + | |
| 734 | 770 | stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; |
| 735 | 771 | } |
| 736 | 772 | |
| ... | ... | @@ -749,12 +785,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 749 | 785 | for(int i = 0; i<objects.size();i++) { |
| 750 | 786 | if(Integer.valueOf(objects.get(i)[8].toString())==0) { |
| 751 | 787 | // 经度 |
| 752 | - String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString(); | |
| 753 | - | |
| 788 | + String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); | |
| 754 | 789 | // 纬度 |
| 755 | - String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString(); | |
| 756 | - | |
| 757 | - Point point = new Point(Double.valueOf(lng), Double.valueOf(lat)); | |
| 790 | + String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); | |
| 758 | 791 | lat = "\t" + lat; |
| 759 | 792 | // 站点类型 |
| 760 | 793 | String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString(); |
| ... | ... | @@ -769,17 +802,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 769 | 802 | String stationNo = "\t" + xh; |
| 770 | 803 | // 站点编码 |
| 771 | 804 | String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); |
| 772 | - int len = stationCode.length(); | |
| 773 | - if(len<8) { | |
| 774 | - int dx = 8 - len; | |
| 775 | - String addStr = ""; | |
| 776 | - for(int p =0;p<dx;p++) { | |
| 777 | - addStr = addStr + "0"; | |
| 778 | - } | |
| 779 | - stationCode = addStr + stationCode; | |
| 780 | - }else if(len>8){ | |
| 781 | - stationCode = stationCode.substring(8); | |
| 782 | - } | |
| 783 | 805 | stationCode = "\t" +stationCode; |
| 784 | 806 | double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; |
| 785 | 807 | String tempDistc = String.valueOf((int) dis); |
| ... | ... | @@ -795,28 +817,20 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 795 | 817 | /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ |
| 796 | 818 | List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); |
| 797 | 819 | if(sobje.size()==1) { |
| 798 | - int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString()); | |
| 799 | - sleepStr = "\t" + String.valueOf(dsleepStr); | |
| 820 | + double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString()); | |
| 821 | + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr); | |
| 800 | 822 | }else if(sobje.size()>1){ |
| 823 | + /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */ | |
| 801 | 824 | for(int j =0;j<sobje.size();j++) { |
| 802 | - double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString()); | |
| 803 | - String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString(); | |
| 804 | - pointsStr = pointsStr.substring(11, pointsStr.length()-1); | |
| 805 | - List<Point> ps = new ArrayList<>(); | |
| 806 | - String[] pArray = pointsStr.split(","); | |
| 807 | - for(int a = 0; a <pArray.length; a++) { | |
| 808 | - String[] tmepA = pArray[a].split(" "); | |
| 809 | - Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1])); | |
| 810 | - ps.add(temp); | |
| 811 | - } | |
| 812 | - if(GeoUtils.isInSection(ps, point)) { | |
| 813 | - sleepStr = "\t" + String.valueOf((int)dsleepStrt); | |
| 814 | - break; | |
| 825 | + String sectionName = sobje.get(j)[3].toString(); | |
| 826 | + String sectionNameA[] = sectionName.split("至"); | |
| 827 | + if(stationName.equals(sectionNameA[0])){ | |
| 828 | + /*sleepStr = sobje.get(j)[2].toString();*/ | |
| 829 | + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString()); | |
| 830 | + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt); | |
| 815 | 831 | } |
| 816 | 832 | } |
| 817 | 833 | } |
| 818 | - if(sleepStr.equals("")) | |
| 819 | - sleepStr = "\t" + "60"; | |
| 820 | 834 | xh++; |
| 821 | 835 | restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; |
| 822 | 836 | } | ... | ... |
src/main/resources/static/pages/base/stationroute/delete_select.html
0 → 100644
| 1 | +<!-- 批量撤销选项 --> | |
| 2 | +<div class="modal fade" id="delete_select_mobal" tabindex="-1" | |
| 3 | + role="basic" aria-hidden="true"> | |
| 4 | + <div class="modal-dialog"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + <div class="modal-header"> | |
| 7 | + <button type="button" class="close" data-dismiss="modal" | |
| 8 | + aria-hidden="true"></button> | |
| 9 | + <h4 class="modal-title"> | |
| 10 | + 批量撤销选项 | |
| 11 | + </h4> | |
| 12 | + </div> | |
| 13 | + <div class="modal-body"> | |
| 14 | + <form class="form-horizontal" action="/" method="post" | |
| 15 | + id="formBootbox" role="form"> | |
| 16 | + <div class="form-group"> | |
| 17 | + <label class="col-md-3 control-label">撤销选项:</label> | |
| 18 | + <div class="col-md-9"> | |
| 19 | + <div class="icheck-list"> | |
| 20 | + <label> | |
| 21 | + <input type="radio" name="deleteOptions" value="0" checked> 批量撤销站点 | |
| 22 | + </label> | |
| 23 | + <label > | |
| 24 | + <input type="radio" name="deleteOptions" value="1" > 批量撤销路段 | |
| 25 | + </label> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + </form> | |
| 30 | + </div> | |
| 31 | + <div class="modal-footer"> | |
| 32 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 33 | + <button type="button" class="btn btn-primary" | |
| 34 | + id="deleteSelectnextButton">下一步</button> | |
| 35 | + </div> | |
| 36 | + </div> | |
| 37 | + </div> | |
| 38 | +</div> | |
| 39 | +<script type="text/javascript"> | |
| 40 | + $('#delete_select_mobal').on('deleteSelectMobal.show',function(e,ajaxd,line,fun,delBatch) { | |
| 41 | + // 加载显示mobal | |
| 42 | + $('#delete_select_mobal').modal({ | |
| 43 | + show : true, | |
| 44 | + backdrop : 'static', | |
| 45 | + keyboard : false | |
| 46 | + }); | |
| 47 | + // 获取表单元素 | |
| 48 | + var form = $('#formBootbox'); | |
| 49 | + // 下一步点击事件 | |
| 50 | + $('#deleteSelectnextButton').on('click', function() { | |
| 51 | + // 获取撤销类型 | |
| 52 | + deleteOptions = $("input[name='deleteOptions']:checked").val(); | |
| 53 | + // 表单提交 | |
| 54 | + form.submit(); | |
| 55 | + }); | |
| 56 | + // 表单验证 | |
| 57 | + form.validate({ | |
| 58 | + // 表单序列化 | |
| 59 | + submitHandler : function(f) { | |
| 60 | + // 批量删除站点 (deleteOptions:0) | |
| 61 | + if(deleteOptions == 0) { | |
| 62 | + // 隐藏选项mobal | |
| 63 | + $('#delete_select_mobal').modal('hide'); | |
| 64 | + // 加载deletestation页面 | |
| 65 | + $.get('deletestation.html', function(m){ | |
| 66 | + $(pjaxContainer).append(m); | |
| 67 | + $('#delete_station_mobal').trigger('deleteStationMobal.show', [ajaxd,line,fun,delBatch]); | |
| 68 | + }); | |
| 69 | + // 批量删除路段(deleteOptions:1) | |
| 70 | + } else if(deleteOptions == 1) { | |
| 71 | + // 隐藏选项mobal | |
| 72 | + $('#delete_select_mobal').modal('hide'); | |
| 73 | + // 加载deletesection页面 | |
| 74 | + $.get('deletesection.html', function(m){ | |
| 75 | + $(pjaxContainer).append(m); | |
| 76 | + $('#delete_section_mobal').trigger('deleteSectionMobal.show', [ajaxd,line,fun,delBatch]); | |
| 77 | + }); | |
| 78 | + } | |
| 79 | + | |
| 80 | + } | |
| 81 | + }); | |
| 82 | + }); | |
| 83 | +</script> | |
| 0 | 84 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/deletesection.html
0 → 100644
| 1 | +<!-- 编辑路段 --> | |
| 2 | +<div class="modal fade" id="delete_section_mobal" role="basic" | |
| 3 | + aria-hidden="true"> | |
| 4 | + <div style="margin:5% auto"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + <div class="col-md-12"> | |
| 7 | + <div class="portlet light porttlet-fit bordered"> | |
| 8 | + <div class="portlet-title"> | |
| 9 | + <div class="tipso-animation"> | |
| 10 | + </div> | |
| 11 | + <div class="caption"> | |
| 12 | + <i class="fa fa-info-circle font-dark"></i> <span | |
| 13 | + class="caption-subject font-dark sbold uppercase">路段信息</span> | |
| 14 | + </div> | |
| 15 | + <div class="actions"> | |
| 16 | + <div class="modal-footer-left"> | |
| 17 | + <button type="button" class="btn btn-primary" id="batchDeleteSectionButton">批量撤销路段</button> | |
| 18 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + <div class="portlet-body"> | |
| 23 | + <div class="table-container" style="margin-top: 10px"> | |
| 24 | + <from class="form-horizontal" role="form" | |
| 25 | + id="batch_delete_section_form"> | |
| 26 | + <table | |
| 27 | + class="table table-striped table-bordered table-hover table-checkable" | |
| 28 | + id="datatable_section_detele"> | |
| 29 | + <thead> | |
| 30 | + <tr role="row" class="heading"> | |
| 31 | + <th width="2%"><input type="checkbox" name="scetionCheckItems" | |
| 32 | + id="scetionCheckItems"></input></th> | |
| 33 | + <th width="2%">序号</th> | |
| 34 | + <th width="5%">路段路由编号</th> | |
| 35 | + <th width="5%">线路编号</th> | |
| 36 | + <th width="11%">线路名称</th> | |
| 37 | + <th width="7%">线路方向</th> | |
| 38 | + <th width="11%">路段名称</th> | |
| 39 | + <th width="5%">路段编码</th> | |
| 40 | + <th width="5%">路段序号</th> | |
| 41 | + <th width="5%">路段限速</th> | |
| 42 | + <th width="5%">路段长度</th> | |
| 43 | + <th width="5%">路段历时</th> | |
| 44 | + <th width="5%">版本号</th> | |
| 45 | + <!-- <th width="6%">是否撤销</th> | |
| 46 | + <th width="9%">操作</th> --> | |
| 47 | + </tr> | |
| 48 | + </thead> | |
| 49 | + <tbody></tbody> | |
| 50 | + </table> | |
| 51 | + </from> | |
| 52 | + <div class="actions"> | |
| 53 | + <div style="text-align: right"> | |
| 54 | + <ul id="pagination" class="pagination"></ul> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | +</div> | |
| 64 | + | |
| 65 | +<script type="text/html" id="sectionInfo_list_table_temp_detele"> | |
| 66 | + {{each list as obj i }} | |
| 67 | + <tr> | |
| 68 | + <td style="vertical-align: middle;"> | |
| 69 | + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" > | |
| 70 | + </td> | |
| 71 | + <td style="vertical-align: middle;"> | |
| 72 | + {{(list.page*10)+(i+1)}} | |
| 73 | + </td> | |
| 74 | + <td style="vertical-align: middle;"> | |
| 75 | + {{obj.id}} | |
| 76 | + </td> | |
| 77 | + <td style="vertical-align: middle;"> | |
| 78 | + {{obj.lineCode}} | |
| 79 | + </td> | |
| 80 | + <td style="vertical-align: middle;"> | |
| 81 | + {{obj.line.name}} | |
| 82 | + </td> | |
| 83 | + <td style="vertical-align: middle;"> | |
| 84 | + {{if obj.directions == '0'}} | |
| 85 | + 上行 | |
| 86 | + {{else if obj.directions == '1'}} | |
| 87 | + 下行 | |
| 88 | + {{/if}} | |
| 89 | + </td> | |
| 90 | + <td style="vertical-align: middle;"> | |
| 91 | + {{obj.section.sectionName}} | |
| 92 | + </td> | |
| 93 | + <td style="vertical-align: middle;"> | |
| 94 | + {{obj.sectionCode}} | |
| 95 | + </td> | |
| 96 | + <td style="vertical-align: middle;"> | |
| 97 | + {{obj.sectionrouteCode}} | |
| 98 | + </td> | |
| 99 | + <td style="vertical-align: middle;"> | |
| 100 | + {{obj.speedLimit}} | |
| 101 | + </td> | |
| 102 | + <td style="vertical-align: middle;"> | |
| 103 | + {{obj.sectionDistance}} | |
| 104 | + </td> | |
| 105 | + <td style="vertical-align: middle;"> | |
| 106 | + {{obj.sectionTime}} | |
| 107 | + </td> | |
| 108 | + <td style="vertical-align: middle;"> | |
| 109 | + {{obj.versions}} | |
| 110 | + </td> | |
| 111 | + </tr> | |
| 112 | + {{/each}} | |
| 113 | + {{if list.length == 0}} | |
| 114 | + <tr> | |
| 115 | + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | |
| 116 | + </tr> | |
| 117 | + {{/if}} | |
| 118 | +</script> | |
| 119 | +<script type="text/javascript"> | |
| 120 | +$('#delete_section_mobal').on('deleteSectionMobal.show',function(e, ajaxd, line, fun, delBatch) { | |
| 121 | + layer.closeAll(); | |
| 122 | + // 显示mobal | |
| 123 | + $('#delete_section_mobal').modal({ | |
| 124 | + show : true, | |
| 125 | + backdrop : 'static', | |
| 126 | + keyboard : false | |
| 127 | + }); | |
| 128 | + // 编辑表单元素 | |
| 129 | + var form = $('#batch_delete_section_form'); | |
| 130 | + // 提交数据按钮事件 | |
| 131 | + $('#batchDeleteSectionButton').on('click', function() { | |
| 132 | + var checked = $("[name=items]:checked"); | |
| 133 | + var ids = ""; | |
| 134 | + checked.each(function() { | |
| 135 | + ids = ids + "," + $(this).val(); | |
| 136 | + //ids.push($(this).val()); | |
| 137 | + }); | |
| 138 | + if (ids != "" && ids != null && ids != undefined) { | |
| 139 | + console.log("ids:" + ids); | |
| 140 | + ids = ids.substr(1, ids.length - 1); | |
| 141 | + var params = {}; | |
| 142 | + params.ids = ids; | |
| 143 | + $.get('/sectionroute/batchDestroy',params,function(resuntDate) { | |
| 144 | + if (resuntDate.status == 'SUCCESS') { | |
| 145 | + // 弹出添加成功提示消息 | |
| 146 | + layer.msg('修改成功...'); | |
| 147 | + /** 通知更新缓存区 */ | |
| 148 | + //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)}) | |
| 149 | + } else { | |
| 150 | + // 弹出添加失败提示消息 | |
| 151 | + layer.msg('修改失败...'); | |
| 152 | + } | |
| 153 | + initSearch(); | |
| 154 | + // 刷新左边树 | |
| 155 | + fun.resjtreeDate(line.id,delBatch.dir); | |
| 156 | + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */ | |
| 157 | + ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) { | |
| 158 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */ | |
| 159 | + fun.linePanlThree(line.id,data,delBatch.dir); | |
| 160 | + }); | |
| 161 | + }); | |
| 162 | + } else { | |
| 163 | + layer.msg('请选择要删除的路段!!!'); | |
| 164 | + } | |
| 165 | + }); | |
| 166 | + | |
| 167 | + /** 全选框 */ | |
| 168 | + document.getElementById('scetionCheckItems').onclick = function() { | |
| 169 | + // 获取所有的复选框 | |
| 170 | + var checkElements = document.getElementsByName('items'); | |
| 171 | + if (this.checked) { | |
| 172 | + for ( var i = 0; i < checkElements.length; i++) { | |
| 173 | + var checkElement = checkElements[i]; | |
| 174 | + checkElement.checked = "checked"; | |
| 175 | + } | |
| 176 | + } else { | |
| 177 | + for ( var i = 0; i < checkElements.length; i++) { | |
| 178 | + var checkElement = checkElements[i]; | |
| 179 | + checkElement.checked = null; | |
| 180 | + } | |
| 181 | + } | |
| 182 | + } | |
| 183 | + | |
| 184 | + /** 页面加载完显示数据 */ | |
| 185 | + window.onload = initSearch(); | |
| 186 | + | |
| 187 | + /** | |
| 188 | + * @description : (TODO) 页面加载事件 | |
| 189 | + * | |
| 190 | + */ | |
| 191 | + function initSearch() { | |
| 192 | + var params = new getParams(); | |
| 193 | + page = 0; | |
| 194 | + loadTableDate(params, true); | |
| 195 | + } | |
| 196 | + function getParams() { | |
| 197 | + // 搜索参数集合 | |
| 198 | + params = {}; | |
| 199 | + params.lineCode_eq = line.id; | |
| 200 | + params.directions_eq = delBatch.dir; | |
| 201 | + params.destroy_eq = "0"; //默认查没有撤销的路段 | |
| 202 | + return params; | |
| 203 | + } | |
| 204 | + /** | |
| 205 | + * @description : (TODO) 表格数据分页加载事件 | |
| 206 | + * | |
| 207 | + * ------@param : 查询参数 | |
| 208 | + * | |
| 209 | + * ------@isPon : 是否重新分页 | |
| 210 | + * | |
| 211 | + */ | |
| 212 | + function loadTableDate(param, isPon) { | |
| 213 | + // 搜索参数 | |
| 214 | + var params = {}; | |
| 215 | + if (param) | |
| 216 | + params = param; | |
| 217 | + // 排序(按方向与序号) | |
| 218 | + params['order'] = 'directions,sectionrouteCode'; | |
| 219 | + // 排序方向. | |
| 220 | + params['direction'] = 'ASC,ASC'; | |
| 221 | + // 记录当前页数 | |
| 222 | + params['page'] = page; | |
| 223 | + // 弹出正在加载层 | |
| 224 | + var i = layer.load(2); | |
| 225 | + // 异步请求获取表格数据 | |
| 226 | + $.get('/sectionroute',params,function(result) { | |
| 227 | + // 添加序号 | |
| 228 | + result.content.page = page; | |
| 229 | + // 把数据填充到模版中 | |
| 230 | + var tbodyHtml = template('sectionInfo_list_table_temp_detele',{list : result.content}); | |
| 231 | + // 把渲染好的模版html文本追加到表格中 | |
| 232 | + $('#datatable_section_detele tbody').html(tbodyHtml); | |
| 233 | + // 是重新分页且返回数据长度大于0 | |
| 234 | + if (isPon && result.content.length > 0) { | |
| 235 | + // 重新分页 | |
| 236 | + initPag = true; | |
| 237 | + // 分页栏 | |
| 238 | + showPagination(result); | |
| 239 | + } | |
| 240 | + // 关闭弹出加载层 | |
| 241 | + layer.close(i); | |
| 242 | + }); | |
| 243 | + } | |
| 244 | + /** | |
| 245 | + * @description : (TODO) 分页栏组件 | |
| 246 | + * | |
| 247 | + */ | |
| 248 | + function showPagination(data) { | |
| 249 | + // 分页组件 | |
| 250 | + $('#pagination').jqPaginator({ | |
| 251 | + // 总页数 | |
| 252 | + totalPages : data.totalPages, | |
| 253 | + // 中间显示页数 | |
| 254 | + visiblePages : 6, | |
| 255 | + // 当前页 | |
| 256 | + urrentPage : page + 1, | |
| 257 | + first : '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 258 | + prev : '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 259 | + next : '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 260 | + last : '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 261 | + page : '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 262 | + onPageChange : function(num, type) { | |
| 263 | + if (initPag) { | |
| 264 | + initPag = false; | |
| 265 | + return; | |
| 266 | + } | |
| 267 | + var pData = getParams(); | |
| 268 | + page = num - 1; | |
| 269 | + loadTableDate(pData, false); | |
| 270 | + } | |
| 271 | + }); | |
| 272 | + } | |
| 273 | +}); | |
| 274 | +</script> | |
| 0 | 275 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/deletestation.html
0 → 100644
| 1 | +<!-- 编辑路段 --> | |
| 2 | +<div class="modal fade" id="delete_station_mobal" role="basic" | |
| 3 | + aria-hidden="true"> | |
| 4 | + <div style="margin:5% auto"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + <div class="col-md-12"> | |
| 7 | + <div class="portlet light porttlet-fit bordered"> | |
| 8 | + <div class="portlet-title"> | |
| 9 | + <div class="tipso-animation"> | |
| 10 | + </div> | |
| 11 | + <div class="caption"> | |
| 12 | + <i class="fa fa-info-circle font-dark"></i> | |
| 13 | + <span class="caption-subject font-dark sbold uppercase">站点信息</span> | |
| 14 | + </div> | |
| 15 | + <div class="actions"> | |
| 16 | + <div class="btn-group btn-group-devided" data-toggle="buttons"> | |
| 17 | + <button type="button" class="btn btn-primary" id="batchDeleteStationButton">批量撤销站点</button> | |
| 18 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + <div class="portlet-body"> | |
| 23 | + <div class="table-container" style="margin-top: 10px"> | |
| 24 | + <from class="form-horizontal" role="form" id="batch_delete_station_form"> | |
| 25 | + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_station_detele"> | |
| 26 | + <thead> | |
| 27 | + <tr role="row" class="heading"> | |
| 28 | + <th width="2%"><input type="checkbox" name="checkItems" | |
| 29 | + id="stationCheckItems"></input></th> | |
| 30 | + <th width="2%">序号</th> | |
| 31 | + <th width="5%">站点路由编号</th> | |
| 32 | + <th width="5%">线路编号</th> | |
| 33 | + <th width="8%">线路名称</th> | |
| 34 | + <th width="5%">线路方向</th> | |
| 35 | + <th width="8%">站点路由名称</th> | |
| 36 | + <th width="4%">站点编码</th> | |
| 37 | + <th width="4%">站点序号</th> | |
| 38 | + <th width="4%">站点类型</th> | |
| 39 | + <th width="6%">站点距离(km)</th> | |
| 40 | + <th width="6%">站点时长(min)</th> | |
| 41 | + <th width="4%">版本号</th> | |
| 42 | + </tr> | |
| 43 | + </thead> | |
| 44 | + <tbody></tbody> | |
| 45 | + </table> | |
| 46 | + </from> | |
| 47 | + <div class="actions"> | |
| 48 | + <div style="text-align: right"> | |
| 49 | + <ul id="pagination" class="pagination"></ul> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | +</div> | |
| 59 | + | |
| 60 | +<script type="text/html" id="stationInfo_list_table_temp_detele"> | |
| 61 | + {{each list as obj i }} | |
| 62 | + <tr> | |
| 63 | + <td style="vertical-align: middle;"> | |
| 64 | + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" > | |
| 65 | + </td> | |
| 66 | + <td style="vertical-align: middle;"> | |
| 67 | + {{(list.page*10)+(i+1)}} | |
| 68 | + </td> | |
| 69 | + <td style="vertical-align: middle;"> | |
| 70 | + {{obj.id}} | |
| 71 | + </td> | |
| 72 | + <td> | |
| 73 | + {{obj.lineCode}} | |
| 74 | + </td> | |
| 75 | + <td> | |
| 76 | + {{obj.line.name}} | |
| 77 | + </td> | |
| 78 | + <td> | |
| 79 | + {{if obj.directions == '0'}} | |
| 80 | + 上行 | |
| 81 | + {{else if obj.directions == '1'}} | |
| 82 | + 下行 | |
| 83 | + {{/if}} | |
| 84 | + </td> | |
| 85 | + <td> | |
| 86 | + {{obj.stationName}} | |
| 87 | + </td> | |
| 88 | + <td> | |
| 89 | + {{obj.stationCode}} | |
| 90 | + </td> | |
| 91 | + <td> | |
| 92 | + {{obj.stationRouteCode}} | |
| 93 | + </td> | |
| 94 | + <td> | |
| 95 | + {{if obj.stationMark == 'B'}} | |
| 96 | + 起始站 | |
| 97 | + {{else if obj.stationMark == 'Z'}} | |
| 98 | + 中途站 | |
| 99 | + {{else if obj.stationMark== 'E'}} | |
| 100 | + 终点站 | |
| 101 | + {{/if}} | |
| 102 | + </td> | |
| 103 | + <td> | |
| 104 | + {{obj.distances}} | |
| 105 | + </td> | |
| 106 | + <td> | |
| 107 | + {{obj.toTime}} | |
| 108 | + </td> | |
| 109 | + <td> | |
| 110 | + {{obj.versions}} | |
| 111 | + </td> | |
| 112 | + </tr> | |
| 113 | + {{/each}} | |
| 114 | + {{if list.length == 0}} | |
| 115 | + <tr> | |
| 116 | + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | |
| 117 | + </tr> | |
| 118 | + {{/if}} | |
| 119 | +</script> | |
| 120 | +<script type="text/javascript"> | |
| 121 | +$('#delete_station_mobal').on('deleteStationMobal.show',function(e, ajaxd, line, fun, delBatch) { | |
| 122 | + layer.closeAll(); | |
| 123 | + // 显示mobal | |
| 124 | + $('#delete_station_mobal').modal({ | |
| 125 | + show : true, | |
| 126 | + backdrop : 'static', | |
| 127 | + keyboard : false | |
| 128 | + }); | |
| 129 | + // 编辑表单元素 | |
| 130 | + var form = $('#batch_delete_station_form'); | |
| 131 | + // 提交数据按钮事件 | |
| 132 | + $('#batchDeleteStationButton').on('click', function() { | |
| 133 | + var checked = $("[name=items]:checked"); | |
| 134 | + var ids = ""; | |
| 135 | + checked.each(function() { | |
| 136 | + ids = ids + "," + $(this).val(); | |
| 137 | + //ids.push($(this).val()); | |
| 138 | + }); | |
| 139 | + if (ids != "" && ids != null && ids != undefined) { | |
| 140 | + console.log("ids:" + ids); | |
| 141 | + ids = ids.substr(1, ids.length - 1); | |
| 142 | + var params = {}; | |
| 143 | + params.ids = ids; | |
| 144 | + $.get('/stationroute/batchDestroy',params,function(resuntDate) { | |
| 145 | + if (resuntDate.status == 'SUCCESS') { | |
| 146 | + // 弹出添加成功提示消息 | |
| 147 | + layer.msg('修改成功...'); | |
| 148 | + /** 通知更新缓存区 */ | |
| 149 | + //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)}) | |
| 150 | + } else { | |
| 151 | + // 弹出添加失败提示消息 | |
| 152 | + layer.msg('修改失败...'); | |
| 153 | + } | |
| 154 | + initSearch(); | |
| 155 | + // 刷新左边树 | |
| 156 | + fun.resjtreeDate(line.id,delBatch.dir); | |
| 157 | + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */ | |
| 158 | + ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) { | |
| 159 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */ | |
| 160 | + fun.linePanlThree(line.id,data,delBatch.dir); | |
| 161 | + }); | |
| 162 | + }); | |
| 163 | + } else { | |
| 164 | + layer.msg('请选择要删除的站点!!!'); | |
| 165 | + } | |
| 166 | + }); | |
| 167 | + | |
| 168 | + /** 全选框 */ | |
| 169 | + document.getElementById('stationCheckItems').onclick = function() { | |
| 170 | + // 获取所有的复选框 | |
| 171 | + var checkElements = document.getElementsByName('items'); | |
| 172 | + if (this.checked) { | |
| 173 | + for ( var i = 0; i < checkElements.length; i++) { | |
| 174 | + var checkElement = checkElements[i]; | |
| 175 | + checkElement.checked = "checked"; | |
| 176 | + } | |
| 177 | + } else { | |
| 178 | + for ( var i = 0; i < checkElements.length; i++) { | |
| 179 | + var checkElement = checkElements[i]; | |
| 180 | + checkElement.checked = null; | |
| 181 | + } | |
| 182 | + } | |
| 183 | + } | |
| 184 | + | |
| 185 | + /** 页面加载完显示数据 */ | |
| 186 | + window.onload = initSearch(); | |
| 187 | + | |
| 188 | + /** | |
| 189 | + * @description : (TODO) 页面加载事件 | |
| 190 | + * | |
| 191 | + */ | |
| 192 | + function initSearch() { | |
| 193 | + var params = new getParams(); | |
| 194 | + page = 0; | |
| 195 | + loadTableDate(params, true); | |
| 196 | + } | |
| 197 | + function getParams() { | |
| 198 | + // 搜索参数集合 | |
| 199 | + params = {}; | |
| 200 | + params.lineCode_eq = line.id; | |
| 201 | + params.directions_eq = delBatch.dir; | |
| 202 | + params.destroy_eq = "0"; //默认查没有撤销的站点 | |
| 203 | + return params; | |
| 204 | + } | |
| 205 | + /** | |
| 206 | + * @description : (TODO) 表格数据分页加载事件 | |
| 207 | + * | |
| 208 | + * ------@param : 查询参数 | |
| 209 | + * | |
| 210 | + * ------@isPon : 是否重新分页 | |
| 211 | + * | |
| 212 | + */ | |
| 213 | + function loadTableDate(param, isPon) { | |
| 214 | + // 搜索参数 | |
| 215 | + var params = {}; | |
| 216 | + if (param) | |
| 217 | + params = param; | |
| 218 | + // 排序(按方向与序号) | |
| 219 | + params['order'] = 'directions,stationRouteCode'; | |
| 220 | + // 排序方向. | |
| 221 | + params['direction'] = 'ASC,ASC'; | |
| 222 | + // 记录当前页数 | |
| 223 | + params['page'] = page; | |
| 224 | + // 弹出正在加载层 | |
| 225 | + var i = layer.load(2); | |
| 226 | + // 异步请求获取表格数据 | |
| 227 | + $.get('/stationroute',params,function(result) { | |
| 228 | + // 添加序号 | |
| 229 | + result.content.page = page; | |
| 230 | + // 把数据填充到模版中 | |
| 231 | + var tbodyHtml = template('stationInfo_list_table_temp_detele',{list : result.content}); | |
| 232 | + // 把渲染好的模版html文本追加到表格中 | |
| 233 | + $('#datatable_station_detele tbody').html(tbodyHtml); | |
| 234 | + // 是重新分页且返回数据长度大于0 | |
| 235 | + if (isPon && result.content.length > 0) { | |
| 236 | + // 重新分页 | |
| 237 | + initPag = true; | |
| 238 | + // 分页栏 | |
| 239 | + showPagination(result); | |
| 240 | + } | |
| 241 | + // 关闭弹出加载层 | |
| 242 | + layer.close(i); | |
| 243 | + }); | |
| 244 | + } | |
| 245 | + /** | |
| 246 | + * @description : (TODO) 分页栏组件 | |
| 247 | + * | |
| 248 | + */ | |
| 249 | + function showPagination(data) { | |
| 250 | + // 分页组件 | |
| 251 | + $('#pagination').jqPaginator({ | |
| 252 | + // 总页数 | |
| 253 | + totalPages : data.totalPages, | |
| 254 | + // 中间显示页数 | |
| 255 | + visiblePages : 6, | |
| 256 | + // 当前页 | |
| 257 | + urrentPage : page + 1, | |
| 258 | + first : '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 259 | + prev : '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 260 | + next : '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 261 | + last : '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 262 | + page : '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 263 | + onPageChange : function(num, type) { | |
| 264 | + if (initPag) { | |
| 265 | + initPag = false; | |
| 266 | + return; | |
| 267 | + } | |
| 268 | + var pData = getParams(); | |
| 269 | + page = num - 1; | |
| 270 | + loadTableDate(pData, false); | |
| 271 | + } | |
| 272 | + }); | |
| 273 | + } | |
| 274 | +}); | |
| 275 | +</script> | |
| 0 | 276 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/js/deletebatch.js
0 → 100644
| 1 | +var DeleteBatchObj = function(){ | |
| 2 | + | |
| 3 | + /** 定义修改线路对象 */ | |
| 4 | + | |
| 5 | + var deleteBatchObj = { | |
| 6 | + /** 获取批量撤销对象 @return:<Batch:批量撤销对象> */ | |
| 7 | + getDeleteBatch : function() { | |
| 8 | + return deleteBatchObj; | |
| 9 | + }, | |
| 10 | + | |
| 11 | + /** 设置批量撤销的线路方向 @param:<dir:方向(0:上行;1:下行)> */ | |
| 12 | + setDeteleBatchDiraction : function(dir) { | |
| 13 | + | |
| 14 | + deleteBatchObj.dir = dir; | |
| 15 | + }, | |
| 16 | + } | |
| 17 | + | |
| 18 | + return deleteBatchObj; | |
| 19 | +}(); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/editsection.js
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
| ... | ... | @@ -56,6 +56,18 @@ $(function(){ |
| 56 | 56 | PublicFunctions.stationRevoke(directionUpValue); |
| 57 | 57 | }); |
| 58 | 58 | |
| 59 | + // 上行批量撤销事件 | |
| 60 | + $('.module_tools #batchUpDelete').on('click', function() { | |
| 61 | + var Line = LineObj.getLineObj(); | |
| 62 | + /** 设置批量删除的线路方向 @param:<directionUpValue:方向(0:上行;1:下行)> */ | |
| 63 | + DeleteBatchObj.setDeteleBatchDiraction(directionUpValue); | |
| 64 | + // 加载选择新增方式mobal | |
| 65 | + $.get('delete_select.html', function(m){ | |
| 66 | + $(pjaxContainer).append(m); | |
| 67 | + $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]); | |
| 68 | + }); | |
| 69 | + }); | |
| 70 | + | |
| 59 | 71 | // 切换上下行. |
| 60 | 72 | $('.retweet').on('click',function() { |
| 61 | 73 | layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', { |
| ... | ... | @@ -210,6 +222,18 @@ $(function(){ |
| 210 | 222 | $('.module_tools #deleteDownStation').on('click', function() { |
| 211 | 223 | PublicFunctions.stationRevoke(directionDownValue); |
| 212 | 224 | }); |
| 225 | + | |
| 226 | + // 下行批量撤销事件 | |
| 227 | + $('.module_tools #batchDownDelete').on('click', function() { | |
| 228 | + var Line = LineObj.getLineObj(); | |
| 229 | + /** 设置批量删除的线路方向 @param:<directionDownValue:方向(0:上行;1:下行)> */ | |
| 230 | + DeleteBatchObj.setDeteleBatchDiraction(directionDownValue); | |
| 231 | + // 加载选择新增方式mobal | |
| 232 | + $.get('delete_select.html', function(m){ | |
| 233 | + $(pjaxContainer).append(m); | |
| 234 | + $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]); | |
| 235 | + }); | |
| 236 | + }); | |
| 213 | 237 | |
| 214 | 238 | // 编辑线路下行走向 |
| 215 | 239 | $('.module_tools #editDownlineTrend').on('click', function() { |
| ... | ... | @@ -242,5 +266,5 @@ $(function(){ |
| 242 | 266 | $('.defeat-scroll').css('overflow','auto'); |
| 243 | 267 | }).on('mouseleave',function() { |
| 244 | 268 | $('.defeat-scroll').css('overflow','hidden'); |
| 245 | - }); | |
| 269 | + }); | |
| 246 | 270 | }); |
| 247 | 271 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/list.html
| ... | ... | @@ -59,6 +59,10 @@ |
| 59 | 59 | </li> |
| 60 | 60 | <li class="divider"> </li> |
| 61 | 61 | <li> |
| 62 | + <a href="javascript:;" id="batchUpDelete"><i class="fa fa-trash-o"></i> 批量撤销</a> | |
| 63 | + </li> | |
| 64 | + <li class="divider"> </li> | |
| 65 | + <li> | |
| 62 | 66 | <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> |
| 63 | 67 | </li> |
| 64 | 68 | <li class="divider"> </li> |
| ... | ... | @@ -69,6 +73,7 @@ |
| 69 | 73 | <li> |
| 70 | 74 | <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a> |
| 71 | 75 | </li> |
| 76 | + <li class="divider"> </li> | |
| 72 | 77 | <!-- <li> |
| 73 | 78 | <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> |
| 74 | 79 | </li> --> |
| ... | ... | @@ -154,6 +159,10 @@ |
| 154 | 159 | </li> |
| 155 | 160 | <li class="divider"> </li> |
| 156 | 161 | <li> |
| 162 | + <a href="javascript:;" id="batchDownDelete"><i class="fa fa-trash-o"></i> 批量撤销</a> | |
| 163 | + </li> | |
| 164 | + <li class="divider"> </li> | |
| 165 | + <li> | |
| 157 | 166 | <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> |
| 158 | 167 | </li> |
| 159 | 168 | <li class="divider"> </li> |
| ... | ... | @@ -227,6 +236,8 @@ |
| 227 | 236 | <script src="/pages/base/stationroute/js/editstationobj.js"></script> |
| 228 | 237 | <!-- 修改路段对象类 --> |
| 229 | 238 | <script src="/pages/base/stationroute/js/editsection.js"></script> |
| 239 | +<!-- 批量撤销对象类 --> | |
| 240 | +<script src="/pages/base/stationroute/js/deletebatch.js"></script> | |
| 230 | 241 | <!-- 绘图类 --> |
| 231 | 242 | <script src="/pages/base/stationroute/js/drawingManager.js"></script> |
| 232 | 243 | <!-- 地图类 --> | ... | ... |
src/main/resources/static/pages/base/timesmodel/add.html
| ... | ... | @@ -156,7 +156,7 @@ |
| 156 | 156 | </div> |
| 157 | 157 | <div class="form-actions"> |
| 158 | 158 | <div class="row"> |
| 159 | - <div class="col-md-offset-3 col-md-9"> | |
| 159 | + <div class="col-md-offset-5 col-md-9"> | |
| 160 | 160 | <a href="javascript:;" class="btn default button-previous disabled" style="display: none;"> |
| 161 | 161 | <i class="fa fa-angle-left"></i> 返回 </a> |
| 162 | 162 | <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
| ... | ... | @@ -324,6 +324,448 @@ var BaseFun = function() { |
| 324 | 324 | 'bxrcgs':null}; |
| 325 | 325 | }, |
| 326 | 326 | |
| 327 | + /** | |
| 328 | + * @description (TODO) 剔除不在上、下行时间范围内的班次. | |
| 329 | + * | |
| 330 | + * | |
| 331 | + */ | |
| 332 | + tcbzfwndbc02 : function(jsonArray,dataMap) { | |
| 333 | + var _obj = baseF.getsxAndxxbc(jsonArray,dataMap); | |
| 334 | + // 剔除上行不在时间范围内的班次 | |
| 335 | + baseF.tcbc(_obj.sxbc,dataMap.smbcsjArr[0].kssj,dataMap.smbcsjArr[0].jssj); | |
| 336 | + // 剔除下行不在时间范围内的班次 | |
| 337 | + baseF.tcbc(_obj.xxbc,dataMap.smbcsjArr[1].kssj,dataMap.smbcsjArr[1].jssj); | |
| 338 | + return _obj.sxbc.concat(_obj.xxbc); | |
| 339 | + }, | |
| 340 | + | |
| 341 | + /** | |
| 342 | + * @description : (TODO) 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班. | |
| 343 | + * @param bxlpbc 班型下的各个路牌的所有班次数组. | |
| 344 | + * @param map 表单参数信息 | |
| 345 | + * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行]. | |
| 346 | + * @param saa 封装的一些 停站时间、周转时间、行驶时间、行驶里程等. | |
| 347 | + * @param cara 路牌数组 | |
| 348 | + * @param bxrcObj 班次类型对象 | |
| 349 | + * @param dgminpcs 低谷最多配车数. | |
| 350 | + * *********************************** 业务要求 **************************************************** | |
| 351 | + * 满足单个路牌对应的标准工时、满足某班型下的所有路牌的平均工时对应的日平均工时、停站时间、路牌是否分班的班次集合. | |
| 352 | + * | |
| 353 | + * *********************************** 业务分析与思路 ********************************************** | |
| 354 | + * | |
| 355 | + * 首先判断出该路牌所属的班型,这里暂时考虑分两种情况. | |
| 356 | + * | |
| 357 | + * 第一种情况 :【五工二休】班型 | |
| 358 | + * | |
| 359 | + * 特点:一天标准工时为 : 8个小时 ; | |
| 360 | + * 一般该班型下的路牌班次出现密集的地方 是在高峰时段以及高峰时段附近。(这种路牌在模型里,我们称为短(断)路牌); | |
| 361 | + * 这种班型现象一般是晚出早归. | |
| 362 | + * | |
| 363 | + * 要求:单个路牌下的工时满足: 工时浮动范围在 标准工时【1-1.5】小时. | |
| 364 | + * 相同班型路牌下的平均工时满足: 工时浮动范围在 以表单录入的日平均工时10分钟内. | |
| 365 | + * | |
| 366 | + * 剔除规则:从最后一个班次开始剔除,遇到高峰时段则跳过。一直剔除到满足到班型的判断标准工时8小时。 | |
| 367 | + * | |
| 368 | + * 第二种情况 : 其它班型(包括 一工一休 、 二工一休 、 三工一休 、 四工一休 、 五工一休 、 六工一休) | |
| 369 | + * | |
| 370 | + * 特点:一天标准工时:以各自对应的班型工时为准。这里会有单/双档 等的概念。现在我们暂时也只考虑单/双档这种情况. | |
| 371 | + * 单:一个路牌一个人开 / 双:一个路牌两个开 ...... | |
| 372 | + * 那么一个路牌下的总工时为 各自对应的班型标准工时*档数. | |
| 373 | + * 这种情况下的路牌 | |
| 374 | + * 第一条件首先满足高峰时段。然后看情况(满足工时或者是防止工时超出)是否会产生分班。 | |
| 375 | + * 如果不产生分班:则一定为连续的,也就是说从头开到尾. | |
| 376 | + * 如果产生分班: | |
| 377 | + * 第一种情况 : 中间会断掉.一般这个断掉的时间不会太长,但至少是3小时以上。 | |
| 378 | + * 第二种情况 : 连续的。这种情况一定是双档。不然工时会超出. | |
| 379 | + * | |
| 380 | + * 要求:单个路牌下的工时满足 :工时浮动范围在 标准工时【1-1.5】小时. | |
| 381 | + * 相同班型路牌下的平均工时满足 : 工时浮动范围在 以表单录入的日平均工时10分钟内. | |
| 382 | + * | |
| 383 | + * 剔除规则:这里情况比较复杂,因为先要考虑该路牌是否分班。 | |
| 384 | + * | |
| 385 | + * 判断是否会产生分班分两种条件 | |
| 386 | + * | |
| 387 | + * 第一种情况:是双档一定有分班班次.并且是连续的班次. | |
| 388 | + * | |
| 389 | + * 第二种情况:是单档 , 但是单个路牌工时超出了要求范围 , 为了在满足工时的条件下。采取分班。 | |
| 390 | + * 判断依据:反算出低谷最少配车数. | |
| 391 | + * 计算公式:(低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙 | |
| 392 | + * 这里的取整数要求:四舍五入去整。 | |
| 393 | + * | |
| 394 | + * | |
| 395 | + * 共同满足的条件 : 所有路牌下的相邻班次(前提条件是 不是分班班次)的停站时间不得超过 行业标准 行驶时间的10%~15%。如果有特殊情况,以表单录入的低谷最大停站时间为极限。 | |
| 396 | + * | |
| 397 | + * | |
| 398 | + **/ | |
| 399 | + tzlpgs02 : function(bxlpbc , map , dataMap , saa , cara , bxrcObj , dgminpcs) { | |
| 400 | + var rsultA = new Array(); | |
| 401 | + for(var a = 0 ; a < bxlpbc.length ; a++) { | |
| 402 | + // 定义该版型下对应的路牌的班次数组、班次数组长度。 | |
| 403 | + var lpbc = bxlpbc[a].lpbc, lpbclen_; | |
| 404 | + // 定义当前路牌的初始工时、班型对应的标准工时 | |
| 405 | + var initCountGs = bxlpbc[a].initCountGs ,bzgs = bxlpbc[a].bzgs; | |
| 406 | + // 定义初始工时与日平均工时差值 | |
| 407 | + var initdx = initCountGs - bxlpbc[a].gsavg; | |
| 408 | + // 定义剔除班次数、剔除的时间段. | |
| 409 | + var deletebcNum = Math.ceil((initCountGs - bxlpbc[a].gsavg) / saa[0].zzsj.dgzzsj) , tcbcgzA = new Array(); | |
| 410 | + // var deletebcNum = parseInt((initCountGs - bxlpbc[a].gsavg) / saa[0].zzsj.dgzzsj) , tcbcgzA = new Array(); | |
| 411 | + if(bxrcObj.type == '五工二休') { | |
| 412 | + if(lpbclen_>0) { | |
| 413 | + // 定义晚高峰后能剔除多少班次数. | |
| 414 | + var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj)); | |
| 415 | + // 定义时间段内剔除班次规则. | |
| 416 | + tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'deletebcNum' : wgfhtcbcNum}, | |
| 417 | + {'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dataMap.wgfsjd[0].st , 'deletebcNum' : deletebcNum - wgfhtcbcNum},); | |
| 418 | + // 逆序排序剔除. | |
| 419 | + lpbc.sort(function(r,s){return s.fcno-r.fcno}); | |
| 420 | + // 剔除不在高峰时间段内的班次. | |
| 421 | + baseF.spliceBc02(lpbc , tcbcgzA , dataMap , 'desc' , true); | |
| 422 | + } | |
| 423 | + }else { | |
| 424 | + /*console.log(bxlpbc[a].lpNo , initCountGs , bzgs , saa[0].zzsj.dgzzsj , | |
| 425 | + initCountGs - bzgs , (initCountGs - bzgs) /saa[0].zzsj.dgzzsj , | |
| 426 | + initCountGs - bxlpbc[a].gsavg , (initCountGs - bxlpbc[a].gsavg) / saa[0].zzsj.dgzzsj );*/ | |
| 427 | + // 单档 一个路牌一档劳动力 | |
| 428 | + if(bxlpbc[a].keepOff==1) { | |
| 429 | + // 如果低谷至少配车数大于零,则该班型下的路牌 存在一些 分班路牌,这里的分班 指的是 这个路牌先满足的前提条件就是 是单档。 | |
| 430 | + // 为了满足工时的要求,在低谷断开一段时间. | |
| 431 | + if(dgminpcs>0 && dgminpcs <= bxrcObj.fpcls ) { | |
| 432 | + if( (a + 1) <= dgminpcs) { | |
| 433 | + var dgzjsj = baseF.getDateTime('12:30'); | |
| 434 | + if( a % 2 == 0) { | |
| 435 | + // 定义早高峰结束 ~ 12:30 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. | |
| 436 | + var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj)); | |
| 437 | + if(initdx < 240) { | |
| 438 | + tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum}); | |
| 439 | + }else { | |
| 440 | + tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : swmaxtcbcNum}, | |
| 441 | + {'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed, 'order' : 'desc' , 'deletebcNum' : deletebcNum - swmaxtcbcNum}); | |
| 442 | + } | |
| 443 | + // 顺序排序 | |
| 444 | + // lpbc.sort(function(x,y){return x.fcno-y.fcno}); | |
| 445 | + }else { | |
| 446 | + // 定义12:30 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. | |
| 447 | + var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj)); | |
| 448 | + if(initdx < 210) { | |
| 449 | + tcbcgzA.push({'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'desc', 'deletebcNum' : deletebcNum}); | |
| 450 | + }else { | |
| 451 | + | |
| 452 | + tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum - xwmaxtcbcNum}, | |
| 453 | + {'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'desc', 'deletebcNum' : xwmaxtcbcNum},); | |
| 454 | + } | |
| 455 | + // 逆序排序. | |
| 456 | + // lpbc.sort(function(m,n){return n.fcno-m.fcno}); | |
| 457 | + // order = 'desc'; | |
| 458 | + } | |
| 459 | + // 按规则剔除班次.并且分班.路牌班次断开. | |
| 460 | + baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true); | |
| 461 | + }else { | |
| 462 | + // 按规则剔除班次.不分班.路牌班次不会断开. | |
| 463 | + baseF.isdk02(lpbc , dataMap , deletebcNum , false); | |
| 464 | + } | |
| 465 | + // 该班型下的路牌 不存在分班路牌. | |
| 466 | + }else if(dgminpcs == 0){ | |
| 467 | + // 按规则剔除班次.不分班.路牌班次不会断开. | |
| 468 | + baseF.isdk02(lpbc , dataMap , deletebcNum , false); | |
| 469 | + } | |
| 470 | + // 双档 一个路牌两档劳动力 | |
| 471 | + }else if(bxlpbc[a].keepOff==2) { | |
| 472 | + // 按规则剔除班次.分班.但是路牌班次不会断开. | |
| 473 | + baseF.isdk02(lpbc , dataMap , deletebcNum , true); | |
| 474 | + } | |
| 475 | + } | |
| 476 | + rsultA = rsultA.concat(lpbc); | |
| 477 | + } | |
| 478 | + return rsultA; | |
| 479 | + }, | |
| 480 | + | |
| 481 | + /** | |
| 482 | + * @description (TODO) 定义不断开班次的路牌剔除规则. | |
| 483 | + * | |
| 484 | + * | |
| 485 | + */ | |
| 486 | + isdk02 : function(lpbc , dataMap , deletebcNum , isfb) { | |
| 487 | + if(deletebcNum > 0) { | |
| 488 | + var zgfzqtcbcNum = parseInt(( dataMap.zgfzqsjd[0].ed - dataMap.zgfzqsjd[0].st ) / (60000 * saa[0].zzsj.dgzzsj)), | |
| 489 | + wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfzhsjd[0].st ) / (60000 * saa[0].zzsj.dgzzsj)) | |
| 490 | + tcbcgzA = new Array(); | |
| 491 | + if( wgfhtcbcNum >= deletebcNum) { | |
| 492 | + tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum},); | |
| 493 | + }else if(zgfzqtcbcNum >= deletebcNum){ | |
| 494 | + tcbcgzA.push({'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum},); | |
| 495 | + }else if(deletebcNum >= (zgfzqtcbcNum + wgfhtcbcNum)){ | |
| 496 | + tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : wgfhtcbcNum}, | |
| 497 | + {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : zgfzqtcbcNum},); | |
| 498 | + } | |
| 499 | + // lpbc.sort(function(m,n){return n.fcno-m.fcno}); | |
| 500 | + baseF.spliceBc02(lpbc , tcbcgzA , dataMap , isfb); | |
| 501 | + } | |
| 502 | + }, | |
| 503 | + | |
| 504 | + /** | |
| 505 | + * @description (TODO) 根据定义规则剔除班次. | |
| 506 | + * @param arr 班次数组. | |
| 507 | + * @param tcbcgzA 剔除规则. | |
| 508 | + * @param type 剔除类型【asc -- 顺序剔除 ; desc -- 逆序剔除】 | |
| 509 | + * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行]. | |
| 510 | + * @param isfb 剔除过程中是否会产生分班. | |
| 511 | + */ | |
| 512 | + spliceBc02 : function (arr , tcbcgzA , dataMap , isfb) { | |
| 513 | + for(var t = 0 ; t < tcbcgzA.length ; t++) { | |
| 514 | + var order = tcbcgzA[t].order; | |
| 515 | + if(order == 'asc') | |
| 516 | + arr.sort(function(x,y){return x.fcno-y.fcno}); | |
| 517 | + else if(order == 'desc') | |
| 518 | + arr.sort(function(m,n){return n.fcno-m.fcno}); | |
| 519 | + for(var a = 0 ; a < arr.length ; a ++) { | |
| 520 | + var fcsj = baseF.getDateTime(arr[a].fcsj); | |
| 521 | + // 判断是否在高峰时间范围.【true--表示在,false--表示不在】. | |
| 522 | + if(!baseF.isgfsjd01(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) { | |
| 523 | + if(order == 'asc') { | |
| 524 | + arr[a-1].isfb = isfb ? 1 : 0; | |
| 525 | + arr[a-1].STOPTIME = 0; | |
| 526 | + }else if(order == 'desc') { | |
| 527 | + var index_ = a + tcbcgzA[t].deletebcNum * 2; | |
| 528 | + arr[index_].STOPTIME = 0; | |
| 529 | + arr[index_].isfb = isfb && a > 0 ? 1 : 0; | |
| 530 | + } | |
| 531 | + arr.splice( a , tcbcgzA[t].deletebcNum * 2); | |
| 532 | + break; | |
| 533 | + } | |
| 534 | + } | |
| 535 | + } | |
| 536 | + }, | |
| 537 | + | |
| 538 | + /** | |
| 539 | + * @description (TODO) 排列各个路牌下的班次. | |
| 540 | + * @param bxrclist 班型数组对象. | |
| 541 | + * @prarm jsonArray 所有路牌下的班次. | |
| 542 | + * @param cara 路牌数组. | |
| 543 | + * @prarm saa 封装的一些 停站时间、周转时间、行驶时间、行驶里程等. | |
| 544 | + * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行]. | |
| 545 | + * @map map 表单参数. | |
| 546 | + * @return 返回一个满足单个路牌对应的标准工时、满足某班型下的所有路牌的平均工时对应的日平均工时、停站时间、路牌是否分班的班次集合. | |
| 547 | + */ | |
| 548 | + jslpgsAndbcs : function(bxrclist , jsonArray , cara , saa , dataMap , map) { | |
| 549 | + // 定义低谷最大发车时间、最大停站时间来反算出低谷最少配车数. | |
| 550 | + var dgmaxfcjx = parseInt(map.dgmaxfcjx), | |
| 551 | + dgmaxtzsj = parseInt(map.dgmaxtzsj); | |
| 552 | + // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙. | |
| 553 | + var dgminpcs = Math.round((dataMap.dgxxsjArr[0] + dataMap.dgxxsjArr[1] + dgmaxtzsj*2) / dgmaxfcjx); | |
| 554 | + // 定义返回数组. | |
| 555 | + var rs = new Array(); | |
| 556 | + for(var x = 0 ; x < bxrclist.length; x++) { | |
| 557 | + // 定义当前班型下对应的路牌、 班型下的各个路牌的所有班次数组. | |
| 558 | + var cla = bxrclist[x].sslp , bxlpbc = new Array() ; | |
| 559 | + // 根据劳动力和配车数 算出是否 单/双 档. | |
| 560 | + var keepOff = bxrclist[x].rs/bxrclist[x].fpcls; | |
| 561 | + // 定义当前班型/人次/配车数 下的标准工时. | |
| 562 | + var hoursV = bxrclist[x].hoursV * keepOff; | |
| 563 | + for(var s = 0 ; s < cla.length; s++) { | |
| 564 | + // 定义路牌编号、定义当前路牌下的所有班次. | |
| 565 | + var lpNo = cla[s].lpNo , lpbc = new Array(); | |
| 566 | + for(var i =0 ; i <jsonArray.length; i++) { | |
| 567 | + // 判断当期遍历的班次是否属于当前的路牌. | |
| 568 | + if(jsonArray[i].lpNo == lpNo) { | |
| 569 | + jsonArray[i].lpName = bxrclist[x].type + '_' + lpNo ; | |
| 570 | + lpbc.push(jsonArray[i]); | |
| 571 | + } | |
| 572 | + } | |
| 573 | + // 更新路牌数组的路牌名称. | |
| 574 | + baseF.updlpArr(cara , lpNo , (bxrclist[x].type + '_' + lpNo)); | |
| 575 | + if(lpbc.length > 0 ) { | |
| 576 | + // 按发车序号逆序排序路牌下的班次. | |
| 577 | + lpbc.sort(function(a,b){return b.fcno-a.fcno}); | |
| 578 | + lpbc[0].STOPTIME = 0; | |
| 579 | + // 因为这里路牌下的班次特点是连续性的 | |
| 580 | + // 所以求这个路牌下当前的总工时(分钟)直接用最后一个班次的到达时间 - 第一个班次的发车时间,再加上进出场时间、早晚例保时间. | |
| 581 | + var initCountGs = parseInt((baseF.getDateTime(lpbc[0].ARRIVALTIME) - baseF.getDateTime(lpbc[lpbc.length-1].fcsj)) / 60000) + | |
| 582 | + dataMap.jcsjArr[baseF.dirDmToIndex(lpbc[0].xlDir)] + | |
| 583 | + dataMap.ccsjArr[baseF.dirDmToIndex(lpbc[lpbc.length-1].xlDir)] + | |
| 584 | + saa[0].lbsj*2; | |
| 585 | + | |
| 586 | + // 如果分班路牌数超过了该班型下的路牌总数.则提示无法排列。 | |
| 587 | + if(keepOff == 1) { | |
| 588 | + if(bxrclist[x].gsavg > (hoursV + 1.5 * bxrclist[x].fpcls)) { | |
| 589 | + ErrorInfo.show('提示', | |
| 590 | + " 班型【" + bxrclist[x].type + "】 下的 " + | |
| 591 | + "日平均工时 " + bxrclist[x].gsavg + " 过大!最大值不能超过:" + | |
| 592 | + hoursV + " + " + "1.5" + "*" + bxrclist[x].fpcls + " 的和。"); | |
| 593 | + return false; | |
| 594 | + } | |
| 595 | + if(dgminpcs > bxrclist[x].fpcls && bxrclist[x].type != '五工二休') { | |
| 596 | + ErrorInfo.show('提示',"请合理的搭配【低谷的最大停站时间、最大发车间隙】 与 【劳动力】 、 【配车数】之间的数值!" + | |
| 597 | + " 在班型【" + bxrclist[x].type + " 】下会产生分班," + "而低谷最少配车数为:" + dgminpcs + | |
| 598 | + " 辆,但是在该班型下只配了:" + bxrclist[x].fpcls + "辆" ); | |
| 599 | + return false; | |
| 600 | + } | |
| 601 | + } else if(keepOff == 2) { | |
| 602 | + if(bxrclist[x].gsavg > (hoursV + 1.5*2*bxrclist[x].fpcls)) { | |
| 603 | + ErrorInfo.show('提示', | |
| 604 | + " 班型【" + bxrclist[x].type + "】 下的 " + | |
| 605 | + "日平均工时 " + bxrclist[x].gsavg + " 过大!最大值不能超过:" + | |
| 606 | + hoursV + " + " + "1.5" + "*2" + bxrclist[x].fpcls + " 的和。"); | |
| 607 | + return false; | |
| 608 | + } | |
| 609 | + } | |
| 610 | + // 'initCountGs' : parseFloat((initCountGs/60).toFixed(2)), | |
| 611 | + bxlpbc.push({'bxtyp' : bxrclist[x].type , 'lpNo' : lpNo , | |
| 612 | + 'lpbc' : lpbc , 'dygbcfcsj' : lpbc[lpbc.length-1].fcsj, | |
| 613 | + 'initCountGs' : initCountGs , | |
| 614 | + 'keepOff' : keepOff , 'bzgs' : parseInt(hoursV*60) , 'gsavg' : parseInt(bxrclist[x].gsavg*60) , | |
| 615 | + 'fcint' : baseF.getDateTime(lpbc[lpbc.length-1].fcsj).getTime()}); | |
| 616 | + } | |
| 617 | + } | |
| 618 | + if(bxlpbc.length > 0 ) { | |
| 619 | + bxlpbc.sort(function(x,y){return x.fcint-y.fcint}); | |
| 620 | + // console.log(bxlpbc); | |
| 621 | + // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班. | |
| 622 | + rs = rs.concat(baseF.tzlpgs02(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs)); | |
| 623 | + } | |
| 624 | + } | |
| 625 | + return rs; | |
| 626 | + }, | |
| 627 | + | |
| 628 | + /** | |
| 629 | + * @description (TODO) 更新路牌数组的路牌名称. | |
| 630 | + * @param cara 路牌数组 | |
| 631 | + * @param name 路牌新名称 | |
| 632 | + */ | |
| 633 | + updlpArr : function(cara , lpNo , name) { | |
| 634 | + for(var l = 0 ; l <cara.length;l++ ) { | |
| 635 | + if(cara[l].lpNo == lpNo) { | |
| 636 | + cara[l].lpName = name; | |
| 637 | + } | |
| 638 | + } | |
| 639 | + }, | |
| 640 | + | |
| 641 | + BXPplaceClassesTime02 : function(saa , cara , map , seMap , dataMap , lpNoA) { | |
| 642 | + // 得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数]. | |
| 643 | + var jsonArray = baseF.plgfbc01(saa , cara , map , seMap , dataMap); | |
| 644 | + // return {'json':jsonArray,'bxrcgs':null}; | |
| 645 | + | |
| 646 | + // 切割班型/人次/配车数 字符串 为 数组对象. | |
| 647 | + var list = baseF.splitBxRc02(map.bxrc); | |
| 648 | + // 把班型分配到对应的具体路牌上. | |
| 649 | + baseF.fprclp01(list,cara); | |
| 650 | + // console.log(list); | |
| 651 | + | |
| 652 | + var tempA = baseF.jslpgsAndbcs(list.data , baseF.tcbzfwndbc02(jsonArray , dataMap) , cara , saa , dataMap , map); | |
| 653 | + // return {'json':tempA,'bxrcgs':null}; | |
| 654 | + return {'json':baseF.addjcclcbc01(cara,tempA,dataMap,saa,map),'bxrcgs':null}; | |
| 655 | + var ttsmbA = baseF.tzsmbcsj01(tempA,dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap); | |
| 656 | + | |
| 657 | + baseF.jhfcjx02(ttsmbA,dataMap); | |
| 658 | + return {'json':ttsmbA,'bxrcgs':null}; | |
| 659 | + // var rsjar = baseF.tzsztest02(cara,ttsmbA,dataMap); | |
| 660 | + // return {'json':rsjar,'bxrcgs':null}; | |
| 661 | + return {'json':baseF.addjcclcbc01(cara,rsjar,dataMap,saa,map),'bxrcgs':null}; | |
| 662 | + }, | |
| 663 | + | |
| 664 | + tzsztest02 : function(cara,tempa,dataMap) { | |
| 665 | + var jsrs = new Array(); | |
| 666 | + for(var t = 0 ; t < cara.length; t++) { | |
| 667 | + if(t>3) | |
| 668 | + continue; | |
| 669 | + var sslpbcA = new Array(); | |
| 670 | + for(var j =0 ; j <tempa.length; j++) { | |
| 671 | + // 判断当期遍历的班次是否属于当前的路牌. | |
| 672 | + if(tempa[j].lpNo == cara[t].lpNo) | |
| 673 | + sslpbcA.push(tempa[j]); | |
| 674 | + } | |
| 675 | + sslpbcA.sort(function(a,b){return a.fcno-b.fcno}); | |
| 676 | + baseF.tztzsjInit02(sslpbcA,dataMap); | |
| 677 | + jsrs = jsrs.concat(sslpbcA); | |
| 678 | + } | |
| 679 | + return jsrs; | |
| 680 | + }, | |
| 681 | + | |
| 682 | + tztzsjInit02 : function(ar,dataMap) { | |
| 683 | + var maxXxsjA = [parseInt(dataMap.map.upTravelTime),parseInt(dataMap.map.downTravelTime)]; | |
| 684 | + var v1 = Math.max.apply(null, maxXxsjA) *1.5; | |
| 685 | + for(var r = 0 ; r< ar.length-1;r++) { | |
| 686 | + var sgbcfcsj = baseF.getDateTime(ar[r+1].fcsj),dqbcddsj = baseF.getDateTime(ar[r].ARRIVALTIME); | |
| 687 | + var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000); | |
| 688 | + if(dxmin<0 || ar[r].STOPTIME<0) { | |
| 689 | + var cctag = baseF.dirDmToIndex(ar[r].xlDir); | |
| 690 | + dxmin = ar[r].bcType == dataMap.bcTypeArr.cf ? 0 : baseF.isgfsjd01(baseF.getDateTime(ar[r].fcsj),dataMap) ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag]; | |
| 691 | + }else if(dxmin >= v1 && dxmin < 180) { | |
| 692 | + if(r==ar.length-2 || baseF.issmbcsjArr(ar[r+1].fcsj,dataMap.smbcsjArr)) { | |
| 693 | + dxmin = dxmin; | |
| 694 | + }else { | |
| 695 | + dxmin = v1; | |
| 696 | + } | |
| 697 | + } | |
| 698 | + if(ar[r].STOPTIME >0) { | |
| 699 | + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin); | |
| 700 | + ar[r+1].fcsj = baseF.getTimeStr(dqbcddsj); | |
| 701 | + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + ar[r+1].bcsj); | |
| 702 | + ar[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj); | |
| 703 | + ar[r].STOPTIME = dxmin >= 180 ? 0 : parseInt(dxmin); | |
| 704 | + } | |
| 705 | + } | |
| 706 | + }, | |
| 707 | + | |
| 708 | + | |
| 709 | + /** | |
| 710 | + * @description : (TODO) 均匀发车间隙 | |
| 711 | + * | |
| 712 | + * @params : [arr--某个方向下的班次数组;dir--方向;zzsj--周转时间] | |
| 713 | + * | |
| 714 | + * @return : 返回一个数组.这里返回的是调整过后 发车间距均匀的班次数组 | |
| 715 | + **/ | |
| 716 | + jhfcjx02 : function(bcArr,dataMap) { | |
| 717 | + if(bcArr.length<=0) | |
| 718 | + return; | |
| 719 | + var dirA = dataMap.dira; | |
| 720 | + var clzs = parseInt(dataMap.map.clzs); | |
| 721 | + for(var d = 0 ; d < dirA.length; d++) { | |
| 722 | + var fxdm = dirA[d],fxbc = new Array(); | |
| 723 | + var cctag = baseF.dirDmToIndex(fxdm); | |
| 724 | + for(var b = 0;b<bcArr.length ; b++) { | |
| 725 | + bcArr[b].fcint = baseF.getDateTime(bcArr[b].fcsj).getTime(); | |
| 726 | + if(bcArr[b].xlDir == fxdm) | |
| 727 | + fxbc.push(bcArr[b]); | |
| 728 | + } | |
| 729 | + var kssj = baseF.getDateTime(dataMap.smbcsjArr[cctag].kssj),// 开始时间. | |
| 730 | + jssj = baseF.getDateTime(dataMap.smbcsjArr[cctag].jssj);// 结束时间. | |
| 731 | + fxbc.sort(function(m,n){return m.fcint - n.fcint}); | |
| 732 | + while(kssj<=jssj) { | |
| 733 | + var tagboolean = baseF.isgfsjd01(kssj,dataMap); | |
| 734 | + var zzsj = tagboolean ? dataMap.zzsj.gfzzsj : dataMap.zzsj.dgzzsj; | |
| 735 | + if(true){ | |
| 736 | + var temp = new Date(); | |
| 737 | + temp.setHours(kssj.getHours()); | |
| 738 | + temp.setMinutes(kssj.getMinutes()+zzsj); | |
| 739 | + var sjdbcArr = baseF.getObjRegion(kssj,temp,fxbc,dataMap); | |
| 740 | + var len_ = sjdbcArr.length; | |
| 741 | + var bcCount = baseF.getlpNum(sjdbcArr);// 定长度 | |
| 742 | + if(len_>0 && bcCount > 0) { | |
| 743 | + var _fcjx = parseInt(Math.ceil(zzsj/bcCount)); | |
| 744 | + console.log(_fcjx); | |
| 745 | + var fcnosj = new Date(kssj); | |
| 746 | + for(var l = 0 ; l< len_ ; l++) { | |
| 747 | + // 每个路牌的末班车发车时间不准动. | |
| 748 | + /*if(baseF.iszhclzsbc(fxbc, sjdbcArr[l].fcno , clzs)) { | |
| 749 | + continue; | |
| 750 | + }*/ | |
| 751 | + sjdbcArr[l].fcsj = baseF.getTimeStr(fcnosj); | |
| 752 | + var _xxsj = baseF.getxssj(dataMap.zgfsjd, | |
| 753 | + dataMap.wgfsjd,fcnosj,dataMap.pcxssjArr, | |
| 754 | + dataMap.gfxxsjArr,baseF.dirDmToIndex(sjdbcArr[l].xlDir));// 获取行驶时间 | |
| 755 | + sjdbcArr[l].bcsj = _xxsj; | |
| 756 | + var ddsj = new Date(); | |
| 757 | + ddsj.setHours(fcnosj.getHours()); | |
| 758 | + ddsj.setMinutes(fcnosj.getMinutes()+_xxsj); | |
| 759 | + sjdbcArr[l].ARRIVALTIME = baseF.getTimeStr(ddsj); | |
| 760 | + fcnosj.setMinutes(fcnosj.getMinutes() + _fcjx); | |
| 761 | + } | |
| 762 | + } | |
| 763 | + } | |
| 764 | + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + zzsj)); | |
| 765 | + } | |
| 766 | + } | |
| 767 | + }, | |
| 768 | + | |
| 327 | 769 | BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) { |
| 328 | 770 | var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap); |
| 329 | 771 | var list = baseF.splitBxRc(map.bxrc); |
| ... | ... | @@ -830,6 +1272,7 @@ var BaseFun = function() { |
| 830 | 1272 | var bcCount = baseF.getlpNum(sjdbcArr);// 定长度 |
| 831 | 1273 | if(len_>0 && bcCount > 0) { |
| 832 | 1274 | var _fcjx = parseInt(Math.ceil(zzsj/bcCount)); |
| 1275 | + console.log(_fcjx); | |
| 833 | 1276 | var fcnosj = new Date(kssj); |
| 834 | 1277 | for(var l = 0 ; l< len_ ; l++) { |
| 835 | 1278 | // 每个路牌的末班车发车时间不准动. |
| ... | ... | @@ -1044,11 +1487,11 @@ var BaseFun = function() { |
| 1044 | 1487 | for(var r = 0 ; r<array.length;r++) { |
| 1045 | 1488 | tempA.push(array[r].STOPTIME + bs); |
| 1046 | 1489 | } |
| 1047 | - var v1 = Math.max.apply(null, maxXxsjA) *1.5; | |
| 1490 | + var v1 = Math.max.apply(null, maxXxsjA) * 1.5; | |
| 1048 | 1491 | var v2 = Math.max.apply(null, tempA); |
| 1049 | 1492 | if( v2 > v1) { |
| 1050 | 1493 | tag = false; |
| 1051 | - dx = parseInt(v2 -v1); | |
| 1494 | + dx = parseInt(v2 - v1); | |
| 1052 | 1495 | } |
| 1053 | 1496 | return {tag:tag,dx:dx}; |
| 1054 | 1497 | }, |
| ... | ... | @@ -1565,6 +2008,115 @@ var BaseFun = function() { |
| 1565 | 2008 | return inv; |
| 1566 | 2009 | }, |
| 1567 | 2010 | |
| 2011 | + | |
| 2012 | + /** | |
| 2013 | + * @discription : (TODO)获取所有路牌默认出场方向. | |
| 2014 | + * | |
| 2015 | + * 判定规则: | |
| 2016 | + * 下行头班车时间 + 下行行驶时间 + 下行停站时间 大于了 上行头班车时间 判定都为上行出场 否则为下行出场. | |
| 2017 | + * | |
| 2018 | + * 举例: | |
| 2019 | + * 浦东38路 上行头班车时间是7:00 下行头班车是6:30 ,下行行驶时间是25分钟 , 下行停站时间为5分钟. | |
| 2020 | + * 所以浦东38的所有路牌的第一个班次都是下行出场. | |
| 2021 | + * | |
| 2022 | + * @params : 起终点站的首末班车时间 | |
| 2023 | + * | |
| 2024 | + * @return : 返回方向结果. [0--上;1--下;2--未知]. | |
| 2025 | + * | |
| 2026 | + **/ | |
| 2027 | + getdefaultDir01 : function(list , xxsj , tzsj) { | |
| 2028 | + var sxtbcsj = baseF.getDateTime(list[0].kssj); | |
| 2029 | + var xxtbcsj = baseF.getDateTime(list[1].kssj); | |
| 2030 | + xxtbcsj.setMinutes(xxtbcsj.getMinutes() + xxsj + tzsj); | |
| 2031 | + if(xxtbcsj>sxtbcsj) { | |
| 2032 | + return 0; | |
| 2033 | + }else { | |
| 2034 | + return 1; | |
| 2035 | + } | |
| 2036 | + }, | |
| 2037 | + /** | |
| 2038 | + * @description (TODO) 得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数]. | |
| 2039 | + * @param saa 封装的一些 停站时间、周转时间、行驶时间、行驶里程等. | |
| 2040 | + * @param cara 路牌数组 | |
| 2041 | + * @param map 表单参数 | |
| 2042 | + * @param seMap 线路营运开始 ~ 结束时间 | |
| 2043 | + * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行]. | |
| 2044 | + * @return 返回一个所有路牌下的班次数[从各路牌下的第一个班次发车时间 ~ 营运结束时间点并且是连续的班次数]. | |
| 2045 | + * | |
| 2046 | + * ******************************** 思路 ********************************************************* | |
| 2047 | + * | |
| 2048 | + * 首先,以早高峰开始时间作为开始点 , 并且作为最后一个路牌的第一个班次的发车时间展开。 | |
| 2049 | + * | |
| 2050 | + * 纵向展开: | |
| 2051 | + * 以最后一个路牌的第一个班次发车时间为开始点,以阶梯形式向上展开. | |
| 2052 | + * | |
| 2053 | + * 规则: | |
| 2054 | + * 下一个路牌的第一个班次发车时间 = 当前路牌的第一个班次发车时间 + 在某时间范围内的发车间隙。 | |
| 2055 | + * 依次类推。可以得到每一个路牌下的第一个班次发车时间。 | |
| 2056 | + * | |
| 2057 | + * 举例:以最后一个路牌第一个班次的发车时间为开始点向上展开. | |
| 2058 | + * 最后一个路牌的第一个班次的发车时间为 6:31 | |
| 2059 | + * 倒数第二个路牌的第一个班次的发车时间为 6:39 = 6:31 + 某周转时间段内的发车间隙为:8 | |
| 2060 | + * 倒数第三个路牌的第一个班次的发车时间为 6:47 = 6:39 + 某周转时间段内的发车间隙为:8 | |
| 2061 | + * 倒数第四个.... | |
| 2062 | + * 以此类推. | |
| 2063 | + * | |
| 2064 | + * 横向展开: | |
| 2065 | + * 就是以每个路牌下的第一个班次的发车时间去补全当前路牌后面并且为连续性的班次。 | |
| 2066 | + * | |
| 2067 | + * 规则: | |
| 2068 | + * 当前班次 :班次的计划发车时间 + 当前方向下并且在某时间范围内的行驶时间 = 当前班次下的计划到达时间 以此推出下个班次的发车时间. | |
| 2069 | + * 下个班次 :下个班次的发车时间 = 以上个班次的到达时间 + 上个班次方向下并且在某时间范围内的停站时间. | |
| 2070 | + * 依次类推。以营运结束时间点作为结束。铺出当前路牌下并为连续性的班次数. | |
| 2071 | + * | |
| 2072 | + * 举例:以最后一个路牌的第一个班次开始向水平方向连续性的补全. | |
| 2073 | + * 第一个班次的发车时间是 6:31 , 某放下下的高峰行驶时间 25分钟 ,得到第一个班次的到达时间 6:31 + 25 = 6:56 , | |
| 2074 | + * 第二个班次: | |
| 2075 | + * 发车时间是 7:01 = 第一个班次的到达时间 6:56 + 第一个班次方向下并且在某时间范围内的停站时间 5分钟 | |
| 2076 | + * 某放下下的高峰行驶时间 25分钟 得到到达时间 : 7:01 + 25 = 7:26 | |
| 2077 | + * 第三个班次 | |
| 2078 | + * 发车时间是 7:31 = 第二个班次的到达时间 7:26 + 第二个班次方向下并且在某时间范围内的停站时间 5分钟 | |
| 2079 | + * 某放下下的高峰行驶时间 25分钟 得到到达时间 : 7:31 + 25 = 7:56 | |
| 2080 | + * 第四个班次 | |
| 2081 | + * 第五个班次 | |
| 2082 | + * ........ | |
| 2083 | + */ | |
| 2084 | + plgfbc01 : function(saa , cara , map, seMap , dataMap) { | |
| 2085 | + // 定义路牌长度 、所有路牌默认出场方向 [0--上行出场;1--下行出场] 、营运结束时间、返回数组. | |
| 2086 | + var len = cara.length , cctag , endTime = baseF.getDateTime(seMap.e) , rs = new Array(); | |
| 2087 | + // 获取所有路牌默认出场方向.如果是环线则只有一个上行方向. | |
| 2088 | + cctag = map.linePlayType=='1' ? 0 : baseF.getdefaultDir01(dataMap.smbcsjArr,saa[0].xxsj, saa[0].dgxxtzjx); | |
| 2089 | + for(var c = 0 ; c < len ; c++) { | |
| 2090 | + // 定义当前路牌的第一个班次的开始时间. | |
| 2091 | + var kssj = baseF.getDateTime(map.earlyStartTime); | |
| 2092 | + kssj.setMinutes(kssj.getMinutes()-(len - cara[c].lpNo)*saa[0].fcjx.dgfcjx); | |
| 2093 | + // 定义当前路牌方向变量 、 是否开启方向切换变量[0 --- 表示不开启 ; 1 -- 表示开启] 、 序号. | |
| 2094 | + var fxTagDm = cctag , fxflag = 0 , xhNo = 3; | |
| 2095 | + while(kssj <= endTime) { | |
| 2096 | + // 获取当前班次方向,如果是当前路牌的第一个班次则为默认方向,否则切换方向. | |
| 2097 | + fxTagDm = baseF.getfx(fxflag,fxTagDm); | |
| 2098 | + // 开启方向切换. | |
| 2099 | + fxflag = 1; | |
| 2100 | + // 定义在某时间段内[高峰时间段、低谷时间段]的停站时间. | |
| 2101 | + var tzsj = baseF.isgfsjd01(kssj,dataMap) ? dataMap.gftzsj[fxTagDm] : dataMap.dgtzsj[fxTagDm]; | |
| 2102 | + // 定义在某时间段内的行驶时间. | |
| 2103 | + var _xxsj = baseF.getxssj(dataMap.zgfsjd,dataMap.wgfsjd,kssj,dataMap.pcxssjArr,dataMap.gfxxsjArr,fxTagDm); | |
| 2104 | + // 定义当前班次的停站时间,这里是为了当计算到了最后一个班次的时候,那么停站时间为0 ,但是后续的班次的发车时间需要加上前一个班次的停站时间. | |
| 2105 | + var xs_tzsj = baseF.isLastbc(kssj,endTime,tzsj,_xxsj) ? 0 : tzsj; | |
| 2106 | + // 添加正常班次对象. | |
| 2107 | + rs.push(baseF.getbcObj(kssj , _xxsj , cara[c] , | |
| 2108 | + dataMap.bcTypeArr.normal, | |
| 2109 | + dataMap.dira[fxTagDm] , xhNo++, | |
| 2110 | + dataMap.pcxslcArr[fxTagDm] , map , 0, | |
| 2111 | + dataMap.qdzArr[fxTagDm], | |
| 2112 | + dataMap.zdzArr[fxTagDm], null , xs_tzsj , 0)); | |
| 2113 | + // 重新计算下一个班次的开始时间. | |
| 2114 | + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + tzsj)); | |
| 2115 | + } | |
| 2116 | + } | |
| 2117 | + return rs; | |
| 2118 | + }, | |
| 2119 | + | |
| 1568 | 2120 | plgfbc : function(saa , cara , map, seMap ,dataMap) { |
| 1569 | 2121 | var len = cara.length,rs = new Array(); |
| 1570 | 2122 | var lbsj = map.lb=='' ? 0:parseInt(map.lb); |
| ... | ... | @@ -1610,9 +2162,10 @@ var BaseFun = function() { |
| 1610 | 2162 | return rs; |
| 1611 | 2163 | }, |
| 1612 | 2164 | |
| 1613 | - isgfsjd01 : function(kssj,dataMap,type) { | |
| 2165 | + isgfsjd01 : function(kssj,dataMap) { | |
| 1614 | 2166 | var tag = false; |
| 1615 | - if((dataMap.zgfsjd[0].st <=kssj && kssj<= dataMap.zgfsjd[0].ed ) || ( dataMap.wgfsjd[0].st <= kssj && kssj <= dataMap.wgfsjd[0].ed)) | |
| 2167 | + if((dataMap.zgfsjd[0].st <= kssj && kssj<= dataMap.zgfsjd[0].ed ) || | |
| 2168 | + ( dataMap.wgfsjd[0].st <= kssj && kssj <= dataMap.wgfsjd[0].ed)) | |
| 1616 | 2169 | tag = true; |
| 1617 | 2170 | return tag; |
| 1618 | 2171 | }, |
| ... | ... | @@ -1653,6 +2206,34 @@ var BaseFun = function() { |
| 1653 | 2206 | return result; |
| 1654 | 2207 | }, |
| 1655 | 2208 | |
| 2209 | + splitBxRc02 : function(str) { | |
| 2210 | + var list = new Array(),rsa = new Array(); | |
| 2211 | + var gsgd = baseF.getBxLs(); | |
| 2212 | + var bxrcAr = str.split(','); | |
| 2213 | + for(var s = 0 ; s< bxrcAr.length;s++) { | |
| 2214 | + var s1a = bxrcAr[s].split('/'); | |
| 2215 | + var rs = parseInt(s1a[1]); | |
| 2216 | + var fpcls = parseInt(s1a[2]); | |
| 2217 | + var gsavg = parseInt(s1a[3]); | |
| 2218 | + var gsgdIndex = 0,hoursV = 0.0,minueV='' ; | |
| 2219 | + for(var g = 0 ; g < gsgd.length; g++) { | |
| 2220 | + if(gsgd[g].type == s1a[0]) { | |
| 2221 | + gsgdIndex = g; | |
| 2222 | + hoursV = gsgd[g].hoursV; | |
| 2223 | + minueV = gsgd[g].minueV; | |
| 2224 | + } | |
| 2225 | + } | |
| 2226 | + list.push({'type':s1a[0], | |
| 2227 | + 'rs':rs, | |
| 2228 | + 'fpcls':fpcls, | |
| 2229 | + 'hoursV':hoursV, | |
| 2230 | + 'minueV':minueV, | |
| 2231 | + 'gsavg' : gsavg}); | |
| 2232 | + rsa.push(rs); | |
| 2233 | + } | |
| 2234 | + return {'data':list.sort(function(a,b){return b.rs-a.rs}),'rsa':rsa.sort().reverse()}; | |
| 2235 | + }, | |
| 2236 | + | |
| 1656 | 2237 | splitBxRc : function(str) { |
| 1657 | 2238 | var list = new Array(),rsa = new Array();; |
| 1658 | 2239 | var gsgd = baseF.getBxLs(); | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
| ... | ... | @@ -966,9 +966,11 @@ var RelationshipGraph = function () { |
| 966 | 966 | var lpNo = array[a].lpNo; |
| 967 | 967 | var timeNum = 0 ,tempNum = 0; |
| 968 | 968 | for(var z = 0 ;z < tza.length;z++) { |
| 969 | - if(tza[z].lpNo == lpNo) { | |
| 969 | + if(tza[z].lpNo == lpNo && tza[z].bcsj >0 ) { | |
| 970 | 970 | timeNum = timeNum + tza[z].bcsj + tza[z].STOPTIME; |
| 971 | - tempNum ++; | |
| 971 | + if( tza[z].bcType !='bd' && tza[z].bcType !='lc' ) { | |
| 972 | + tempNum ++; | |
| 973 | + } | |
| 972 | 974 | } |
| 973 | 975 | } |
| 974 | 976 | var className = 'statis_container_' + lpNo; | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| ... | ... | @@ -64,7 +64,8 @@ |
| 64 | 64 | }else if(map.baseRes== '1') { |
| 65 | 65 | // 采用班型人次数据获取渲染时刻表明细图形的配置参数数据. |
| 66 | 66 | // data = BaseFun.BXPplaceClassesTime(stopAraay,CSMap.maxCar,map,seMap,dataMap,getylp(CSMap.maxCar).lpNoA); |
| 67 | - data = BaseFun.BXPplaceClassesTime01(stopAraay,CSMap.maxCar,map,seMap,dataMap,getylp(CSMap.maxCar).lpNoA); | |
| 67 | + // data = BaseFun.BXPplaceClassesTime01(stopAraay,CSMap.maxCar,map,seMap,dataMap,getylp(CSMap.maxCar).lpNoA); | |
| 68 | + data = BaseFun.BXPplaceClassesTime02(stopAraay,CSMap.maxCar,map,seMap,dataMap,getylp(CSMap.maxCar).lpNoA); | |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | }else { |
| ... | ... | @@ -129,7 +130,11 @@ |
| 129 | 130 | * @returns 返回一个分装发车间隙、车辆数的最大值集合. |
| 130 | 131 | * */ |
| 131 | 132 | function getMaxCarAndStopSpace1(map) { |
| 132 | - return {'gattA':null,'fcjx': {'gffcjx': Math.round(map.zzsj.gfzzsj/map.clzs) , 'dgfcjx': Math.round(map.zzsj.dgzzsj/map.clzs)},'maxCar':BaseFun.getYAxisCarArray(parseInt(map.clzs))}; | |
| 133 | + return {'gattA':null, | |
| 134 | + 'fcjx': {'gffcjx': Math.round(map.zzsj.gfzzsj/map.clzs) , | |
| 135 | + 'dgfcjx': Math.round(map.zzsj.dgzzsj/map.clzs), | |
| 136 | + 'dgmaxfcjx' : parseInt(map.dgmaxfcjx)}, | |
| 137 | + 'maxCar':BaseFun.getYAxisCarArray(parseInt(map.clzs))}; | |
| 133 | 138 | } |
| 134 | 139 | |
| 135 | 140 | /** |
| ... | ... | @@ -147,6 +152,8 @@ |
| 147 | 152 | 'pcxssjArr' : BaseFun.formatPairing(gatps.upTravelTime,gatps.downTravelTime),// 平常行驶时间。[下标0代表上;下标1代表下] |
| 148 | 153 | 'gfxxsjArr' : BaseFun.formatPairing(gatps.lateUpTime=='' ? gatps.upTravelTime : gatps.lateUpTime, |
| 149 | 154 | gatps.lateDownTime=='' ? gatps.downTravelTime : gatps.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下] |
| 155 | + 'dgxxsjArr' : BaseFun.formatPairing(gatps.troughUpTime=='' ? gatps.upTravelTime : gatps.troughUpTime, | |
| 156 | + gatps.troughDownTime=='' ? gatps.downTravelTime : gatps.troughDownTime),// 低谷行驶时间。[下标0代表上;下标1代表下] | |
| 150 | 157 | 'pcxslcArr' : BaseFun.formatPairing(gatps.upMileage,gatps.downMileage),// 行驶里程。[下标0代表上;下标1代表下] |
| 151 | 158 | 'qdzArr' : BaseFun.qzdz(gatps.up_s.split('_')[0],gatps.down_s.split('_')[0]),// 起始站。[下标0代表上;下标1代表下] |
| 152 | 159 | 'zdzArr':BaseFun.qzdz(gatps.up_s.split('_')[1],gatps.down_s.split('_')[1]),// 终点站。[下标0代表上;下标1代表下] |
| ... | ... | @@ -170,6 +177,8 @@ |
| 170 | 177 | // 'maxztjx' : parseInt(gatps.maxstopTime), // 最大停站时间. |
| 171 | 178 | 'gftzsj': BaseFun.formatPairing(gatps.gfupStopTime,gatps.gfdownStopTime),// 高峰停站时间. |
| 172 | 179 | 'dgtzsj' : BaseFun.formatPairing(gatps.dgupStopTime,gatps.dgdownStopTime),// 低谷停站时间. |
| 180 | + 'dgmaxtzsj' : parseInt(gatps.dgmaxtzsj),// 低谷最大停站时间. | |
| 181 | + 'dgmaxfcjx' : parseInt(gatps.dgmaxfcjx),// 低谷最大发车间隙. | |
| 173 | 182 | 'map' : gatps, |
| 174 | 183 | 'zzsj':gatps.zzsj,// 周转时间. |
| 175 | 184 | }; |
| ... | ... | @@ -191,6 +200,9 @@ |
| 191 | 200 | 'dgzzsj': parseInt(map.troughUpTime==''? map.upTravelTime : map.troughUpTime) + |
| 192 | 201 | parseInt(map.dgupStopTime) + parseInt(map.dgdownStopTime) + |
| 193 | 202 | parseInt(map.troughDownTime==''? map.downTravelTime: map.troughDownTime),// 低谷周转时间 |
| 203 | + 'dgmaxzzsj' : parseInt(map.troughUpTime==''? map.upTravelTime : map.troughUpTime) + | |
| 204 | + parseInt(map.dgmaxtzsj) + parseInt(map.dgmaxtzsj) + | |
| 205 | + parseInt(map.troughDownTime==''? map.downTravelTime: map.troughDownTime),// 低谷最大的周转时间 | |
| 194 | 206 | }; |
| 195 | 207 | } |
| 196 | 208 | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/tagsinput.js
| ... | ... | @@ -42,7 +42,8 @@ var ComponentsBootstrapTagsinput = function() { |
| 42 | 42 | var bctypeValue = $('#state_tagsinput_bctype').val(); |
| 43 | 43 | var rcnum = $('#state_tagsinput_rcsvalue').val(); |
| 44 | 44 | var clnum = $('#state_tagsinput_clsvalue').val(); |
| 45 | - if(isNull(bctypeValue,rcnum,clnum)) { | |
| 45 | + var gsvag = $('#state_tagsinput_gsavgvalue').val(); | |
| 46 | + if(isNull(bctypeValue,rcnum,clnum,gsvag)) { | |
| 46 | 47 | if(!Number.isInteger(parseInt(rcnum)/parseInt(clnum))) { |
| 47 | 48 | layer.msg('当前算法只支持【单/双挡】!请您重新输入!'); |
| 48 | 49 | $('#state_tagsinput_bctype').val(null); |
| ... | ... | @@ -56,22 +57,24 @@ var ComponentsBootstrapTagsinput = function() { |
| 56 | 57 | if(s1a[0]==bctypeValue) { |
| 57 | 58 | rcnum = parseInt(rcnum) + parseInt(s1a[1]); |
| 58 | 59 | clnum = parseInt(clnum) + parseInt(s1a[2]); |
| 60 | + gsvag = parseInt(s1a[3]); | |
| 59 | 61 | } |
| 60 | 62 | } |
| 61 | 63 | elt.tagsinput('add', { |
| 62 | - "value": bctypeValue + '/' + rcnum + '/' + clnum, | |
| 63 | - "text": bctypeValue + '/' + rcnum + '/' + clnum, | |
| 64 | + "value": bctypeValue + '/' + rcnum + '/' + clnum + '/' + gsvag, | |
| 65 | + "text": bctypeValue + '/' + rcnum + '/' + clnum + '/' + gsvag, | |
| 64 | 66 | "continent": bctypeValue, |
| 65 | 67 | }); |
| 66 | 68 | $('#state_tagsinput_bctype').val(null); |
| 67 | 69 | $('#state_tagsinput_rcsvalue').val(null); |
| 68 | 70 | $('#state_tagsinput_clsvalue').val(null); |
| 71 | + $('#state_tagsinput_gsavgvalue').val(null); | |
| 69 | 72 | } |
| 70 | 73 | }); |
| 71 | 74 | |
| 72 | - var isNull = function(v1,v2,v3) { | |
| 75 | + var isNull = function(v1,v2,v3,v4) { | |
| 73 | 76 | var tag = true; |
| 74 | - if(v1==''|| v2=='' || v3=='') | |
| 77 | + if(v1==''|| v2=='' || v3=='' || v4=='') | |
| 75 | 78 | tag = false; |
| 76 | 79 | return tag; |
| 77 | 80 | } | ... | ... |
src/main/resources/static/pages/base/timesmodel/tepms/bctype_temp.html
| ... | ... | @@ -170,56 +170,83 @@ |
| 170 | 170 | |
| 171 | 171 | <!-- 表单分组组件 form-group START --> |
| 172 | 172 | <div class="form-group"> |
| 173 | - <!-- 高峰上行停站间隙 (* 必填项) START --> | |
| 173 | + <!-- 高峰上行停站时间 (* 必填项) START --> | |
| 174 | 174 | <div class="col-md-6"> |
| 175 | 175 | <label class="control-label col-md-5"> |
| 176 | - <span class="required"> * </span> 高峰上行停站间隙: | |
| 176 | + <span class="required"> * </span> 高峰上行停站时间: | |
| 177 | 177 | </label> |
| 178 | 178 | <div class="col-md-5"> |
| 179 | 179 | <input type="text" class="form-control" name="gfupStopTime" id="gfupStopTimeInput" |
| 180 | - placeholder="请输入高峰上行停站间隙"> | |
| 180 | + placeholder="请输入高峰上行停站时间"> | |
| 181 | 181 | </div> |
| 182 | 182 | </div> |
| 183 | - <!-- 上行停站间隙 (* 必填项) END --> | |
| 183 | + <!-- 上行停站时间 (* 必填项) END --> | |
| 184 | 184 | |
| 185 | - <!-- 高峰下行停站间隙 (* 必填项) START --> | |
| 185 | + <!-- 高峰下行停站时间 (* 必填项) START --> | |
| 186 | 186 | <div class="col-md-6"> |
| 187 | 187 | <label class="control-label col-md-5"> |
| 188 | - <span class="required"> * </span> 高峰下行停站间隙: | |
| 188 | + <span class="required"> * </span> 高峰下行停站时间: | |
| 189 | 189 | </label> |
| 190 | 190 | <div class="col-md-5"> |
| 191 | 191 | <input type="text" class="form-control" name="gfdownStopTime" id="gfdownStopTimeInput" |
| 192 | - placeholder="请输入高峰下行停站间隙"> | |
| 192 | + placeholder="请输入高峰下行停站时间"> | |
| 193 | 193 | </div> |
| 194 | 194 | </div> |
| 195 | - <!-- 高峰下行停站间隙 (* 必填项) END --> | |
| 195 | + <!-- 高峰下行停站时间 (* 必填项) END --> | |
| 196 | 196 | </div> |
| 197 | 197 | <!-- 表单分组组件 form-group END --> |
| 198 | 198 | |
| 199 | 199 | <!-- 表单分组组件 form-group START --> |
| 200 | 200 | <div class="form-group"> |
| 201 | - <!-- 低谷上行停站间隙(* 必填项) START --> | |
| 201 | + <!-- 低谷上行停站时间(* 必填项) START --> | |
| 202 | 202 | <div class="col-md-6"> |
| 203 | 203 | <label class="control-label col-md-5"> |
| 204 | - <span class="required"> * </span> 低谷上行停站间隙: | |
| 204 | + <span class="required"> * </span> 低谷上行停站时间: | |
| 205 | 205 | </label> |
| 206 | 206 | <div class="col-md-5"> |
| 207 | - <input type="text" class="form-control" name="dgupStopTime" id="dgupStopTimeInput" placeholder="请输入低谷上行停站间隙"> | |
| 207 | + <input type="text" class="form-control" name="dgupStopTime" id="dgupStopTimeInput" placeholder="请输入低谷上行停站时间"> | |
| 208 | 208 | </div> |
| 209 | 209 | </div> |
| 210 | - <!-- 低谷上行停站间隙(* 必填项) END --> | |
| 210 | + <!-- 低谷上行停站时间(* 必填项) END --> | |
| 211 | 211 | |
| 212 | - <!-- 低谷下行停站间隙(* 必填项) START --> | |
| 212 | + <!-- 低谷下行停站时间(* 必填项) START --> | |
| 213 | 213 | <div class="col-md-6"> |
| 214 | 214 | <label class="control-label col-md-5"> |
| 215 | - <span class="required"> * </span> 低谷下行停站间隙: | |
| 215 | + <span class="required"> * </span> 低谷下行停站时间: | |
| 216 | 216 | </label> |
| 217 | 217 | <div class="col-md-5"> |
| 218 | 218 | <input type="text" class="form-control" name="dgdownStopTime" id="dgdownStopTimeInput" |
| 219 | - placeholder="请输入低谷下行停站间隙"> | |
| 219 | + placeholder="请输入低谷下行停站时间"> | |
| 220 | 220 | </div> |
| 221 | 221 | </div> |
| 222 | - <!-- 低谷停站间隙 (* 必填项) END --> | |
| 222 | + <!-- 低谷停站时间 (* 必填项) END --> | |
| 223 | +</div> | |
| 224 | +<!-- 表单分组组件 form-group END --> | |
| 225 | + | |
| 226 | +<!-- 表单分组组件 form-group START --> | |
| 227 | +<div class="form-group"> | |
| 228 | + <!-- 低谷最大发车间隙(* 必填项) START --> | |
| 229 | + <div class="col-md-6"> | |
| 230 | + <label class="control-label col-md-5"> | |
| 231 | + <span class="required"> * </span> 低谷最大发车间隙: | |
| 232 | + </label> | |
| 233 | + <div class="col-md-5"> | |
| 234 | + <input type="text" class="form-control" name="dgmaxfcjx" id="dgmaxfcjxInput" placeholder="请输入低谷最大发车间隙"> | |
| 235 | + </div> | |
| 236 | + </div> | |
| 237 | + <!-- 低谷最大发车间隙(* 必填项) END --> | |
| 238 | + | |
| 239 | + <!-- 低谷最大停站时间(* 必填项) START --> | |
| 240 | + <div class="col-md-6"> | |
| 241 | + <label class="control-label col-md-5"> | |
| 242 | + <span class="required"> * </span> 低谷最大停站时间: | |
| 243 | + </label> | |
| 244 | + <div class="col-md-5"> | |
| 245 | + <input type="text" class="form-control" name="dgmaxtzsj" id="dgmaxtzsjInput" | |
| 246 | + placeholder="请输入低谷最大停站时间"> | |
| 247 | + </div> | |
| 248 | + </div> | |
| 249 | + <!-- 低谷停站时间 (* 必填项) END --> | |
| 223 | 250 | </div> |
| 224 | 251 | <!-- 表单分组组件 form-group END --> |
| 225 | 252 | |
| ... | ... | @@ -523,9 +550,14 @@ |
| 523 | 550 | <div class="col-md-6 "> |
| 524 | 551 | <label class="control-label col-md-5"><span class="required"> * </span>班型/人次/车辆 :</label> |
| 525 | 552 | <div class="col-md-5 tagsDiv"> |
| 526 | - <input type="text" value="" name="bxrc" id="state_tagsinput" style="display: none;"> | |
| 527 | - <div class="margin-top-10"> | |
| 528 | - <select class="form-control" id="state_tagsinput_bctype"> | |
| 553 | + <div class="row" style="margin-left: 15px;"> | |
| 554 | + <input type="text" value="" name="bxrc" id="state_tagsinput" style="display: none;"> | |
| 555 | + </div> | |
| 556 | + | |
| 557 | + <div class="row" style="margin-top: 10px;"> | |
| 558 | + <label class="control-label col-md-4">工休类型 :</label> | |
| 559 | + <div class="col-md-8"> | |
| 560 | + <select class="form-control" id="state_tagsinput_bctype"> | |
| 529 | 561 | <option value="">请选择工休类型...</option> |
| 530 | 562 | <option value="六工一休">六工一休</option> |
| 531 | 563 | <option value="五工一休">五工一休</option> |
| ... | ... | @@ -536,14 +568,31 @@ |
| 536 | 568 | <option value="一工一休">一工一休</option> |
| 537 | 569 | <option value="无工休">无工休</option> |
| 538 | 570 | </select> |
| 571 | + </div> | |
| 572 | + </div> | |
| 573 | + | |
| 574 | + <div class="row" style="margin-top: 10px;"> | |
| 575 | + <label class="control-label col-md-4">分配人次数:</label> | |
| 576 | + <div class="col-md-8"> | |
| 577 | + <input type="number" class="form-control" placeholder="请输入分配人次数" id="state_tagsinput_rcsvalue" min="1"> | |
| 578 | + </div> | |
| 539 | 579 | </div> |
| 540 | - <div class="margin-top-10"> | |
| 541 | - <input type="number" class="form-control" placeholder="请输入分配人次数" id="state_tagsinput_rcsvalue" min="1"> | |
| 580 | + | |
| 581 | + <div class="row" style="margin-top: 10px;"> | |
| 582 | + <label class="control-label col-md-4">分配车辆数:</label> | |
| 583 | + <div class="col-md-8"> | |
| 584 | + <input type="number" class="form-control" placeholder="请输入分配车辆数" id="state_tagsinput_clsvalue" min="1"> | |
| 585 | + </div> | |
| 542 | 586 | </div> |
| 543 | - <div class="margin-top-10"> | |
| 544 | - <input type="number" class="form-control" placeholder="请输入分配车辆数" id="state_tagsinput_clsvalue" min="1"> | |
| 587 | + | |
| 588 | + <div class="row" style="margin-top: 10px;"> | |
| 589 | + <label class="control-label col-md-4">日平均工时:</label> | |
| 590 | + <div class="col-md-8"> | |
| 591 | + <input type="number" class="form-control" placeholder="请输入日平均工时" id="state_tagsinput_gsavgvalue" min="1"> | |
| 592 | + </div> | |
| 545 | 593 | </div> |
| 546 | - <div class="margin-top-10"> | |
| 594 | + | |
| 595 | + <div class="row" style="margin-top: 10px;margin-left: 116px;"> | |
| 547 | 596 | <a href="javascript:;" class="btn red" id="state_tagsinput_add">添加</a> |
| 548 | 597 | </div> |
| 549 | 598 | </div> |
| ... | ... | @@ -710,43 +759,65 @@ |
| 710 | 759 | |
| 711 | 760 | <!-- 表单分组组件 form-group START --> |
| 712 | 761 | <div class="form-group"> |
| 713 | - <!-- 高峰上行停站间隙(* 必填项) START --> | |
| 762 | + <!-- 高峰上行停站时间(* 必填项) START --> | |
| 714 | 763 | <div class="col-md-6"> |
| 715 | - <label class="control-label col-md-5"> 高峰上行停站间隙: </label> | |
| 764 | + <label class="control-label col-md-5"> 高峰上行停站时间: </label> | |
| 716 | 765 | <div class="col-md-4"> |
| 717 | 766 | <p class="form-control-static" data-display="gfupStopTime"> </p> |
| 718 | 767 | </div> |
| 719 | 768 | </div> |
| 720 | - <!-- 高峰上行停站间隙(* 必填项) END --> | |
| 721 | - <!-- 高峰下行停站间隙(* 必填项) START --> | |
| 769 | + <!-- 高峰上行停站时间(* 必填项) END --> | |
| 770 | + <!-- 高峰下行停站时间(* 必填项) START --> | |
| 722 | 771 | <div class="col-md-6"> |
| 723 | - <label class="control-label col-md-5"> 高峰下行停站间隙: </label> | |
| 772 | + <label class="control-label col-md-5"> 高峰下行停站时间: </label> | |
| 724 | 773 | <div class="col-md-4"> |
| 725 | 774 | <p class="form-control-static" data-display="gfdownStopTime"> </p> |
| 726 | 775 | </div> |
| 727 | 776 | </div> |
| 728 | - <!-- 高峰下行停站间隙(* 必填项) END --> | |
| 777 | + <!-- 高峰下行停站时间(* 必填项) END --> | |
| 729 | 778 | </div> |
| 730 | 779 | <!-- 表单分组组件 form-group END --> |
| 731 | 780 | |
| 732 | 781 | <!-- 表单分组组件 form-group START --> |
| 733 | 782 | <div class="form-group"> |
| 734 | - <!-- 低谷上行停站间隙(* 必填项) START --> | |
| 783 | + <!-- 低谷上行停站时间(* 必填项) START --> | |
| 735 | 784 | <div class="col-md-6"> |
| 736 | - <label class="control-label col-md-5"> 低谷上行停站间隙: </label> | |
| 785 | + <label class="control-label col-md-5"> 低谷上行停站时间: </label> | |
| 737 | 786 | <div class="col-md-4"> |
| 738 | 787 | <p class="form-control-static" data-display="dgupStopTime"> </p> |
| 739 | 788 | </div> |
| 740 | 789 | </div> |
| 741 | - <!-- 低谷上行停站间隙(* 必填项) END --> | |
| 742 | - <!-- 低谷下行停站间隙(* 必填项) START --> | |
| 790 | + <!-- 低谷上行停站时间(* 必填项) END --> | |
| 791 | + <!-- 低谷下行停站时间(* 必填项) START --> | |
| 743 | 792 | <div class="col-md-6"> |
| 744 | - <label class="control-label col-md-5"> 低谷下行停站间隙: </label> | |
| 793 | + <label class="control-label col-md-5"> 低谷下行停站时间: </label> | |
| 745 | 794 | <div class="col-md-4"> |
| 746 | 795 | <p class="form-control-static" data-display="dgdownStopTime"> </p> |
| 747 | 796 | </div> |
| 748 | 797 | </div> |
| 749 | - <!-- 低谷下行停站间隙(* 必填项) END --> | |
| 798 | + <!-- 低谷下行停站时间(* 必填项) END --> | |
| 799 | +</div> | |
| 800 | +<!-- 表单分组组件 form-group END --> | |
| 801 | + | |
| 802 | +<!-- 表单分组组件 form-group START --> | |
| 803 | +<div class="form-group"> | |
| 804 | + <!-- 低谷最大发车间隙(* 必填项) START --> | |
| 805 | + <div class="col-md-6"> | |
| 806 | + <label class="control-label col-md-5"> 低谷最大发车间隙: </label> | |
| 807 | + <div class="col-md-4"> | |
| 808 | + <p class="form-control-static" data-display="dgmaxfcjx"> </p> | |
| 809 | + </div> | |
| 810 | + </div> | |
| 811 | + <!-- 低谷最大发车间隙(* 必填项) END --> | |
| 812 | + | |
| 813 | + <!-- 低谷最大停站时间(* 必填项) START --> | |
| 814 | + <div class="col-md-6"> | |
| 815 | + <label class="control-label col-md-5"> 低谷最大停站时间: </label> | |
| 816 | + <div class="col-md-4"> | |
| 817 | + <p class="form-control-static" data-display="dgmaxtzsj"> </p> | |
| 818 | + </div> | |
| 819 | + </div> | |
| 820 | + <!-- 低谷最大停站时间(* 必填项) END --> | |
| 750 | 821 | </div> |
| 751 | 822 | <!-- 表单分组组件 form-group END --> |
| 752 | 823 | ... | ... |