Commit 04da1a79eb7b41deb19a199c31ccb8128385d147

Authored by 徐烜
2 parents 73f39937 931d141f

Merge branch 'minhang' into pudong

Showing 23 changed files with 956 additions and 122 deletions
src/main/java/com/bsth/controller/SectionRouteController.java
@@ -35,6 +35,16 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer @@ -35,6 +35,16 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer
35 @Autowired 35 @Autowired
36 SectionRouteService routeService; 36 SectionRouteService routeService;
37 37
  38 + /**
  39 + * @param String
  40 + * @throws
  41 + * @Description: TODO(批量撤销路段)
  42 + */
  43 + @RequestMapping(value = "/batchDestroy", method = RequestMethod.GET)
  44 + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
  45 + return routeService.updateSectionRouteInfoFormId(map);
  46 + }
  47 +
38 /** 48 /**
39 * @param @param map 49 * @param @param map
40 * @throws 50 * @throws
src/main/java/com/bsth/controller/StationRouteController.java
@@ -47,6 +47,16 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer @@ -47,6 +47,16 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
47 return service.list(map); 47 return service.list(map);
48 } 48 }
49 49
  50 + /**
  51 + * @param String
  52 + * @throws
  53 + * @Description: TODO(批量撤销站点)
  54 + */
  55 + @RequestMapping(value = "/batchDestroy", method = RequestMethod.GET)
  56 + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
  57 + return service.updateStationRouteInfoFormId(map);
  58 + }
  59 +
50 /** 60 /**
51 * @Description :TODO(查询树站点与路段数据) 61 * @Description :TODO(查询树站点与路段数据)
52 * 62 *
src/main/java/com/bsth/controller/forms/ExportController.java
@@ -87,6 +87,7 @@ public class ExportController { @@ -87,6 +87,7 @@ public class ExportController {
87 public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map) { 87 public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map) {
88 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); 88 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
89 List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); 89 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  90 + Map<String, Object> map2 = new HashMap<String, Object>();
90 ReportUtils ee = new ReportUtils(); 91 ReportUtils ee = new ReportUtils();
91 List<Shifday> shifday = formsService.shifday(map); 92 List<Shifday> shifday = formsService.shifday(map);
92 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 93 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
@@ -110,11 +111,15 @@ public class ExportController { @@ -110,11 +111,15 @@ public class ExportController {
110 m.put("sjbc", l.getSjbc()); 111 m.put("sjbc", l.getSjbc());
111 resList.add(m); 112 resList.add(m);
112 } 113 }
  114 + if(resList.size() > 0){
  115 + map2 = resList.get(resList.size() - 1);
  116 + resList.remove(map2);
  117 + }
113 118
114 try { 119 try {
115 listI.add(resList.iterator()); 120 listI.add(resList.iterator());
116 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 121 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
117 - ee.excelReplace(listI, new Object[] { map }, path + "mould/shifday.xls", 122 + ee.excelReplace(listI, new Object[] { map2 }, path + "mould/shifday.xls",
118 path + "export/班次车辆人员日报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); 123 path + "export/班次车辆人员日报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
119 } catch (Exception e) { 124 } catch (Exception e) {
120 e.printStackTrace(); 125 e.printStackTrace();
src/main/java/com/bsth/repository/SectionRouteRepository.java
@@ -175,6 +175,10 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int @@ -175,6 +175,10 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
175 @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+10) where line = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true) 175 @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+10) where line = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true)
176 public void sectionUpdSectionRouteCode(Integer line,Integer dir,Integer routeCod); 176 public void sectionUpdSectionRouteCode(Integer line,Integer dir,Integer routeCod);
177 177
  178 + @Modifying
  179 + @Query(value="UPDATE bsth_c_sectionroute set destroy = 1 where id = ?1", nativeQuery=true)
  180 + public void sectionRouteIsDestroyUpdBatch(Integer ids);
  181 +
178 @Modifying 182 @Modifying
179 @Query(value="update bsth_c_sectionroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true) 183 @Query(value="update bsth_c_sectionroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true)
180 public void sectionRouteDir(Integer line); 184 public void sectionRouteDir(Integer line);
src/main/java/com/bsth/repository/StationRouteRepository.java
@@ -282,4 +282,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -282,4 +282,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
282 @Modifying 282 @Modifying
283 @Query(value="UPDATE bsth_c_stationroute set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true) 283 @Query(value="UPDATE bsth_c_stationroute set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true)
284 public void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod); 284 public void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod);
  285 +
  286 + @Modifying
  287 + @Query(value="UPDATE bsth_c_stationroute set destroy = 1 where id = ?1", nativeQuery=true)
  288 + public void stationRouteIsDestroyUpdBatch(Integer ids);
285 } 289 }
src/main/java/com/bsth/service/SectionRouteService.java
@@ -33,6 +33,15 @@ public interface SectionRouteService extends BaseService&lt;SectionRoute, Integer&gt; @@ -33,6 +33,15 @@ public interface SectionRouteService extends BaseService&lt;SectionRoute, Integer&gt;
33 List<Map<String, Object>> getSectionRoute(Map<String, Object> map); 33 List<Map<String, Object>> getSectionRoute(Map<String, Object> map);
34 34
35 /** 35 /**
  36 + * @Description : TODO(根据路段路由Id批量撤销路段)
  37 + *
  38 + * @param map <id:路段路由ID>
  39 + *
  40 + * @return List<Map<String, Object>>
  41 + */
  42 + Map<String, Object> updateSectionRouteInfoFormId(Map<String, Object> map);
  43 +
  44 + /**
36 * @Description : TODO(根据路段路由Id查询详情) 45 * @Description : TODO(根据路段路由Id查询详情)
37 * 46 *
38 * @param map <id:路段路由ID> 47 * @param map <id:路段路由ID>
src/main/java/com/bsth/service/StationRouteService.java
@@ -31,6 +31,15 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt; @@ -31,6 +31,15 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
31 Iterable<StationRoute> list(Map<String, Object> map); 31 Iterable<StationRoute> list(Map<String, Object> map);
32 32
33 /** 33 /**
  34 + * @Description : TODO(根据路段站点Id批量撤销站点)
  35 + *
  36 + * @param map <id:站点路由ID>
  37 + *
  38 + * @return List<Map<String, Object>>
  39 + */
  40 + Map<String, Object> updateStationRouteInfoFormId(Map<String, Object> map);
  41 +
  42 + /**
34 * @Description :TODO(查询树站点与路段数据) 43 * @Description :TODO(查询树站点与路段数据)
35 * 44 *
36 * @param map <line.id_eq:线路ID; directions_eq:方向> 45 * @param map <line.id_eq:线路ID; directions_eq:方向>
@@ -92,4 +101,5 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt; @@ -92,4 +101,5 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
92 Map<String, Object> updSwitchDir(String lineIds); 101 Map<String, Object> updSwitchDir(String lineIds);
93 102
94 Map<String, Object> upddis(Map<String, Object> map); 103 Map<String, Object> upddis(Map<String, Object> map);
  104 +
95 } 105 }
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
@@ -5,10 +5,15 @@ import java.util.HashMap; @@ -5,10 +5,15 @@ import java.util.HashMap;
5 import java.util.List; 5 import java.util.List;
6 import java.util.Map; 6 import java.util.Map;
7 7
  8 +import javax.persistence.EntityManager;
  9 +import javax.transaction.Transactional;
  10 +
8 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.beans.factory.annotation.Value;
9 import org.springframework.data.domain.Sort; 13 import org.springframework.data.domain.Sort;
10 import org.springframework.data.domain.Sort.Direction; 14 import org.springframework.data.domain.Sort.Direction;
11 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
  16 +import org.springframework.web.bind.annotation.RequestParam;
12 17
13 import com.bsth.common.ResponseCode; 18 import com.bsth.common.ResponseCode;
14 import com.bsth.entity.Line; 19 import com.bsth.entity.Line;
@@ -49,6 +54,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ @@ -49,6 +54,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
49 @Autowired 54 @Autowired
50 LineRepository lineRepository; 55 LineRepository lineRepository;
51 56
  57 + @Autowired
  58 + private EntityManager entityManager;
  59 +
  60 + @Value("${hibernate.jdbc.batch_size}")
  61 + private int batchSize;
  62 +
52 @Override 63 @Override
53 public Iterable<SectionRoute> list(Map<String, Object> map) { 64 public Iterable<SectionRoute> list(Map<String, Object> map) {
54 List<Sort.Order> orderList = new ArrayList<>(); 65 List<Sort.Order> orderList = new ArrayList<>();
@@ -106,6 +117,9 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ @@ -106,6 +117,9 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
106 return resultList; 117 return resultList;
107 } 118 }
108 119
  120 +
  121 +
  122 +
109 /** 123 /**
110 * @Description : TODO(根据路段路由Id查询详情) 124 * @Description : TODO(根据路段路由Id查询详情)
111 * 125 *
@@ -297,4 +311,33 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ @@ -297,4 +311,33 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
297 } 311 }
298 return resultMap; 312 return resultMap;
299 } 313 }
  314 +
  315 + /**
  316 + * @Description : TODO(根据路段路由Id批量撤销路段)
  317 + *
  318 + * @param map <id:路段路由ID>
  319 + */
  320 + @Override
  321 + @Transactional
  322 + public Map<String, Object> updateSectionRouteInfoFormId(Map<String, Object> map) {
  323 + Map<String, Object> resultMap = new HashMap<String, Object>();
  324 + try {
  325 + //int i = 0;
  326 + String[] idsStr = map.get("ids").toString().split(",") ;
  327 + for (String id : idsStr) {
  328 + /* entityManager.persist(Integer.parseInt(id));*/
  329 + repository.sectionRouteIsDestroyUpdBatch(Integer.parseInt(id));
  330 +/* i++;
  331 + if (i % batchSize == 0) {
  332 + entityManager.flush();
  333 + entityManager.clear();
  334 + }*/
  335 + }
  336 + resultMap.put("status", ResponseCode.SUCCESS);
  337 + } catch (Exception e) {
  338 + resultMap.put("status", ResponseCode.ERROR);
  339 + logger.error("save erro.", e);
  340 + }
  341 + return resultMap;
  342 + }
