Commit adfc150870bd9d5d3dceac5f2d764f95a1346a5d

Authored by 李强
1 parent 450417ed

李强update

Showing 27 changed files with 681 additions and 177 deletions
src/main/java/com/bsth/repository/SectionRouteRepository.java
@@ -141,4 +141,13 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int @@ -141,4 +141,13 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int
141 */ 141 */
142 @Query(value = " select MAX(r.sectionroute_code) as sectionrouteCode from bsth_c_sectionroute r WHERE r.line=?1 and r.directions =?2 and r.sectionroute_code< ?3", nativeQuery=true) 142 @Query(value = " select MAX(r.sectionroute_code) as sectionrouteCode from bsth_c_sectionroute r WHERE r.line=?1 and r.directions =?2 and r.sectionroute_code< ?3", nativeQuery=true)
143 List<Object[]> findUpSectionRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); 143 List<Object[]> findUpSectionRouteCode(Integer lineId,Integer direction,Integer stationRouteCode);
  144 +
  145 + @Query(value = "SELECT " +
  146 + "c.directions," +
  147 + "AsText(s.bsection_vector) as bsection_vector," +
  148 + "s.speed_limit," +
  149 + "s.section_name " +
  150 + " FROM bsth_c_sectionroute c " +
  151 + " LEFT JOIN bsth_c_section s on c.section = s.id where c.line = ?1 and c.directions = ?2", nativeQuery=true)
  152 +List<Object[]> sectionRouteVector(Integer lineId,Integer directions);
144 } 153 }
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.stereotype.Service; 9 import org.springframework.stereotype.Service;
10 10
11 import com.alibaba.fastjson.JSONArray; 11 import com.alibaba.fastjson.JSONArray;
12 -import com.alibaba.fastjson.JSONObject;  
13 import com.bsth.common.ResponseCode; 12 import com.bsth.common.ResponseCode;
14 import com.bsth.entity.Line; 13 import com.bsth.entity.Line;
15 import com.bsth.entity.Section; 14 import com.bsth.entity.Section;
@@ -122,7 +121,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -122,7 +121,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
122 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString()); 121 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
123 122
124 // 线路ID 123 // 线路ID
125 - Integer sectionRouteLine =map.get("sectionRouteLine").equals("") ? null : Integer.parseInt(map.get("sectionRouteLine").toString()); 124 + Integer sectionRouteLine = map.get("sectionRouteLine").equals("") ? null : Integer.parseInt(map.get("sectionRouteLine").toString());
126 125
127 // 道路编码 126 // 道路编码
128 String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString(); 127 String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
@@ -403,16 +402,18 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -403,16 +402,18 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
403 // 路段路由 402 // 路段路由
404 SectionRoute sectionRoute = new SectionRoute(); 403 SectionRoute sectionRoute = new SectionRoute();
405 404
406 - String sectionrouteCodeArray[] = null;  
407 -  
408 Integer routeCode = null; 405 Integer routeCode = null;
409 406
410 if(!sectionrouteCode.equals("")){ 407 if(!sectionrouteCode.equals("")){
411 408
412 - sectionrouteCodeArray = sectionrouteCode.split("_"); 409 + String sectionrouteCodeArray[] = sectionrouteCode.split("_");
413 410
414 routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1; 411 routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1;
415 412
  413 + }else {
  414 +
  415 + routeCode = 100;
  416 +
416 } 417 }
417 418
418 sectionRoute.setSectionrouteCode(routeCode); 419 sectionRoute.setSectionrouteCode(routeCode);
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
1 package com.bsth.service.impl; 1 package com.bsth.service.impl;
2 2
  3 +import java.awt.Point;
3 import java.io.ByteArrayInputStream; 4 import java.io.ByteArrayInputStream;
4 import java.io.File; 5 import java.io.File;
5 import java.io.InputStream; 6 import java.io.InputStream;
@@ -519,56 +520,66 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -519,56 +520,66 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
519 /** 查询线路信息 */ 520 /** 查询线路信息 */
520 Line line = lineRepository.findOne(lineId); 521 Line line = lineRepository.findOne(lineId);
521 522
522 - /** 获取配置文件里的ftp参数 */  
523 - Map<String, Object> FTPParamMap = readPropertiesGetFTPParam();  
524 -  
525 - // 压缩文件名  
526 - String odlGzFileName = line.getLineCode() + ".tar.gz";  
527 -  
528 - // text文件名  
529 - String textFileName = line.getLineCode() + ".txt";  
530 -  
531 - FTPClientUtils clientUtils = new FTPClientUtils();  
532 -  
533 - String url = FTPParamMap.get("url").toString();  
534 -  
535 - int port = Integer.valueOf(FTPParamMap.get("port").toString());  
536 -  
537 - String username = FTPParamMap.get("username").toString();  
538 -  
539 - String password = FTPParamMap.get("password").toString();  
540 -  
541 - String remotePath = FTPParamMap.get("remotePath").toString();  
542 -  
543 - /** 如果行单文件已存在则删除 */  
544 - clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName);  
545 -  
546 - clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName);  
547 -  
548 List<Object[]> objects = repository.usingSingle(lineId); 523 List<Object[]> objects = repository.usingSingle(lineId);
549 524
550 - String textStr = newTextFileToFTP(objects);  
551 -  
552 - textStr = line.getName() + " " + "2" + "\r\n" + textStr;  
553 -  
554 - InputStream input = new ByteArrayInputStream(textStr.getBytes("utf-8"));  
555 -  
556 - /** 生成text文件 */  
557 - clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input);  
558 -  
559 - Test test= new Test();  
560 -  
561 - File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName);  
562 -  
563 - File[] sources = new File[] {textFile};  
564 -  
565 - File target = new File(odlGzFileName);  
566 -  
567 - File targetFile = test.pack(sources, target);  
568 -  
569 - clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName()); 525 + if (objects.size()>0) {
  526 +
  527 + /** 获取配置文件里的ftp参数 */
  528 + Map<String, Object> FTPParamMap = readPropertiesGetFTPParam();
  529 +
  530 + // 压缩文件名
  531 + String odlGzFileName = line.getLineCode() + ".txt.gz";
  532 +
  533 + // text文件名
  534 + String textFileName = line.getLineCode() + ".txt";
  535 +
  536 + FTPClientUtils clientUtils = new FTPClientUtils();
  537 +
  538 + String url = FTPParamMap.get("url").toString();
  539 +
  540 + int port = Integer.valueOf(FTPParamMap.get("port").toString());
  541 +
  542 + String username = FTPParamMap.get("username").toString();
  543 +
  544 + String password = FTPParamMap.get("password").toString();
  545 +
  546 + String remotePath = FTPParamMap.get("remotePath").toString();
  547 +
  548 + /** 如果行单文件已存在则删除 */
  549 + clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName);
  550 +
  551 + clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName);
  552 +
  553 + String textStr = newTextFileToFTP(objects,lineId);
  554 +
  555 + textStr = line.getName() + " " + "2" + "\r\n" + textStr;
  556 +
  557 + InputStream input = new ByteArrayInputStream(textStr.getBytes("utf-8"));
  558 +
  559 + /** 生成text文件 */
  560 + clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input);
  561 +
  562 + Test test= new Test();
  563 +
  564 + File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName);
  565 +
  566 + File[] sources = new File[] {textFile};
  567 +
  568 + File target = new File(odlGzFileName);
  569 +
  570 + File targetFile = test.pack(sources, target);
  571 +
  572 + /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/
  573 +
  574 + clientUtils.testUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath);
  575 +
  576 + resultMap.put("status", ResponseCode.SUCCESS);
  577 +
  578 + }else {
  579 +
  580 + resultMap.put("status","NOTDATA");
  581 + }
