Commit 9a65026db3eebdb0b9b14619deb3d2dbc2b528af
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
18 changed files
with
803 additions
and
545 deletions
src/main/java/com/bsth/controller/schedule/core/TTInfoDetailController.java
| ... | ... | @@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 8 | import org.springframework.web.bind.annotation.PathVariable; |
| 9 | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | 10 | import org.springframework.web.bind.annotation.RequestMethod; |
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | 12 | import org.springframework.web.bind.annotation.RestController; |
| 12 | 13 | |
| 13 | 14 | import java.util.HashMap; |
| ... | ... | @@ -87,5 +88,16 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { |
| 87 | 88 | } |
| 88 | 89 | return rtn; |
| 89 | 90 | } |
| 90 | - | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 时刻表明细批量插入 | |
| 94 | + * | |
| 95 | + * @param entities | |
| 96 | + * | |
| 97 | + * @return | |
| 98 | + */ | |
| 99 | + @RequestMapping(value = "/skbDetailMxSave" ,method = RequestMethod.POST) | |
| 100 | + public Map<String, Object> skbDetailMxSave(@RequestParam Map<String, Object> entities){ | |
| 101 | + return ttInfoDetailService.skbDetailMxSave(entities); | |
| 102 | + } | |
| 91 | 103 | } | ... | ... |
src/main/java/com/bsth/entity/SectionRoute.java
src/main/java/com/bsth/repository/schedule/GuideboardInfoRepository.java
| ... | ... | @@ -3,6 +3,7 @@ package com.bsth.repository.schedule; |
| 3 | 3 | import java.util.List; |
| 4 | 4 | import java.util.Map; |
| 5 | 5 | |
| 6 | +import com.bsth.entity.Line; | |
| 6 | 7 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| 7 | 8 | import com.bsth.entity.schedule.GuideboardInfo; |
| 8 | 9 | import com.bsth.repository.BaseRepository; |
| ... | ... | @@ -37,4 +38,8 @@ public interface GuideboardInfoRepository extends BaseRepository<GuideboardInfo, |
| 37 | 38 | "where td.ttinfo.id=?1 " + |
| 38 | 39 | "group by td.ttinfo.id, td.lp.id, td.lp.lpName") |
| 39 | 40 | List<Map<String, Object>> findLpName(Long ttid); |
| 41 | + | |
| 42 | + @Query(value = "SELECT g FROM GuideboardInfo g where g.xl =?1 and g.lpName = ?2 and g.lpNo = ?3 and lpType =?4 and isCancel = 0") | |
| 43 | + List<GuideboardInfo> validateLp(Line xl,String lpName , int lpNo,String lpType); | |
| 44 | + | |
| 40 | 45 | } | ... | ... |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| ... | ... | @@ -11,6 +11,8 @@ import com.bsth.repository.StationRouteRepository; |
| 11 | 11 | import com.bsth.service.StationRouteService; |
| 12 | 12 | import com.bsth.util.FTPClientUtils; |
| 13 | 13 | import com.bsth.util.PackTarGZUtils; |
| 14 | +import com.bsth.util.Geo.GeoUtils; | |
| 15 | +import com.bsth.util.Geo.Point; | |
| 14 | 16 | import com.bsth.util.db.DBUtils_MS; |
| 15 | 17 | import com.google.common.base.Splitter; |
| 16 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -556,9 +558,15 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 556 | 558 | |
| 557 | 559 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName); |
| 558 | 560 | |
| 559 | - /** 行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/ | |
| 560 | - String textStr = newTextFileToFTP(objects,lineId); | |
| 561 | + String textStr = ""; | |
| 561 | 562 | |
| 563 | + boolean tempTag = ishxType(objects); | |
| 564 | + | |
| 565 | + if(tempTag) | |
| 566 | + textStr = hxTextFileToFtp(objects,lineId);// 环线行单文件内容 | |
| 567 | + else | |
| 568 | + textStr = newTextFileToFTP(objects,lineId);/** 双向行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/ | |
| 569 | + | |
| 562 | 570 | /*textStr = line.getName() + "\t" + "2" + "\r" + textStr;*/ |
| 563 | 571 | |
| 564 | 572 | textStr = line.getName() + " " + "2" + "\r" + textStr; |
| ... | ... | @@ -574,9 +582,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 574 | 582 | /** 获取txt文件 */ |
| 575 | 583 | File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName); |
| 576 | 584 | |
| 577 | - /*File[] sources = new File[] {textFile};*/ | |
| 578 | - //File[] sources = new File[] {textFile}; | |
| 579 | - | |
| 580 | 585 | File target = new File(odlGzFileName); |
| 581 | 586 | |
| 582 | 587 | // 将txt文件打包 |
| ... | ... | @@ -603,6 +608,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 603 | 608 | } |
| 604 | 609 | return resultMap; |
| 605 | 610 | } |
| 611 | + public boolean ishxType(List<Object[]> listObj) { | |
| 612 | + boolean tag = true; | |
| 613 | + String pointBStr[] = null,pointEStr[] = null; | |
| 614 | + int numzd = 0; | |
| 615 | + for(int i =0;i<listObj.size();i++) { | |
| 616 | + if(listObj.get(i)[3].equals("B") && Integer.valueOf(listObj.get(i)[8].toString())==0) | |
| 617 | + pointBStr = listObj.get(i)[2].toString().split(" "); | |
| 618 | + else if(listObj.get(i)[3].equals("E") && Integer.valueOf(listObj.get(i)[8].toString())==0) | |
| 619 | + pointEStr = listObj.get(i)[2].toString().split(" "); | |
| 620 | + if(Integer.valueOf(listObj.get(i)[8].toString())==1) | |
| 621 | + numzd++; | |
| 622 | + } | |
| 623 | + Point p1 = new Point(Double.valueOf(pointBStr[0]),Double.valueOf(pointBStr[1])); | |
| 624 | + Point p2 = new Point(Double.valueOf(pointEStr[0]),Double.valueOf(pointEStr[1])); | |
| 625 | + if(GeoUtils.getDistance(p1, p2)>100 && numzd>2) | |
| 626 | + tag = false; | |
| 627 | + return tag; | |
| 628 | + } | |
| 606 | 629 | |
| 607 | 630 | /** |
| 608 | 631 | * @Description : TODO(形成行单文件内容) |
| ... | ... | @@ -717,31 +740,79 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 717 | 740 | } |
| 718 | 741 | |
| 719 | 742 | } |
| 720 | - | |
| 721 | - /* | |
| 722 | - String bdJWPointStr = objects.get(i)[2].toString(); | |
| 723 | - | |
| 724 | - String bdJWPointA[] = bdJWPointStr.split(" "); | |
| 725 | - | |
| 726 | - Map<String, Object> pointsM = new HashMap<String,Object>(); | |
| 727 | - | |
| 728 | - pointsM.put("lng", bdJWPointA[0]); | |
| 729 | - | |
| 730 | - pointsM.put("lat", bdJWPointA[1]); | |
| 731 | - | |
| 732 | - System.out.println(objects.get(i)[7].toString()); | |
| 733 | - | |
| 734 | - sleepStr = sleepStr + GetFormPointOnPolylineSeleepLimit(pointsM,sobje);*/ | |
| 735 | 743 | } |
| 736 | 744 | |
| 737 | 745 | stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; |
| 738 | - | |
| 739 | 746 | } |
| 740 | 747 | |
| 741 | 748 | } |
| 742 | - | |
| 743 | 749 | return stationRStr; |
| 744 | - | |
| 750 | + } | |
| 751 | + | |
| 752 | + public String hxTextFileToFtp(List<Object[]> objects,Integer lineId) { | |
| 753 | + String restStr = ""; | |
| 754 | + // windows下的文本文件换行符 | |
| 755 | + //String enterStr = "\r\n"; | |
| 756 | + // linux/unix下的文本文件换行符 | |
| 757 | + String enterStr = "\r"; | |
| 758 | + int xh = 1 ; | |
| 759 | + for(int x =0;x<2;x++) { | |
| 760 | + for(int i = 0; i<objects.size();i++) { | |
| 761 | + if(Integer.valueOf(objects.get(i)[8].toString())==0) { | |
| 762 | + // 经度 | |
| 763 | + String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); | |
| 764 | + // 纬度 | |
| 765 | + String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); | |
| 766 | + lat = "\t" + lat; | |
| 767 | + // 站点类型 | |
| 768 | + String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString(); | |
| 769 | + String stationMake = ""; | |
| 770 | + if(stationMakeStr.equals("E")) { | |
| 771 | + stationMake = "\t2"; | |
| 772 | + }else { | |
| 773 | + stationMake ="\t1"; | |
| 774 | + } | |
| 775 | + // 站点序号 | |
| 776 | + // String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString(); | |
| 777 | + String stationNo = "\t" + xh; | |
| 778 | + // 站点编码 | |
| 779 | + String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); | |
| 780 | + stationCode = "\t" +stationCode; | |
| 781 | + double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; | |
| 782 | + String tempDistc = String.valueOf((int) dis); | |
| 783 | + // 站点距离 | |
| 784 | + String staitondistance = "\t" + tempDistc; | |
| 785 | + // 站点名称 | |
| 786 | + String stationName = objects.get(i)[7].equals("") ? "" : objects.get(i)[7].toString(); | |
| 787 | + stationName = "\t" +stationName; | |
| 788 | + // 限速 | |
| 789 | + String sleepStr = ""; | |
| 790 | + // 方向 | |
| 791 | + int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString()); | |
| 792 | + /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ | |
| 793 | + List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); | |
| 794 | + if(sobje.size()==1) { | |
| 795 | + double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString()); | |
| 796 | + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr); | |
| 797 | + }else if(sobje.size()>1){ | |
| 798 | + /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */ | |
| 799 | + for(int j =0;j<sobje.size();j++) { | |
| 800 | + String sectionName = sobje.get(j)[3].toString(); | |
| 801 | + String sectionNameA[] = sectionName.split("至"); | |
| 802 | + if(stationName.equals(sectionNameA[0])){ | |
| 803 | + /*sleepStr = sobje.get(j)[2].toString();*/ | |
| 804 | + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString()); | |
| 805 | + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt); | |
| 806 | + } | |
| 807 | + } | |
| 808 | + } | |
| 809 | + xh++; | |
| 810 | + restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; | |
| 811 | + } | |
| 812 | + } | |
| 813 | + } | |
| 814 | + System.out.println(restStr); | |
| 815 | + return restStr; | |
| 745 | 816 | } |
| 746 | 817 | |
| 747 | 818 | public String GetFormPointOnPolylineSeleepLimit(Map<String, Object> p,List<Object[]> listObjArra) { | ... | ... |
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
| ... | ... | @@ -6,6 +6,7 @@ import org.apache.commons.lang3.StringUtils; |
| 6 | 6 | |
| 7 | 7 | import java.util.ArrayList; |
| 8 | 8 | import java.util.List; |
| 9 | +import java.util.Map; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * Created by xu on 16/7/2. |
| ... | ... | @@ -200,5 +201,5 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { |
| 200 | 201 | // TODO:这个方法可以用通用方法解决,以后改 |
| 201 | 202 | List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId); |
| 202 | 203 | |
| 203 | - | |
| 204 | + Map<String, Object> skbDetailMxSave(Map<String, Object> map); | |
| 204 | 205 | } | ... | ... |
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| 1 | 1 | package com.bsth.service.schedule.impl; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson.JSONArray; | |
| 4 | +import com.alibaba.fastjson.JSONObject; | |
| 5 | +import com.bsth.common.ResponseCode; | |
| 3 | 6 | import com.bsth.entity.CarPark; |
| 7 | +import com.bsth.entity.Line; | |
| 4 | 8 | import com.bsth.entity.LineInformation; |
| 5 | 9 | import com.bsth.entity.StationRoute; |
| 6 | 10 | import com.bsth.entity.schedule.GuideboardInfo; |
| 7 | 11 | import com.bsth.entity.schedule.TTInfoDetail; |
| 12 | +import com.bsth.repository.CarParkRepository; | |
| 13 | +import com.bsth.repository.LineRepository; | |
| 14 | +import com.bsth.repository.StationRepository; | |
| 15 | +import com.bsth.repository.schedule.GuideboardInfoRepository; | |
| 8 | 16 | import com.bsth.repository.schedule.TTInfoDetailRepository; |
| 17 | +import com.bsth.repository.schedule.TTInfoRepository; | |
| 9 | 18 | import com.bsth.service.CarParkService; |
| 10 | 19 | import com.bsth.service.LineInformationService; |
| 11 | 20 | import com.bsth.service.StationRouteService; |
| ... | ... | @@ -58,7 +67,16 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 58 | 67 | private TTInfoDetailRepository ttInfoDetailRepository; |
| 59 | 68 | @Autowired |
| 60 | 69 | private DataToolsProperties dataToolsProperties; |
| 61 | - | |
| 70 | + @Autowired | |
| 71 | + private LineRepository lineRepository; | |
| 72 | + @Autowired | |
| 73 | + private TTInfoRepository infoRepository; | |
| 74 | + @Autowired | |
| 75 | + private StationRepository staRepository; | |
| 76 | + @Autowired | |
| 77 | + private CarParkRepository carParkRepository; | |
| 78 | + @Autowired | |
| 79 | + private GuideboardInfoRepository guideboardInfoRepository; | |
| 62 | 80 | @Autowired |
| 63 | 81 | @Qualifier(value = "dataToolsServiceImpl") |
| 64 | 82 | private DataToolsService dataToolsService; |
| ... | ... | @@ -512,5 +530,84 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 512 | 530 | public List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId) { |
| 513 | 531 | return ttInfoDetailRepository.findBcdetails(xlId, ttinfoId, lpId); |
| 514 | 532 | } |
| 515 | - | |
| 533 | + | |
| 534 | + @Override | |
| 535 | + public Map<String, Object> skbDetailMxSave(Map<String, Object> map) { | |
| 536 | + Map<String, Object> rs_m = new HashMap<String,Object>(); | |
| 537 | + try { | |
| 538 | + String d = map.get("d") == null ? null : map.get("d").toString(); | |
| 539 | + if(d!=null) | |
| 540 | + ttInfoDetailRepository.save(jsonArrayToListEntity(d)); | |
| 541 | + } catch (Exception e) { | |
| 542 | + e.printStackTrace(); | |
| 543 | + rs_m.put("status", ResponseCode.ERROR); | |
| 544 | + } | |
| 545 | + rs_m.put("status", ResponseCode.SUCCESS); | |
| 546 | + return rs_m; | |
| 547 | + } | |
| 548 | + | |
| 549 | + public List<TTInfoDetail> jsonArrayToListEntity(String jsonStr) throws Exception { | |
| 550 | + List<TTInfoDetail> listTd = new ArrayList<TTInfoDetail>(); | |
| 551 | + JSONArray jsonArray = JSONArray.parseArray(jsonStr); | |
| 552 | + for(int i =0; i<jsonArray.size();i++) { | |
| 553 | + JSONObject jsonObj = jsonArray.getJSONObject(i); | |
| 554 | + if(jsonObj.getString("bcType").equals("bd") || jsonObj.getString("bcType").equals("lc") || jsonObj.getString("bcType").equals("cf")) | |
| 555 | + continue; | |
| 556 | + listTd.add(objToEntity(jsonObj)); | |
| 557 | + } | |
| 558 | + return listTd; | |
| 559 | + } | |
| 560 | + | |
| 561 | + public TTInfoDetail objToEntity(JSONObject obj) throws Exception { | |
| 562 | + TTInfoDetail td = new TTInfoDetail(); | |
| 563 | + Line xl = lineRepository.findOne(Integer.parseInt(obj.getString("xl"))); | |
| 564 | + td.setXl(xl); | |
| 565 | + td.setTtinfo(obj.getString("ttinfo") == null ? null : infoRepository.findOne(Long.parseLong(obj.getString("ttinfo")))); | |
| 566 | + td.setLp(getLp(xl,obj.getString("lp"),Integer.parseInt(obj.getString("lp")),obj.getString("lpType"))); | |
| 567 | + td.setFcno(Integer.parseInt(obj.getString("fcno"))); | |
| 568 | + td.setXlDir(dirToCod(obj.get("xlDir").toString())); | |
| 569 | + td.setQdz( obj.getString("qdz") ==null? null : staRepository.findOne(Integer.parseInt(obj.getString("qdz")))); | |
| 570 | + td.setZdz(obj.getString("zdz") ==null ? null :staRepository.findOne(Integer.parseInt(obj.getString("zdz")))); | |
| 571 | + td.setTcc(carParkRepository.findOne(Integer.parseInt(obj.getString("tcc")))); | |
| 572 | + td.setFcsj(obj.getString("fcsj")); | |
| 573 | + td.setBcs(Integer.parseInt(obj.getString("bcs"))); | |
| 574 | + td.setJhlc(Double.parseDouble(obj.getString("jhlc"))); | |
| 575 | + td.setBcsj(Integer.parseInt(obj.getString("bcsj"))); | |
| 576 | + td.setBcType(obj.getString("bcType")); | |
| 577 | + td.setIsFB(false); | |
| 578 | + td.setIsSwitchXl(false); | |
| 579 | + td.setSwitchXl(null); | |
| 580 | + td.setSwitchXlDesc(null); | |
| 581 | + td.setRemark(null); | |
| 582 | + td.setCreateBy(null); | |
| 583 | + td.setUpdateBy(null); | |
| 584 | + return td; | |
| 585 | + } | |
| 586 | + | |
| 587 | + public GuideboardInfo getLp(Line xl,String name, int code, String lpType) throws Exception { | |
| 588 | + GuideboardInfo entity = new GuideboardInfo(); | |
| 589 | + List<GuideboardInfo> lgi = guideboardInfoRepository.validateLp(xl, name, code,lpType); | |
| 590 | + if(lgi.size()>0) { | |
| 591 | + entity = lgi.get(0); | |
| 592 | + }else{ | |
| 593 | + entity.setXl(xl); | |
| 594 | + entity.setLpNo(code); | |
| 595 | + entity.setLpName(name); | |
| 596 | + entity.setLpType(lpType); | |
| 597 | + entity.setIsCancel(false); | |
| 598 | + entity.setCreateBy(null); | |
| 599 | + entity.setUpdateBy(null); | |
| 600 | + guideboardInfoRepository.save(entity); | |
| 601 | + } | |
| 602 | + return entity; | |
| 603 | + } | |
| 604 | + | |
| 605 | + public String dirToCod(String str) throws Exception { | |
| 606 | + String c = ""; | |
| 607 | + if(str.equals("relationshipGraph-up")) | |
| 608 | + c = "0"; | |
| 609 | + else if(str.equals("relationshipGraph-down")) | |
| 610 | + c = "1"; | |
| 611 | + return c; | |
| 612 | + } | |
| 516 | 613 | } | ... | ... |
src/main/java/com/bsth/util/Geo/SHCJ2BDJW.java
| ... | ... | @@ -27,9 +27,11 @@ public class SHCJ2BDJW { |
| 27 | 27 | |
| 28 | 28 | /*String sqlSelect = "SELECT b.SHAPESTRING as SHAPE , b.id as ID FROM jjwgps_t_gjldb b where SHAPESTRING is not null order by b.ldbh asc ";*/ |
| 29 | 29 | /*String sqlSelect = "select s.id,s.descriptions from bsth_c_station s order by s.id asc ";*/ |
| 30 | - String sqlSelect = "SELECT s.id,s.descriptions FROM bsth_c_section s order by s.id asc "; | |
| 30 | + String sqlSelect = "select s.id,s.x,s.y from bsth_c_station s where id >=26882 order by s.id asc"; | |
| 31 | + /*String sqlSelect = "SELECT s.id,s.descriptions FROM bsth_c_section s order by s.id asc ";*/ | |
| 31 | 32 | |
| 32 | - String sqlUpdate = "UPDATE bsth_c_section SET csection_vector = ST_GeomFromText(?) , bsection_vector=ST_GeomFromText(?) , gsection_vector=ST_GeomFromText(?) where id = ?"; | |
| 33 | + /*String sqlUpdate = "UPDATE bsth_c_section SET csection_vector = ST_GeomFromText(?) , bsection_vector=ST_GeomFromText(?) , gsection_vector=ST_GeomFromText(?) where id = ?";*/ | |
| 34 | + String sqlUpdate = "UPDATE bsth_c_station SET b_jwpoints= ? , g_lonx=? , g_laty=? where id = ?"; | |
| 33 | 35 | |
| 34 | 36 | List<Map<String, Object>> list = new ArrayList<>(); |
| 35 | 37 | |
| ... | ... | @@ -44,8 +46,9 @@ public class SHCJ2BDJW { |
| 44 | 46 | |
| 45 | 47 | Map<String, Object> map = new HashMap<String, Object>(); |
| 46 | 48 | |
| 47 | - map.put("descriptions", rs.getString("descriptions")); | |
| 48 | - | |
| 49 | + /*map.put("descriptions", rs.getString("descriptions"));*/ | |
| 50 | + map.put("x", rs.getString("x")); | |
| 51 | + map.put("y", rs.getString("y")); | |
| 49 | 52 | map.put("id", rs.getInt("id")); |
| 50 | 53 | |
| 51 | 54 | list.add(map); |
| ... | ... | @@ -55,10 +58,21 @@ public class SHCJ2BDJW { |
| 55 | 58 | |
| 56 | 59 | Map<String, Object> temp = list.get(i); |
| 57 | 60 | // POINT (8229.30921617 -933.16425265) |
| 58 | - String lineString = temp.get("descriptions").toString(); | |
| 59 | - int id = Integer.parseInt(temp.get("id").toString()); | |
| 61 | + //String lineString = temp.get("descriptions").toString(); | |
| 62 | + | |
| 63 | + Double lng = Double.parseDouble(temp.get("x").toString()); | |
| 64 | + Double lat = Double.parseDouble(temp.get("y").toString()); | |
| 65 | + Map map_2 = JWDUtil.ConvertSHToJW(lng,lat); | |
| 60 | 66 | |
| 61 | - String arrayP[] = lineString.substring(lineString.indexOf("(")+1, lineString.length()-1).split(", "); | |
| 67 | + String b_jwpoints = ""; | |
| 68 | + Float g_lonx=0.0f,g_laty=0.0f; | |
| 69 | + int id = Integer.parseInt(temp.get("id").toString()); | |
| 70 | + g_lonx = Float.parseFloat(map_2.get("x").toString()); | |
| 71 | + g_laty = Float.parseFloat(map_2.get("y").toString()); | |
| 72 | + Location location = TransGPS.LocationMake(Float.parseFloat(map_2.get("x").toString()), Float.parseFloat(map_2.get("y").toString())); | |
| 73 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location)); | |
| 74 | + b_jwpoints = (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624); | |
| 75 | + //String arrayP[] = lineString.substring(lineString.indexOf("(")+1, lineString.length()-1).split(", "); | |
| 62 | 76 | /*String arrayP[] = lineString.substring(lineString.indexOf("(")+1, lineString.length()-1).split(" "); |
| 63 | 77 | String b_jwpoints = ""; |
| 64 | 78 | Float g_lonx=0.0f,g_laty=0.0f,x=0.0f,y=0.0f;*/ |
| ... | ... | @@ -76,7 +90,7 @@ public class SHCJ2BDJW { |
| 76 | 90 | b_jwpoints = (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624);*/ |
| 77 | 91 | //b_jwpoints = (location.getLng()) + " " + (location.getLat()); |
| 78 | 92 | |
| 79 | - String csection_vector="",bsection_vector="",gsection_vector=""; | |
| 93 | + /* String csection_vector="",bsection_vector="",gsection_vector=""; | |
| 80 | 94 | |
| 81 | 95 | for(int k =0;k<arrayP.length;k++) { |
| 82 | 96 | |
| ... | ... | @@ -103,20 +117,20 @@ public class SHCJ2BDJW { |
| 103 | 117 | } |
| 104 | 118 | |
| 105 | 119 | |
| 106 | - } | |
| 120 | + }*/ | |
| 107 | 121 | |
| 108 | 122 | ps = null; |
| 109 | - bsection_vector = "LINESTRING(" + bsection_vector +")"; | |
| 110 | - csection_vector = "LINESTRING(" + csection_vector +")"; | |
| 111 | - gsection_vector = "LINESTRING(" + gsection_vector +")"; | |
| 123 | + //bsection_vector = "LINESTRING(" + bsection_vector +")"; | |
| 124 | + //csection_vector = "LINESTRING(" + csection_vector +")"; | |
| 125 | + //gsection_vector = "LINESTRING(" + gsection_vector +")"; | |
| 112 | 126 | |
| 113 | 127 | ps = conn.prepareStatement(sqlUpdate); |
| 114 | 128 | |
| 115 | 129 | // String sqlUpdate = "UPDATE bsth_c_section SET csection_vector = ? , bsection_vector=? , gsection_vector=? where id = ?"; |
| 116 | - ps.setString(1, csection_vector); | |
| 117 | - ps.setString(2, bsection_vector); | |
| 118 | - ps.setString(3, gsection_vector); | |
| 119 | - ps.setInt(4, id); | |
| 130 | + //ps.setString(1, csection_vector); | |
| 131 | + //ps.setString(2, bsection_vector); | |
| 132 | + //ps.setString(3, gsection_vector); | |
| 133 | + //ps.setInt(4, id); | |
| 120 | 134 | |
| 121 | 135 | //int stauts = ps.executeUpdate(); |
| 122 | 136 | // String sqlUpdate = "UPDATE bsth_c_station SET b_jwpoints = ?1 , g_lonx=?2 , g_laty=?3 , x = ?4 , y = ?5 where id = ?6"; |
| ... | ... | @@ -126,6 +140,11 @@ public class SHCJ2BDJW { |
| 126 | 140 | ps.setFloat(4, x); |
| 127 | 141 | ps.setFloat(5, y); |
| 128 | 142 | ps.setFloat(6, id);*/ |
| 143 | + | |
| 144 | + ps.setString(1, b_jwpoints); | |
| 145 | + ps.setFloat(2, g_lonx); | |
| 146 | + ps.setFloat(3, g_laty); | |
| 147 | + ps.setFloat(4, id); | |
| 129 | 148 | int stauts = ps.executeUpdate(); |
| 130 | 149 | System.out.println(stauts); |
| 131 | 150 | } | ... | ... |
src/main/resources/static/pages/base/station/edit_select.html
| ... | ... | @@ -177,7 +177,7 @@ $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,drm, |
| 177 | 177 | map.clearMarkAndOverlays(); |
| 178 | 178 | |
| 179 | 179 | // 打开绘制工具 |
| 180 | - PositionsDrawingManagerObj.openDrawingManager(); | |
| 180 | + drm.openDrawingManager(); | |
| 181 | 181 | |
| 182 | 182 | // 根据站点位置在地图定位 |
| 183 | 183 | map.localtionPoint(editStationName); | ... | ... |
src/main/resources/static/pages/control/lineallot/allot.html
| ... | ... | @@ -337,8 +337,8 @@ |
| 337 | 337 | //alert('进入线调'); |
| 338 | 338 | layer.closeAll(); |
| 339 | 339 | //loadPage('/pages/control/line/index.html'); |
| 340 | - //window.location.href = "/real_control/v2"; | |
| 341 | - window.open("/real_control/v2"); | |
| 340 | + window.location.href = "/real_control/v2"; | |
| 341 | + //window.open("/real_control/v2"); | |
| 342 | 342 | }); |
| 343 | 343 | }); |
| 344 | 344 | ... | ... |
src/main/resources/static/real_control_v2/css/electron.css
| 1 | -/** 在electron 环境下特定的css样式 */ | |
| 2 | - | |
| 3 | -.north{ | |
| 4 | - height: 160px !important; | |
| 5 | -} | |
| 6 | - | |
| 7 | -.north-toolbar{ | |
| 8 | - width: 582px !important; | |
| 9 | -} | |
| 10 | - | |
| 11 | -.north>div.uk-grid.uk-grid-match{ | |
| 12 | - margin-top: 35px; | |
| 13 | -} | |
| 14 | - | |
| 15 | - | |
| 16 | -.main-container { | |
| 17 | - height: calc(100% - 160px) !important; | |
| 18 | -} | |
| 19 | - | |
| 20 | -.uk-navbar-content .icon-item{ | |
| 21 | - display: inline-block; | |
| 22 | - margin: 6px 3px 7px 0; | |
| 23 | - font-size: 16px; | |
| 24 | - vertical-align: middle; | |
| 25 | - padding: 5px; | |
| 26 | - cursor: pointer; | |
| 27 | -} | |
| 28 | - | |
| 29 | -.uk-navbar-content .icon-item:hover{ | |
| 30 | - box-shadow: 0 4px 7px 0 rgba(0, 0, 0, 0.2), 0 3px 2px 0 rgba(0, 0, 0, 0.19); | |
| 31 | -} | |
| 32 | - | |
| 1 | +/** 在electron 环境下特定的css样式 */ | |
| 2 | + | |
| 3 | +.north{ | |
| 4 | + height: 160px !important; | |
| 5 | +} | |
| 6 | + | |
| 7 | +.north-toolbar{ | |
| 8 | + width: 662px !important; | |
| 9 | +} | |
| 10 | + | |
| 11 | +.north>div.uk-grid.uk-grid-match{ | |
| 12 | + margin-top: 35px; | |
| 13 | +} | |
| 14 | + | |
| 15 | + | |
| 16 | +.main-container { | |
| 17 | + height: calc(100% - 160px) !important; | |
| 18 | +} | |
| 19 | + | |
| 20 | +.uk-navbar-content .icon-item{ | |
| 21 | + display: inline-block; | |
| 22 | + margin: 6px 3px 7px 0; | |
| 23 | + font-size: 16px; | |
| 24 | + vertical-align: middle; | |
| 25 | + padding: 5px; | |
| 26 | + cursor: pointer; | |
| 27 | +} | |
| 28 | + | |
| 29 | +.uk-navbar-content .icon-item:hover{ | |
| 30 | + box-shadow: 0 4px 7px 0 rgba(0, 0, 0, 0.2), 0 3px 2px 0 rgba(0, 0, 0, 0.19); | |
| 31 | +} | |
| 33 | 32 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/css/line_schedule.css
src/main/resources/static/real_control_v2/css/north.css
| ... | ... | @@ -5,8 +5,8 @@ |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | .north.main { |
| 8 | - /*background: linear-gradient(to right, #082F4A, #125688, #0a3f64);*/ | |
| 9 | - background-image: url('/assets/img/title-bg.jpg'); | |
| 8 | + background: linear-gradient(to right, #082F4A, #125688, #0a3f64); | |
| 9 | + /*background-image: url('/assets/img/title-bg.jpg');*/ | |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | .north.monitor { | ... | ... |
src/main/resources/static/real_control_v2/electron/lineSelect.html
| 1 | -<!DOCTYPE html> | |
| 2 | -<html lang="zh"> | |
| 3 | -<head> | |
| 4 | - <meta name="renderer" content="webkit"/> | |
| 5 | - <meta charset="utf-8"/> | |
| 6 | - <title>选择线路</title> | |
| 7 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/> | |
| 8 | - <link rel="stylesheet" | |
| 9 | - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/form-advanced.gradient.min.css"/> | |
| 10 | - | |
| 11 | - <link rel="stylesheet" | |
| 12 | - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.gradient.min.css"/> | |
| 13 | - | |
| 14 | - <style type="text/css"> | |
| 15 | - | |
| 16 | - ::-webkit-scrollbar { | |
| 17 | - width: 16px; | |
| 18 | - height: 16px; | |
| 19 | - } | |
| 20 | - | |
| 21 | - ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb { | |
| 22 | - border-radius: 999px; | |
| 23 | - border: 5px solid transparent; | |
| 24 | - } | |
| 25 | - | |
| 26 | - ::-webkit-scrollbar-track { | |
| 27 | - box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset; | |
| 28 | - } | |
| 29 | - | |
| 30 | - ::-webkit-scrollbar-thumb { | |
| 31 | - min-height: 20px; | |
| 32 | - background-clip: content-box; | |
| 33 | - box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset; | |
| 34 | - } | |
| 35 | - | |
| 36 | - ::-webkit-scrollbar-corner { | |
| 37 | - background: transparent; | |
| 38 | - } | |
| 39 | - | |
| 40 | - input[type="checkbox"] { | |
| 41 | - vertical-align: bottom; | |
| 42 | - } | |
| 43 | - | |
| 44 | - .line-btn-list { | |
| 45 | - padding: 0 15px 15px 15px; | |
| 46 | - height: 180px; | |
| 47 | - overflow: auto; | |
| 48 | - } | |
| 49 | - | |
| 50 | - .line-btn-list-selected { | |
| 51 | - padding: 0 15px 15px 15px; | |
| 52 | - height: 35px; | |
| 53 | - overflow: auto; | |
| 54 | - } | |
| 55 | - | |
| 56 | - .line-btn-list span.line-item { | |
| 57 | - border: 1px solid #e0dfdf; | |
| 58 | - padding: 4px 9px; | |
| 59 | - margin: 5px; | |
| 60 | - -webkit-user-select: none; | |
| 61 | - user-select: none; | |
| 62 | - display: inline-block; | |
| 63 | - cursor: default; | |
| 64 | - transition: all .1s; | |
| 65 | - } | |
| 66 | - | |
| 67 | - .line-btn-list span.line-item.active { | |
| 68 | - background: #5E96D2; | |
| 69 | - border: 1px solid #5E96D2; | |
| 70 | - box-shadow: 0px 3px 4px 0 rgba(111, 172, 237, 0.3), 0px 3px 5px 0 rgba(111, 172, 237, 0.3); | |
| 71 | - color: #ffffff; | |
| 72 | - } | |
| 73 | - | |
| 74 | - input.i-cbox[type=checkbox] { | |
| 75 | - vertical-align: middle; | |
| 76 | - margin-top: -3px; | |
| 77 | - } | |
| 78 | - | |
| 79 | - .line-btn-list span.line-item.active input.i-cbox[type=checkbox] { | |
| 80 | - border: 0; | |
| 81 | - } | |
| 82 | - | |
| 83 | - .line-btn-list span.line-item.active input.i-cbox[type=checkbox]:checked:before { | |
| 84 | - color: #86f78b; | |
| 85 | - } | |
| 86 | - | |
| 87 | - .uk-panel-title { | |
| 88 | - text-indent: 15px; | |
| 89 | - } | |
| 90 | - | |
| 91 | - .line-btn-list-selected span.line-item { | |
| 92 | - padding: 4px 9px; | |
| 93 | - margin: 2px; | |
| 94 | - color: #fff; | |
| 95 | - background: #5e96d2; | |
| 96 | - box-shadow: 0px 3px 4px 0 rgba(111, 172, 237, 0.3), 0px 3px 5px 0 rgba(111, 172, 237, 0.3); | |
| 97 | - user-select: none; | |
| 98 | - display: inline-block; | |
| 99 | - cursor: move; | |
| 100 | - border-radius: 5px; | |
| 101 | - } | |
| 102 | - | |
| 103 | - #lineSearchInput { | |
| 104 | - width: 300px; | |
| 105 | - box-shadow: 0px 3px 4px 0 rgba(217, 226, 235, 0.3), 0px 3px 5px 0 rgba(200, 217, 236, 0.3); | |
| 106 | - height: 35px; | |
| 107 | - } | |
| 108 | - | |
| 109 | - #submitBtn{ | |
| 110 | - border-radius: 0; | |
| 111 | - border-color: #00aff2; | |
| 112 | - transition: all .3s; | |
| 113 | - } | |
| 114 | - | |
| 115 | - #submitBtn:disabled{ | |
| 116 | - border-color: #ebe9e9; | |
| 117 | - } | |
| 118 | - </style> | |
| 119 | -</head> | |
| 120 | - | |
| 121 | -<body> | |
| 122 | -<div class="wrapper ng-scope"> | |
| 123 | - <div class="dialog dialog-shadow"> | |
| 124 | - <form class="uk-form" style="width: 100%;"> | |
| 125 | - <div class="uk-grid"> | |
| 126 | - | |
| 127 | - <div class="uk-width-medium-1-1"> | |
| 128 | - <div class="uk-panel uk-panel-divider"> | |
| 129 | - <div class="uk-form-row"> | |
| 130 | - <div class="uk-form-icon" style="margin: 15px;"> | |
| 131 | - <i class="uk-icon-search"></i> | |
| 132 | - <input type="text" placeholder="搜索线路..." id="lineSearchInput"> | |
| 133 | - </div> | |
| 134 | - </div> | |
| 135 | - <h3 class="uk-panel-title">待选择的线路</h3> | |
| 136 | - <div class="line-btn-list"> | |
| 137 | - </div> | |
| 138 | - </div> | |
| 139 | - <div class="uk-panel uk-panel-divider"> | |
| 140 | - <h3 class="uk-panel-title">已选择的线路</h3> | |
| 141 | - <div class="line-btn-list-selected uk-sortable" data-uk-sortable data-uk-observe> | |
| 142 | - </div> | |
| 143 | - <button disabled class="uk-button uk-button-primary uk-button-large uk-width-1-1" type="button" id="submitBtn">确定 | |
| 144 | - </button> | |
| 145 | - </div> | |
| 146 | - </div> | |
| 147 | - | |
| 148 | - </div> | |
| 149 | - </form> | |
| 150 | - | |
| 151 | - </div> | |
| 152 | -</div> | |
| 153 | - | |
| 154 | -<script> | |
| 155 | - delete window.exports; | |
| 156 | - delete window.module; | |
| 157 | -</script> | |
| 158 | -<!-- jQuery --> | |
| 159 | -<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | |
| 160 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script> | |
| 161 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.min.js"></script> | |
| 162 | -<script src="/assets/plugins/pinyin.js"></script> | |
| 163 | -<script src="/real_control_v2/js/common.js"></script> | |
| 164 | - | |
| 165 | -<!-- EventProxy --> | |
| 166 | -<script src="/assets/js/eventproxy.js"></script> | |
| 167 | -<script> | |
| 168 | - if (typeof(process) == 'undefined' || !process) { | |
| 169 | - alert('不支持当前环境!!'); | |
| 170 | - } | |
| 171 | - | |
| 172 | - const ipcMain = require('electron').ipcRenderer | |
| 173 | - | |
| 174 | - !function () { | |
| 175 | - var all = {}; | |
| 176 | - //线路编码映射 | |
| 177 | - var lineIdMap = {}; | |
| 178 | - var storage = window.localStorage; | |
| 179 | - | |
| 180 | - var auth; | |
| 181 | - gb_common.$get('/line/all', {destroy_eq: 0}, function (list) { | |
| 182 | - | |
| 183 | - //用户分配的线路 | |
| 184 | - $.get('/realControAuthority/findByCurrentUser', function (t) { | |
| 185 | - auth = t; | |
| 186 | - var newArray = [], authArray = t.lineCodeStr.split(','); | |
| 187 | - | |
| 188 | - $.each(list, function () { | |
| 189 | - if (this.lineCode && authArray.indexOf(this.lineCode) != -1) { | |
| 190 | - newArray.push(this); | |
| 191 | - } | |
| 192 | - }); | |
| 193 | - | |
| 194 | - var htmlStr = ''; | |
| 195 | - $.each(newArray, function () { | |
| 196 | - htmlStr += '<span class="line-item" data-name="' + this.name + '" data-code="' + this.lineCode + '">' + | |
| 197 | - ' <input class="i-cbox" type="checkbox"> ' + this.name + | |
| 198 | - '</span>'; | |
| 199 | - | |
| 200 | - //拼音首字母 | |
| 201 | - this.camelChars = pinyin.getCamelChars(this.name); | |
| 202 | - //全拼 | |
| 203 | - this.fullChars = pinyin.getFullChars(this.name).toUpperCase(); | |
| 204 | - | |
| 205 | - lineIdMap[this.lineCode] = this; | |
| 206 | - }); | |
| 207 | - all = list; | |
| 208 | - | |
| 209 | - $('.line-btn-list').html(htmlStr); | |
| 210 | - | |
| 211 | - $('.line-btn-list .line-item').on('click', function () { | |
| 212 | - var box = $(this).find('input[type=checkbox]')[0]; | |
| 213 | - if ($(this).hasClass('active')) { | |
| 214 | - $(this).removeClass('active'); | |
| 215 | - box.checked = false; | |
| 216 | - | |
| 217 | - removeSelected(this); | |
| 218 | - } | |
| 219 | - else { | |
| 220 | - $(this).addClass('active'); | |
| 221 | - box.checked = true; | |
| 222 | - | |
| 223 | - addSelected(this); | |
| 224 | - } | |
| 225 | - }); | |
| 226 | - }); | |
| 227 | - }); | |
| 228 | - | |
| 229 | - | |
| 230 | - $('#lineSearchInput').on('input', function () { | |
| 231 | - var t = $(this).val().toUpperCase(); | |
| 232 | - if (!t) { | |
| 233 | - $('.line-btn-list .line-item').show(); | |
| 234 | - return; | |
| 235 | - } | |
| 236 | - | |
| 237 | - var rs = []; | |
| 238 | - $.each(all, function () { | |
| 239 | - if (this.camelChars.indexOf(t) != -1 | |
| 240 | - || this.fullChars.indexOf(t) != -1 | |
| 241 | - || this.name.indexOf(t) != -1) { | |
| 242 | - rs.push(this.lineCode); | |
| 243 | - } | |
| 244 | - }); | |
| 245 | - | |
| 246 | - $('.line-btn-list .line-item').hide().each(function () { | |
| 247 | - var code = $(this).data('code') + ''; | |
| 248 | - if (rs.indexOf(code) != -1) | |
| 249 | - $(this).show(); | |
| 250 | - }); | |
| 251 | - }); | |
| 252 | - | |
| 253 | - function addSelected(that) { | |
| 254 | - $('.line-btn-list-selected').append('<span class="line-item" data-code="' + $(that).data('code') + '">' + $(that).data('name') + '</span>'); | |
| 255 | - | |
| 256 | - $('#submitBtn').removeAttr('disabled'); | |
| 257 | - } | |
| 258 | - | |
| 259 | - function removeSelected(that) { | |
| 260 | - var code = $(that).data('code'); | |
| 261 | - $('.line-btn-list-selected .line-item[data-code='+code+']').remove(); | |
| 262 | - | |
| 263 | - if($('.line-btn-list-selected .line-item').length == 0){ | |
| 264 | - $('#submitBtn').attr('disabled', 'disabled'); | |
| 265 | - } | |
| 266 | - } | |
| 267 | - | |
| 268 | - function error(rs) { | |
| 269 | - return rs.status == 'ERROR' || rs.status == 500; | |
| 270 | - } | |
| 271 | - | |
| 272 | - /** | |
| 273 | - * 确定 | |
| 274 | - */ | |
| 275 | - $('#submitBtn').on('click', function () { | |
| 276 | - var ep = EventProxy.create('car2DeviceId', 'routes', 'checkLineConfig', function () { | |
| 277 | - ipcMain.send('webPageGotoControl'); | |
| 278 | - }); | |
| 279 | - | |
| 280 | - var lsData = [], codeStr='', code; | |
| 281 | - $('.line-btn-list-selected .line-item').each(function () { | |
| 282 | - code = $(this).data('code'); | |
| 283 | - lsData.push(lineIdMap[code]); | |
| 284 | - codeStr += (code + ','); | |
| 285 | - }); | |
| 286 | - //将选择的线路信息写入localstorage | |
| 287 | - storage.setItem('lineControlItems', JSON.stringify(lsData)); | |
| 288 | - | |
| 289 | - //缓存车辆自编号和设备号对照 | |
| 290 | - $.get('/gps/Car2DeviceId', function (rs) { | |
| 291 | - storage.setItem('car2DeviceId', JSON.stringify(rs)); | |
| 292 | - ep.emitLater('car2DeviceId'); | |
| 293 | - }); | |
| 294 | - | |
| 295 | - //监控模式还是主调模式 | |
| 296 | - storage.setItem('operationMode', auth.pattern); | |
| 297 | - | |
| 298 | - //缓存线路路由 | |
| 299 | - codeStr = codeStr.substr(0, codeStr.length - 1); | |
| 300 | - $.get('/realMap/multiRouteByLine', {codeStr: codeStr}, function (rs) { | |
| 301 | - for(var key in rs){ | |
| 302 | - storage.setItem(key, JSON.stringify(rs[key])); | |
| 303 | - } | |
| 304 | - ep.emitLater('routes'); | |
| 305 | - }); | |
| 306 | - | |
| 307 | - //检查线路配置信息 | |
| 308 | - $.ajax({ | |
| 309 | - url: '/lineConfig/check', | |
| 310 | - traditional: true, | |
| 311 | - data: {codeArray: codeStr.split(',')}, | |
| 312 | - method: 'POST', | |
| 313 | - success: function (rs) { | |
| 314 | - if (rs.status == 0){ | |
| 315 | - ep.emitLater('checkLineConfig'); | |
| 316 | - } | |
| 317 | - else if (rs.status == 1){ | |
| 318 | - initLineConfig(rs.not, function () { | |
| 319 | - ep.emitLater('checkLineConfig'); | |
| 320 | - }); | |
| 321 | - } | |
| 322 | - } | |
| 323 | - }); | |
| 324 | - }); | |
| 325 | - | |
| 326 | - | |
| 327 | - function initLineConfig(arr, cb) { | |
| 328 | - var i = 0; | |
| 329 | - (function () { | |
| 330 | - if (i >= arr.length) { | |
| 331 | - cb && cb(); | |
| 332 | - return; | |
| 333 | - } | |
| 334 | - var f = arguments.callee | |
| 335 | - , lineCode = arr[i]; | |
| 336 | - | |
| 337 | - $.post('/lineConfig/init/' + lineCode, function (rs) { | |
| 338 | - if (rs == 1) { | |
| 339 | - i++; | |
| 340 | - f(); | |
| 341 | - } | |
| 342 | - }); | |
| 343 | - })(); | |
| 344 | - } | |
| 345 | - }(); | |
| 346 | -</script> | |
| 347 | -</body> | |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh"> | |
| 3 | +<head> | |
| 4 | + <meta name="renderer" content="webkit"/> | |
| 5 | + <meta charset="utf-8"/> | |
| 6 | + <title>选择线路</title> | |
| 7 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/> | |
| 8 | + <link rel="stylesheet" | |
| 9 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/form-advanced.gradient.min.css"/> | |
| 10 | + | |
| 11 | + <link rel="stylesheet" | |
| 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.gradient.min.css"/> | |
| 13 | + | |
| 14 | + <style type="text/css"> | |
| 15 | + html, body { | |
| 16 | + background: transparent; | |
| 17 | + } | |
| 18 | + | |
| 19 | + body { | |
| 20 | + overflow: hidden; | |
| 21 | + padding: 3px; | |
| 22 | + } | |
| 23 | + | |
| 24 | + .wrapper.ng-scope { | |
| 25 | + box-shadow: 1px 0px 20px 0 rgba(18, 86, 136, 0.41), 1px 3px 20px 0 rgba(18, 86, 136, 0.45); | |
| 26 | + background-position: -15px -18px; | |
| 27 | + border: 1px solid #125688; | |
| 28 | + border-radius: 5px 5px 0 0; | |
| 29 | + background: #fff; | |
| 30 | + } | |
| 31 | + | |
| 32 | + ::-webkit-scrollbar { | |
| 33 | + width: 16px; | |
| 34 | + height: 16px; | |
| 35 | + } | |
| 36 | + | |
| 37 | + ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb { | |
| 38 | + border-radius: 999px; | |
| 39 | + border: 5px solid transparent; | |
| 40 | + } | |
| 41 | + | |
| 42 | + ::-webkit-scrollbar-track { | |
| 43 | + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset; | |
| 44 | + } | |
| 45 | + | |
| 46 | + ::-webkit-scrollbar-thumb { | |
| 47 | + min-height: 20px; | |
| 48 | + background-clip: content-box; | |
| 49 | + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset; | |
| 50 | + } | |
| 51 | + | |
| 52 | + ::-webkit-scrollbar-corner { | |
| 53 | + background: transparent; | |
| 54 | + } | |
| 55 | + | |
| 56 | + input[type="checkbox"] { | |
| 57 | + vertical-align: bottom; | |
| 58 | + } | |
| 59 | + | |
| 60 | + .line-btn-list { | |
| 61 | + padding: 0 15px 15px 15px; | |
| 62 | + height: 180px; | |
| 63 | + overflow: auto; | |
| 64 | + } | |
| 65 | + | |
| 66 | + .line-btn-list-selected { | |
| 67 | + padding: 0 15px 15px 15px; | |
| 68 | + height: 35px; | |
| 69 | + overflow: auto; | |
| 70 | + } | |
| 71 | + | |
| 72 | + .line-btn-list span.line-item { | |
| 73 | + border: 1px solid #e0dfdf; | |
| 74 | + padding: 4px 9px; | |
| 75 | + margin: 5px; | |
| 76 | + -webkit-user-select: none; | |
| 77 | + user-select: none; | |
| 78 | + display: inline-block; | |
| 79 | + cursor: default; | |
| 80 | + transition: all .1s; | |
| 81 | + } | |
| 82 | + | |
| 83 | + .line-btn-list span.line-item.active { | |
| 84 | + background: #5E96D2; | |
| 85 | + border: 1px solid #5E96D2; | |
| 86 | + box-shadow: 0px 3px 4px 0 rgba(111, 172, 237, 0.3), 0px 3px 5px 0 rgba(111, 172, 237, 0.3); | |
| 87 | + color: #ffffff; | |
| 88 | + } | |
| 89 | + | |
| 90 | + input.i-cbox[type=checkbox] { | |
| 91 | + vertical-align: middle; | |
| 92 | + margin-top: -3px; | |
| 93 | + } | |
| 94 | + | |
| 95 | + .line-btn-list span.line-item.active input.i-cbox[type=checkbox] { | |
| 96 | + border: 0; | |
| 97 | + } | |
| 98 | + | |
| 99 | + .line-btn-list span.line-item.active input.i-cbox[type=checkbox]:checked:before { | |
| 100 | + color: #86f78b; | |
| 101 | + } | |
| 102 | + | |
| 103 | + .uk-panel-title { | |
| 104 | + text-indent: 15px; | |
| 105 | + } | |
| 106 | + | |
| 107 | + .line-btn-list-selected span.line-item { | |
| 108 | + padding: 4px 9px; | |
| 109 | + margin: 2px; | |
| 110 | + color: #fff; | |
| 111 | + background: #5e96d2; | |
| 112 | + box-shadow: 0px 3px 4px 0 rgba(111, 172, 237, 0.3), 0px 3px 5px 0 rgba(111, 172, 237, 0.3); | |
| 113 | + user-select: none; | |
| 114 | + display: inline-block; | |
| 115 | + cursor: move; | |
| 116 | + border-radius: 5px; | |
| 117 | + } | |
| 118 | + | |
| 119 | + #lineSearchInput { | |
| 120 | + width: 300px; | |
| 121 | + box-shadow: 0px 3px 4px 0 rgba(217, 226, 235, 0.3), 0px 3px 5px 0 rgba(200, 217, 236, 0.3); | |
| 122 | + height: 35px; | |
| 123 | + } | |
| 124 | + | |
| 125 | + #submitBtn { | |
| 126 | + border-radius: 0; | |
| 127 | + border-color: #00aff2; | |
| 128 | + transition: all .3s; | |
| 129 | + } | |
| 130 | + | |
| 131 | + #submitBtn:disabled { | |
| 132 | + border-color: #ebe9e9; | |
| 133 | + } | |
| 134 | + | |
| 135 | + .top-tools { | |
| 136 | + height: 55px; | |
| 137 | + position: relative; | |
| 138 | + background-image: linear-gradient(to bottom, #125688, #14517b); | |
| 139 | + } | |
| 140 | + | |
| 141 | + .icon-span { | |
| 142 | + padding: 6px 13px 10px 13px; | |
| 143 | + cursor: default; | |
| 144 | + -webkit-app-region: no-drag; | |
| 145 | + } | |
| 146 | + | |
| 147 | + .icon-span:hover { | |
| 148 | + background: rgba(255, 255, 255, 0.29); | |
| 149 | + border-radius: 3px; | |
| 150 | + } | |
| 151 | + | |
| 152 | + .icon-span.close-icon:hover { | |
| 153 | + background: rgb(255, 118, 118); | |
| 154 | + } | |
| 155 | + | |
| 156 | + div.title { | |
| 157 | + font-size: 18px; | |
| 158 | + color: #e1e0e0; | |
| 159 | + text-indent: 15px; | |
| 160 | + padding-top: 15px; | |
| 161 | + } | |
| 162 | + </style> | |
| 163 | +</head> | |
| 164 | + | |
| 165 | +<body> | |
| 166 | +<div class="wrapper ng-scope"> | |
| 167 | + <div class="top-tools" style="-webkit-app-region: drag"> | |
| 168 | + <div class="title"> | |
| 169 | + 选择线路 | |
| 170 | + </div> | |
| 171 | + <div style="position: absolute;right: 5px;top: 10px;"> | |
| 172 | + <span class="icon-span" id="mnavbarIconBtnMIN"> | |
| 173 | + <img src="/real_control_v2/electron/imgs/minus.png"> | |
| 174 | + </span> | |
| 175 | + <span class="icon-span close-icon" id="mnavbarIconBtnCLOSE"> | |
| 176 | + <img src="/real_control_v2/electron/imgs/remove.png"> | |
| 177 | + </span> | |
| 178 | + </div> | |
| 179 | + </div> | |
| 180 | + <div class="dialog dialog-shadow"> | |
| 181 | + <form class="uk-form" style="width: 100%;"> | |
| 182 | + <div class="uk-grid"> | |
| 183 | + | |
| 184 | + <div class="uk-width-medium-1-1"> | |
| 185 | + <div class="uk-panel uk-panel-divider"> | |
| 186 | + <div class="uk-form-row"> | |
| 187 | + <div class="uk-form-icon" style="margin: 15px;"> | |
| 188 | + <i class="uk-icon-search"></i> | |
| 189 | + <input type="text" placeholder="搜索线路..." id="lineSearchInput"> | |
| 190 | + </div> | |
| 191 | + </div> | |
| 192 | + <h3 class="uk-panel-title">待选择的线路</h3> | |
| 193 | + <div class="line-btn-list"> | |
| 194 | + </div> | |
| 195 | + </div> | |
| 196 | + <div class="uk-panel uk-panel-divider"> | |
| 197 | + <h3 class="uk-panel-title">已选择的线路</h3> | |
| 198 | + <div class="line-btn-list-selected uk-sortable" data-uk-sortable data-uk-observe> | |
| 199 | + </div> | |
| 200 | + <button disabled class="uk-button uk-button-primary uk-button-large uk-width-1-1" type="button" | |
| 201 | + id="submitBtn">确定 | |
| 202 | + </button> | |
| 203 | + </div> | |
| 204 | + </div> | |
| 205 | + | |
| 206 | + </div> | |
| 207 | + </form> | |
| 208 | + | |
| 209 | + </div> | |
| 210 | +</div> | |
| 211 | + | |
| 212 | +<script> | |
| 213 | + delete window.exports; | |
| 214 | + delete window.module; | |
| 215 | +</script> | |
| 216 | +<!-- jQuery --> | |
| 217 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | |
| 218 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script> | |
| 219 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.min.js"></script> | |
| 220 | +<script src="/assets/plugins/pinyin.js"></script> | |
| 221 | +<script src="/real_control_v2/js/common.js"></script> | |
| 222 | + | |
| 223 | +<!-- EventProxy --> | |
| 224 | +<script src="/assets/js/eventproxy.js"></script> | |
| 225 | +<script> | |
| 226 | + if (typeof(process) == 'undefined' || !process) { | |
| 227 | + alert('不支持当前环境!!'); | |
| 228 | + } | |
| 229 | + | |
| 230 | + const ipcMain = require('electron').ipcRenderer | |
| 231 | + | |
| 232 | + !function () { | |
| 233 | + var all = {}; | |
| 234 | + //线路编码映射 | |
| 235 | + var lineIdMap = {}; | |
| 236 | + var storage = window.localStorage; | |
| 237 | + | |
| 238 | + var auth; | |
| 239 | + gb_common.$get('/line/all', {destroy_eq: 0}, function (list) { | |
| 240 | + | |
| 241 | + //用户分配的线路 | |
| 242 | + $.get('/realControAuthority/findByCurrentUser', function (t) { | |
| 243 | + auth = t; | |
| 244 | + var newArray = [], authArray = t.lineCodeStr.split(','); | |
| 245 | + | |
| 246 | + $.each(list, function () { | |
| 247 | + if (this.lineCode && authArray.indexOf(this.lineCode) != -1) { | |
| 248 | + newArray.push(this); | |
| 249 | + } | |
| 250 | + }); | |
| 251 | + | |
| 252 | + var htmlStr = ''; | |
| 253 | + $.each(newArray, function () { | |
| 254 | + htmlStr += '<span class="line-item" data-name="' + this.name + '" data-code="' + this.lineCode + '">' + | |
| 255 | + ' <input class="i-cbox" type="checkbox"> ' + this.name + | |
| 256 | + '</span>'; | |
| 257 | + | |
| 258 | + //拼音首字母 | |
| 259 | + this.camelChars = pinyin.getCamelChars(this.name); | |
| 260 | + //全拼 | |
| 261 | + this.fullChars = pinyin.getFullChars(this.name).toUpperCase(); | |
| 262 | + | |
| 263 | + lineIdMap[this.lineCode] = this; | |
| 264 | + }); | |
| 265 | + all = list; | |
| 266 | + | |
| 267 | + $('.line-btn-list').html(htmlStr); | |
| 268 | + | |
| 269 | + $('.line-btn-list .line-item').on('click', function () { | |
| 270 | + var box = $(this).find('input[type=checkbox]')[0]; | |
| 271 | + if ($(this).hasClass('active')) { | |
| 272 | + $(this).removeClass('active'); | |
| 273 | + box.checked = false; | |
| 274 | + | |
| 275 | + removeSelected(this); | |
| 276 | + } | |
| 277 | + else { | |
| 278 | + $(this).addClass('active'); | |
| 279 | + box.checked = true; | |
| 280 | + | |
| 281 | + addSelected(this); | |
| 282 | + } | |
| 283 | + }); | |
| 284 | + }); | |
| 285 | + }); | |
| 286 | + | |
| 287 | + | |
| 288 | + $('#lineSearchInput').on('input', function () { | |
| 289 | + var t = $(this).val().toUpperCase(); | |
| 290 | + if (!t) { | |
| 291 | + $('.line-btn-list .line-item').show(); | |
| 292 | + return; | |
| 293 | + } | |
| 294 | + | |
| 295 | + var rs = []; | |
| 296 | + $.each(all, function () { | |
| 297 | + try { | |
| 298 | + if (this.camelChars.indexOf(t) != -1 | |
| 299 | + || this.fullChars.indexOf(t) != -1 | |
| 300 | + || this.name.indexOf(t) != -1) { | |
| 301 | + rs.push(this.lineCode); | |
| 302 | + } | |
| 303 | + } catch (e) { | |
| 304 | + } | |
| 305 | + }); | |
| 306 | + | |
| 307 | + $('.line-btn-list .line-item').hide().each(function () { | |
| 308 | + var code = $(this).data('code') + ''; | |
| 309 | + if (rs.indexOf(code) != -1) | |
| 310 | + $(this).show(); | |
| 311 | + }); | |
| 312 | + }); | |
| 313 | + | |
| 314 | + function addSelected(that) { | |
| 315 | + $('.line-btn-list-selected').append('<span class="line-item" data-code="' + $(that).data('code') + '">' + $(that).data('name') + '</span>'); | |
| 316 | + | |
| 317 | + $('#submitBtn').removeAttr('disabled'); | |
| 318 | + } | |
| 319 | + | |
| 320 | + function removeSelected(that) { | |
| 321 | + var code = $(that).data('code'); | |
| 322 | + $('.line-btn-list-selected .line-item[data-code=' + code + ']').remove(); | |
| 323 | + | |
| 324 | + if ($('.line-btn-list-selected .line-item').length == 0) { | |
| 325 | + $('#submitBtn').attr('disabled', 'disabled'); | |
| 326 | + } | |
| 327 | + } | |
| 328 | + | |
| 329 | + function error(rs) { | |
| 330 | + return rs.status == 'ERROR' || rs.status == 500; | |
| 331 | + } | |
| 332 | + | |
| 333 | + /** | |
| 334 | + * 确定 | |
| 335 | + */ | |
| 336 | + $('#submitBtn').on('click', function () { | |
| 337 | + var ep = EventProxy.create('car2DeviceId', 'routes', 'checkLineConfig', function () { | |
| 338 | + ipcMain.send('webPageGotoControl'); | |
| 339 | + }); | |
| 340 | + | |
| 341 | + var lsData = [], codeStr = '', code; | |
| 342 | + $('.line-btn-list-selected .line-item').each(function () { | |
| 343 | + code = $(this).data('code'); | |
| 344 | + lsData.push(lineIdMap[code]); | |
| 345 | + codeStr += (code + ','); | |
| 346 | + }); | |
| 347 | + //将选择的线路信息写入localstorage | |
| 348 | + storage.setItem('lineControlItems', JSON.stringify(lsData)); | |
| 349 | + | |
| 350 | + //缓存车辆自编号和设备号对照 | |
| 351 | + $.get('/gps/Car2DeviceId', function (rs) { | |
| 352 | + storage.setItem('car2DeviceId', JSON.stringify(rs)); | |
| 353 | + ep.emitLater('car2DeviceId'); | |
| 354 | + }); | |
| 355 | + | |
| 356 | + //监控模式还是主调模式 | |
| 357 | + storage.setItem('operationMode', auth.pattern); | |
| 358 | + | |
| 359 | + //缓存线路路由 | |
| 360 | + codeStr = codeStr.substr(0, codeStr.length - 1); | |
| 361 | + $.get('/realMap/multiRouteByLine', {codeStr: codeStr}, function (rs) { | |
| 362 | + for (var key in rs) { | |
| 363 | + storage.setItem(key, JSON.stringify(rs[key])); | |
| 364 | + } | |
| 365 | + ep.emitLater('routes'); | |
| 366 | + }); | |
| 367 | + | |
| 368 | + //检查线路配置信息 | |
| 369 | + $.ajax({ | |
| 370 | + url: '/lineConfig/check', | |
| 371 | + traditional: true, | |
| 372 | + data: {codeArray: codeStr.split(',')}, | |
| 373 | + method: 'POST', | |
| 374 | + success: function (rs) { | |
| 375 | + if (rs.status == 0) { | |
| 376 | + ep.emitLater('checkLineConfig'); | |
| 377 | + } | |
| 378 | + else if (rs.status == 1) { | |
| 379 | + initLineConfig(rs.not, function () { | |
| 380 | + ep.emitLater('checkLineConfig'); | |
| 381 | + }); | |
| 382 | + } | |
| 383 | + } | |
| 384 | + }); | |
| 385 | + }); | |
| 386 | + | |
| 387 | + | |
| 388 | + function initLineConfig(arr, cb) { | |
| 389 | + var i = 0; | |
| 390 | + (function () { | |
| 391 | + if (i >= arr.length) { | |
| 392 | + cb && cb(); | |
| 393 | + return; | |
| 394 | + } | |
| 395 | + var f = arguments.callee | |
| 396 | + , lineCode = arr[i]; | |
| 397 | + | |
| 398 | + $.post('/lineConfig/init/' + lineCode, function (rs) { | |
| 399 | + if (rs == 1) { | |
| 400 | + i++; | |
| 401 | + f(); | |
| 402 | + } | |
| 403 | + }); | |
| 404 | + })(); | |
| 405 | + } | |
| 406 | + }(); | |
| 407 | +</script> | |
| 408 | +</body> | |
| 348 | 409 | </html> |
| 349 | 410 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
| ... | ... | @@ -120,11 +120,11 @@ |
| 120 | 120 | </li> |
| 121 | 121 | {{/each}} |
| 122 | 122 | </ul> |
| 123 | - <div class="uk-navbar-content uk-navbar-flip uk-hidden-small"> | |
| 123 | + <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;"> | |
| 124 | 124 | <div class="icon-item" id="mnavbarIconBtnMIN" data-uk-tooltip="{pos:'bottom'}" title="最小化"> |
| 125 | 125 | <img src="/real_control_v2/assets/imgs/icon/minus.png"> |
| 126 | 126 | </div> |
| 127 | - | |
| 127 | + | |
| 128 | 128 | <div class="icon-item" id="mnavbarIconBtnCLOSE" data-uk-tooltip="{pos:'bottom'}" title="退出系统"> |
| 129 | 129 | <img src="/real_control_v2/assets/imgs/icon/remove.png"> |
| 130 | 130 | </div> | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_basic.js
| ... | ... | @@ -164,7 +164,7 @@ var gb_data_basic = (function () { |
| 164 | 164 | //是否是环线 |
| 165 | 165 | isLoopLine: function (lineCode) { |
| 166 | 166 | var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); |
| 167 | - //如果上行起终点距离50米内 并且下行只有2个站点 | |
| 167 | + //下行只有2个站点 | |
| 168 | 168 | var len = data[0].length; |
| 169 | 169 | if (len > 0 && data[1].length == 2) { |
| 170 | 170 | var first = data[0][0], |
| ... | ... | @@ -176,7 +176,8 @@ var gb_data_basic = (function () { |
| 176 | 176 | var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} |
| 177 | 177 | , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; |
| 178 | 178 | |
| 179 | - if (geolib.getDistance(fPoint, ePoint) < 40) { | |
| 179 | + //并且上行起终点距离200米内 | |
| 180 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 180 | 181 | return true; |
| 181 | 182 | } |
| 182 | 183 | } | ... | ... |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
| ... | ... | @@ -65,7 +65,7 @@ |
| 65 | 65 | ] |
| 66 | 66 | }, |
| 67 | 67 | { |
| 68 | - "id": 1, | |
| 68 | + "id": 2, | |
| 69 | 69 | "text": "报表管理", |
| 70 | 70 | "clazz": "dropdown-column-2-lg", |
| 71 | 71 | "columns": true, |
| ... | ... | @@ -78,79 +78,79 @@ |
| 78 | 78 | "header": 1 |
| 79 | 79 | }, |
| 80 | 80 | { |
| 81 | - "id": 4.5, | |
| 81 | + "id": 2.2, | |
| 82 | 82 | "text": "月存油报表", |
| 83 | 83 | "event": "form_oilListMonth", |
| 84 | 84 | "icon": "uk-icon-table" |
| 85 | 85 | }, |
| 86 | 86 | { |
| 87 | - "id": 4.6, | |
| 87 | + "id": 2.3, | |
| 88 | 88 | "text": "时刻表分析", |
| 89 | 89 | "event": "form_scheduleAnaly", |
| 90 | 90 | "icon": "uk-icon-table" |
| 91 | 91 | }, |
| 92 | 92 | { |
| 93 | - "id": 4.7, | |
| 93 | + "id": 2.4, | |
| 94 | 94 | "text": "调度消息分析", |
| 95 | 95 | "event": "form_message", |
| 96 | 96 | "icon": "uk-icon-table" |
| 97 | 97 | }, |
| 98 | 98 | { |
| 99 | - "id": 4.8, | |
| 99 | + "id": 2.5, | |
| 100 | 100 | "text": "指令状态分析", |
| 101 | 101 | "event": "form_commandState", |
| 102 | 102 | "icon": "uk-icon-table" |
| 103 | 103 | }, |
| 104 | 104 | { |
| 105 | - "id": 4.9, | |
| 105 | + "id": 2.6, | |
| 106 | 106 | "text": "线路首末班查询", |
| 107 | 107 | "event": "form_firstAndLastBus", |
| 108 | 108 | "icon": "uk-icon-table" |
| 109 | 109 | }, |
| 110 | 110 | { |
| 111 | - "id": 5.0, | |
| 111 | + "id": 2.7, | |
| 112 | 112 | "text": "路单数据", |
| 113 | 113 | "event": "form_singledata", |
| 114 | 114 | "icon": "uk-icon-table" |
| 115 | 115 | }, |
| 116 | 116 | { |
| 117 | - "id": 5.1, | |
| 117 | + "id": 2.8, | |
| 118 | 118 | "text": "车辆加注", |
| 119 | 119 | "event": "form_vehicleloading", |
| 120 | 120 | "icon": "uk-icon-table" |
| 121 | 121 | }, |
| 122 | 122 | { |
| 123 | - "id": 5.2, | |
| 123 | + "id": 2.9, | |
| 124 | 124 | "text": "运营服务阶段报表", |
| 125 | 125 | "event": "form_operationservice", |
| 126 | 126 | "icon": "uk-icon-table" |
| 127 | 127 | }, |
| 128 | 128 | { |
| 129 | - "id": 5.3, | |
| 129 | + "id": 3.0, | |
| 130 | 130 | "text": "线路客流量报表", |
| 131 | 131 | "event": "form_linepassengerflow", |
| 132 | 132 | "icon": "uk-icon-table" |
| 133 | 133 | }, |
| 134 | 134 | { |
| 135 | - "id": 5.4, | |
| 135 | + "id": 3.1, | |
| 136 | 136 | "text": "换人换车情况统计表", |
| 137 | 137 | "event": "form_changetochange", |
| 138 | 138 | "icon": "uk-icon-table" |
| 139 | 139 | }, |
| 140 | 140 | { |
| 141 | - "id": 5.5, | |
| 141 | + "id": 3.2, | |
| 142 | 142 | "text": "营运线路出车率统计表", |
| 143 | 143 | "event": "form_turnoutrate", |
| 144 | 144 | "icon": "uk-icon-table" |
| 145 | 145 | }, |
| 146 | 146 | { |
| 147 | - "id": 5.6, | |
| 147 | + "id": 3.3, | |
| 148 | 148 | "text": "班次执行率统计表", |
| 149 | 149 | "event": "form_executionrate", |
| 150 | 150 | "icon": "uk-icon-table" |
| 151 | 151 | }, |
| 152 | 152 | { |
| 153 | - "id": 5.6, | |
| 153 | + "id": 3.4, | |
| 154 | 154 | "text": "营运线路名称统计表", |
| 155 | 155 | "event": "form_allline", |
| 156 | 156 | "icon": "uk-icon-table" |
| ... | ... | @@ -158,84 +158,84 @@ |
| 158 | 158 | ], |
| 159 | 159 | [ |
| 160 | 160 | { |
| 161 | - "id": 3.1, | |
| 161 | + "id": 4.1, | |
| 162 | 162 | "text": "报表管理", |
| 163 | 163 | "header": 1 |
| 164 | 164 | }, |
| 165 | 165 | { |
| 166 | - "id": 3.2, | |
| 166 | + "id": 4.2, | |
| 167 | 167 | "text": "行车路单", |
| 168 | 168 | "event": "form_waybill", |
| 169 | 169 | "icon": "uk-icon-table" |
| 170 | 170 | }, |
| 171 | 171 | { |
| 172 | - "id": 3.3, | |
| 172 | + "id": 4.3, | |
| 173 | 173 | "text": "调度历史消息", |
| 174 | 174 | "event": "form_history_message", |
| 175 | 175 | "icon": "uk-icon-table" |
| 176 | 176 | }, |
| 177 | 177 | { |
| 178 | - "id": 3.4, | |
| 178 | + "id": 4.4, | |
| 179 | 179 | "text": "驾驶员请求台账", |
| 180 | 180 | "event": "form_account", |
| 181 | 181 | "icon": "uk-icon-table" |
| 182 | 182 | }, |
| 183 | 183 | { |
| 184 | - "id": 3.5, | |
| 184 | + "id": 4.5, | |
| 185 | 185 | "text": "班次日报表", |
| 186 | 186 | "event": "form_daily", |
| 187 | 187 | "icon": "uk-icon-table" |
| 188 | 188 | }, |
| 189 | 189 | { |
| 190 | - "id": 3.6, | |
| 190 | + "id": 4.6, | |
| 191 | 191 | "text": "修正报表", |
| 192 | 192 | "event": "form_correctForm", |
| 193 | 193 | "icon": "uk-icon-table" |
| 194 | 194 | }, |
| 195 | 195 | { |
| 196 | - "id": 3.7, | |
| 196 | + "id": 4.7, | |
| 197 | 197 | "text": "统计日报", |
| 198 | 198 | "event": "form_statisticsDaily", |
| 199 | 199 | "icon": "uk-icon-table" |
| 200 | 200 | }, |
| 201 | 201 | { |
| 202 | - "id": 3.8, | |
| 202 | + "id": 4.8, | |
| 203 | 203 | "text": "调度日报", |
| 204 | 204 | "event": "form_scheduleDaily", |
| 205 | 205 | "icon": "uk-icon-table" |
| 206 | 206 | }, |
| 207 | 207 | { |
| 208 | - "id": 3.9, | |
| 208 | + "id": 4.9, | |
| 209 | 209 | "text": "行车路单日报表", |
| 210 | 210 | "event": "form_waybillday", |
| 211 | 211 | "icon": "uk-icon-table" |
| 212 | 212 | }, |
| 213 | 213 | { |
| 214 | - "id": 4.0, | |
| 214 | + "id": 5.0, | |
| 215 | 215 | "text": "班次到离站", |
| 216 | 216 | "event": "form_inoutstation", |
| 217 | 217 | "icon": "uk-icon-table" |
| 218 | 218 | }, |
| 219 | 219 | { |
| 220 | - "id": 4.1, | |
| 220 | + "id": 5.1, | |
| 221 | 221 | "text": "班次车辆人员日报表", |
| 222 | 222 | "event": "form_shifday", |
| 223 | 223 | "icon": "uk-icon-table" |
| 224 | 224 | }, |
| 225 | 225 | { |
| 226 | - "id": 4.2, | |
| 226 | + "id": 5.2, | |
| 227 | 227 | "text": "班次车辆人员月报表", |
| 228 | 228 | "event": "form_shiftuehiclemanth", |
| 229 | 229 | "icon": "uk-icon-table" |
| 230 | 230 | }, |
| 231 | 231 | { |
| 232 | - "id": 4.3, | |
| 232 | + "id": 5.3, | |
| 233 | 233 | "text": "营运服务日报表", |
| 234 | 234 | "event": "form_workDaily", |
| 235 | 235 | "icon": "uk-icon-table" |
| 236 | 236 | }, |
| 237 | 237 | { |
| 238 | - "id": 4.4, | |
| 238 | + "id": 5.4, | |
| 239 | 239 | "text": "计划车辆班次人员", |
| 240 | 240 | "event": "form_peopleCarPlan", |
| 241 | 241 | "icon": "uk-icon-table" |
| ... | ... | @@ -244,47 +244,47 @@ |
| 244 | 244 | ] |
| 245 | 245 | }, |
| 246 | 246 | { |
| 247 | - "id": 2, | |
| 247 | + "id": 3, | |
| 248 | 248 | "text": "车载设备", |
| 249 | 249 | "children": [ |
| 250 | 250 | { |
| 251 | - "id": 2.1, | |
| 251 | + "id": 3.1, | |
| 252 | 252 | "text": "设备管理", |
| 253 | 253 | "event": "all_devices" |
| 254 | 254 | }, |
| 255 | 255 | { |
| 256 | - "id": 2.3, | |
| 256 | + "id": 3.2, | |
| 257 | 257 | "text": "指令下发记录", |
| 258 | 258 | "event": "directive_history" |
| 259 | 259 | }, |
| 260 | 260 | { |
| 261 | - "id": 2.2, | |
| 261 | + "id": 3.3, | |
| 262 | 262 | "text": "设备上报记录", |
| 263 | 263 | "event": "device_report" |
| 264 | 264 | }, |
| 265 | 265 | { |
| 266 | - "id": 2.3, | |
| 266 | + "id": 3.4, | |
| 267 | 267 | "text": "轨迹回放", |
| 268 | 268 | "event": "gps_play_back" |
| 269 | 269 | } |
| 270 | 270 | ] |
| 271 | 271 | }, |
| 272 | 272 | { |
| 273 | - "id": 3, | |
| 273 | + "id": 4, | |
| 274 | 274 | "text": "系统设置", |
| 275 | 275 | "children": [ |
| 276 | 276 | { |
| 277 | - "id": 3.1, | |
| 277 | + "id": 4.1, | |
| 278 | 278 | "text": "线路配置", |
| 279 | 279 | "event": "line_config" |
| 280 | 280 | }, |
| 281 | 281 | { |
| 282 | - "id": 3.2, | |
| 282 | + "id": 4.2, | |
| 283 | 283 | "text": "TTS", |
| 284 | 284 | "event": "tts_config" |
| 285 | 285 | }, |
| 286 | 286 | { |
| 287 | - "id": 3.3, | |
| 287 | + "id": 4.3, | |
| 288 | 288 | "text": "信号标记", |
| 289 | 289 | "event": "signal_state" |
| 290 | 290 | } | ... | ... |
src/main/resources/static/real_control_v2/js/forms/form_embed.js
| 1 | -/** | |
| 2 | - * 嵌入表单片段 处理模块 | |
| 3 | - * | |
| 4 | - */ | |
| 5 | - | |
| 6 | -var gb_embed_form_hanlde = (function () { | |
| 7 | - | |
| 8 | - | |
| 9 | - var temps; | |
| 10 | - $.get('/real_control_v2/js/forms/temps.html', function (dom) { | |
| 11 | - temps = gb_common.compileTempByDom(dom, {escape: false}); | |
| 12 | - }); | |
| 13 | - | |
| 14 | - //setTimeout(loadPlugins, 5000); | |
| 15 | - | |
| 16 | - return { | |
| 17 | - temps: function () { | |
| 18 | - return temps; | |
| 19 | - } | |
| 20 | - } | |
| 21 | -})(); | |
| 22 | - | |
| 23 | -/** | |
| 24 | - * 打开表单片段 | |
| 25 | - * @param pageUrl | |
| 26 | - */ | |
| 27 | -var open_modal_form_fragment = function (pageUrl, title) { | |
| 28 | - //将片段路径写入 localStorage | |
| 29 | - window.localStorage.setItem('real_control_form_embed_pageUrl', pageUrl); | |
| 30 | - //包裹页面 | |
| 31 | - var wrapUrl = '/real_control_v2/js/forms/wrap.html?origin=real_control_iframe'; | |
| 32 | - //modal ID | |
| 33 | - var id = '#formFragmentModal'; | |
| 34 | - | |
| 35 | - var htmlStr = gb_embed_form_hanlde.temps()['forms-embed-modal-temp']({pageUrl: wrapUrl, title: title}); | |
| 36 | - $(document.body).append(htmlStr); | |
| 37 | - UIkit.modal(id, {bgclose: false}).show(); | |
| 38 | -}; | |
| 39 | - | |
| 40 | - | |
| 41 | -/*function setIframeHeight(iframe) { | |
| 42 | - setTimeout(function () { | |
| 43 | - if (iframe) { | |
| 44 | - var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow; | |
| 45 | - if (iframeWin.document.body) { | |
| 46 | - iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight; | |
| 47 | - } | |
| 48 | - } | |
| 49 | - }, 800); | |
| 50 | -};*/ | |
| 1 | +/** | |
| 2 | + * 嵌入表单片段 处理模块 | |
| 3 | + * | |
| 4 | + */ | |
| 5 | + | |
| 6 | +var gb_embed_form_hanlde = (function () { | |
| 7 | + | |
| 8 | + | |
| 9 | + var temps; | |
| 10 | + $.get('/real_control_v2/js/forms/temps.html', function (dom) { | |
| 11 | + temps = gb_common.compileTempByDom(dom, {escape: false}); | |
| 12 | + }); | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * 打开表单片段 | |
| 16 | + * @param pageUrl | |
| 17 | + */ | |
| 18 | + var open_modal_form_fragment = function (pageUrl, title) { | |
| 19 | + //modal ID | |
| 20 | + var id = '#formFragmentModal'; | |
| 21 | + | |
| 22 | + if($(id+'.uk-modal').length > 0){ | |
| 23 | + $(id).remove(); | |
| 24 | + } | |
| 25 | + | |
| 26 | + //将片段路径写入 localStorage | |
| 27 | + window.localStorage.setItem('real_control_form_embed_pageUrl', pageUrl); | |
| 28 | + //包裹页面 | |
| 29 | + var wrapUrl = '/real_control_v2/js/forms/wrap.html?origin=real_control_iframe'; | |
| 30 | + var htmlStr = gb_embed_form_hanlde.temps()['forms-embed-modal-temp']({pageUrl: wrapUrl, title: title}); | |
| 31 | + $(document.body).append(htmlStr); | |
| 32 | + UIkit.modal(id, {bgclose: false}).show(); | |
| 33 | + }; | |
| 34 | + | |
| 35 | + return { | |
| 36 | + temps: function () { | |
| 37 | + return temps; | |
| 38 | + }, | |
| 39 | + open_modal_form_fragment: open_modal_form_fragment | |
| 40 | + } | |
| 41 | +})(); | |
| 51 | 42 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -100,82 +100,82 @@ var gb_northToolbar = (function () { |
| 100 | 100 | open_modal('/real_control_v2/fragments/north/nav/cache_data/list.html', {}, modal_opts); |
| 101 | 101 | }, |
| 102 | 102 | form_waybill: function () { |
| 103 | - open_modal_form_fragment('/pages/forms/statement/waybill.html', '行车路单'); | |
| 103 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/waybill.html', '行车路单'); | |
| 104 | 104 | }, |
| 105 | 105 | form_history_message: function () { |
| 106 | - open_modal_form_fragment('/pages/forms/statement/historyMessage.html', '调度历史消息'); | |
| 106 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/historyMessage.html', '调度历史消息'); | |
| 107 | 107 | }, |
| 108 | 108 | form_account: function () { |
| 109 | - open_modal_form_fragment('/pages/forms/statement/account.html', '驾驶员请求台账'); | |
| 109 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/account.html', '驾驶员请求台账'); | |
| 110 | 110 | }, |
| 111 | 111 | form_daily: function () { |
| 112 | - open_modal_form_fragment('/pages/forms/statement/daily.html', '班次日报表'); | |
| 112 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/daily.html', '班次日报表'); | |
| 113 | 113 | }, |
| 114 | 114 | form_correctForm: function () { |
| 115 | - open_modal_form_fragment('/pages/forms/statement/correctForm.html', '修正报表'); | |
| 115 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/correctForm.html', '修正报表'); | |
| 116 | 116 | }, |
| 117 | 117 | form_statisticsDaily: function () { |
| 118 | - open_modal_form_fragment('/pages/forms/statement/statisticsDaily.html', '统计日报'); | |
| 118 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/statisticsDaily.html', '统计日报'); | |
| 119 | 119 | }, |
| 120 | 120 | form_scheduleDaily: function () { |
| 121 | - open_modal_form_fragment('/pages/forms/statement/scheduleDaily.html', '调度日报'); | |
| 121 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/scheduleDaily.html', '调度日报'); | |
| 122 | 122 | }, |
| 123 | 123 | form_waybillday: function () { |
| 124 | - open_modal_form_fragment('/pages/forms/statement/waybillday.html', '行车路单日报表'); | |
| 124 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/waybillday.html', '行车路单日报表'); | |
| 125 | 125 | }, |
| 126 | 126 | form_inoutstation: function () { |
| 127 | - open_modal_form_fragment('/pages/report/inoutstation.html', '班次到离站'); | |
| 127 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/report/inoutstation.html', '班次到离站'); | |
| 128 | 128 | }, |
| 129 | 129 | form_shifday: function () { |
| 130 | - open_modal_form_fragment('/pages/mforms/shifdays/shifday.html', '班次车辆人员日报表'); | |
| 130 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/shifdays/shifday.html', '班次车辆人员日报表'); | |
| 131 | 131 | }, |
| 132 | 132 | form_shiftuehiclemanth: function () { |
| 133 | - open_modal_form_fragment('/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html', '班次车辆人员月报表'); | |
| 133 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html', '班次车辆人员月报表'); | |
| 134 | 134 | }, |
| 135 | 135 | form_workDaily: function () { |
| 136 | - open_modal_form_fragment('/pages/forms/statement/workDaily.html', '营运服务日报表'); | |
| 136 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/workDaily.html', '营运服务日报表'); | |
| 137 | 137 | }, |
| 138 | 138 | form_peopleCarPlan: function () { |
| 139 | - open_modal_form_fragment('/pages/forms/statement/peopleCarPlan.html', '计划车辆班次人员'); | |
| 139 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/peopleCarPlan.html', '计划车辆班次人员'); | |
| 140 | 140 | }, |
| 141 | 141 | form_oilListMonth: function () { |
| 142 | - open_modal_form_fragment('/pages/report/oil/oilListMonth.html', '月存油报表'); | |
| 142 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/report/oil/oilListMonth.html', '月存油报表'); | |
| 143 | 143 | }, |
| 144 | 144 | form_scheduleAnaly: function () { |
| 145 | - open_modal_form_fragment('/pages/forms/statement/scheduleAnaly.html', '时刻表分析'); | |
| 145 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/scheduleAnaly.html', '时刻表分析'); | |
| 146 | 146 | }, |
| 147 | 147 | form_message: function () { |
| 148 | - open_modal_form_fragment('/pages/report/message/message.html', '调度消息分析'); | |
| 148 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/report/message/message.html', '调度消息分析'); | |
| 149 | 149 | }, |
| 150 | 150 | form_commandState: function () { |
| 151 | - open_modal_form_fragment('/pages/forms/statement/commandState.html', '指令状态分析'); | |
| 151 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/commandState.html', '指令状态分析'); | |
| 152 | 152 | }, |
| 153 | 153 | form_firstAndLastBus: function () { |
| 154 | - open_modal_form_fragment('/pages/forms/statement/firstAndLastBus.html', '线路首末班查询'); | |
| 154 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/firstAndLastBus.html', '线路首末班查询'); | |
| 155 | 155 | }, |
| 156 | 156 | form_singledata: function () { |
| 157 | - open_modal_form_fragment('/pages/mforms/singledatas/singledata.html', '路单数据'); | |
| 157 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/singledatas/singledata.html', '路单数据'); | |
| 158 | 158 | }, |
| 159 | 159 | form_vehicleloading: function () { |
| 160 | - open_modal_form_fragment('/pages/mforms/vehicleloadings/vehicleloading.html', '车辆加注'); | |
| 160 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/vehicleloadings/vehicleloading.html', '车辆加注'); | |
| 161 | 161 | }, |
| 162 | 162 | form_operationservice: function () { |
| 163 | - open_modal_form_fragment('/pages/mforms/operationservices/operationservice.html', '运营服务阶段报表'); | |
| 163 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/operationservices/operationservice.html', '运营服务阶段报表'); | |
| 164 | 164 | }, |
| 165 | 165 | form_linepassengerflow: function () { |
| 166 | - open_modal_form_fragment('/pages/mforms/linepassengerflows/linepassengerflow.html', '线路客流量报表'); | |
| 166 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/linepassengerflows/linepassengerflow.html', '线路客流量报表'); | |
| 167 | 167 | }, |
| 168 | 168 | form_changetochange: function () { |
| 169 | - open_modal_form_fragment('/pages/mforms/changetochanges/changetochange.html', '换人换车情况统计表'); | |
| 169 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/changetochanges/changetochange.html', '换人换车情况统计表'); | |
| 170 | 170 | }, |
| 171 | 171 | form_turnoutrate: function () { |
| 172 | - open_modal_form_fragment('/pages/mforms/changetochanges/turnoutrate.html', '营运线路出车率统计表'); | |
| 172 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/changetochanges/turnoutrate.html', '营运线路出车率统计表'); | |
| 173 | 173 | }, |
| 174 | 174 | form_executionrate: function () { |
| 175 | - open_modal_form_fragment('/pages/mforms/executionrates/executionrate.html', '班次执行率统计表'); | |
| 175 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/executionrates/executionrate.html', '班次执行率统计表'); | |
| 176 | 176 | }, |
| 177 | 177 | form_allline: function () { |
| 178 | - open_modal_form_fragment('/pages/mforms/alllines/allline.html', '营运线路名称统计表'); | |
| 178 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/mforms/alllines/allline.html', '营运线路名称统计表'); | |
| 179 | 179 | } |
| 180 | 180 | }; |
| 181 | 181 | ... | ... |