300 } 343 }
301 \ No newline at end of file 344 \ No newline at end of file
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
@@ -24,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional; @@ -24,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional;
24 24
25 import java.io.ByteArrayInputStream; 25 import java.io.ByteArrayInputStream;
26 import java.io.File; 26 import java.io.File;
27 -import java.io.FileOutputStream;  
28 import java.io.InputStream; 27 import java.io.InputStream;
29 import java.text.DecimalFormat; 28 import java.text.DecimalFormat;
30 import java.util.*; 29 import java.util.*;
@@ -68,6 +67,29 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -68,6 +67,29 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
68 return repository.findAll(new CustomerSpecs<StationRoute>(map), new Sort(orderList)); 67 return repository.findAll(new CustomerSpecs<StationRoute>(map), new Sort(orderList));
69 } 68 }
70 69
  70 +
  71 + /**
  72 + * @Description : TODO(根据路段路由Id批量撤销路段)
  73 + *
  74 + * @param map <id:路段路由ID>
  75 + */
  76 + @Override
  77 + @Transactional
  78 + public Map<String, Object> updateStationRouteInfoFormId(Map<String, Object> map) {
  79 + Map<String, Object> resultMap = new HashMap<String, Object>();
  80 + try {
  81 + String[] idsStr = map.get("ids").toString().split(",") ;
  82 + for (String id : idsStr) {
  83 + repository.stationRouteIsDestroyUpdBatch(Integer.parseInt(id));
  84 + }
  85 + resultMap.put("status", ResponseCode.SUCCESS);
  86 + } catch (Exception e) {
  87 + resultMap.put("status", ResponseCode.ERROR);
  88 + logger.error("save erro.", e);
  89 + }
  90 + return resultMap;
  91 + }
  92 +
71 /** 93 /**
72 * @Description :TODO(查询树站点与路段数据) 94 * @Description :TODO(查询树站点与路段数据)
73 * 95 *
@@ -512,38 +534,57 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -512,38 +534,57 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
512 */ 534 */
513 @Override 535 @Override
514 public Map<String, Object> usingSingle(Map<String, Object> map) { 536 public Map<String, Object> usingSingle(Map<String, Object> map) {
  537 +
515 // 返回值map 538 // 返回值map
516 Map<String, Object> resultMap = new HashMap<String,Object>(); 539 Map<String, Object> resultMap = new HashMap<String,Object>();
  540 +
517 try { 541 try {
  542 +
518 // 获取线路ID 543 // 获取线路ID
519 Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); 544 Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString());
  545 +
520 /** 查询线路信息 @param:<lineId:线路ID> */ 546 /** 查询线路信息 @param:<lineId:线路ID> */
521 Line line = lineRepository.findOne(lineId); 547 Line line = lineRepository.findOne(lineId);
  548 +
522 /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */ 549 /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */
523 List<Object[]> objects = repository.usingSingle(lineId); 550 List<Object[]> objects = repository.usingSingle(lineId);
  551 +
524 if (objects.size()>0) { 552 if (objects.size()>0) {
  553 +
525 /** 获取配置文件里的ftp登录参数 */ 554 /** 获取配置文件里的ftp登录参数 */
526 Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); 555 Map<String, Object> FTPParamMap = readPropertiesGetFTPParam();
  556 +
527 // 压缩文件名 557 // 压缩文件名
528 String odlGzFileName = line.getLineCode() + ".txt.gz"; 558 String odlGzFileName = line.getLineCode() + ".txt.gz";
  559 +
529 // txt文件名 560 // txt文件名
530 String textFileName = line.getLineCode() + ".txt"; 561 String textFileName = line.getLineCode() + ".txt";
  562 +
531 // 创建一个ftp上传实例 563 // 创建一个ftp上传实例
532 FTPClientUtils clientUtils = new FTPClientUtils(); 564 FTPClientUtils clientUtils = new FTPClientUtils();
  565 +
533 // IP 566 // IP
534 String url = FTPParamMap.get("url").toString(); 567 String url = FTPParamMap.get("url").toString();
  568 +
535 // 端口 569 // 端口
536 int port = Integer.valueOf(FTPParamMap.get("port").toString()); 570 int port = Integer.valueOf(FTPParamMap.get("port").toString());
  571 +
537 // 用户名 572 // 用户名
538 String username = FTPParamMap.get("username").toString(); 573 String username = FTPParamMap.get("username").toString();
  574 +
539 // 密码 575 // 密码
540 String password = FTPParamMap.get("password").toString(); 576 String password = FTPParamMap.get("password").toString();
  577 +
541 // 相对路径 578 // 相对路径
542 String remotePath = FTPParamMap.get("remotePath").toString(); 579 String remotePath = FTPParamMap.get("remotePath").toString();
  580 +
543 /** 如果已存在相同行单文件名则先删除 */ 581 /** 如果已存在相同行单文件名则先删除 */
544 clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName); 582 clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName);
  583 +
545 clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName); 584 clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName);
  585 +
546 String textStr = ""; 586 String textStr = "";
  587 +