570 582
571 - resultMap.put("status", ResponseCode.SUCCESS);  
572 583
573 } catch (Exception e) { 584 } catch (Exception e) {
574 585
@@ -580,28 +591,30 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -580,28 +591,30 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
580 return resultMap; 591 return resultMap;
581 } 592 }
582 593
583 - public String newTextFileToFTP(List<Object[]> objects) { 594 + public String newTextFileToFTP(List<Object[]> objects,Integer lineId) {
584 595
585 String stationRStr = ""; 596 String stationRStr = "";
586 597
587 // windows下的文本文件换行符 598 // windows下的文本文件换行符
588 - String enterStr = "\r\n"; 599 + // String enterStr = "\r\n";
589 600
590 // linux/unix下的文本文件换行符 601 // linux/unix下的文本文件换行符
591 - // String enterStr = "\r"; 602 + String enterStr = "\r";
592 603
593 if(objects.size()>0) { 604 if(objects.size()>0) {
594 605
595 for(int i = 0; i<objects.size();i++) { 606 for(int i = 0; i<objects.size();i++) {
596 607
597 // 经度 608 // 经度
598 - String lng = objects.get(i)[0].toString(); 609 + String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString();
599 610
600 // 纬度 611 // 纬度
601 - String lat = " " + objects.get(i)[1].toString(); 612 + String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString();
  613 +
  614 + lat = " " + lat;
602 615
603 // 站点类型 616 // 站点类型
604 - String stationMake = objects.get(i)[3].toString(); 617 + String stationMake = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString();
605 618
606 if(stationMake.equals("E")) { 619 if(stationMake.equals("E")) {
607 620
@@ -614,23 +627,82 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -614,23 +627,82 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
614 } 627 }
615 628
616 // 站点序号 629 // 站点序号
617 - String stationNo = " " + objects.get(i)[4].toString(); 630 + String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString();
  631 +
  632 + stationNo = " " + stationNo;
618 633
619 // 站点编码 634 // 站点编码
620 - String stationCode = " " + objects.get(i)[5].toString(); 635 + String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
  636 +
  637 + stationCode = " " +stationCode;
  638 +
  639 + double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString());
621 640
622 - double tempd = Double.parseDouble(objects.get(i)[6].toString())*1000; 641 + double tempd = dis*1000;
623 642
624 // 站点距离 643 // 站点距离
625 String staitondistance = " " + String.valueOf((int) tempd); 644 String staitondistance = " " + String.valueOf((int) tempd);
626 645
  646 + // 站点名称
  647 + String stationName = objects.get(i)[7].equals("") ? "" : objects.get(i)[7].toString();
  648 +
627 // 限速 649 // 限速
628 - String sleepStr = " " + "60"; 650 + // String sleepStr = " " + "60";
629 651
630 - // 站点名称  
631 - String staitonName = " " + objects.get(i)[7].toString(); 652 + String sleepStr = "";
632 653
633 - stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + staitonName + enterStr; 654 + int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
  655 +
  656 + List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
  657 +
  658 + if(sobje.size()==1) {
  659 +
  660 + sleepStr = sobje.get(0)[2] == null ? "" : sobje.get(0)[2].toString();
  661 +
  662 + sleepStr = " " + sleepStr;
  663 +
  664 + }else if(sobje.size()>1){
  665 +
  666 + /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */
  667 + for(int j =0;j<sobje.size();j++) {
  668 +
  669 + String sectionName = sobje.get(j)[3].toString();
  670 +
  671 + String sectionNameA[] = sectionName.split("至");
  672 +
  673 + if(stationName.equals(sectionNameA[0])){
  674 +
  675 + sleepStr = sobje.get(j)[2].toString();
  676 +
  677 + sleepStr = " " + sleepStr;
  678 +
  679 + }
  680 +
  681 + }
  682 +
  683 + /*
  684 + String bdJWPointStr = objects.get(i)[2].toString();
  685 +
  686 + String bdJWPointA[] = bdJWPointStr.split(" ");
  687 +
  688 + Map<String, Object> pointsM = new HashMap<String,Object>();
  689 +
  690 + pointsM.put("lng", bdJWPointA[0]);
  691 +
  692 + pointsM.put("lat", bdJWPointA[1]);
  693 +
  694 + System.out.println(objects.get(i)[7].toString());
  695 +
  696 + sleepStr = sleepStr + GetFormPointOnPolylineSeleepLimit(pointsM,sobje);*/
  697 + }
  698 +
  699 + if(sleepStr.equals(""))
  700 + sleepStr = " " + "60";
  701 +
  702 +
  703 + stationName = " " +stationName;
  704 +
  705 + stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
634 706
635 } 707 }
636 708
@@ -640,6 +712,90 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -640,6 +712,90 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
640 712
641 } 713 }
642 714
  715 + public String GetFormPointOnPolylineSeleepLimit(Map<String, Object> p,List<Object[]> listObjArra) {
  716 +
  717 + String sleeplimiV = "";
  718 +
  719 + int size = listObjArra.size();
  720 +
  721 + if(size>0) {
  722 +
  723 + for(int i =0;i<size-1;i++) {
  724 +
  725 + System.out.println(listObjArra.get(i)[3].toString());
  726 +
  727 +
  728 + List<Map<String, Object>> listM = new ArrayList<Map<String,Object>>();
  729 +
  730 + String bVecotr = listObjArra.get(i)[1].toString();
  731 +
  732 + bVecotr = bVecotr.substring(11,bVecotr.length()-1);
  733 +
  734 + String tempA [] = bVecotr.split(",");
  735 +
  736 + int len = tempA.length;
  737 +
  738 + for(int e = 0; e< len ;e++) {
  739 +
  740 + Map<String, Object> tempM = new HashMap<String,Object>();
  741 +
  742 + String temStr = tempA[e];
  743 +
  744 + String nextTemA[] = temStr.split(" ");
  745 +
  746 + tempM.put("lng", nextTemA[0]);
  747 +
  748 + tempM.put("lat", nextTemA[1]);
  749 +
  750 + listM.add(tempM);
  751 +
  752 + }
  753 +
  754 + if(isPointOnPolyline(p,listM)) {
  755 +
  756 +
  757 + sleeplimiV = listObjArra.get(i)[2].toString();
  758 + }
  759 +
  760 + }
  761 +
  762 + }
  763 +
  764 +
  765 + return sleeplimiV;
  766 + }
  767 +
  768 + public boolean isPointOnPolyline (Map<String, Object> point, List<Map<String, Object>> listMap ){
  769 +
  770 + boolean success = false;
  771 +
  772 + for(int l = 0; l < listMap.size() - 1; l ++){
  773 +
  774 + Map<String, Object> tempM = listMap.get(l);
  775 +
  776 + Map<String, Object> nextTempM = listMap.get(l+1);
  777 +
  778 + if (Double.valueOf(point.get("lng").toString())>= Math.min(Double.valueOf(tempM.get("lng").toString()), Double.valueOf(nextTempM.get("lng").toString())) && Double.valueOf(point.get("lng").toString()) <= Math.max(Double.valueOf(tempM.get("lng").toString()), Double.valueOf(nextTempM.get("lng").toString())) &&
  779 + Double.valueOf(point.get("lat").toString()) >= Math.min(Double.valueOf(tempM.get("lat").toString()), Double.valueOf(nextTempM.get("lat").toString())) && Double.valueOf(point.get("lat").toString()) <= Math.max(Double.valueOf(tempM.get("lat").toString()), Double.valueOf(nextTempM.get("lat").toString()))){
  780 +
  781 +
  782 + double precision = (Double.valueOf(tempM.get("lng").toString()) - Double.valueOf(point.get("lng").toString())) * (Double.valueOf(nextTempM.get("lat").toString()) - Double.valueOf(point.get("lat").toString())) -
  783 + (Double.valueOf(nextTempM.get("lng").toString()) - Double.valueOf(tempM.get("lng").toString())) * (Double.valueOf(tempM.get("lat").toString()) - Double.valueOf(nextTempM.get("lat").toString()));
  784 +
  785 + if(precision < 2e-10 && precision > -2e-10){
  786 +
  787 + //实质判断是否接近0
  788 + success = true;
  789 +
  790 + }
  791 +
  792 + }
  793 +
  794 + }
  795 +
  796 + return success;
  797 + }
  798 +
643 public Map<String, Object> readPropertiesGetFTPParam(){ 799 public Map<String, Object> readPropertiesGetFTPParam(){
644 800
645 Map<String, Object> resultMap = new HashMap<String, Object>(); 801 Map<String, Object> resultMap = new HashMap<String, Object>();
src/main/java/com/bsth/service/impl/StationServiceImpl.java
@@ -866,25 +866,32 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -866,25 +866,32 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
866 Line resultLine = lineRepository.findOne(line); 866 Line resultLine = lineRepository.findOne(line);
867 867
868 // 站点路由序号 868 // 站点路由序号
869 - String stationRouteCode = map.get("stationRouteCode").equals("") ? "" : map.get("stationRouteCode").toString(); 869 + String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? "" : map.get("stationRouteCode").toString();
870 870
871 // 站点类型 871 // 站点类型
872 String stationMark = map.get("stationMark").equals("") ? "" : map.get("stationMark").toString(); 872 String stationMark = map.get("stationMark").equals("") ? "" : map.get("stationMark").toString();
873 873
874 - String stationRouteCodeArray [] = null; 874 + Integer stationRouteCode = null;
875 875
876 - if(stationRouteCode!="") { 876 + if(stationRouteCodeStr!="") {
  877 +
  878 + String stationRouteCodeArray [] = stationRouteCodeStr.split("_");
877 879
878 - stationRouteCodeArray= stationRouteCode.split("_"); 880 + stationRouteCode = Integer.parseInt(stationRouteCodeArray[0]+1);
  881 +
  882 +
  883 + }else {
  884 +
  885 + stationRouteCode = 100;
879 886
880 } 887 }
881 888
882 // 保存站点 889 // 保存站点
883 - /*repository.stationSave(stationCod, stationName, roadCoding, dbType, bJwpoints, 890 + repository.stationSave(stationCod, stationName, roadCoding, dbType, bJwpoints,
884 891
885 gLonx, gLaty, x, y, gPloygonGrid,bPloygonGrid, destroy, radius, 892 gLonx, gLaty, x, y, gPloygonGrid,bPloygonGrid, destroy, radius,
886 -  
887 - shapesType, versions, descriptions, createBy, updateBy,stationId);*/ 893 +
  894 + shapesType, versions, descriptions, createBy, updateBy,stationId);
888 895
889 896
890 897
@@ -908,7 +915,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -908,7 +915,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
908 arg0.setStationCode(stationCod); 915 arg0.setStationCode(stationCod);
909 916
910 // 站点路由序号 917 // 站点路由序号
911 - arg0.setStationRouteCode(Integer.parseInt(stationRouteCodeArray[0])+1); 918 + arg0.setStationRouteCode(stationRouteCode);
912 919
913 // 站点路由类型 920 // 站点路由类型
914 arg0.setStationMark(stationMark); 921 arg0.setStationMark(stationMark);
@@ -931,7 +938,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -931,7 +938,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
931 // 站点路由说明 938 // 站点路由说明
932 arg0.setDescriptions(descriptions); 939 arg0.setDescriptions(descriptions);
933 940
934 - /*routeRepository.save(arg0);*/ 941 + routeRepository.save(arg0);
935 942
936 resultMap.put("status", ResponseCode.SUCCESS); 943 resultMap.put("status", ResponseCode.SUCCESS);
937 944
src/main/java/com/bsth/util/FTPClientUtils.java
@@ -98,16 +98,16 @@ public class FTPClientUtils { @@ -98,16 +98,16 @@ public class FTPClientUtils {
98 } 98 }
99 99
100 // 将本地文件上传到FTP服务器上 100 // 将本地文件上传到FTP服务器上
101 - public void testUpLoadFromDisk(File file,String name){ 101 + public void testUpLoadFromDisk(File file,String name,String url, int port, String username, String password, String remotePath){
102 102
103 try { 103 try {
104 FileInputStream in=new FileInputStream(file); 104 FileInputStream in=new FileInputStream(file);
105 105
106 - boolean flag = uploadFile("192.168.168.101", 21, "testftpservice", "123", "ftptest/", name, in); 106 + boolean flag = uploadFile(url, port,username, password, remotePath, name, in);
107 107
108 - /* boolean flag = uploadFile("222.66.0.205", 21, "transport", "transport123", "ftptest/", name, in);*/ 108 + /* boolean flag = uploadFile("192.168.168.101", 21, "testftpservice", "123", "ftptest/", name, in);*/
109 109
110 - System.out.println(flag); 110 + /* boolean flag = uploadFile("222.66.0.205", 21, "transport", "transport123", "ftptest/", name, in);*/
111 111
112 } catch (FileNotFoundException e) { 112 } catch (FileNotFoundException e) {
113 113
@@ -126,9 +126,7 @@ public class FTPClientUtils { @@ -126,9 +126,7 @@ public class FTPClientUtils {
126 126
127 InputStream input = new ByteArrayInputStream(str.getBytes("utf-8")); 127 InputStream input = new ByteArrayInputStream(str.getBytes("utf-8"));
128 128
129 - boolean flag = uploadFile("192.168.168.101", 21, "testftpservice", "123", "ftptest/", "test.txt", input);  
130 -  
131 - System.out.println(flag); 129 + uploadFile("192.168.168.101", 21, "testftpservice", "123", "ftptest/", "test.txt", input);
132 130
133 } catch (UnsupportedEncodingException e) { 131 } catch (UnsupportedEncodingException e) {
134 132
@@ -324,7 +322,7 @@ public class FTPClientUtils { @@ -324,7 +322,7 @@ public class FTPClientUtils {
324 322
325 File targetFile = test.pack(sources, target); 323 File targetFile = test.pack(sources, target);
326 324
327 - clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName()); 325 + /* clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/
328 326
329 327
330 /** 删除文件 */ 328 /** 删除文件 */
src/main/resources/ftp.properties
1 -ftp.url=222.66.0.205  
2 -ftp.port=21  
3 -ftp.username=transport  
4 -ftp.password= transport123  
5 -ftp.path= down/  
6 -  
7 -#ftp.url=192.168.168.101 1 +#ftp.url=222.66.0.205
8 #ftp.port=21 2 #ftp.port=21
9 -#ftp.username=testftpservice  
10 -#ftp.password= 123  
11 -#ftp.path= ftptest/  
12 \ No newline at end of file 3 \ No newline at end of file
  4 +#ftp.username=transport
  5 +#ftp.password=transport123
  6 +#ftp.path= down/
  7 +
  8 +ftp.url=192.168.168.101
  9 +ftp.port=21
  10 +ftp.username=testftpservice
  11 +ftp.password= 123
  12 +ftp.path= ftptest/
13 \ No newline at end of file 13 \ No newline at end of file
src/main/resources/static/pages/base/carpark/add.html
@@ -307,12 +307,12 @@ @@ -307,12 +307,12 @@
307 </div> 307 </div>
308 </div> 308 </div>
309 309
310 - <div class="form-group"> 310 + <!-- <div class="form-group">
311 <label class="control-label col-md-3"> 中心位置WGS坐标点: </label> 311 <label class="control-label col-md-3"> 中心位置WGS坐标点: </label>
312 <div class="col-md-4"> 312 <div class="col-md-4">
313 <p class="form-control-static" data-display="gCenterPoint"> </p> 313 <p class="form-control-static" data-display="gCenterPoint"> </p>
314 </div> 314 </div>
315 - </div> 315 + </div> -->
316 316
317 <h4 class="form-section"> 停车场信息 </h4> 317 <h4 class="form-section"> 停车场信息 </h4>
318 318
src/main/resources/static/pages/base/carpark/edit_select.html
@@ -156,7 +156,7 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,fun, @@ -156,7 +156,7 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,fun,
156 156
157 if(eidtselect_==0){ 157 if(eidtselect_==0){
158 158
159 - WorldsBMap.localSearchFromAdreesToPoint(editStationName); 159 + map.localSearchFromAdreesToPoint(editStationName);
160 160
161 map.openDrawingManager(); 161 map.openDrawingManager();
162 162
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
@@ -167,7 +167,7 @@ var FormWizard = function() { @@ -167,7 +167,7 @@ var FormWizard = function() {
167 } 167 }
168 168
169 // 返回list.html页面 169 // 返回list.html页面
170 - loadPage('list.html'); 170 + loadPage('/pages/base/carpark/list.html');
171 171
172 }); 172 });
173 173
@@ -266,26 +266,21 @@ var FormWizard = function() { @@ -266,26 +266,21 @@ var FormWizard = function() {
266 // 设置停车场名称 266 // 设置停车场名称
267 $('#parkNameInput').val(stationNameV); 267 $('#parkNameInput').val(stationNameV);
268 268
269 - VmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {  
270 -  
271 - if(p) {  
272 -  
273 - if(baseResValue == 0) {  
274 -  
275 - $('.leftUtils').hide();  
276 -  
277 - VmapWorlds.pointsCircle(p);  
278 -  
279 - }else if(baseResValue ==1) {  
280 -  
281 - $('.leftUtils').show();  
282 -  
283 - VmapWorlds.drawingManagerOpen();  
284 -  
285 - }  
286 - }  
287 -  
288 - }); 269 + VmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {});
  270 +
  271 + if(baseResValue == 0) {
  272 +
  273 + $('.leftUtils').hide();
  274 +
  275 + VmapWorlds.pointsCircle(p);
  276 +
  277 + }else if(baseResValue ==1) {
  278 +
  279 + $('.leftUtils').show();
  280 +
  281 + VmapWorlds.drawingManagerOpen();
  282 +
  283 + }
289 } 284 }
290 285
291 /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ 286 /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */
@@ -327,6 +322,8 @@ var FormWizard = function() { @@ -327,6 +322,8 @@ var FormWizard = function() {
327 /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ 322 /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */
328 onTabClick: function (tab, navigation, index, clickedIndex) { 323 onTabClick: function (tab, navigation, index, clickedIndex) {
329 324
  325 + return false;
  326 +
330 success.hide(); 327 success.hide();
331 328
332 error.hide(); 329 error.hide();
@@ -358,6 +355,8 @@ var FormWizard = function() { @@ -358,6 +355,8 @@ var FormWizard = function() {
358 355
359 VmapWorlds.clearMarkAndOverlays(); 356 VmapWorlds.clearMarkAndOverlays();
360 357
  358 + VmapWorlds.drawingManagerClose();
  359 +
361 } 360 }
362 361
363 handleTitle(tab, navigation, index); 362 handleTitle(tab, navigation, index);
@@ -371,6 +370,12 @@ var FormWizard = function() { @@ -371,6 +370,12 @@ var FormWizard = function() {
371 370
372 error.hide(); 371 error.hide();
373 372
  373 + if(index ==0) {
  374 +
  375 + VmapWorlds.drawingManagerClose();
  376 +
  377 + }
  378 +
374 VmapWorlds.clearMarkAndOverlays(); 379 VmapWorlds.clearMarkAndOverlays();
375 380
376 handleTitle(tab, navigation, index); 381 handleTitle(tab, navigation, index);
src/main/resources/static/pages/base/carpark/js/carpark-positions-events.js
@@ -3,7 +3,10 @@ $(function(){ @@ -3,7 +3,10 @@ $(function(){
3 $('#backUp').on('click',function() { 3 $('#backUp').on('click',function() {
4 4
5 // 获取返回元素并修改url地址 5 // 获取返回元素并修改url地址
6 - $('#backUp').attr('href','list.html?'); 6 + /*$('#backUp').attr('href','list.html?');*/
  7 +
  8 + // 返回list.html页面
  9 + loadPage('/pages/base/carpark/list.html');
7 10
8 }); 11 });
9 12
src/main/resources/static/pages/base/carpark/js/carpark-positions-function.js
1 /** 1 /**
2 * 函数 2 * 函数
3 * 3 *
4 - * initCarPark :停车场信息初始化 @param:<id:停车场ID>  
5 */ 4 */
6 5
7 var PublicFunctions = function () { 6 var PublicFunctions = function () {
@@ -58,16 +57,132 @@ var PublicFunctions = function () { @@ -58,16 +57,132 @@ var PublicFunctions = function () {
58 // 中心坐标点 57 // 中心坐标点
59 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); 58 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
60 59
  60 + var shapesV = '';
  61 +
  62 + if(r[0].carParkShapesType='d') {
  63 +
  64 + shapesV = '多边形';
  65 +
  66 + }else if(r[0].carParkShapesType='r') {
  67 +
  68 + shapesV = '圆形';
  69 +
  70 + }
  71 +
  72 + var companyV = '';
  73 +
  74 + var branchecomV = '';
  75 +
  76 + if( r[0].carParkCompany=='55'){
  77 +
  78 + companyV = '上南公司';
  79 +
  80 + if(r[0].carParkBrancheCompany=='1'){
  81 +
  82 + branchecomV = '上南二分公司';
  83 +
  84 + }else if(r[0].carParkBrancheCompany=='2'){
  85 +
  86 + branchecomV = '上南三分公司';
  87 +
  88 + }else if(r[0].carParkBrancheCompany=='3'){
  89 +
  90 + branchecomV = '上南六分公司';
  91 +
  92 + }else if(r[0].carParkBrancheCompany=='4'){
  93 +
  94 + branchecomV = '上南一分公司';
  95 +
  96 + }
  97 +
  98 + }else if( r[0].carParkCompany=='22'){
  99 +
  100 + companyV = '金高公司';
  101 +
  102 + if(r[0].carParkBrancheCompany=='1'){
  103 +
  104 + branchecomV = '四分公司';
  105 +
  106 + }else if(r[0].carParkBrancheCompany=='2'){
  107 +
  108 + branchecomV = '二分公司';
  109 +
  110 + }else if(r[0].carParkBrancheCompany=='3'){
  111 +
  112 + branchecomV = '三分公司';
  113 +
  114 + }else if(r[0].carParkBrancheCompany=='5'){
  115 +
  116 + branchecomV = '一分公司';
  117 +
  118 + }
  119 +
  120 + }else if( r[0].carParkCompany=='05'){
  121 +
  122 + companyV = '杨高公司';
  123 +
  124 + if(r[0].carParkBrancheCompany=='1'){
  125 +
  126 + branchecomV = '川沙分公司';
  127 +
  128 + }else if(r[0].carParkBrancheCompany=='2'){
  129 +
  130 + branchecomV = '金桥分公司';
  131 +
  132 + }else if(r[0].carParkBrancheCompany=='3'){
  133 +
  134 + branchecomV = '芦潮港分公司';
  135 +
  136 + }else if(r[0].carParkBrancheCompany=='5'){
  137 +
  138 + branchecomV = '杨高分公司';
  139 +
  140 + }else if(r[0].carParkBrancheCompany=='6'){
  141 +
  142 + branchecomV = '周浦分公司';
  143 +
  144 + }
  145 +
  146 +
  147 + }else if( r[0].carParkCompany=='26'){
  148 +
  149 + companyV = '南汇公司';
  150 +
  151 + if(r[0].carParkBrancheCompany=='1'){
  152 +
  153 + branchecomV = '南汇一分';
  154 +
  155 + }else if(r[0].carParkBrancheCompany=='2'){
  156 +
  157 + branchecomV = '南汇二分';
  158 +
  159 + }else if(r[0].carParkBrancheCompany=='3'){
  160 +
  161 + branchecomV = '南汇三分';
  162 +
  163 + }else if(r[0].carParkBrancheCompany=='4'){
  164 +
  165 + branchecomV = '南汇维修公司';
  166 +
  167 + }else if(r[0].carParkBrancheCompany=='5'){
  168 +
  169 + branchecomV = '南汇公司';
  170 +
  171 + }
  172 +
  173 + }
  174 +
  175 + // 信息窗口类容
61 var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ 176 var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
62 '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' + 177 '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' +
63 '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场编码:' + r[0].carParkCode + '</span>' + 178 '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场编码:' + r[0].carParkCode + '</span>' +
64 '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场面积:' + r[0].carParkArea + '</span>' + 179 '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场面积:' + r[0].carParkArea + '</span>' +
65 - '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].carParkBcenterPoint + '</span>' +  
66 - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + r[0].carParkShapesType + '</span>' +  
67 - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' +  
68 - '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + r[0].carParkCompany + '</span>' +  
69 - '<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + r[0].carParkBrancheCompany + '</span>' +  
70 - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' + 180 + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].carParkBcenterPoint + '</span>' +
  181 + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + shapesV + '</span>' +
  182 + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' +
  183 + '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + companyV + '</span>' +
  184 + '<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' +
  185 + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' +
71 '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ; 186 '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ;
72 187
73 // 信息窗口参数属性 188 // 信息窗口参数属性
src/main/resources/static/pages/base/carpark/js/carpark-positions-reload.js
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 (function(){ 15 (function(){
16 16
17 // 获取参数停车场ID 17 // 获取参数停车场ID
18 - id = $.url().param('no'); 18 + var id = $.url().param('no');
19 19
20 // 关闭左侧栏 20 // 关闭左侧栏
21 if (!$('body').hasClass('page-sidebar-closed')) { 21 if (!$('body').hasClass('page-sidebar-closed')) {
src/main/resources/static/pages/base/carpark/list.html
@@ -36,9 +36,9 @@ @@ -36,9 +36,9 @@
36 <th width="8%">面积</th> 36 <th width="8%">面积</th>
37 <th width="8%">分公司</th> 37 <th width="8%">分公司</th>
38 <th width="8%">所属公司</th> 38 <th width="8%">所属公司</th>
39 - <th width="8%">版本号</th>  
40 - <th width="8%">是否撤销</th>  
41 - <th width="12%">操作</th> 39 + <th width="6%">版本号</th>
  40 + <th width="6%">是否撤销</th>
  41 + <th width="14%">操作</th>
42 </tr> 42 </tr>
43 <tr role="row" class="filter"> 43 <tr role="row" class="filter">
44 <td>#</td> 44 <td>#</td>
@@ -110,16 +110,80 @@ @@ -110,16 +110,80 @@
110 {{obj.area}} 110 {{obj.area}}
111 </td> 111 </td>
112 <td> 112 <td>
113 - {{obj.brancheCompany}} 113 + {{if obj.company == '55'}}
  114 +
  115 + {{if obj.brancheCompany == '1'}}
  116 + 上南二分公司
  117 + {{else if obj.brancheCompany == '2'}}
  118 + 上南三分公司
  119 + {{else if obj.brancheCompany == '3'}}
  120 + 上南六分公司
  121 + {{else if obj.brancheCompany == '4'}}
  122 + 上南一分公司
  123 + {{/if}}
  124 +
  125 + {{else if obj.company == '22'}}
  126 +
  127 + {{if obj.brancheCompany == '1'}}
  128 + 四分公司
  129 + {{else if obj.brancheCompany == '2'}}
  130 + 二分公司
  131 + {{else if obj.brancheCompany == '3'}}
  132 + 三分公司
  133 + {{else if obj.brancheCompany == '5'}}
  134 + 一分公司
  135 + {{/if}}
  136 +
  137 + {{else if obj.company == '05'}}
  138 +
  139 + {{if obj.brancheCompany == '1'}}
  140 + 川沙分公司
  141 + {{else if obj.brancheCompany == '2'}}
  142 + 金桥分公司
  143 + {{else if obj.brancheCompany == '3'}}
  144 + 芦潮港分公司
  145 + {{else if obj.brancheCompany == '5'}}
  146 + 杨高分公司
  147 + {{else if obj.brancheCompany == '6'}}
  148 + 周浦分公司
  149 + {{/if}}
  150 +
  151 + {{else if obj.company == '26'}}
  152 +
  153 + {{if obj.brancheCompany == '1'}}
  154 + 南汇一分
  155 + {{else if obj.brancheCompany == '2'}}
  156 + 南汇二分
  157 + {{else if obj.brancheCompany == '3'}}
  158 + 南汇三分
  159 + {{else if obj.brancheCompany == '4'}}
  160 + 南汇维修公司
  161 + {{else if obj.brancheCompany == '5'}}
  162 + 南汇公司
  163 + {{/if}}
  164 +
  165 + {{/if}}
114 </td> 166 </td>
115 <td> 167 <td>
116 - {{obj.company}} 168 + {{if obj.company == '55'}}
  169 + 上南公司
  170 + {{else if obj.company == '22'}}
  171 + 金高公司
  172 + {{else if obj.company == '05'}}
  173 + 杨高公司
  174 + {{else if obj.company == '26'}}
  175 + 南汇公司
  176 + {{/if}}
117 </td> 177 </td>
118 <td> 178 <td>
119 {{obj.versions}} 179 {{obj.versions}}
120 </td> 180 </td>
121 <td> 181 <td>
122 - {{obj.destroy}} 182 + {{if obj.destroy == 1}}
  183 + <span style="font-weight: bold; color: red; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">撤销</span>
  184 + {{else if obj.destroy == 0}}
  185 + <span style="font-weight: bold; color: #07824e; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">运营</span>
  186 + {{/if}}
123 </td> 187 </td>
124 <td> 188 <td>
125 <a href="positions.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 定位 </a> 189 <a href="positions.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 定位 </a>
src/main/resources/static/pages/base/line/js/line-list-table.js
@@ -246,27 +246,63 @@ @@ -246,27 +246,63 @@
246 // 生成行单 246 // 生成行单
247 $('#datatable_ajax_tools #createUsingSingle').on('click', function() { 247 $('#datatable_ajax_tools #createUsingSingle').on('click', function() {
248 248
249 - /*alert('aaa');*/  
250 -  
251 - /*var lineIdEvents = LineObj.getLineObj();  
252 -  
253 - var params = {lineId:lineIdEvents.id};  
254 -  
255 - GetAjaxData.createUsingSingle(params,function(data) { 249 + // 获取选中行
  250 + var arrChk = $("input[type='checkbox']:checked");
  251 +
  252 + var len = arrChk.length;
  253 +
  254 + // 选中行ID与线路名称
  255 + var id = '', lineName = '';
  256 +
  257 + if(len>1) {
  258 +
  259 + // 弹出添加成功提示消息
  260 + layer.msg('存在多选,请只选中一行!');
  261 +
  262 + return ;
  263 +
  264 + }else if(len==0) {
  265 +
  266 + // 弹出添加成功提示消息
  267 + layer.msg('请选中一条线路!');
  268 +
  269 + return ;
  270 +
  271 + }else {
  272 +
  273 + id = arrChk.data('id');
  274 +
  275 + lineName = arrChk.val();
  276 +
  277 + var params = {lineId:id};
256 278
257 - if(data.status=='SUCCESS') { 279 + // 弹出正在加载层
  280 + var index = layer.load(0);
  281 +
  282 + $post('/stationroute/usingSingle',params,function(data) {
258 283
259 - // 弹出添加成功提示消息  
260 - layer.msg('生成成功...'); 284 + // 关闭弹出框
  285 + layer.close(index);
261 286
262 - }else { 287 + if(data.status=='SUCCESS') {
  288 +
  289 + // 弹出添加成功提示消息
  290 + layer.msg('生成线路【'+ lineName +'】路单文件成功!');
  291 +
  292 + }else if(data.status=='ERROR'){
  293 +
  294 + // 弹出添加成功提示消息
  295 + layer.msg('生成线路【'+ lineName +'】路单文件失败!');
  296 +
  297 + }else if(data.status=='NOTDATA') {
  298 +
  299 + // 弹出添加成功提示消息
  300 + layer.msg('系统无线路【'+ lineName +'】的站点与路段信息!');
  301 +
  302 + }
263 303
264 - // 弹出添加失败提示消息  
265 - layer.msg('生成失败...'); 304 + });
266 305
267 - }  
268 -  
269 - });*/  
270 - 306 + }
271 }); 307 });
272 })(); 308 })();
273 \ No newline at end of file 309 \ No newline at end of file
src/main/resources/static/pages/base/line/list.html
@@ -185,9 +185,9 @@ @@ -185,9 +185,9 @@
185 {{if obj.brancheCompany == '1'}} 185 {{if obj.brancheCompany == '1'}}
186 四分公司 186 四分公司
187 {{else if obj.brancheCompany == '2'}} 187 {{else if obj.brancheCompany == '2'}}
188 - 分公司 188 + 分公司
189 {{else if obj.brancheCompany == '3'}} 189 {{else if obj.brancheCompany == '3'}}
190 - 分公司 190 + 分公司
191 {{else if obj.brancheCompany == '5'}} 191 {{else if obj.brancheCompany == '5'}}
192 一分公司 192 一分公司
193 {{/if}} 193 {{/if}}
src/main/resources/static/pages/base/section/js/add-form-wizard.js
@@ -194,7 +194,7 @@ var FormWizard = function() { @@ -194,7 +194,7 @@ var FormWizard = function() {
194 194
195 console.log(params); 195 console.log(params);
196 196
197 - //保存站点 197 + // 保存路段
198 PublicFunctions.sectionSave(params,function(data) { 198 PublicFunctions.sectionSave(params,function(data) {
199 199
200 if(data.status=='SUCCESS') { 200 if(data.status=='SUCCESS') {
src/main/resources/static/pages/base/section/js/section-ajax-getdata.js
@@ -44,8 +44,6 @@ var GetAjaxData = function(){ @@ -44,8 +44,6 @@ var GetAjaxData = function(){
44 // 编辑线路走向保存 44 // 编辑线路走向保存
45 sectionUpdate:function(section,callback) { 45 sectionUpdate:function(section,callback) {
46 46
47 - console.log(section);  
48 -  
49 $post('/section/sectionUpdate',section,function(data) { 47 $post('/section/sectionUpdate',section,function(data) {
50 48
51 callback && callback(data); 49 callback && callback(data);
src/main/resources/static/pages/base/section/js/section-positions-events.js
@@ -10,7 +10,9 @@ $(function(){ @@ -10,7 +10,9 @@ $(function(){
10 // 编辑线路走向 10 // 编辑线路走向
11 $('.dropdown-menu #eidt').on('click', function(){ 11 $('.dropdown-menu #eidt').on('click', function(){
12 12
13 - $('.dropdown-toggle').addClass('disabled'); 13 + $('#eidt').attr("disabled",true);
  14 +  
  15 + $('#eidt').addClass('btn disabled');
14 16
15 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) 17 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
16 var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000}); 18 var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000});
src/main/resources/static/pages/base/station/add.html
@@ -390,12 +390,12 @@ @@ -390,12 +390,12 @@
390 </div> 390 </div>
391 </div> 391 </div>
392 392
393 - <div class="form-group"> 393 + <!-- <div class="form-group">
394 <label class="control-label col-md-3"> 中心位置WGS坐标点: </label> 394 <label class="control-label col-md-3"> 中心位置WGS坐标点: </label>
395 <div class="col-md-4"> 395 <div class="col-md-4">
396 <p class="form-control-static" data-display="bJwpoints"> </p> 396 <p class="form-control-static" data-display="bJwpoints"> </p>
397 </div> 397 </div>
398 - </div> 398 + </div> -->
399 399
400 <!-- 400 <!--
401 <div class="form-group"> 401 <div class="form-group">
src/main/resources/static/pages/base/station/edit.html
@@ -452,8 +452,9 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu @@ -452,8 +452,9 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu
452 var params = form.serializeJSON(); 452 var params = form.serializeJSON();
453 453
454 error.hide(); 454 error.hide();
  455 +
455 console.log(params); 456 console.log(params);
456 - return ; 457 +
457 fun.stationUpdate(params,function(resuntDate) { 458 fun.stationUpdate(params,function(resuntDate) {
458 459
459 if(resuntDate.status=='SUCCESS') { 460 if(resuntDate.status=='SUCCESS') {
src/main/resources/static/pages/base/station/edit_select.html
@@ -174,13 +174,13 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm, @@ -174,13 +174,13 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm,
174 if(eidtselect_==0){ 174 if(eidtselect_==0){
175 175
176 // 清除地图覆盖物 176 // 清除地图覆盖物
177 - StationPositionsWorldsBMap.clearMarkAndOverlays(); 177 + map.clearMarkAndOverlays();
178 178
179 // 打开绘制工具 179 // 打开绘制工具
180 PositionsDrawingManagerObj.openDrawingManager(); 180 PositionsDrawingManagerObj.openDrawingManager();
181 181
182 // 根据站点位置在地图定位 182 // 根据站点位置在地图定位
183 - StationPositionsWorldsBMap.localtionPoint(editStationName); 183 + map.localtionPoint(editStationName);
184 184
185 185
186 }else if(eidtselect_==1){ 186 }else if(eidtselect_==1){
@@ -190,7 +190,7 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm, @@ -190,7 +190,7 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm,
190 shift: 0,time: 10000}); 190 shift: 0,time: 10000});
191 191
192 // 编辑图形 192 // 编辑图形
193 - StationPositionsWorldsBMap.editShapes(stationShapesTypeV,mindex); 193 + map.editShapes(stationShapesTypeV,mindex);
194 194
195 }else if(eidtselect_==2){ 195 }else if(eidtselect_==2){
196 196
src/main/resources/static/pages/base/station/js/add-form-wizard.js
@@ -41,7 +41,7 @@ var FormWizard = function() { @@ -41,7 +41,7 @@ var FormWizard = function() {
41 // 需要验证的表单元素 41 // 需要验证的表单元素
42 rules : { 42 rules : {
43 43
44 - // 线路名称 44 + // 站点名称
45 'statinoNamebooxt' : { 45 'statinoNamebooxt' : {
46 46
47 // 必填项 47 // 必填项
@@ -49,6 +49,69 @@ var FormWizard = function() { @@ -49,6 +49,69 @@ var FormWizard = function() {
49 49
50 // 最大长度 50 // 最大长度
51 maxlength: 20 51 maxlength: 20
  52 + },
  53 +
  54 + // 线路名称
  55 + 'line' : {
  56 +
  57 + // 必填项
  58 + required : true
  59 +
  60 + },
  61 +
  62 + // 线路编码
  63 + 'lineCode' : {
  64 +
  65 + // 必填项
  66 + required : true
  67 +
  68 + },
  69 +
  70 + // 站点名称
  71 + 'stationName' : {
  72 +
  73 + // 必填项
  74 + required : true
  75 +
  76 + },
  77 +
  78 + // 站点编码
  79 + 'stationCod' : {
  80 +
  81 + // 必填项
  82 + required : true
  83 +
  84 + },
  85 +
  86 + // 上一站点
  87 + 'stationRouteCode' : {
  88 +
  89 + isStart : true
  90 +
  91 + },
  92 +
  93 + // 站点类型
  94 + 'stationMark' : {
  95 +
  96 + // 必填项
  97 + required : true
  98 +
  99 + },
  100 +
  101 + // 站点方向
  102 + 'directions' : {
  103 +
  104 + // 必填项
  105 + required : true
  106 +
  107 + },
  108 +
  109 + // 经纬度坐标点
  110 + 'bJwpoints' : {
  111 +
  112 + // 必填项
  113 + required : true
  114 +
52 } 115 }
53 116
54 117
@@ -115,6 +178,8 @@ var FormWizard = function() { @@ -115,6 +178,8 @@ var FormWizard = function() {
115 // 表单序列化 178 // 表单序列化
116 var params = form.serializeJSON(); 179 var params = form.serializeJSON();
117 180
  181 + console.log(params);
  182 +
118 //保存站点 183 //保存站点
119 PublicFunctions.stationSave(params,function(data) { 184 PublicFunctions.stationSave(params,function(data) {
120 185
@@ -139,6 +204,37 @@ var FormWizard = function() { @@ -139,6 +204,37 @@ var FormWizard = function() {
139 } 204 }
140 }); 205 });
141 206
  207 + // 当站点类型为中途站或者终点站时,上一站点为必填项!
  208 + $.validator.addMethod("isStart", function(value,element) {
  209 +
  210 + var tel = false;
  211 +
  212 + var stationMarkV = $('#stationMarkSelect').val();
  213 +
  214 + var stationrouteSelectV = $('#stationrouteSelect').val();
  215 +
  216 + if(stationMarkV =='B'){
  217 +
  218 + tel = true;
  219 +
  220 + return tel;
  221 +
  222 + }else if(stationMarkV =='Z' || stationMarkV =='E'){
  223 +
  224 +
  225 + if(stationrouteSelectV!=''){
  226 +
  227 + tel = true;
  228 +
  229 + return tel;
  230 +
  231 + }
  232 +
  233 + }
  234 +
  235 + return tel;
  236 + }, '当站点类型为中途站或者终点站时,上一站点为必填项!');
  237 +
142 // 确认提交信息 238 // 确认提交信息
143 var displayConfirm = function() { 239 var displayConfirm = function() {
144 240
src/main/resources/static/pages/base/station/js/station-list-table.js
@@ -101,8 +101,6 @@ @@ -101,8 +101,6 @@
101 // 异步请求获取表格数据 101 // 异步请求获取表格数据
102 $.get('/stationroute',params,function(result){ 102 $.get('/stationroute',params,function(result){
103 103
104 - console.log(result);  
105 -  
106 // 添加序号 104 // 添加序号
107 result.content.page = page; 105 result.content.page = page;
108 106
src/main/resources/static/pages/base/station/js/station-positions-function.js
@@ -18,6 +18,25 @@ var PositionsPublicFunctions = function () { @@ -18,6 +18,25 @@ var PositionsPublicFunctions = function () {
18 18
19 if(len>0) { 19 if(len>0) {
20 20
  21 + console.log(r[0]);
  22 +
  23 + var markTypeStr = '';
  24 +
  25 + if(r[0].stationRouteStationMark=='B') {
  26 +
  27 + markTypeStr='起点站';
  28 +
  29 + }else if(r[0].stationRouteStationMark=='Z') {
  30 +
  31 + markTypeStr ='中途站';
  32 +
  33 +
  34 + }else if(r[0].stationRouteStationMark=='E') {
  35 +
  36 + markTypeStr='终点站';
  37 +
  38 + }
  39 +
21 var stationShapesType = r[0].stationShapesType; 40 var stationShapesType = r[0].stationShapesType;
22 41
23 // 获取中心坐标点字符串分割 42 // 获取中心坐标点字符串分割
@@ -30,10 +49,15 @@ var PositionsPublicFunctions = function () { @@ -30,10 +49,15 @@ var PositionsPublicFunctions = function () {
30 '<span style="color:#DDD;font-size: 15px;">站点名称:' + r[0].stationName + '</span>' + 49 '<span style="color:#DDD;font-size: 15px;">站点名称:' + r[0].stationName + '</span>' +
31 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' + 50 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' +
32 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + r[0].stationRouteCode + '</span>' + 51 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + r[0].stationRouteCode + '</span>' +
  52 + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +
33 '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].stationJwpoints + '</span>' + 53 '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].stationJwpoints + '</span>' +
  54 + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + r[0].stationRouteToTime + '&nbsp;分钟</span>' +
  55 + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + r[0].stationRouteDistances + '&nbsp;公里</span>' +
34 '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].stationRadius + '</span>' + 56 '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].stationRadius + '</span>' +
35 '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].stationRouteVersions + '</span>' + 57 '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].stationRouteVersions + '</span>' +
36 - '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ 'ddd' +'" >说明/描述:' + 'ddd' + '</span>' ; 58 + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+
  59 + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+
  60 + r[0].stationRouteDescriptions +'" >说明/描述:' + r[0].stationRouteDescriptions + '</span>' ;
37 61
38 // 信息窗口参数属性 62 // 信息窗口参数属性
39 var opts = { 63 var opts = {
src/main/resources/static/pages/base/station/js/station-positions-map.js
@@ -155,7 +155,7 @@ var StationPositionsWorldsBMap = function () { @@ -155,7 +155,7 @@ var StationPositionsWorldsBMap = function () {
155 mapBValue.panTo(pointPolygon,PanOptions_); 155 mapBValue.panTo(pointPolygon,PanOptions_);
156 156
157 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 157 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
158 - mapBValue.panBy(10,110,PanOptions_); 158 + mapBValue.panBy(10,-510,PanOptions_);
159 159
160 //开启信息窗口 160 //开启信息窗口
161 marker.openInfoWindow(infoWindow,pointPolygon); 161 marker.openInfoWindow(infoWindow,pointPolygon);
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
@@ -188,18 +188,9 @@ var GetAjaxData = function(){ @@ -188,18 +188,9 @@ var GetAjaxData = function(){
188 188
189 }); 189 });
190 190
191 - },  
192 -  
193 - createUsingSingle : function(params,callback) {  
194 -  
195 - $post('/stationroute/usingSingle',params,function(p) {  
196 -  
197 - return callback && callback(p);  
198 -  
199 - });  
200 -  
201 } 191 }
202 192
  193 +
203 } 194 }
204 195
205 return ajaxData; 196 return ajaxData;
src/main/resources/static/pages/base/stationroute/list.html
@@ -73,9 +73,9 @@ @@ -73,9 +73,9 @@
73 <li> 73 <li>
74 <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> 74 <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a>
75 </li> 75 </li>
76 - <li> 76 + <!-- <li>
77 <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a> 77 <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a>
78 - </li> 78 + </li> -->
79 </ul> 79 </ul>
80 </div> 80 </div>
81 </div> 81 </div>