Commit 7b70144aea16bd3e0ff589b057a271b15c0959c1
1 parent
2ea9f571
bsthlq <2519941818@qq.com>线路文件生成BUG修改
Showing
8 changed files
with
119 additions
and
81 deletions
src/main/java/com/bsth/repository/SectionRouteRepository.java
| ... | ... | @@ -163,7 +163,7 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int |
| 163 | 163 | "s.speed_limit," + |
| 164 | 164 | "s.section_name " + |
| 165 | 165 | " FROM bsth_c_sectionroute c " + |
| 166 | - " LEFT JOIN bsth_c_section s on c.section = s.id where c.line = ?1 and c.directions = ?2", nativeQuery=true) | |
| 166 | + " LEFT JOIN bsth_c_section s on c.section = s.id where c.line = ?1 and c.directions = ?2 and c.destroy = 0", nativeQuery=true) | |
| 167 | 167 | List<Object[]> sectionRouteVector(Integer lineId,Integer directions); |
| 168 | 168 | |
| 169 | 169 | @Transactional | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -153,7 +153,7 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 153 | 153 | "s.station_route_code," + |
| 154 | 154 | "s.directions," + |
| 155 | 155 | "s.distances,"+ |
| 156 | - "s.station FROM bsth_c_stationroute s where s.line = ?1) a " + | |
| 156 | + "s.station FROM bsth_c_stationroute s where s.line = ?1 and s.destroy=0) a " + | |
| 157 | 157 | "LEFT JOIN bsth_c_station b " + |
| 158 | 158 | " on a.station = b.id ORDER BY a.directions ASC ) k ORDER BY k.directions,k.station_route_code ASC", nativeQuery=true) |
| 159 | 159 | List<Object[]> usingSingle(Integer lineId); | ... | ... |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| ... | ... | @@ -24,6 +24,7 @@ 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; | |
| 27 | 28 | import java.io.InputStream; |
| 28 | 29 | import java.text.DecimalFormat; |
| 29 | 30 | import java.util.*; |
| ... | ... | @@ -511,57 +512,38 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 511 | 512 | */ |
| 512 | 513 | @Override |
| 513 | 514 | public Map<String, Object> usingSingle(Map<String, Object> map) { |
| 514 | - | |
| 515 | 515 | // 返回值map |
| 516 | 516 | Map<String, Object> resultMap = new HashMap<String,Object>(); |
| 517 | - | |
| 518 | 517 | try { |
| 519 | - | |
| 520 | 518 | // 获取线路ID |
| 521 | 519 | Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); |
| 522 | - | |
| 523 | 520 | /** 查询线路信息 @param:<lineId:线路ID> */ |
| 524 | 521 | Line line = lineRepository.findOne(lineId); |
| 525 | - | |
| 526 | 522 | /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */ |
| 527 | 523 | List<Object[]> objects = repository.usingSingle(lineId); |
| 528 | - | |
| 529 | 524 | if (objects.size()>0) { |
| 530 | - | |
| 531 | 525 | /** 获取配置文件里的ftp登录参数 */ |
| 532 | 526 | Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); |
| 533 | - | |
| 534 | 527 | // 压缩文件名 |
| 535 | 528 | String odlGzFileName = line.getLineCode() + ".txt.gz"; |
| 536 | - | |
| 537 | 529 | // txt文件名 |
| 538 | 530 | String textFileName = line.getLineCode() + ".txt"; |
| 539 | - | |
| 540 | 531 | // 创建一个ftp上传实例 |
| 541 | 532 | FTPClientUtils clientUtils = new FTPClientUtils(); |
| 542 | - | |
| 543 | 533 | // IP |
| 544 | 534 | String url = FTPParamMap.get("url").toString(); |
| 545 | - | |
| 546 | 535 | // 端口 |
| 547 | 536 | int port = Integer.valueOf(FTPParamMap.get("port").toString()); |
| 548 | - | |
| 549 | 537 | // 用户名 |
| 550 | 538 | String username = FTPParamMap.get("username").toString(); |
| 551 | - | |
| 552 | 539 | // 密码 |
| 553 | 540 | String password = FTPParamMap.get("password").toString(); |
| 554 | - | |
| 555 | 541 | // 相对路径 |
| 556 | 542 | String remotePath = FTPParamMap.get("remotePath").toString(); |
| 557 | - | |
| 558 | 543 | /** 如果已存在相同行单文件名则先删除 */ |
| 559 | 544 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName); |
| 560 | - | |
| 561 | 545 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName); |
| 562 | - | |
| 563 | 546 | String textStr = ""; |
| 564 | - | |
| 565 | 547 | boolean tempTag = ishxType(objects); |
| 566 | 548 | |
| 567 | 549 | if(tempTag) |
| ... | ... | @@ -575,6 +557,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 575 | 557 | |
| 576 | 558 | InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk")); |
| 577 | 559 | |
| 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 | + }*/ | |
| 578 | 566 | /** 生成txt文件,上传ftp */ |
| 579 | 567 | clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input); |
| 580 | 568 | |
| ... | ... | @@ -645,25 +633,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 645 | 633 | * @return String |
| 646 | 634 | */ |
| 647 | 635 | public String newTextFileToFTP(List<Object[]> objects,Integer lineId) { |
| 648 | - | |
| 649 | 636 | // 返回值String |
| 650 | 637 | String stationRStr = ""; |
| 651 | - | |
| 652 | 638 | // windows下的文本文件换行符 |
| 653 | 639 | //String enterStr = "\r\n"; |
| 654 | - | |
| 655 | 640 | // linux/unix下的文本文件换行符 |
| 656 | 641 | String enterStr = "\r"; |
| 657 | - | |
| 642 | + int defaultZdxh = 0; | |
| 658 | 643 | if(objects.size()>0) { |
| 659 | - | |
| 660 | 644 | for(int i = 0; i<objects.size();i++) { |
| 661 | - | |
| 645 | + defaultZdxh ++ ; | |
| 662 | 646 | // 经度 |
| 663 | - String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); | |
| 647 | + String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString(); | |
| 664 | 648 | |
| 665 | 649 | // 纬度 |
| 666 | - String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); | |
| 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)); | |
| 667 | 653 | |
| 668 | 654 | lat = "\t" + lat; |
| 669 | 655 | |
| ... | ... | @@ -673,23 +659,32 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 673 | 659 | String stationMake = ""; |
| 674 | 660 | |
| 675 | 661 | if(stationMakeStr.equals("E")) { |
| 676 | - | |
| 677 | 662 | stationMake = "\t2"; |
| 678 | - | |
| 679 | 663 | }else { |
| 680 | - | |
| 681 | 664 | stationMake ="\t1"; |
| 682 | - | |
| 683 | 665 | } |
| 684 | 666 | |
| 685 | 667 | // 站点序号 |
| 686 | - String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString(); | |
| 668 | + // String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString(); | |
| 669 | + String stationNo = String.valueOf(defaultZdxh); | |
| 687 | 670 | |
| 688 | 671 | stationNo = "\t" + stationNo; |
| 689 | 672 | |
| 690 | 673 | // 站点编码 |
| 691 | 674 | String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); |
| 692 | 675 | |
| 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 | + | |
| 693 | 688 | stationCode = "\t" +stationCode; |
| 694 | 689 | |
| 695 | 690 | double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; |
| ... | ... | @@ -709,41 +704,33 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 709 | 704 | |
| 710 | 705 | // 限速 |
| 711 | 706 | String sleepStr = ""; |
| 712 | - | |
| 713 | 707 | // 方向 |
| 714 | 708 | int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString()); |
| 715 | - | |
| 716 | 709 | /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ |
| 717 | 710 | List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); |
| 718 | - | |
| 719 | 711 | if(sobje.size()==1) { |
| 720 | - | |
| 721 | - double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString()); | |
| 722 | - | |
| 723 | - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr); | |
| 724 | - | |
| 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); | |
| 725 | 714 | }else if(sobje.size()>1){ |
| 726 | - | |
| 727 | - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */ | |
| 728 | 715 | for(int j =0;j<sobje.size();j++) { |
| 729 | - | |
| 730 | - String sectionName = sobje.get(j)[3].toString(); | |
| 731 | - | |
| 732 | - String sectionNameA[] = sectionName.split("至"); | |
| 733 | - | |
| 734 | - if(stationName.equals(sectionNameA[0])){ | |
| 735 | - | |
| 736 | - /*sleepStr = sobje.get(j)[2].toString();*/ | |
| 737 | - | |
| 738 | - double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString()); | |
| 739 | - | |
| 740 | - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt); | |
| 741 | - | |
| 716 | + int dsleepStrt = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.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(dsleepStrt); | |
| 728 | + break; | |
| 742 | 729 | } |
| 743 | - | |
| 744 | 730 | } |
| 745 | 731 | } |
| 746 | - | |
| 732 | + if(sleepStr.equals("")) | |
| 733 | + sleepStr = "\t" + "60"; | |
| 747 | 734 | stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; |
| 748 | 735 | } |
| 749 | 736 | |
| ... | ... | @@ -762,9 +749,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 762 | 749 | for(int i = 0; i<objects.size();i++) { |
| 763 | 750 | if(Integer.valueOf(objects.get(i)[8].toString())==0) { |
| 764 | 751 | // 经度 |
| 765 | - String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); | |
| 752 | + String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString(); | |
| 753 | + | |
| 766 | 754 | // 纬度 |
| 767 | - String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); | |
| 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)); | |
| 768 | 758 | lat = "\t" + lat; |
| 769 | 759 | // 站点类型 |
| 770 | 760 | String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString(); |
| ... | ... | @@ -779,6 +769,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 779 | 769 | String stationNo = "\t" + xh; |
| 780 | 770 | // 站点编码 |
| 781 | 771 | 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 | + } | |
| 782 | 783 | stationCode = "\t" +stationCode; |
| 783 | 784 | double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; |
| 784 | 785 | String tempDistc = String.valueOf((int) dis); |
| ... | ... | @@ -794,20 +795,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 794 | 795 | /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ |
| 795 | 796 | List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); |
| 796 | 797 | if(sobje.size()==1) { |
| 797 | - double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString()); | |
| 798 | - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr); | |
| 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); | |
| 799 | 800 | }else if(sobje.size()>1){ |
| 800 | - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */ | |
| 801 | 801 | for(int j =0;j<sobje.size();j++) { |
| 802 | - String sectionName = sobje.get(j)[3].toString(); | |
| 803 | - String sectionNameA[] = sectionName.split("至"); | |
| 804 | - if(stationName.equals(sectionNameA[0])){ | |
| 805 | - /*sleepStr = sobje.get(j)[2].toString();*/ | |
| 806 | - double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString()); | |
| 807 | - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt); | |
| 802 | + int dsleepStrt = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.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(dsleepStrt); | |
| 814 | + break; | |
| 808 | 815 | } |
| 809 | 816 | } |
| 810 | 817 | } |
| 818 | + if(sleepStr.equals("")) | |
| 819 | + sleepStr = "\t" + "60"; | |
| 811 | 820 | xh++; |
| 812 | 821 | restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; |
| 813 | 822 | } | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/add-form-reload.js
| ... | ... | @@ -46,7 +46,8 @@ |
| 46 | 46 | obj.jhlc = d[i].jhlc;// 计划里程 |
| 47 | 47 | obj.lp = d[i].lp==null ? null : d[i].lp.id;// 路牌id |
| 48 | 48 | obj.lpType = d[i].lp==null ? null : d[i].lp.lpType;// 路牌类型 |
| 49 | - obj.parent = d[i].lp.lpName;// 路牌名称 | |
| 49 | + obj.parent = d[i].lp.lpNo;// 路牌名称 | |
| 50 | + obj.lpName = d[i].lp.lpName; | |
| 50 | 51 | obj.lpNo = d[i].lp.lpNo;// 路牌编码 |
| 51 | 52 | obj.tcc = d[i].tcc==null ? null : d[i].tcc.id;// 停车场id |
| 52 | 53 | obj.ttinfo = d[i].ttinfo==null ? null : d[i].ttinfo.id;// 时刻表id |
| ... | ... | @@ -60,7 +61,7 @@ |
| 60 | 61 | resultD.push(obj); |
| 61 | 62 | if(lpA.indexOf(obj.lpNo)<0) { |
| 62 | 63 | lpA.push(obj.lpNo); |
| 63 | - rsLpA.push({'lp':obj.lp,'lpNo':obj.lpNo,'lpName':obj.parent,'lpType':obj.lpType}); | |
| 64 | + rsLpA.push({'lp':obj.lp,'lpNo':obj.lpNo,'lpName':obj.lpName,'lpType':obj.lpType}); | |
| 64 | 65 | } |
| 65 | 66 | } |
| 66 | 67 | // 返回渲染图形的数据格式. | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js
| ... | ... | @@ -407,7 +407,9 @@ var SKBFormWizard = function() { |
| 407 | 407 | obj.jhlc = d[i].jhlc;// 计划里程 |
| 408 | 408 | obj.lp = d[i].lp==null ? null : d[i].lp.id;// 路牌id |
| 409 | 409 | obj.lpType = d[i].lp==null ? null : d[i].lp.lpType;// 路牌类型 |
| 410 | - obj.parent = d[i].lp.lpName;// 路牌名称 | |
| 410 | + // obj.parent = d[i].lp.lpName;// 路牌名称 | |
| 411 | + // obj.parent = parseInt(d[i].lp.lpNo);// 路牌名称 | |
| 412 | + obj.lpName = d[i].lp.lpName; | |
| 411 | 413 | obj.lpNo = d[i].lp.lpNo;// 路牌编码 |
| 412 | 414 | obj.tcc = d[i].tcc==null ? null : d[i].tcc.id;// 停车场id |
| 413 | 415 | obj.ttinfo = d[i].ttinfo==null ? null : d[i].ttinfo.id;// 时刻表id |
| ... | ... | @@ -421,7 +423,7 @@ var SKBFormWizard = function() { |
| 421 | 423 | resultD.push(obj); |
| 422 | 424 | if(lpA.indexOf(obj.lpNo)<0) { |
| 423 | 425 | lpA.push(obj.lpNo); |
| 424 | - rsLpA.push({'lp':obj.lp,'lpNo':obj.lpNo,'lpName':obj.parent,'lpType':obj.lpType}); | |
| 426 | + rsLpA.push({'lp':obj.lp,'lpNo':obj.lpNo,'lpName':obj.lpName,'lpType':obj.lpType}); | |
| 425 | 427 | } |
| 426 | 428 | } |
| 427 | 429 | // 返回渲染图形的数据格式. | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
| ... | ... | @@ -388,7 +388,7 @@ var BaseFun = function() { |
| 388 | 388 | var jar = baseF.tzsmbcsj01( |
| 389 | 389 | baseF.setbcsAndfcno(baseF.tzsmbcsj01(baseF.setbcsAndfcno(baseF.tzsztest(cara,jar01,dataMap)),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap)), |
| 390 | 390 | dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap); |
| 391 | - // return {'json':jar,'bxrcgs':bxrcgs}; | |
| 391 | + // return {'json':jar,'bxrcgs':bxrcgs}; | |
| 392 | 392 | for(var r = 0 ; r < bxrcgs.length; r++) { |
| 393 | 393 | var lpNo = bxrcgs[r].lpNo; |
| 394 | 394 | var gsv = 0 , bczs = 0; |
| ... | ... | @@ -401,8 +401,9 @@ var BaseFun = function() { |
| 401 | 401 | bxrcgs[r].sjgsV = gsv; |
| 402 | 402 | bxrcgs[r].bczs = bczs; |
| 403 | 403 | } |
| 404 | + //debugger; | |
| 404 | 405 | var jar3 = baseF.dqbcsAndgs(bxrcgs,jar,dataMap,cara.length); |
| 405 | - // return {'json':jar3,'bxrcgs':bxrcgs}; | |
| 406 | + //return {'json':jar3,'bxrcgs':bxrcgs}; | |
| 406 | 407 | /*var jar4 = baseF.tzsmbcsj01( |
| 407 | 408 | baseF.setbcsAndfcno(baseF.tzsmbcsj01(baseF.setbcsAndfcno(baseF.tzsztest(cara,jar3,dataMap)),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap)), |
| 408 | 409 | dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);*/ |
| ... | ... | @@ -538,9 +539,11 @@ var BaseFun = function() { |
| 538 | 539 | for(var q = 0 ; q < qbbfbc.length; q++) { |
| 539 | 540 | if(q<(qbbfbc.length-1)) |
| 540 | 541 | qbbfbc[q].STOPTIME = qbbfbc[q].STOPTIME + vag; |
| 541 | - if(q==0) | |
| 542 | - continue; | |
| 543 | - else { | |
| 542 | + if(q==0) { | |
| 543 | + var fcsj_ = baseF.getDateTime(qbbfbc[q].fcsj); | |
| 544 | + fcsj_.setMinutes(fcsj_.getMinutes() + qbbfbc[q].bcsj); | |
| 545 | + qbbfbc[q].ARRIVALTIME = baseF.getTimeStr(fcsj_); | |
| 546 | + }else { | |
| 544 | 547 | var ddsj_ = baseF.getDateTime(qbbfbc[q-1].ARRIVALTIME); |
| 545 | 548 | ddsj_.setMinutes(ddsj_.getMinutes() + qbbfbc[q-1].STOPTIME); |
| 546 | 549 | qbbfbc[q].fcsj = baseF.getTimeStr(ddsj_); |
| ... | ... | @@ -616,6 +619,9 @@ var BaseFun = function() { |
| 616 | 619 | var dygbcfcsj = baseF.getDateTime(obj.fcsj); |
| 617 | 620 | dygbcfcsj.setMinutes(dygbcfcsj.getMinutes() - dx); |
| 618 | 621 | obj.fcsj = baseF.getTimeStr(dygbcfcsj); |
| 622 | + | |
| 623 | + dygbcfcsj.setMinutes(dygbcfcsj.getMinutes() + obj.bcsj); | |
| 624 | + obj.ARRIVALTIME = baseF.getTimeStr(dygbcfcsj); | |
| 619 | 625 | }, |
| 620 | 626 | |
| 621 | 627 | zhygbcUpd: function(obj,xgOjb,dx) { | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| ... | ... | @@ -70,8 +70,28 @@ |
| 70 | 70 | }else { |
| 71 | 71 | var jsonA = JSON.parse(objD); |
| 72 | 72 | // 使用已有的时刻表明细数据渲染视图. |
| 73 | - data = {'json':jsonA.rsD,'bxrcgs':null}; | |
| 73 | + // data = {'json':jsonA.rsD,'bxrcgs':null}; | |
| 74 | 74 | CSMap = {'gattA':null,'stopSpace': Math.round(map.zzsj/map.clzs),'maxCar':jsonA.rsLP}; |
| 75 | + var cara = jsonA.rsLP; | |
| 76 | + var rsjar = jsonA.rsD; | |
| 77 | + var resultJA = new Array(); | |
| 78 | + for(var m = 0 ; m < cara.length; m++) { | |
| 79 | + // 获取路牌编号. | |
| 80 | + var lpNo_ = cara[m].lpNo; | |
| 81 | + // 定义路牌下的所有班次. | |
| 82 | + var lpbc_ = new Array(); | |
| 83 | + // 遍历班次数. | |
| 84 | + for(var x =0 ; x <rsjar.length; x++) { | |
| 85 | + // 判断当期遍历的班次是否属于当前的路牌. | |
| 86 | + if(rsjar[x].lpNo == lpNo_) { | |
| 87 | + lpbc_.push(rsjar[x]); | |
| 88 | + } | |
| 89 | + } | |
| 90 | + // 按照发车序号顺序排序. | |
| 91 | + lpbc_.sort(function(a,b){return a.fcno-b.fcno}); | |
| 92 | + resultJA = resultJA.concat(BaseFun.addjclbbc01(lpbc_,dataMap,stopAraay[0].lbsj,map)); | |
| 93 | + } | |
| 94 | + data = {'json':rsjar,'bxrcgs':null}; | |
| 75 | 95 | } |
| 76 | 96 | // 创建甘特图对象. |
| 77 | 97 | var graph = d3.select('#ganttSvg').relationshipGraph( |
| ... | ... | @@ -401,6 +421,7 @@ |
| 401 | 421 | var hours=Math.floor(leave1/(3600*1000)); |
| 402 | 422 | DXHOURS = days*24+hours; |
| 403 | 423 | WIDTH = DXHOURS*MINUTE*MULTIPLE; |
| 424 | + debugger; | |
| 404 | 425 | var lpsplitA = getylp(p.yAxisCarArray); |
| 405 | 426 | var args = { |
| 406 | 427 | 'valueKeyName': VALUEKEYNAME, | ... | ... |