547 boolean tempTag = ishxType(objects); 588 boolean tempTag = ishxType(objects);
548 589
549 if(tempTag) 590 if(tempTag)
@@ -557,12 +598,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -557,12 +598,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
557 598
558 InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk")); 599 InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk"));
559 600
560 - // FileOutputStream fos = new FileOutputStream("test.txt");  
561 - /*int len = 0 ;  
562 - byte[] cbuf = new byte[1024];  
563 - while((len = input.read(cbuf)) != -1) {  
564 - fos.write(cbuf, 0, len);  
565 - }*/  
566 /** 生成txt文件,上传ftp */ 601 /** 生成txt文件,上传ftp */
567 clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input); 602 clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input);
568 603
@@ -633,23 +668,25 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -633,23 +668,25 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
633 * @return String 668 * @return String
634 */ 669 */
635 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) { 670 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) {
  671 +
636 // 返回值String 672 // 返回值String
637 String stationRStr = ""; 673 String stationRStr = "";
  674 +
638 // windows下的文本文件换行符 675 // windows下的文本文件换行符
639 //String enterStr = "\r\n"; 676 //String enterStr = "\r\n";
  677 +
640 // linux/unix下的文本文件换行符 678 // linux/unix下的文本文件换行符
641 String enterStr = "\r"; 679 String enterStr = "\r";
642 - int defaultZdxh = 0; 680 +
643 if(objects.size()>0) { 681 if(objects.size()>0) {
  682 +
644 for(int i = 0; i<objects.size();i++) { 683 for(int i = 0; i<objects.size();i++) {
645 - defaultZdxh ++ ; 684 +
646 // 经度 685 // 经度
647 - String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString(); 686 + String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString();
648 687
649 // 纬度 688 // 纬度
650 - String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString();  
651 -  
652 - Point point = new Point(Double.valueOf(lng), Double.valueOf(lat)); 689 + String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString();
653 690
654 lat = "\t" + lat; 691 lat = "\t" + lat;
655 692
@@ -659,32 +696,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -659,32 +696,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
659 String stationMake = ""; 696 String stationMake = "";
660 697
661 if(stationMakeStr.equals("E")) { 698 if(stationMakeStr.equals("E")) {
  699 +
662 stationMake = "\t2"; 700 stationMake = "\t2";
  701 +
663 }else { 702 }else {
  703 +
664 stationMake ="\t1"; 704 stationMake ="\t1";
  705 +
665 } 706 }
666 707
667 // 站点序号 708 // 站点序号
668 - // String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString();  
669 - String stationNo = String.valueOf(defaultZdxh); 709 + String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString();
670 710
671 stationNo = "\t" + stationNo; 711 stationNo = "\t" + stationNo;
672 712
673 // 站点编码 713 // 站点编码
674 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); 714 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
675 715
676 - int len = stationCode.length();  
677 - if(len<8) {  
678 - int dx = 8 - len;  
679 - String addStr = "";  
680 - for(int p =0;p<dx;p++) {  
681 - addStr = addStr + "0";  
682 - }  
683 - stationCode = addStr + stationCode;  
684 - }else if(len>8){  
685 - stationCode = stationCode.substring(8);  
686 - }  
687 -  
688 stationCode = "\t" +stationCode; 716 stationCode = "\t" +stationCode;
689 717
690 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; 718 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
@@ -704,33 +732,41 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -704,33 +732,41 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
704 732
705 // 限速 733 // 限速
706 String sleepStr = ""; 734 String sleepStr = "";
  735 +
707 // 方向 736 // 方向
708 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString()); 737 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
  738 +
709 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ 739 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
710 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 740 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
  741 +
711 if(sobje.size()==1) { 742 if(sobje.size()==1) {
712 - int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());  
713 - sleepStr = "\t" + String.valueOf(dsleepStr); 743 +
  744 + double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());
  745 +
  746 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr);
  747 +
714 }else if(sobje.size()>1){ 748 }else if(sobje.size()>1){
  749 +
  750 + /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */
715 for(int j =0;j<sobje.size();j++) { 751 for(int j =0;j<sobje.size();j++) {
716 - double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString());  
717 - String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString();  
718 - pointsStr = pointsStr.substring(11, pointsStr.length()-1);  
719 - List<Point> ps = new ArrayList<>();  
720 - String[] pArray = pointsStr.split(",");  
721 - for(int a = 0; a <pArray.length; a++) {  
722 - String[] tmepA = pArray[a].split(" ");  
723 - Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1]));  
724 - ps.add(temp);  
725 - }  
726 - if(GeoUtils.isInSection(ps, point)) {  
727 - sleepStr = "\t" + String.valueOf((int)dsleepStrt);  
728 - break; 752 +
  753 + String sectionName = sobje.get(j)[3].toString();
  754 +
  755 + String sectionNameA[] = sectionName.split("至");
  756 +
  757 + if(stationName.equals(sectionNameA[0])){
  758 +
  759 + /*sleepStr = sobje.get(j)[2].toString();*/
  760 +
  761 + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());
  762 +
  763 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt);
  764 +
729 } 765 }
  766 +
730 } 767 }
731 } 768 }
732 - if(sleepStr.equals(""))  
733 - sleepStr = "\t" + "60"; 769 +
734 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; 770 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
735 } 771 }
736 772
@@ -749,12 +785,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -749,12 +785,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
749 for(int i = 0; i<objects.size();i++) { 785 for(int i = 0; i<objects.size();i++) {
750 if(Integer.valueOf(objects.get(i)[8].toString())==0) { 786 if(Integer.valueOf(objects.get(i)[8].toString())==0) {
751 // 经度 787 // 经度
752 - String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString();  
753 - 788 + String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString();
754 // 纬度 789 // 纬度
755 - String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString();  
756 -  
757 - Point point = new Point(Double.valueOf(lng), Double.valueOf(lat)); 790 + String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString();
758 lat = "\t" + lat; 791 lat = "\t" + lat;
759 // 站点类型 792 // 站点类型
760 String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString(); 793 String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString();
@@ -769,17 +802,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -769,17 +802,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
769 String stationNo = "\t" + xh; 802 String stationNo = "\t" + xh;
770 // 站点编码 803 // 站点编码
771 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); 804 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
772 - int len = stationCode.length();  
773 - if(len<8) {  
774 - int dx = 8 - len;  
775 - String addStr = "";  
776 - for(int p =0;p<dx;p++) {  
777 - addStr = addStr + "0";  
778 - }  
779 - stationCode = addStr + stationCode;  
780 - }else if(len>8){  
781 - stationCode = stationCode.substring(8);  
782 - }  
783 stationCode = "\t" +stationCode; 805 stationCode = "\t" +stationCode;
784 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; 806 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
785 String tempDistc = String.valueOf((int) dis); 807 String tempDistc = String.valueOf((int) dis);
@@ -795,28 +817,20 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -795,28 +817,20 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
795 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ 817 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
796 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 818 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
797 if(sobje.size()==1) { 819 if(sobje.size()==1) {
798 - int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());  
799 - sleepStr = "\t" + String.valueOf(dsleepStr); 820 + double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());
  821 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr);
800 }else if(sobje.size()>1){ 822 }else if(sobje.size()>1){
  823 + /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */
801 for(int j =0;j<sobje.size();j++) { 824 for(int j =0;j<sobje.size();j++) {
802 - double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString());  
803 - String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString();  
804 - pointsStr = pointsStr.substring(11, pointsStr.length()-1);  
805 - List<Point> ps = new ArrayList<>();  
806 - String[] pArray = pointsStr.split(",");  
807 - for(int a = 0; a <pArray.length; a++) {  
808 - String[] tmepA = pArray[a].split(" ");  
809 - Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1]));  
810 - ps.add(temp);  
811 - }  
812 - if(GeoUtils.isInSection(ps, point)) {  
813 - sleepStr = "\t" + String.valueOf((int)dsleepStrt);  
814 - break; 825 + String sectionName = sobje.get(j)[3].toString();
  826 + String sectionNameA[] = sectionName.split("至");
  827 + if(stationName.equals(sectionNameA[0])){
  828 + /*sleepStr = sobje.get(j)[2].toString();*/
  829 + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());
  830 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt);
815 } 831 }
816 } 832 }
817 } 833 }
818 - if(sleepStr.equals(""))  
819 - sleepStr = "\t" + "60";  
820 xh++; 834 xh++;
821 restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; 835 restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
822 } 836 }
src/main/resources/static/pages/base/stationroute/delete_select.html 0 → 100644
  1 +<!-- 批量撤销选项 -->
  2 +<div class="modal fade" id="delete_select_mobal" tabindex="-1"
  3 + role="basic" aria-hidden="true">
  4 + <div class="modal-dialog">
  5 + <div class="modal-content">
  6 + <div class="modal-header">
  7 + <button type="button" class="close" data-dismiss="modal"
  8 + aria-hidden="true"></button>
  9 + <h4 class="modal-title">
  10 + 批量撤销选项
  11 + </h4>
  12 + </div>
  13 + <div class="modal-body">
  14 + <form class="form-horizontal" action="/" method="post"
  15 + id="formBootbox" role="form">
  16 + <div class="form-group">
  17 + <label class="col-md-3 control-label">撤销选项:</label>
  18 + <div class="col-md-9">
  19 + <div class="icheck-list">
  20 + <label>
  21 + <input type="radio" name="deleteOptions" value="0" checked> 批量撤销站点
  22 + </label>
  23 + <label >
  24 + <input type="radio" name="deleteOptions" value="1" > 批量撤销路段
  25 + </label>
  26 + </div>
  27 + </div>
  28 + </div>
  29 + </form>
  30 + </div>
  31 + <div class="modal-footer">
  32 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  33 + <button type="button" class="btn btn-primary"
  34 + id="deleteSelectnextButton">下一步</button>
  35 + </div>
  36 + </div>
  37 + </div>
  38 +</div>
  39 +<script type="text/javascript">
  40 + $('#delete_select_mobal').on('deleteSelectMobal.show',function(e,ajaxd,line,fun,delBatch) {
  41 + // 加载显示mobal
  42 + $('#delete_select_mobal').modal({
  43 + show : true,
  44 + backdrop : 'static',
  45 + keyboard : false
  46 + });
  47 + // 获取表单元素
  48 + var form = $('#formBootbox');
  49 + // 下一步点击事件
  50 + $('#deleteSelectnextButton').on('click', function() {
  51 + // 获取撤销类型
  52 + deleteOptions = $("input[name='deleteOptions']:checked").val();
  53 + // 表单提交
  54 + form.submit();
  55 + });
  56 + // 表单验证
  57 + form.validate({
  58 + // 表单序列化
  59 + submitHandler : function(f) {
  60 + // 批量删除站点 (deleteOptions:0)
  61 + if(deleteOptions == 0) {
  62 + // 隐藏选项mobal
  63 + $('#delete_select_mobal').modal('hide');
  64 + // 加载deletestation页面
  65 + $.get('deletestation.html', function(m){
  66 + $(pjaxContainer).append(m);
  67 + $('#delete_station_mobal').trigger('deleteStationMobal.show', [ajaxd,line,fun,delBatch]);
  68 + });
  69 + // 批量删除路段(deleteOptions:1)
  70 + } else if(deleteOptions == 1) {
  71 + // 隐藏选项mobal
  72 + $('#delete_select_mobal').modal('hide');
  73 + // 加载deletesection页面
  74 + $.get('deletesection.html', function(m){
  75 + $(pjaxContainer).append(m);
  76 + $('#delete_section_mobal').trigger('deleteSectionMobal.show', [ajaxd,line,fun,delBatch]);
  77 + });
  78 + }
  79 +
  80 + }
  81 + });
  82 + });
  83 +</script>
0 \ No newline at end of file 84 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/deletesection.html 0 → 100644
  1 +<!-- 编辑路段 -->
  2 +<div class="modal fade" id="delete_section_mobal" role="basic"
  3 + aria-hidden="true">
  4 + <div style="margin:5% auto">
  5 + <div class="modal-content">
  6 + <div class="col-md-12">
  7 + <div class="portlet light porttlet-fit bordered">
  8 + <div class="portlet-title">
  9 + <div class="tipso-animation">
  10 + </div>
  11 + <div class="caption">
  12 + <i class="fa fa-info-circle font-dark"></i> <span
  13 + class="caption-subject font-dark sbold uppercase">路段信息</span>
  14 + </div>
  15 + <div class="actions">
  16 + <div class="modal-footer-left">
  17 + <button type="button" class="btn btn-primary" id="batchDeleteSectionButton">批量撤销路段</button>
  18 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  19 + </div>
  20 + </div>
  21 + </div>
  22 + <div class="portlet-body">
  23 + <div class="table-container" style="margin-top: 10px">
  24 + <from class="form-horizontal" role="form"
  25 + id="batch_delete_section_form">
  26 + <table
  27 + class="table table-striped table-bordered table-hover table-checkable"
  28 + id="datatable_section_detele">
  29 + <thead>
  30 + <tr role="row" class="heading">
  31 + <th width="2%"><input type="checkbox" name="scetionCheckItems"
  32 + id="scetionCheckItems"></input></th>
  33 + <th width="2%">序号</th>
  34 + <th width="5%">路段路由编号</th>
  35 + <th width="5%">线路编号</th>
  36 + <th width="11%">线路名称</th>
  37 + <th width="7%">线路方向</th>
  38 + <th width="11%">路段名称</th>
  39 + <th width="5%">路段编码</th>
  40 + <th width="5%">路段序号</th>
  41 + <th width="5%">路段限速</th>
  42 + <th width="5%">路段长度</th>
  43 + <th width="5%">路段历时</th>
  44 + <th width="5%">版本号</th>
  45 + <!-- <th width="6%">是否撤销</th>
  46 + <th width="9%">操作</th> -->
  47 + </tr>
  48 + </thead>
  49 + <tbody></tbody>
  50 + </table>
  51 + </from>
  52 + <div class="actions">
  53 + <div style="text-align: right">
  54 + <ul id="pagination" class="pagination"></ul>
  55 + </div>
  56 + </div>
  57 + </div>
  58 + </div>
  59 + </div>
  60 + </div>
  61 + </div>
  62 + </div>
  63 +</div>
  64 +
  65 +<script type="text/html" id="sectionInfo_list_table_temp_detele">
  66 + {{each list as obj i }}
  67 + <tr>
  68 + <td style="vertical-align: middle;">
  69 + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" >
  70 + </td>
  71 + <td style="vertical-align: middle;">
  72 + {{(list.page*10)+(i+1)}}
  73 + </td>
  74 + <td style="vertical-align: middle;">
  75 + {{obj.id}}
  76 + </td>
  77 + <td style="vertical-align: middle;">
  78 + {{obj.lineCode}}
  79 + </td>
  80 + <td style="vertical-align: middle;">
  81 + {{obj.line.name}}
  82 + </td>
  83 + <td style="vertical-align: middle;">
  84 + {{if obj.directions == '0'}}
  85 + 上行
  86 + {{else if obj.directions == '1'}}
  87 + 下行
  88 + {{/if}}
  89 + </td>
  90 + <td style="vertical-align: middle;">
  91 + {{obj.section.sectionName}}
  92 + </td>
  93 + <td style="vertical-align: middle;">
  94 + {{obj.sectionCode}}
  95 + </td>
  96 + <td style="vertical-align: middle;">
  97 + {{obj.sectionrouteCode}}
  98 + </td>
  99 + <td style="vertical-align: middle;">
  100 + {{obj.speedLimit}}
  101 + </td>
  102 + <td style="vertical-align: middle;">
  103 + {{obj.sectionDistance}}
  104 + </td>
  105 + <td style="vertical-align: middle;">
  106 + {{obj.sectionTime}}
  107 + </td>
  108 + <td style="vertical-align: middle;">
  109 + {{obj.versions}}
  110 + </td>
  111 + </tr>
  112 + {{/each}}
  113 + {{if list.length == 0}}
  114 + <tr>
  115 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
  116 + </tr>
  117 + {{/if}}
  118 +</script>
  119 +<script type="text/javascript">
  120 +$('#delete_section_mobal').on('deleteSectionMobal.show',function(e, ajaxd, line, fun, delBatch) {
  121 + layer.closeAll();
  122 + // 显示mobal
  123 + $('#delete_section_mobal').modal({
  124 + show : true,
  125 + backdrop : 'static',
  126 + keyboard : false
  127 + });
  128 + // 编辑表单元素
  129 + var form = $('#batch_delete_section_form');
  130 + // 提交数据按钮事件
  131 + $('#batchDeleteSectionButton').on('click', function() {
  132 + var checked = $("[name=items]:checked");
  133 + var ids = "";
  134 + checked.each(function() {
  135 + ids = ids + "," + $(this).val();
  136 + //ids.push($(this).val());
  137 + });
  138 + if (ids != "" && ids != null && ids != undefined) {
  139 + console.log("ids:" + ids);
  140 + ids = ids.substr(1, ids.length - 1);
  141 + var params = {};
  142 + params.ids = ids;
  143 + $.get('/sectionroute/batchDestroy',params,function(resuntDate) {
  144 + if (resuntDate.status == 'SUCCESS') {
  145 + // 弹出添加成功提示消息
  146 + layer.msg('修改成功...');
  147 + /** 通知更新缓存区 */
  148 + //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)})
  149 + } else {
  150 + // 弹出添加失败提示消息
  151 + layer.msg('修改失败...');
  152 + }
  153 + initSearch();
  154 + // 刷新左边树
  155 + fun.resjtreeDate(line.id,delBatch.dir);
  156 + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */
  157 + ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) {
  158 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */
  159 + fun.linePanlThree(line.id,data,delBatch.dir);
  160 + });
  161 + });
  162 + } else {
  163 + layer.msg('请选择要删除的路段!!!');
  164 + }
  165 + });
  166 +
  167 + /** 全选框 */
  168 + document.getElementById('scetionCheckItems').onclick = function() {
  169 + // 获取所有的复选框
  170 + var checkElements = document.getElementsByName('items');
  171 + if (this.checked) {
  172 + for ( var i = 0; i < checkElements.length; i++) {
  173 + var checkElement = checkElements[i];
  174 + checkElement.checked = "checked";
  175 + }
  176 + } else {
  177 + for ( var i = 0; i < checkElements.length; i++) {
  178 + var checkElement = checkElements[i];
  179 + checkElement.checked = null;
  180 + }
  181 + }
  182 + }
  183 +
  184 + /** 页面加载完显示数据 */
  185 + window.onload = initSearch();
  186 +
  187 + /**
  188 + * @description : (TODO) 页面加载事件
  189 + *
  190 + */
  191 + function initSearch() {
  192 + var params = new getParams();
  193 + page = 0;
  194 + loadTableDate(params, true);
  195 + }
  196 + function getParams() {
  197 + // 搜索参数集合
  198 + params = {};
  199 + params.lineCode_eq = line.id;
  200 + params.directions_eq = delBatch.dir;
  201 + params.destroy_eq = "0"; //默认查没有撤销的路段
  202 + return params;
  203 + }
  204 + /**
  205 + * @description : (TODO) 表格数据分页加载事件
  206 + *
  207 + * ------@param : 查询参数
  208 + *
  209 + * ------@isPon : 是否重新分页
  210 + *
  211 + */
  212 + function loadTableDate(param, isPon) {
  213 + // 搜索参数
  214 + var params = {};
  215 + if (param)
  216 + params = param;
  217 + // 排序(按方向与序号)
  218 + params['order'] = 'directions,sectionrouteCode';
  219 + // 排序方向.
  220 + params['direction'] = 'ASC,ASC';
  221 + // 记录当前页数
  222 + params['page'] = page;
  223 + // 弹出正在加载层
  224 + var i = layer.load(2);
  225 + // 异步请求获取表格数据
  226 + $.get('/sectionroute',params,function(result) {
  227 + // 添加序号
  228 + result.content.page = page;
  229 + // 把数据填充到模版中
  230 + var tbodyHtml = template('sectionInfo_list_table_temp_detele',{list : result.content});
  231 + // 把渲染好的模版html文本追加到表格中
  232 + $('#datatable_section_detele tbody').html(tbodyHtml);
  233 + // 是重新分页且返回数据长度大于0
  234 + if (isPon && result.content.length > 0) {
  235 + // 重新分页
  236 + initPag = true;
  237 + // 分页栏
  238 + showPagination(result);
  239 + }
  240 + // 关闭弹出加载层
  241 + layer.close(i);
  242 + });
  243 + }
  244 + /**
  245 + * @description : (TODO) 分页栏组件
  246 + *
  247 + */
  248 + function showPagination(data) {
  249 + // 分页组件
  250 + $('#pagination').jqPaginator({
  251 + // 总页数
  252 + totalPages : data.totalPages,
  253 + // 中间显示页数
  254 + visiblePages : 6,
  255 + // 当前页
  256 + urrentPage : page + 1,
  257 + first : '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  258 + prev : '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  259 + next : '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  260 + last : '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  261 + page : '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  262 + onPageChange : function(num, type) {
  263 + if (initPag) {
  264 + initPag = false;
  265 + return;
  266 + }
  267 + var pData = getParams();
  268 + page = num - 1;
  269 + loadTableDate(pData, false);
  270 + }
  271 + });
  272 + }
  273 +});
  274 +</script>
0 \ No newline at end of file 275 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/deletestation.html 0 → 100644
  1 +<!-- 编辑路段 -->
  2 +<div class="modal fade" id="delete_station_mobal" role="basic"
  3 + aria-hidden="true">
  4 + <div style="margin:5% auto">
  5 + <div class="modal-content">
  6 + <div class="col-md-12">
  7 + <div class="portlet light porttlet-fit bordered">
  8 + <div class="portlet-title">
  9 + <div class="tipso-animation">
  10 + </div>
  11 + <div class="caption">
  12 + <i class="fa fa-info-circle font-dark"></i>
  13 + <span class="caption-subject font-dark sbold uppercase">站点信息</span>
  14 + </div>
  15 + <div class="actions">
  16 + <div class="btn-group btn-group-devided" data-toggle="buttons">
  17 + <button type="button" class="btn btn-primary" id="batchDeleteStationButton">批量撤销站点</button>
  18 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  19 + </div>
  20 + </div>
  21 + </div>
  22 + <div class="portlet-body">
  23 + <div class="table-container" style="margin-top: 10px">
  24 + <from class="form-horizontal" role="form" id="batch_delete_station_form">
  25 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_station_detele">
  26 + <thead>
  27 + <tr role="row" class="heading">
  28 + <th width="2%"><input type="checkbox" name="checkItems"
  29 + id="stationCheckItems"></input></th>
  30 + <th width="2%">序号</th>
  31 + <th width="5%">站点路由编号</th>
  32 + <th width="5%">线路编号</th>
  33 + <th width="8%">线路名称</th>
  34 + <th width="5%">线路方向</th>
  35 + <th width="8%">站点路由名称</th>
  36 + <th width="4%">站点编码</th>
  37 + <th width="4%">站点序号</th>
  38 + <th width="4%">站点类型</th>
  39 + <th width="6%">站点距离(km)</th>
  40 + <th width="6%">站点时长(min)</th>
  41 + <th width="4%">版本号</th>
  42 + </tr>
  43 + </thead>
  44 + <tbody></tbody>
  45 + </table>
  46 + </from>
  47 + <div class="actions">
  48 + <div style="text-align: right">
  49 + <ul id="pagination" class="pagination"></ul>
  50 + </div>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + </div>
  57 + </div>
  58 +</div>
  59 +
  60 +<script type="text/html" id="stationInfo_list_table_temp_detele">
  61 + {{each list as obj i }}
  62 + <tr>
  63 + <td style="vertical-align: middle;">
  64 + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" >
  65 + </td>
  66 + <td style="vertical-align: middle;">
  67 + {{(list.page*10)+(i+1)}}
  68 + </td>
  69 + <td style="vertical-align: middle;">
  70 + {{obj.id}}
  71 + </td>
  72 + <td>
  73 + {{obj.lineCode}}
  74 + </td>
  75 + <td>
  76 + {{obj.line.name}}
  77 + </td>
  78 + <td>
  79 + {{if obj.directions == '0'}}
  80 + 上行
  81 + {{else if obj.directions == '1'}}
  82 + 下行
  83 + {{/if}}
  84 + </td>
  85 + <td>
  86 + {{obj.stationName}}
  87 + </td>
  88 + <td>
  89 + {{obj.stationCode}}
  90 + </td>
  91 + <td>
  92 + {{obj.stationRouteCode}}
  93 + </td>
  94 + <td>
  95 + {{if obj.stationMark == 'B'}}
  96 + 起始站
  97 + {{else if obj.stationMark == 'Z'}}
  98 + 中途站
  99 + {{else if obj.stationMark== 'E'}}
  100 + 终点站
  101 + {{/if}}
  102 + </td>
  103 + <td>
  104 + {{obj.distances}}
  105 + </td>
  106 + <td>
  107 + {{obj.toTime}}
  108 + </td>
  109 + <td>
  110 + {{obj.versions}}
  111 + </td>
  112 + </tr>
  113 + {{/each}}
  114 + {{if list.length == 0}}
  115 + <tr>
  116 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
  117 + </tr>
  118 + {{/if}}
  119 +</script>
  120 +<script type="text/javascript">
  121 +$('#delete_station_mobal').on('deleteStationMobal.show',function(e, ajaxd, line, fun, delBatch) {
  122 + layer.closeAll();
  123 + // 显示mobal
  124 + $('#delete_station_mobal').modal({
  125 + show : true,
  126 + backdrop : 'static',
  127 + keyboard : false
  128 + });
  129 + // 编辑表单元素
  130 + var form = $('#batch_delete_station_form');
  131 + // 提交数据按钮事件
  132 + $('#batchDeleteStationButton').on('click', function() {
  133 + var checked = $("[name=items]:checked");
  134 + var ids = "";
  135 + checked.each(function() {
  136 + ids = ids + "," + $(this).val();
  137 + //ids.push($(this).val());
  138 + });
  139 + if (ids != "" && ids != null && ids != undefined) {
  140 + console.log("ids:" + ids);
  141 + ids = ids.substr(1, ids.length - 1);
  142 + var params = {};
  143 + params.ids = ids;
  144 + $.get('/stationroute/batchDestroy',params,function(resuntDate) {
  145 + if (resuntDate.status == 'SUCCESS') {
  146 + // 弹出添加成功提示消息
  147 + layer.msg('修改成功...');
  148 + /** 通知更新缓存区 */
  149 + //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)})
  150 + } else {
  151 + // 弹出添加失败提示消息
  152 + layer.msg('修改失败...');
  153 + }
  154 + initSearch();
  155 + // 刷新左边树
  156 + fun.resjtreeDate(line.id,delBatch.dir);
  157 + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */
  158 + ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) {
  159 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */
  160 + fun.linePanlThree(line.id,data,delBatch.dir);
  161 + });
  162 + });
  163 + } else {
  164 + layer.msg('请选择要删除的站点!!!');
  165 + }
  166 + });
  167 +
  168 + /** 全选框 */
  169 + document.getElementById('stationCheckItems').onclick = function() {
  170 + // 获取所有的复选框
  171 + var checkElements = document.getElementsByName('items');
  172 + if (this.checked) {
  173 + for ( var i = 0; i < checkElements.length; i++) {
  174 + var checkElement = checkElements[i];
  175 + checkElement.checked = "checked";
  176 + }
  177 + } else {
  178 + for ( var i = 0; i < checkElements.length; i++) {
  179 + var checkElement = checkElements[i];
  180 + checkElement.checked = null;
  181 + }
  182 + }
  183 + }
  184 +
  185 + /** 页面加载完显示数据 */
  186 + window.onload = initSearch();
  187 +
  188 + /**
  189 + * @description : (TODO) 页面加载事件
  190 + *
  191 + */
  192 + function initSearch() {
  193 + var params = new getParams();
  194 + page = 0;
  195 + loadTableDate(params, true);
  196 + }
  197 + function getParams() {
  198 + // 搜索参数集合
  199 + params = {};
  200 + params.lineCode_eq = line.id;
  201 + params.directions_eq = delBatch.dir;
  202 + params.destroy_eq = "0"; //默认查没有撤销的站点
  203 + return params;
  204 + }
  205 + /**
  206 + * @description : (TODO) 表格数据分页加载事件
  207 + *
  208 + * ------@param : 查询参数
  209 + *
  210 + * ------@isPon : 是否重新分页
  211 + *
  212 + */
  213 + function loadTableDate(param, isPon) {
  214 + // 搜索参数
  215 + var params = {};
  216 + if (param)
  217 + params = param;
  218 + // 排序(按方向与序号)
  219 + params['order'] = 'directions,stationRouteCode';
  220 + // 排序方向.
  221 + params['direction'] = 'ASC,ASC';
  222 + // 记录当前页数
  223 + params['page'] = page;
  224 + // 弹出正在加载层
  225 + var i = layer.load(2);
  226 + // 异步请求获取表格数据
  227 + $.get('/stationroute',params,function(result) {
  228 + // 添加序号
  229 + result.content.page = page;
  230 + // 把数据填充到模版中
  231 + var tbodyHtml = template('stationInfo_list_table_temp_detele',{list : result.content});
  232 + // 把渲染好的模版html文本追加到表格中
  233 + $('#datatable_station_detele tbody').html(tbodyHtml);
  234 + // 是重新分页且返回数据长度大于0
  235 + if (isPon && result.content.length > 0) {
  236 + // 重新分页
  237 + initPag = true;
  238 + // 分页栏
  239 + showPagination(result);
  240 + }
  241 + // 关闭弹出加载层
  242 + layer.close(i);
  243 + });
  244 + }
  245 + /**
  246 + * @description : (TODO) 分页栏组件
  247 + *
  248 + */
  249 + function showPagination(data) {
  250 + // 分页组件
  251 + $('#pagination').jqPaginator({
  252 + // 总页数
  253 + totalPages : data.totalPages,
  254 + // 中间显示页数
  255 + visiblePages : 6,
  256 + // 当前页
  257 + urrentPage : page + 1,
  258 + first : '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  259 + prev : '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  260 + next : '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  261 + last : '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  262 + page : '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  263 + onPageChange : function(num, type) {
  264 + if (initPag) {
  265 + initPag = false;
  266 + return;
  267 + }
  268 + var pData = getParams();
  269 + page = num - 1;
  270 + loadTableDate(pData, false);
  271 + }
  272 + });
  273 + }
  274 +});
  275 +</script>
0 \ No newline at end of file 276 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/js/deletebatch.js 0 → 100644
  1 +var DeleteBatchObj = function(){
  2 +
  3 + /** 定义修改线路对象 */
  4 +
  5 + var deleteBatchObj = {
  6 + /** 获取批量撤销对象 @return:<Batch:批量撤销对象> */
  7 + getDeleteBatch : function() {
  8 + return deleteBatchObj;
  9 + },
  10 +
  11 + /** 设置批量撤销的线路方向 @param:<dir:方向(0:上行;1:下行)> */
  12 + setDeteleBatchDiraction : function(dir) {
  13 +
  14 + deleteBatchObj.dir = dir;
  15 + },
  16 + }
  17 +
  18 + return deleteBatchObj;
  19 +}();
src/main/resources/static/pages/base/stationroute/js/editsection.js
@@ -7,7 +7,6 @@ var EditSectionObj = function () { @@ -7,7 +7,6 @@ var EditSectionObj = function () {
7 7
8 /** 获取修改路段集合对象 @return:<Section:修改路段对象> */ 8 /** 获取修改路段集合对象 @return:<Section:修改路段对象> */
9 getEitdSection : function() { 9 getEitdSection : function() {
10 -  
11 return Section; 10 return Section;
12 }, 11 },
13 12
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
@@ -56,6 +56,18 @@ $(function(){ @@ -56,6 +56,18 @@ $(function(){
56 PublicFunctions.stationRevoke(directionUpValue); 56 PublicFunctions.stationRevoke(directionUpValue);
57 }); 57 });
58 58
  59 + // 上行批量撤销事件
  60 + $('.module_tools #batchUpDelete').on('click', function() {
  61 + var Line = LineObj.getLineObj();
  62 + /** 设置批量删除的线路方向 @param:<directionUpValue:方向(0:上行;1:下行)> */
  63 + DeleteBatchObj.setDeteleBatchDiraction(directionUpValue);
  64 + // 加载选择新增方式mobal
  65 + $.get('delete_select.html', function(m){
  66 + $(pjaxContainer).append(m);
  67 + $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]);
  68 + });
  69 + });
  70 +
59 // 切换上下行. 71 // 切换上下行.
60 $('.retweet').on('click',function() { 72 $('.retweet').on('click',function() {
61 layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', { 73 layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', {
@@ -210,6 +222,18 @@ $(function(){ @@ -210,6 +222,18 @@ $(function(){
210 $('.module_tools #deleteDownStation').on('click', function() { 222 $('.module_tools #deleteDownStation').on('click', function() {
211 PublicFunctions.stationRevoke(directionDownValue); 223 PublicFunctions.stationRevoke(directionDownValue);
212 }); 224 });
  225 +
  226 + // 下行批量撤销事件
  227 + $('.module_tools #batchDownDelete').on('click', function() {
  228 + var Line = LineObj.getLineObj();
  229 + /** 设置批量删除的线路方向 @param:<directionDownValue:方向(0:上行;1:下行)> */
  230 + DeleteBatchObj.setDeteleBatchDiraction(directionDownValue);
  231 + // 加载选择新增方式mobal
  232 + $.get('delete_select.html', function(m){
  233 + $(pjaxContainer).append(m);
  234 + $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]);
  235 + });
  236 + });
213 237
214 // 编辑线路下行走向 238 // 编辑线路下行走向
215 $('.module_tools #editDownlineTrend').on('click', function() { 239 $('.module_tools #editDownlineTrend').on('click', function() {
@@ -242,5 +266,5 @@ $(function(){ @@ -242,5 +266,5 @@ $(function(){
242 $('.defeat-scroll').css('overflow','auto'); 266 $('.defeat-scroll').css('overflow','auto');
243 }).on('mouseleave',function() { 267 }).on('mouseleave',function() {
244 $('.defeat-scroll').css('overflow','hidden'); 268 $('.defeat-scroll').css('overflow','hidden');
245 - }); 269 + });
246 }); 270 });
247 \ No newline at end of file 271 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/list.html
@@ -59,6 +59,10 @@ @@ -59,6 +59,10 @@
59 </li> 59 </li>
60 <li class="divider"> </li> 60 <li class="divider"> </li>
61 <li> 61 <li>
  62 + <a href="javascript:;" id="batchUpDelete"><i class="fa fa-trash-o"></i> 批量撤销</a>
  63 + </li>
  64 + <li class="divider"> </li>
  65 + <li>
62 <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> 66 <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>
63 </li> 67 </li>
64 <li class="divider"> </li> 68 <li class="divider"> </li>
@@ -69,6 +73,7 @@ @@ -69,6 +73,7 @@
69 <li> 73 <li>
70 <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a> 74 <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a>
71 </li> 75 </li>
  76 + <li class="divider"> </li>
72 <!-- <li> 77 <!-- <li>
73 <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> 78 <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a>
74 </li> --> 79 </li> -->
@@ -154,6 +159,10 @@ @@ -154,6 +159,10 @@
154 </li> 159 </li>
155 <li class="divider"> </li> 160 <li class="divider"> </li>
156 <li> 161 <li>
  162 + <a href="javascript:;" id="batchDownDelete"><i class="fa fa-trash-o"></i> 批量撤销</a>
  163 + </li>
  164 + <li class="divider"> </li>
  165 + <li>
157 <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> 166 <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>
158 </li> 167 </li>
159 <li class="divider"> </li> 168 <li class="divider"> </li>
@@ -227,6 +236,8 @@ @@ -227,6 +236,8 @@
227 <script src="/pages/base/stationroute/js/editstationobj.js"></script> 236 <script src="/pages/base/stationroute/js/editstationobj.js"></script>
228 <!-- 修改路段对象类 --> 237 <!-- 修改路段对象类 -->
229 <script src="/pages/base/stationroute/js/editsection.js"></script> 238 <script src="/pages/base/stationroute/js/editsection.js"></script>
  239 +<!-- 批量撤销对象类 -->
  240 +<script src="/pages/base/stationroute/js/deletebatch.js"></script>
230 <!-- 绘图类 --> 241 <!-- 绘图类 -->
231 <script src="/pages/base/stationroute/js/drawingManager.js"></script> 242 <script src="/pages/base/stationroute/js/drawingManager.js"></script>
232 <!-- 地图类 --> 243 <!-- 地图类 -->
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
@@ -414,7 +414,7 @@ var BaseFun = function() { @@ -414,7 +414,7 @@ var BaseFun = function() {
414 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj)); 414 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj));
415 // 定义时间段内剔除班次规则. 415 // 定义时间段内剔除班次规则.
416 tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'deletebcNum' : wgfhtcbcNum}, 416 tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'deletebcNum' : wgfhtcbcNum},
417 - {'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dataMap.wgfsjd[0].st , 'deletebcNum' : deletebcNum - wgfhtcbcNum},); 417 + {'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dataMap.wgfsjd[0].st , 'deletebcNum' : deletebcNum - wgfhtcbcNum});
418 // 逆序排序剔除. 418 // 逆序排序剔除.
419 lpbc.sort(function(r,s){return s.fcno-r.fcno}); 419 lpbc.sort(function(r,s){return s.fcno-r.fcno});
420 // 剔除不在高峰时间段内的班次. 420 // 剔除不在高峰时间段内的班次.
@@ -431,30 +431,29 @@ var BaseFun = function() { @@ -431,30 +431,29 @@ var BaseFun = function() {
431 if(dgminpcs>0 && dgminpcs <= bxrcObj.fpcls ) { 431 if(dgminpcs>0 && dgminpcs <= bxrcObj.fpcls ) {
432 if( (a + 1) <= dgminpcs) { 432 if( (a + 1) <= dgminpcs) {
433 var dgzjsj = baseF.getDateTime('12:30'); 433 var dgzjsj = baseF.getDateTime('12:30');
  434 + /*var zgfyh = dataMap.zgfsjd[0].ed;
  435 + zgfyh.setMinutes(zgfyh.getMinutes()+ Math.min.apply(null, dataMap.dgxxsjArr));*/
434 if( a % 2 == 0) { 436 if( a % 2 == 0) {
435 // 定义早高峰结束 ~ 12:30 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. 437 // 定义早高峰结束 ~ 12:30 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
436 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj)); 438 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj));
437 - if(initdx < 240) {  
438 - tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum}); 439 + if(deletebcNum < swmaxtcbcNum) {
  440 + // tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum});
  441 + tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum});
439 }else { 442 }else {
440 - tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : swmaxtcbcNum}, 443 + tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed, 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : swmaxtcbcNum},
441 {'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed, 'order' : 'desc' , 'deletebcNum' : deletebcNum - swmaxtcbcNum}); 444 {'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed, 'order' : 'desc' , 'deletebcNum' : deletebcNum - swmaxtcbcNum});
442 } 445 }
443 - // 顺序排序  
444 - // lpbc.sort(function(x,y){return x.fcno-y.fcno}); 446 + // tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum});
445 }else { 447 }else {
446 // 定义12:30 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. 448 // 定义12:30 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
447 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj)); 449 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj));
448 - if(initdx < 210) { 450 + if(deletebcNum < xwmaxtcbcNum) {
449 tcbcgzA.push({'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'desc', 'deletebcNum' : deletebcNum}); 451 tcbcgzA.push({'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'desc', 'deletebcNum' : deletebcNum});
450 }else { 452 }else {
451 -  
452 tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum - xwmaxtcbcNum}, 453 tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum - xwmaxtcbcNum},
453 - {'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'desc', 'deletebcNum' : xwmaxtcbcNum},); 454 + {'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'desc', 'deletebcNum' : xwmaxtcbcNum});
454 } 455 }
455 - // 逆序排序.  
456 - // lpbc.sort(function(m,n){return n.fcno-m.fcno});  
457 - // order = 'desc'; 456 + // tcbcgzA.push({'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'desc', 'deletebcNum' : deletebcNum});
458 } 457 }
459 // 按规则剔除班次.并且分班.路牌班次断开. 458 // 按规则剔除班次.并且分班.路牌班次断开.
460 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true); 459 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true);
@@ -489,12 +488,12 @@ var BaseFun = function() { @@ -489,12 +488,12 @@ var BaseFun = function() {
489 wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfzhsjd[0].st ) / (60000 * saa[0].zzsj.dgzzsj)) 488 wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfzhsjd[0].st ) / (60000 * saa[0].zzsj.dgzzsj))
490 tcbcgzA = new Array(); 489 tcbcgzA = new Array();
491 if( wgfhtcbcNum >= deletebcNum) { 490 if( wgfhtcbcNum >= deletebcNum) {
492 - tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum},); 491 + tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum});
493 }else if(zgfzqtcbcNum >= deletebcNum){ 492 }else if(zgfzqtcbcNum >= deletebcNum){
494 - tcbcgzA.push({'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum},); 493 + tcbcgzA.push({'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum});
495 }else if(deletebcNum >= (zgfzqtcbcNum + wgfhtcbcNum)){ 494 }else if(deletebcNum >= (zgfzqtcbcNum + wgfhtcbcNum)){
496 tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : wgfhtcbcNum}, 495 tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : wgfhtcbcNum},
497 - {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : zgfzqtcbcNum},); 496 + {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : zgfzqtcbcNum});
498 } 497 }
499 // lpbc.sort(function(m,n){return n.fcno-m.fcno}); 498 // lpbc.sort(function(m,n){return n.fcno-m.fcno});
500 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , isfb); 499 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , isfb);
@@ -655,9 +654,10 @@ var BaseFun = function() { @@ -655,9 +654,10 @@ var BaseFun = function() {
655 var ttsmbA = baseF.tzsmbcsj01(tempA,dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap); 654 var ttsmbA = baseF.tzsmbcsj01(tempA,dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);
656 655
657 baseF.jhfcjx02(ttsmbA,dataMap); 656 baseF.jhfcjx02(ttsmbA,dataMap);
658 - return {'json':ttsmbA,'bxrcgs':null};  
659 - // var rsjar = baseF.tzsztest02(cara,ttsmbA,dataMap);  
660 - // return {'json':rsjar,'bxrcgs':null}; 657 + //return {'json':baseF.addjcclcbc01(cara,ttsmbA,dataMap,saa,map),'bxrcgs':null};
  658 + //return {'json':ttsmbA,'bxrcgs':null};
  659 + var rsjar = baseF.tzsztest02(cara,ttsmbA,dataMap);
  660 + return {'json':rsjar,'bxrcgs':null};
661 return {'json':baseF.addjcclcbc01(cara,rsjar,dataMap,saa,map),'bxrcgs':null}; 661 return {'json':baseF.addjcclcbc01(cara,rsjar,dataMap,saa,map),'bxrcgs':null};
662 }, 662 },
663 663
src/main/resources/static/pages/forms/mould/shifday.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
@@ -312,22 +312,50 @@ @@ -312,22 +312,50 @@
312 <tr> 312 <tr>
313 <td>{{obj.date}}</td> 313 <td>{{obj.date}}</td>
314 <td>{{obj.line}}</td> 314 <td>{{obj.line}}</td>
315 - <td>{{obj.qdzFirst0}}</td>  
316 - <td>{{obj.jhfcFirst0}}</td>  
317 - <td>{{obj.sjfcFirst0}}</td>  
318 - <td>{{obj.delayFirst0}}</td>  
319 - <td>{{obj.qdzLast0}}</td>  
320 - <td>{{obj.jhfcLast0}}</td>  
321 - <td>{{obj.sjfcLast0}}</td>  
322 - <td>{{obj.delayLast0}}</td>  
323 - <td>{{obj.qdzFirst1}}</td>  
324 - <td>{{obj.jhfcFirst1}}</td>  
325 - <td>{{obj.sjfcFirst1}}</td>  
326 - <td>{{obj.delayFirst1}}</td>  
327 - <td>{{obj.qdzLast1}}</td>  
328 - <td>{{obj.jhfcLast1}}</td>  
329 - <td>{{obj.sjfcLast1}}</td>  
330 - <td>{{obj.delayLast1}}</td> 315 + {{if obj.delayFirst0 != '/' && (obj.delayFirst0 > 1 || obj.delayFirst0 < -2)}}
  316 + <td style="background-color: #FF9999">{{obj.qdzFirst0}}</td>
  317 + <td style="background-color: #FF9999">{{obj.jhfcFirst0}}</td>
  318 + <td style="background-color: #FF9999">{{obj.sjfcFirst0}}</td>
  319 + <td style="background-color: #FF9999">{{obj.delayFirst0}}</td>
  320 + {{else}}
  321 + <td>{{obj.qdzFirst0}}</td>
  322 + <td>{{obj.jhfcFirst0}}</td>
  323 + <td>{{obj.sjfcFirst0}}</td>
  324 + <td>{{obj.delayFirst0}}</td>
  325 + {{/if}}
  326 + {{if obj.delayLast0 != '/' && (obj.delayLast0 > 1 || obj.delayLast0 < -2)}}
  327 + <td style="background-color: #FF9999">{{obj.qdzLast0}}</td>
  328 + <td style="background-color: #FF9999">{{obj.jhfcLast0}}</td>
  329 + <td style="background-color: #FF9999">{{obj.sjfcLast0}}</td>
  330 + <td style="background-color: #FF9999">{{obj.delayLast0}}</td>
  331 + {{else}}
  332 + <td>{{obj.qdzLast0}}</td>
  333 + <td>{{obj.jhfcLast0}}</td>
  334 + <td>{{obj.sjfcLast0}}</td>
  335 + <td>{{obj.delayLast0}}</td>
  336 + {{/if}}
  337 + {{if obj.delayFirst1 != '/' && (obj.delayFirst1 > 1 || obj.delayFirst1 < -2)}}
  338 + <td style="background-color: #FF9999">{{obj.qdzFirst1}}</td>
  339 + <td style="background-color: #FF9999">{{obj.jhfcFirst1}}</td>
  340 + <td style="background-color: #FF9999">{{obj.sjfcFirst1}}</td>
  341 + <td style="background-color: #FF9999">{{obj.delayFirst1}}</td>
  342 + {{else}}
  343 + <td>{{obj.qdzFirst1}}</td>
  344 + <td>{{obj.jhfcFirst1}}</td>
  345 + <td>{{obj.sjfcFirst1}}</td>
  346 + <td>{{obj.delayFirst1}}</td>
  347 + {{/if}}
  348 + {{if obj.delayLast1 != '/' && (obj.delayLast1 > 1 || obj.delayLast1 < -2)}}
  349 + <td style="background-color: #FF9999">{{obj.qdzLast1}}</td>
  350 + <td style="background-color: #FF9999">{{obj.jhfcLast1}}</td>
  351 + <td style="background-color: #FF9999">{{obj.sjfcLast1}}</td>
  352 + <td style="background-color: #FF9999">{{obj.delayLast1}}</td>
  353 + {{else}}
  354 + <td>{{obj.qdzLast1}}</td>
  355 + <td>{{obj.jhfcLast1}}</td>
  356 + <td>{{obj.sjfcLast1}}</td>
  357 + <td>{{obj.delayLast1}}</td>
  358 + {{/if}}
331 </tr> 359 </tr>
332 {{/each}} 360 {{/each}}
333 </script> 361 </script>
334 \ No newline at end of file 362 \ No newline at end of file
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
@@ -309,9 +309,6 @@ @@ -309,9 +309,6 @@
309 layer.msg("请选择时间"); 309 layer.msg("请选择时间");
310 return; 310 return;
311 } 311 }
312 - if($("#table").height() > $(window).height() - 110){  
313 - $("#table").height($(window).height()-110);  
314 - }  
315 var reason = $("input[name='reason']"); 312 var reason = $("input[name='reason']");
316 var params = {}; 313 var params = {};
317 if(line == " ") 314 if(line == " ")
@@ -348,7 +345,12 @@ @@ -348,7 +345,12 @@
348 $('#export').attr('disabled', "true"); 345 $('#export').attr('disabled', "true");
349 else 346 else
350 $("#export").removeAttr("disabled"); 347 $("#export").removeAttr("disabled");
351 - 348 +
  349 + if($("#forms").height()+70 > $(window).height()-110){
  350 + $("#table").height($(window).height()-110);
  351 + } else {
  352 + $("#table").height($("#forms").height()+70);
  353 + }
352 }); 354 });
353 } 355 }
354 356
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
@@ -520,7 +520,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -520,7 +520,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
520 return { 520 return {
521 rest : $resource( 521 rest : $resource(
522 '/spic/:id', 522 '/spic/:id',
523 - {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id'}, 523 + {order: 'xl,scheduleDate,lp,xlDir,fcno', direction: 'ASC,ASC,ASC,ASC,ASC', id: '@id'},
524 { 524 {
525 list: { 525 list: {
526 method: 'GET', 526 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
@@ -84,10 +84,20 @@ @@ -84,10 +84,20 @@
84 <span ng-bind="info.bcType | dict:'ScheduleType':'未知' "></span> 84 <span ng-bind="info.bcType | dict:'ScheduleType':'未知' "></span>
85 </td> 85 </td>
86 <td> 86 <td>
87 - <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span> 87 + <a href="#" ng-if="info.xlDir == '0'">
  88 + <i class="fa fa-arrow-up" aria-hidden="true"></i>
  89 + <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span>
  90 + </a>
  91 + <a href="#" ng-if="info.xlDir == '1'">
  92 + <i class="fa fa-arrow-circle-down" aria-hidden="true"></i>
  93 + <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span>
  94 + </a>
88 </td> 95 </td>
89 <td> 96 <td>
90 - <span ng-bind="info.fcsj"></span> 97 + <a href="#">
  98 + <i class="fa fa-clock-o" aria-hidden="true"></i>
  99 + <span ng-bind="info.fcsj"></span>
  100 + </a>
91 </td> 101 </td>
92 <td> 102 <td>
93 <a href="#" 103 <a href="#"
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
@@ -64,7 +64,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -64,7 +64,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
64 return { 64 return {
65 rest : $resource( 65 rest : $resource(
66 '/spic/:id', 66 '/spic/:id',
67 - {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id'}, 67 + {order: 'xl,scheduleDate,lp,xlDir,fcno', direction: 'ASC,ASC,ASC,ASC,ASC', id: '@id'},
68 { 68 {
69 list: { 69 list: {
70 method: 'GET', 70 method: 'GET',