Commit 56780f35967031efcd898e2bf7c14ff686e90d8e

Authored by 王通
2 parents cd8e74b0 ac81c71a

Merge branch 'pudong' into minhang

# Conflicts:
#	src/main/resources/application-prod.properties
Showing 179 changed files with 8196 additions and 1616 deletions
src/main/java/com/bsth/controller/StationController.java
1 package com.bsth.controller; 1 package com.bsth.controller;
2 2
3 -import java.util.Map;  
4 - 3 +import com.bsth.entity.Station;
  4 +import com.bsth.service.StationService;
  5 +import com.bsth.util.GetUIDAndCode;
5 import org.slf4j.Logger; 6 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 7 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,9 +11,7 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -10,9 +11,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
10 import org.springframework.web.bind.annotation.RequestParam; 11 import org.springframework.web.bind.annotation.RequestParam;
11 import org.springframework.web.bind.annotation.RestController; 12 import org.springframework.web.bind.annotation.RestController;
12 13
13 -import com.bsth.entity.Station;  
14 -import com.bsth.service.StationService;  
15 -import com.bsth.util.GetUIDAndCode; 14 +import java.util.Map;
16 15
17 /** 16 /**
18 * 17 *
@@ -160,11 +159,11 @@ public class StationController extends BaseController<Station, Integer> { @@ -160,11 +159,11 @@ public class StationController extends BaseController<Station, Integer> {
160 public int updateStationAndSectionCode(@RequestParam Integer stationCount, Integer sectionCount) { 159 public int updateStationAndSectionCode(@RequestParam Integer stationCount, Integer sectionCount) {
161 System.out.println(stationCount+" _ "+ sectionCount ); 160 System.out.println(stationCount+" _ "+ sectionCount );
162 for(int i = 0; i < stationCount; i++) { 161 for(int i = 0; i < stationCount; i++) {
163 - System.out.println(stationCount); 162 + System.out.println(i);
164 GetUIDAndCode.getStationId(); 163 GetUIDAndCode.getStationId();
165 } 164 }
166 - for(int i = 0; i < sectionCount; i++) {  
167 - System.out.println(sectionCount); 165 + for(int j = 0; j < sectionCount; j++) {
  166 + System.out.println(j);
168 GetUIDAndCode.getSectionId(); 167 GetUIDAndCode.getSectionId();
169 } 168 }
170 return 1; 169 return 1;
src/main/java/com/bsth/controller/StationRouteController.java
1 package com.bsth.controller; 1 package com.bsth.controller;
2 2
3 -import com.bsth.entity.Station;  
4 import com.bsth.entity.StationRoute; 3 import com.bsth.entity.StationRoute;
5 import com.bsth.entity.StationRouteCache; 4 import com.bsth.entity.StationRouteCache;
6 import com.bsth.repository.StationRouteCacheRepository; 5 import com.bsth.repository.StationRouteCacheRepository;
@@ -12,11 +11,10 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -12,11 +11,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
12 import org.springframework.web.bind.annotation.RequestParam; 11 import org.springframework.web.bind.annotation.RequestParam;
13 import org.springframework.web.bind.annotation.RestController; 12 import org.springframework.web.bind.annotation.RestController;
14 13
  14 +import javax.servlet.http.HttpServletResponse;
15 import java.util.List; 15 import java.util.List;
16 import java.util.Map; 16 import java.util.Map;
17 17
18 -import javax.servlet.http.HttpServletResponse;  
19 -  
20 /** 18 /**
21 * 19 *
22 * @ClassName: StationRouteController(站点路由控制器) 20 * @ClassName: StationRouteController(站点路由控制器)
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
1 package com.bsth.controller.realcontrol; 1 package com.bsth.controller.realcontrol;
2 2
  3 +import java.io.ByteArrayOutputStream;
  4 +import java.io.IOException;
  5 +import java.io.InputStream;
  6 +import java.io.OutputStream;
  7 +import java.net.HttpURLConnection;
  8 +import java.net.URL;
  9 +import java.util.ArrayList;
  10 +import java.util.Collection;
  11 +import java.util.HashMap;
  12 +import java.util.List;
  13 +import java.util.Map;
  14 +
  15 +import org.apache.commons.io.IOUtils;
  16 +import org.apache.commons.lang3.StringEscapeUtils;
  17 +import org.joda.time.format.DateTimeFormat;
  18 +import org.joda.time.format.DateTimeFormatter;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.web.bind.annotation.PathVariable;
  21 +import org.springframework.web.bind.annotation.RequestMapping;
  22 +import org.springframework.web.bind.annotation.RequestMethod;
  23 +import org.springframework.web.bind.annotation.RequestParam;
  24 +import org.springframework.web.bind.annotation.RestController;
  25 +
3 import com.alibaba.fastjson.JSONArray; 26 import com.alibaba.fastjson.JSONArray;
4 import com.bsth.common.ResponseCode; 27 import com.bsth.common.ResponseCode;
5 import com.bsth.controller.BaseController; 28 import com.bsth.controller.BaseController;
@@ -10,14 +33,11 @@ import com.bsth.data.schedule.DayOfSchedule; @@ -10,14 +33,11 @@ import com.bsth.data.schedule.DayOfSchedule;
10 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; 33 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
11 import com.bsth.entity.realcontrol.ScheduleRealInfo; 34 import com.bsth.entity.realcontrol.ScheduleRealInfo;
12 import com.bsth.entity.schedule.SchedulePlanInfo; 35 import com.bsth.entity.schedule.SchedulePlanInfo;
  36 +import com.bsth.entity.sys.SysUser;
  37 +import com.bsth.security.util.SecurityUtils;
13 import com.bsth.service.realcontrol.ScheduleRealInfoService; 38 import com.bsth.service.realcontrol.ScheduleRealInfoService;
14 -import org.apache.commons.lang3.StringEscapeUtils;  
15 -import org.joda.time.format.DateTimeFormat;  
16 -import org.joda.time.format.DateTimeFormatter;  
17 -import org.springframework.beans.factory.annotation.Autowired;  
18 -import org.springframework.web.bind.annotation.*;  
19 -  
20 -import java.util.*; 39 +import com.bsth.util.ConfigUtil;
  40 +import com.fasterxml.jackson.databind.ObjectMapper;
21 41
22 @RestController 42 @RestController
23 @RequestMapping("/realSchedule") 43 @RequestMapping("/realSchedule")
@@ -515,6 +535,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -515,6 +535,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
515 return scheduleRealInfoService.realScheduleList(line,date); 535 return scheduleRealInfoService.realScheduleList(line,date);
516 } 536 }
517 537
  538 + @RequestMapping(value="/realScheduleList_zrw")
  539 + public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){
  540 + return scheduleRealInfoService.realScheduleList_zrw(line,date);
  541 + }
  542 +
518 @RequestMapping(value="/realScheduleList_mh_2") 543 @RequestMapping(value="/realScheduleList_mh_2")
519 public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){ 544 public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){
520 return scheduleRealInfoService.realScheduleList_mh_2(line,date); 545 return scheduleRealInfoService.realScheduleList_mh_2(line,date);
@@ -686,4 +711,74 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -686,4 +711,74 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
686 public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ 711 public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){
687 return scheduleRealInfoService.deleteToHistory(id); 712 return scheduleRealInfoService.deleteToHistory(id);
688 } 713 }
  714 +
  715 + /**
  716 + * 从历史库里删除临加班次
  717 + * @param sch
  718 + * @return
  719 + */
  720 + @RequestMapping(value = "wxsb", method = RequestMethod.POST)
  721 + public Map<String, Object> deleteToHistory(@RequestParam Map<String, Object> param){
  722 + SysUser user = SecurityUtils.getCurrentUser();
  723 + String uname = user.getUserName();
  724 + StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url"));
  725 + url.append("?nbbm=").append(param.get("nbbm")).append("&bxy=").append(uname).append("&bxbm=").append(param.get("bxType"));
  726 + // 分公司保存格式 分公司编码_公司编码
  727 + String val = BasicData.nbbm2FgsCompanyCodeMap.get(param.get("nbbm"));
  728 + String[] arr = val.split("_");
  729 + if (!"22".equals(arr[1])) {
  730 + Map<String, Object> res = new HashMap<String, Object>();
  731 + res.put("status", ResponseCode.ERROR);
  732 + res.put("msg", "除金高公司外暂未开通此功能");
  733 +
  734 + return res;
  735 + }
  736 + url.append("&fgs=").append(arr[0]);
  737 +
  738 + return request(url.toString());
  739 + }
  740 +
  741 + @SuppressWarnings("unchecked")
  742 + private static Map<String, Object> request(String url) {
  743 + Map<String, Object> res = new HashMap<String, Object>();
  744 + res.put("status", ResponseCode.SUCCESS);
  745 + InputStream in = null;
  746 + HttpURLConnection con = null;
  747 + try {
  748 + con = (HttpURLConnection)new URL(url).openConnection();
  749 + con.setRequestMethod("POST");
  750 + con.setRequestProperty("keep-alive", "true");
  751 + con.setRequestProperty("accept", "application/json");
  752 + con.setRequestProperty("content-type", "application/json");
  753 + con.setDoInput(true);
  754 + con.setReadTimeout(2500);
  755 + con.setConnectTimeout(2500);
  756 +
  757 + con.connect();
  758 + if (con.getResponseCode() == 200) {
  759 + in = con.getInputStream();
  760 + ByteArrayOutputStream bout = new ByteArrayOutputStream();
  761 + IOUtils.copy(in, bout); bout.close();
  762 + Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class);
  763 + if (!"报修成功".equals(response.get("msg"))) {
  764 + res.put("status", ResponseCode.ERROR);
  765 + res.putAll(response);
  766 + }
  767 + }
  768 + } catch (IOException e) {
  769 + // TODO Auto-generated catch block
  770 + res.put("status", ResponseCode.ERROR);
  771 + res.put("msg", "调用上报接口异常");
  772 + } finally {
  773 + try {
  774 + if (in != null) in.close();
  775 + if (con != null) con.disconnect();
  776 + } catch (IOException e) {
  777 + // TODO Auto-generated catch block
  778 + e.printStackTrace();
  779 + }
  780 + }
  781 +
  782 + return res;
  783 + }
689 } 784 }
src/main/java/com/bsth/controller/schedule/core/CarConfigInfoController.java
@@ -63,6 +63,20 @@ public class CarConfigInfoController extends BController&lt;CarConfigInfo, Long&gt; { @@ -63,6 +63,20 @@ public class CarConfigInfoController extends BController&lt;CarConfigInfo, Long&gt; {
63 return rtn; 63 return rtn;
64 } 64 }
65 65
  66 + @RequestMapping(value = "/validate_cars_2", method = RequestMethod.GET)
  67 + public Map<String, Object> validate_cars(@RequestParam Integer xlId, @RequestParam Integer clId) {
  68 + Map<String, Object> rtn = new HashMap<>();
  69 + try {
  70 + carConfigInfoService.validate_cars(xlId, clId);
  71 + rtn.put("status", ResponseCode.SUCCESS);
  72 + } catch (ScheduleException exp) {
  73 + rtn.put("status", ResponseCode.ERROR);
  74 + rtn.put("msg", exp.getMessage());
  75 + }
  76 +
  77 + return rtn;
  78 + }
  79 +
66 @RequestMapping(value = "/validate_cars_gs", method = RequestMethod.GET) 80 @RequestMapping(value = "/validate_cars_gs", method = RequestMethod.GET)
67 public Map<String, Object> validate_cars_gs(HttpServletRequest request, @RequestParam Map<String, Object> param) { 81 public Map<String, Object> validate_cars_gs(HttpServletRequest request, @RequestParam Map<String, Object> param) {
68 HttpSession session = request.getSession(); 82 HttpSession session = request.getSession();
src/main/java/com/bsth/controller/schedule/core/SchedulePlanController.java
@@ -57,4 +57,21 @@ public class SchedulePlanController extends BController&lt;SchedulePlan, Long&gt; { @@ -57,4 +57,21 @@ public class SchedulePlanController extends BController&lt;SchedulePlan, Long&gt; {
57 return rtn; 57 return rtn;
58 } 58 }
59 59
  60 + /**
  61 + * 验证排班计划时间范围内规则的正确性。
  62 + * @return
  63 + * @throws Exception
  64 + */
  65 + @RequestMapping(value = "/valttrule/{xlid}/{from}/{to}", method = RequestMethod.GET)
  66 + public Map<String, Object> validateRule(
  67 + @PathVariable(value = "xlid") Integer xlid,
  68 + @PathVariable(value = "from") Date from,
  69 + @PathVariable(value = "to") Date to
  70 + ) throws Exception {
  71 + Map<String, Object> rtn = new HashMap<>();
  72 + rtn.put("status", ResponseCode.SUCCESS);
  73 + rtn.put("data", schedulePlanService.validateRule(xlid, from, to));
  74 + return rtn;
  75 + }
  76 +
60 } 77 }
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
@@ -121,7 +121,7 @@ public class InStationProcess { @@ -121,7 +121,7 @@ public class InStationProcess {
121 private void inEndStation(ScheduleRealInfo sch, GpsEntity gps) { 121 private void inEndStation(ScheduleRealInfo sch, GpsEntity gps) {
122 String nbbm = sch.getClZbh(); 122 String nbbm = sch.getClZbh();
123 //校验进站前置约束 123 //校验进站前置约束
124 - if (!validInPremise(gps)) 124 + if (!validInPremise(gps) && isNormalSch(sch))
125 return; 125 return;
126 126
127 //实达时间不覆盖 127 //实达时间不覆盖
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
@@ -74,7 +74,7 @@ public class OutStationProcess { @@ -74,7 +74,7 @@ public class OutStationProcess {
74 * @param gps 74 * @param gps
75 */ 75 */
76 private void outStation(GpsEntity gps, GpsEntity prev) { 76 private void outStation(GpsEntity gps, GpsEntity prev) {
77 - logger.info("站记录(到达时间:" + gps.getArrTime() + " 进出站状态:" + gps.getInstation() + " 站点编号:" + gps.getStopNo() + " deviceId:" + gps.getDeviceId() + " nbbm:" + gps.getNbbm() + ")"); 77 + logger.info("站记录(到达时间:" + gps.getArrTime() + " 进出站状态:" + gps.getInstation() + " 站点编号:" + gps.getStopNo() + " deviceId:" + gps.getDeviceId() + " nbbm:" + gps.getNbbm() + ")");
78 ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); 78 ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm());
79 79
80 //起点发车 80 //起点发车
src/main/java/com/bsth/entity/mcy_forms/Shifday.java
@@ -35,6 +35,8 @@ public class Shifday { @@ -35,6 +35,8 @@ public class Shifday {
35 private String sjbc;//实际班次 35 private String sjbc;//实际班次
36 36
37 private String jgh; 37 private String jgh;
  38 +
  39 + private String sgh;
38 40
39 private String zbh; 41 private String zbh;
40 42
@@ -56,6 +58,14 @@ public class Shifday { @@ -56,6 +58,14 @@ public class Shifday {
56 this.jgh = jgh; 58 this.jgh = jgh;
57 } 59 }
58 60
  61 + public String getSgh() {
  62 + return sgh;
  63 + }
  64 +
  65 + public void setSgh(String sgh) {
  66 + this.sgh = sgh;
  67 + }
  68 +
59 public String getZbh() { 69 public String getZbh() {
60 return zbh; 70 return zbh;
61 } 71 }
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
1 package com.bsth.entity.schedule; 1 package com.bsth.entity.schedule;
2 2
3 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
4 -import com.bsth.service.schedule.rules.rerun.RerunRule_input;  
5 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output;  
6 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_Type; 4 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;
  5 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;
  6 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_Type;
7 7
8 import javax.persistence.*; 8 import javax.persistence.*;
9 import java.sql.PreparedStatement; 9 import java.sql.PreparedStatement;
src/main/java/com/bsth/filter/AccessLogFilter.java
@@ -58,9 +58,11 @@ public class AccessLogFilter extends BaseFilter { @@ -58,9 +58,11 @@ public class AccessLogFilter extends BaseFilter {
58 s.append(getBlock(params)); 58 s.append(getBlock(params));
59 s.append(getBlock(headers)); 59 s.append(getBlock(headers));
60 s.append(getBlock(request.getHeader("Referer"))); 60 s.append(getBlock(request.getHeader("Referer")));
61 -  
62 - logger.info(s.toString()); 61 +
  62 + long now = System.currentTimeMillis();
63 chain.doFilter(request, response); 63 chain.doFilter(request, response);
  64 + s.append("<cost time:").append(System.currentTimeMillis() - now).append(">");
  65 + logger.info(s.toString());
64 } 66 }
65 67
66 private static String getParams(HttpServletRequest request) { 68 private static String getParams(HttpServletRequest request) {
src/main/java/com/bsth/repository/schedule/CarConfigInfoRepository.java
@@ -50,4 +50,7 @@ public interface CarConfigInfoRepository extends BaseRepository&lt;CarConfigInfo, L @@ -50,4 +50,7 @@ public interface CarConfigInfoRepository extends BaseRepository&lt;CarConfigInfo, L
50 50
51 @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH) 51 @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH)
52 List<CarConfigInfo> findByXlId(Integer xlid); 52 List<CarConfigInfo> findByXlId(Integer xlid);
  53 +
  54 + @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH)
  55 + List<CarConfigInfo> findByClId(Integer clid);
53 } 56 }
54 \ No newline at end of file 57 \ No newline at end of file
src/main/java/com/bsth/repository/schedule/GuideboardInfoRepository.java
@@ -43,5 +43,7 @@ public interface GuideboardInfoRepository extends BaseRepository&lt;GuideboardInfo, @@ -43,5 +43,7 @@ public interface GuideboardInfoRepository extends BaseRepository&lt;GuideboardInfo,
43 43
44 @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") 44 @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")
45 List<GuideboardInfo> validateLp(Line xl,String lpName , int lpNo,String lpType); 45 List<GuideboardInfo> validateLp(Line xl,String lpName , int lpNo,String lpType);
  46 +
  47 + List<GuideboardInfo> findByXlId(Integer id);
46 48
47 } 49 }
src/main/java/com/bsth/repository/schedule/TTInfoRepository.java
@@ -48,4 +48,6 @@ public interface TTInfoRepository extends BaseRepository&lt;TTInfo, Long&gt; { @@ -48,4 +48,6 @@ public interface TTInfoRepository extends BaseRepository&lt;TTInfo, Long&gt; {
48 "from LineVersions lv where lv.line.id = ?1 and lv.status = ?2 ") 48 "from LineVersions lv where lv.line.id = ?1 and lv.status = ?2 ")
49 List<Map<String, Object>> findLineVersionDescs3(Integer lineId, Integer status); 49 List<Map<String, Object>> findLineVersionDescs3(Integer lineId, Integer status);
50 50
  51 + List<TTInfo> findByXlId(Integer xlId);
  52 +
51 } 53 }
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -596,7 +596,7 @@ public class FormsServiceImpl implements FormsService { @@ -596,7 +596,7 @@ public class FormsServiceImpl implements FormsService {
596 @Override 596 @Override
597 public List<Shifday> shifday(Map<String, Object> map) { 597 public List<Shifday> shifday(Map<String, Object> map) {
598 598
599 - String line=""; 599 + String line="";
600 String date=""; 600 String date="";
601 String gsdmShif=""; 601 String gsdmShif="";
602 String fgsdmShif=""; 602 String fgsdmShif="";
@@ -624,18 +624,17 @@ public class FormsServiceImpl implements FormsService { @@ -624,18 +624,17 @@ public class FormsServiceImpl implements FormsService {
624 if(!type.equals("") && !statue.equals("")){ 624 if(!type.equals("") && !statue.equals("")){
625 sql_ +=" order by "+statue+" "+type; 625 sql_ +=" order by "+statue+" "+type;
626 } 626 }
627 - String sql ="select t.* from (select r.schedule_date,r.j_name,"  
628 - + "IFNULL(r.s_name,'')as s_name,"  
629 - + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name "  
630 - + "FROM bsth_c_s_sp_info_real r where 1=1 "  
631 - + " and r.schedule_date_str='"+date + "' " 627 + String sql ="select t.* from (select r.schedule_date,"
  628 + + " IFNULL(r.s_gh,'')as s_gh,r.cl_zbh,"
  629 + + " r.xl_bm,r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name"
  630 + + " FROM bsth_c_s_sp_info_real r where 1=1 "
  631 + + " and r.schedule_date_str='"+date + "' "
632 + " and r.xl_bm = '"+line+"' " 632 + " and r.xl_bm = '"+line+"' "
633 + " and r.gs_bm like '%"+gsdmShif+"%' " 633 + " and r.gs_bm like '%"+gsdmShif+"%' "
634 - + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t"  
635 - + " GROUP BY t.schedule_date,t.j_name,t.s_name, "  
636 - + "t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm,t.lp_name "  
637 - + sql_;  
638 - 634 + + " and r.fgs_bm like '%"+fgsdmShif+"%' "+sql_+") t"
  635 + + " GROUP BY t.schedule_date,t.xl_bm,t.cl_zbh,t.lp_name,"
  636 + + " t.j_gh,t.s_gh,t.gs_bm,t.fgs_bm ";
  637 +
639 638
640 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { 639 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
641 640
@@ -643,15 +642,16 @@ public class FormsServiceImpl implements FormsService { @@ -643,15 +642,16 @@ public class FormsServiceImpl implements FormsService {
643 public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException { 642 public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException {
644 Shifday shifday = new Shifday(); 643 Shifday shifday = new Shifday();
645 shifday.setRq(arg0.getString("schedule_date")); 644 shifday.setRq(arg0.getString("schedule_date"));
646 - shifday.setjName(arg0.getString("j_name").toString());  
647 - shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); 645 +// shifday.setjName(arg0.getString("j_name").toString());
  646 +// shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString());
648 shifday.setCarPlate(arg0.getString("cl_zbh").toString()); 647 shifday.setCarPlate(arg0.getString("cl_zbh").toString());
649 shifday.setJgh(arg0.getString("j_gh")); 648 shifday.setJgh(arg0.getString("j_gh"));
  649 + shifday.setSgh(arg0.getString("s_gh") == null ? "" : arg0.getString("s_gh").toString());
650 shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString()); 650 shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString());
651 return shifday; 651 return shifday;
652 } 652 }
653 -  
654 }); 653 });
  654 +
655 List<ScheduleRealInfo> sList; 655 List<ScheduleRealInfo> sList;
656 List<ScheduleRealInfo> list_s; 656 List<ScheduleRealInfo> list_s;
657 List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); 657 List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString());
@@ -661,8 +661,9 @@ public class FormsServiceImpl implements FormsService { @@ -661,8 +661,9 @@ public class FormsServiceImpl implements FormsService {
661 Shifday d=list.get(i); 661 Shifday d=list.get(i);
662 for (int j = 0; j < lists.size(); j++) { 662 for (int j = 0; j < lists.size(); j++) {
663 ScheduleRealInfo s=lists.get(j); 663 ScheduleRealInfo s=lists.get(j);
664 - if(d.getJgh().equals(s.getjGh()) && d.getCarPlate().equals(s.getClZbh())  
665 - &&d.getLpName().equals(s.getLpName())){ 664 + if(d.getJgh().equals(s.getjGh()) && d.getSgh().equals(s.getsGh())
  665 + && d.getCarPlate().equals(s.getClZbh())
  666 + && d.getLpName().equals(s.getLpName())){
666 sList.add(s); 667 sList.add(s);
667 Set<ChildTaskPlan> cts = s.getcTasks(); 668 Set<ChildTaskPlan> cts = s.getcTasks();
668 if(cts != null && cts.size() > 0){ 669 if(cts != null && cts.size() > 0){
@@ -674,7 +675,10 @@ public class FormsServiceImpl implements FormsService { @@ -674,7 +675,10 @@ public class FormsServiceImpl implements FormsService {
674 } 675 }
675 } 676 }
676 } 677 }
677 - 678 + if(sList.size()>0){
  679 + d.setjName(sList.get(0).getjName());
  680 + d.setsName(sList.get(0).getsName() == null ? "":sList.get(0).getsName());
  681 + }
678 double ksgl=culateMileageService.culateKsgl(list_s); 682 double ksgl=culateMileageService.culateKsgl(list_s);
679 double jccgl=culateMileageService.culateJccgl(list_s); 683 double jccgl=culateMileageService.culateJccgl(list_s);
680 double zksgl=Arith.add(ksgl, jccgl); 684 double zksgl=Arith.add(ksgl, jccgl);
@@ -893,7 +897,8 @@ public class FormsServiceImpl implements FormsService { @@ -893,7 +897,8 @@ public class FormsServiceImpl implements FormsService {
893 if(fgsdm.length() != 0){ 897 if(fgsdm.length() != 0){
894 sql += " and r.fgs_bm ='"+fgsdm+"'"; 898 sql += " and r.fgs_bm ='"+fgsdm+"'";
895 } 899 }
896 - sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh"; 900 + sql += " group by r.fgs_bm,r.j_gh,r.xl_bm,r.cl_zbh,r.j_name " +
  901 + "order by r.xl_bm,r.cl_zbh";
897 902
898 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { 903 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
899 @Override 904 @Override
@@ -924,7 +929,7 @@ public class FormsServiceImpl implements FormsService { @@ -924,7 +929,7 @@ public class FormsServiceImpl implements FormsService {
924 + " WHERE rq = '"+startDate+"'" 929 + " WHERE rq = '"+startDate+"'"
925 + linesql 930 + linesql
926 + " union" 931 + " union"
927 - + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" 932 + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb"
928 + " WHERE rq = '"+startDate+"'" 933 + " WHERE rq = '"+startDate+"'"
929 + linesql; 934 + linesql;
930 List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { 935 List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() {
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -400,7 +400,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -400,7 +400,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
400 sql += " and cl.line_code = '"+line+"'"; 400 sql += " and cl.line_code = '"+line+"'";
401 if(ttId.length() != 0) 401 if(ttId.length() != 0)
402 sql += " and td.ttinfo = '"+ttId+"'"; 402 sql += " and td.ttinfo = '"+ttId+"'";
403 - sql += " group by td.lp"; 403 + sql += " group by td.lp, lp.lp_name";
404 404
405 list = jdbcTemplate.query(sql, 405 list = jdbcTemplate.query(sql,
406 new RowMapper<Map<String, Object>>(){ 406 new RowMapper<Map<String, Object>>(){
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
@@ -132,8 +132,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -132,8 +132,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
132 132
133 Long getMaxId(); 133 Long getMaxId();
134 Map<String,Object> scheduleDaily(String line,String date); 134 Map<String,Object> scheduleDaily(String line,String date);
135 -  
136 List<ScheduleRealInfo> realScheduleList(String line,String date); 135 List<ScheduleRealInfo> realScheduleList(String line,String date);
  136 + List<ScheduleRealInfo> realScheduleList_zrw(String line,String date);
137 List<ScheduleRealInfo> realScheduleListQp(String line,String date); 137 List<ScheduleRealInfo> realScheduleListQp(String line,String date);
138 138
139 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String jGh,String nbbm); 139 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String jGh,String nbbm);
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -611,111 +611,119 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -611,111 +611,119 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
611 * 临加班次 611 * 临加班次
612 */ 612 */
613 @Override 613 @Override
614 - public Map<String, Object> save(ScheduleRealInfo t) { 614 + public Map<String, Object> save(ScheduleRealInfo sch) {
615 Map<String, Object> rs = new HashMap<>(); 615 Map<String, Object> rs = new HashMap<>();
616 try { 616 try {
617 - if (!carExist(t.getGsBm(), t.getClZbh())) {  
618 - rs.put("msg", "车辆 " + t.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!");  
619 - rs.put("status", ResponseCode.ERROR);  
620 - return rs; 617 + String clZbh = sch.getClZbh();
  618 + if (StringUtils.isNotEmpty(clZbh)) {
  619 + //检测
  620 + if (!carExist(sch.getGsBm(), clZbh)) {
  621 + rs.put("status", ResponseCode.ERROR);
  622 + rs.put("msg", "车辆 " + clZbh + " 不存在!");
  623 + return rs;
  624 + } else if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(clZbh))) {
  625 + rs.put("status", ResponseCode.ERROR);
  626 + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + clZbh + "】的车辆");
  627 + return rs;
  628 + }
621 } 629 }
622 630
623 SysUser user = SecurityUtils.getCurrentUser(); 631 SysUser user = SecurityUtils.getCurrentUser();
624 - String schDate = DayOfSchedule.currSchDateMap.get(t.getXlBm()); 632 + String schDate = DayOfSchedule.currSchDateMap.get(sch.getXlBm());
625 633
626 SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"), sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm"); 634 SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"), sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm");
627 635
628 - if (StringUtils.isEmpty(t.getjGh())) { 636 + if (StringUtils.isEmpty(sch.getjGh())) {
629 rs.put("status", ResponseCode.ERROR); 637 rs.put("status", ResponseCode.ERROR);
630 rs.put("msg", "驾驶员工号不能为空!"); 638 rs.put("msg", "驾驶员工号不能为空!");
631 return rs; 639 return rs;
632 } 640 }
633 //截取驾驶员工号 641 //截取驾驶员工号
634 - if (t.getjGh().indexOf("-") != -1) {  
635 - t.setjGh(t.getjGh().split("-")[1]); 642 + if (sch.getjGh().indexOf("-") != -1) {
  643 + sch.setjGh(sch.getjGh().split("-")[1]);
636 } 644 }
637 //检查驾驶员工号 645 //检查驾驶员工号
638 - String jName = getPersonName(t.getGsBm(), t.getjGh()); 646 + String jName = getPersonName(sch.getGsBm(), sch.getjGh());
639 if (StringUtils.isEmpty(jName)) { 647 if (StringUtils.isEmpty(jName)) {
640 - rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); 648 + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员");
641 rs.put("status", ResponseCode.ERROR); 649 rs.put("status", ResponseCode.ERROR);
642 return rs; 650 return rs;
643 - } else if (StringUtils.isEmpty(t.getjName())) {  
644 - t.setjName(jName);//补上驾驶员名称 651 + } else if (StringUtils.isEmpty(sch.getjName())) {
  652 + sch.setjName(jName);//补上驾驶员名称
645 } 653 }
646 654
647 //有售票员 655 //有售票员
648 - if (StringUtils.isNotEmpty(t.getsGh())) {  
649 - String sName = getPersonName(t.getGsBm(), t.getsGh()); 656 + if (StringUtils.isNotEmpty(sch.getsGh())) {
  657 + String sName = getPersonName(sch.getGsBm(), sch.getsGh());
650 if (StringUtils.isEmpty(sName)) { 658 if (StringUtils.isEmpty(sName)) {
651 - rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); 659 + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的售票员");
652 rs.put("status", ResponseCode.ERROR); 660 rs.put("status", ResponseCode.ERROR);
653 return rs; 661 return rs;
654 - } else if (StringUtils.isEmpty(t.getsName())) {  
655 - t.setsName(sName);//补上售票员名称 662 + } else if (StringUtils.isEmpty(sch.getsName())) {
  663 + sch.setsName(sName);//补上售票员名称
656 } 664 }
657 } else { 665 } else {
658 - t.setsGh("");  
659 - t.setsName(""); 666 + sch.setsGh("");
  667 + sch.setsName("");
660 } 668 }
661 669
662 //公司 和 分公司名称 670 //公司 和 分公司名称
663 - t.setGsName(BasicData.businessCodeNameMap.get(t.getGsBm()));  
664 - t.setFgsName(BasicData.businessFgsCodeNameMap.get(t.getFgsBm() + "_" + t.getGsBm()));  
665 - t.setCreateDate(new Date());  
666 - t.setScheduleDateStr(schDate);  
667 - t.setScheduleDate(sdfyyyyMMdd.parse(schDate));  
668 - t.setRealExecDate(schDate);  
669 -  
670 - t.setCreateBy(user);  
671 - t.setSflj(true);  
672 - t.setLate(false);  
673 - t.setDfsj(t.getFcsj());  
674 - t.setZdsjT(sdfyyyyMMddHHmm.parse(schDate + t.getZdsj()).getTime());  
675 - t.setJhlcOrig(t.getJhlc());  
676 - t.setCreateDate(new Date());  
677 - t.setUpdateDate(new Date());  
678 - t.setSpId(-1L); 671 + sch.setGsName(BasicData.businessCodeNameMap.get(sch.getGsBm()));
  672 + sch.setFgsName(BasicData.businessFgsCodeNameMap.get(sch.getFgsBm() + "_" + sch.getGsBm()));
  673 + sch.setCreateDate(new Date());
  674 + sch.setScheduleDateStr(schDate);
  675 + sch.setScheduleDate(sdfyyyyMMdd.parse(schDate));
  676 + sch.setRealExecDate(schDate);
  677 +
  678 + sch.setCreateBy(user);
  679 + sch.setSflj(true);
  680 + sch.setLate(false);
  681 + sch.setDfsj(sch.getFcsj());
  682 + sch.setZdsjT(sdfyyyyMMddHHmm.parse(schDate + sch.getZdsj()).getTime());
  683 + sch.setJhlcOrig(sch.getJhlc());
  684 + sch.setCreateDate(new Date());
  685 + sch.setUpdateDate(new Date());
  686 + sch.setSpId(-1L);
679 //起终点名称 687 //起终点名称
680 - String prefix = t.getXlBm() + "_" + t.getXlDir() + "_";  
681 - t.setQdzName(BasicData.getStationNameByCode(t.getQdzCode(), prefix));  
682 - t.setZdzName(BasicData.getStationNameByCode(t.getZdzCode(), prefix)); 688 + String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_";
  689 + sch.setQdzName(BasicData.getStationNameByCode(sch.getQdzCode(), prefix));
  690 + sch.setZdzName(BasicData.getStationNameByCode(sch.getZdzCode(), prefix));
683 691
684 //计算班次实际执行时间 692 //计算班次实际执行时间
685 - schAttrCalculator.calcRealDate(t).calcAllTimeByFcsj(t); 693 + schAttrCalculator.calcRealDate(sch).calcAllTimeByFcsj(sch);
686 694
687 //处理计达跨24点 695 //处理计达跨24点
688 - LineConfig conf = lineConfigData.get(t.getXlBm());  
689 - if (t.getZdsj().compareTo(conf.getStartOpt()) < 0) {  
690 - t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime() + (1000 * 60 * 60 * 24)); 696 + LineConfig conf = lineConfigData.get(sch.getXlBm());
  697 + if (sch.getZdsj().compareTo(conf.getStartOpt()) < 0) {
  698 + sch.setZdsjT(sdfyyyyMMddHHmm.parse(sch.getScheduleDateStr() + sch.getZdsj()).getTime() + (1000 * 60 * 60 * 24));
691 } 699 }
692 700
693 //班次历时 701 //班次历时
694 - t.setBcsj((int) ((t.getZdsjT() - t.getDfsjT()) / 1000 / 60));  
695 - if (t.getZdsjT() < t.getFcsjT()) { 702 + sch.setBcsj((int) ((sch.getZdsjT() - sch.getDfsjT()) / 1000 / 60));
  703 + if (sch.getZdsjT() < sch.getFcsjT()) {
696 rs.put("status", ResponseCode.ERROR); 704 rs.put("status", ResponseCode.ERROR);
697 rs.put("msg", "起终点时间异常!"); 705 rs.put("msg", "起终点时间异常!");
698 return rs; 706 return rs;
699 } 707 }
700 708
701 - t.setId(dayOfSchedule.getId()); 709 + sch.setId(dayOfSchedule.getId());
702 //实时入库 710 //实时入库
703 - super.save(t); 711 + super.save(sch);
704 712
705 // 加入缓存 713 // 加入缓存
706 - dayOfSchedule.put(t); 714 + dayOfSchedule.put(sch);
707 715
708 //更新起点应到时间 716 //更新起点应到时间
709 - List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(t); 717 + List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch);
710 718
711 //重新计算车辆当前执行班次 719 //重新计算车辆当前执行班次
712 - dayOfSchedule.reCalcExecPlan(t.getClZbh()); 720 + dayOfSchedule.reCalcExecPlan(sch.getClZbh());
713 721
714 //记录站到场历时数据 722 //记录站到场历时数据
715 - Station2ParkBuffer.put(t); 723 + Station2ParkBuffer.put(sch);
716 724
717 rs.put("ts", ts); 725 rs.put("ts", ts);
718 - rs.put("t", t); 726 + rs.put("t", sch);
719 } catch (Exception e) { 727 } catch (Exception e) {
720 logger.error("", e); 728 logger.error("", e);
721 rs.put("status", ResponseCode.ERROR); 729 rs.put("status", ResponseCode.ERROR);
@@ -3433,6 +3441,195 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3433,6 +3441,195 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3433 } 3441 }
3434 3442
3435 @Override 3443 @Override
  3444 + public List<ScheduleRealInfo> realScheduleList_zrw(String line, String date) {
  3445 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  3446 + String lpName = "lpName";
  3447 + String zdsj = "";
  3448 + String zdsjActual = "";
  3449 + String zdsj1 = "";
  3450 + String zdsjActual1 = "";
  3451 + List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleDdrb(line, date);
  3452 +
  3453 + /*
  3454 + * 对计划发车时间相同的班次进行排序 out最前 in最后
  3455 + */
  3456 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3457 + String minfcsj = "02:00";
  3458 + List<Line> lineList = lineRepository.findLineByCode(line);
  3459 + if (lineList.size() > 0) {
  3460 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  3461 + + " id = ("
  3462 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  3463 + + ")";
  3464 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  3465 + }
  3466 + String[] minSjs = minfcsj.split(":");
  3467 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  3468 + for (int i = 0; i < listInfo.size(); i++) {
  3469 + ScheduleRealInfo s = listInfo.get(i);
  3470 + if (s.getBcType().equals("out")) {
  3471 + s.setRemark("1");
  3472 + } else if (s.getBcType().equals("in")) {
  3473 + s.setRemark("3");
  3474 + } else {
  3475 + s.setRemark("2");
  3476 + }
  3477 + String[] fcsj = s.getFcsj().split(":");
  3478 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  3479 +
  3480 + Long fscjT = 0L;
  3481 + if (fcsjL < minSj) {
  3482 + Calendar calendar = new GregorianCalendar();
  3483 + calendar.setTime(s.getScheduleDate());
  3484 + calendar.add(calendar.DATE, 1);
  3485 + s.setScheduleDate(calendar.getTime());
  3486 + try {
  3487 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
  3488 + } catch (ParseException e) {
  3489 + // TODO Auto-generated catch block
  3490 + e.printStackTrace();
  3491 + }
  3492 +
  3493 + } else {
  3494 + try {
  3495 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  3496 + } catch (ParseException e) {
  3497 + // TODO Auto-generated catch block
  3498 + e.printStackTrace();
  3499 + }
  3500 + ;
  3501 + }
  3502 + s.setFcsjT(fscjT);
  3503 + }
  3504 +
  3505 +// Collections.sort(listInfo, new compareLpFcsjType());
  3506 + List<ScheduleRealInfo> listInfo2=new ArrayList<ScheduleRealInfo>();
  3507 +
  3508 + Collections.sort(listInfo, new compareLpFcsjType());
  3509 + for (int i = 0; i < listInfo.size(); i++) {
  3510 + ScheduleRealInfo t = listInfo.get(i);
  3511 + if (!lpName.equals(t.getLpName())) {
  3512 + zdsjActual = t.getZdsjActual();
  3513 + zdsj = t.getZdsj();
  3514 + t.setZdsjActual("");
  3515 + t.setZdsj("");
  3516 + } else {
  3517 + zdsj1 = t.getZdsj();
  3518 + zdsjActual1 = t.getZdsjActual();
  3519 + t.setZdsjActual(zdsjActual);
  3520 + t.setZdsj(zdsj);
  3521 + zdsj = zdsj1;
  3522 + zdsjActual = zdsjActual1;
  3523 + }
  3524 +
  3525 +
  3526 +
  3527 + lpName = t.getLpName();
  3528 + listInfo2.add(t);
  3529 +
  3530 + }
  3531 +
  3532 + Collections.sort(listInfo2,new compareDirLpFcsjType());
  3533 + for (int i = 0; i < listInfo2.size(); i++) {
  3534 + ScheduleRealInfo t=listInfo2.get(i);
  3535 + list.add(t);
  3536 + Set<ChildTaskPlan> childTaskPlans = t.getcTasks();
  3537 + //计算营运里程,空驶里程
  3538 + if (!childTaskPlans.isEmpty()) {
  3539 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
  3540 + Collections.sort(listit, new ComparableChild());
  3541 + for (int j = 0; j < listit.size(); j++) {
  3542 + ScheduleRealInfo s = new ScheduleRealInfo();
  3543 + ChildTaskPlan childTaskPlan = listit.get(j);
  3544 + if (childTaskPlan.getCcId() == null) {
  3545 + if (childTaskPlan.isDestroy()) {
  3546 + s.setFcsjActual("");
  3547 + s.setZdsjActual("");
  3548 + } else {
  3549 + s.setFcsjActual(childTaskPlan.getStartDate());
  3550 + s.setZdsjActual("");
  3551 + s.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  3552 + }
  3553 + s.setFcsj(childTaskPlan.getStartDate());
  3554 + s.setZdsj("");
  3555 + s.setQdzName(childTaskPlan.getStartStationName());
  3556 + s.setZdzName(childTaskPlan.getEndStationName());
  3557 + s.setRemarks(childTaskPlan.getRemarks());
  3558 + s.setAdjustExps("子");
  3559 + s.setLpName("");
  3560 + list.add(s);
  3561 + }
  3562 + }
  3563 + }
  3564 + }
  3565 + List<ScheduleRealInfo> xList = new ArrayList<ScheduleRealInfo>();
  3566 + List<ScheduleRealInfo> yList = new ArrayList<ScheduleRealInfo>();
  3567 + List<ScheduleRealInfo> zList = new ArrayList<ScheduleRealInfo>();
  3568 + List<ScheduleRealInfo> newList = new ArrayList<ScheduleRealInfo>();
  3569 + if (list.size() > 0) {
  3570 + int a = list.size() % 3;
  3571 + int b = list.size() / 3;
  3572 + int x = 0, y = 0;
  3573 + if (a == 2) {
  3574 + x = b + 1;
  3575 + y = x * 2;
  3576 + } else if (a == 1) {
  3577 + x = b + 1;
  3578 + y = x * 2 - 1;
  3579 + } else {
  3580 + x = b;
  3581 + y = 2 * x;
  3582 +
  3583 + }
  3584 + for (int i = 0; i < list.size(); i++) {
  3585 + ScheduleRealInfo s = list.get(i);
  3586 + if (i + 1 <= x) {
  3587 + xList.add(s);
  3588 + } else if ((i + 1) > x && (i + 1) <= y) {
  3589 + yList.add(s);
  3590 + } else {
  3591 + zList.add(s);
  3592 + }
  3593 + }
  3594 + for (int i = 0; i < x; i++) {
  3595 + newList.add(xList.get(i));
  3596 + if (yList.size() > i) {
  3597 + newList.add(yList.get(i));
  3598 + } else {
  3599 + newList.add(new ScheduleRealInfo());
  3600 + }
  3601 + if (zList.size() > i) {
  3602 + newList.add(zList.get(i));
  3603 + } else {
  3604 + newList.add(new ScheduleRealInfo());
  3605 + }
  3606 +
  3607 + }
  3608 + }
  3609 + /* for (int i = 0; i < newList.size(); i++) {
  3610 + ScheduleRealInfo t1 = newList.get(i);
  3611 + for (int j = 0; j < list.size(); j++) {
  3612 + ScheduleRealInfo t2 = list.get(j);
  3613 + if (t1.getId() == t2.getId()) {
  3614 + t1 = t2;
  3615 + }
  3616 + }
  3617 + }*/
  3618 +
  3619 + for (int i = 0; i < newList.size(); i++) {
  3620 + ScheduleRealInfo t1 = newList.get(i);
  3621 + String reamrks1 = t1.getRemarks() == null ? "" : t1.getRemarks();
  3622 + if (reamrks1.length() > 4) {
  3623 + t1.setRemarks(reamrks1.substring(0, 4));
  3624 + t1.setRemark(reamrks1);
  3625 + } else {
  3626 + t1.setRemark(reamrks1);
  3627 + }
  3628 + }
  3629 + return newList;
  3630 + }
  3631 +
  3632 + @Override
3436 public List<ScheduleRealInfo> realScheduleList_mh_2(String line, String date) { 3633 public List<ScheduleRealInfo> realScheduleList_mh_2(String line, String date) {
3437 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 3634 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
3438 String lpName = "lpName"; 3635 String lpName = "lpName";
@@ -4774,13 +4971,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4774,13 +4971,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4774 String xlName = map.get("xlName").toString(); 4971 String xlName = map.get("xlName").toString();
4775 String state = map.get("state").toString(); 4972 String state = map.get("state").toString();
4776 String type = map.get("type").toString(); 4973 String type = map.get("type").toString();
4777 - 4974 + String genre =map.get("genre").toString();
4778 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>(); 4975 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>();
4779 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>(); 4976 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>();
4780 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null); 4977 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null);
4781 List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state); 4978 List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state);
4782 - List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);  
4783 - 4979 + List<ScheduleRealInfo> list3 = new ArrayList<ScheduleRealInfo>();
  4980 + if(genre.equals("qp"))
  4981 + list3=this.realScheduleListQp(line, date);
  4982 + else if(genre.equals("zrw"))
  4983 + list3=this.realScheduleList_zrw(line, date);
  4984 + else
  4985 + list3=this.realScheduleList(line, date);
4784 Map<String, Object> nMap = new HashMap<String, Object>(); 4986 Map<String, Object> nMap = new HashMap<String, Object>();
4785 nMap.put("date", xlName + date); 4987 nMap.put("date", xlName + date);
4786 nMap.put("jls", list1.get(0).get("jls")); 4988 nMap.put("jls", list1.get(0).get("jls"));
@@ -4908,7 +5110,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4908,7 +5110,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4908 } 5110 }
4909 } 5111 }
4910 tempMap.put("zdsjk" + x, zdsjk); 5112 tempMap.put("zdsjk" + x, zdsjk);
4911 - tempMap.put("zdsjm" + x, zdsjm); 5113 + tempMap.put("zdsjm" + x, zdsjm.equals("0")?"":zdsjm);
4912 tempMap.put("fcsj" + x, schedule.getFcsj()); 5114 tempMap.put("fcsj" + x, schedule.getFcsj());
4913 String fcsjActural = schedule.getFcsjActual() != null ? schedule.getFcsjActual() : ""; 5115 String fcsjActural = schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "";
4914 String bcType = schedule.getBcType() != null ? schedule.getBcType() : ""; 5116 String bcType = schedule.getBcType() != null ? schedule.getBcType() : "";
@@ -4935,7 +5137,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4935,7 +5137,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4935 } 5137 }
4936 } 5138 }
4937 tempMap.put("fcsjk" + x, fcsjk); 5139 tempMap.put("fcsjk" + x, fcsjk);
4938 - tempMap.put("fcsjm" + x, fcsjm); 5140 + tempMap.put("fcsjm" + x, fcsjm.equals("0")?"":fcsjm);
4939 tempMap.put("remarks" + x, schedule.getRemark() != null ? schedule.getRemark() : ""); 5141 tempMap.put("remarks" + x, schedule.getRemark() != null ? schedule.getRemark() : "");
4940 5142
4941 size++; 5143 size++;
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
@@ -10,7 +10,10 @@ import java.util.List; @@ -10,7 +10,10 @@ import java.util.List;
10 * Created by xu on 16/5/9. 10 * Created by xu on 16/5/9.
11 */ 11 */
12 public interface CarConfigInfoService extends BService<CarConfigInfo, Long> { 12 public interface CarConfigInfoService extends BService<CarConfigInfo, Long> {
  13 + // 判定车辆是否配置在其他线路上
13 void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException; 14 void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException;
  15 + // 判定车辆是否配置在其他线路上2
  16 + void validate_cars(Integer xlId, Integer clId) throws ScheduleException;
14 // 判定车辆是否配置在当前线路中 17 // 判定车辆是否配置在当前线路中
15 void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException; 18 void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException;
16 // 判定车辆所属公司和当前用户的所属公司 19 // 判定车辆所属公司和当前用户的所属公司
src/main/java/com/bsth/service/schedule/SchedulePlanService.java
1 package com.bsth.service.schedule; 1 package com.bsth.service.schedule;
2 2
3 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
4 -import com.bsth.service.schedule.rules.ttinfo2.Result; 4 +import com.bsth.service.schedule.impl.plan.kBase3.validate.rule.ValidateRuleResult;
  5 +import com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.Result;
5 6
6 import java.util.Date; 7 import java.util.Date;
7 8
@@ -26,4 +27,13 @@ public interface SchedulePlanService extends BService&lt;SchedulePlan, Long&gt; { @@ -26,4 +27,13 @@ public interface SchedulePlanService extends BService&lt;SchedulePlan, Long&gt; {
26 * @return 27 * @return
27 */ 28 */
28 Result validateTTInfo(Integer xlid, Date from, Date to); 29 Result validateTTInfo(Integer xlid, Date from, Date to);
  30 +
  31 + /**
  32 + * 验证规则。
  33 + * @param xlId 线路id
  34 + * @param from 排班计划开始时间
  35 + * @param to 排班计划结束时间
  36 + * @return
  37 + */
  38 + ValidateRuleResult validateRule(Integer xlId, Date from, Date to);
29 } 39 }
30 \ No newline at end of file 40 \ No newline at end of file
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
@@ -130,6 +130,18 @@ public class CarConfigInfoServiceImpl extends BServiceImpl&lt;CarConfigInfo, Long&gt; @@ -130,6 +130,18 @@ public class CarConfigInfoServiceImpl extends BServiceImpl&lt;CarConfigInfo, Long&gt;
130 } 130 }
131 131
132 @Override 132 @Override
  133 + public void validate_cars(Integer xlId, Integer clId) throws ScheduleException {
  134 + Map<String, Object> param = new HashMap<>();
  135 + param.put("cl.id_eq", clId);
  136 + List<CarConfigInfo> carConfigInfos = list(param);
  137 + for (CarConfigInfo carConfigInfo : carConfigInfos) {
  138 + if (!carConfigInfo.getXl().getId().equals(xlId)) {
  139 + throw new ScheduleException("车辆不配置在当前线路下,配置在" + carConfigInfo.getXl().getName() + "线路中!");
  140 + }
  141 + }
  142 + }
  143 +
  144 + @Override
133 public void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException { 145 public void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException {
134 Map<String, Object> param = new HashMap<>(); 146 Map<String, Object> param = new HashMap<>();
135 param.put("xl.id_eq", carConfigInfo.getXl().getId()); 147 param.put("xl.id_eq", carConfigInfo.getXl().getId());
src/main/java/com/bsth/service/schedule/impl/CarsServiceImpl.java
1 package com.bsth.service.schedule.impl; 1 package com.bsth.service.schedule.impl;
2 2
  3 +import com.bsth.entity.CarDevice;
3 import com.bsth.entity.Cars; 4 import com.bsth.entity.Cars;
  5 +import com.bsth.entity.schedule.CarConfigInfo;
  6 +import com.bsth.repository.schedule.CarConfigInfoRepository;
  7 +import com.bsth.service.schedule.CarDeviceService;
4 import com.bsth.service.schedule.CarsService; 8 import com.bsth.service.schedule.CarsService;
5 import com.bsth.service.schedule.exception.ScheduleException; 9 import com.bsth.service.schedule.exception.ScheduleException;
6 import com.bsth.service.schedule.utils.DataToolsFile; 10 import com.bsth.service.schedule.utils.DataToolsFile;
@@ -12,7 +16,9 @@ import org.springframework.transaction.annotation.Transactional; @@ -12,7 +16,9 @@ import org.springframework.transaction.annotation.Transactional;
12 import org.springframework.util.CollectionUtils; 16 import org.springframework.util.CollectionUtils;
13 17
14 import java.io.File; 18 import java.io.File;
  19 +import java.util.Date;
15 import java.util.HashMap; 20 import java.util.HashMap;
  21 +import java.util.List;
16 import java.util.Map; 22 import java.util.Map;
17 23
18 /** 24 /**
@@ -24,6 +30,48 @@ public class CarsServiceImpl extends BServiceImpl&lt;Cars, Integer&gt; implements Cars @@ -24,6 +30,48 @@ public class CarsServiceImpl extends BServiceImpl&lt;Cars, Integer&gt; implements Cars
24 @Qualifier(value = "cars_dataTool") 30 @Qualifier(value = "cars_dataTool")
25 private DataToolsService dataToolsService; 31 private DataToolsService dataToolsService;
26 32
  33 + @Autowired
  34 + @Qualifier(value = "carDeviceServiceImpl_sc")
  35 + private CarDeviceService carDeviceService;
  36 +
  37 + @Autowired
  38 + private CarConfigInfoRepository carConfigInfoRepository;
  39 +
  40 + @Override
  41 + public Cars save(Cars cars) {
  42 + if (cars.getId() != null && cars.getScrapState()) { // 更新车辆信息,报废车辆
  43 + // 1、作废的车辆,修改报废号
  44 + String eCode = cars.getEquipmentCode();
  45 + cars.setEquipmentCode("BF-" + eCode);
  46 + cars.setScrapCode("BF-" + cars.getEquipmentCode());
  47 + // 2、添加一条相关的设备替换记录
  48 + // 查找在哪条线路上
  49 + List<CarConfigInfo> carConfigInfoList = carConfigInfoRepository.findByClId(cars.getId());
  50 + for (CarConfigInfo carConfigInfo : carConfigInfoList) {
  51 + CarDevice carDevice = new CarDevice();
  52 + carDevice.setGsName(cars.getCompany());
  53 + carDevice.setCompany(cars.getBusinessCode());
  54 + carDevice.setBrancheCompany(cars.getBrancheCompanyCode());
  55 + carDevice.setCl(cars.getId());
  56 + carDevice.setClZbh(cars.getInsideCode());
  57 + carDevice.setXl(carConfigInfo.getXl().getId());
  58 + carDevice.setXlName(carConfigInfo.getXl().getName());
  59 + carDevice.setXlBm(carConfigInfo.getXl().getLineCode());
  60 + carDevice.setOldDeviceNo(eCode);
  61 + carDevice.setNewDeviceNo("BF-" + eCode);
  62 + carDevice.setIsCancel(false);
  63 +
  64 + carDevice.setCreateBy(cars.getCreateBy());
  65 + carDevice.setUpdateBy(cars.getUpdateBy());
  66 + carDevice.setCreateDate(new Date());
  67 + carDevice.setUpdateDate(new Date());
  68 + carDeviceService.save(carDevice);
  69 + }
  70 + }
  71 +
  72 + return super.save(cars);
  73 + }
  74 +
27 @Override 75 @Override
28 public void importData(File file, Map<String, Object> params) throws ScheduleException { 76 public void importData(File file, Map<String, Object> params) throws ScheduleException {
29 dataToolsService.importData(file, params); 77 dataToolsService.importData(file, params);
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
1 package com.bsth.service.schedule.impl; 1 package com.bsth.service.schedule.impl;
2 2
  3 +import com.bsth.entity.Line;
3 import com.bsth.entity.schedule.SchedulePlan; 4 import com.bsth.entity.schedule.SchedulePlan;
4 import com.bsth.entity.schedule.TTInfo; 5 import com.bsth.entity.schedule.TTInfo;
5 import com.bsth.repository.BusinessRepository; 6 import com.bsth.repository.BusinessRepository;
@@ -7,10 +8,11 @@ import com.bsth.repository.LineRepository; @@ -7,10 +8,11 @@ import com.bsth.repository.LineRepository;
7 import com.bsth.repository.schedule.*; 8 import com.bsth.repository.schedule.*;
8 import com.bsth.service.schedule.SchedulePlanService; 9 import com.bsth.service.schedule.SchedulePlanService;
9 import com.bsth.service.schedule.exception.ScheduleException; 10 import com.bsth.service.schedule.exception.ScheduleException;
10 -import com.bsth.service.schedule.plan.DroolsSchedulePlan;  
11 -import com.bsth.service.schedule.rules.ScheduleRuleService;  
12 -import com.bsth.service.schedule.rules.ttinfo2.CalcuParam;  
13 -import com.bsth.service.schedule.rules.ttinfo2.Result; 11 +import com.bsth.service.schedule.impl.plan.kBase3.validate.rule.ValidateRuleResult;
  12 +import com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.CalcuParam;
  13 +import com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.Result;
  14 +import com.bsth.service.schedule.impl.plan.DroolsSchedulePlan;
  15 +import com.bsth.service.schedule.impl.plan.ScheduleRuleService;
14 import org.joda.time.DateTime; 16 import org.joda.time.DateTime;
15 import org.kie.api.KieBase; 17 import org.kie.api.KieBase;
16 import org.kie.api.runtime.KieSession; 18 import org.kie.api.runtime.KieSession;
@@ -42,6 +44,10 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -42,6 +44,10 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
42 private KieBase preKBase; 44 private KieBase preKBase;
43 45
44 @Autowired 46 @Autowired
  47 + @Qualifier("KBase3")
  48 + private KieBase validateKBase;
  49 +
  50 + @Autowired
45 private ScheduleRule1FlatRepository scheduleRule1FlatRepository; 51 private ScheduleRule1FlatRepository scheduleRule1FlatRepository;
46 @Autowired 52 @Autowired
47 private TTInfoRepository ttInfoRepository; 53 private TTInfoRepository ttInfoRepository;
@@ -52,6 +58,8 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -52,6 +58,8 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
52 @Autowired 58 @Autowired
53 private CarConfigInfoRepository carConfigInfoRepository; 59 private CarConfigInfoRepository carConfigInfoRepository;
54 @Autowired 60 @Autowired
  61 + private GuideboardInfoRepository guideboardInfoRepository;
  62 + @Autowired
55 private EmployeeConfigInfoRepository employeeConfigInfoRepository; 63 private EmployeeConfigInfoRepository employeeConfigInfoRepository;
56 @Autowired 64 @Autowired
57 private BusinessRepository businessRepository; 65 private BusinessRepository businessRepository;
@@ -146,22 +154,25 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -146,22 +154,25 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
146 public Result validateTTInfo(Integer xlid, Date from, Date to) { 154 public Result validateTTInfo(Integer xlid, Date from, Date to) {
147 // 构造drools session->载入数据->启动规则->计算->销毁session 155 // 构造drools session->载入数据->启动规则->计算->销毁session
148 // 创建session,内部配置的是stateful 156 // 创建session,内部配置的是stateful
149 - KieSession session = coreKBase.newKieSession(); 157 + KieSession session = validateKBase.newKieSession();
150 // 设置gloable对象,在drl中通过别名使用 158 // 设置gloable对象,在drl中通过别名使用
151 session.setGlobal("log", logger); 159 session.setGlobal("log", logger);
152 - session.setGlobal("lineRepository", lineRepository);  
153 session.setGlobal("tTInfoDetailRepository", ttInfoDetailRepository); 160 session.setGlobal("tTInfoDetailRepository", ttInfoDetailRepository);
154 161
155 Result rs = new Result(); // 输出gloable对象 162 Result rs = new Result(); // 输出gloable对象
156 session.setGlobal("rs", rs); 163 session.setGlobal("rs", rs);
157 164
158 // 载入数据 165 // 载入数据
  166 + Line line = lineRepository.findOne(xlid);
  167 + session.insert(line);
  168 +
159 CalcuParam calcuParam = new CalcuParam( 169 CalcuParam calcuParam = new CalcuParam(
160 new DateTime(from), new DateTime(to), xlid); 170 new DateTime(from), new DateTime(to), xlid);
161 session.insert(calcuParam); 171 session.insert(calcuParam);
162 - List<TTInfo> ttInfos = (List<TTInfo>) ttInfoRepository.findAll();  
163 - for (TTInfo ttInfo: ttInfos)  
164 - session.insert(ttInfo); 172 + List<TTInfo> ttInfos = ttInfoRepository.findByXlId(xlid);
  173 + for (TTInfo ttInfo: ttInfos) {
  174 + session.insert(ttInfo);
  175 + }
165 176
166 // 执行rule 177 // 执行rule
167 session.fireAllRules(); 178 session.fireAllRules();
@@ -171,4 +182,30 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -171,4 +182,30 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
171 182
172 return rs; 183 return rs;
173 } 184 }
  185 +
  186 + @Override
  187 + public ValidateRuleResult validateRule(Integer xlId, Date from, Date to) {
  188 + KieSession session = validateKBase.newKieSession();
  189 + session.setGlobal("LOG", logger);
  190 + session.setGlobal("ccRepo", carConfigInfoRepository);
  191 + session.setGlobal("lpRepo", guideboardInfoRepository);
  192 + session.setGlobal("ecRepo", employeeConfigInfoRepository);
  193 + session.setGlobal("ruleRepo", scheduleRule1FlatRepository);
  194 +
  195 + ValidateRuleResult result = new ValidateRuleResult();
  196 + session.setGlobal("result", result);
  197 +
  198 + com.bsth.service.schedule.impl.plan.kBase3.validate.rule.CalcuParam calcuParam =
  199 + new com.bsth.service.schedule.impl.plan.kBase3.validate.rule.CalcuParam();
  200 + calcuParam.setXlId(xlId);
  201 + calcuParam.setFromDate(new DateTime(from));
  202 + calcuParam.setToDate(new DateTime(to));
  203 + session.insert(calcuParam);
  204 +
  205 + session.fireAllRules();
  206 +
  207 + session.dispose();;
  208 +
  209 + return result;
  210 + }
174 } 211 }
src/main/java/com/bsth/service/schedule/plan/DroolsSchedulePlan.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/DroolsSchedulePlan.java
1 -package com.bsth.service.schedule.plan; 1 +package com.bsth.service.schedule.impl.plan;
2 2
3 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
4 import com.bsth.entity.schedule.SchedulePlan; 4 import com.bsth.entity.schedule.SchedulePlan;
@@ -8,17 +8,16 @@ import com.bsth.entity.schedule.rule.ScheduleRule1Flat; @@ -8,17 +8,16 @@ import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
8 import com.bsth.repository.BusinessRepository; 8 import com.bsth.repository.BusinessRepository;
9 import com.bsth.repository.LineRepository; 9 import com.bsth.repository.LineRepository;
10 import com.bsth.repository.schedule.*; 10 import com.bsth.repository.schedule.*;
11 -import com.bsth.service.schedule.rules.ScheduleRuleService;  
12 -import com.bsth.service.schedule.rules.plan.PlanCalcuParam_input;  
13 -import com.bsth.service.schedule.rules.plan.PlanResult;  
14 -import com.bsth.service.schedule.rules.rerun.RerunRule_input;  
15 -import com.bsth.service.schedule.rules.rerun.RerunRule_param;  
16 -import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;  
17 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output;  
18 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;  
19 -import com.bsth.service.schedule.rules.ttinfo.*;  
20 -import com.bsth.service.schedule.rules.validate.ValidateParam;  
21 -import com.bsth.service.schedule.rules.validate.ValidateResults_output; 11 +import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanCalcuParam_input;
  12 +import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanResult;
  13 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;
  14 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_param;
  15 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleCalcuParam_input;
  16 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;
  17 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_input;
  18 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.*;
  19 +import com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidateParam;
  20 +import com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidateResults_output;
22 import org.apache.commons.lang3.StringUtils; 21 import org.apache.commons.lang3.StringUtils;
23 import org.joda.time.DateTime; 22 import org.joda.time.DateTime;
24 import org.kie.api.KieBase; 23 import org.kie.api.KieBase;
src/main/java/com/bsth/service/schedule/rules/MyDroolsConfiguration.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/MyDroolsConfiguration.java
1 -package com.bsth.service.schedule.rules; 1 +package com.bsth.service.schedule.impl.plan;
2 2
3 import org.kie.api.KieBase; 3 import org.kie.api.KieBase;
4 import org.kie.api.KieBaseConfiguration; 4 import org.kie.api.KieBaseConfiguration;
@@ -56,27 +56,24 @@ public class MyDroolsConfiguration { @@ -56,27 +56,24 @@ public class MyDroolsConfiguration {
56 // 3.2、写入drl(写法超多,有点混乱) 56 // 3.2、写入drl(写法超多,有点混乱)
57 // 这里使用文件的形式写入,TODO:以后考虑从数据库中读drl写入 57 // 这里使用文件的形式写入,TODO:以后考虑从数据库中读drl写入
58 // 注意kfs写的时候如果指定path,强制为src/main/resources/加上文件名,还有就是文件名不要重复否则会覆盖的 58 // 注意kfs写的时候如果指定path,强制为src/main/resources/加上文件名,还有就是文件名不要重复否则会覆盖的
59 - kfs.write("src/main/resources/functions.drl", kieServices.getResources() 59 + kfs.write("src/main/resources/kBase1_core_shiftloop.drl", kieServices.getResources()
60 .newInputStreamResource(this.getClass().getResourceAsStream( 60 .newInputStreamResource(this.getClass().getResourceAsStream(
61 - "/rules/functions.drl"), "UTF-8"));  
62 - kfs.write("src/main/resources/shiftloop_fb_2.drl", kieServices.getResources() 61 + "/rules/kBase1_core_shiftloop.drl"), "UTF-8"));
  62 + kfs.write("src/main/resources/kBase1_core_ttinfo.drl", kieServices.getResources()
63 .newInputStreamResource(this.getClass().getResourceAsStream( 63 .newInputStreamResource(this.getClass().getResourceAsStream(
64 - "/rules/shiftloop_fb_2.drl"), "UTF-8"));  
65 - kfs.write("src/main/resources/ttinfo.drl", kieServices.getResources() 64 + "/rules/kBase1_core_ttinfo.drl"), "UTF-8"));
  65 + kfs.write("src/main/resources/kBase1_core_plan.drl", kieServices.getResources()
66 .newInputStreamResource(this.getClass().getResourceAsStream( 66 .newInputStreamResource(this.getClass().getResourceAsStream(
67 - "/rules/ttinfo.drl"), "UTF-8"));  
68 - kfs.write("src/main/resources/ttinfo2.drl", kieServices.getResources() 67 + "/rules/kBase1_core_plan.drl"), "UTF-8"));
  68 + kfs.write("src/main/resources/kBase1_core_rerun.drl", kieServices.getResources()
69 .newInputStreamResource(this.getClass().getResourceAsStream( 69 .newInputStreamResource(this.getClass().getResourceAsStream(
70 - "/rules/ttinfo2.drl"), "UTF-8"));  
71 - kfs.write("src/main/resources/plan.drl", kieServices.getResources() 70 + "/rules/kBase1_core_rerun.drl"), "UTF-8"));
  71 + kfs.write("src/main/resources/kBase1_core_validate.drl", kieServices.getResources()
72 .newInputStreamResource(this.getClass().getResourceAsStream( 72 .newInputStreamResource(this.getClass().getResourceAsStream(
73 - "/rules/plan.drl"), "UTF-8"));  
74 - kfs.write("src/main/resources/rerun.drl", kieServices.getResources() 73 + "/rules/kBase1_core_validate.drl"), "UTF-8"));
  74 + kfs.write("src/main/resources/kBase1_core_functions.drl", kieServices.getResources()
75 .newInputStreamResource(this.getClass().getResourceAsStream( 75 .newInputStreamResource(this.getClass().getResourceAsStream(
76 - "/rules/rerun.drl"), "UTF-8"));  
77 - kfs.write("src/main/resources/validplan.drl", kieServices.getResources()  
78 - .newInputStreamResource(this.getClass().getResourceAsStream(  
79 - "/rules/validplan.drl"), "UTF-8")); 76 + "/rules/kBase1_core_functions.drl"), "UTF-8"));
80 // TODO:还有其他drl.... 77 // TODO:还有其他drl....
81 78
82 // 4、创建KieBuilder,使用KieFileSystem构建 79 // 4、创建KieBuilder,使用KieFileSystem构建
@@ -134,9 +131,9 @@ public class MyDroolsConfiguration { @@ -134,9 +131,9 @@ public class MyDroolsConfiguration {
134 // 这里使用文件的形式写入,TODO:以后考虑从数据库中读drl写入 131 // 这里使用文件的形式写入,TODO:以后考虑从数据库中读drl写入
135 // 注意kfs写的时候如果指定path,强制为src/main/resources/加上文件名,还有就是文件名不要重复否则会覆盖的 132 // 注意kfs写的时候如果指定path,强制为src/main/resources/加上文件名,还有就是文件名不要重复否则会覆盖的
136 133
137 - kfs.write("src/main/resources/ruleWrap.drl", kieServices.getResources() 134 + kfs.write("src/main/resources/kBase2_wrap_rule.drl", kieServices.getResources()
138 .newInputStreamResource(this.getClass().getResourceAsStream( 135 .newInputStreamResource(this.getClass().getResourceAsStream(
139 - "/rules/ruleWrap.drl"), "UTF-8")); 136 + "/rules/kBase2_wrap_rule.drl"), "UTF-8"));
140 137
141 // TODO:还有其他drl.... 138 // TODO:还有其他drl....
142 139
@@ -161,4 +158,52 @@ public class MyDroolsConfiguration { @@ -161,4 +158,52 @@ public class MyDroolsConfiguration {
161 158
162 return kieBase; 159 return kieBase;
163 } 160 }
  161 +
  162 + /**
  163 + * 验证相关的drl知识库。
  164 + * @return
  165 + */
  166 + @Bean(name = "KBase3")
  167 + public KieBase myKieBase3() {
  168 + KieServices kieServices = KieServices.Factory.get();
  169 + KieModuleModel kieModuleModel = kieServices.newKieModuleModel();
  170 + KieBaseModel kieBaseModel = kieModuleModel.newKieBaseModel("KBase3")
  171 + .setDefault(true)
  172 + .setEqualsBehavior(EqualityBehaviorOption.EQUALITY)
  173 + .setEventProcessingMode(EventProcessingOption.STREAM);
  174 + kieBaseModel.newKieSessionModel("KSession1")
  175 + .setDefault(true)
  176 + .setType(KieSessionModel.KieSessionType.STATEFUL)
  177 + .setClockType(ClockTypeOption.get("realtime"));
  178 +
  179 + KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
  180 + kieFileSystem.writeKModuleXML(kieModuleModel.toXML());
  181 +
  182 + kieFileSystem.write(
  183 + "src/main/resources/kBase3_validate_timetable.drl",
  184 + kieServices.getResources().newInputStreamResource(
  185 + this.getClass().getResourceAsStream("/rules/kBase3_validate_timetable.drl"),
  186 + "UTF-8"));
  187 + kieFileSystem.write(
  188 + "src/main/resources/kbase3_validate_rule.drl",
  189 + kieServices.getResources().newInputStreamResource(
  190 + this.getClass().getResourceAsStream("/rules/kBase3_validate_rule.drl"),
  191 + "UTF-8"));
  192 +
  193 + KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem).buildAll();
  194 + Results results = kieBuilder.getResults();
  195 + if (results.hasMessages(Message.Level.ERROR)) {
  196 + throw new IllegalStateException("构建drools6错误:" + results.getMessages());
  197 + }
  198 +
  199 + ReleaseId releaseId = kieServices.getRepository().getDefaultReleaseId();
  200 + KieContainer kieContainer = kieServices.newKieContainer(releaseId);
  201 +
  202 + KieBaseConfiguration kieBaseConfiguration = kieServices.newKieBaseConfiguration();
  203 + KieBase kieBase = kieContainer.newKieBase("KBase3", kieBaseConfiguration);
  204 +
  205 + return kieBase;
  206 +
  207 + }
  208 +
164 } 209 }
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleService.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/ScheduleRuleService.java
1 -package com.bsth.service.schedule.rules; 1 +package com.bsth.service.schedule.impl.plan;
2 2
3 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
4 import com.bsth.entity.schedule.SchedulePlanInfo; 4 import com.bsth.entity.schedule.SchedulePlanInfo;
5 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; 5 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult;
6 -import com.bsth.service.schedule.rules.rerun.RerunRule_input; 6 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;
7 7
8 import java.util.Date; 8 import java.util.Date;
9 import java.util.List; 9 import java.util.List;
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleServiceImpl.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/ScheduleRuleServiceImpl.java
1 -package com.bsth.service.schedule.rules; 1 +package com.bsth.service.schedule.impl.plan;
2 2
3 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
4 import com.bsth.entity.schedule.SchedulePlanInfo; 4 import com.bsth.entity.schedule.SchedulePlanInfo;
5 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; 5 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult;
6 -import com.bsth.service.schedule.rules.rerun.RerunRule_input; 6 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;
7 import org.slf4j.Logger; 7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
src/main/java/com/bsth/service/schedule/rules/plan/PlanCalcuParam_input.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/plan/PlanCalcuParam_input.java
1 -package com.bsth.service.schedule.rules.plan; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.plan;
2 2
3 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
4 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output;  
5 -import com.bsth.service.schedule.rules.ttinfo.TTInfoResults_output; 4 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;
  5 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResults_output;
6 6
7 /** 7 /**
8 * 排班规则-规则输入参数。 8 * 排班规则-规则输入参数。
src/main/java/com/bsth/service/schedule/rules/plan/PlanResult.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/plan/PlanResult.java
1 -package com.bsth.service.schedule.rules.plan; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.plan;
2 2
3 import com.bsth.entity.schedule.SchedulePlanInfo; 3 import com.bsth.entity.schedule.SchedulePlanInfo;
4 4
src/main/java/com/bsth/service/schedule/rules/plan/readme.txt renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/plan/readme.txt
src/main/java/com/bsth/service/schedule/rules/rerun/RerunRule_input.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/rerun/RerunRule_input.java
1 -package com.bsth.service.schedule.rules.rerun; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.rerun;
2 2
3 /** 3 /**
4 * Created by xu on 17/4/26. 4 * Created by xu on 17/4/26.
src/main/java/com/bsth/service/schedule/rules/rerun/RerunRule_param.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/rerun/RerunRule_param.java
1 -package com.bsth.service.schedule.rules.rerun; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.rerun;
2 2
3 import java.util.Set; 3 import java.util.Set;
4 4
src/main/java/com/bsth/service/schedule/rules/shiftloop/GidFbFcnoFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/GidFbFcnoFunction.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import com.bsth.entity.schedule.TTInfoDetail; 3 import com.bsth.entity.schedule.TTInfoDetail;
4 import org.kie.api.runtime.rule.AccumulateFunction; 4 import org.kie.api.runtime.rule.AccumulateFunction;
src/main/java/com/bsth/service/schedule/rules/shiftloop/GidFbTimeFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/GidFbTimeFunction.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import com.bsth.entity.schedule.TTInfoDetail; 3 import com.bsth.entity.schedule.TTInfoDetail;
4 import org.joda.time.LocalTime; 4 import org.joda.time.LocalTime;
src/main/java/com/bsth/service/schedule/rules/shiftloop/GidsCountFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/GidsCountFunction.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import com.bsth.entity.schedule.TTInfoDetail; 3 import com.bsth.entity.schedule.TTInfoDetail;
4 import org.kie.api.runtime.rule.AccumulateFunction; 4 import org.kie.api.runtime.rule.AccumulateFunction;
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleCalcuParam_input.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/ScheduleCalcuParam_input.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
4 import org.joda.time.DateTime; 4 import org.joda.time.DateTime;
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleResult_output.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/ScheduleResult_output.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import org.joda.time.DateTime; 3 import org.joda.time.DateTime;
4 4
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleResults_output.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/ScheduleResults_output.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; 3 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult;
4 import org.apache.commons.lang3.StringUtils; 4 import org.apache.commons.lang3.StringUtils;
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_Type.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/ScheduleRule_Type.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 /** 3 /**
4 * 排班规则_输入_输出_类型。 4 * 排班规则_输入_输出_类型。
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_input.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/shiftloop/ScheduleRule_input.java
1 -package com.bsth.service.schedule.rules.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import com.bsth.entity.schedule.rule.ScheduleRule1Flat; 3 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
4 import com.google.common.base.Splitter; 4 import com.google.common.base.Splitter;
src/main/java/com/bsth/service/schedule/rules/ttinfo/LpInfoResult_output.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/LpInfoResult_output.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 import org.joda.time.DateTime; 3 import org.joda.time.DateTime;
4 4
src/main/java/com/bsth/service/schedule/rules/ttinfo/LpInfoResultsFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/LpInfoResultsFunction.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 import com.bsth.entity.schedule.TTInfoDetail; 3 import com.bsth.entity.schedule.TTInfoDetail;
4 import org.kie.api.runtime.rule.AccumulateFunction; 4 import org.kie.api.runtime.rule.AccumulateFunction;
src/main/java/com/bsth/service/schedule/rules/ttinfo/LpInfoResults_output.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/LpInfoResults_output.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 import java.util.ArrayList; 3 import java.util.ArrayList;
4 import java.util.List; 4 import java.util.List;
src/main/java/com/bsth/service/schedule/rules/ttinfo/MinRuleQyrqFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/MinRuleQyrqFunction.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; 3 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_input;
4 import org.joda.time.DateTime; 4 import org.joda.time.DateTime;
5 import org.kie.api.runtime.rule.AccumulateFunction; 5 import org.kie.api.runtime.rule.AccumulateFunction;
6 6
src/main/java/com/bsth/service/schedule/rules/ttinfo/TTInfoCalcuParam_input.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/TTInfoCalcuParam_input.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 import org.joda.time.DateTime; 3 import org.joda.time.DateTime;
4 4
src/main/java/com/bsth/service/schedule/rules/ttinfo/TTInfoResult_output.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/TTInfoResult_output.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 import org.joda.time.DateTime; 3 import org.joda.time.DateTime;
4 4
src/main/java/com/bsth/service/schedule/rules/ttinfo/TTInfoResults_output.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/TTInfoResults_output.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 import com.google.common.collect.ArrayListMultimap; 3 import com.google.common.collect.ArrayListMultimap;
4 import com.google.common.collect.Multimap; 4 import com.google.common.collect.Multimap;
src/main/java/com/bsth/service/schedule/rules/ttinfo/TTInfo_input.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/TTInfo_input.java
1 -package com.bsth.service.schedule.rules.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
2 2
3 import com.bsth.entity.schedule.TTInfo; 3 import com.bsth.entity.schedule.TTInfo;
4 import org.apache.commons.lang3.StringUtils; 4 import org.apache.commons.lang3.StringUtils;
src/main/java/com/bsth/service/schedule/rules/ttinfo/readme.txt renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/ttinfo/readme.txt
src/main/java/com/bsth/service/schedule/rules/validate/ValidRepeatBcFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/validate/ValidRepeatBcFunction.java
1 -package com.bsth.service.schedule.rules.validate; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.validate;
2 2
3 import com.bsth.entity.schedule.SchedulePlanInfo; 3 import com.bsth.entity.schedule.SchedulePlanInfo;
4 import org.kie.api.runtime.rule.AccumulateFunction; 4 import org.kie.api.runtime.rule.AccumulateFunction;
src/main/java/com/bsth/service/schedule/rules/validate/ValidWantLpFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/validate/ValidWantLpFunction.java
1 -package com.bsth.service.schedule.rules.validate; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.validate;
2 2
3 import com.bsth.entity.schedule.SchedulePlanInfo; 3 import com.bsth.entity.schedule.SchedulePlanInfo;
4 -import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output; 4 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResult_output;
5 import org.kie.api.runtime.rule.AccumulateFunction; 5 import org.kie.api.runtime.rule.AccumulateFunction;
6 6
7 import java.io.*; 7 import java.io.*;
src/main/java/com/bsth/service/schedule/rules/validate/ValidWholeRerunBcFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/validate/ValidWholeRerunBcFunction.java
1 -package com.bsth.service.schedule.rules.validate; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.validate;
2 2
3 import com.bsth.entity.schedule.SchedulePlanInfo; 3 import com.bsth.entity.schedule.SchedulePlanInfo;
4 import org.kie.api.runtime.rule.AccumulateFunction; 4 import org.kie.api.runtime.rule.AccumulateFunction;
src/main/java/com/bsth/service/schedule/rules/validate/ValidateParam.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/validate/ValidateParam.java
1 -package com.bsth.service.schedule.rules.validate; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.validate;
2 2
3 import org.joda.time.DateTime; 3 import org.joda.time.DateTime;
4 import org.joda.time.Period; 4 import org.joda.time.Period;
src/main/java/com/bsth/service/schedule/rules/validate/ValidateResource.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/validate/ValidateResource.java
1 -package com.bsth.service.schedule.rules.validate; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.validate;
2 2
3 import com.bsth.entity.schedule.SchedulePlanInfo; 3 import com.bsth.entity.schedule.SchedulePlanInfo;
4 -import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output; 4 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResult_output;
5 5
6 import java.util.Date; 6 import java.util.Date;
7 import java.util.List; 7 import java.util.List;
src/main/java/com/bsth/service/schedule/rules/validate/ValidateResults_output.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase1/core/validate/ValidateResults_output.java
1 -package com.bsth.service.schedule.rules.validate; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.validate;
2 2
3 import java.util.ArrayList; 3 import java.util.ArrayList;
4 import java.util.Date; 4 import java.util.Date;
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/CalcuParam.java 0 → 100644
  1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +import org.joda.time.DateTime;
  4 +
  5 +/**
  6 + * 计算用参数。
  7 + */
  8 +public class CalcuParam {
  9 + /** 线路Id */
  10 + private Integer xlId;
  11 +
  12 + /** 计划开始计算日期 */
  13 + private DateTime fromDate;
  14 + /** 计划结束计算日期 */
  15 + private DateTime toDate;
  16 +
  17 + public Integer getXlId() {
  18 + return xlId;
  19 + }
  20 +
  21 + public void setXlId(Integer xlId) {
  22 + this.xlId = xlId;
  23 + }
  24 +
  25 + public DateTime getFromDate() {
  26 + return fromDate;
  27 + }
  28 +
  29 + public void setFromDate(DateTime fromDate) {
  30 + this.fromDate = fromDate;
  31 + }
  32 +
  33 + public DateTime getToDate() {
  34 + return toDate;
  35 + }
  36 +
  37 + public void setToDate(DateTime toDate) {
  38 + this.toDate = toDate;
  39 + }
  40 +}
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/ErrorInfoFunction.java 0 → 100644
  1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +
  4 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  5 +import com.bsth.entity.schedule.GuideboardInfo;
  6 +import org.apache.commons.lang3.StringUtils;
  7 +import org.apache.commons.lang3.math.NumberUtils;
  8 +import org.kie.api.runtime.rule.AccumulateFunction;
  9 +
  10 +import java.io.*;
  11 +import java.util.HashMap;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 查找错误函数。
  16 + */
  17 +public class ErrorInfoFunction implements AccumulateFunction {
  18 + @Override
  19 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  20 +
  21 + }
  22 +
  23 + @Override
  24 + public void writeExternal(ObjectOutput out) throws IOException {
  25 +
  26 + }
  27 +
  28 + protected static class ErrorInfoContext implements Externalizable {
  29 + /** 错误数量 */
  30 + public Integer errorCount = 0;
  31 + /** 错误Map,Map<规则id,errorInfo> */
  32 + public Map<Long, ValidateRuleResult.ErrorInfo> errorInfoMap = new HashMap<>();
  33 +
  34 + public ErrorInfoContext() {
  35 +
  36 + }
  37 +
  38 + @Override
  39 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  40 + errorCount = in.readInt();
  41 + errorInfoMap = (Map<Long, ValidateRuleResult.ErrorInfo>) in.readObject();
  42 +
  43 + }
  44 +
  45 + @Override
  46 + public void writeExternal(ObjectOutput out) throws IOException {
  47 + out.writeInt(errorCount);
  48 + out.writeObject(errorInfoMap);
  49 + }
  50 +
  51 + }
  52 +
  53 + @Override
  54 + public Serializable createContext() {
  55 + return new ErrorInfoContext();
  56 + }
  57 +
  58 + @Override
  59 + public void init(Serializable serializable) throws Exception {
  60 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  61 + errorInfoContext.errorCount = 0;
  62 + errorInfoContext.errorInfoMap = new HashMap<>();
  63 + }
  64 +
  65 + @Override
  66 + public void accumulate(Serializable serializable, Object o) {
  67 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  68 + WrapInput wrapInput = (WrapInput) o;
  69 +
  70 + ValidateRuleResult.ErrorInfo errorInfo = new ValidateRuleResult.ErrorInfo();
  71 + errorInfo.setRuleId(wrapInput.getRuleId());
  72 + errorInfo.setClZbh(wrapInput.getClZbh());
  73 + errorInfo.setQyrq(wrapInput.getQyrq());
  74 +
  75 + // 1、车辆配置验证
  76 + if (StringUtils.isNotEmpty(wrapInput.getClZbh())) { // 自编号不能为空
  77 + if (wrapInput.getCcInfos().get(wrapInput.getClZbh()) == null) { // 车辆配置不在当前线路上
  78 + errorInfo.getErrorDescList().add("车辆配置不在当前线路,请重新编辑保存!");
  79 + }
  80 + } else {
  81 + errorInfo.getErrorDescList().add("自编号不能为空,请重新编辑保存!");
  82 + }
  83 +
  84 + // 2、路牌id,路牌名字,路牌起始索引验证
  85 + if (StringUtils.isNotEmpty(wrapInput.getLpIds()) &&
  86 + StringUtils.isNotEmpty(wrapInput.getLpNames())) { // 冗余的路牌id和路牌名字都不能为空
  87 + String[] lpIds = wrapInput.getLpIds().split(",");
  88 + String[] lpNames = wrapInput.getLpNames().split(",");
  89 + if (lpIds.length == lpNames.length) { // 路牌id和路牌名字个数一致
  90 + for (int i = 0; i < lpIds.length; i++) {
  91 + if (!NumberUtils.isDigits(lpIds[i])) { // 冗余路牌id必须是数字
  92 + errorInfo.getErrorDescList().add("冗余路牌id必须是数字,请重新编辑保存!");
  93 + break;
  94 + }
  95 +
  96 + GuideboardInfo lpInfo = wrapInput.getLpInfos().get(NumberUtils.toLong(lpIds[i]));
  97 + if (lpInfo == null) { // 路牌不在当前线路上
  98 + errorInfo.getErrorDescList().add("路牌不在当前线路上,请重新编辑保存!");
  99 + } else {
  100 + if (StringUtils.isEmpty(lpNames[i]) ||
  101 + !(lpNames[i].equals(lpInfo.getLpName()))) { // 路牌id和路牌名字不对应
  102 + errorInfo.getErrorDescList().add("路牌id和路牌名字不对应,请重新编辑保存!");
  103 + break;
  104 + }
  105 + }
  106 + }
  107 +
  108 + if (wrapInput.getLpStartIndex() < 1 ||
  109 + wrapInput.getLpStartIndex() > lpIds.length) { // 路牌起始索引溢出
  110 + errorInfo.getErrorDescList().add("路牌起始索引溢出,请重新编辑保存!");
  111 + }
  112 + } else {
  113 + errorInfo.getErrorDescList().add("路牌id和路牌名字个数不一致,请重新编辑保存!");
  114 + }
  115 + } else {
  116 + errorInfo.getErrorDescList().add("冗余的路牌id和路牌名字都不能为空,请重新编辑保存!");
  117 + }
  118 +
  119 + // 3、人员配置,搭班编码,人员起始索引验证
  120 + if (StringUtils.isNotEmpty(wrapInput.getEcIds()) &&
  121 + StringUtils.isNotEmpty(wrapInput.getEcDbbms())) { // 冗余的人员配置id和人员搭班编码都不能为空
  122 + String[] ecIds = wrapInput.getEcIds().split(",");
  123 + String[] ecDbbms = wrapInput.getEcDbbms().split(",");
  124 + if (ecIds.length == ecDbbms.length) { // 人员配置id和搭班编码个数一致
  125 + for (int i = 0; i < ecIds.length; i++) {
  126 + if (ecIds[i].contains("-")) { // 分班标识
  127 + String[] fb_ecIds = ecIds[i].split("-");
  128 + String[] fb_ecDbbms = ecDbbms[i].split("-");
  129 + if (fb_ecIds.length != 2 || fb_ecDbbms.length != 2) { // 只能早晚分班
  130 + errorInfo.getErrorDescList().add("只能早晚分班,请重新编辑保存!");
  131 + break;
  132 + } else {
  133 + EmployeeConfigInfo fb_ecInfo1 = wrapInput.getEcInfos().get(NumberUtils.toLong(fb_ecIds[0]));
  134 + EmployeeConfigInfo fb_ecInfo2 = wrapInput.getEcInfos().get(NumberUtils.toLong(fb_ecIds[1]));
  135 + if (fb_ecInfo1 == null || fb_ecInfo2 == null) { // 分班的人员配置不在当前线路
  136 + errorInfo.getErrorDescList().add("分班的人员配置不在当前线路,请重新编辑保存!");
  137 + break;
  138 + } else {
  139 + if (StringUtils.isEmpty(fb_ecDbbms[0]) ||
  140 + StringUtils.isEmpty(fb_ecDbbms[1]) ||
  141 + !(fb_ecDbbms[0].equals(fb_ecInfo1.getDbbm())) ||
  142 + !(fb_ecDbbms[1].equals(fb_ecInfo2.getDbbm()))) { // 分班人员配置id和搭班编码不对应
  143 + errorInfo.getErrorDescList().add("分班人员配置id和搭班编码不对应,请重新编辑保存!");
  144 + break;
  145 + }
  146 + }
  147 + }
  148 +
  149 + } else {
  150 + if (!NumberUtils.isDigits(ecIds[i])) { // 冗余的人员配置id必须是数字
  151 + errorInfo.getErrorDescList().add("冗余的人员配置id必须是数字,请重新编辑保存!");
  152 + break;
  153 + }
  154 +
  155 + EmployeeConfigInfo ecInfo = wrapInput.getEcInfos().get(NumberUtils.toLong(ecIds[i]));
  156 + if (ecInfo == null) { // 人员配置不在当前线路
  157 + errorInfo.getErrorDescList().add("人员配置不在当前线路,请重新编辑保存!");
  158 + break;
  159 + } else {
  160 + if (StringUtils.isEmpty(ecDbbms[i]) ||
  161 + !(ecDbbms[i].equals(ecInfo.getDbbm()))) { // 人员配置id和搭班编码不对应
  162 + errorInfo.getErrorDescList().add("人员配置id和搭班编码不对应,请重新编辑保存!");
  163 + break;
  164 + }
  165 + }
  166 + }
  167 + }
  168 +
  169 + if (wrapInput.getEcStartIndex() < 1 ||
  170 + wrapInput.getEcStartIndex() > ecIds.length) { // 人员起始索引溢出
  171 + errorInfo.getErrorDescList().add("人员起始索引溢出,请重新编辑保存!");
  172 + }
  173 + } else {
  174 + errorInfo.getErrorDescList().add("人员配置id和搭班编码个数不一致,请重新编辑保存!");
  175 + }
  176 + }
  177 +
  178 + if (errorInfo.getErrorDescList().size() > 0) {
  179 + errorInfoContext.errorCount ++;
  180 + errorInfoContext.errorInfoMap.put(wrapInput.getRuleId(), errorInfo);
  181 + }
  182 +
  183 + }
  184 +
  185 + @Override
  186 + public void reverse(Serializable serializable, Object o) throws Exception {
  187 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  188 + WrapInput wrapInput = (WrapInput) o;
  189 +
  190 + if (errorInfoContext.errorInfoMap.get(wrapInput.getRuleId()) != null) {
  191 + errorInfoContext.errorInfoMap.remove(wrapInput.getRuleId());
  192 + errorInfoContext.errorCount --;
  193 + }
  194 + }
  195 +
  196 + @Override
  197 + public Object getResult(Serializable serializable) throws Exception {
  198 + ErrorInfoContext errorInfoContext = (ErrorInfoContext) serializable;
  199 + return errorInfoContext.errorInfoMap;
  200 + }
  201 +
  202 + @Override
  203 + public boolean supportsReverse() {
  204 + return true;
  205 + }
  206 +
  207 + @Override
  208 + public Class<?> getResultType() {
  209 + return Map.class;
  210 + }
  211 +
  212 +}
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/ValidateRuleResult.java 0 → 100644
  1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 输出结果值。
  9 + */
  10 +public class ValidateRuleResult {
  11 + /** 线路id */
  12 + private Integer xlId;
  13 + /** 规则总数量 */
  14 + private Integer count;
  15 + /** 启用的规则数量 */
  16 + private Integer qyCount;
  17 + /** 启用规则中的错误数量 */
  18 + private Integer qyErrorCount;
  19 + /** 错误列表 */
  20 + private List<ErrorInfo> errorInfos = new ArrayList<>();
  21 +
  22 + public Integer getXlId() {
  23 + return xlId;
  24 + }
  25 +
  26 + public void setXlId(Integer xlId) {
  27 + this.xlId = xlId;
  28 + }
  29 +
  30 + public Integer getCount() {
  31 + return count;
  32 + }
  33 +
  34 + public void setCount(Integer count) {
  35 + this.count = count;
  36 + }
  37 +
  38 + public Integer getQyCount() {
  39 + return qyCount;
  40 + }
  41 +
  42 + public void setQyCount(Integer qyCount) {
  43 + this.qyCount = qyCount;
  44 + }
  45 +
  46 + public Integer getQyErrorCount() {
  47 + return qyErrorCount;
  48 + }
  49 +
  50 + public void setQyErrorCount(Integer qyErrorCount) {
  51 + this.qyErrorCount = qyErrorCount;
  52 + }
  53 +
  54 + public List<ErrorInfo> getErrorInfos() {
  55 + return errorInfos;
  56 + }
  57 +
  58 + public void setErrorInfos(List<ErrorInfo> errorInfos) {
  59 + this.errorInfos = errorInfos;
  60 + }
  61 +
  62 + public static class ErrorInfo {
  63 + /** 规则id */
  64 + private Long ruleId;
  65 + /** 车辆自编号 */
  66 + private String clZbh;
  67 + /** 启用日期 */
  68 + private Date qyrq;
  69 + /** 错误描述 */
  70 + private List<String> errorDescList = new ArrayList<>();
  71 +
  72 + public Long getRuleId() {
  73 + return ruleId;
  74 + }
  75 +
  76 + public void setRuleId(Long ruleId) {
  77 + this.ruleId = ruleId;
  78 + }
  79 +
  80 + public String getClZbh() {
  81 + return clZbh;
  82 + }
  83 +
  84 + public void setClZbh(String clZbh) {
  85 + this.clZbh = clZbh;
  86 + }
  87 +
  88 + public Date getQyrq() {
  89 + return qyrq;
  90 + }
  91 +
  92 + public void setQyrq(Date qyrq) {
  93 + this.qyrq = qyrq;
  94 + }
  95 +
  96 + public List<String> getErrorDescList() {
  97 + return errorDescList;
  98 + }
  99 +
  100 + public void setErrorDescList(List<String> errorDescList) {
  101 + this.errorDescList = errorDescList;
  102 + }
  103 + }
  104 +}
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/WrapInput.java 0 → 100644
  1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +import com.bsth.entity.schedule.CarConfigInfo;
  4 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  5 +import com.bsth.entity.schedule.GuideboardInfo;
  6 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  7 +import org.springframework.util.CollectionUtils;
  8 +
  9 +import java.util.*;
  10 +
  11 +/**
  12 + * 聚合输入的待判定数据。
  13 + */
  14 +public class WrapInput {
  15 + /** 线路Id */
  16 + private Integer xlId;
  17 + /** 车辆自编号 */
  18 + private String clZbh;
  19 + /** 路牌id列表 */
  20 + private String lpIds;
  21 + /** 路牌名字列表 */
  22 + private String lpNames;
  23 + /** 人员配置列表 */
  24 + private String ecIds;
  25 + /** 人员搭班编码列表 */
  26 + private String ecDbbms;
  27 + /** 路牌循环起始索引 */
  28 + private Integer lpStartIndex;
  29 + /** 人员循环起始索引 */
  30 + private Integer ecStartIndex;
  31 + /** 规则id */
  32 + private Long ruleId;
  33 + /** 启用日期 */
  34 + private Date qyrq;
  35 +
  36 + private Map<String, CarConfigInfo> ccInfos = new HashMap<>();
  37 + private Map<Long, GuideboardInfo> lpInfos = new HashMap<>();
  38 + private Map<Long, EmployeeConfigInfo> ecInfos = new HashMap<>();
  39 +
  40 + public WrapInput(ScheduleRule1Flat r,
  41 + Map<String, CarConfigInfo> cc,
  42 + Map<Long, GuideboardInfo> lp,
  43 + Map<Long, EmployeeConfigInfo> ec) {
  44 + this.xlId = r.getXl().getId();
  45 + this.clZbh = r.getCarConfigInfo().getCl().getInsideCode();
  46 + this.lpIds = r.getLpIds();
  47 + this.lpNames = r.getLpNames();
  48 + this.ecIds = r.getRyConfigIds();
  49 + this.ecDbbms = r.getRyDbbms();
  50 + this.lpStartIndex = r.getLpStart();
  51 + this.ecStartIndex = r.getRyStart();
  52 + this.ruleId = r.getId();
  53 + this.qyrq = r.getQyrq();
  54 +
  55 + if (!CollectionUtils.isEmpty(cc)) {
  56 + this.ccInfos.putAll(cc);
  57 + }
  58 + if (!CollectionUtils.isEmpty(lp)) {
  59 + this.lpInfos.putAll(lp);
  60 + }
  61 + if (!CollectionUtils.isEmpty(ec)) {
  62 + this.ecInfos.putAll(ec);
  63 + }
  64 +
  65 + }
  66 +
  67 + public Integer getXlId() {
  68 + return xlId;
  69 + }
  70 +
  71 + public void setXlId(Integer xlId) {
  72 + this.xlId = xlId;
  73 + }
  74 +
  75 + public String getClZbh() {
  76 + return clZbh;
  77 + }
  78 +
  79 + public void setClZbh(String clZbh) {
  80 + this.clZbh = clZbh;
  81 + }
  82 +
  83 + public String getLpIds() {
  84 + return lpIds;
  85 + }
  86 +
  87 + public void setLpIds(String lpIds) {
  88 + this.lpIds = lpIds;
  89 + }
  90 +
  91 + public String getLpNames() {
  92 + return lpNames;
  93 + }
  94 +
  95 + public void setLpNames(String lpNames) {
  96 + this.lpNames = lpNames;
  97 + }
  98 +
  99 + public String getEcIds() {
  100 + return ecIds;
  101 + }
  102 +
  103 + public void setEcIds(String ecIds) {
  104 + this.ecIds = ecIds;
  105 + }
  106 +
  107 + public String getEcDbbms() {
  108 + return ecDbbms;
  109 + }
  110 +
  111 + public void setEcDbbms(String ecDbbms) {
  112 + this.ecDbbms = ecDbbms;
  113 + }
  114 +
  115 + public Integer getLpStartIndex() {
  116 + return lpStartIndex;
  117 + }
  118 +
  119 + public void setLpStartIndex(Integer lpStartIndex) {
  120 + this.lpStartIndex = lpStartIndex;
  121 + }
  122 +
  123 + public Integer getEcStartIndex() {
  124 + return ecStartIndex;
  125 + }
  126 +
  127 + public void setEcStartIndex(Integer ecStartIndex) {
  128 + this.ecStartIndex = ecStartIndex;
  129 + }
  130 +
  131 + public Long getRuleId() {
  132 + return ruleId;
  133 + }
  134 +
  135 + public void setRuleId(Long ruleId) {
  136 + this.ruleId = ruleId;
  137 + }
  138 +
  139 + public Date getQyrq() {
  140 + return qyrq;
  141 + }
  142 +
  143 + public void setQyrq(Date qyrq) {
  144 + this.qyrq = qyrq;
  145 + }
  146 +
  147 + public Map<String, CarConfigInfo> getCcInfos() {
  148 + return ccInfos;
  149 + }
  150 +
  151 + public void setCcInfos(Map<String, CarConfigInfo> ccInfos) {
  152 + this.ccInfos = ccInfos;
  153 + }
  154 +
  155 + public Map<Long, GuideboardInfo> getLpInfos() {
  156 + return lpInfos;
  157 + }
  158 +
  159 + public void setLpInfos(Map<Long, GuideboardInfo> lpInfos) {
  160 + this.lpInfos = lpInfos;
  161 + }
  162 +
  163 + public Map<Long, EmployeeConfigInfo> getEcInfos() {
  164 + return ecInfos;
  165 + }
  166 +
  167 + public void setEcInfos(Map<Long, EmployeeConfigInfo> ecInfos) {
  168 + this.ecInfos = ecInfos;
  169 + }
  170 +}
src/main/java/com/bsth/service/schedule/rules/ttinfo2/CalcuParam.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/timetable/CalcuParam.java
1 -package com.bsth.service.schedule.rules.ttinfo2; 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.timetable;
2 2
3 import org.joda.time.DateTime; 3 import org.joda.time.DateTime;
4 4
src/main/java/com/bsth/service/schedule/rules/ttinfo2/ErrorBcCountFunction.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/timetable/ErrorBcCountFunction.java
1 -package com.bsth.service.schedule.rules.ttinfo2; 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.timetable;
2 2
3 import com.bsth.entity.schedule.TTInfoDetail; 3 import com.bsth.entity.schedule.TTInfoDetail;
4 import org.apache.commons.lang3.StringUtils; 4 import org.apache.commons.lang3.StringUtils;
src/main/java/com/bsth/service/schedule/rules/ttinfo2/Result.java renamed to src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/timetable/Result.java
1 -package com.bsth.service.schedule.rules.ttinfo2; 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.timetable;
2 2
3 import java.util.ArrayList; 3 import java.util.ArrayList;
4 import java.util.List; 4 import java.util.List;
@@ -22,6 +22,8 @@ public class Result { @@ -22,6 +22,8 @@ public class Result {
22 private Long ttid; 22 private Long ttid;
23 /** 时刻表名字 */ 23 /** 时刻表名字 */
24 private String ttname; 24 private String ttname;
  25 + /** 线路版本 */
  26 + private Integer lineVersion;
25 27
26 /** 所有班次数 */ 28 /** 所有班次数 */
27 private Long allbc; 29 private Long allbc;
@@ -90,5 +92,13 @@ public class Result { @@ -90,5 +92,13 @@ public class Result {
90 public void setErrorbc(Long errorbc) { 92 public void setErrorbc(Long errorbc) {
91 this.errorbc = errorbc; 93 this.errorbc = errorbc;
92 } 94 }
  95 +
  96 + public Integer getLineVersion() {
  97 + return lineVersion;
  98 + }
  99 +
  100 + public void setLineVersion(Integer lineVersion) {
  101 + this.lineVersion = lineVersion;
  102 + }
93 } 103 }
94 } 104 }
src/main/resources/datatools/ktrs/carsDataOutput.ktr
@@ -10,13 +10,18 @@ @@ -10,13 +10,18 @@
10 <directory>&#x2f;</directory> 10 <directory>&#x2f;</directory>
11 <parameters> 11 <parameters>
12 <parameter> 12 <parameter>
  13 + <name>QUERY</name>
  14 + <default_value/>
  15 + <description>&#x67e5;&#x8be2;</description>
  16 + </parameter>
  17 + <parameter>
13 <name>cgsbm_in</name> 18 <name>cgsbm_in</name>
14 <default_value/> 19 <default_value/>
15 <description>&#x5206;&#x516c;&#x53f8;&#x7f16;&#x7801;</description> 20 <description>&#x5206;&#x516c;&#x53f8;&#x7f16;&#x7801;</description>
16 </parameter> 21 </parameter>
17 <parameter> 22 <parameter>
18 <name>filepath</name> 23 <name>filepath</name>
19 - <default_value/> 24 + <default_value>1&#x3d;1</default_value>
20 <description>excel&#x6587;&#x4ef6;&#x8def;&#x5f84;</description> 25 <description>excel&#x6587;&#x4ef6;&#x8def;&#x5f84;</description>
21 </parameter> 26 </parameter>
22 </parameters> 27 </parameters>
@@ -192,6 +197,102 @@ @@ -192,6 +197,102 @@
192 </attributes> 197 </attributes>
193 </connection> 198 </connection>
194 <connection> 199 <connection>
  200 + <name>JGJW_VM</name>
  201 + <server>192.168.198.240</server>
  202 + <type>ORACLE</type>
  203 + <access>Native</access>
  204 + <database>orcl</database>
  205 + <port>1521</port>
  206 + <username>jwgl</username>
  207 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10d485a8d6</password>
  208 + <servername/>
  209 + <data_tablespace/>
  210 + <index_tablespace/>
  211 + <attributes>
  212 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  213 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  214 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  215 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  216 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  217 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  218 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  219 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  220 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  221 + </attributes>
  222 + </connection>
  223 + <connection>
  224 + <name>NHJW_VM</name>
  225 + <server>192.168.198.240</server>
  226 + <type>ORACLE</type>
  227 + <access>Native</access>
  228 + <database>orcl</database>
  229 + <port>1521</port>
  230 + <username>nhjw</username>
  231 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10d09aa5cd</password>
  232 + <servername/>
  233 + <data_tablespace/>
  234 + <index_tablespace/>
  235 + <attributes>
  236 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  237 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  238 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  239 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  240 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  241 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  242 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  243 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  244 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  245 + </attributes>
  246 + </connection>
  247 + <connection>
  248 + <name>PDGJ_VM</name>
  249 + <server>192.168.198.240</server>
  250 + <type>ORACLE</type>
  251 + <access>Native</access>
  252 + <database>orcl</database>
  253 + <port>1521</port>
  254 + <username>pdgj</username>
  255 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10ce96a8d0</password>
  256 + <servername/>
  257 + <data_tablespace/>
  258 + <index_tablespace/>
  259 + <attributes>
  260 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  261 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  262 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  263 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  264 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  265 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  266 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  267 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  268 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  269 + </attributes>
  270 + </connection>
  271 + <connection>
  272 + <name>SNJW_VM</name>
  273 + <server>192.168.198.240</server>
  274 + <type>ORACLE</type>
  275 + <access>Native</access>
  276 + <database>orcl</database>
  277 + <port>1521</port>
  278 + <username>snjw</username>
  279 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10cd9ca5cd</password>
  280 + <servername/>
  281 + <data_tablespace/>
  282 + <index_tablespace/>
  283 + <attributes>
  284 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  285 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  286 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  287 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  288 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  289 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  290 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  291 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  292 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  293 + </attributes>
  294 + </connection>
  295 + <connection>
195 <name>xlab_mysql_youle</name> 296 <name>xlab_mysql_youle</name>
196 <server>101.231.124.8</server> 297 <server>101.231.124.8</server>
197 <type>MYSQL</type> 298 <type>MYSQL</type>
@@ -270,6 +371,102 @@ @@ -270,6 +371,102 @@
270 <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute> 371 <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
271 </attributes> 372 </attributes>
272 </connection> 373 </connection>
  374 + <connection>
  375 + <name>YGJW_VM</name>
  376 + <server>192.168.198.240</server>
  377 + <type>ORACLE</type>
  378 + <access>Native</access>
  379 + <database>orcl</database>
  380 + <port>1521</port>
  381 + <username>ygjw</username>
  382 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10c795a5cd</password>
  383 + <servername/>
  384 + <data_tablespace/>
  385 + <index_tablespace/>
  386 + <attributes>
  387 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  388 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  389 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  390 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  391 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  392 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  393 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  394 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  395 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  396 + </attributes>
  397 + </connection>
  398 + <connection>
  399 + <name>&#x516c;&#x53f8;jgjw</name>
  400 + <server>192.168.168.1</server>
  401 + <type>ORACLE</type>
  402 + <access>Native</access>
  403 + <database>orcl</database>
  404 + <port>1521</port>
  405 + <username>jwgl</username>
  406 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10d485a8d6</password>
  407 + <servername/>
  408 + <data_tablespace/>
  409 + <index_tablespace/>
  410 + <attributes>
  411 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  412 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  413 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  414 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  415 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  416 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  417 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  418 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  419 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  420 + </attributes>
  421 + </connection>
  422 + <connection>
  423 + <name>&#x516c;&#x53f8;snjw</name>
  424 + <server>192.168.168.1</server>
  425 + <type>ORACLE</type>
  426 + <access>Native</access>
  427 + <database>orcl</database>
  428 + <port>1521</port>
  429 + <username>snjw</username>
  430 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10cd9ca5cd</password>
  431 + <servername/>
  432 + <data_tablespace/>
  433 + <index_tablespace/>
  434 + <attributes>
  435 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  436 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  437 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  438 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  439 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  440 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  441 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  442 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  443 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  444 + </attributes>
  445 + </connection>
  446 + <connection>
  447 + <name>&#x516c;&#x53f8;ygjw</name>
  448 + <server>192.168.168.1</server>
  449 + <type>ORACLE</type>
  450 + <access>Native</access>
  451 + <database>orcl</database>
  452 + <port>1521</port>
  453 + <username>ygjw</username>
  454 + <password>Encrypted 2be98afc86aa7f2e4cb79ce10c795a5cd</password>
  455 + <servername/>
  456 + <data_tablespace/>
  457 + <index_tablespace/>
  458 + <attributes>
  459 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  460 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  461 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  462 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  463 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  464 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  465 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  466 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  467 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  468 + </attributes>
  469 + </connection>
273 <order> 470 <order>
274 <hop> <from>&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop> 471 <hop> <from>&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</to><enabled>Y</enabled> </hop>
275 <hop> <from>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop> 472 <hop> <from>&#x5206;&#x516c;&#x53f8;&#x67e5;&#x8be2;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>
@@ -480,7 +677,7 @@ @@ -480,7 +677,7 @@
480 <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name> 677 <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
481 <type>SelectValues</type> 678 <type>SelectValues</type>
482 <description/> 679 <description/>
483 - <distribute>Y</distribute> 680 + <distribute>N</distribute>
484 <custom_distribution/> 681 <custom_distribution/>
485 <copies>1</copies> 682 <copies>1</copies>
486 <partitioning> 683 <partitioning>
@@ -525,6 +722,36 @@ @@ -525,6 +722,36 @@
525 </step> 722 </step>
526 723
527 <step> 724 <step>
  725 + <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>
  726 + <type>ScriptValueMod</type>
  727 + <description/>
  728 + <distribute>Y</distribute>
  729 + <custom_distribution/>
  730 + <copies>1</copies>
  731 + <partitioning>
  732 + <method>none</method>
  733 + <schema_name/>
  734 + </partitioning>
  735 + <compatible>N</compatible>
  736 + <optimizationLevel>9</optimizationLevel>
  737 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  738 + <jsScript_name>Script 1</jsScript_name>
  739 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#xa;if&#x28;sfdc_cal &#x3d;&#x3d; 0&#x29; &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#x7d; else if &#x28;sfdc_cal &#x3d;&#x3d; 1&#x29; &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x662f;&#x22;&#x3b;&#xa;&#x7d; else &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#x7d;&#xa;</jsScript_script>
  740 + </jsScript> </jsScripts> <fields> <field> <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>
  741 + <rename>&#x662f;&#x5426;&#x7535;&#x8f66;</rename>
  742 + <type>String</type>
  743 + <length>-1</length>
  744 + <precision>-1</precision>
  745 + <replace>N</replace>
  746 + </field> </fields> <cluster_schema/>
  747 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  748 + <xloc>695</xloc>
  749 + <yloc>173</yloc>
  750 + <draw>Y</draw>
  751 + </GUI>
  752 + </step>
  753 +
  754 + <step>
528 <name>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</name> 755 <name>&#x6dfb;&#x52a0;&#x67e5;&#x8be2;&#x5e38;&#x91cf;</name>
529 <type>ScriptValueMod</type> 756 <type>ScriptValueMod</type>
530 <description/> 757 <description/>
@@ -566,7 +793,7 @@ @@ -566,7 +793,7 @@
566 <schema_name/> 793 <schema_name/>
567 </partitioning> 794 </partitioning>
568 <connection>bus_control_variable</connection> 795 <connection>bus_control_variable</connection>
569 - <sql>SELECT &#x2a; FROM bsth_c_cars&#xa;&#xa;</sql> 796 + <sql>SELECT &#x2a; FROM bsth_c_cars&#xa;where &#x24;&#x7b;QUERY&#x7d;</sql>
570 <limit>0</limit> 797 <limit>0</limit>
571 <lookup/> 798 <lookup/>
572 <execute_each_row>N</execute_each_row> 799 <execute_each_row>N</execute_each_row>
@@ -580,36 +807,6 @@ @@ -580,36 +807,6 @@
580 </GUI> 807 </GUI>
581 </step> 808 </step>
582 809
583 - <step>  
584 - <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>  
585 - <type>ScriptValueMod</type>  
586 - <description/>  
587 - <distribute>Y</distribute>  
588 - <custom_distribution/>  
589 - <copies>1</copies>  
590 - <partitioning>  
591 - <method>none</method>  
592 - <schema_name/>  
593 - </partitioning>  
594 - <compatible>N</compatible>  
595 - <optimizationLevel>9</optimizationLevel>  
596 - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>  
597 - <jsScript_name>Script 1</jsScript_name>  
598 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x5426;&#x22;&#x3b;&#xa;&#xa;if&#x28;sfdc_cal&#x29; &#x7b;&#xa; &#x662f;&#x5426;&#x7535;&#x8f66; &#x3d; &#x22;&#x662f;&#x22;&#x3b;&#xa;&#x7d;&#xa;</jsScript_script>  
599 - </jsScript> </jsScripts> <fields> <field> <name>&#x662f;&#x5426;&#x7535;&#x8f66;</name>  
600 - <rename>&#x662f;&#x5426;&#x7535;&#x8f66;</rename>  
601 - <type>String</type>  
602 - <length>-1</length>  
603 - <precision>-1</precision>  
604 - <replace>N</replace>  
605 - </field> </fields> <cluster_schema/>  
606 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
607 - <xloc>695</xloc>  
608 - <yloc>173</yloc>  
609 - <draw>Y</draw>  
610 - </GUI>  
611 - </step>  
612 -  
613 <step_error_handling> 810 <step_error_handling>
614 </step_error_handling> 811 </step_error_handling>
615 <slave-step-copy-partition-distribution> 812 <slave-step-copy-partition-distribution>
src/main/resources/rules/functions.drl deleted 100644 → 0
1 -package com.bsth.service.schedule;  
2 -  
3 -import accumulate com.bsth.service.schedule.rules.ttinfo2.ErrorBcCountFunction ecount;  
4 -import accumulate com.bsth.service.schedule.rules.shiftloop.GidsCountFunction gidscount;  
5 -import accumulate com.bsth.service.schedule.rules.shiftloop.GidFbTimeFunction gidfbtime;  
6 -import accumulate com.bsth.service.schedule.rules.shiftloop.GidFbFcnoFunction gidfbfcno;  
7 -import accumulate com.bsth.service.schedule.rules.ttinfo.LpInfoResultsFunction lpinforesult;  
8 -import accumulate com.bsth.service.schedule.rules.ttinfo.MinRuleQyrqFunction minruleqyrq;  
9 -import accumulate com.bsth.service.schedule.rules.validate.ValidRepeatBcFunction vrb;  
10 -import accumulate com.bsth.service.schedule.rules.validate.ValidWholeRerunBcFunction vwrb;  
11 -import accumulate com.bsth.service.schedule.rules.validate.ValidWantLpFunction vwlp;  
src/main/resources/rules/kBase1_core_functions.drl 0 → 100644
  1 +package com.bsth.service.schedule.impl.plan.kBase1.core;
  2 +
  3 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidsCountFunction gidscount;
  4 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbTimeFunction gidfbtime;
  5 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbFcnoFunction gidfbfcno;
  6 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResultsFunction lpinforesult;
  7 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.MinRuleQyrqFunction minruleqyrq;
  8 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidRepeatBcFunction vrb;
  9 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWholeRerunBcFunction vwrb;
  10 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWantLpFunction vwlp;
src/main/resources/rules/plan.drl renamed to src/main/resources/rules/kBase1_core_plan.drl
1 -package com.bsth.service.schedule.plan; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.plan;
2 2
3 import org.joda.time.*; 3 import org.joda.time.*;
4 import java.util.*; 4 import java.util.*;
5 5
6 -import com.bsth.service.schedule.rules.plan.PlanCalcuParam_input;  
7 -import com.bsth.service.schedule.rules.plan.PlanResult; 6 +import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanCalcuParam_input;
  7 +import com.bsth.service.schedule.impl.plan.kBase1.core.plan.PlanResult;
8 8
9 import com.bsth.repository.schedule.TTInfoDetailRepository; 9 import com.bsth.repository.schedule.TTInfoDetailRepository;
10 import com.bsth.repository.schedule.CarConfigInfoRepository; 10 import com.bsth.repository.schedule.CarConfigInfoRepository;
@@ -12,10 +12,10 @@ import com.bsth.repository.schedule.EmployeeConfigInfoRepository; @@ -12,10 +12,10 @@ import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
12 import com.bsth.repository.LineRepository; 12 import com.bsth.repository.LineRepository;
13 import com.bsth.repository.BusinessRepository; 13 import com.bsth.repository.BusinessRepository;
14 14
15 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output;  
16 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output;  
17 -import com.bsth.service.schedule.rules.ttinfo.TTInfoResult_output;  
18 -import com.bsth.service.schedule.rules.ttinfo.TTInfoResults_output; 15 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;
  16 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;
  17 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResult_output;
  18 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResults_output;
19 import com.bsth.entity.Line; 19 import com.bsth.entity.Line;
20 import com.bsth.entity.Business; 20 import com.bsth.entity.Business;
21 21
@@ -28,7 +28,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; @@ -28,7 +28,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo;
28 import org.slf4j.Logger 28 import org.slf4j.Logger
29 import org.joda.time.format.DateTimeFormat 29 import org.joda.time.format.DateTimeFormat
30 import org.apache.commons.lang3.StringUtils 30 import org.apache.commons.lang3.StringUtils
31 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_Type; 31 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_Type;
32 32
33 33
34 // 全局日志类(一般使用调用此规则的service类) 34 // 全局日志类(一般使用调用此规则的service类)
src/main/resources/rules/rerun.drl renamed to src/main/resources/rules/kBase1_core_rerun.drl
1 -package com.bsth.service.schedule.rerun; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.rerun;
2 2
3 import org.joda.time.*; 3 import org.joda.time.*;
4 import java.util.*; 4 import java.util.*;
5 5
6 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output;  
7 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; 6 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;
  7 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;
8 8
9 -import com.bsth.service.schedule.rules.rerun.RerunRule_input;  
10 -import com.bsth.service.schedule.rules.rerun.RerunRule_param; 9 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;
  10 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_param;
11 11
12 import com.bsth.repository.schedule.CarConfigInfoRepository; 12 import com.bsth.repository.schedule.CarConfigInfoRepository;
13 import com.bsth.repository.schedule.EmployeeConfigInfoRepository; 13 import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
14 14
15 -import org.slf4j.Logger  
16 -import com.bsth.entity.schedule.CarConfigInfo  
17 -import java.util.HashMap  
18 -import com.bsth.entity.schedule.EmployeeConfigInfo 15 +import org.slf4j.Logger;
  16 +import com.bsth.entity.schedule.CarConfigInfo;
  17 +import java.util.HashMap;
  18 +import com.bsth.entity.schedule.EmployeeConfigInfo;
19 import com.bsth.entity.schedule.SchedulePlanInfo; 19 import com.bsth.entity.schedule.SchedulePlanInfo;
20 20
21 // 全局日志类(一般使用调用此规则的service类) 21 // 全局日志类(一般使用调用此规则的service类)
src/main/resources/rules/shiftloop_fb_2.drl renamed to src/main/resources/rules/kBase1_core_shiftloop.drl
1 -package com.bsth.service.schedule.shiftloop; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop;
2 2
3 import org.joda.time.*; 3 import org.joda.time.*;
4 import java.util.*; 4 import java.util.*;
5 5
6 -import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output; 6 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResult_output;
7 7
8 import com.bsth.service.schedule.utils.Md5Util; 8 import com.bsth.service.schedule.utils.Md5Util;
9 9
10 -import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;  
11 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;  
12 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_Type;  
13 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output;  
14 -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; 10 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleCalcuParam_input;
  11 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_input;
  12 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_Type;
  13 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResult_output;
  14 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleResults_output;
15 15
16 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; 16 import com.bsth.entity.schedule.temp.SchedulePlanRuleResult;
17 17
18 import com.bsth.entity.schedule.SchedulePlan; 18 import com.bsth.entity.schedule.SchedulePlan;
19 19
20 -import com.bsth.service.schedule.rules.ScheduleRuleService; 20 +import com.bsth.service.schedule.impl.plan.ScheduleRuleService;
21 21
22 import org.slf4j.Logger; 22 import org.slf4j.Logger;
23 23
src/main/resources/rules/ttinfo.drl renamed to src/main/resources/rules/kBase1_core_ttinfo.drl
1 -package com.bsth.service.schedule.ttinfo; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo;
  2 +
  3 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidsCountFunction gidscount;
  4 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbTimeFunction gidfbtime;
  5 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.GidFbFcnoFunction gidfbfcno;
  6 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResultsFunction lpinforesult;
  7 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.MinRuleQyrqFunction minruleqyrq;
  8 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidRepeatBcFunction vrb;
  9 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWholeRerunBcFunction vwrb;
  10 +import accumulate com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidWantLpFunction vwlp;
2 11
3 import org.joda.time.*; 12 import org.joda.time.*;
4 import java.util.*; 13 import java.util.*;
5 14
6 -import com.bsth.service.schedule.rules.ttinfo.TTInfoCalcuParam_input;  
7 -import com.bsth.service.schedule.rules.ttinfo.TTInfo_input;  
8 -import com.bsth.service.schedule.rules.ttinfo.TTInfoResult_output;  
9 -import com.bsth.service.schedule.rules.ttinfo.TTInfoResults_output;  
10 -import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output;  
11 -import com.bsth.service.schedule.rules.ttinfo.LpInfoResults_output; 15 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoCalcuParam_input;
  16 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfo_input;
  17 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResult_output;
  18 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.TTInfoResults_output;
  19 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResult_output;
  20 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResults_output;
12 21
13 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; 22 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_input;
14 23
15 import com.bsth.repository.schedule.TTInfoDetailRepository; 24 import com.bsth.repository.schedule.TTInfoDetailRepository;
16 25
src/main/resources/rules/validplan.drl renamed to src/main/resources/rules/kBase1_core_validate.drl
1 -package com.bsth.service.schedule.rules.validate; 1 +package com.bsth.service.schedule.impl.plan.kBase1.core.validate;
2 2
3 import com.bsth.entity.schedule.SchedulePlanInfo; 3 import com.bsth.entity.schedule.SchedulePlanInfo;
4 -import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output;  
5 -import com.bsth.service.schedule.rules.validate.ValidateResource; 4 +import com.bsth.service.schedule.impl.plan.kBase1.core.ttinfo.LpInfoResult_output;
  5 +import com.bsth.service.schedule.impl.plan.kBase1.core.validate.ValidateResource;
6 6
7 import org.joda.time.*; 7 import org.joda.time.*;
8 import java.util.*; 8 import java.util.*;
src/main/resources/rules/ruleWrap.drl renamed to src/main/resources/rules/kBase2_wrap_rule.drl
1 -package com.bsth.service.schedule.rulewrap; 1 +package com.bsth.service.schedule.impl.plan.kBase2.wrap.rule;
2 2
3 import org.joda.time.*; 3 import org.joda.time.*;
4 import java.util.*; 4 import java.util.*;
5 import org.slf4j.Logger; 5 import org.slf4j.Logger;
6 6
7 -import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;  
8 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;  
9 -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_Type; 7 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleCalcuParam_input;
  8 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_input;
  9 +import com.bsth.service.schedule.impl.plan.kBase1.core.shiftloop.ScheduleRule_Type;
  10 +import com.bsth.service.schedule.impl.plan.kBase1.core.rerun.RerunRule_input;
10 11
11 import com.bsth.repository.schedule.RerunRuleRepository; 12 import com.bsth.repository.schedule.RerunRuleRepository;
12 import com.bsth.repository.schedule.ScheduleRule1FlatRepository; 13 import com.bsth.repository.schedule.ScheduleRule1FlatRepository;
13 14
14 -import com.bsth.service.schedule.rules.rerun.RerunRule_input;  
15 -import com.bsth.service.schedule.rules.ScheduleRuleService; 15 +import com.bsth.service.schedule.impl.plan.ScheduleRuleService;
16 16
17 import com.bsth.entity.Line; 17 import com.bsth.entity.Line;
18 import com.bsth.entity.schedule.CarConfigInfo 18 import com.bsth.entity.schedule.CarConfigInfo
src/main/resources/rules/kBase3_validate_rule.drl 0 → 100644
  1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
  2 +
  3 +import accumulate com.bsth.service.schedule.impl.plan.kBase3.validate.rule.ErrorInfoFunction srif;
  4 +import accumulate com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.ErrorBcCountFunction ecount;
  5 +
  6 +import org.joda.time.*;
  7 +import java.util.*;
  8 +
  9 +import com.bsth.service.schedule.impl.plan.kBase3.validate.rule.CalcuParam;
  10 +import com.bsth.service.schedule.impl.plan.kBase3.validate.rule.ValidateRuleResult;
  11 +import com.bsth.service.schedule.impl.plan.kBase3.validate.rule.ValidateRuleResult.ErrorInfo;
  12 +import com.bsth.service.schedule.impl.plan.kBase3.validate.rule.WrapInput;
  13 +
  14 +import com.bsth.repository.schedule.ScheduleRule1FlatRepository
  15 +import com.bsth.repository.schedule.CarConfigInfoRepository;
  16 +import com.bsth.repository.schedule.GuideboardInfoRepository;
  17 +import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
  18 +
  19 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  20 +import com.bsth.entity.schedule.CarConfigInfo;
  21 +import com.bsth.entity.schedule.GuideboardInfo;
  22 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  23 +
  24 +import org.slf4j.Logger
  25 +
  26 +// 全局日志
  27 +global Logger LOG;
  28 +
  29 +// repository查询
  30 +global CarConfigInfoRepository ccRepo;
  31 +global GuideboardInfoRepository lpRepo;
  32 +global EmployeeConfigInfoRepository ecRepo;
  33 +global ScheduleRule1FlatRepository ruleRepo;
  34 +
  35 +// return输出
  36 +global ValidateRuleResult result;
  37 +
  38 +
  39 +//------------------ 第一阶段、车辆信息,路牌信息,人员信息载入 -----------------//
  40 +
  41 +// 1、车辆信息载入
  42 +declare CarConfig_Wraps
  43 + xlId: Integer // 线路Id
  44 + ccMap: Map // 车辆配置Map Map<车辆自编号, CarConfigInfo>
  45 +end
  46 +
  47 +rule "calcu_CarConfig_Wraps"
  48 + salience 800
  49 + when
  50 + $param: CalcuParam($xlId: xlId)
  51 + then
  52 + List ccInfos = ccRepo.findByXlId($xlId);
  53 +
  54 + CarConfig_Wraps carConfig_wraps = new CarConfig_Wraps();
  55 + carConfig_wraps.setXlId($xlId);
  56 + carConfig_wraps.setCcMap(new HashMap());
  57 +
  58 + for (int i = 0; i < ccInfos.size(); i++) {
  59 + CarConfigInfo ccInfo = (CarConfigInfo) ccInfos.get(i);
  60 + if (!ccInfo.getIsCancel()) {
  61 + carConfig_wraps.getCcMap().put(ccInfo.getCl().getInsideCode(), ccInfo);
  62 + }
  63 + }
  64 +
  65 + insert(carConfig_wraps);
  66 +
  67 + LOG.info("第一阶段 --> 1、车辆信息载入 calcu_CarConfig_Wraps 有效配置车辆数={}", ccInfos.size());
  68 +end
  69 +
  70 +// 2、路牌信息载入
  71 +declare Lp_Wraps
  72 + xlId: Integer // 线路Id
  73 + lpMap: Map // 路牌Map Map<id, GuideboardInfo>
  74 +end
  75 +
  76 +rule "calcu_Lp_Wraps"
  77 + salience 800
  78 + when
  79 + $param: CalcuParam($xlId: xlId)
  80 + then
  81 + List lpInfos = lpRepo.findByXlId($xlId);
  82 + Lp_Wraps lp_wraps = new Lp_Wraps();
  83 + lp_wraps.setXlId($xlId);
  84 + lp_wraps.setLpMap(new HashMap());
  85 +
  86 + for (int i = 0; i < lpInfos.size(); i++) {
  87 + GuideboardInfo lpInfo = (GuideboardInfo) lpInfos.get(i);
  88 + if (!lpInfo.getIsCancel()) {
  89 + lp_wraps.getLpMap().put(lpInfo.getId(), lpInfo);
  90 + }
  91 + }
  92 +
  93 + insert(lp_wraps);
  94 +
  95 + LOG.info("第一阶段 --> 2、路牌信息载入 calcu_Lp_Wraps 有效路牌数={}", lpInfos.size());
  96 +
  97 +end
  98 +
  99 +// 3、人员信息载入
  100 +declare EmployeeConfig_Wraps
  101 + xlId: Integer // 线路Id
  102 + ecMap: Map // 人员配置Map Map<id, EmployeeConfigInfo>
  103 +end
  104 +
  105 +rule "calcu_EmployeeConfig_Wraps"
  106 + salience 800
  107 + when
  108 + $param: CalcuParam($xlId: xlId)
  109 + then
  110 + List ecInfos = ecRepo.findByXlId($xlId);
  111 +
  112 + EmployeeConfig_Wraps employeeConfig_wraps = new EmployeeConfig_Wraps();
  113 + employeeConfig_wraps.setXlId($xlId);
  114 + employeeConfig_wraps.setEcMap(new HashMap());
  115 +
  116 + for (int i = 0; i < ecInfos.size(); i++) {
  117 + EmployeeConfigInfo ecInfo = (EmployeeConfigInfo) ecInfos.get(i);
  118 + if (!ecInfo.getIsCancel()) {
  119 + employeeConfig_wraps.getEcMap().put(ecInfo.getId(), ecInfo);
  120 + }
  121 + }
  122 +
  123 + insert(employeeConfig_wraps);
  124 +
  125 + LOG.info("第一阶段 --> 3、人员信息载入 calcu_EmployeeConfig_Wraps 有效人员配置数={}", ecInfos.size());
  126 +end
  127 +
  128 +//------------------ 第二阶段、规则载入,计算相关数量 -----------------//
  129 +
  130 +declare Rule_Wraps
  131 + xlId: Integer // 线路Id
  132 + qyrq: Date // 启用日期
  133 + rule: ScheduleRule1Flat // ScheduleRule1Flat规则
  134 +end
  135 +
  136 +rule "calcu_schedule_rule_wrap"
  137 + salience 700
  138 + when
  139 + $param: CalcuParam($xlId: xlId)
  140 + $rule: ScheduleRule1Flat($qyrq: qyrq) from ruleRepo.findByXlId($xlId)
  141 + then
  142 + Rule_Wraps rw = new Rule_Wraps();
  143 + rw.setXlId($xlId);
  144 + rw.setQyrq($qyrq);
  145 + rw.setRule($rule);
  146 + insert(rw);
  147 +end
  148 +
  149 +rule "calcu_all_rule_count"
  150 + salience 600
  151 + when
  152 + $param: CalcuParam($xlId: xlId, $fd: fromDate, $td: toDate)
  153 + $allList: ArrayList() from collect(Rule_Wraps(xlId == $xlId))
  154 + then
  155 + result.setXlId($xlId);
  156 + result.setCount($allList.size());
  157 +
  158 + LOG.info("第二阶段 --> 规则总数={}", $allList.size());
  159 +end
  160 +
  161 +rule "calcu_all_qy_rule_count"
  162 + salience 500
  163 + when
  164 + $param: CalcuParam($xlId: xlId, $fd: fromDate, $td: toDate)
  165 + $qyList: ArrayList() from collect(
  166 + Rule_Wraps(xlId == $xlId, qyrq.getTime() <= $td.getMillis()))
  167 + then
  168 + result.setXlId($xlId);
  169 + result.setQyCount($qyList.size());
  170 +
  171 + LOG.info("第二阶段 --> 启用规则数={}", $qyList.size());
  172 +
  173 +end
  174 +
  175 +//------------------ 第三阶段、规则判定 -----------------//
  176 +
  177 +rule "calcu_Wrap_input"
  178 + salience 400
  179 + when
  180 + $param: CalcuParam($xlId: xlId, $fd: fromDate, $td: toDate)
  181 + $qy_rule: Rule_Wraps(xlId == $xlId, qyrq.getTime() <= $td.getMillis())
  182 + $cc: CarConfig_Wraps(xlId == $xlId)
  183 + $lp: Lp_Wraps(xlId == $xlId)
  184 + $ec: EmployeeConfig_Wraps(xlId == $xlId)
  185 + then
  186 + WrapInput wr = new WrapInput(
  187 + $qy_rule.getRule(),
  188 + $cc.getCcMap(),
  189 + $lp.getLpMap(),
  190 + $ec.getEcMap()
  191 + );
  192 + insert(wr);
  193 +end
  194 +
  195 +rule "calcu_error_info"
  196 + salience 300
  197 + when
  198 + $param: CalcuParam($xlId: xlId)
  199 + $errorMap: Map() from accumulate ($wr: WrapInput(xlId == $xlId), srif($wr))
  200 + then
  201 + result.setQyErrorCount($errorMap.size());
  202 + result.getErrorInfos().addAll($errorMap.values());
  203 +
  204 + LOG.info("第三阶段 --> 规则总数={}, 启用规则数={}, 错误的启用规则数={}",
  205 + result.getCount(), result.getQyCount(), result.getQyErrorCount());
  206 +
  207 +end
  208 +
  209 +
src/main/resources/rules/ttinfo2.drl renamed to src/main/resources/rules/kBase3_validate_timetable.drl
1 -package com.bsth.service.schedule.ttinfo2; 1 +package com.bsth.service.schedule.impl.plan.kBase3.validate.timetable;
2 2
3 import org.joda.time.*; 3 import org.joda.time.*;
4 import java.util.*; 4 import java.util.*;
5 import org.apache.commons.lang3.StringUtils; 5 import org.apache.commons.lang3.StringUtils;
6 6
7 -import com.bsth.service.schedule.rules.ttinfo2.Result;  
8 -import com.bsth.service.schedule.rules.ttinfo2.Result.StatInfo;  
9 -import com.bsth.service.schedule.rules.ttinfo2.CalcuParam; 7 +import com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.Result;
  8 +import com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.Result.StatInfo;
  9 +import com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.CalcuParam;
10 10
11 import com.bsth.entity.schedule.TTInfo; 11 import com.bsth.entity.schedule.TTInfo;
12 import com.bsth.entity.schedule.TTInfoDetail; 12 import com.bsth.entity.schedule.TTInfoDetail;
13 import com.bsth.entity.Line; 13 import com.bsth.entity.Line;
14 14
15 -import com.bsth.repository.LineRepository;  
16 import com.bsth.repository.schedule.TTInfoDetailRepository; 15 import com.bsth.repository.schedule.TTInfoDetailRepository;
17 16
18 import org.slf4j.Logger 17 import org.slf4j.Logger
@@ -23,7 +22,6 @@ import java.lang.Object; @@ -23,7 +22,6 @@ import java.lang.Object;
23 22
24 // 全局日志类(一般使用调用此规则的service类) 23 // 全局日志类(一般使用调用此规则的service类)
25 global Logger log; 24 global Logger log;
26 -global LineRepository lineRepository;  
27 global TTInfoDetailRepository tTInfoDetailRepository; 25 global TTInfoDetailRepository tTInfoDetailRepository;
28 26
29 // 输出 27 // 输出
@@ -63,15 +61,14 @@ rule &quot;calcu_iter_days&quot; @@ -63,15 +61,14 @@ rule &quot;calcu_iter_days&quot;
63 $toDate: toDate, 61 $toDate: toDate,
64 $fromDate.isBefore($toDate) || $fromDate.isEqual($toDate) 62 $fromDate.isBefore($toDate) || $fromDate.isEqual($toDate)
65 ) 63 )
  64 + $line: Line(id == $xlId)
66 then 65 then
67 // 构造Calcu_iter_days_result对象,进行下一步计算 66 // 构造Calcu_iter_days_result对象,进行下一步计算
68 Calcu_iter_days_result cidr = new Calcu_iter_days_result(); 67 Calcu_iter_days_result cidr = new Calcu_iter_days_result();
69 Period p = new Period($fromDate, $toDate, PeriodType.days()); 68 Period p = new Period($fromDate, $toDate, PeriodType.days());
70 69
71 - Line line = (Line) lineRepository.findOne($xlId);  
72 -  
73 cidr.setXlId($xlId); 70 cidr.setXlId($xlId);
74 - cidr.setXlName(line.getName()); 71 + cidr.setXlName($line.getName());
75 72
76 cidr.setCalcu_day(new Integer(1)); 73 cidr.setCalcu_day(new Integer(1));
77 cidr.setCalcu_weekday(Integer.valueOf($fromDate.getDayOfWeek())); 74 cidr.setCalcu_weekday(Integer.valueOf($fromDate.getDayOfWeek()));
@@ -311,6 +308,9 @@ rule &quot;statinfo_result&quot; // 统计计算结果 @@ -311,6 +308,9 @@ rule &quot;statinfo_result&quot; // 统计计算结果
311 $statInfo.setYybc($yybc); 308 $statInfo.setYybc($yybc);
312 $statInfo.setErrorbc($errorbc); 309 $statInfo.setErrorbc($errorbc);
313 310
  311 + int lineVersion = ((TTInfoDetail) $ttInfoDetails_wrap.getBcInfoList().get(0)).getLineVersion();
  312 + $statInfo.setLineVersion(lineVersion);
  313 +
314 rs.getInfos().add($statInfo); 314 rs.getInfos().add($statInfo);
315 315
316 end 316 end
src/main/resources/static/index.html
@@ -632,7 +632,6 @@ @@ -632,7 +632,6 @@
632 data-exclude=1></script> 632 data-exclude=1></script>
633 <!-- echarts4 误删 --> 633 <!-- echarts4 误删 -->
634 <script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> 634 <script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script>
635 -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>  
636 635
637 </body> 636 </body>
638 </html> 637 </html>
639 \ No newline at end of file 638 \ No newline at end of file
src/main/resources/static/pages/base/line/js/line-list-table.js
@@ -386,8 +386,6 @@ @@ -386,8 +386,6 @@
386 } 386 }
387 387
388 }); 388 });
389 -  
390 -  
391 } 389 }
392 }); 390 });
393 /** 生成路线(路段和站点) */ 391 /** 生成路线(路段和站点) */
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
@@ -58,15 +58,17 @@ window.WorldsBMap = function () { @@ -58,15 +58,17 @@ window.WorldsBMap = function () {
58 marker.enableDragging(); 58 marker.enableDragging();
59 dragMarker = marker; 59 dragMarker = marker;
60 dragMarker._old_point = dragMarker._position; 60 dragMarker._old_point = dragMarker._position;
  61 + centerPoint = dragMarker._position;
61 //监听拖拽事件 dragging 62 //监听拖拽事件 dragging
62 dragMarker.addEventListener('dragging', dragMarkerDragEvent); 63 dragMarker.addEventListener('dragging', dragMarkerDragEvent);
63 }; 64 };
64 65
65 var dragMarkerDragEvent = function (e) { 66 var dragMarkerDragEvent = function (e) {
66 if (editPolygon) { 67 if (editPolygon) {
67 - if (!BMapLib.GeoUtils.isPointInPolygon(e.target._position, editPolygon)) 68 + // 中心点是否超出多边形
  69 + if (!BMapLib.GeoUtils.isPointInPolygon(e.target._position, editPolygon)) {
68 dragMarker.setPosition(dragMarker._old_point);//还原位置 70 dragMarker.setPosition(dragMarker._old_point);//还原位置
69 - 71 + }
70 centerPoint = e.target._position; 72 centerPoint = e.target._position;
71 } 73 }
72 else if (editCircle) { 74 else if (editCircle) {
src/main/resources/static/pages/base/timesmodel/add.html
@@ -21,10 +21,10 @@ @@ -21,10 +21,10 @@
21 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> 21 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
22 <li><span class="active">运营计划管理</span> <i class="fa fa-circle"></i></li> 22 <li><span class="active">运营计划管理</span> <i class="fa fa-circle"></i></li>
23 <li> 23 <li>
24 - <a href="/#/ttInfoManage">时刻表管理</a> 24 + <a href="/#/ttInfoManage2">智能时刻表管理</a>
25 <i class="fa fa-circle"></i> 25 <i class="fa fa-circle"></i>
26 </li> 26 </li>
27 - <li><span class="active">时刻表明细制作建模</span></li> 27 + <li><span class="active">智能时刻表明细制作建模</span></li>
28 </ul> 28 </ul>
29 <!-- 线路信息导航栏组件 END --> 29 <!-- 线路信息导航栏组件 END -->
30 <div class="portlet light bordered" id="form-wizard-info"> 30 <div class="portlet light bordered" id="form-wizard-info">
@@ -152,7 +152,7 @@ @@ -152,7 +152,7 @@
152 <input type="radio" class="icheck" name="baseRes" value=2 > 发车间隔分析(旧:一步调整) 152 <input type="radio" class="icheck" name="baseRes" value=2 > 发车间隔分析(旧:一步调整)
153 </label> 153 </label>
154 <label> 154 <label>
155 - <input type="radio" class="icheck" name="baseRes" value=3 checked> 发车间隔分析(新:增量调整-单向进场) 155 + <input type="radio" class="icheck" name="baseRes" value=3 checked> 发车间隔分析(新:增量调整-单向进场)
156 </label> 156 </label>
157 <label> 157 <label>
158 <input type="radio" class="icheck" name="baseRes" value=0> 客流大数据分析 158 <input type="radio" class="icheck" name="baseRes" value=0> 客流大数据分析
src/main/resources/static/pages/base/timesmodel/css/index.css
@@ -217,11 +217,11 @@ text.alert-danger { @@ -217,11 +217,11 @@ text.alert-danger {
217 } 217 }
218 218
219 .sx { 219 .sx {
220 - background-color: #233f5d; 220 + background-color: #ff2949;
221 } 221 }
222 222
223 .xx { 223 .xx {
224 - background-color: #31394a; 224 + background-color: #518fe3;
225 } 225 }
226 226
227 .tipso_bubble { 227 .tipso_bubble {
src/main/resources/static/pages/base/timesmodel/fragments/addbc.html
@@ -201,7 +201,7 @@ $(&#39;#addBc_mobal&#39;).on(&#39;addBcMobal.show&#39;, function(e,lpData,lpDataCount,echartsDra @@ -201,7 +201,7 @@ $(&#39;#addBc_mobal&#39;).on(&#39;addBcMobal.show&#39;, function(e,lpData,lpDataCount,echartsDra
201 // 'dir' : {required : true}, 201 // 'dir' : {required : true},
202 'fcsj' : {required : true}, 202 'fcsj' : {required : true},
203 'bcType' : {required : true}, 203 'bcType' : {required : true},
204 - 'bcsj' : {number : true,required : true}, 204 + 'bcsj' : {min : 1, digits : true, required : true},
205 'isfb' : {required : true} 205 'isfb' : {required : true}
206 }, 206 },
207 invalidHandler : function(event, validator) { 207 invalidHandler : function(event, validator) {
@@ -224,50 +224,54 @@ $(&#39;#addBc_mobal&#39;).on(&#39;addBcMobal.show&#39;, function(e,lpData,lpDataCount,echartsDra @@ -224,50 +224,54 @@ $(&#39;#addBc_mobal&#39;).on(&#39;addBcMobal.show&#39;, function(e,lpData,lpDataCount,echartsDra
224 var fcsj = Date.parse(DateTimeTool.getDateTime(params.fcsj)); 224 var fcsj = Date.parse(DateTimeTool.getDateTime(params.fcsj));
225 var ARRIVALTIME = fcsj + parseInt(params.bcsj)*60000 ; 225 var ARRIVALTIME = fcsj + parseInt(params.bcsj)*60000 ;
226 226
227 - for(var i=0; i<data.length-1; i++) {  
228 - if(data[i].value[0] == params.lpName) {  
229 - if(data[i].value[7] < params.fcno) {  
230 - prevBcObj = data[i];  
231 - bcObj = $.extend(true, {}, bcObj, data[i]);  
232 - index = i+1;  
233 - } else {  
234 - if(type) {  
235 - type = false;  
236 - nextBcObj = data[i]; 227 + if(params.bcsj > 0){
  228 + for(var i=0; i<data.length-1; i++) {
  229 + if(data[i].value[0] == params.lpName) {
  230 + if(data[i].value[7] < params.fcno) {
  231 + prevBcObj = data[i];
  232 + bcObj = $.extend(true, {}, bcObj, data[i]);
  233 + index = i+1;
  234 + } else {
  235 + if(type) {
  236 + type = false;
  237 + nextBcObj = data[i];
  238 + }
  239 + data[i].value[7] += 1;
237 } 240 }
238 - data[i].value[7] += 1;  
239 } 241 }
240 } 242 }
241 - }  
242 - bcObj.value[1] = fcsj;  
243 - bcObj.value[2] = ARRIVALTIME;  
244 - bcObj.value[3] = params.bcsj*60000;  
245 - // bcObj.value[4] = lpNo;  
246 - bcObj.value[6] = params.bcType;  
247 - bcObj.value[7] = parseInt(params.fcno);  
248 - var dir = bcObj.value[8] == 1 ? 0:1;  
249 - bcObj.value[8] = dir;  
250 - bcObj.itemStyle.normal.color = dir==0?"#ff2949":"#518fe3";  
251 - // 起终点互换  
252 - var station = bcObj.value[13];  
253 - bcObj.value[13] = bcObj.value[14];  
254 - bcObj.value[14] = station;  
255 - bcObj.value[16] = parseInt(params.isfb);  
256 - data.splice(index, 0 , bcObj); 243 + bcObj.value[1] = fcsj;
  244 + bcObj.value[2] = ARRIVALTIME;
  245 + bcObj.value[3] = params.bcsj*60000;
  246 + // bcObj.value[4] = lpNo;
  247 + bcObj.value[6] = params.bcType;
  248 + bcObj.value[7] = parseInt(params.fcno);
  249 + var dir = bcObj.value[8] == 1 ? 0:1;
  250 + bcObj.value[8] = dir;
  251 + bcObj.itemStyle.normal.color = dir==0?"#ff2949":"#518fe3";
  252 + // 起终点互换
  253 + var station = bcObj.value[13];
  254 + bcObj.value[13] = bcObj.value[14];
  255 + bcObj.value[14] = station;
  256 + bcObj.value[16] = parseInt(params.isfb);
  257 + data.splice(index, 0 , bcObj);
257 258
258 - if(nextBcObj != null && (nextBcObj.value[1] < ARRIVALTIME || prevBcObj.value[2] > fcsj)){  
259 - layer.confirm('添加的班次与前后班次有时间冲突,是否添加?', {  
260 - btn : [ '添加','取消' ], icon: 3, title:'提示'  
261 - }, function(){  
262 - echartsDrawGTT.init(data,false,true); 259 + if(nextBcObj != null && (nextBcObj.value[1] < ARRIVALTIME || prevBcObj.value[2] > fcsj)){
  260 + layer.confirm('添加的班次与前后班次有时间冲突,是否添加?', {
  261 + btn : [ '添加','取消' ], icon: 3, title:'提示'
  262 + }, function(){
  263 + echartsDrawGTT.init(data,false,true,false);
  264 + echartsDrawGTT.refreshDrag();
  265 + layer.msg('路牌:'+params.lpName+' fnco:'+params.fcno+' 班次添加成功,注意修改冲突班次!');
  266 + });
  267 + } else {
  268 + echartsDrawGTT.init(data,false,true,false);
263 echartsDrawGTT.refreshDrag(); 269 echartsDrawGTT.refreshDrag();
264 - layer.msg('路牌:'+params.lpName+' fnco:'+params.fcno+' 班次添加成功,注意修改冲突班次!');  
265 - }); 270 + layer.msg('路牌:'+params.lpName+' fnco:'+params.fcno+' 班次添加成功!');
  271 + }
266 } else { 272 } else {
267 - echartsDrawGTT.init(data,false,true);  
268 - echartsDrawGTT.refreshDrag();  
269 - layer.msg('路牌:'+params.lpName+' fnco:'+params.fcno+' 班次添加成功!');  
270 - } 273 + layer.msg('班次时间为0分钟,为无效班次添加失败!');
  274 + }
271 $('#addBc_mobal').modal('hide'); 275 $('#addBc_mobal').modal('hide');
272 } 276 }
273 }); 277 });
src/main/resources/static/pages/base/timesmodel/fragments/deletelp.html
@@ -104,7 +104,7 @@ $(&#39;#deletelp_mobal&#39;).on(&#39;deletelpMobal.show&#39;, function(e,lpData,echartsDrawGTT){ @@ -104,7 +104,7 @@ $(&#39;#deletelp_mobal&#39;).on(&#39;deletelpMobal.show&#39;, function(e,lpData,echartsDrawGTT){
104 lpData.splice(index,1); 104 lpData.splice(index,1);
105 }); 105 });
106 echartsDrawGTT.setLpData(lpData); 106 echartsDrawGTT.setLpData(lpData);
107 - echartsDrawGTT.init(data,false,true); 107 + echartsDrawGTT.init(data,false,true,false);
108 echartsDrawGTT.refreshDrag(); 108 echartsDrawGTT.refreshDrag();
109 $('#deletelp_mobal').modal('hide'); 109 $('#deletelp_mobal').modal('hide');
110 layer.msg('删除路牌【'+ params.lpName +'】成功!'); 110 layer.msg('删除路牌【'+ params.lpName +'】成功!');
src/main/resources/static/pages/base/timesmodel/fragments/editbc.html
@@ -162,7 +162,7 @@ $(&#39;#editBc_mobal&#39;).on(&#39;editBcMobal.show&#39;, function(e,index,echartsDrawGTT){ @@ -162,7 +162,7 @@ $(&#39;#editBc_mobal&#39;).on(&#39;editBcMobal.show&#39;, function(e,index,echartsDrawGTT){
162 // 'dir' : {required : true}, 162 // 'dir' : {required : true},
163 'fcsj' : {required : true}, 163 'fcsj' : {required : true},
164 'bcType' : {required : true}, 164 'bcType' : {required : true},
165 - 'bcsj' : {number : true,required : true}, 165 + 'bcsj' : {min : 1, digits : true,required : true},
166 'isfb' : {required : true} 166 'isfb' : {required : true}
167 }, 167 },
168 invalidHandler : function(event, validator) { 168 invalidHandler : function(event, validator) {
@@ -192,7 +192,7 @@ $(&#39;#editBc_mobal&#39;).on(&#39;editBcMobal.show&#39;, function(e,index,echartsDrawGTT){ @@ -192,7 +192,7 @@ $(&#39;#editBc_mobal&#39;).on(&#39;editBcMobal.show&#39;, function(e,index,echartsDrawGTT){
192 bcObj.value[7] = parseInt(params.fcno); 192 bcObj.value[7] = parseInt(params.fcno);
193 bcObj.value[16] = parseInt(params.isfb); 193 bcObj.value[16] = parseInt(params.isfb);
194 194
195 - echartsDrawGTT.init(data,false,true); 195 + echartsDrawGTT.init(data,false,true,false);
196 echartsDrawGTT.refreshDrag(); 196 echartsDrawGTT.refreshDrag();
197 layer.msg('路牌:'+params.lpName+' fnco:'+params.fcno+' 班次修改成功!'); 197 layer.msg('路牌:'+params.lpName+' fnco:'+params.fcno+' 班次修改成功!');
198 $('#editBc_mobal').modal('hide'); 198 $('#editBc_mobal').modal('hide');
src/main/resources/static/pages/base/timesmodel/gantt.html
@@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
14 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> 14 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
15 <li><span class="active">运营计划管理</span> <i class="fa fa-circle"></i></li> 15 <li><span class="active">运营计划管理</span> <i class="fa fa-circle"></i></li>
16 <li> 16 <li>
17 - <a href="/#/ttInfoManage">时刻表管理</a> 17 + <a href="/#/ttInfoManage2">智能时刻表管理</a>
18 <i class="fa fa-circle"></i> 18 <i class="fa fa-circle"></i>
19 </li> 19 </li>
20 - <li><span class="active">时刻表明细模型</span></li> 20 + <li><span class="active">智能时刻表明细模型</span></li>
21 </ul> 21 </ul>
22 <!-- 线路信息导航栏组件 END --> 22 <!-- 线路信息导航栏组件 END -->
23 23
@@ -160,6 +160,11 @@ @@ -160,6 +160,11 @@
160 </div> 160 </div>
161 <!-- col-md-12 组件END --> 161 <!-- col-md-12 组件END -->
162 </div> 162 </div>
  163 +
  164 +
  165 +<!-- echarts4 误删 -->
  166 +<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script>
  167 +
163 <!-- row 组件END --> 168 <!-- row 组件END -->
164 <script src="/pages/base/timesmodel/js/raty/lib/jquery.raty.js"></script> 169 <script src="/pages/base/timesmodel/js/raty/lib/jquery.raty.js"></script>
165 <script src="/pages/base/timesmodel/js/ContextJS/js/context.js"></script> 170 <script src="/pages/base/timesmodel/js/ContextJS/js/context.js"></script>
@@ -186,8 +191,8 @@ @@ -186,8 +191,8 @@
186 --> 191 -->
187 192
188 <script src="/pages/base/timesmodel/js/v2_2/InternalScheduleObj.js"></script> 193 <script src="/pages/base/timesmodel/js/v2_2/InternalScheduleObj.js"></script>
189 -<script src="/pages/base/timesmodel/js/v2_2/main_v2_2_excel.js"></script>  
190 <script src="/pages/base/timesmodel/js/v2_2/main_v2_2.js"></script> 194 <script src="/pages/base/timesmodel/js/v2_2/main_v2_2.js"></script>
  195 +<script src="/pages/base/timesmodel/js/v2_2/Main_v2_2_ExcelObj.js"></script>
191 <script src="/pages/base/timesmodel/js/v2_2/strategy/workhours/ModifyBcTripWHS1.js"></script> 196 <script src="/pages/base/timesmodel/js/v2_2/strategy/workhours/ModifyBcTripWHS1.js"></script>
192 <script src="/pages/base/timesmodel/js/v2_2/strategy/headway/CalcuHeadwayS1.js"></script> 197 <script src="/pages/base/timesmodel/js/v2_2/strategy/headway/CalcuHeadwayS1.js"></script>
193 <script src="/pages/base/timesmodel/js/v2_2/strategy/headway/CalcuHeadwayS2.js"></script> 198 <script src="/pages/base/timesmodel/js/v2_2/strategy/headway/CalcuHeadwayS2.js"></script>
src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js
1 -  
2 /** 1 /**
3 * @description : (TODO) 表单的导航向导、验证、提交 2 * @description : (TODO) 表单的导航向导、验证、提交
4 */ 3 */
@@ -288,12 +287,12 @@ var SKBFormWizard = function() { @@ -288,12 +287,12 @@ var SKBFormWizard = function() {
288 // 4、返回判断结果布尔值. 287 // 4、返回判断结果布尔值.
289 return tag; 288 return tag;
290 } 289 }
291 - 290 +
292 /** 291 /**
293 * @description : (TODO) 获取客流数据. 292 * @description : (TODO) 获取客流数据.
294 - * 293 + *
295 * @params [url--请求地址;data--请求参数;cb--回调函数] 294 * @params [url--请求地址;data--请求参数;cb--回调函数]
296 - * 295 + *
297 * */ 296 * */
298 function getJSONP(url, data, cb) { 297 function getJSONP(url, data, cb) {
299 $.ajax({ 298 $.ajax({
@@ -305,24 +304,24 @@ var SKBFormWizard = function() { @@ -305,24 +304,24 @@ var SKBFormWizard = function() {
305 success : cb 304 success : cb
306 }); 305 });
307 } 306 }
308 - 307 +
309 /** 308 /**
310 * @description : (TODO) 根据获取参数方式来获取表单参数详情html模版页. 309 * @description : (TODO) 根据获取参数方式来获取表单参数详情html模版页.
311 - * 310 + *
312 * @param [n--获取参数方式;map--表单参数;lineId--线路ID;krl--客容量;cb--回调函数] 311 * @param [n--获取参数方式;map--表单参数;lineId--线路ID;krl--客容量;cb--回调函数]
313 - * 312 + *
314 * @return 返回表单参数详情html模版页. 313 * @return 返回表单参数详情html模版页.
315 - * 314 + *
316 * @status OK. 315 * @status OK.
317 * */ 316 * */
318 var getHtmlTemp = function(n,map,lineId,krl,cb) { 317 var getHtmlTemp = function(n,map,lineId,krl,cb) {
319 // 1、定义模版名称. 318 // 1、定义模版名称.
320 var tempName = ''; 319 var tempName = '';
321 - if(n==0) 320 + if(n==0)
322 tempName = 'carnum_temp'; 321 tempName = 'carnum_temp';
323 else if(n==1) 322 else if(n==1)
324 tempName = 'bctype_temp'; 323 tempName = 'bctype_temp';
325 - else if (n==2 || n == 3) 324 + else if (n==2 || n==3)
326 tempName = 'fcjx_temp'; 325 tempName = 'fcjx_temp';
327 // 2、获参数详情模版html内容. 326 // 2、获参数详情模版html内容.
328 $.get('/pages/base/timesmodel/tepms/'+ tempName + '.html', function(html){ 327 $.get('/pages/base/timesmodel/tepms/'+ tempName + '.html', function(html){
@@ -348,9 +347,9 @@ var SKBFormWizard = function() { @@ -348,9 +347,9 @@ var SKBFormWizard = function() {
348 var params = {'xlid':lineId,'startDateTime':startDateTime,'endDateTime':endDateTime,'zzsj':zzsj}; 347 var params = {'xlid':lineId,'startDateTime':startDateTime,'endDateTime':endDateTime,'zzsj':zzsj};
349 /** 348 /**
350 * getJSONP请求获取客流数据. 349 * getJSONP请求获取客流数据.
351 - * 350 + *
352 * 返回的是一个每次以半小时为间隔作为开始时间点, 在加上周转时间作为结束时间点的 时段段内的客流最大通过量. 351 * 返回的是一个每次以半小时为间隔作为开始时间点, 在加上周转时间作为结束时间点的 时段段内的客流最大通过量.
353 - * */ 352 + * */
354 getJSONP("http://139.196.13.237:8080/bsth-busfareflow-gj/Crlcxb/selectsjbctgl.do",params,function(json){ 353 getJSONP("http://139.196.13.237:8080/bsth-busfareflow-gj/Crlcxb/selectsjbctgl.do",params,function(json){
355 // 定义时段集合,可容量. 354 // 定义时段集合,可容量.
356 var sjdArr = getsjdArr(map),krlInt = parseInt(krl); 355 var sjdArr = getsjdArr(map),krlInt = parseInt(krl);
@@ -390,11 +389,29 @@ var SKBFormWizard = function() { @@ -390,11 +389,29 @@ var SKBFormWizard = function() {
390 389
391 // 返回参数详情模版. 390 // 返回参数详情模版.
392 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})}); 391 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
393 - }); 392 + });
394 }else if(n==1) { 393 }else if(n==1) {
395 - // 返回参数详情模版.  
396 - return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});  
397 - }else if (n==2 || n == 3) { 394 + // 更具站点路由版本获取起点终点站
  395 + var iversion = $('#lineVersionSelect').val();
  396 + $get('/stationroute/all',{'line.id_eq':lineId,'destroy_eq':0, 'versions_eq': iversion},function(result) {
  397 + $.each(result, function(i, d) {
  398 + if (d.stationMark == 'B' && d.directions == 0) {
  399 + // alert(d.stationName);
  400 + map.line.startStationName = d.stationName;
  401 + } else if (d.stationMark == 'E' && d.directions == 0) {
  402 + // alert(d.stationName);
  403 + map.line.endStationName = d.stationName;
  404 + }
  405 + });
  406 +
  407 + // return cb && cb({
  408 + // 'forminput': template(tempName, {map: map}),
  409 + // 'datadisplay': template(tempName + '_config', {map: null})
  410 + // });
  411 + // 返回参数详情模版.
  412 + return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
  413 + });
  414 + }else if (n==2 || n==3) {
398 // 更具站点路由版本获取起点终点站 415 // 更具站点路由版本获取起点终点站
399 var iversion = $('#lineVersionSelect').val(); 416 var iversion = $('#lineVersionSelect').val();
400 $get('/stationroute/all',{'line.id_eq':lineId,'destroy_eq':0, 'versions_eq': iversion},function(result) { 417 $get('/stationroute/all',{'line.id_eq':lineId,'destroy_eq':0, 'versions_eq': iversion},function(result) {
@@ -417,8 +434,8 @@ var SKBFormWizard = function() { @@ -417,8 +434,8 @@ var SKBFormWizard = function() {
417 434
418 } 435 }
419 }); 436 });
420 - }  
421 - 437 + };
  438 +
422 /** 439 /**
423 * @description (TODO) 格式化成渲染图形数据格式. 440 * @description (TODO) 格式化成渲染图形数据格式.
424 * 441 *
@@ -540,7 +557,17 @@ var SKBFormWizard = function() { @@ -540,7 +557,17 @@ var SKBFormWizard = function() {
540 'bxrc' : {required : true},// 班型人次,必填项 557 'bxrc' : {required : true},// 班型人次,必填项
541 'linePlayType' : {required : true},// 线路规划类型,必填项 558 'linePlayType' : {required : true},// 线路规划类型,必填项
542 'zdzcrl' : {number : true,digits : true}, 559 'zdzcrl' : {number : true,digits : true},
543 - 560 + // 新增时间段字段
  561 + 'start1' : {required : true},
  562 + 'end1' : {required : true},
  563 + 'start2' : {required : true},
  564 + 'end2' : {required : true},
  565 + 'start3' : {required : true},
  566 + 'end3' : {required : true},
  567 + 'start4' : {required : true},
  568 + 'end4' : {required : true},
  569 + 'start5' : {required : true},
  570 + 'end5' : {required : true},
544 571
545 'gfupStopTime' : {required : true,number : true}, // 高峰上行停站时间,必填项、必须为整数. 572 'gfupStopTime' : {required : true,number : true}, // 高峰上行停站时间,必填项、必须为整数.
546 'gfdownStopTime' : {required : true,number : true}, // 高峰下行停站时间,必填项、必须为整数. 573 'gfdownStopTime' : {required : true,number : true}, // 高峰下行停站时间,必填项、必须为整数.
@@ -957,6 +984,16 @@ var SKBFormWizard = function() { @@ -957,6 +984,16 @@ var SKBFormWizard = function() {
957 $('#zgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 早高峰结束时间 984 $('#zgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 早高峰结束时间
958 $('#wgfkssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰开始时间 985 $('#wgfkssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰开始时间
959 $('#wgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰结束时间 986 $('#wgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰结束时间
  987 + $('#startInput1').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  988 + $('#endInput1').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  989 + $('#startInput2').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  990 + $('#endInput2').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  991 + $('#startInput3').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  992 + $('#endInput3').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  993 + $('#startInput4').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  994 + $('#endInput4').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  995 + $('#startInput5').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  996 + $('#endInput5').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
960 // 初始化停车场下拉框. 997 // 初始化停车场下拉框.
961 gettccInfo(function(cd) { 998 gettccInfo(function(cd) {
962 var options = '<option value="">请选择...</option><optgroup label="停车场">'; 999 var options = '<option value="">请选择...</option><optgroup label="停车场">';
src/main/resources/static/pages/base/timesmodel/js/dateTimeTool.js
1 /** 时间工具类*/ 1 /** 时间工具类*/
2 var DateTimeTool = function () { 2 var DateTimeTool = function () {
  3 + var jsd = [];
  4 + var initSJD = function (map) {
  5 + jsd = map;
  6 + };
3 // 数字格式转化为时间格式 7 // 数字格式转化为时间格式
4 var calculateHours = function (time) { 8 var calculateHours = function (time) {
5 if(!time) 9 if(!time)
@@ -44,9 +48,38 @@ var DateTimeTool = function () { @@ -44,9 +48,38 @@ var DateTimeTool = function () {
44 +':' 48 +':'
45 +(date.getMinutes()<10? '0' + date.getMinutes() : date.getMinutes()); 49 +(date.getMinutes()<10? '0' + date.getMinutes() : date.getMinutes());
46 }; 50 };
  51 + // 判断时间在什么时间段段内
  52 + var judgmentTimeQuantum = function (t) {
  53 + if(t <= getDateTime(jsd[0].end))
  54 + return 0;
  55 + else if(t > getDateTime(jsd[1].start) && t <= getDateTime(jsd[1].end))
  56 + return 1;
  57 + else if(t > getDateTime(jsd[2].start) && t <= getDateTime(jsd[2].end))
  58 + return 2;
  59 + else if(t > getDateTime(jsd[3].start) && t <= getDateTime(jsd[3].end))
  60 + return 3;
  61 + else if(t > getDateTime(jsd[4].start))
  62 + return 4;
  63 + };
  64 +
  65 + // 8:31-16:00专用
  66 + var judgmentTimeQuantum1 = function (t) {
  67 + var start = DateTimeTool.getDateTime(jsd[2].start);
  68 + if(t > start && t <= start.setHours(start.getHours() + 2))
  69 + return 1;
  70 + else if(t > start.setHours(start.getHours() + 2) && t <= start.setHours(start.getHours() + 4))
  71 + return 2;
  72 + else if(t > start.setHours(start.getHours() + 4) && t <= start.setHours(start.getHours() + 6))
  73 + return 2;
  74 + else if(t > start.setHours(start.getHours() + 6) && t <= DateTimeTool.getDateTime(jsd[2].end))
  75 + return 1;
  76 + };
47 return{ 77 return{
  78 + initSJD : initSJD,
48 calculateHours : calculateHours, 79 calculateHours : calculateHours,
49 getDateTime : getDateTime, 80 getDateTime : getDateTime,
50 - getHHmmStr : getHHmmStr 81 + getHHmmStr : getHHmmStr,
  82 + judgmentTimeQuantum : judgmentTimeQuantum,
  83 + judgmentTimeQuantum1 : judgmentTimeQuantum1
51 } 84 }
52 }(); 85 }();
src/main/resources/static/pages/base/timesmodel/js/echartsDrawGanTT.js
@@ -5,7 +5,7 @@ var echartsDrawGTT = function () { @@ -5,7 +5,7 @@ var echartsDrawGTT = function () {
5 var upDowndom = document.getElementById("upDownContainer"); 5 var upDowndom = document.getElementById("upDownContainer");
6 var upDownChart = echarts.init(upDowndom); 6 var upDownChart = echarts.init(upDowndom);
7 // upDowndom.style.height = '200px'; 7 // upDowndom.style.height = '200px';
8 - var option,upDownOption,dataZoomStart = 0,dataZoomEnd = 80;//图层对象 8 + var option,upDownOption,dataZoomStart = 0,dataZoomEnd = 70;//图层对象
9 var historyData = [],// 保存操作图形后的数据集合(撤销与恢复操作) 9 var historyData = [],// 保存操作图形后的数据集合(撤销与恢复操作)
10 _keyIndex = -1,// 记录当前操作步骤 (在撤销与恢复操作时) 10 _keyIndex = -1,// 记录当前操作步骤 (在撤销与恢复操作时)
11 dataUp = [],// (上/下)行发车时刻表数据 11 dataUp = [],// (上/下)行发车时刻表数据
@@ -107,7 +107,8 @@ var echartsDrawGTT = function () { @@ -107,7 +107,8 @@ var echartsDrawGTT = function () {
107 bcObj.qdz, 107 bcObj.qdz,
108 bcObj.zdz, 108 bcObj.zdz,
109 bcObj.STOPTIME, 109 bcObj.STOPTIME,
110 - bcObj.isfb = 0 110 + bcObj.isfb ? 1:0,
  111 + bcObj.qs
111 //bcObj.isSwitchXl, 112 //bcObj.isSwitchXl,
112 //bcObj.bz, 113 //bcObj.bz,
113 ], 114 ],
@@ -329,7 +330,7 @@ var echartsDrawGTT = function () { @@ -329,7 +330,7 @@ var echartsDrawGTT = function () {
329 bcTypeStr = bcType[type]; 330 bcTypeStr = bcType[type];
330 331
331 var arr = [ 332 var arr = [
332 - '{left|' + timeStr + '}{type|' + bcTypeStr +'}', 333 + '{left|' + timeStr + '}{type|'+ ((dataZoomEnd - dataZoomStart) <= 70 ? bcType[type] : '') +'}',
333 '{left|' + lastStr + '}{left|' + stayStr + '}' 334 '{left|' + lastStr + '}{left|' + stayStr + '}'
334 ]; 335 ];
335 return arr.join('\n'); 336 return arr.join('\n');
@@ -601,11 +602,17 @@ var echartsDrawGTT = function () { @@ -601,11 +602,17 @@ var echartsDrawGTT = function () {
601 lastStr = "行:" + last; 602 lastStr = "行:" + last;
602 } 603 }
603 604
  605 + // 分班显示‘分’
  606 + if(params.data.value[16] == 1)
  607 + bcTypeStr = "分";
  608 + else
  609 + bcTypeStr = bcType[type];
  610 +
604 if(type == 'normal') { 611 if(type == 'normal') {
605 stayStr = "停:" + params.data.value[15]; 612 stayStr = "停:" + params.data.value[15];
606 } 613 }
607 var arr = [ 614 var arr = [
608 - '{left|' + timeStr + '}{type|'+ ((e.end - e.start) < 80 ? bcType[type] : '') +'}', 615 + '{left|' + timeStr + '}{type|'+ ((dataZoomEnd - dataZoomStart) <= 70 ? bcType[type] : '') +'}',
609 '{left|' + lastStr + '}{left|' + stayStr + '}' 616 '{left|' + lastStr + '}{left|' + stayStr + '}'
610 ]; 617 ];
611 618
@@ -895,14 +902,15 @@ var echartsDrawGTT = function () { @@ -895,14 +902,15 @@ var echartsDrawGTT = function () {
895 data[dataIndex].value[2] = xMax; 902 data[dataIndex].value[2] = xMax;
896 data[dataIndex].value[1] = data[dataIndex].value[2] - data[dataIndex].value[3]; 903 data[dataIndex].value[1] = data[dataIndex].value[2] - data[dataIndex].value[3];
897 } 904 }
898 -  
899 } 905 }
900 - _keyIndex++; 906 +
  907 + set_keyIndex(++_keyIndex);
901 908
902 historyData[_keyIndex] = $.extend(true, [], historyData[_keyIndex], data);// 历史数组增加一次数据 909 historyData[_keyIndex] = $.extend(true, [], historyData[_keyIndex], data);// 历史数组增加一次数据
903 refreshDrag(); 910 refreshDrag();
904 refreshUpDownData(); 911 refreshUpDownData();
905 historyData.splice(_keyIndex + 1, historyData.length);// 数据改变后过后清除多余的历史数据 912 historyData.splice(_keyIndex + 1, historyData.length);// 数据改变后过后清除多余的历史数据
  913 + init(historyData[_keyIndex],false,false);
906 } else { 914 } else {
907 refreshDrag(); 915 refreshDrag();
908 } 916 }
@@ -936,7 +944,12 @@ var echartsDrawGTT = function () { @@ -936,7 +944,12 @@ var echartsDrawGTT = function () {
936 color: '#333' 944 color: '#333'
937 }, 945 },
938 min: 0, 946 min: 0,
939 - max: 30, 947 + max: function(value) {
  948 + if(value.max < 30)
  949 + return 30;
  950 + else
  951 + return value.max + 5;
  952 + },
940 axisTick: {show: false}, 953 axisTick: {show: false},
941 //axisLine: {lineStyle: {color: '#ccc'}}, 954 //axisLine: {lineStyle: {color: '#ccc'}},
942 axisLabel: {show: false}, 955 axisLabel: {show: false},
src/main/resources/static/pages/base/timesmodel/js/gantt.js
1 (function() { 1 (function() {
  2 + var indexLoad = layer.load(0, {content:'拼命计算中...',time: 10*1000,success: function(layero){
  3 + layero.find('.layui-layer-content').css('padding-top', '40px');
  4 + }});
2 // 全屏模式点击事件. 5 // 全屏模式点击事件.
3 // $(document).on('click','.fullscreen',function() { 6 // $(document).on('click','.fullscreen',function() {
4 // if($('.ganttSvgContainer').height()>400) 7 // if($('.ganttSvgContainer').height()>400)
@@ -34,7 +37,7 @@ @@ -34,7 +37,7 @@
34 offsetX : offsetX, 37 offsetX : offsetX,
35 offsetY : offsetY, 38 offsetY : offsetY,
36 content :'<div class="tipsdscontinue"> <span>图例:</span> <div class="dscrp sx"></div><span>:上行</span> <div class="dscrp xx"></div> <span>:下行</span></br><div/></br>' + 39 content :'<div class="tipsdscontinue"> <span>图例:</span> <div class="dscrp sx"></div><span>:上行</span> <div class="dscrp xx"></div> <span>:下行</span></br><div/></br>' +
37 - '<div class="tipsdscontinue"> <span>该模块支持鼠标拖拽、鼠标绘制(鼠标右键按下3S开始)框选功能.</span> <div/>' 40 + '<div class="tipsdscontinue"> <span>该模块支持鼠标拖拽功能.</span> <div/>'
38 41
39 }); 42 });
40 $('.tipso-animation').tipso('show'); 43 $('.tipso-animation').tipso('show');
@@ -99,7 +102,6 @@ @@ -99,7 +102,6 @@
99 Main_v2.exportDataConfig(data.aInternalLpObj); 102 Main_v2.exportDataConfig(data.aInternalLpObj);
100 } else if (map.baseRes == '3') { // 主站停站使用v2_2版本 103 } else if (map.baseRes == '3') { // 主站停站使用v2_2版本
101 data = Main_v2_2.BXPplaceClassesTime03(_paramObj, CSMap.maxCar); 104 data = Main_v2_2.BXPplaceClassesTime03(_paramObj, CSMap.maxCar);
102 - Main_v2_2.exportDataConfig(data.aInternalLpObj);  
103 } 105 }
104 106
105 }else { 107 }else {
@@ -124,12 +126,12 @@ @@ -124,12 +126,12 @@
124 } 126 }
125 // 按照发车序号顺序排序. 127 // 按照发车序号顺序排序.
126 lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 128 lpbc_.sort(function(a,b){return a.fcno-b.fcno});
127 - resultJA = resultJA.concat(BaseFun.addjclbbc01(lpbc_,dataMap,stopAraay[0].lbsj,map)); 129 + resultJA = resultJA.concat(BaseFun.addjclbbc01(lpbc_,dataMap,stopArray[0].lbsj,map));
128 } 130 }
129 data = {'json':rsjar,'bxrcgs':null}; 131 data = {'json':rsjar,'bxrcgs':null};
130 } 132 }
131 echartsDrawGTT.init(data.json,true,true); 133 echartsDrawGTT.init(data.json,true,true);
132 - console.log(data.json); 134 + // console.log(data.json);
133 // 创建甘特图对象. 135 // 创建甘特图对象.
134 // var graph = d3.select('#ganttSvg').relationshipGraph( 136 // var graph = d3.select('#ganttSvg').relationshipGraph(
135 // getGraphArgus({'ganttInitParams': map,'yAxisCarArray':CSMap.maxCar, 137 // getGraphArgus({'ganttInitParams': map,'yAxisCarArray':CSMap.maxCar,
@@ -140,6 +142,55 @@ @@ -140,6 +142,55 @@
140 // graph.addHistory(); 142 // graph.addHistory();
141 // // 初始化右键菜单. 143 // // 初始化右键菜单.
142 // contextInit(graph); 144 // contextInit(graph);
  145 +
  146 + if (map.baseRes == '3' || map.baseRes == '1') {
  147 + // 导入导出设置
  148 + // Main_v2_2.exportExcelConfig($_GlobalGraph.getDataArray);
  149 +
  150 + var _dfun = function() {
  151 + // fix,从新的甘特图中获取数据
  152 + var _keyIndex = echartsDrawGTT.get_keyIndex();
  153 + var historyData = echartsDrawGTT.getHistoryData();
  154 + var _data = $.extend(true, [], data, historyData[_keyIndex]);
  155 +
  156 + var _i;
  157 + var _j;
  158 + var _gObj;
  159 +
  160 + var _rtnBcArray = [];
  161 + for (_i = 0; _i < _data.length; _i++) {
  162 + _gObj = _data[_i].value;
  163 + _rtnBcArray.push({
  164 + lpName : _gObj[0],
  165 + fcsj: moment(_gObj[1]).format("HH:mm"),
  166 + ARRIVALTIME: moment(_gObj[2]).format("HH:mm"),
  167 + bcsj: _gObj[3] / 60000,
  168 + lpNo: _gObj[4],
  169 + lpType: _gObj[5],
  170 + bcType: _gObj[6],
  171 + fcno: _gObj[7],
  172 + xlDir: (_gObj[8] == 0 ? "relationshipGraph-up" : "relationshipGraph-down"),
  173 + jhlc: _gObj[9],
  174 + tcc: _gObj[10],
  175 + ttinfo: _gObj[11],
  176 + xl: _gObj[12],
  177 + qdz: _gObj[13],
  178 + zdz: _gObj[14],
  179 + STOPTIME: _gObj[15],
  180 + isfb: _gObj[16]
  181 + });
  182 + }
  183 +
  184 + console.log("重组前数据=" + _data);
  185 + console.log("重组后数据=" + _rtnBcArray);
  186 + return _rtnBcArray;
  187 + };
  188 +
  189 + // Main_v2_2.exportExcelConfig(_dfun);
  190 + }
  191 +
  192 + // 关闭弹出层
  193 + layer.close(indexLoad);
143 },500); 194 },500);
144 195
145 /** 196 /**
@@ -214,9 +265,10 @@ @@ -214,9 +265,10 @@
214 'gftzsj': BaseFun.formatPairing(gatps.gfupStopTime,gatps.gfdownStopTime),// 高峰停站时间. 265 'gftzsj': BaseFun.formatPairing(gatps.gfupStopTime,gatps.gfdownStopTime),// 高峰停站时间.
215 'dgtzsj' : BaseFun.formatPairing(gatps.dgupStopTime,gatps.dgdownStopTime),// 低谷停站时间. 266 'dgtzsj' : BaseFun.formatPairing(gatps.dgupStopTime,gatps.dgdownStopTime),// 低谷停站时间.
216 'dgmaxtzsj' : parseInt(gatps.dgmaxtzsj),// 低谷最大停站时间. 267 'dgmaxtzsj' : parseInt(gatps.dgmaxtzsj),// 低谷最大停站时间.
217 - 'dgmaxfcjx' : parseInt(gatps.dgmaxfcjx),// 低谷最大发车间隙. 268 + // 'dgmaxfcjx' : parseInt(gatps.dgmaxfcjx),// 低谷最大发车间隙.
  269 + 'dgmaxfcjx' : 20,// 低谷最大发车间隙.
218 'map' : gatps, 270 'map' : gatps,
219 - 'zzsj':gatps.zzsj,// 周转时间. 271 + 'zzsj':gatps.zzsj// 周转时间.
220 }; 272 };
221 } 273 }
222 274
src/main/resources/static/pages/base/timesmodel/js/systemTools.js
@@ -13,8 +13,7 @@ $(&#39;.recover&#39;).on(&#39;click&#39;,function() { @@ -13,8 +13,7 @@ $(&#39;.recover&#39;).on(&#39;click&#39;,function() {
13 echartsDrawGTT.set_keyIndex(++_keyIndex); 13 echartsDrawGTT.set_keyIndex(++_keyIndex);
14 var historyData = echartsDrawGTT.getHistoryData(); 14 var historyData = echartsDrawGTT.getHistoryData();
15 var data = $.extend(true, [], data, historyData[_keyIndex]); 15 var data = $.extend(true, [], data, historyData[_keyIndex]);
16 - echartsDrawGTT.init(data,false,false);  
17 - echartsDrawGTT.refreshDrag(); 16 + echartsDrawGTT.init(data,false,false,false);
18 layer.msg('恢复到操作记录的【第'+(_keyIndex+1)+'步】了!'); 17 layer.msg('恢复到操作记录的【第'+(_keyIndex+1)+'步】了!');
19 } 18 }
20 }); 19 });
@@ -33,8 +32,7 @@ $(&quot;.revoke&quot;).on(&quot;click&quot;,function(){ @@ -33,8 +32,7 @@ $(&quot;.revoke&quot;).on(&quot;click&quot;,function(){
33 echartsDrawGTT.set_keyIndex(--_keyIndex); 32 echartsDrawGTT.set_keyIndex(--_keyIndex);
34 var historyData = echartsDrawGTT.getHistoryData(); 33 var historyData = echartsDrawGTT.getHistoryData();
35 var data = $.extend(true, [], data, historyData[_keyIndex]); 34 var data = $.extend(true, [], data, historyData[_keyIndex]);
36 - echartsDrawGTT.init(data,false,false);  
37 - echartsDrawGTT.refreshDrag(); 35 + echartsDrawGTT.init(data,false,false,false);
38 layer.msg('撤销到操作记录的【第'+(_keyIndex+1)+'步】了!'); 36 layer.msg('撤销到操作记录的【第'+(_keyIndex+1)+'步】了!');
39 } 37 }
40 }); 38 });
@@ -101,8 +99,7 @@ $(&#39;#bcAdjustListSubmit&#39;).on(&#39;click&#39;,function() { @@ -101,8 +99,7 @@ $(&#39;#bcAdjustListSubmit&#39;).on(&#39;click&#39;,function() {
101 data[bcAdjustList[i]].value[0] = lpName; 99 data[bcAdjustList[i]].value[0] = lpName;
102 data[bcAdjustList[i]].value[4] = lpDataCount[lpName][2]; 100 data[bcAdjustList[i]].value[4] = lpDataCount[lpName][2];
103 } 101 }
104 - echartsDrawGTT.init(data,false,true);  
105 - echartsDrawGTT.refreshDrag(); 102 + echartsDrawGTT.init(data,false,true,false);
106 } else 103 } else
107 layer.msg('没有找到目标路牌,请重新选择!'); 104 layer.msg('没有找到目标路牌,请重新选择!');
108 $('.bc-adjust-list').addClass('hidden'); 105 $('.bc-adjust-list').addClass('hidden');
@@ -115,8 +112,8 @@ $(&#39;#bcAdjustListSubmit&#39;).on(&#39;click&#39;,function() { @@ -115,8 +112,8 @@ $(&#39;#bcAdjustListSubmit&#39;).on(&#39;click&#39;,function() {
115 /* 右击菜单事件 112 /* 右击菜单事件
116 * 1.修改 update 113 * 1.修改 update
117 * 2.删除 delete 114 * 2.删除 delete
118 -* 3.设为上行 setUp  
119 -* 4.设为下行 setDown 115 +* 3.班次切换上下行 dropdownMenuSwitchUpDown
  116 +* 4.路牌切换上下行 dropdownMenuLpSwitchUpDown
120 * 5.设为正常 setNormal 117 * 5.设为正常 setNormal
121 * 6.设为区间 setRegion 118 * 6.设为区间 setRegion
122 * 7.设为分班 setFb 119 * 7.设为分班 setFb
@@ -148,13 +145,16 @@ function dropdownMenuDelete(dataIndex) { @@ -148,13 +145,16 @@ function dropdownMenuDelete(dataIndex) {
148 // 关闭弹出层. 145 // 关闭弹出层.
149 layer.closeAll(); 146 layer.closeAll();
150 data.splice(dataIndex,1); 147 data.splice(dataIndex,1);
151 - echartsDrawGTT.init(data,false,true);  
152 - echartsDrawGTT.refreshDrag(); 148 + $.each(data, function () {
  149 + if(bc.value[0] == this.value[0] && bc.value[7] < this.value[7])
  150 + this.value[7] -= 1;
  151 + });
  152 + echartsDrawGTT.init(data,false,true,false);
153 layer.msg('删除成功!'); 153 layer.msg('删除成功!');
154 }); 154 });
155 } 155 }
156 } 156 }
157 -// 切换上下行 157 +// 班次切换上下行
158 function dropdownMenuSwitchUpDown(dataIndex) { 158 function dropdownMenuSwitchUpDown(dataIndex) {
159 // 获取当前操作步数 159 // 获取当前操作步数
160 var _keyIndex = echartsDrawGTT.get_keyIndex(), 160 var _keyIndex = echartsDrawGTT.get_keyIndex(),
@@ -180,9 +180,17 @@ function dropdownMenuSwitchUpDown(dataIndex) { @@ -180,9 +180,17 @@ function dropdownMenuSwitchUpDown(dataIndex) {
180 data[dataIndex].value[3] = parseInt(dataMap.map.downInTimer)*60000; 180 data[dataIndex].value[3] = parseInt(dataMap.map.downInTimer)*60000;
181 data[dataIndex].value[2] = data[dataIndex].value[1] + data[dataIndex].value[3]; 181 data[dataIndex].value[2] = data[dataIndex].value[1] + data[dataIndex].value[3];
182 } 182 }
183 - echartsDrawGTT.init(data,false,true);  
184 - echartsDrawGTT.refreshDrag();  
185 - layer.msg('设置为上行成功!'); 183 + if(data[dataIndex].value[3] <= 0){
  184 + var bc = data[dataIndex];
  185 + data.splice(dataIndex,1);
  186 + $.each(data, function () {
  187 + if(bc.value[0] == this.value[0] && bc.value[7] < this.value[7])
  188 + this.value[7] -= 1;
  189 + });
  190 + layer.msg('班次切换上下行成功,切换后班次运送时间为0分钟,无意义所以删除改班次!',{time: 8000});
  191 + } else
  192 + layer.msg('班次切换上下行成功!');
  193 + echartsDrawGTT.init(data,false,true,false);
186 } 194 }
187 // 路牌切换上下行 195 // 路牌切换上下行
188 function dropdownMenuLpSwitchUpDown(dataIndex) { 196 function dropdownMenuLpSwitchUpDown(dataIndex) {
@@ -211,10 +219,16 @@ function dropdownMenuLpSwitchUpDown(dataIndex) { @@ -211,10 +219,16 @@ function dropdownMenuLpSwitchUpDown(dataIndex) {
211 data[i].value[3] = parseInt(dataMap.map.downInTimer)*60000; 219 data[i].value[3] = parseInt(dataMap.map.downInTimer)*60000;
212 data[i].value[2] = data[i].value[1] + data[i].value[3]; 220 data[i].value[2] = data[i].value[1] + data[i].value[3];
213 } 221 }
  222 + if(data[i].value[3] <= 0){
  223 + data.splice(i,1);
  224 + $.each(data, function () {
  225 + if(data[i].value[0] == this.value[0] && data[i].value[7] < this.value[7])
  226 + this.value[7] -= 1;
  227 + });
  228 + }
214 } 229 }
215 } 230 }
216 - echartsDrawGTT.init(data,false,true);  
217 - echartsDrawGTT.refreshDrag(); 231 + echartsDrawGTT.init(data,false,true,false);
218 layer.msg('路牌切换上下行成功!'); 232 layer.msg('路牌切换上下行成功!');
219 } 233 }
220 // 设为正常 234 // 设为正常
@@ -226,11 +240,7 @@ function dropdownMenuSetNormal(dataIndex) { @@ -226,11 +240,7 @@ function dropdownMenuSetNormal(dataIndex) {
226 240
227 if(!isType(data[dataIndex].value[6],'设置为正常班次','normal','正常班次')) { 241 if(!isType(data[dataIndex].value[6],'设置为正常班次','normal','正常班次')) {
228 data[dataIndex].value[6] = 'normal'; 242 data[dataIndex].value[6] = 'normal';
229 - historyData.push(data);  
230 - echartsDrawGTT.set_keyIndex(++_keyIndex);  
231 - echartsDrawGTT.setHistoryData(historyData);  
232 - echartsDrawGTT.refreshDrag();  
233 - echartsDrawGTT.refreshUpDownData(); 243 + echartsDrawGTT.init(data,false,true,false);
234 layer.msg('设置为正常成功!'); 244 layer.msg('设置为正常成功!');
235 } 245 }
236 } 246 }
@@ -242,11 +252,7 @@ function dropdownMenuSetRegion(dataIndex) { @@ -242,11 +252,7 @@ function dropdownMenuSetRegion(dataIndex) {
242 data = $.extend(true, [], data, historyData[_keyIndex]); 252 data = $.extend(true, [], data, historyData[_keyIndex]);
243 if(!isType(data[dataIndex].value[6],'设置为区间班次','region','区间班次')) { 253 if(!isType(data[dataIndex].value[6],'设置为区间班次','region','区间班次')) {
244 data[dataIndex].value[6] = 'region'; 254 data[dataIndex].value[6] = 'region';
245 - historyData.push(data);  
246 - echartsDrawGTT.set_keyIndex(++_keyIndex);  
247 - echartsDrawGTT.setHistoryData(historyData);  
248 - echartsDrawGTT.refreshDrag();  
249 - echartsDrawGTT.refreshUpDownData(); 255 + echartsDrawGTT.init(data,false,true,false);
250 layer.msg('设置为区间成功!'); 256 layer.msg('设置为区间成功!');
251 } 257 }
252 } 258 }
@@ -258,11 +264,7 @@ function dropdownMenuSetFb(dataIndex) { @@ -258,11 +264,7 @@ function dropdownMenuSetFb(dataIndex) {
258 data = $.extend(true, [], data, historyData[_keyIndex]); 264 data = $.extend(true, [], data, historyData[_keyIndex]);
259 if(!isType(data[dataIndex].value[6],'设置为分班班次') && !isType(data[dataIndex].value[16],'设置为分班班次',1,'分班班次')) { 265 if(!isType(data[dataIndex].value[6],'设置为分班班次') && !isType(data[dataIndex].value[16],'设置为分班班次',1,'分班班次')) {
260 data[dataIndex].value[16] = 1; 266 data[dataIndex].value[16] = 1;
261 - historyData.push(data);  
262 - echartsDrawGTT.set_keyIndex(++_keyIndex);  
263 - echartsDrawGTT.setHistoryData(historyData);  
264 - echartsDrawGTT.refreshDrag();  
265 - echartsDrawGTT.refreshUpDownData(); 267 + echartsDrawGTT.init(data,false,true,false);
266 layer.msg('设置为分班成功!'); 268 layer.msg('设置为分班成功!');
267 } 269 }
268 } 270 }
@@ -274,11 +276,7 @@ function dropdownMenuSetNoFb(dataIndex) { @@ -274,11 +276,7 @@ function dropdownMenuSetNoFb(dataIndex) {
274 data = $.extend(true, [], data, historyData[_keyIndex]); 276 data = $.extend(true, [], data, historyData[_keyIndex]);
275 if(!isType(data[dataIndex].value[6],'取消分班') && !isType(data[dataIndex].value[16],0,'不是分班班次')) { 277 if(!isType(data[dataIndex].value[6],'取消分班') && !isType(data[dataIndex].value[16],0,'不是分班班次')) {
276 data[dataIndex].value[16] = 0; 278 data[dataIndex].value[16] = 0;
277 - historyData.push(data);  
278 - echartsDrawGTT.set_keyIndex(++_keyIndex);  
279 - echartsDrawGTT.setHistoryData(historyData);  
280 - echartsDrawGTT.refreshDrag();  
281 - echartsDrawGTT.refreshUpDownData(); 279 + echartsDrawGTT.init(data,false,true,false);
282 layer.msg('取消分班成功!'); 280 layer.msg('取消分班成功!');
283 } 281 }
284 } 282 }
@@ -290,11 +288,7 @@ function dropdownMenuSetVenting(dataIndex) { @@ -290,11 +288,7 @@ function dropdownMenuSetVenting(dataIndex) {
290 data = $.extend(true, [], data, historyData[_keyIndex]); 288 data = $.extend(true, [], data, historyData[_keyIndex]);
291 if(!isType(data[dataIndex].value[6],'设置为直放班次','venting','直放班次')) { 289 if(!isType(data[dataIndex].value[6],'设置为直放班次','venting','直放班次')) {
292 data[dataIndex].value[6] = 'venting'; 290 data[dataIndex].value[6] = 'venting';
293 - historyData.push(data);  
294 - echartsDrawGTT.set_keyIndex(++_keyIndex);  
295 - echartsDrawGTT.setHistoryData(historyData);  
296 - echartsDrawGTT.refreshDrag();  
297 - echartsDrawGTT.refreshUpDownData(); 291 + echartsDrawGTT.init(data,false,true,false);
298 layer.msg('设置为直放成功!'); 292 layer.msg('设置为直放成功!');
299 } 293 }
300 } 294 }
@@ -306,11 +300,7 @@ function dropdownMenuSetMajor(dataIndex) { @@ -306,11 +300,7 @@ function dropdownMenuSetMajor(dataIndex) {
306 data = $.extend(true, [], data, historyData[_keyIndex]); 300 data = $.extend(true, [], data, historyData[_keyIndex]);
307 if(!isType(data[dataIndex].value[6],'设置为放站班次','major','放站班次')){ 301 if(!isType(data[dataIndex].value[6],'设置为放站班次','major','放站班次')){
308 data[dataIndex].value[6] = 'major' ; 302 data[dataIndex].value[6] = 'major' ;
309 - historyData.push(data);  
310 - echartsDrawGTT.set_keyIndex(++_keyIndex);  
311 - echartsDrawGTT.setHistoryData(historyData);  
312 - echartsDrawGTT.refreshDrag();  
313 - echartsDrawGTT.refreshUpDownData(); 303 + echartsDrawGTT.init(data,false,true,false);
314 layer.msg('设置为放站成功!'); 304 layer.msg('设置为放站成功!');
315 } 305 }
316 } 306 }
@@ -460,6 +450,6 @@ $(&#39;.parambtn&#39;).on(&#39;click&#39;, function() { @@ -460,6 +450,6 @@ $(&#39;.parambtn&#39;).on(&#39;click&#39;, function() {
460 $.get('/pages/base/timesmodel/paramadd.html', function(m){ 450 $.get('/pages/base/timesmodel/paramadd.html', function(m){
461 $(pjaxContainer).append(m); 451 $(pjaxContainer).append(m);
462 // 规定被选元素要触发的事件。可以使自定义事件(使用 bind() 函数来附加),或者任何标准事件。 452 // 规定被选元素要触发的事件。可以使自定义事件(使用 bind() 函数来附加),或者任何标准事件。
463 - $('#paramadd_mobal').trigger('paramAddMobal.show', [Main_v2, Main_v2_2, InternalScheduleObj_v2_2]); 453 + $('#paramadd_mobal').trigger('paramAddMobal.show', Main_v2);
464 }); 454 });
465 }); 455 });
466 \ No newline at end of file 456 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/v1/AdjustTrip.js
@@ -15,26 +15,47 @@ @@ -15,26 +15,47 @@
15 */ 15 */
16 var AdjustTrip = function () { 16 var AdjustTrip = function () {
17 var departureClearanceAdjust = function (bcList, dataMap) { 17 var departureClearanceAdjust = function (bcList, dataMap) {
18 - var upBc = new Array(), downBc = new Array();  
19 - // 取出上下行班次,并按发车时间排序  
20 - $.each(bcList, function () {  
21 - if(this.bcType == "normal"){  
22 - if(this.xlDir == "relationshipGraph-up")  
23 - upBc.push(this);  
24 - if(this.xlDir == "relationshipGraph-down")  
25 - downBc.push(this); 18 + var upDownbc = bcFun.getUpAndDownBc(bcList, dataMap);
  19 +
  20 + // 升序排序
  21 + // upDownbc[0].sort(function(a,b){return DateTimeTool.getDateTime(a.fcsj)-DateTimeTool.getDateTime(b.fcsj)});
  22 + // upDownbc[1].sort(function(a,b){return DateTimeTool.getDateTime(a.fcsj)-DateTimeTool.getDateTime(b.fcsj)});
  23 + for(var i=1; i<20; i++) {
  24 + if(i%2 == 0) {
  25 + calculate(upDownbc[1], bcList, dataMap, 5);
  26 + calculate(upDownbc[0], bcList, dataMap, 5);
  27 + } else {
  28 + calculate(upDownbc[0], bcList, dataMap, 5);
  29 + calculate(upDownbc[1], bcList, dataMap, 5);
  30 +
26 } 31 }
27 - });  
28 - // upBc.sort(function(a,b){return a.fcint-b.fcint});  
29 - // downBc.sort(function(a,b){return a.fcint-b.fcint});  
30 - calculate(upBc, bcList, dataMap, 11);  
31 - calculate(downBc, bcList, dataMap, 11); 32 + }
  33 + for(var i=1; i<20; i++) {
  34 + if(i%2 == 0) {
  35 + calculateReverse(upDownbc[1], bcList, dataMap, 5);
  36 + calculateReverse(upDownbc[0], bcList, dataMap, 5);
  37 + } else {
  38 + calculateReverse(upDownbc[0], bcList, dataMap, 5);
  39 + calculateReverse(upDownbc[1], bcList, dataMap, 5);
  40 +
  41 + }
  42 + }
  43 + for(var i=1; i<10; i++) {
  44 + if(i%2 == 0) {
  45 + calculate(upDownbc[1], bcList, dataMap, 5);
  46 + calculate(upDownbc[0], bcList, dataMap, 5);
  47 + } else {
  48 + calculate(upDownbc[0], bcList, dataMap, 5);
  49 + calculate(upDownbc[1], bcList, dataMap, 5);
  50 +
  51 + }
  52 + }
32 }; 53 };
33 54
34 var iBcCountOfGroup = 3; // 3个班次一次参与计算 55 var iBcCountOfGroup = 3; // 3个班次一次参与计算
35 var dirBcOfGroup = []; 56 var dirBcOfGroup = [];
36 var dirBcIntervalOfGroup = []; // 班次间隔列表,3个班次,2个间隔 57 var dirBcIntervalOfGroup = []; // 班次间隔列表,3个班次,2个间隔
37 - var oBcFcTime; // 班次发车时间 58 + var oBcFcTime = null; // 班次发车时间
38 /** 59 /**
39 * 平衡车距内部方法。 60 * 平衡车距内部方法。
40 * @param dirBc {array} 单方向班次列表 61 * @param dirBc {array} 单方向班次列表
@@ -46,19 +67,20 @@ var AdjustTrip = function () { @@ -46,19 +67,20 @@ var AdjustTrip = function () {
46 var calculate = function (dirBc, bcList, dataMap, iFre) { 67 var calculate = function (dirBc, bcList, dataMap, iFre) {
47 if(iFre > 0){ 68 if(iFre > 0){
48 // 升序排序 69 // 升序排序
49 - dirBc.sort(function(a,b){return a.fcint-b.fcint}); 70 + dirBc.sort(function(a,b){return DateTimeTool.getDateTime(a.fcsj)-DateTimeTool.getDateTime(b.fcsj)});
50 71
51 for (var i = 0; i <= dirBc.length; i++) { 72 for (var i = 0; i <= dirBc.length; i++) {
52 // 获取班次列表 73 // 获取班次列表
53 _calcuBcGroup(i, dirBc); 74 _calcuBcGroup(i, dirBc);
54 75
55 - if (dirBcOfGroup.length > 0) { 76 + if (dirBcOfGroup.length > 2) {
56 // 获取中间预调整的班次时间 77 // 获取中间预调整的班次时间
57 - oBcFcTime = dirBcOfGroup[1].fcint; 78 + oBcFcTime = dirBcOfGroup[1].fcsj;
58 // 获取发车间隙:用发车时间判断 79 // 获取发车间隙:用发车时间判断
59 - var fcjx = dataMap.fcjx[judgmentTimeQuantum(oBcFcTime)]; 80 + var fcjx = dataMap.fcjx[DateTimeTool.judgmentTimeQuantum(DateTimeTool.getDateTime(oBcFcTime))];
60 // 发车时间所在时间段 81 // 发车时间所在时间段
61 - // var timeQuantum = judgmentTimeQuantum(oBcFcTime); 82 + // var timeQuantum = DateTimeTool.judgmentTimeQuantum(oBcFcTime);
  83 +
62 if (dirBcIntervalOfGroup[0] < fcjx.min) { 84 if (dirBcIntervalOfGroup[0] < fcjx.min) {
63 // 发车间隙调整为高峰发车间隙 +时间 85 // 发车间隙调整为高峰发车间隙 +时间
64 if (_isModifyBcFcsj( 86 if (_isModifyBcFcsj(
@@ -73,6 +95,21 @@ var AdjustTrip = function () { @@ -73,6 +95,21 @@ var AdjustTrip = function () {
73 dataMap, 95 dataMap,
74 1 96 1
75 ); 97 );
  98 + } else {
  99 + // 最后一个班次不能为末班车 中间班次不能调整,就调整后一个的班次
  100 + if (!bcFun.lpBcIsHaveLast(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  101 + bcList,
  102 + dirBcOfGroup[2],
  103 + dataMap,
  104 + -1
  105 + )) {
  106 + _modifyFcsj(
  107 + bcList,
  108 + dirBcOfGroup[2],
  109 + dataMap,
  110 + -1
  111 + );
  112 + }
76 } 113 }
77 } else if (dirBcIntervalOfGroup[0] > fcjx.max) { 114 } else if (dirBcIntervalOfGroup[0] > fcjx.max) {
78 // 发车间隙调整为高峰发车间隙 -时间 115 // 发车间隙调整为高峰发车间隙 -时间
@@ -81,17 +118,35 @@ var AdjustTrip = function () { @@ -81,17 +118,35 @@ var AdjustTrip = function () {
81 dirBcOfGroup[1], 118 dirBcOfGroup[1],
82 dataMap, 119 dataMap,
83 -1 120 -1
  121 + // fcjx.max - dirBcIntervalOfGroup[0]
84 )) { 122 )) {
85 _modifyFcsj( 123 _modifyFcsj(
86 bcList, 124 bcList,
87 dirBcOfGroup[1], 125 dirBcOfGroup[1],
88 dataMap, 126 dataMap,
89 -1 127 -1
  128 + // fcjx.max - dirBcIntervalOfGroup[0]
90 ); 129 );
  130 + } else {
  131 + // 下一个班次不能为首班车 中间班次不能调整,就调整下一个的班次
  132 + if (!bcFun.lpBcIsHaveLast(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  133 + bcList,
  134 + dirBcOfGroup[2],
  135 + dataMap,
  136 + fcjx.max - dirBcIntervalOfGroup[0]
  137 + )) {
  138 + _modifyFcsj(
  139 + bcList,
  140 + dirBcOfGroup[2],
  141 + dataMap,
  142 + fcjx.max - dirBcIntervalOfGroup[0]
  143 + );
  144 + }
91 } 145 }
92 } else { 146 } else {
93 // -1或+1分钟 147 // -1或+1分钟
94 if (Math.abs(dirBcIntervalOfGroup[0] - dirBcIntervalOfGroup[1]) <= 1) { 148 if (Math.abs(dirBcIntervalOfGroup[0] - dirBcIntervalOfGroup[1]) <= 1) {
  149 + continue;
95 // 两个间隔相差1分钟,不处理 150 // 两个间隔相差1分钟,不处理
96 } else if (dirBcIntervalOfGroup[0] > dirBcIntervalOfGroup[1]) { 151 } else if (dirBcIntervalOfGroup[0] > dirBcIntervalOfGroup[1]) {
97 if (_isModifyBcFcsj( 152 if (_isModifyBcFcsj(
@@ -106,6 +161,21 @@ var AdjustTrip = function () { @@ -106,6 +161,21 @@ var AdjustTrip = function () {
106 dataMap, 161 dataMap,
107 -1 162 -1
108 ); 163 );
  164 + } else {
  165 + // 前一个班次不能为首班车 中间班次不能调整,就调整前一个的班次
  166 + if (!bcFun.lpBcIsHaveFirst(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  167 + bcList,
  168 + dirBcOfGroup[0],
  169 + dataMap,
  170 + 1
  171 + )) {
  172 + _modifyFcsj(
  173 + bcList,
  174 + dirBcOfGroup[0],
  175 + dataMap,
  176 + 1
  177 + );
  178 + }
109 } 179 }
110 } else { 180 } else {
111 if (_isModifyBcFcsj( 181 if (_isModifyBcFcsj(
@@ -120,6 +190,21 @@ var AdjustTrip = function () { @@ -120,6 +190,21 @@ var AdjustTrip = function () {
120 dataMap, 190 dataMap,
121 1 191 1
122 ); 192 );
  193 + } else {
  194 + // 最后一个班次不能为末班车 中间班次不能调整,就调整后一个的班次
  195 + if (!bcFun.lpBcIsHaveLast(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  196 + bcList,
  197 + dirBcOfGroup[2],
  198 + dataMap,
  199 + -1
  200 + )) {
  201 + _modifyFcsj(
  202 + bcList,
  203 + dirBcOfGroup[2],
  204 + dataMap,
  205 + -1
  206 + );
  207 + }
123 } 208 }
124 } 209 }
125 } 210 }
@@ -140,7 +225,10 @@ var AdjustTrip = function () { @@ -140,7 +225,10 @@ var AdjustTrip = function () {
140 dirBcOfGroup = []; 225 dirBcOfGroup = [];
141 dirBcIntervalOfGroup = []; 226 dirBcIntervalOfGroup = [];
142 for (var i = iStartIndex; i < iStartIndex + iBcCountOfGroup && iStartIndex < dirBc.length - 2; i++) { 227 for (var i = iStartIndex; i < iStartIndex + iBcCountOfGroup && iStartIndex < dirBc.length - 2; i++) {
143 - dirBcOfGroup.push(dirBc[i]); 228 + if(dirBc[i].bcType == 'cf')
  229 + iStartIndex++;
  230 + else
  231 + dirBcOfGroup.push(dirBc[i]);
144 } 232 }
145 for (var j = 0; j < dirBcOfGroup.length - 1; j++) { 233 for (var j = 0; j < dirBcOfGroup.length - 1; j++) {
146 dirBcIntervalOfGroup.push((DateTimeTool.getDateTime(dirBcOfGroup[j + 1].fcsj).getTime() - DateTimeTool.getDateTime(dirBcOfGroup[j].fcsj).getTime())/60000); 234 dirBcIntervalOfGroup.push((DateTimeTool.getDateTime(dirBcOfGroup[j + 1].fcsj).getTime() - DateTimeTool.getDateTime(dirBcOfGroup[j].fcsj).getTime())/60000);
@@ -149,6 +237,201 @@ var AdjustTrip = function () { @@ -149,6 +237,201 @@ var AdjustTrip = function () {
149 }; 237 };
150 238
151 /** 239 /**
  240 + * 平衡车距内部方法(反方向)。
  241 + * @param dirBc {array} 单方向班次列表
  242 + * @param bcList {array} 所有班次列表对象
  243 + * @param dataMap {array} 参数对象
  244 + * @param iFre {int} 递归次数
  245 + * @private
  246 + */
  247 + var calculateReverse = function (dirBc, bcList, dataMap, iFre) {
  248 + if(iFre > 0){
  249 + // 降序排序
  250 + dirBc.sort(function(a,b){return DateTimeTool.getDateTime(b.fcsj)-DateTimeTool.getDateTime(a.fcsj)});
  251 +
  252 + for (var i = 0; i <= dirBc.length; i++) {
  253 + // 获取班次列表
  254 + _calcuReverseBcGroup(i, dirBc);
  255 +
  256 + if (dirBcOfGroup.length > 2) {
  257 + // 获取中间预调整的班次时间
  258 + oBcFcTime = dirBcOfGroup[1].fcsj;
  259 + // 获取发车间隙:用发车时间判断
  260 + var fcjx = dataMap.fcjx[DateTimeTool.judgmentTimeQuantum(DateTimeTool.getDateTime(oBcFcTime))];
  261 + // 发车时间所在时间段
  262 + // var timeQuantum = DateTimeTool.judgmentTimeQuantum(oBcFcTime);
  263 +
  264 + if (dirBcIntervalOfGroup[0] < fcjx.min) {
  265 + // 发车间隙调整为高峰发车间隙 +时间
  266 + if (_isModifyBcFcsj(
  267 + bcList,
  268 + dirBcOfGroup[1],
  269 + dataMap,
  270 + -1
  271 + )) {
  272 + _modifyFcsj(
  273 + bcList,
  274 + dirBcOfGroup[1],
  275 + dataMap,
  276 + -1
  277 + );
  278 + } else {
  279 + // 最后一个班次不能为末班车 中间班次不能调整,就调整后一个的班次
  280 + if (!bcFun.lpBcIsHaveFirst(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  281 + bcList,
  282 + dirBcOfGroup[2],
  283 + dataMap,
  284 + 1
  285 + )) {
  286 + _modifyFcsj(
  287 + bcList,
  288 + dirBcOfGroup[2],
  289 + dataMap,
  290 + 1
  291 + );
  292 + }
  293 + }
  294 + } else if (dirBcIntervalOfGroup[0] > fcjx.max) {
  295 + // 发车间隙调整为高峰发车间隙 -时间
  296 + if (_isModifyBcFcsj(
  297 + bcList,
  298 + dirBcOfGroup[1],
  299 + dataMap,
  300 + 1
  301 + // fcjx.max - dirBcIntervalOfGroup[0]
  302 + )) {
  303 + _modifyFcsj(
  304 + bcList,
  305 + dirBcOfGroup[1],
  306 + dataMap,
  307 + 1
  308 + // fcjx.max - dirBcIntervalOfGroup[0]
  309 + );
  310 + } else {
  311 + // 最后一个班次不能为首班车 中间班次不能调整,就调整后一个的班次
  312 + if (!bcFun.lpBcIsHaveFirst(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  313 + bcList,
  314 + dirBcOfGroup[2],
  315 + dataMap,
  316 + dirBcIntervalOfGroup[0] - fcjx.max
  317 + )) {
  318 + _modifyFcsj(
  319 + bcList,
  320 + dirBcOfGroup[2],
  321 + dataMap,
  322 + dirBcIntervalOfGroup[0] - fcjx.max
  323 + );
  324 + } else {
  325 + // 前一个班次不能为首班车 中间班次不能调整,就调整前一个的班次
  326 + if (!bcFun.lpBcIsHaveLast(dirBcOfGroup[0]) && _isModifyBcFcsj(
  327 + bcList,
  328 + dirBcOfGroup[0],
  329 + dataMap,
  330 + -1
  331 + )) {
  332 + _modifyFcsj(
  333 + bcList,
  334 + dirBcOfGroup[0],
  335 + dataMap,
  336 + -1
  337 + );
  338 + }
  339 + }
  340 + }
  341 + } else {
  342 + // -1或+1分钟
  343 + if (Math.abs(dirBcIntervalOfGroup[0] - dirBcIntervalOfGroup[1]) <= 1) {
  344 + continue;
  345 + // 两个间隔相差1分钟,不处理
  346 + } else if (dirBcIntervalOfGroup[0] > dirBcIntervalOfGroup[1]) {
  347 + if (_isModifyBcFcsj(
  348 + bcList,
  349 + dirBcOfGroup[1],
  350 + dataMap,
  351 + 1
  352 + )) {
  353 + _modifyFcsj(
  354 + bcList,
  355 + dirBcOfGroup[1],
  356 + dataMap,
  357 + 1
  358 + );
  359 + } else {
  360 + // 前一个班次不能为首班车 中间班次不能调整,就调整前一个的班次
  361 + if (!bcFun.lpBcIsHaveLast(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  362 + bcList,
  363 + dirBcOfGroup[0],
  364 + dataMap,
  365 + -1
  366 + )) {
  367 + _modifyFcsj(
  368 + bcList,
  369 + dirBcOfGroup[0],
  370 + dataMap,
  371 + -1
  372 + );
  373 + }
  374 + }
  375 + } else {
  376 + if (_isModifyBcFcsj(
  377 + bcList,
  378 + dirBcOfGroup[1],
  379 + dataMap,
  380 + -1
  381 + )) {
  382 + _modifyFcsj(
  383 + bcList,
  384 + dirBcOfGroup[1],
  385 + dataMap,
  386 + -1
  387 + );
  388 + } else {
  389 + // 最后一个班次不能为末班车 中间班次不能调整,就调整后一个的班次
  390 + if (!bcFun.lpBcIsHaveFirst(dirBcOfGroup,dataMap.smbcsjArr) && _isModifyBcFcsj(
  391 + bcList,
  392 + dirBcOfGroup[2],
  393 + dataMap,
  394 + 1
  395 + )) {
  396 + _modifyFcsj(
  397 + bcList,
  398 + dirBcOfGroup[2],
  399 + dataMap,
  400 + 1
  401 + );
  402 + }
  403 + }
  404 + }
  405 + }
  406 + }
  407 + }
  408 + // bcFun.deleteNotInRangeBc(dirBc, dataMap.smbcsjArr[].kssj, dataMap.smbcsjArr[].jssj);
  409 + // 递归迭代
  410 + calculateReverse(dirBc, bcList, dataMap, iFre - 1);
  411 + }
  412 + };
  413 + /**
  414 + * 按照规则计算班次列表()。
  415 + * @param iStartIndex {int} 开始索引
  416 + * @param dirBc {array} 班次列表
  417 + * @private
  418 + */
  419 + var _calcuReverseBcGroup = function(iStartIndex, dirBc) {
  420 + dirBcOfGroup = [];
  421 + dirBcIntervalOfGroup = [];
  422 + for (var i = iStartIndex; i < iStartIndex + iBcCountOfGroup && iStartIndex < dirBc.length - 2; i++) {
  423 + if(dirBc[i].bcType == 'cf')
  424 + iStartIndex++;
  425 + else
  426 + dirBcOfGroup.push(dirBc[i]);
  427 + }
  428 + for (var j = 0; j < dirBcOfGroup.length - 1; j++) {
  429 + dirBcIntervalOfGroup.push((DateTimeTool.getDateTime(dirBcOfGroup[j].fcsj).getTime() - DateTimeTool.getDateTime(dirBcOfGroup[j + 1].fcsj).getTime())/60000);
  430 + // dirBcIntervalOfGroup.push(Math.round((dirBcOfGroup[j + 1].fcint - dirBcOfGroup[j].fcint)/360000));
  431 + }
  432 + };
  433 +
  434 + /**
152 * 是否可以调整班次发车时间。 435 * 是否可以调整班次发车时间。
153 * @param bcList {InternalLpObj} 所有班次对象 436 * @param bcList {InternalLpObj} 所有班次对象
154 * @param oBc {InternalBcObj} 调整班次对象 437 * @param oBc {InternalBcObj} 调整班次对象
@@ -159,19 +442,21 @@ var AdjustTrip = function () { @@ -159,19 +442,21 @@ var AdjustTrip = function () {
159 // 获取前后班次 442 // 获取前后班次
160 var bc = getLpPrevAndNextBc(bcList, oBc), 443 var bc = getLpPrevAndNextBc(bcList, oBc),
161 prevBc = bc[0], 444 prevBc = bc[0],
162 - nextBc = bc[1]; 445 + nextBc = bc[1],
  446 + cfBc = bc[2],
  447 + cfBcsj = 0;
  448 + if(cfBc != null){
  449 + cfBcsj = cfBc.bcsj;
  450 + }
163 if (prevBc != null && nextBc != null){ 451 if (prevBc != null && nextBc != null){
164 - if (prevBc.bcType == 'cf') { // 如果是吃饭班次,不能修改发车时间  
165 - return false;  
166 - }  
167 // 上一个班次的停站范围, 本班次停站范围, 上一班次停站时间, 本班次停站时间 452 // 上一个班次的停站范围, 本班次停站范围, 上一班次停站时间, 本班次停站时间
168 - var prevStopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(prevBc.xlDir)][judgmentTimeQuantum(prevBc.fcint)],  
169 - StopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(oBc.xlDir)][judgmentTimeQuantum(oBc.fcint)], 453 + var prevStopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(prevBc.xlDir)][DateTimeTool.judgmentTimeQuantum(prevBc.fcint)],
  454 + StopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(oBc.xlDir)][DateTimeTool.judgmentTimeQuantum(oBc.fcint)],
170 // prevBcStopTime = prevBc.STOPTIME + iStep, 455 // prevBcStopTime = prevBc.STOPTIME + iStep,
171 // BcStopTime = oBc.STOPTIME + iStep; 456 // BcStopTime = oBc.STOPTIME + iStep;
172 // iStep为班次往后移动的时间,调整后的时间 = 停站 - 往后移动的时间 457 // iStep为班次往后移动的时间,调整后的时间 = 停站 - 往后移动的时间
173 prevBcStopTime = (DateTimeTool.getDateTime(oBc.fcsj) - DateTimeTool.getDateTime(prevBc.ARRIVALTIME))/60000 + iStep, 458 prevBcStopTime = (DateTimeTool.getDateTime(oBc.fcsj) - DateTimeTool.getDateTime(prevBc.ARRIVALTIME))/60000 + iStep,
174 - BcStopTime = (DateTimeTool.getDateTime(nextBc.fcsj) - DateTimeTool.getDateTime(oBc.ARRIVALTIME))/60000 - iStep; 459 + BcStopTime = (DateTimeTool.getDateTime(nextBc.fcsj) - DateTimeTool.getDateTime(oBc.ARRIVALTIME))/60000 - iStep - cfBcsj; // 如果有吃饭,则多减掉一个吃饭班次的运行时间
175 // 班次移动调整发车间隔时,需要考录的移动班次的前后停站 460 // 班次移动调整发车间隔时,需要考录的移动班次的前后停站
176 if (prevBcStopTime >= 0 && BcStopTime >= 0) { 461 if (prevBcStopTime >= 0 && BcStopTime >= 0) {
177 return true; 462 return true;
@@ -179,9 +464,9 @@ var AdjustTrip = function () { @@ -179,9 +464,9 @@ var AdjustTrip = function () {
179 return false; 464 return false;
180 } 465 }
181 } else if(prevBc == null && nextBc != null) { 466 } else if(prevBc == null && nextBc != null) {
182 - var StopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(nextBc.xlDir)][judgmentTimeQuantum(nextBc.fcint)],  
183 - BcStopTime = (DateTimeTool.getDateTime(nextBc.fcsj) - DateTimeTool.getDateTime(oBc.ARRIVALTIME))/60000 - iStep;  
184 - // 班次移动调整发车间隔时,需要考录的移动班次的前后停站 TODO:没有判定调整发车时间后会不会不够 467 + var StopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(nextBc.xlDir)][DateTimeTool.judgmentTimeQuantum(nextBc.fcint)],
  468 + BcStopTime = (DateTimeTool.getDateTime(nextBc.fcsj) - DateTimeTool.getDateTime(oBc.ARRIVALTIME))/60000 - iStep - cfBcsj; // 如果有吃饭,则多减掉一个吃饭班次的运行时间
  469 + // 班次移动调整发车间隔时,需要考录的移动班次的前后停站
185 if (BcStopTime >= 0) { 470 if (BcStopTime >= 0) {
186 return true; 471 return true;
187 } else { 472 } else {
@@ -189,10 +474,7 @@ var AdjustTrip = function () { @@ -189,10 +474,7 @@ var AdjustTrip = function () {
189 } 474 }
190 // 如果是第一个班次为空 475 // 如果是第一个班次为空
191 } else if(prevBc != null && nextBc == null) { 476 } else if(prevBc != null && nextBc == null) {
192 - if (prevBc.bcType == 'cf') { // 如果是吃饭班次,不能修改发车时间  
193 - return false;  
194 - }  
195 - var prevStopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(prevBc.xlDir)][judgmentTimeQuantum(prevBc.fcint)], 477 + var prevStopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(prevBc.xlDir)][DateTimeTool.judgmentTimeQuantum(prevBc.fcint)],
196 prevBcStopTime = (DateTimeTool.getDateTime(oBc.fcsj) - DateTimeTool.getDateTime(prevBc.ARRIVALTIME))/60000 + iStep; 478 prevBcStopTime = (DateTimeTool.getDateTime(oBc.fcsj) - DateTimeTool.getDateTime(prevBc.ARRIVALTIME))/60000 + iStep;
197 // 班次移动调整发车间隔时,需要考录的移动班次的前后停站 479 // 班次移动调整发车间隔时,需要考录的移动班次的前后停站
198 if (prevBcStopTime >= 0) { 480 if (prevBcStopTime >= 0) {
@@ -202,53 +484,6 @@ var AdjustTrip = function () { @@ -202,53 +484,6 @@ var AdjustTrip = function () {
202 } 484 }
203 } 485 }
204 } 486 }
205 - /*function _isModifyBcFcsj(bcList, oBc, dataMap, iStep) {  
206 - // 获取前后班次  
207 - var bc = getLpPrevAndNextBc(bcList, oBc),  
208 - prevBc = bc[0],  
209 - nextBc = bc[1];  
210 - if (prevBc != null && nextBc != null){  
211 - if (prevBc.bcType == 'cf') { // 如果是吃饭班次,不能修改发车时间  
212 - return false;  
213 - }  
214 - // 上一个班次的停站范围, 本班次停站范围, 上一班次停站时间, 本班次停站时间  
215 - var prevStopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(prevBc.xlDir)][judgmentTimeQuantum(prevBc.fcint)],  
216 - StopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(oBc.xlDir)][judgmentTimeQuantum(oBc.fcint)],  
217 - // prevBcStopTime = prevBc.STOPTIME + iStep,  
218 - // BcStopTime = oBc.STOPTIME + iStep;  
219 - // iStep为班次往后移动的时间,调整后的时间 = 停站 - 往后移动的时间  
220 - prevBcStopTime = (DateTimeTool.getDateTime(oBc.fcsj) - DateTimeTool.getDateTime(prevBc.ARRIVALTIME))/60000 + iStep,  
221 - BcStopTime = (DateTimeTool.getDateTime(nextBc.fcsj) - DateTimeTool.getDateTime(oBc.ARRIVALTIME))/60000 - iStep;  
222 - // 班次移动调整发车间隔时,需要考录的移动班次的前后停站  
223 - if (prevBcStopTime >= prevStopTimeScope.min && BcStopTime >= StopTimeScope.min) {  
224 - return true;  
225 - } else {  
226 - return false;  
227 - }  
228 - } else if(prevBc == null && nextBc != null) {  
229 - var StopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(nextBc.xlDir)][judgmentTimeQuantum(nextBc.fcint)],  
230 - BcStopTime = (DateTimeTool.getDateTime(nextBc.fcsj) - DateTimeTool.getDateTime(oBc.ARRIVALTIME))/60000 - iStep;  
231 - // 班次移动调整发车间隔时,需要考录的移动班次的前后停站 TODO:没有判定调整发车时间后会不会不够  
232 - if (BcStopTime >= StopTimeScope.min) {  
233 - return true;  
234 - } else {  
235 - return false;  
236 - }  
237 - // 如果是第一个班次为空  
238 - } else if(prevBc != null && nextBc == null) {  
239 - if (prevBc.bcType == 'cf') { // 如果是吃饭班次,不能修改发车时间  
240 - return false;  
241 - }  
242 - var prevStopTimeScope = dataMap.tzsj[bcFun.upDownStrConvertNum(prevBc.xlDir)][judgmentTimeQuantum(prevBc.fcint)],  
243 - prevBcStopTime = (DateTimeTool.getDateTime(oBc.fcsj) - DateTimeTool.getDateTime(prevBc.ARRIVALTIME))/60000 + iStep;  
244 - // 班次移动调整发车间隔时,需要考录的移动班次的前后停站  
245 - if (prevBcStopTime >= prevStopTimeScope.min) {  
246 - return true;  
247 - } else {  
248 - return false;  
249 - }  
250 - }  
251 - }*/  
252 487
253 /** 488 /**
254 * 调整发车时间(调整当前班次后,需要处理后续路牌的所有班次)。 489 * 调整发车时间(调整当前班次后,需要处理后续路牌的所有班次)。
@@ -261,19 +496,26 @@ var AdjustTrip = function () { @@ -261,19 +496,26 @@ var AdjustTrip = function () {
261 function _modifyFcsj(bcList, oBc, dataMap, iMin) { 496 function _modifyFcsj(bcList, oBc, dataMap, iMin) {
262 var bc = getLpPrevAndNextBc(bcList, oBc), 497 var bc = getLpPrevAndNextBc(bcList, oBc),
263 prevBc = bc[0], 498 prevBc = bc[0],
264 - nextBc = bc[1]; 499 + nextBc = bc[1],
  500 + cfBc = bc[2];
265 var fcsj = DateTimeTool.getDateTime(oBc.fcsj); 501 var fcsj = DateTimeTool.getDateTime(oBc.fcsj);
266 fcsj.setMinutes(fcsj.getMinutes() + iMin); 502 fcsj.setMinutes(fcsj.getMinutes() + iMin);
267 $.each(bcList, function () { 503 $.each(bcList, function () {
268 - if(this.lpNo == oBc.lpNo && this.fcno == oBc.fcno){ 504 + if(this.lpNo == oBc.lpNo && this.fcno == oBc.fcno && this.bcType != 'cf'){
269 var time = new Date(fcsj); 505 var time = new Date(fcsj);
270 - this.ARRIVALTIME = DateTimeTool.getHHmmStr(time.setMinutes(time.getMinutes() + this.bcsj)); 506 + time.setMinutes(time.getMinutes() + this.bcsj);
  507 + this.ARRIVALTIME = DateTimeTool.getHHmmStr(time);
271 this.fcsj = DateTimeTool.getHHmmStr(fcsj); 508 this.fcsj = DateTimeTool.getHHmmStr(fcsj);
272 this.fcint = fcsj.getTime(); 509 this.fcint = fcsj.getTime();
273 - // 前一个班次停站时间 = 原停站时间 - 中间班次移动时间  
274 - this.STOPTIME -= iMin; 510 + // 不是分班班次这调整停站 前一个班次停站时间 = 原停站时间 - 中间班次移动时间
  511 + if(this.isfb == 0)
  512 + this.STOPTIME -= iMin;
  513 + if(cfBc != null) {
  514 + cfBc.fcsj = this.ARRIVALTIME;
  515 + cfBc.ARRIVALTIME = DateTimeTool.getHHmmStr(time.setMinutes(time.getMinutes() + cfBc.bcsj));
  516 + }
275 } 517 }
276 - if(prevBc != undefined && prevBc != null && this.lpNo == oBc.lpNo && this.fcno == prevBc.fcno){ 518 + if(prevBc != undefined && prevBc != null && this.lpNo == oBc.lpNo && this.fcno == prevBc.fcno && this.isfb == 0){
277 // 前一个班次停站时间 = 原停站时间 + 中间班次移动时间 519 // 前一个班次停站时间 = 原停站时间 + 中间班次移动时间
278 this.STOPTIME += iMin; 520 this.STOPTIME += iMin;
279 } 521 }
@@ -283,37 +525,25 @@ var AdjustTrip = function () { @@ -283,37 +525,25 @@ var AdjustTrip = function () {
283 var getLpPrevAndNextBc = function (bcList, oBc) { 525 var getLpPrevAndNextBc = function (bcList, oBc) {
284 var lpBc = new Array(), 526 var lpBc = new Array(),
285 // 前一个班次 527 // 前一个班次
286 - prevBc = null, nextBc = null; 528 + prevBc = null, nextBc = null, cfBc = null;
287 $.each(bcList, function () { 529 $.each(bcList, function () {
288 if(this.lpNo == oBc.lpNo) 530 if(this.lpNo == oBc.lpNo)
289 lpBc.push(this); 531 lpBc.push(this);
290 }); 532 });
291 - lpBc.sort(function (a,b) {return a.fcint - b.fcint;}); 533 + lpBc.sort(function (a,b) {return DateTimeTool.getDateTime(a.fcsj)-DateTimeTool.getDateTime(b.fcsj);});
292 for(var n = 0; n < lpBc.length; n++) { 534 for(var n = 0; n < lpBc.length; n++) {
293 if(lpBc[n].fcno == oBc.fcno && n > 0) 535 if(lpBc[n].fcno == oBc.fcno && n > 0)
294 prevBc = lpBc[n-1]; 536 prevBc = lpBc[n-1];
295 - if(lpBc[n].fcno == oBc.fcno && n < lpBc.length-1)  
296 - nextBc = lpBc[n+1]; 537 + if(lpBc[n].fcno == oBc.fcno && n < lpBc.length-1){
  538 + if(lpBc[n+1].bcType == 'cf'){
  539 + nextBc = lpBc[n+2];
  540 + cfBc = lpBc[n+1];
  541 + } else {
  542 + nextBc = lpBc[n+1];
  543 + }
  544 + }
297 } 545 }
298 - return [prevBc, nextBc];  
299 - };  
300 - // 判断时间在什么时间段段内  
301 - /**  
302 - * 判断时间在什么时间段段内  
303 - * @param t 时间  
304 - * @private  
305 - */  
306 - var judgmentTimeQuantum = function (t) {  
307 - if(t <= DateTimeTool.getDateTime('6:30'))  
308 - return 0;  
309 - else if(t > DateTimeTool.getDateTime('6:30') && t <= DateTimeTool.getDateTime('8:30'))  
310 - return 1;  
311 - else if(t > DateTimeTool.getDateTime('8:30') && t <= DateTimeTool.getDateTime('16:00'))  
312 - return 2;  
313 - else if(t > DateTimeTool.getDateTime('16:00') && t <= DateTimeTool.getDateTime('18:00'))  
314 - return 3;  
315 - else if(t > DateTimeTool.getDateTime('18:00'))  
316 - return 4; 546 + return [prevBc, nextBc, cfBc];
317 }; 547 };
318 return { 548 return {
319 departureClearanceAdjust : departureClearanceAdjust 549 departureClearanceAdjust : departureClearanceAdjust
src/main/resources/static/pages/base/timesmodel/js/v1/bcFun.js
@@ -30,6 +30,7 @@ var bcFun = function() { @@ -30,6 +30,7 @@ var bcFun = function() {
30 obj.bcType = type; 30 obj.bcType = type;
31 obj.xlDir = dir; 31 obj.xlDir = dir;
32 obj.fcno = xh; 32 obj.fcno = xh;
  33 + obj.qs = xh;
33 obj.jhlc = jhlc;// 计划里程 34 obj.jhlc = jhlc;// 计划里程
34 obj.tcc = gatps.tcc_id;// 停车场id 35 obj.tcc = gatps.tcc_id;// 停车场id
35 obj.ttinfo = gatps.skbName;// 时刻表id 36 obj.ttinfo = gatps.skbName;// 时刻表id
@@ -125,6 +126,7 @@ var bcFun = function() { @@ -125,6 +126,7 @@ var bcFun = function() {
125 } 126 }
126 } 127 }
127 }; 128 };
  129 +
128 /** 130 /**
129 * @description (TODO) 获取 上、下行的正常、区间、空放、直放班次. 131 * @description (TODO) 获取 上、下行的正常、区间、空放、直放班次.
130 * @param 需要分割的班次数据集合. 132 * @param 需要分割的班次数据集合.
@@ -135,7 +137,7 @@ var bcFun = function() { @@ -135,7 +137,7 @@ var bcFun = function() {
135 var upArray = new Array(),downArray = new Array(),rs = new Array(); 137 var upArray = new Array(),downArray = new Array(),rs = new Array();
136 for(var j = 0 ; j< json.length ; j++) { 138 for(var j = 0 ; j< json.length ; j++) {
137 // 判断是否为正常、区间、空放、直放班次 139 // 判断是否为正常、区间、空放、直放班次
138 - if(json[j].bcType== dataMap.bcTypeArr.normal || 140 + /*if(json[j].bcType== dataMap.bcTypeArr.normal ||
139 json[j].bcType== dataMap.bcTypeArr.region || 141 json[j].bcType== dataMap.bcTypeArr.region ||
140 json[j].bcType== dataMap.bcTypeArr.major || 142 json[j].bcType== dataMap.bcTypeArr.major ||
141 json[j].bcType== dataMap.bcTypeArr.venting) { 143 json[j].bcType== dataMap.bcTypeArr.venting) {
@@ -143,9 +145,13 @@ var bcFun = function() { @@ -143,9 +145,13 @@ var bcFun = function() {
143 upArray.push(json[j]); 145 upArray.push(json[j]);
144 else if(json[j].xlDir == dataMap.dira[1]) 146 else if(json[j].xlDir == dataMap.dira[1])
145 downArray.push(json[j]); 147 downArray.push(json[j]);
146 - } 148 + }*/
  149 + if(json[j].xlDir == dataMap.dira[0])
  150 + upArray.push(json[j]);
  151 + else if(json[j].xlDir == dataMap.dira[1])
  152 + downArray.push(json[j]);
147 } 153 }
148 - rs.push(upArray,downArray); 154 + rs.push(upArray, downArray);
149 // 返回数据. 155 // 返回数据.
150 return rs; 156 return rs;
151 }; 157 };
@@ -180,9 +186,9 @@ var bcFun = function() { @@ -180,9 +186,9 @@ var bcFun = function() {
180 } 186 }
181 // 按照发车序号顺序排序. 187 // 按照发车序号顺序排序.
182 lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 188 lpbc_.sort(function(a,b){return a.fcno-b.fcno});
183 - addcfbc01(lpbc_,dataMap,map);  
184 - // 按照发车序号顺序排序.  
185 - lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 189 + // addcfbc01(lpbc_,dataMap,map);
  190 + // // 按照发车序号顺序排序.
  191 + // lpbc_.sort(function(a,b){return a.fcno-b.fcno});
186 var tt = addjclbbc01(lpbc_,dataMap,dataMap.lbsj,map); 192 var tt = addjclbbc01(lpbc_,dataMap,dataMap.lbsj,map);
187 bcs = updfcno(tt,bcs); 193 bcs = updfcno(tt,bcs);
188 resultJA = resultJA.concat(tt); 194 resultJA = resultJA.concat(tt);
@@ -227,24 +233,39 @@ var bcFun = function() { @@ -227,24 +233,39 @@ var bcFun = function() {
227 result.push(getbcObj( 233 result.push(getbcObj(
228 dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out, 234 dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out,
229 dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次 235 dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次
230 - fcno ++; 236 + fcno = 3;
231 }else if(b==bc.length-1){ 237 }else if(b==bc.length-1){
232 - var fcno_ = dxfno + 2; 238 + fxdm = fxdm == 0 ? 1:0;
  239 + // var fcno_ = dxfno + 2;
233 var qdbcddsj = DateTimeTool.getDateTime(bc[b].ARRIVALTIME); 240 var qdbcddsj = DateTimeTool.getDateTime(bc[b].ARRIVALTIME);
234 - result.push(getbcObj(  
235 - qdbcddsj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,  
236 - dataMap.dira[fxdm],fcno_++,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次 241 + if(dataMap.jcsjArr[fxdm] > 0){
  242 + result.push(getbcObj(
  243 + qdbcddsj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,
  244 + dataMap.dira[fxdm],++fcno,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次
  245 + }
237 result.push(getbcObj( 246 result.push(getbcObj(
238 qdbcddsj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.lc, 247 qdbcddsj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.lc,
239 - dataMap.dira[fxdm],fcno_++,0,gatps,0,null,null,null,0,lbsj));// 晚班例保班次 248 + dataMap.dira[fxdm],++fcno,0,gatps,0,null,null,null,0,lbsj));// 晚班例保班次
  249 + } else if(bc[b].isfb && b!=bc.length-1){
  250 + fxdm = fxdm == 0 ? 1:0;
  251 + var qdbcddsj = DateTimeTool.getDateTime(bc[b].ARRIVALTIME);
  252 + if(dataMap.jcsjArr[fxdm] > 0){
  253 + result.push(getbcObj(
  254 + qdbcddsj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,
  255 + dataMap.dira[fxdm],++fcno,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次
  256 + }
240 } 257 }
241 - dxfno = bc[b].fcno + fcno;  
242 - bc[b].fcno = dxfno;  
243 - if(stas) { 258 + // dxfno = bc[b].fcno + fcno;
  259 + // bc[b].fcno = dxfno;
  260 +
  261 + bc[b].fcno = fcno;
  262 + result.push(bc[b]);
  263 + fcno++;
  264 +
  265 + /*if(stas) {
244 fcno ++; 266 fcno ++;
245 stas = false; 267 stas = false;
246 - }  
247 - result.push(bc[b]); 268 + }*/
248 } 269 }
249 return result; 270 return result;
250 }; 271 };
@@ -254,7 +275,7 @@ var bcFun = function() { @@ -254,7 +275,7 @@ var bcFun = function() {
254 for(var g = 0 ; g <lpbcar.length-1;g++ ) { 275 for(var g = 0 ; g <lpbcar.length-1;g++ ) {
255 if( parseInt((DateTimeTool.getDateTime(lpbcar[g+1].fcsj) - DateTimeTool.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 180 276 if( parseInt((DateTimeTool.getDateTime(lpbcar[g+1].fcsj) - DateTimeTool.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 180
256 && lpbcar[g].STOPTIME==0 && lpbcar[g].bcType =='normal' ) { 277 && lpbcar[g].STOPTIME==0 && lpbcar[g].bcType =='normal' ) {
257 - lpbcar[g].isfb = 1; 278 + lpbcar[g].isfb = true;
258 } 279 }
259 } 280 }
260 }; 281 };
@@ -265,6 +286,222 @@ var bcFun = function() { @@ -265,6 +286,222 @@ var bcFun = function() {
265 return 1; 286 return 1;
266 }; 287 };
267 288
  289 + /**
  290 + * @description (TODO) 横向调整 调整停站时间.
  291 + * @param cara 路牌数组.
  292 + * @param tempa 所有的班次数组集合.
  293 + * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].
  294 + *
  295 + * ******************************** 思路 *************************************************
  296 + * 第一步 等到每个路牌下的班次数组集合.
  297 + *
  298 + * 第二步 顺序排序每个路牌下的班次数组集合.
  299 + *
  300 + * 第三步 从第二个班次开始,用第二个班次的发车时间 - 上一个班次的到达时间 得到 上一个班次的停站时间.
  301 + *
  302 + * 第四步 修改上一个班次的停站时间.
  303 + *
  304 + * 修改停站时间规则:以行驶时间的10%-15% 为标准。
  305 + * 如果超出该范围。则以录入参数低谷最大停站间隙为准。
  306 + * 停站时间最大不能超过该停站时间。
  307 + * 高峰附近的班次的停站时间在离高峰最近一个班次的停站时间浮动范围【1-2】分钟。
  308 + *
  309 + * ****************************************************************************************
  310 + */
  311 + var resizeByPitStopTime = function(cara,tempa,dataMap) {
  312 + var cLen = cara.length,tLen = tempa.length;
  313 + if(cLen<= 0 || tLen<=0 || dataMap==null)
  314 + return;
  315 + // 定义低谷最大停站时间、行业标准最小、最大停站时间(行驶时间的10%~15%).
  316 + var dgmaxtzsj = dataMap.dgmaxtzsj,normmintzsj, normmaxtzsj;
  317 + for(var t = 0 ; t < cLen ; t++) {
  318 + // 定义当前路牌班次数组集合.
  319 + var sslpbcA = new Array();
  320 + for(var j =0 ; j < tLen ; j++) {
  321 + // 判断当期遍历的班次是否属于当前的路牌.如果是则添加到当前的路牌班次数组集合.
  322 + if(tempa[j].lpNo == cara[t].lpNo) {
  323 + tempa[j].fcint = DateTimeTool.getDateTime(tempa[j].fcsj).getTime();
  324 + sslpbcA.push(tempa[j]);
  325 + }
  326 + }
  327 + if(sslpbcA.length > 0) {
  328 + // 按发车时间顺序排序.
  329 + sslpbcA.sort(function(a,b){return a.fcint-b.fcint});
  330 + // 按照规则修改停站时间.
  331 + for(var r = 0 ; r < sslpbcA.length-1 ; r++) {
  332 + if(sslpbcA[r].isfb)
  333 + continue;
  334 + // test
  335 + //if(sslpbcA[r].bcType == 'cf') {
  336 + // alert('cf' + sslpbcA[r-1].fcsj);
  337 + //}
  338 + // 定义上一个班次的发车时间、当前班次的到达时间、发车时间.
  339 + var sgbcfcsj = DateTimeTool.getDateTime(sslpbcA[r+1].fcsj),
  340 + dqbcddsj = DateTimeTool.getDateTime(sslpbcA[r].ARRIVALTIME),
  341 + dqbcfcsj = DateTimeTool.getDateTime(sslpbcA[r].fcsj);
  342 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  343 + var cctag = dirDmToIndex(sslpbcA[r].xlDir); // dataMap.smbcsjArr
  344 + // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.)
  345 + var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000);
  346 + // 定义是否高峰
  347 + var tt_flag = scheduleInitialize.isPeakTimeScope(dqbcfcsj , dataMap);
  348 + // 获取行驶时间.
  349 + var xxsj = scheduleInitialize.judgeXSSJ(cctag, dqbcfcsj, dataMap);
  350 + var time = dataMap.tzsj[cctag][DateTimeTool.judgmentTimeQuantum(xxsj)];
  351 +
  352 + normmintzsj = time.min;
  353 + normmaxtzsj = time.max;
  354 + var flag = false;
  355 +
  356 + // 如果小于零
  357 + if(dxmin < 0 && sslpbcA[r].isfb ==0) {
  358 + // 根据不同时段的停站时间.重新赋值停站时间.
  359 + if(sslpbcA[r].bcType=='normal' && sslpbcA[r+1].bcType =='normal')
  360 + //dxmin = tt_flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  361 + dxmin = 1;
  362 + else
  363 + dxmin = 0;
  364 + flag = true;
  365 + }else if(dxmin==0){
  366 + if (sslpbcA[r].bcType == 'cf') { // 如果是吃饭班次,停站为0
  367 + dxmin = 0;
  368 + } else {
  369 + // 这里区分,如果下一个班次是吃饭班次,停站为0
  370 + if (sslpbcA[r + 1].bcType=='cf') {
  371 + dxmin = 0;
  372 + } else { // 否则使用最小停站时间
  373 + dxmin = normmintzsj;
  374 + }
  375 + }
  376 +
  377 + flag = true;
  378 + }else {
  379 + // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
  380 + if(dxmin >= dgmaxtzsj && dxmin < 180 && sslpbcA[r].isfb==false) {
  381 + dxmin = dgmaxtzsj;
  382 + flag = true;
  383 + // 如果大于零 并且 小于等于行业标准的最小停站时间
  384 + }else if(dxmin > 0 && dxmin <= normmintzsj ) {
  385 + // dxmin = dxmin;
  386 + flag = true;
  387 + // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
  388 + }else if(dxmin > normmintzsj && dxmin <= normmaxtzsj ) {
  389 + // dxmin = dxmin;
  390 + flag = true;
  391 + // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
  392 + }else if(dxmin > normmaxtzsj && dxmin < dgmaxtzsj ) {
  393 + // dxmin = dxmin;
  394 + flag = true;
  395 + }else if (dxmin >= 180){
  396 + dxmin = 0;
  397 + }
  398 + }
  399 + if(flag) {
  400 + if(!isDirSmbc(dirDmToIndex(sslpbcA[r+1].xlDir) , sslpbcA[r+1].fcsj , dataMap)) {
  401 + // 修改当前班次的停站时间.
  402 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  403 + // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.
  404 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);
  405 + // 修改下一个班次的发车时间.
  406 + sslpbcA[r+1].fcsj = DateTimeTool.getHHmmStr(dqbcddsj);
  407 + // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.
  408 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);
  409 + // 修改下一个班次的到达时间.
  410 + sslpbcA[r+1].ARRIVALTIME = DateTimeTool.getHHmmStr(dqbcddsj);
  411 + }else {
  412 + if(r>0) {
  413 + // 修改当前班次的停站时间.
  414 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  415 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].STOPTIME);
  416 + sslpbcA[r].ARRIVALTIME = DateTimeTool.getHHmmStr(sgbcfcsj);
  417 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].bcsj);
  418 + sslpbcA[r].fcsj = DateTimeTool.getHHmmStr(sgbcfcsj);
  419 + sslpbcA[r-1].STOPTIME = parseInt( ( sgbcfcsj - DateTimeTool.getDateTime(sslpbcA[r-1].ARRIVALTIME))/60000);
  420 + }
  421 + }
  422 + }
  423 + }
  424 + }
  425 + }
  426 + };
  427 +
  428 + var isDirSmbc = function(dirDm , fcsj , dataMap) {
  429 + var falg = false;
  430 + if(fcsj == dataMap.smbcsjArr[dirDm].kssj || fcsj == dataMap.smbcsjArr[dirDm].jssj)
  431 + falg = true;
  432 + return falg;
  433 + };
  434 +
  435 +
  436 +
  437 + /**
  438 + * @description (TODO) 标记上、下行首末班车.
  439 + * @param jsonArray 初始化路牌下的所有班次并且已经均匀发车间隙的数组集合.
  440 + * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].
  441 + */
  442 + var markLastBus = function(jsonArray , dataMap) {
  443 + // 定义上、下行的正常、区间、空放、直放班次、返回数组集合.
  444 + var listMap = getUpAndDownBc( jsonArray , dataMap) , resultArray = new Array();
  445 + for(var i = 0 ; i < listMap.length ; i++) {
  446 + if(listMap[i].length > 0){
  447 + // 把班次顺序排序.
  448 + listMap[i].sort(function(a,b){return a.fcint-b.fcint});
  449 + // 确定首末班车时间.
  450 + markFirstAndLastBusAlso(listMap[i] , dataMap , i);
  451 + }
  452 + resultArray = resultArray.concat(listMap[i]);
  453 + }
  454 + return resultArray;
  455 + };
  456 +
  457 + /**
  458 + * @description (TODO) 确定某方向下的末班车.
  459 + * @param dirArray 某方向下的数组集合.
  460 + * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].
  461 + * @param dir 方向.
  462 + */
  463 + var markFirstAndLastBusAlso = function(dirArray , dataMap , dir) {
  464 + if(dirArray.length>=2) {
  465 + // 定义最后一个班次.
  466 + var dirLastBc = dirArray[dirArray.length-1];
  467 + // 确认末班车时间
  468 + if(dirLastBc.fcsj != dataMap.smbcsjArr[dir].jssj) {
  469 + // 修改最后一个班次的发车时间.
  470 + dirLastBc.fcsj = dataMap.smbcsjArr[dir].jssj;
  471 + // 定义到达时间.
  472 + var ddsj_ = DateTimeTool.getDateTime(dirLastBc.fcsj);
  473 + ddsj_.setMinutes(ddsj_.getMinutes() + dataMap.xssj[dir][4]);
  474 + // 修改最后一个班次的到达时间.
  475 + dirLastBc.ARRIVALTIME = DateTimeTool.getHHmmStr(ddsj_);
  476 + dirLastBc.bcsj = dataMap.xssj[dir][4];
  477 + }
  478 + }
  479 + };
  480 +
  481 + /**
  482 + * @description (TODO) 判断某路牌下是否存在末班车时间班次.
  483 + * @param arr 某路牌下的班次.
  484 + * @param smbcsjArr 首末班车时间点数组集合.
  485 + */
  486 + var lpBcIsHaveLast = function(arr , smbcsjArr) {
  487 + for(var a = 0 ; a < arr.length ; a++) {
  488 + for(var s = 0 ; s < smbcsjArr.length ; s++) {
  489 + if(arr[a].fcsj == smbcsjArr[s].jssj && dirDmToIndex(arr[a].xlDir) == s)
  490 + return true;
  491 + }
  492 + }
  493 + return false;
  494 + };
  495 + var lpBcIsHaveFirst = function(arr , smbcsjArr) {
  496 + for(var a = 0 ; a < arr.length ; a++) {
  497 + for(var s = 0 ; s < smbcsjArr.length ; s++) {
  498 + if(arr[a].fcsj == smbcsjArr[s].kssj && dirDmToIndex(arr[a].xlDir) == s)
  499 + return true;
  500 + }
  501 + }
  502 + return false;
  503 + };
  504 +
268 return{ 505 return{
269 getbcObj : getbcObj, //封装班次属性值 506 getbcObj : getbcObj, //封装班次属性值
270 upDownStrConvertNum : upDownStrConvertNum, 507 upDownStrConvertNum : upDownStrConvertNum,
@@ -272,6 +509,11 @@ var bcFun = function() { @@ -272,6 +509,11 @@ var bcFun = function() {
272 markFirstAndLastBusAlsoDietNotInRangeBc : markFirstAndLastBusAlsoDietNotInRangeBc, 509 markFirstAndLastBusAlsoDietNotInRangeBc : markFirstAndLastBusAlsoDietNotInRangeBc,
273 getUpAndDownBc : getUpAndDownBc, 510 getUpAndDownBc : getUpAndDownBc,
274 addInOutFieldBc : addInOutFieldBc, //添加进出场班次 511 addInOutFieldBc : addInOutFieldBc, //添加进出场班次
275 - updfcno : updfcno 512 + updfcno : updfcno,
  513 + resizeByPitStopTime : resizeByPitStopTime,
  514 + markLastBus : markLastBus, //标记上、下行末班车
  515 + lpBcIsHaveLast : lpBcIsHaveLast, // 判断路牌班次是否有末班车
  516 + lpBcIsHaveFirst : lpBcIsHaveFirst, // 判断路牌班次是否有首班车
  517 + dirDmToIndex : dirDmToIndex // 字符串转换为方向
276 } 518 }
277 }(); 519 }();
src/main/resources/static/pages/base/timesmodel/js/v1/lpFun.js
@@ -64,49 +64,6 @@ var lpFun = function () { @@ -64,49 +64,6 @@ var lpFun = function () {
64 // 返回数据. 64 // 返回数据.
65 return list.sort(function(a,b){return b.hoursV-a.hoursV}); 65 return list.sort(function(a,b){return b.hoursV-a.hoursV});
66 }; 66 };
67 - /**  
68 - * @description (TODO) 把班型人次合理的分配到不同的路牌上.  
69 - * @param list 班型人次数组集合.  
70 - * @param clzs 路牌数组.  
71 - * @return 返回一个把路牌合理的分配到班型人次下组成的数据集合.  
72 - * */  
73 - var bxAlloTotLp = function(arr,clzs){  
74 - var cLen = clzs.length;  
75 - var type = getMode(arr);  
76 - var i=0;  
77 - while(clzs.length > i){  
78 - for(var j=0; j<type.length; j++) {  
79 - if(arr[type[j]].len-- > 0) {  
80 - arr[type[j]].bx.sslp.push(clzs[i]);  
81 - i++  
82 - }  
83 - }  
84 - }  
85 - };  
86 - var getMode = function(arr){  
87 - var mode = [], bxRcList = arr;  
88 - var count = bxRcList[0].lps;  
89 - for(var i=1; i<bxRcList.length; i++) {  
90 - if(bxRcList[i].lps < count)  
91 - count = bxRcList[i].lps;  
92 - }  
93 - for(var i=0; i<bxRcList.length; i++) {  
94 - bxRcList[i] = {'bx':bxRcList[i],'len':bxRcList[i].lps, 'ratio':Math.round(bxRcList[i].lps/count)}  
95 - }  
96 - for(var i=0; i<bxRcList.length; i++) {  
97 - for(var j=0; j<bxRcList[i].ratio; j++) {  
98 - mode.push(i);  
99 - }  
100 - }  
101 - // for(var m=0; m<mode.length-2; m++) {  
102 - // if(mode[m] == mode[m+1]) {  
103 - // var a = mode[m+1];  
104 - // mode[m+1] = mode[m+2];  
105 - // mode[m+2] = a;  
106 - // }  
107 - // }  
108 - return mode;  
109 - };  
110 // 路牌整理 67 // 路牌整理
111 var lpNeaten = function (bxRcList, carList, dataMap) { 68 var lpNeaten = function (bxRcList, carList, dataMap) {
112 var carListH = new Array(); 69 var carListH = new Array();
@@ -132,11 +89,12 @@ var lpFun = function () { @@ -132,11 +89,12 @@ var lpFun = function () {
132 // carListH:带工时和圈数的车辆list,carListCache:缓存为分班车辆 89 // carListH:带工时和圈数的车辆list,carListCache:缓存为分班车辆
133 var carListH = [],carListCache = []; 90 var carListH = [],carListCache = [];
134 91
135 - // 最分班路牌 = 总路牌 - (低谷周转/低谷最大发车间隔)向上取整 92 + // 最分班路牌 = 总路牌 - (低谷周转/低谷最大发车间隔)向上取整
136 var fblps = carList.length - Math.ceil((dataMap.zzsj[2]) / map.dgmaxfcjx); 93 var fblps = carList.length - Math.ceil((dataMap.zzsj[2]) / map.dgmaxfcjx);
137 // 取出有工时的路牌 94 // 取出有工时的路牌
138 for (var i = 0; i < bxRcList.length; i++) { 95 for (var i = 0; i < bxRcList.length; i++) {
139 var sslp = bxRcList[i].bx.sslp, bx = bxRcList[i].bx; 96 var sslp = bxRcList[i].bx.sslp, bx = bxRcList[i].bx;
  97 + // 路牌能有多少圈
140 var count = Math.round(bx.hoursV / (dataMap.zzsj[1]/60));// 早高峰周转:dataMap.zzsj[1] 98 var count = Math.round(bx.hoursV / (dataMap.zzsj[1]/60));// 早高峰周转:dataMap.zzsj[1]
141 if(bx.type == '五工二休') { 99 if(bx.type == '五工二休') {
142 $.each(sslp, function () { 100 $.each(sslp, function () {
@@ -167,7 +125,7 @@ var lpFun = function () { @@ -167,7 +125,7 @@ var lpFun = function () {
167 cutCar(carListH,carListCache); 125 cutCar(carListH,carListCache);
168 var index = Math.floor(carListH.length / fblps); 126 var index = Math.floor(carListH.length / fblps);
169 for(var s=1; s<=fblps; s++){ 127 for(var s=1; s<=fblps; s++){
170 - carListH[s*index].isfb = true; 128 + carListH[s*index - 1].isfb = true;
171 } 129 }
172 } 130 }
173 carListH = carListH.concat(carListCache); 131 carListH = carListH.concat(carListCache);
@@ -179,6 +137,16 @@ var lpFun = function () { @@ -179,6 +137,16 @@ var lpFun = function () {
179 } 137 }
180 return carListH; 138 return carListH;
181 }; 139 };
  140 + // 切割出连班路牌
  141 + var cutCar = function(carListH,carListCache) {
  142 + for(var c=0; c<carListH.length; c++){
  143 + if(carListH[c].isfb) {
  144 + carListCache.push(carListH[c]);
  145 + carListH.splice(c,1);
  146 + cutCar(carListH,carListCache);
  147 + }
  148 + }
  149 + };
182 // 确定路牌分班数 150 // 确定路牌分班数
183 var lpfbs = function (fblps, bxRcList, index) { 151 var lpfbs = function (fblps, bxRcList, index) {
184 if(fblps > bxRcList[index].lps){ 152 if(fblps > bxRcList[index].lps){
src/main/resources/static/pages/base/timesmodel/js/v1/scheduleInitialize.js
@@ -33,8 +33,8 @@ var scheduleInitialize = function () { @@ -33,8 +33,8 @@ var scheduleInitialize = function () {
33 return; 33 return;
34 } 34 }
35 35
36 - // 行驶时间、停站时间、周转时间。发车间隙获取  
37 - getParaTime(map,dataMap); 36 + // 行驶时间、停站时间、周转时间、发车间隙获取、时间段
  37 + getParaTime(map,dataMap,seMap);
38 38
39 // 第一步 路牌分配 39 // 第一步 路牌分配
40 var bxRcList = lpFun.getBxRcListCollection(map.bxrc); 40 var bxRcList = lpFun.getBxRcListCollection(map.bxrc);
@@ -49,24 +49,28 @@ var scheduleInitialize = function () { @@ -49,24 +49,28 @@ var scheduleInitialize = function () {
49 // 第三步 剔除营运时间外的班次 49 // 第三步 剔除营运时间外的班次
50 var operationBcData = bcFun.markFirstAndLastBusAlsoDietNotInRangeBc(bcData, dataMap); 50 var operationBcData = bcFun.markFirstAndLastBusAlsoDietNotInRangeBc(bcData, dataMap);
51 // 第四步 横向调整停站时间 51 // 第四步 横向调整停站时间
52 - resizeByPitStopTime(carListH , operationBcData , dataMap); 52 + bcFun.resizeByPitStopTime(carListH , operationBcData , dataMap);
53 53
54 // 第五步 确认首末班车 54 // 第五步 确认首末班车
55 - markFirstAndLastBus(operationBcData, dataMap); 55 + bcFun.markLastBus(operationBcData, dataMap);
  56 + // return {'json':operationBcData,'bxrcgs':null};
56 57
57 // 第六步 抽车来满足工时. 58 // 第六步 抽车来满足工时.
58 var tempA = takeCar(operationBcData, carListH , seMap, dataMap , map); 59 var tempA = takeCar(operationBcData, carListH , seMap, dataMap , map);
  60 + // return {'json':tempA,'bxrcgs':null};
59 61
60 // 第七步 确定吃饭时间. 62 // 第七步 确定吃饭时间.
61 if (map.cfdd) { // NEW,没有选择吃饭地点,不设定吃饭班次 63 if (map.cfdd) { // NEW,没有选择吃饭地点,不设定吃饭班次
62 markeEatTime(bxRcList , tempA , carListH , seMap , dataMap ,map); 64 markeEatTime(bxRcList , tempA , carListH , seMap , dataMap ,map);
63 } 65 }
  66 +
64 // 横向调整停站时间 67 // 横向调整停站时间
65 - // resizeByPitStopTime(carListH , tempA , dataMap); 68 + bcFun.resizeByPitStopTime(carListH , tempA , dataMap);
  69 +
66 // 第八步 纵向调整(发车间隔调整) 70 // 第八步 纵向调整(发车间隔调整)
67 AdjustTrip.departureClearanceAdjust(tempA,dataMap); 71 AdjustTrip.departureClearanceAdjust(tempA,dataMap);
68 - // AdjustTrip2.departureClearanceAdjust(tempA,dataMap);  
69 bcFun.updfcno(tempA,0); 72 bcFun.updfcno(tempA,0);
  73 +
70 // 第九步 添加进出场和早晚例保 74 // 第九步 添加进出场和早晚例保
71 var data = bcFun.addInOutFieldBc(carListH,tempA,dataMap,map); 75 var data = bcFun.addInOutFieldBc(carListH,tempA,dataMap,map);
72 return {'json':data,'bxrcgs':null}; 76 return {'json':data,'bxrcgs':null};
@@ -108,16 +112,18 @@ var scheduleInitialize = function () { @@ -108,16 +112,18 @@ var scheduleInitialize = function () {
108 // count:班次圈数,type:是否跳过低谷班次(只对工时小于10了车辆有效) 112 // count:班次圈数,type:是否跳过低谷班次(只对工时小于10了车辆有效)
109 var count = 0, type = true; 113 var count = 0, type = true;
110 // 定义当前路牌的第一个班次的开始时间. 114 // 定义当前路牌的第一个班次的开始时间.
  115 + if(c > 0)
  116 + sbxfcTime.setMinutes(sbxfcTime.getMinutes() + judgeFCJX(sbxfcTime, dataMap));
111 var kssj = new Date(sbxfcTime); 117 var kssj = new Date(sbxfcTime);
112 // 进入早高峰按高峰发车间隙,否则按低估: TODO:暂时直接按早高峰 118 // 进入早高峰按高峰发车间隙,否则按低估: TODO:暂时直接按早高峰
113 - kssj.setMinutes(kssj.getMinutes() + (c * dataMap.fcjx[1].max)); 119 + // kssj.setMinutes(kssj.getMinutes() + (c * dataMap.fcjx[1].max));
114 // lpKssj:中标线之后的开始时间 120 // lpKssj:中标线之后的开始时间
115 var lpKssj, ZBXAfter = false; 121 var lpKssj, ZBXAfter = false;
116 // 判断是否中标线 122 // 判断是否中标线
117 if(c < ZBXCarNum) { 123 if(c < ZBXCarNum) {
118 lpKssj = new Date(kssj); 124 lpKssj = new Date(kssj);
119 // 判断中标线时间 = 发车时间 -(反方向停站时间+反方向行驶时间:早高峰之前行驶时间) 早高峰结束之前都用的最小停站时间 125 // 判断中标线时间 = 发车时间 -(反方向停站时间+反方向行驶时间:早高峰之前行驶时间) 早高峰结束之前都用的最小停站时间
120 - lpKssj.setMinutes(lpKssj.getMinutes()-(judgeTZSJ(fxTagDm==0 ? 1:0,zbxfcTime,dataMap) + dataMap.xssj[fxTagDm==0 ? 1:0][judgmentTimeQuantum(zbxfcTime)])); 126 + lpKssj.setMinutes(lpKssj.getMinutes()-(judgeTZSJ(fxTagDm==0 ? 1:0,zbxfcTime,dataMap) + dataMap.xssj[fxTagDm==0 ? 1:0][DateTimeTool.judgmentTimeQuantum(zbxfcTime)]));
121 // 中标线发车时间 与 判断中标线时间的上下差值在 高峰发车间隔的一般以内,为中标线 127 // 中标线发车时间 与 判断中标线时间的上下差值在 高峰发车间隔的一般以内,为中标线
122 if(Math.abs((zbxfcTime.getTime() - lpKssj.getTime())/60000) < dataMap.fcjx[1].max){ 128 if(Math.abs((zbxfcTime.getTime() - lpKssj.getTime())/60000) < dataMap.fcjx[1].max){
123 ZBXCarNum = c; 129 ZBXCarNum = c;
@@ -136,12 +142,12 @@ var scheduleInitialize = function () { @@ -136,12 +142,12 @@ var scheduleInitialize = function () {
136 // 定义在某时间段内[高峰时间段、低谷时间段]的停站时间. 142 // 定义在某时间段内[高峰时间段、低谷时间段]的停站时间.
137 var tzsj = judgeTZSJ(fxTagDm,lpKssj,dataMap); 143 var tzsj = judgeTZSJ(fxTagDm,lpKssj,dataMap);
138 // 定义在某时间段内的行驶时间. 144 // 定义在某时间段内的行驶时间.
139 - var xssj = dataMap.xssj[fxTagDm][judgmentTimeQuantum(lpKssj)]; 145 + var xssj = dataMap.xssj[fxTagDm][DateTimeTool.judgmentTimeQuantum(lpKssj)];
140 // 定义当前班次的停站时间,这里是为了当计算到了最后一个班次的时候,那么停站时间为0 ,但是后续的班次的发车时间需要加上前一个班次的停站时间. 146 // 定义当前班次的停站时间,这里是为了当计算到了最后一个班次的时候,那么停站时间为0 ,但是后续的班次的发车时间需要加上前一个班次的停站时间.
141 var xs_tzsj = isLastbc(lpKssj, endTime, tzsj, xssj) ? 0 : tzsj; 147 var xs_tzsj = isLastbc(lpKssj, endTime, tzsj, xssj) ? 0 : tzsj;
142 rs.push(bcFun.getbcObj(lpKssj, xssj, carListH[c], 148 rs.push(bcFun.getbcObj(lpKssj, xssj, carListH[c],
143 dataMap.bcTypeArr.normal, 149 dataMap.bcTypeArr.normal,
144 - dataMap.dira[fxTagDm], xhNo++, 150 + dataMap.dira[fxTagDm], xhNo-1,
145 dataMap.pcxslcArr[fxTagDm], map, 0, 151 dataMap.pcxslcArr[fxTagDm], map, 0,
146 dataMap.qdzArr[fxTagDm], 152 dataMap.qdzArr[fxTagDm],
147 dataMap.zdzArr[fxTagDm], null, xs_tzsj, 0)); 153 dataMap.zdzArr[fxTagDm], null, xs_tzsj, 0));
@@ -156,7 +162,7 @@ var scheduleInitialize = function () { @@ -156,7 +162,7 @@ var scheduleInitialize = function () {
156 // 定义在某时间段内[高峰时间段、低谷时间段]的停站时间. 162 // 定义在某时间段内[高峰时间段、低谷时间段]的停站时间.
157 var tzsj = judgeTZSJ(fxTagDm,kssj,dataMap); 163 var tzsj = judgeTZSJ(fxTagDm,kssj,dataMap);
158 // 定义在某时间段内的行驶时间. 164 // 定义在某时间段内的行驶时间.
159 - var xssj = dataMap.xssj[fxTagDm][judgmentTimeQuantum(kssj)]; 165 + var xssj = dataMap.xssj[fxTagDm][DateTimeTool.judgmentTimeQuantum(kssj)];
160 // 定义当前班次的停站时间,这里是为了当计算到了最后一个班次的时候,那么停站时间为0 ,但是后续的班次的发车时间需要加上前一个班次的停站时间. 166 // 定义当前班次的停站时间,这里是为了当计算到了最后一个班次的时候,那么停站时间为0 ,但是后续的班次的发车时间需要加上前一个班次的停站时间.
161 var xs_tzsj = isLastbc(kssj, endTime, tzsj, xssj) ? 0 : tzsj; 167 var xs_tzsj = isLastbc(kssj, endTime, tzsj, xssj) ? 0 : tzsj;
162 // 添加正常班次对象.(这里初始化时,都是正常班次类型.) 168 // 添加正常班次对象.(这里初始化时,都是正常班次类型.)
@@ -183,29 +189,45 @@ var scheduleInitialize = function () { @@ -183,29 +189,45 @@ var scheduleInitialize = function () {
183 * @return 返回一个满足单个路牌对应的标准工时、满足某班型下的所有路牌的平均工时对应的日平均工时、停站时间、路牌是否分班的班次集合. 189 * @return 返回一个满足单个路牌对应的标准工时、满足某班型下的所有路牌的平均工时对应的日平均工时、停站时间、路牌是否分班的班次集合.
184 */ 190 */
185 var takeCar = function (jsonArray, cara, saa, dataMap, map) { 191 var takeCar = function (jsonArray, cara, saa, dataMap, map) {
186 - // 定义低谷最大发车时间、最大停站时间来反算出低谷最少配车数.  
187 - var dgmaxfcjx = parseInt(map.dgmaxfcjx),  
188 - dgmaxtzsj = parseInt(map.dgmaxtzsj);  
189 - // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙.  
190 - // var dgminpcs = Math.round((dataMap.xssj[0][3] + dataMap.xssj[1][3] + dataMap.dgtzsj[0] + dataMap.dgtzsj[1]) / dgmaxfcjx);  
191 - // var zwxeLpNum = cuontZwxeLpNum(bxRcList);  
192 - // var dgminpcs = 4;  
193 // 定义返回数组. 192 // 定义返回数组.
194 var rs = new Array(); 193 var rs = new Array();
195 for(var s = 0 ; s < cara.length; s++) { 194 for(var s = 0 ; s < cara.length; s++) {
196 // 定义路牌编号、定义当前路牌下的所有班次. 195 // 定义路牌编号、定义当前路牌下的所有班次.
197 - var lpNo = cara[s].lpNo, car = cara[s], lpbc = new Array(); 196 + var lpNo = cara[s].lpNo, car = cara[s], lpbc = new Array(), hoursV = 0;
198 for (var i = 0; i < jsonArray.length; i++) { 197 for (var i = 0; i < jsonArray.length; i++) {
199 // 判断当期遍历的班次是否属于当前的路牌. 198 // 判断当期遍历的班次是否属于当前的路牌.
200 if (jsonArray[i].lpNo == lpNo) { 199 if (jsonArray[i].lpNo == lpNo) {
201 lpbc.push(jsonArray[i]); 200 lpbc.push(jsonArray[i]);
202 } 201 }
203 } 202 }
204 - var avgMakerCarNum = lpbc.length - car.count*2; 203 + lpbc.sort(function (a,b) { return a.fcno - b.fcno;});
  204 + // hoursV 分钟为单位(先添加进出场时间)
  205 + hoursV = dataMap.zwcArr[0] + dataMap.zwcArr[1] + dataMap.lbsj*2;
  206 + if(car.isfb){
  207 + hoursV += (DateTimeTool.getDateTime(lpbc[lpbc.length-1].ARRIVALTIME) - DateTimeTool.getDateTime(lpbc[0].fcsj)) / 60000;
  208 + } else {
  209 + for (var i = 0; i < jsonArray.length; i++) {
  210 + // 判断当期遍历的班次是否属于当前的路牌.
  211 + if (jsonArray[i].lpNo == lpNo) {
  212 + hoursV += jsonArray[i].bcsj + jsonArray[i].STOPTIME;
  213 + }
  214 + }
  215 + }
  216 + var excessHours = (hoursV/60).toFixed(2) - car.hoursV,
  217 + dgAvgXssj = (dataMap.xssj[0][0]+dataMap.xssj[0][2]+dataMap.xssj[0][4]+dataMap.xssj[1][0]+dataMap.xssj[1][2]+dataMap.xssj[1][4])/6;
  218 +
  219 + // 抽车全在低谷,所以用低谷平均行驶时间 TODO:(分班本来需要大于3小时,现在暂时改为1小时)
  220 + var avgMakerCarNum = 0;
  221 + if(excessHours >= 1){
  222 + avgMakerCarNum = Math.floor(excessHours*60/dgAvgXssj);
  223 + }
  224 + // var avgMakerCarNum = lpbc.length - car.count*2;
205 rs = rs.concat(abstractBcByWorkTime(lpbc, map, dataMap, saa, cara, avgMakerCarNum)); 225 rs = rs.concat(abstractBcByWorkTime(lpbc, map, dataMap, saa, cara, avgMakerCarNum));
206 } 226 }
207 return rs; 227 return rs;
208 }; 228 };
  229 +
  230 + // 数据排序
209 function sortDeepArr(arr, sortTypes) { 231 function sortDeepArr(arr, sortTypes) {
210 var i = 0; 232 var i = 0;
211 var len = sortTypes.length; 233 var len = sortTypes.length;
@@ -231,7 +253,7 @@ var scheduleInitialize = function () { @@ -231,7 +253,7 @@ var scheduleInitialize = function () {
231 } else { 253 } else {
232 var nextSortType = sortTypes[i]; 254 var nextSortType = sortTypes[i];
233 $.each(arrObj[sortType.name], function(key, val) { 255 $.each(arrObj[sortType.name], function(key, val) {
234 - console.log(i) 256 + // console.log(i);
235 itSelf(val, nextSortType) 257 itSelf(val, nextSortType)
236 }) 258 })
237 } 259 }
@@ -242,12 +264,27 @@ var scheduleInitialize = function () { @@ -242,12 +264,27 @@ var scheduleInitialize = function () {
242 * @param map 264 * @param map
243 * @param dataMap 265 * @param dataMap
244 */ 266 */
245 - var getParaTime = function (map,dataMap) { 267 + var getParaTime = function (map,dataMap,seMap) {
246 // 停站类型:tzlx,主站方向:zzfx 268 // 停站类型:tzlx,主站方向:zzfx
247 var tzlx = map.tzlx.split('/'),zzfx = 0; 269 var tzlx = map.tzlx.split('/'),zzfx = 0;
  270 + var isMasterStop = false; // 是否主站停
  271 + if (map) {
  272 + var tzlx = map.tzlx.split("/");
  273 + if (tzlx.length == 1) { // 双向停站
  274 + isMasterStop = false;
  275 + } else if(tzlx.length > 1){
  276 + isMasterStop = true;
  277 + zzfx = tzlx[1] == 0 ? 0 : 1;
  278 + }
  279 + }
  280 + dataMap.isMasterStop = isMasterStop; // 是否主站停
  281 + dataMap.zzfx = zzfx; //主站方向
  282 +
  283 + // 停站类型:tzlx,主站方向:zzfx
  284 + /*var tzlx = map.tzlx.split('/'),zzfx = 0;
248 if(tzlx.length > 1 && tzlx[0] == 1) { 285 if(tzlx.length > 1 && tzlx[0] == 1) {
249 zzfx = tzlx[1] == 0 ? 0 : 1; 286 zzfx = tzlx[1] == 0 ? 0 : 1;
250 - } 287 + }*/
251 288
252 // 行驶时间 上下行分别5个时间段 0:上行,1:下行 289 // 行驶时间 上下行分别5个时间段 0:上行,1:下行
253 var xssj = [[],[]]; 290 var xssj = [[],[]];
@@ -263,6 +300,7 @@ var scheduleInitialize = function () { @@ -263,6 +300,7 @@ var scheduleInitialize = function () {
263 xssj[1].push(parseInt(map.downTravelTime5)); 300 xssj[1].push(parseInt(map.downTravelTime5));
264 // 停站时间 上下行分别5个时间段 0:上行,1:下行 TODO:暂时只支持单向停站 301 // 停站时间 上下行分别5个时间段 0:上行,1:下行 TODO:暂时只支持单向停站
265 var tzsj = [[],[]]; 302 var tzsj = [[],[]];
  303 + // 是否主站停站
266 var upDownTravelTimeMin1 =Math.round((parseInt(map.upTravelTime1)+parseInt(map.downTravelTime1))*0.15), 304 var upDownTravelTimeMin1 =Math.round((parseInt(map.upTravelTime1)+parseInt(map.downTravelTime1))*0.15),
267 upDownTravelTimeMin2 =Math.round((parseInt(map.upTravelTime2)+parseInt(map.downTravelTime2))*0.1), 305 upDownTravelTimeMin2 =Math.round((parseInt(map.upTravelTime2)+parseInt(map.downTravelTime2))*0.1),
268 upDownTravelTimeMin3 =Math.round((parseInt(map.upTravelTime3)+parseInt(map.downTravelTime3))*0.15), 306 upDownTravelTimeMin3 =Math.round((parseInt(map.upTravelTime3)+parseInt(map.downTravelTime3))*0.15),
@@ -274,20 +312,33 @@ var scheduleInitialize = function () { @@ -274,20 +312,33 @@ var scheduleInitialize = function () {
274 upDownTravelTimeMax3 =Math.round((parseInt(map.upTravelTime3)+parseInt(map.downTravelTime3))*0.2), 312 upDownTravelTimeMax3 =Math.round((parseInt(map.upTravelTime3)+parseInt(map.downTravelTime3))*0.2),
275 upDownTravelTimeMax4 =Math.round((parseInt(map.upTravelTime4)+parseInt(map.downTravelTime4))*0.15), 313 upDownTravelTimeMax4 =Math.round((parseInt(map.upTravelTime4)+parseInt(map.downTravelTime4))*0.15),
276 upDownTravelTimeMax5 =Math.round((parseInt(map.upTravelTime5)+parseInt(map.downTravelTime5))*0.2); 314 upDownTravelTimeMax5 =Math.round((parseInt(map.upTravelTime5)+parseInt(map.downTravelTime5))*0.2);
277 - if(zzfx == 0) {  
278 - tzsj[0].push({'min':upDownTravelTimeMin1 < 10 ? 10 : upDownTravelTimeMin1, 'max':upDownTravelTimeMax1});  
279 - tzsj[0].push({'min':upDownTravelTimeMin2 < 10 ? 10 : upDownTravelTimeMin2, 'max':upDownTravelTimeMax2});  
280 - tzsj[0].push({'min':upDownTravelTimeMin3 < 10 ? 10 : upDownTravelTimeMin3, 'max':upDownTravelTimeMax3});  
281 - tzsj[0].push({'min':upDownTravelTimeMin4 < 10 ? 10 : upDownTravelTimeMin4, 'max':upDownTravelTimeMax4});  
282 - tzsj[0].push({'min':upDownTravelTimeMin5 < 10 ? 10 : upDownTravelTimeMin5, 'max':upDownTravelTimeMax5});  
283 - tzsj[1] = [{'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}]; 315 + if(isMasterStop) {
  316 + if(zzfx == 0) {
  317 + tzsj[0].push({'min':upDownTravelTimeMin1 < 10 ? 10 : upDownTravelTimeMin1, 'max':upDownTravelTimeMax1});
  318 + tzsj[0].push({'min':upDownTravelTimeMin2 < 3 ? 3 : upDownTravelTimeMin2, 'max':upDownTravelTimeMax2});
  319 + tzsj[0].push({'min':upDownTravelTimeMin3 < 10 ? 10 : upDownTravelTimeMin3, 'max':upDownTravelTimeMax3});
  320 + tzsj[0].push({'min':upDownTravelTimeMin4 < 3 ? 3 : upDownTravelTimeMin4, 'max':upDownTravelTimeMax4});
  321 + tzsj[0].push({'min':upDownTravelTimeMin5 < 10 ? 10 : upDownTravelTimeMin5, 'max':upDownTravelTimeMax5});
  322 + tzsj[1] = [{'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}];
  323 + } else {
  324 + tzsj[1].push({'min':upDownTravelTimeMin1 < 10 ? 10 : upDownTravelTimeMin1, 'max':upDownTravelTimeMax1});
  325 + tzsj[1].push({'min':upDownTravelTimeMin2 < 3 ? 3 : upDownTravelTimeMin2, 'max':upDownTravelTimeMax2});
  326 + tzsj[1].push({'min':upDownTravelTimeMin3 < 10 ? 10 : upDownTravelTimeMin3, 'max':upDownTravelTimeMax3});
  327 + tzsj[1].push({'min':upDownTravelTimeMin4 < 3 ? 3 : upDownTravelTimeMin4, 'max':upDownTravelTimeMax4});
  328 + tzsj[1].push({'min':upDownTravelTimeMin5 < 10 ? 10 : upDownTravelTimeMin5, 'max':upDownTravelTimeMax5});
  329 + tzsj[0] = [{'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}];
  330 + }
284 } else { 331 } else {
285 - tzsj[1].push({'min':upDownTravelTimeMin1 < 10 ? 10 : upDownTravelTimeMin1, 'max':upDownTravelTimeMax1});  
286 - tzsj[1].push({'min':upDownTravelTimeMin2 < 10 ? 10 : upDownTravelTimeMin2, 'max':upDownTravelTimeMax2});  
287 - tzsj[1].push({'min':upDownTravelTimeMin3 < 10 ? 10 : upDownTravelTimeMin3, 'max':upDownTravelTimeMax3});  
288 - tzsj[1].push({'min':upDownTravelTimeMin4 < 10 ? 10 : upDownTravelTimeMin4, 'max':upDownTravelTimeMax4});  
289 - tzsj[1].push({'min':upDownTravelTimeMin5 < 10 ? 10 : upDownTravelTimeMin5, 'max':upDownTravelTimeMax5});  
290 - tzsj[0] = [{'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}, {'min':1, 'max':3}]; 332 + tzsj[0].push({'min':upDownTravelTimeMin1/2 < 10 ? 10 : upDownTravelTimeMin1/2, 'max':upDownTravelTimeMax1/2});
  333 + tzsj[0].push({'min':upDownTravelTimeMin2/2 < 3 ? 3 : upDownTravelTimeMin2/2, 'max':upDownTravelTimeMax2/2});
  334 + tzsj[0].push({'min':upDownTravelTimeMin3/2 < 10 ? 10 : upDownTravelTimeMin3/2, 'max':upDownTravelTimeMax3/2});
  335 + tzsj[0].push({'min':upDownTravelTimeMin4/2 < 3 ? 3 : upDownTravelTimeMin4/2, 'max':upDownTravelTimeMax4/2});
  336 + tzsj[0].push({'min':upDownTravelTimeMin5/2 < 10 ? 10 : upDownTravelTimeMin5/2, 'max':upDownTravelTimeMax5/2});
  337 + tzsj[1].push({'min':upDownTravelTimeMin1/2 < 10 ? 10 : upDownTravelTimeMin1/2, 'max':upDownTravelTimeMax1/2});
  338 + tzsj[1].push({'min':upDownTravelTimeMin2/2 < 3 ? 3 : upDownTravelTimeMin2/2, 'max':upDownTravelTimeMax2/2});
  339 + tzsj[1].push({'min':upDownTravelTimeMin3/2 < 10 ? 10 : upDownTravelTimeMin3/2, 'max':upDownTravelTimeMax3/2});
  340 + tzsj[1].push({'min':upDownTravelTimeMin4/2 < 3 ? 3 : upDownTravelTimeMin4/2, 'max':upDownTravelTimeMax4/2});
  341 + tzsj[1].push({'min':upDownTravelTimeMin5/2 < 10 ? 10 : upDownTravelTimeMin5/2, 'max':upDownTravelTimeMax5/2});
291 } 342 }
292 // 周转时间 分别5个时间段 343 // 周转时间 分别5个时间段
293 var zzsj = []; 344 var zzsj = [];
@@ -299,55 +350,61 @@ var scheduleInitialize = function () { @@ -299,55 +350,61 @@ var scheduleInitialize = function () {
299 // 发车间隙 分别5个时间段 350 // 发车间隙 分别5个时间段
300 var fcjx = []; 351 var fcjx = [];
301 var clzs = parseInt(map.clzs); 352 var clzs = parseInt(map.clzs);
302 - // fcjx.push(Math.round(zzsj[0] / clzs > 20.4 ? 20 : (zzsj[0] / clzs < 15 ? 15 : zzsj[1] / clzs)));  
303 - fcjx.push({'min':10, 'max':12});  
304 - // fcjx.push({'min':5, 'max':Math.round(zzsj[1] / clzs > 8.4 ? 8 : zzsj[1] / clzs)});  
305 - fcjx.push({'min':5, 'max':Math.round(zzsj[1] / clzs)});  
306 - fcjx.push({'min':8, 'max':20});  
307 - fcjx.push({'min':5, 'max':Math.round(zzsj[1] / clzs)});  
308 - fcjx.push({'min':8, 'max':20});  
309 353
310 - dataMap.xssj = xssj;  
311 - dataMap.tzsj = tzsj;  
312 - dataMap.zzsj = zzsj;  
313 - dataMap.fcjx = fcjx;  
314 - // map.dgmaxfcjx = 20; 354 + var dgmaxfcjx = parseInt(dataMap.dgmaxfcjx);
  355 + // 一级线路要满足8分20分的发车间隔
  356 + if(map.level == '1') {
  357 + fcjx.push({'min':10, 'max':15});
  358 + fcjx.push({'min':5, 'max':Math.round(zzsj[1] / clzs > 8 ? 8 : zzsj[1] / clzs)});
  359 + fcjx.push({'min':8, 'max':20});
  360 + fcjx.push({'min':5, 'max':Math.round(zzsj[1] / clzs > 8 ? 8 : zzsj[1] / clzs)});
  361 + fcjx.push({'min':8, 'max':20});
  362 + } else {
  363 + // fcjx.push(Math.round(zzsj[0] / clzs > 20.4 ? 20 : (zzsj[0] / clzs < 15 ? 15 : zzsj[1] / clzs)));
  364 + fcjx.push({'min':10, 'max':15});
  365 + fcjx.push({'min':5, 'max':Math.floor(zzsj[1] / clzs)});
  366 + fcjx.push({'min':8, 'max':20});
  367 + fcjx.push({'min':5, 'max':Math.floor(zzsj[1] / clzs)});
  368 + fcjx.push({'min':8, 'max':20});
  369 + }
  370 + var sjd = [];
  371 + sjd.push({'start':seMap.s, 'end':map.end1});
  372 + sjd.push({'start':map.start2, 'end':map.end2});
  373 + sjd.push({'start':map.start3, 'end':map.end3});
  374 + sjd.push({'start':map.start4, 'end':map.end4});
  375 + sjd.push({'start':map.start5, 'end':seMap.e});
  376 + DateTimeTool.initSJD(sjd);
  377 +
  378 + dataMap.zgfzqsjd = [{'st':DateTimeTool.getDateTime(seMap.s), 'ed':DateTimeTool.getDateTime(map.end1)}];
  379 + dataMap.zgfsjd = [{'st':DateTimeTool.getDateTime(map.start2), 'ed':DateTimeTool.getDateTime(map.end2)}];
  380 + dataMap.gfzjsjd = [{'st':DateTimeTool.getDateTime(map.start3), 'ed':DateTimeTool.getDateTime(map.end3)}];
  381 + dataMap.wgfsjd = [{'st':DateTimeTool.getDateTime(map.start4), 'ed':DateTimeTool.getDateTime(map.end4)}];
  382 + dataMap.wgfzhsjd = [{'st':DateTimeTool.getDateTime(map.start5), 'ed':DateTimeTool.getDateTime(seMap.e)}];
  383 + dataMap.sjd = sjd;
  384 + dataMap.xssj = xssj; // 行驶时间
  385 + dataMap.tzsj = tzsj; // 停站时间zse31
  386 + dataMap.zzsj = zzsj; // 周转时间
  387 + dataMap.fcjx = fcjx; // 发车间隙
  388 + // 清除不用的元素
  389 + delete dataMap.dgtzsj;
  390 + delete dataMap.dgxxsjArr;
  391 + delete dataMap.gftzsj;
  392 + delete dataMap.gfxxsjArr;
  393 + map.dgmaxfcjx = 20;
315 // map.dgmaxtzsj = upDownTravelTime3 < 10 ? 10 : upDownTravelTime3; 394 // map.dgmaxtzsj = upDownTravelTime3 < 10 ? 10 : upDownTravelTime3;
316 }; 395 };
317 - // 判断时间在什么时间段段内  
318 - var judgmentTimeQuantum = function (t) {  
319 - if(t <= DateTimeTool.getDateTime('6:30'))  
320 - return 0;  
321 - else if(t > DateTimeTool.getDateTime('6:30') && t <= DateTimeTool.getDateTime('8:30'))  
322 - return 1;  
323 - else if(t > DateTimeTool.getDateTime('8:30') && t <= DateTimeTool.getDateTime('16:00'))  
324 - return 2;  
325 - else if(t > DateTimeTool.getDateTime('16:00') && t <= DateTimeTool.getDateTime('18:00'))  
326 - return 3;  
327 - else if(t > DateTimeTool.getDateTime('18:00'))  
328 - return 4;  
329 - };  
330 - // 8:31-16:00专用  
331 - var judgmentTimeQuantum1 = function (t) {  
332 - if(t > DateTimeTool.getDateTime('8:30') && t <= DateTimeTool.getDateTime('10:30'))  
333 - return 1;  
334 - else if(t > DateTimeTool.getDateTime('10:30') && t <= DateTimeTool.getDateTime('12:30'))  
335 - return 2;  
336 - else if(t > DateTimeTool.getDateTime('12:30') && t <= DateTimeTool.getDateTime('14:30'))  
337 - return 2;  
338 - else if(t > DateTimeTool.getDateTime('14:30') && t <= DateTimeTool.getDateTime('16:00'))  
339 - return 1;  
340 - };  
341 396
342 // 判断发车间隙 397 // 判断发车间隙
343 var judgeFCJX = function (kssj, dataMap) { 398 var judgeFCJX = function (kssj, dataMap) {
344 - var time = dataMap.fcjx[judgmentTimeQuantum(kssj)]; 399 + var time = dataMap.fcjx[DateTimeTool.judgmentTimeQuantum(kssj)];
345 if(time == null) 400 if(time == null)
346 return 0; 401 return 0;
347 - if(judgmentTimeQuantum(kssj) == 2) { 402 + if(DateTimeTool.judgmentTimeQuantum(kssj) == 2) {
348 // 为了从大到小在从小到大 403 // 为了从大到小在从小到大
349 - var time = Math.round((time.max - time.min)/2);  
350 - return time*judgmentTimeQuantum1(kssj) + time.min; 404 + var resultTime = Math.round((time.max - time.min)/2);
  405 + return resultTime*DateTimeTool.judgmentTimeQuantum1(kssj) + time.min;
  406 + }else if(DateTimeTool.judgmentTimeQuantum(kssj) == 1 || DateTimeTool.judgmentTimeQuantum(kssj) == 3) {
  407 + return time.max;
351 } else { 408 } else {
352 return Math.round((time.max + time.min)/2); 409 return Math.round((time.max + time.min)/2);
353 } 410 }
@@ -355,8 +412,8 @@ var scheduleInitialize = function () { @@ -355,8 +412,8 @@ var scheduleInitialize = function () {
355 // 判断停站时间 412 // 判断停站时间
356 var judgeTZSJ = function (dir, kssj, dataMap) { 413 var judgeTZSJ = function (dir, kssj, dataMap) {
357 var sj = new Date(kssj); 414 var sj = new Date(kssj);
358 - sj.setMinutes(sj.getMinutes() + dataMap.xssj[dir][judgmentTimeQuantum(sj)]);  
359 - var sjd = judgmentTimeQuantum(sj); 415 + sj.setMinutes(sj.getMinutes() + dataMap.xssj[dir][DateTimeTool.judgmentTimeQuantum(sj)]);
  416 + var sjd = DateTimeTool.judgmentTimeQuantum(sj);
360 var time = dataMap.tzsj[dir][sjd]; 417 var time = dataMap.tzsj[dir][sjd];
361 if(time == null) 418 if(time == null)
362 return 0; 419 return 0;
@@ -370,9 +427,9 @@ var scheduleInitialize = function () { @@ -370,9 +427,9 @@ var scheduleInitialize = function () {
370 }; 427 };
371 // 判断行驶时间 428 // 判断行驶时间
372 var judgeXSSJ = function (dir, kssj, dataMap) { 429 var judgeXSSJ = function (dir, kssj, dataMap) {
373 - var xssj = dataMap.xssj[dir][judgmentTimeQuantum(kssj)]; 430 + var xssj = dataMap.xssj[dir][DateTimeTool.judgmentTimeQuantum(kssj)];
374 431
375 - var sjd = judgmentTimeQuantum(sj); 432 + /*var sjd = DateTimeTool.judgmentTimeQuantum(kssj);
376 var time = dataMap.tzsj[dir][sjd]; 433 var time = dataMap.tzsj[dir][sjd];
377 if(time == null) 434 if(time == null)
378 return 0; 435 return 0;
@@ -383,6 +440,18 @@ var scheduleInitialize = function () { @@ -383,6 +440,18 @@ var scheduleInitialize = function () {
383 } else { 440 } else {
384 return time.max; 441 return time.max;
385 } 442 }
  443 +
  444 + var time = dataMap.fcjx[DateTimeTool.judgmentTimeQuantum(kssj)];
  445 + if(time == null)
  446 + return 0;
  447 + if(DateTimeTool.judgmentTimeQuantum(kssj) == 2) {
  448 + // 为了从大到小在从小到大
  449 + var time = Math.round((time.max - time.min)/2);
  450 + return time*DateTimeTool.judgmentTimeQuantum1(kssj) + time.min;
  451 + } else {
  452 + return Math.round((time.max + time.min)/2);
  453 + }*/
  454 + return xssj;
386 }; 455 };
387 /** 456 /**
388 * @discription : (TODO) 判断是否为最后一个班次 457 * @discription : (TODO) 判断是否为最后一个班次
@@ -400,22 +469,6 @@ var scheduleInitialize = function () { @@ -400,22 +469,6 @@ var scheduleInitialize = function () {
400 return tag; 469 return tag;
401 }; 470 };
402 /** 471 /**
403 - * @discription : (TODO) 获取行驶时间  
404 - *  
405 - * @parmas : [zg--早高峰时间段;wg--晚高峰时间段;sj--当前时间;pc--平常行驶时间;gf--高峰行驶时间;dir--方向]  
406 - *  
407 - * @return : 返回一个数值。这里返回的是行驶时间数值  
408 - *  
409 - * */  
410 - var getByDirTravelTime = function(zg,wg,sj,pc,gf,dir) {  
411 - var xxsj = 0;  
412 - if(isgfsjd(zg[0].st,zg[0].ed,sj) || isgfsjd(wg[0].st,wg[0].ed,sj))  
413 - xxsj = gf[dir];  
414 - else  
415 - xxsj = pc[dir];  
416 - return xxsj;  
417 - };  
418 - /**  
419 * @discription : (TODO) 比较一个时间是否在某个时间段内 472 * @discription : (TODO) 比较一个时间是否在某个时间段内
420 * 473 *
421 * @params : [st--开始时间;ed--结束时间;sj--当前时间] 474 * @params : [st--开始时间;ed--结束时间;sj--当前时间]
@@ -503,77 +556,6 @@ var scheduleInitialize = function () { @@ -503,77 +556,6 @@ var scheduleInitialize = function () {
503 }; 556 };
504 557
505 /** 558 /**
506 - * @description (TODO) 标记上、下行首末班车.  
507 - * @param jsonArray 初始化路牌下的所有班次并且已经均匀发车间隙的数组集合.  
508 - * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].  
509 - */  
510 - var markFirstAndLastBus = function(jsonArray , dataMap) {  
511 - // 定义上、下行的正常、区间、空放、直放班次、返回数组集合.  
512 - var listMap = getUpAndDownBc( jsonArray , dataMap) , resultArray = new Array();  
513 - for(var i = 0 ; i < listMap.length ; i++) {  
514 - if(listMap[i].bc.length > 0){  
515 - // 把班次顺序排序.  
516 - listMap[i].bc.sort(function(a,b){return a.fcint-b.fcint});  
517 - // 确定首末班车时间.  
518 - markFirstAndLastBusAlso(listMap[i].bc , dataMap , i);  
519 - }  
520 - resultArray = resultArray.concat(listMap[i].bc);  
521 - }  
522 - return resultArray;  
523 - };  
524 -  
525 - /**  
526 - * @description (TODO) 确定某方向下的末班车.  
527 - * @param dirArray 某方向下的数组集合.  
528 - * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].  
529 - * @param dir 方向.  
530 - */  
531 - var markFirstAndLastBusAlso = function(dirArray , dataMap , dir) {  
532 - if(dirArray.length>=2) {  
533 - // 定义最后一个班次.  
534 - var dirLastBc = dirArray[dirArray.length-1];  
535 - // 确认末班车时间  
536 - if(dirLastBc.fcsj != dataMap.smbcsjArr[dir].jssj) {  
537 - // 修改最后一个班次的发车时间.  
538 - dirLastBc.fcsj = dataMap.smbcsjArr[dir].jssj;  
539 - // 修改最后一个班次的班次时间.  
540 - dirLastBc.bcsj = dataMap.dgxxsjArr[dir];  
541 - // 定义到达时间.  
542 - var ddsj_ = DateTimeTool.getDateTime(dirLastBc.fcsj);  
543 - ddsj_.setMinutes(ddsj_.getMinutes() + dataMap.xssj[dir][4]);  
544 - // 修改最后一个班次的到达时间.  
545 - dirLastBc.ARRIVALTIME = DateTimeTool.getHHmmStr(ddsj_);  
546 - dirLastBc.bcsj = dataMap.xssj[dir][4];  
547 - }  
548 - }  
549 - };  
550 -  
551 - /**  
552 - * @description (TODO) 获取 上、下行的正常、区间、空放、直放班次.  
553 - * @param 需要分割的班次数据集合.  
554 - * @param 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].  
555 - */  
556 - var getUpAndDownBc = function(json,dataMap) {  
557 - // 定义上行班次 、 下行班次 数组集合、返回数组集合对象.  
558 - var upArray = new Array(),downArray = new Array(),rs = new Array();  
559 - for(var j = 0 ; j< json.length ; j++) {  
560 - // 判断是否为正常、区间、空放、直放班次  
561 - if(json[j].bcType== dataMap.bcTypeArr.normal ||  
562 - json[j].bcType== dataMap.bcTypeArr.region ||  
563 - json[j].bcType== dataMap.bcTypeArr.major ||  
564 - json[j].bcType== dataMap.bcTypeArr.venting) {  
565 - if(json[j].xlDir == dataMap.dira[0])  
566 - upArray.push(json[j]);  
567 - else if(json[j].xlDir == dataMap.dira[1])  
568 - downArray.push(json[j]);  
569 - }  
570 - }  
571 - rs.push({'bc' : upArray},{'bc' : downArray});  
572 - // 返回数据.  
573 - return rs;  
574 - };  
575 -  
576 - /**  
577 * @description : (TODO) 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班. -- 这里我们也叫抽车 559 * @description : (TODO) 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班. -- 这里我们也叫抽车
578 * @param bxlpbc 班型下的各个路牌的所有班次数组. 560 * @param bxlpbc 班型下的各个路牌的所有班次数组.
579 * @param map 表单参数信息 561 * @param map 表单参数信息
@@ -636,106 +618,95 @@ var scheduleInitialize = function () { @@ -636,106 +618,95 @@ var scheduleInitialize = function () {
636 var sumGs = 0; 618 var sumGs = 0;
637 if(lpbc.length<=0) 619 if(lpbc.length<=0)
638 return; 620 return;
639 - var isLastFlag = lpDownIsHaveLastBc(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array();  
640 - var isFirstFlag = lpDownIsHaveFirstBc(lpbc , dataMap.smbcsjArr); 621 + var isLastFlag = bcFun.lpBcIsHaveLast(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array();
  622 + var isFirstFlag = bcFun.lpBcIsHaveFirst(lpbc , dataMap.smbcsjArr);
641 var bxStr = lpbc[0].lpName.split('_'); 623 var bxStr = lpbc[0].lpName.split('_');
642 /** 满足工时需要剔除的班次 624 /** 满足工时需要剔除的班次
643 * wgfhtcbcNum,zgfqtcbcNum 定义晚高峰后,早高峰前 能剔除多少班次数(适用于单挡连班) 625 * wgfhtcbcNum,zgfqtcbcNum 定义晚高峰后,早高峰前 能剔除多少班次数(适用于单挡连班)
644 - * dgzjtcbcNum: 低估中间能剔除多少班次数(适用于五休二以外的分班) 626 + * dgzjtcbcNum1: 低估中间能剔除多少班次数(适用于五休二以外的分班)
645 * dgtcbcNum: 低估能剔除多少班次数(适用于五休二分班) 627 * dgtcbcNum: 低估能剔除多少班次数(适用于五休二分班)
646 */ 628 */
647 - var wgfhtcbcNum=0,zgfqtcbcNum=0,dgzjtcbcNum=0,dgtcbcNum=0; 629 + var wgfhtcbcNum=0,zgfqtcbcNum=0,dgzjtcbcNum1=0,dgzjtcbcNum2=0,dgtcbcNum=0;
648 $.each(lpbc, function () { 630 $.each(lpbc, function () {
649 if(DateTimeTool.getDateTime(this.fcsj) > dataMap.wgfzhsjd[0].st) 631 if(DateTimeTool.getDateTime(this.fcsj) > dataMap.wgfzhsjd[0].st)
650 wgfhtcbcNum++; 632 wgfhtcbcNum++;
651 if(DateTimeTool.getDateTime(this.fcsj) < dataMap.zgfsjd[0].st) 633 if(DateTimeTool.getDateTime(this.fcsj) < dataMap.zgfsjd[0].st)
652 zgfqtcbcNum++; 634 zgfqtcbcNum++;
653 if(DateTimeTool.getDateTime(this.fcsj) > dgzjsj && DateTimeTool.getDateTime(this.fcsj) < dataMap.wgfsjd[0].st) 635 if(DateTimeTool.getDateTime(this.fcsj) > dgzjsj && DateTimeTool.getDateTime(this.fcsj) < dataMap.wgfsjd[0].st)
654 - dgzjtcbcNum++; 636 + dgzjtcbcNum1++;
  637 + if(DateTimeTool.getDateTime(this.fcsj) > dataMap.zgfsjd[0].ed && DateTimeTool.getDateTime(this.fcsj) < dgzjsj)
  638 + dgzjtcbcNum2++;
655 if(DateTimeTool.getDateTime(this.fcsj) > dataMap.zgfsjd[0].ed && DateTimeTool.getDateTime(this.fcsj) < dataMap.wgfsjd[0].st) 639 if(DateTimeTool.getDateTime(this.fcsj) > dataMap.zgfsjd[0].ed && DateTimeTool.getDateTime(this.fcsj) < dataMap.wgfsjd[0].st)
656 dgtcbcNum++; 640 dgtcbcNum++;
657 -  
658 }); 641 });
  642 + // dgtcbcNum = dgzjtcbcNum1+dgzjtcbcNum2
659 if(bxStr[0] == '五工二休'){ 643 if(bxStr[0] == '五工二休'){
660 - if(isLastFlag) { 644 + if(isLastFlag && !isFirstFlag) {
661 // 定义时间段内剔除班次规则. 645 // 定义时间段内剔除班次规则.
662 - tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'asc' , 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgtcbcNum: deletebcNum}); 646 + tcbcgzA.push({'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'asc' , 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1: deletebcNum},
  647 + {'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgzjtcbcNum2: deletebcNum-dgzjtcbcNum1},
  648 + {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum - zgfqtcbcNum > 0 ? zgfqtcbcNum: deletebcNum-dgtcbcNum});
663 }else { 649 }else {
664 - tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dataMap.wgfsjd[0].st ,'order' : 'asc' , 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgtcbcNum: deletebcNum},  
665 - {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum}); 650 + tcbcgzA.push({'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'asc' , 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1: deletebcNum},
  651 + {'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgzjtcbcNum2: deletebcNum-dgzjtcbcNum1},
  652 + {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum - zgfqtcbcNum > 0 ? zgfqtcbcNum: deletebcNum-dgtcbcNum});
666 } 653 }
667 } else { 654 } else {
668 if(lpbc.isfb) { 655 if(lpbc.isfb) {
669 - if(isLastFlag) {  
670 - tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum > 0 ? dgzjtcbcNum: deletebcNum},  
671 - {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum});  
672 - } else if(isFirstFlag){  
673 - tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum > 0 ? dgzjtcbcNum: deletebcNum},  
674 - {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum}); 656 + if(isLastFlag && !isFirstFlag) {
  657 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'desc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1 : deletebcNum},
  658 + {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 - zgfqtcbcNum > 0 ? zgfqtcbcNum : deletebcNum - dgzjtcbcNum1});
  659 + } else if(isFirstFlag && !isLastFlag){
  660 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1 : deletebcNum},
  661 + {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 - wgfhtcbcNum > 0 ? wgfhtcbcNum : deletebcNum-dgzjtcbcNum1},
  662 + {'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgzjtcbcNum2 : deletebcNum-dgzjtcbcNum1});
  663 + } else if(isFirstFlag && isLastFlag){
  664 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgtcbcNum : deletebcNum});
675 } else { 665 } else {
676 - tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed, 'maxsj' : dataMap.wgfzhsjd[0].ed,'order' : 'desc', 'deletebcNum' : deletebcNum - dgzjtcbcNum},  
677 - {'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum > 0 ? dgzjtcbcNum: deletebcNum}); 666 + tcbcgzA.push({'minsj': dgzjsj , 'maxsj' : dataMap.wgfsjd[0].st , 'order' : 'asc' , 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1: deletebcNum},
  667 + {'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgzjtcbcNum2: deletebcNum-dgzjtcbcNum1},
  668 + {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc' , 'deletebcNum' : deletebcNum - dgtcbcNum - zgfqtcbcNum > 0 ? zgfqtcbcNum: deletebcNum-dgtcbcNum});
678 } 669 }
679 }else { 670 }else {
  671 + if(isLastFlag && !isFirstFlag) {
  672 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 - zgfqtcbcNum > 0 ? dgzjtcbcNum1 : deletebcNum-zgfqtcbcNum},
  673 + {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - zgfqtcbcNum > 0 ? zgfqtcbcNum : deletebcNum});
  674 + } else if(!isLastFlag && isFirstFlag){
  675 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - wgfhtcbcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1 : deletebcNum-wgfhtcbcNum},
  676 + {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum - wgfhtcbcNum > 0 ? wgfhtcbcNum : deletebcNum});
  677 + } else if(isFirstFlag && isLastFlag){
  678 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgtcbcNum : deletebcNum});
  679 + } else {
  680 + tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed, 'order' : 'desc', 'deletebcNum' : deletebcNum - zgfqtcbcNum - wgfhtcbcNum > 0 ? wgfhtcbcNum : deletebcNum-zgfqtcbcNum},
  681 + {'minsj': dataMap.zgfzqsjd[0].st, 'maxsj' : dataMap.zgfzqsjd[0].ed, 'order' : 'asc','deletebcNum' : deletebcNum - zgfqtcbcNum > 0 ? zgfqtcbcNum : deletebcNum});
  682 + }
680 // 单档 一个路牌一档劳动力 683 // 单档 一个路牌一档劳动力
681 /*if(deletebcNum - (wgfhtcbcNum+zgfqtcbcNum) > 0) { 684 /*if(deletebcNum - (wgfhtcbcNum+zgfqtcbcNum) > 0) {
682 // TODO:可能删除末班车 685 // TODO:可能删除末班车
683 - tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed, 'maxsj' : dataMap.wgfzhsjd[0].ed,'order' : 'desc', 'deletebcNum' : deletebcNum - dgzjtcbcNum},  
684 - {'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum > 0 ? dgzjtcbcNum: deletebcNum}); 686 + tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed, 'maxsj' : dataMap.wgfzhsjd[0].ed,'order' : 'desc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1},
  687 + {'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1: deletebcNum});
685 } else { 688 } else {
686 if(isLastFlag) { 689 if(isLastFlag) {
687 - tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum > 0 ? dgzjtcbcNum: deletebcNum},  
688 - {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum}); 690 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1: deletebcNum},
  691 + {'minsj': dataMap.zgfzqsjd[0].st , 'maxsj' : dataMap.zgfzqsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1});
689 } else if(isFirstFlag){ 692 } else if(isFirstFlag){
690 - tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum > 0 ? dgzjtcbcNum: deletebcNum},  
691 - {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum}); 693 + tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1 > 0 ? dgzjtcbcNum1: deletebcNum},
  694 + {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum1});
692 } else { 695 } else {
693 tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed, 'maxsj' : dataMap.wgfzhsjd[0].ed, 'order' : 'desc', 'deletebcNum' : deletebcNum - zgfqtcbcNum}, 696 tcbcgzA.push({'minsj': dataMap.wgfsjd[0].ed, 'maxsj' : dataMap.wgfzhsjd[0].ed, 'order' : 'desc', 'deletebcNum' : deletebcNum - zgfqtcbcNum},
694 {'minsj': dataMap.zgfzqsjd[0].st, 'maxsj' : dataMap.zgfzqsjd[0].ed, 'order' : 'asc','deletebcNum' : zgfqtcbcNum}); 697 {'minsj': dataMap.zgfzqsjd[0].st, 'maxsj' : dataMap.zgfzqsjd[0].ed, 'order' : 'asc','deletebcNum' : zgfqtcbcNum});
695 } 698 }
696 }*/ 699 }*/
697 - if(isLastFlag) {  
698 - tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgtcbcNum > 0 ? dgtcbcNum: deletebcNum});  
699 - } else if(isFirstFlag){  
700 - tcbcgzA.push({'minsj': dgzjsj, 'maxsj' : dataMap.wgfsjd[0].st, 'order' : 'asc', 'deletebcNum' : deletebcNum - dgzjtcbcNum > 0 ? dgzjtcbcNum: deletebcNum},  
701 - {'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed , 'order' : 'desc', 'deletebcNum' : deletebcNum - dgzjtcbcNum});  
702 - } else {  
703 - tcbcgzA.push({'minsj': dataMap.wgfzhsjd[0].st , 'maxsj' : dataMap.wgfzhsjd[0].ed, 'order' : 'desc', 'deletebcNum' : deletebcNum - zgfqtcbcNum},  
704 - {'minsj': dataMap.zgfzqsjd[0].st, 'maxsj' : dataMap.zgfzqsjd[0].ed, 'order' : 'asc','deletebcNum' : zgfqtcbcNum});  
705 - }  
706 } 700 }
707 } 701 }
708 // 剔除不在高峰时间段内的班次. 702 // 剔除不在高峰时间段内的班次.
709 spliceBc02(lpbc , tcbcgzA , dataMap , false); 703 spliceBc02(lpbc , tcbcgzA , dataMap , false);
  704 + lpbc.sort(function(x,y){return x.fcno-y.fcno});
710 rsultA = rsultA.concat(lpbc); 705 rsultA = rsultA.concat(lpbc);
711 return rsultA; 706 return rsultA;
712 }; 707 };
713 708
714 /** 709 /**
715 - * @description (TODO) 判断某路牌下是否存在末班车时间班次.  
716 - * @param arr 某路牌下的班次.  
717 - * @param smbcsjArr 首末班车时间点数组集合.  
718 - */  
719 - var lpDownIsHaveLastBc = function(arr , smbcsjArr) {  
720 - for(var a = 0 ; a < arr.length ; a++) {  
721 - for(var s = 0 ; s < smbcsjArr.length ; s++) {  
722 - if(arr[a].fcsj == smbcsjArr[s].jssj && dirDmToIndex(arr[a].xlDir) == s)  
723 - return true;  
724 - }  
725 - }  
726 - return false;  
727 - };  
728 - var lpDownIsHaveFirstBc = function(arr , smbcsjArr) {  
729 - for(var a = 0 ; a < arr.length ; a++) {  
730 - for(var s = 0 ; s < smbcsjArr.length ; s++) {  
731 - if(arr[a].fcsj == smbcsjArr[s].kssj && dirDmToIndex(arr[a].xlDir) == s)  
732 - return true;  
733 - }  
734 - }  
735 - return false;  
736 - };  
737 -  
738 - /**  
739 * @description (TODO) 根据定义规则剔除班次. 710 * @description (TODO) 根据定义规则剔除班次.
740 * @param arr 班次数组. 711 * @param arr 班次数组.
741 * @param tcbcgzA 剔除规则. 712 * @param tcbcgzA 剔除规则.
@@ -743,7 +714,8 @@ var scheduleInitialize = function () { @@ -743,7 +714,8 @@ var scheduleInitialize = function () {
743 * @param isfb 剔除过程中是否会产生分班. 714 * @param isfb 剔除过程中是否会产生分班.
744 */ 715 */
745 var spliceBc02 = function (arr , tcbcgzA , dataMap , isfb) { 716 var spliceBc02 = function (arr , tcbcgzA , dataMap , isfb) {
746 - for(var t = 0 ; t < tcbcgzA.length ; t++) { 717 + tcbcgzA.sort();
  718 + for(var t = tcbcgzA.length-1 ; t >=0 ; t--) {
747 if(tcbcgzA[t].deletebcNum <= 0) { 719 if(tcbcgzA[t].deletebcNum <= 0) {
748 continue; 720 continue;
749 } 721 }
@@ -752,22 +724,73 @@ var scheduleInitialize = function () { @@ -752,22 +724,73 @@ var scheduleInitialize = function () {
752 arr.sort(function(x,y){return x.fcno-y.fcno}); 724 arr.sort(function(x,y){return x.fcno-y.fcno});
753 else if(order == 'desc') 725 else if(order == 'desc')
754 arr.sort(function(m,n){return n.fcno-m.fcno}); 726 arr.sort(function(m,n){return n.fcno-m.fcno});
755 - for(var a = 0 ; a < arr.length ; a ++) {  
756 - var fcsj = DateTimeTool.getDateTime(arr[a].fcsj);  
757 - // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.  
758 - if(!isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) {  
759 - if(order == 'asc') {  
760 - if(a>0) {  
761 - arr[a-1].isfb = isfb ? 1 : 0;  
762 - arr[a-1].STOPTIME = 0; 727 + // 主站停车类型,分班班次只能主站停车
  728 + if(dataMap.isMasterStop) {
  729 + for(var a = 0 ; a < arr.length ; a ++) {
  730 + var fcsj = DateTimeTool.getDateTime(arr[a].fcsj);
  731 + // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.
  732 + if(!isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) {
  733 + // 判断早高峰两小时之后的剔除班次,是否需要考虑主站停车(默认需要考录,但是早高峰之后两小时内有需要剔除的班次,那就不考虑)
  734 + var sjdtype = true;
  735 + if(order == 'asc') {
  736 + if(a>0 && arr[a-1] != undefined && arr[a-1] != null) {
  737 + // 分班路牌需要主站停车
  738 + if(sjdtype && tcbcgzA[t].minsj >= dataMap.zgfsjd[0].ed && tcbcgzA[t].maxsj <= dataMap.wgfsjd[0].st && bcFun.dirDmToIndex(arr[a-1].xlDir) == dataMap.zzfx){
  739 + a++;
  740 + if(isPeakTimeScope(arr[a+tcbcgzA[t].deletebcNum].fcsj,dataMap))
  741 + tcbcgzA[t].deletebcNum--;
  742 + }
  743 + arr[a - 1].isfb = true;
  744 + arr[a - 1].STOPTIME = 0;
  745 + if(tcbcgzA[t].deletebcNum > 0) {
  746 + }
  747 + }
  748 + }else if(order == 'desc') {
  749 + var index_ = a + tcbcgzA[t].deletebcNum;
  750 + if(arr[index_] != undefined && arr[index_] != null){
  751 + // 分班路牌需要主站停车
  752 + if(tcbcgzA[t].minsj >= dataMap.zgfsjd[0].ed && tcbcgzA[t].maxsj <= dataMap.wgfsjd[0].st){
  753 + // 早高峰之后两小时内有需要剔除的班次标记(使标记失效)
  754 + sjdtype = false;
  755 + if(bcFun.dirDmToIndex(arr[index_].xlDir) == dataMap.zzfx) {
  756 + tcbcgzA[t].deletebcNum--;
  757 + index_--;
  758 + }
  759 + }
  760 + if(tcbcgzA[t].deletebcNum > 0){
  761 + arr[index_].STOPTIME = 0;
  762 + arr[index_].isfb = true;
  763 + }
  764 + }
763 } 765 }
764 - }else if(order == 'desc') {  
765 - var index_ = a + tcbcgzA[t].deletebcNum;  
766 - arr[index_].STOPTIME = 0;  
767 - arr[index_].isfb = isfb && a > 0 ? 1 : 0; 766 + arr.splice( a , tcbcgzA[t].deletebcNum);
  767 + break;
  768 + }
  769 + }
  770 +
  771 + } else {
  772 + // 双向停站没有停站限制
  773 + for(var a = 0 ; a < arr.length ; a ++) {
  774 + var fcsj = DateTimeTool.getDateTime(arr[a].fcsj);
  775 + // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.
  776 + if(!isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) {
  777 + if(order == 'asc') {
  778 + if(a>0 && arr[a-1] != undefined && arr[a-1] != null) {
  779 + // arr[a-1].isfb = isfb ? 1 : 0;
  780 + arr[a-1].isfb = true;
  781 + arr[a-1].STOPTIME = 0;
  782 + }
  783 + }else if(order == 'desc') {
  784 + var index_ = a + tcbcgzA[t].deletebcNum;
  785 + if(arr[index_] != undefined && arr[index_] != null){
  786 + arr[index_].STOPTIME = 0;
  787 + arr[index_].isfb = true;
  788 + // arr[index_].isfb = isfb && a > 0 ? 1 : 0;
  789 + }
  790 + }
  791 + arr.splice( a , tcbcgzA[t].deletebcNum);
  792 + break;
768 } 793 }
769 - arr.splice( a , tcbcgzA[t].deletebcNum);  
770 - break;  
771 } 794 }
772 } 795 }
773 } 796 }
@@ -837,16 +860,6 @@ var scheduleInitialize = function () { @@ -837,16 +860,6 @@ var scheduleInitialize = function () {
837 } 860 }
838 return parseFloat((sumWorkTime/60).toFixed(2)); 861 return parseFloat((sumWorkTime/60).toFixed(2));
839 }; 862 };
840 - // 切割出连班路牌  
841 - var cutCar = function(carListH,carListCache) {  
842 - for(var c=0; c<carListH.length; c++){  
843 - if(carListH[c].isfb) {  
844 - carListCache.push(carListH[c]);  
845 - carListH.splice(c,1);  
846 - cutCar(carListH,carListCache);  
847 - }  
848 - }  
849 - };  
850 var dirDmToIndex = function (str) { 863 var dirDmToIndex = function (str) {
851 if(str == 'relationshipGraph-up') 864 if(str == 'relationshipGraph-up')
852 return 0; 865 return 0;
@@ -893,6 +906,7 @@ var scheduleInitialize = function () { @@ -893,6 +906,7 @@ var scheduleInitialize = function () {
893 if(canCf.length>0 && canCf[canCf.length-1].isfb == 0) { // NEW,如果班次是分班班次,就不吃饭 906 if(canCf.length>0 && canCf[canCf.length-1].isfb == 0) { // NEW,如果班次是分班班次,就不吃饭
894 console.log('countTzsj:' + countTzsj + 'length:' + canCf.length); 907 console.log('countTzsj:' + countTzsj + 'length:' + canCf.length);
895 var fxDm = dirDmToIndex(canCf[canCf.length-1].xlDir); 908 var fxDm = dirDmToIndex(canCf[canCf.length-1].xlDir);
  909 + cfddDm = (cfddDm == 1 ? 0:1);
896 if (map.cfdd == "allYes") { // NEW,如果选择的吃饭地点是所有,则使用班次的方向作为吃饭班次的方向 910 if (map.cfdd == "allYes") { // NEW,如果选择的吃饭地点是所有,则使用班次的方向作为吃饭班次的方向
897 cfddDm = fxDm; 911 cfddDm = fxDm;
898 } 912 }
@@ -921,154 +935,12 @@ var scheduleInitialize = function () { @@ -921,154 +935,12 @@ var scheduleInitialize = function () {
921 } 935 }
922 } 936 }
923 }; 937 };
924 -  
925 - /**  
926 - * @description (TODO) 横向调整 调整停站时间.  
927 - * @param cara 路牌数组.  
928 - * @param tempa 所有的班次数组集合.  
929 - * @param dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].  
930 - *  
931 - * ******************************** 思路 *************************************************  
932 - * 第一步 等到每个路牌下的班次数组集合.  
933 - *  
934 - * 第二步 顺序排序每个路牌下的班次数组集合.  
935 - *  
936 - * 第三步 从第二个班次开始,用第二个班次的发车时间 - 上一个班次的到达时间 得到 上一个班次的停站时间.  
937 - *  
938 - * 第四步 修改上一个班次的停站时间.  
939 - *  
940 - * 修改停站时间规则:以行驶时间的10%-15% 为标准。  
941 - * 如果超出该范围。则以录入参数低谷最大停站间隙为准。  
942 - * 停站时间最大不能超过该停站时间。  
943 - * 高峰附近的班次的停站时间在离高峰最近一个班次的停站时间浮动范围【1-2】分钟。  
944 - *  
945 - * ****************************************************************************************  
946 - */  
947 - var resizeByPitStopTime = function(cara,tempa,dataMap) {  
948 - var cLen = cara.length,tLen = tempa.length;  
949 - if(cLen<= 0 || tLen<=0 || dataMap==null)  
950 - return;  
951 - // 定义低谷最大停站时间、行业标准最小、最大停站时间(行驶时间的10%~15%).  
952 - var dgmaxtzsj = dataMap.dgmaxtzsj,normmintzsj, normmaxtzsj;  
953 - for(var t = 0 ; t < cLen ; t++) {  
954 - // 定义当前路牌班次数组集合.  
955 - var sslpbcA = new Array();  
956 - for(var j =0 ; j < tLen ; j++) {  
957 - // 判断当期遍历的班次是否属于当前的路牌.如果是则添加到当前的路牌班次数组集合.  
958 - if(tempa[j].lpNo == cara[t].lpNo) {  
959 - tempa[j].fcint = DateTimeTool.getDateTime(tempa[j].fcsj).getTime();  
960 - sslpbcA.push(tempa[j]);  
961 - }  
962 - }  
963 - if(sslpbcA.length > 0) {  
964 - // 按发车时间顺序排序.  
965 - sslpbcA.sort(function(a,b){return a.fcint-b.fcint});  
966 - // 按照规则修改停站时间.  
967 - for(var r = 0 ; r < sslpbcA.length-1 ; r++) {  
968 - // test  
969 - //if(sslpbcA[r].bcType == 'cf') {  
970 - // alert('cf' + sslpbcA[r-1].fcsj);  
971 - //}  
972 - // 定义上一个班次的发车时间、当前班次的到达时间、发车时间.  
973 - var sgbcfcsj = DateTimeTool.getDateTime(sslpbcA[r+1].fcsj),  
974 - dqbcddsj = DateTimeTool.getDateTime(sslpbcA[r].ARRIVALTIME),  
975 - dqbcfcsj = DateTimeTool.getDateTime(sslpbcA[r].fcsj);  
976 - // 定义当前班次方向下标代码[0代表上行;1代表下行].  
977 - var cctag = dirDmToIndex(sslpbcA[r].xlDir); // dataMap.smbcsjArr  
978 - // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.)  
979 - var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000);  
980 - // 定义是否高峰  
981 - var tt_flag = isPeakTimeScope(dqbcfcsj , dataMap);  
982 - // 获取行驶时间.  
983 - var xxsj = getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , dqbcfcsj,  
984 - dataMap.pcxssjArr , dataMap.gfxxsjArr ,  
985 - dirDmToIndex(sslpbcA[r].xlDir));  
986 - normmintzsj = xxsj*0.1;  
987 - normmaxtzsj = xxsj*0.15;  
988 - var flag = false;  
989 -  
990 - // 如果小于零  
991 - if(dxmin < 0 && sslpbcA[r].isfb ==0) {  
992 - // 根据不同时段的停站时间.重新赋值停站时间.  
993 - if(sslpbcA[r].bcType=='normal' && sslpbcA[r+1].bcType =='normal')  
994 - //dxmin = tt_flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];  
995 - dxmin = 1;  
996 - else  
997 - dxmin = 0;  
998 - flag = true;  
999 - }else if(dxmin==0){  
1000 - if (sslpbcA[r].bcType == 'cf') { // 如果是吃饭班次,停站为0  
1001 - dxmin = 0;  
1002 - } else {  
1003 - // 这里区分,如果下一个班次是吃饭班次,停站为0  
1004 - if (sslpbcA[r + 1].bcType=='cf') {  
1005 - dxmin = 0;  
1006 - } else { // 否则使用最小停站时间  
1007 - dxmin = normmintzsj;  
1008 - }  
1009 - }  
1010 -  
1011 - flag = true;  
1012 - }else {  
1013 - // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.  
1014 - if(dxmin >= dgmaxtzsj && dxmin < 180 && sslpbcA[r].isfb==0) {  
1015 - dxmin = dgmaxtzsj;  
1016 - flag = true;  
1017 - // 如果大于零 并且 小于等于行业标准的最小停站时间  
1018 - }else if(dxmin > 0 && dxmin <= normmintzsj ) {  
1019 - // dxmin = dxmin;  
1020 - flag = true;  
1021 - // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间  
1022 - }else if(dxmin > normmintzsj && dxmin <= normmaxtzsj ) {  
1023 - // dxmin = dxmin;  
1024 - flag = true;  
1025 - // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间  
1026 - }else if(dxmin > normmaxtzsj && dxmin < dgmaxtzsj ) {  
1027 - // dxmin = dxmin;  
1028 - flag = true;  
1029 - }else if (dxmin >= 180){  
1030 - dxmin = 0;  
1031 - }  
1032 - }  
1033 - if(flag) {  
1034 - if(!isDirSmbc(dirDmToIndex(sslpbcA[r+1].xlDir) , sslpbcA[r+1].fcsj , dataMap)) {  
1035 - // 修改当前班次的停站时间.  
1036 - sslpbcA[r].STOPTIME = parseInt(dxmin) ;  
1037 - // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.  
1038 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);  
1039 - // 修改下一个班次的发车时间.  
1040 - sslpbcA[r+1].fcsj = DateTimeTool.getHHmmStr(dqbcddsj);  
1041 - // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.  
1042 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);  
1043 - // 修改下一个班次的到达时间.  
1044 - sslpbcA[r+1].ARRIVALTIME = DateTimeTool.getHHmmStr(dqbcddsj);  
1045 - }else {  
1046 - if(r>0) {  
1047 - // 修改当前班次的停站时间.  
1048 - sslpbcA[r].STOPTIME = parseInt(dxmin) ;  
1049 - sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].STOPTIME);  
1050 - sslpbcA[r].ARRIVALTIME = DateTimeTool.getHHmmStr(sgbcfcsj);  
1051 - sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].bcsj);  
1052 - sslpbcA[r].fcsj = DateTimeTool.getHHmmStr(sgbcfcsj);  
1053 - sslpbcA[r-1].STOPTIME = parseInt( ( sgbcfcsj - DateTimeTool.getDateTime(sslpbcA[r-1].ARRIVALTIME))/60000);  
1054 - }  
1055 - }  
1056 - }  
1057 - }  
1058 - }  
1059 - }  
1060 - };  
1061 -  
1062 - var isDirSmbc = function(dirDm , fcsj , dataMap) {  
1063 - var falg = false;  
1064 - if(fcsj == dataMap.smbcsjArr[dirDm].kssj || fcsj == dataMap.smbcsjArr[dirDm].jssj)  
1065 - falg = true;  
1066 - return falg;  
1067 - };  
1068 - 938 +
1069 return { 939 return {
1070 scheduleInit : scheduleInit, 940 scheduleInit : scheduleInit,
1071 - judgeFCJX : judgeFCJX,  
1072 - judgeTZSJ : judgeTZSJ 941 + judgeFCJX : judgeFCJX, //判断发车间隙
  942 + judgeTZSJ : judgeTZSJ, //判断停站时间
  943 + judgeXSSJ : judgeXSSJ, //判断行驶时间
  944 + isPeakTimeScope : isPeakTimeScope //判断是否高峰
1073 } 945 }
1074 }(); 946 }();
1075 \ No newline at end of file 947 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/v2_2/InternalScheduleObj.js
@@ -565,7 +565,7 @@ var InternalScheduleObj_v2_2 = (function() { @@ -565,7 +565,7 @@ var InternalScheduleObj_v2_2 = (function() {
565 } 565 }
566 } 566 }
567 567
568 - // // 修正上标线副站方向班次(一圈的结束班次,也是下一圈的开始班次)以及后续所有班次 568 + // 修正上标线副站方向班次(一圈的结束班次,也是下一圈的开始班次)以及后续所有班次
569 iNextBcInterval = aBcInterval[i - 1].iFcInterval; 569 iNextBcInterval = aBcInterval[i - 1].iFcInterval;
570 _modifyTimeNextGroupIndex = this._iFirstSlaveBcGroupIndex + 1; 570 _modifyTimeNextGroupIndex = this._iFirstSlaveBcGroupIndex + 1;
571 _modifyTimeNextBcIndex = this._iFirstSlaveBcIndex; 571 _modifyTimeNextBcIndex = this._iFirstSlaveBcIndex;
@@ -877,14 +877,58 @@ var InternalScheduleObj_v2_2 = (function() { @@ -877,14 +877,58 @@ var InternalScheduleObj_v2_2 = (function() {
877 * 调整发车间隔。 877 * 调整发车间隔。
878 */ 878 */
879 InternalScheduleObj.prototype.fnAdjustHeadway = function() { 879 InternalScheduleObj.prototype.fnAdjustHeadway = function() {
880 - // TODO:572测试,尝试调整第6圈  
881 - StrategyUtils_v2_2.sFn("ADJUST_HEADWAY_2")(  
882 - this, this._oParam,  
883 - 6, 0,  
884 - 6, 1,  
885 - 0.2  
886 - );  
887 - // TODO:843测试 880 + // // TODO:572测试,尝试调整第6圈
  881 + // StrategyUtils_v2_2.sFn("ADJUST_HEADWAY_2")(
  882 + // this, this._oParam,
  883 + // 6, 0,
  884 + // 6, 1,
  885 + // 0.2
  886 + // );
  887 + // // TODO:843测试
  888 + // StrategyUtils_v2_2.sFn("ADJUST_HEADWAY_2")(
  889 + // this, this._oParam,
  890 + // 3, 0,
  891 + // 3, 1,
  892 + // 0.2
  893 + // );
  894 +
  895 + var i;
  896 + var bQIsAnotherWay; // 圈的第一个班次是否副站
  897 + if (this._qIsUp) {
  898 + if (this._oParam.getDirAnotherWayStop()) {
  899 + bQIsAnotherWay = true;
  900 + } else {
  901 + bQIsAnotherWay = false;
  902 + }
  903 + } else {
  904 + if (this._oParam.getDirAnotherWayStop()) {
  905 + bQIsAnotherWay = false;
  906 + } else {
  907 + bQIsAnotherWay = true;
  908 + }
  909 + }
  910 +
  911 + if (this._qIsUp == bQIsAnotherWay) {
  912 + for (i = 0; i < this._qCount; i++) {
  913 + StrategyUtils_v2_2.sFn("ADJUST_HEADWAY_2")(
  914 + this, this._oParam,
  915 + i, 0,
  916 + i, 1,
  917 + 0.2
  918 + );
  919 + }
  920 + } else { // 圈的第一个班次是主站班次
  921 + for (i = 0; i < this._qCount; i++) {
  922 + if ((i + 1) < this._qCount) {
  923 + StrategyUtils_v2_2.sFn("ADJUST_HEADWAY_2")(
  924 + this, this._oParam,
  925 + i, 1,
  926 + (i + 1), 0,
  927 + 0.2
  928 + );
  929 + }
  930 + }
  931 + }
888 932
889 933
890 }; 934 };
@@ -931,7 +975,7 @@ var InternalScheduleObj_v2_2 = (function() { @@ -931,7 +975,7 @@ var InternalScheduleObj_v2_2 = (function() {
931 } 975 }
932 } 976 }
933 977
934 - // 2、调整吃饭停站时间 978 + // 2、调整吃饭所需的停站时间
935 StrategyUtils_v2_2.sFn("ADJUST_HEADWAY_3_EAT")( 979 StrategyUtils_v2_2.sFn("ADJUST_HEADWAY_3_EAT")(
936 this, this._oParam 980 this, this._oParam
937 ); 981 );
src/main/resources/static/pages/base/timesmodel/js/v2_2/Main_v2_2_ExcelObj.js 0 → 100644
  1 +/**
  2 + * v2_2版本时刻表excel对象。
  3 + */
  4 +var Main_v2_2_ExcelObj = (function() {
  5 + // html5导出下载文件方法
  6 + var _fnDownloadFile = function(data, mimeType, fileName) {
  7 + var success = false;
  8 + var blob = new Blob([data], { type: mimeType });
  9 + try {
  10 + if (navigator.msSaveBlob)
  11 + navigator.msSaveBlob(blob, fileName);
  12 + else {
  13 + // Try using other saveBlob implementations, if available
  14 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  15 + if (saveBlob === undefined) throw "Not supported";
  16 + saveBlob(blob, fileName);
  17 + }
  18 + success = true;
  19 + } catch (ex) {
  20 + console.log("saveBlob method failed with the following exception:");
  21 + console.log(ex);
  22 + }
  23 +
  24 + if (!success) {
  25 + // Get the blob url creator
  26 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  27 + if (urlCreator) {
  28 + // Try to use a download link
  29 + var link = document.createElement('a');
  30 + if ('download' in link) {
  31 + // Try to simulate a click
  32 + try {
  33 + // Prepare a blob URL
  34 + var url = urlCreator.createObjectURL(blob);
  35 + link.setAttribute('href', url);
  36 +
  37 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  38 + link.setAttribute("download", fileName);
  39 +
  40 + // Simulate clicking the download link
  41 + var event = document.createEvent('MouseEvents');
  42 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  43 + link.dispatchEvent(event);
  44 + success = true;
  45 +
  46 + } catch (ex) {
  47 + console.log("Download link method with simulated click failed with the following exception:");
  48 + console.log(ex);
  49 + }
  50 + }
  51 +
  52 + if (!success) {
  53 + // Fallback to window.location method
  54 + try {
  55 + // Prepare a blob URL
  56 + // Use application/octet-stream when using window.location to force download
  57 + var url = urlCreator.createObjectURL(blob);
  58 + window.location = url;
  59 + console.log("Download link method with window.location succeeded");
  60 + success = true;
  61 + } catch (ex) {
  62 + console.log("Download link method with window.location failed with the following exception:");
  63 + console.log(ex);
  64 + }
  65 + }
  66 + }
  67 + }
  68 +
  69 + if (!success) {
  70 + // Fallback to window.open method
  71 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  72 + window.open("", '_blank', '');
  73 + }
  74 + };
  75 +
  76 + // 计算导出参数sheet数据。
  77 + var _fnCalcuExportParam_sheet = function(_paramObj) {
  78 + return [
  79 + {'paramItem' : '上行首班时间', 'paramValue' : _paramObj.getUpFirstDTimeObj().format("HH:mm")},
  80 + {'paramItem' : '上行末班时间', 'paramValue' : _paramObj.getUpLastDtimeObj().format("HH:mm")},
  81 + {'paramItem' : '下行首班时间', 'paramValue' : _paramObj.getDownFirstDTimeObj().format("HH:mm")},
  82 + {'paramItem' : '下行末班时间', 'paramValue' : _paramObj.getDownLastDTimeObj().format("HH:mm")},
  83 + {'paramItem' : '早高峰开始时间', 'paramValue' : _paramObj.getMPeakStartTimeObj().format("HH:mm")},
  84 + {'paramItem' : '早高峰结束时间', 'paramValue' : _paramObj.getMPeakEndTimeObj().format("HH:mm")},
  85 + {'paramItem' : '晚高峰开始时间', 'paramValue' : _paramObj.getEPeakStartTimeObj().format("HH:mm")},
  86 + {'paramItem' : '晚高峰结束时间', 'paramValue' : _paramObj.getEPeakEndTimeObj().format("HH:mm")},
  87 + {'paramItem' : '上行进场时间', 'paramValue' : _paramObj.getUpInTime()},
  88 + {'paramItem' : '上行出场时间', 'paramValue' : _paramObj.getUpOutTime()},
  89 + {'paramItem' : '下行进场时间', 'paramValue' : _paramObj.getDownInTime()},
  90 + {'paramItem' : '下行出场时间', 'paramValue' : _paramObj.getDownOutTime()},
  91 + {'paramItem' : '早高峰上行时间', 'paramValue' : _paramObj.getUpMPeakTime()},
  92 + {'paramItem' : '早高峰下行时间', 'paramValue' : _paramObj.getDownMPeakTime()},
  93 + {'paramItem' : '晚高峰上行时间', 'paramValue' : _paramObj.getUpEPeakTime()},
  94 + {'paramItem' : '晚高峰下行时间', 'paramValue' : _paramObj.getDownEPeakTime()},
  95 + {'paramItem' : '低谷上行时间', 'paramValue' : _paramObj.getUpTroughTime()},
  96 + {'paramItem' : '低谷下行时间', 'paramValue' : _paramObj.getDownTroughTime()},
  97 + {'paramItem' : '线路规划类型', 'paramValue' : "双向"},
  98 + {'paramItem' : '吃饭地点', 'paramValue' : _paramObj.fnIsEat() ? (_paramObj.fnIsBothEat() ? "上下行" : (_paramObj.fnIsUpEat() ? "上行" : "下行")) : "不吃饭"},
  99 + {'paramItem' : '早晚例行保养', 'paramValue' : _paramObj.getLbTime()},
  100 + {'paramItem' : '停车场', 'paramValue' : _paramObj.getTccId()},
  101 + {'paramItem' : '工作餐午餐时间', 'paramValue' : _paramObj.fnGetLunchTime()},
  102 + {'paramItem' : '工作餐晚餐时间', 'paramValue' : _paramObj.fnGetDinnerTime()},
  103 + {'paramItem' : '早高峰发车间隔', 'paramValue' : "[" + _paramObj.getMPeakMinFcjx() + "," + _paramObj.getMPeakMaxFcjx() + "]"},
  104 + {'paramItem' : '晚高峰发车间隔', 'paramValue' : "[" + _paramObj.getEPeakMinFcjx() + "," + _paramObj.getEPeakMaxFcjx() + "]"},
  105 + {'paramItem' : '低谷发车间隔', 'paramValue' : "[" + _paramObj.getTroughMinFcjx() + "," + _paramObj.getTroughMaxFcjx() + "]"},
  106 + {'paramItem' : '建议加班路牌数', 'paramValue' : _paramObj.getJBLpes()},
  107 + {'paramItem' : '停站类型', 'paramValue' : _paramObj.isTwoWayStop() ? "双向停站" : (_paramObj.isUpOneWayStop() ? "上行主站" : "下行主站") },
  108 + {'paramItem' : '建议高峰配车数', 'paramValue' : _paramObj.getAdvicePeakClzs()}
  109 + ]
  110 + };
  111 +
  112 + // 计算班次统计数据sheet数据。
  113 + var _fnCalcuExportStatInfo_sheet = function(aBc, oParam) {
  114 + var countBc = 0, // 总班次
  115 + serviceBc = 0, // 营运班次
  116 + jcbc = 0, // 进场总班次.
  117 + ccbc = 0, // 出场总班次.
  118 + cfbc = 0, // 吃饭总班次.
  119 + zwlbbc = 0, // 早晚例保总班次.
  120 + countGs = 0.0, // 总工时
  121 + servicesj = 0, // 营运班次总时间
  122 + jcsj = 0.0, // 进场总时间.
  123 + ccsj = 0.0, // 出场总时间.
  124 + cfsj = 0.0, // 吃饭总时间.
  125 + zwlbsj = 0.0, // 早晚例保总时间.
  126 + ksBc = 0, // 空驶班次
  127 + serviceLc = 0.0, // 营运里程
  128 + ksLc = 0.0, // 空驶里程
  129 + avgTzjx = 0.0, // 平均停站间隙
  130 + gfServiceBc = 0, // 高峰营运班次
  131 + dgServiceBc = 0, // 低谷营运班次
  132 + gfAvgTzjx = 0.0, // 高峰平均停站间隙
  133 + dgAvgTzjx = 0.0; // 低谷平均停站间隙
  134 +
  135 + var i;
  136 + var oBc;
  137 + for (i = 0; i < aBc.length; i++) {
  138 + oBc = aBc[i];
  139 +
  140 + if (oBc.bcsj > 0) {
  141 + countBc = countBc + 1;
  142 + countGs = countGs + oBc.STOPTIME + oBc.bcsj;
  143 + if (oParam.isTroughBc(oParam.toTimeObj(oBc.fcsj))) {
  144 + if (oBc.bcType == "normal") {
  145 + dgServiceBc = dgServiceBc + 1;
  146 + dgAvgTzjx = dgAvgTzjx + oBc.STOPTIME;
  147 + }
  148 + } else {
  149 + if (oBc.bcType == "normal") {
  150 + gfServiceBc = gfServiceBc + 1;
  151 + gfAvgTzjx = gfAvgTzjx + oBc.STOPTIME;
  152 + }
  153 + }
  154 +
  155 + if (oBc.bcType == "normal" || oBc.bcType == "cf") {
  156 + serviceBc = serviceBc + 1;
  157 + serviceLc = serviceLc + oBc.jhlc;
  158 + servicesj = servicesj + oBc.bcsj;
  159 + avgTzjx = avgTzjx + oBc.STOPTIME;
  160 +
  161 + if (oBc.bcType == "cf") {
  162 + cfbc = cfbc + 1;
  163 + cfsj = cfsj + oBc.bcsj;
  164 + }
  165 + } else if (oBc.bcType == "in") {
  166 + jcbc = jcbc + 1;
  167 + jcsj = jcsj + oBc.bcsj;
  168 + } else if (oBc.bcType == "out") {
  169 + ccbc = ccbc + 1;
  170 + ccsj = ccsj + oBc.bcsj;
  171 + } else if (oBc.bcType == "bd") {
  172 + zwlbbc = zwlbbc + 1;
  173 + zwlbsj = zwlbsj + oBc.bcsj;
  174 + } else if (oBc.bcType == "lc") {
  175 + zwlbbc = zwlbbc + 1;
  176 + zwlbsj = zwlbsj + oBc.bcsj;
  177 + }
  178 + }
  179 + }
  180 +
  181 + dgAvgTzjx = dgAvgTzjx / dgServiceBc;
  182 + gfAvgTzjx = gfAvgTzjx / gfServiceBc;
  183 + avgTzjx = avgTzjx / dgServiceBc;
  184 +
  185 + return [
  186 + {'statItem': '总班次(包括进出场、吃饭时间、早晚例保、营运且班次时间大于零的班次)', 'statValue': countBc},
  187 + {'statItem': '进场总班次(包括进场且班次时间大于零的班次)', 'statValue': jcbc},
  188 + {'statItem': '出场总班次(包括进场且班次时间大于零的班次)', 'statValue': ccbc},
  189 + {'statItem': '吃饭总班次(包括吃饭且班次时间大于零的班次)', 'statValue': cfbc},
  190 + {'statItem': '早晚例保总班次(包括早晚例保且时间大于零的班次)', 'statValue': zwlbbc},
  191 + {'statItem': '营运总班次(包括正常、区间、放大站且班次时间大于零班次)','statValue': serviceBc},
  192 + {'statItem': '进场总时间(包括进场班次且班次时间大于零)', 'statValue': jcsj/60},
  193 + {'statItem': '出场总时间(包括进场班次且班次时间大于零)', 'statValue': ccsj/60},
  194 + {'statItem': '吃饭总时间(包括吃饭班次且班次时间大于零)', 'statValue': cfsj/60},
  195 + {'statItem': '早晚例保总时间(包括早晚例保班次且时间大于零的)', 'statValue': zwlbsj/60},
  196 + {'statItem': '营运班次总时间(包括正常、区间、放大站且班次时间大于零)', 'statValue': servicesj/60},
  197 + {'statItem': '总工时(包括进出场、吃饭时间、早晚例保、营运班次时间)', 'statValue': countGs/60},
  198 + {'statItem': '空驶班次(包括直放班次)', 'statValue': ksBc},
  199 + {'statItem': '营运里程(包括正常、区间、放大站里程)', 'statValue': serviceLc},
  200 + {'statItem': '空驶里程(包括直放里程)', 'statValue': ksLc},
  201 + {'statItem': '平均停站时间(营运班次停站时间总和/营运总班次)', 'statValue': avgTzjx},
  202 + {'statItem': '高峰营运班次(包括早晚高峰时段的正常、区间、放大站班次)', 'statValue': gfServiceBc},
  203 + {'statItem': '低谷营运班次(包括低谷时段的正常、区间、放大站班次)', 'statValue': dgServiceBc},
  204 + {'statItem': '高峰平均停站间隙(高峰营运班次停站时间总和/高峰营运班次总和)', 'statValue': gfAvgTzjx},
  205 + {'statItem': '低谷平均停站间隙(低谷营运班次停站时间总和/低谷营运班次总和)', 'statValue': dgAvgTzjx},
  206 + {'statItem': '综合评估', 'statValue': 3}
  207 + ];
  208 +
  209 + };
  210 +
  211 + /**
  212 + * 内部计算Excel班次方法1,
  213 + * 这里是假设班次按照从早到晚排序,并且路牌也是从小到大排序。
  214 + * @param aExcelLp excel显示用路牌
  215 + * @param aGanttBc 甘特图班次列表
  216 + * @param oParam 参数对象
  217 + * @param bQIsUp 每一圈是上行开始还是下行开始
  218 + * @private
  219 + */
  220 + function InternalCalcuExcelBc1(aExcelLp, aGanttBc, oParam, bQIsUp) {
  221 + this._aExcelLp = aExcelLp;
  222 + this._oParam = oParam;
  223 + this._bQIsUp = bQIsUp;
  224 +
  225 + this._iUpGroupIndex = 0;
  226 + this._iDownGroupIndex = 0;
  227 +
  228 + // {"路牌名字":{"isFlag": 是否为标记班次(表示扫描过但是没有班次对象),"normal":正常班次}}
  229 + this._oLpGroupNormalGanttBc = {};
  230 + // [吃饭类型班次]
  231 + this._aLpGroupCfGanttBc = [];
  232 +
  233 + // TODO:其他类型的班次再议
  234 +
  235 + // 计算上行gantt班次列表,下行gantt班次列表,并排序
  236 + var i;
  237 + var oGanttBc;
  238 + this._aUpGanttBc = [];
  239 + this._aDownGanttBc = [];
  240 + for (i = 0; i < aGanttBc.length; i++) {
  241 + oGanttBc = aGanttBc[i];
  242 + if (oGanttBc.xlDir == "relationshipGraph-up") {
  243 + this._aUpGanttBc.push(oGanttBc);
  244 + } else {
  245 + this._aDownGanttBc.push(oGanttBc);
  246 + }
  247 + }
  248 + // 排序班次
  249 + this._fnSortBc(this._aUpGanttBc);
  250 + this._fnSortBc(this._aDownGanttBc);
  251 +
  252 + if (this._aUpGanttBc.length == 0) {
  253 + throw "没有上行班次,不能导出数据!";
  254 + }
  255 + if (this._aDownGanttBc.length == 0) {
  256 + throw "没有下行班次,不能导出数据!"
  257 + }
  258 +
  259 + }
  260 +
  261 + //----------------------- 外部方法 -----------------------//
  262 + InternalCalcuExcelBc1.prototype.fnGenerateExcelLpBcList = function() {
  263 + // 计算Excel班次
  264 + this._calcuExcelBc();
  265 +
  266 + // 设置路牌圈数
  267 + var iGroupCount = this._iUpGroupIndex > this._iDownGroupIndex ?
  268 + (this._iUpGroupIndex + 1) : (this._iDownGroupIndex + 1);
  269 +
  270 + // 设置路由id
  271 + var oUpNormalBc;
  272 + var oDownNormalBc;
  273 + var i;
  274 + for (i = 0; i < this._aUpGanttBc.length; i++) {
  275 + if (this._aUpGanttBc[i].bcType == "normal") {
  276 + oUpNormalBc = this._aUpGanttBc[i];
  277 + break;
  278 + }
  279 + }
  280 + for (i = 0; i < this._aDownGanttBc.length; i++) {
  281 + if (this._aDownGanttBc[i].bcType == "normal") {
  282 + oDownNormalBc = this._aDownGanttBc[i];
  283 + break;
  284 + }
  285 + }
  286 +
  287 + var stationRouteId1;
  288 + var stationRouteId2;
  289 + if (this._bQIsUp) {
  290 + stationRouteId1 = oUpNormalBc.qdz;
  291 + stationRouteId2 = oDownNormalBc.qdz;
  292 + } else {
  293 + stationRouteId1 = oDownNormalBc.qdz;
  294 + stationRouteId2 = oUpNormalBc.qdz;
  295 + }
  296 +
  297 + var oExcelLp;
  298 + for (i = 0; i < this._aExcelLp.length; i++) {
  299 + oExcelLp = this._aExcelLp[i];
  300 + oExcelLp.groupCount = iGroupCount;
  301 + oExcelLp.stationRouteId1 = stationRouteId1;
  302 + oExcelLp.stationRouteId2 = stationRouteId2;
  303 +
  304 + // 删除临时参数
  305 + delete oExcelLp["_bcObjGroupList"];
  306 + }
  307 +
  308 + // 路牌数据统计
  309 + var j = 0;
  310 + var aLpBc;
  311 + var oLpBc;
  312 + for (i = 0; i < this._aExcelLp.length; i++) {
  313 + oExcelLp = this._aExcelLp[i];
  314 + aLpBc = oExcelLp.bcObjList;
  315 + for (j = 0; j < aLpBc.length; j++) {
  316 + oLpBc = aLpBc[j];
  317 + if (oLpBc.bcType == "normal") {
  318 + oExcelLp.zlc = oExcelLp.zlc +
  319 + oLpBc._bclc; // 总里程
  320 + oExcelLp.yylc = oExcelLp.yylc +
  321 + oLpBc._bclc; // 营运里程
  322 + oExcelLp.yygs = oExcelLp.yygs +
  323 + oLpBc.bcsj + // 班次时间
  324 + oLpBc.ssj + // 停站时间
  325 + oLpBc.eatsj; // 吃饭时间
  326 + oExcelLp.yybc = oExcelLp.yybc + 1;
  327 +
  328 + oExcelLp.zgs = oExcelLp.zgs +
  329 + oLpBc.bcsj + // 班次时间
  330 + oLpBc.ssj + // 停站时间
  331 + oLpBc.eatsj; // 吃饭时间
  332 + oExcelLp.zbc = oExcelLp.zbc + 1;
  333 + } else if (
  334 + oLpBc.bcType == "bd" ||
  335 + oLpBc.bcType == "out" ||
  336 + oLpBc.bcType == "in" ||
  337 + oLpBc.bcType == "lc") {
  338 + oExcelLp.kslc = oExcelLp.kslc +
  339 + oLpBc._bclc; // 里程
  340 + oExcelLp.zlc = oExcelLp.zlc +
  341 + oLpBc._bclc; // 里程
  342 + oExcelLp.zgs = oExcelLp.zgs +
  343 + oLpBc.bcsj + // 班次时间
  344 + oLpBc.ssj; // 停站时间
  345 +
  346 + if (oLpBc.bcType != "bd" && oLpBc.bcType != "lc") {
  347 + oExcelLp.zbc = oExcelLp.zbc + 1;
  348 + }
  349 +
  350 + }
  351 +
  352 + delete oLpBc._bclc; // 删除临时变量
  353 +
  354 + }
  355 + }
  356 +
  357 +
  358 +
  359 + return this._aExcelLp;
  360 + };
  361 +
  362 + //----------------------- 内部方法 ------------------------//
  363 + // 排序班次
  364 + InternalCalcuExcelBc1.prototype._fnSortBc = function(aGanttBc) {
  365 + var oParam = this._oParam;
  366 + aGanttBc.sort(function (o1, o2) { // 时间从早到晚排序
  367 + var o1_fcsj;
  368 + var o2_fcsj;
  369 + if (o1.fcsj.indexOf("00:") >= 0) { // 大于00点是第二天
  370 + o1_fcsj = oParam.toTimeObj(o1.fcsj).add(1, "d");
  371 + } else {
  372 + o1_fcsj = oParam.toTimeObj(o1.fcsj);
  373 + }
  374 +
  375 + if (o2.fcsj.indexOf("00:") >= 0) { // 大于00点是第二天
  376 + o2_fcsj = oParam.toTimeObj(o2.fcsj).add(1, "d");
  377 + } else {
  378 + o2_fcsj = oParam.toTimeObj(o2.fcsj);
  379 + }
  380 +
  381 +
  382 + if (o1_fcsj.isBefore(o2_fcsj)) {
  383 + return -1;
  384 + } else {
  385 + return 1;
  386 + }
  387 + });
  388 + // 此处假设班次按照从早倒晚排,每一圈按照路牌顺序排
  389 +
  390 + // TODO:如果发生同一圈路牌交叉发车,不是按照路牌排序的,导出时有问题,再议
  391 + };
  392 +
  393 + InternalCalcuExcelBc1.prototype._calcuExcelBc = function() {
  394 + var i = 0;
  395 + var j = 0;
  396 +
  397 + var aUpBc;
  398 + var aDownBc;
  399 + if (this._bQIsUp) {
  400 + aUpBc = this._aUpGanttBc;
  401 + aDownBc = this._aDownGanttBc;
  402 + } else {
  403 + aUpBc = this._aDownGanttBc;
  404 + aDownBc = this._aUpGanttBc;
  405 + }
  406 +
  407 + do {
  408 + i = this._calcuExcelBcPerGroup(this._bQIsUp, i);
  409 + j = this._calcuExcelBcPerGroup(!this._bQIsUp, j);
  410 + } while(i < aUpBc.length || j < aDownBc.length);
  411 +
  412 + // 重新计算报到,出场,进场,离场班次的圈,班次索引
  413 + this._resetBdOutInLcBcGroup();
  414 +
  415 + };
  416 +
  417 + /**
  418 + * 重新计算Excel显示班次(计算1圈)。
  419 + * @param bIsUp 是否上行
  420 + * @param iBcIndex 班次索引
  421 + * @return 下一次计算索引
  422 + */
  423 + InternalCalcuExcelBc1.prototype._calcuExcelBcPerGroup = function(bIsUp, iBcIndex) {
  424 + this._oLpGroupNormalGanttBc = {};
  425 +
  426 + var i;
  427 + var j = 0;
  428 + var oExcelLp;
  429 + var oGanttBc;
  430 + var aGBc = bIsUp ? this._aUpGanttBc : this._aDownGanttBc;
  431 +
  432 + for (i = iBcIndex; i < aGBc.length; i++) {
  433 + oGanttBc = aGBc[i];
  434 +
  435 + // 添加到场,出场,进场,离场班次
  436 + this._addBdOutInLcBc(oGanttBc, bIsUp);
  437 +
  438 + while(j < this._aExcelLp.length) {
  439 + oExcelLp = this._aExcelLp[j];
  440 +
  441 + if (oGanttBc.bcType == "cf") { // 吃饭班次
  442 + this._aLpGroupCfGanttBc.push(oGanttBc);
  443 + break;
  444 + } else if (oGanttBc.bcType == "normal") { // 正常班次
  445 + this._oLpGroupNormalGanttBc[oExcelLp.lpname] = {
  446 + "isFlag": true, "normal": null
  447 + };
  448 + if (oExcelLp.lpname == oGanttBc.lpName) {
  449 + this._oLpGroupNormalGanttBc[oExcelLp.lpname].isFlag = false;
  450 + this._oLpGroupNormalGanttBc[oExcelLp.lpname].normal = oGanttBc;
  451 + j++;
  452 + break;
  453 + } else {
  454 + j++;
  455 + }
  456 + } else {
  457 +
  458 + break;
  459 + }
  460 +
  461 + }
  462 +
  463 + if (j == this._aExcelLp.length) { // 完整的一圈处理
  464 + this._resetCalcuGroup(bIsUp);
  465 + j = 0;
  466 + if (oGanttBc.lpName !=
  467 + this._aExcelLp[this._aExcelLp.length - 1].lpname) {
  468 + i--;
  469 + break;
  470 +
  471 + }
  472 +
  473 + break;
  474 + }
  475 +
  476 + }
  477 +
  478 + // 最后一圈reset一下
  479 + if (j > 0) {
  480 + this._resetCalcuGroup(bIsUp);
  481 + }
  482 + return i + 1;
  483 +
  484 + };
  485 +
  486 + InternalCalcuExcelBc1.prototype._resetCalcuGroup = function(bIsUp) {
  487 + // 判定是否开始分班,添加圈数
  488 + if (bIsUp) {
  489 + if (this._fnIsFBcQ(bIsUp)) {
  490 + this._iUpGroupIndex += 1;
  491 + this._iDownGroupIndex += 1;
  492 + }
  493 + } else {
  494 + if (this._fnIsFBcQ(!bIsUp)) {
  495 + this._iUpGroupIndex += 1;
  496 + this._iDownGroupIndex += 1;
  497 + }
  498 + }
  499 +
  500 + // 重置计算圈及班次
  501 + var oExcelLp;
  502 + var oGroupGanttNormalBc;
  503 + var oGroupGanttEatBc;
  504 + for (var i = 0; i < this._aExcelLp.length; i++) {
  505 + oExcelLp = this._aExcelLp[i];
  506 + if (this._oLpGroupNormalGanttBc[oExcelLp.lpname]) {
  507 + if (!this._oLpGroupNormalGanttBc[oExcelLp.lpname].isFlag) { // 非标记班次
  508 + oGroupGanttNormalBc = this._oLpGroupNormalGanttBc[oExcelLp.lpname].normal;
  509 +
  510 + // 获取吃饭班次
  511 + oGroupGanttEatBc = null;
  512 + if (this._aLpGroupCfGanttBc.length > 0) {
  513 + if (this._aLpGroupCfGanttBc[0].lpName == oExcelLp.lpname) {
  514 + if (this._oParam.toTimeObj(this._aLpGroupCfGanttBc[0].fcsj).isBefore(
  515 + this._oParam.toTimeObj(oGroupGanttNormalBc.fcsj))) {
  516 + oGroupGanttEatBc = this._aLpGroupCfGanttBc.shift();
  517 + }
  518 + }
  519 + }
  520 +
  521 + oExcelLp.bcObjList.push({
  522 + "bcsj": oGroupGanttNormalBc.bcsj, // 班次时间
  523 + "ssj": oGroupGanttNormalBc.STOPTIME, // 停站时间
  524 + "eatsj": oGroupGanttEatBc ? oGroupGanttEatBc.bcsj : 0, // 吃饭时间
  525 +
  526 + "tccid": oGroupGanttNormalBc.tcc, // 停车场id
  527 + "qdzid": oGroupGanttNormalBc.qdz, // 起点站id
  528 + "zdzid": oGroupGanttNormalBc.zdz, // 终点站id
  529 +
  530 + "isUp": bIsUp, // 是否上行
  531 +
  532 + "bcType": oGroupGanttNormalBc.bcType, // 班次类型
  533 + "fcsj": oGroupGanttEatBc ?
  534 + ("*" + oGroupGanttNormalBc.fcsj) :
  535 + oGroupGanttNormalBc.fcsj, // 发车时间描述
  536 + "fcsjDesc": oGroupGanttEatBc ?
  537 + ("(吃" + oGroupGanttNormalBc.fcsj + ")") :
  538 + oGroupGanttNormalBc.fcsj, // 发车时间描述2
  539 +
  540 + "groupNo": bIsUp ? this._iUpGroupIndex : this._iDownGroupIndex, // 第几圈
  541 + "groupBcNo": bIsUp == this._bQIsUp ? 0 : 1, // 圈里第几个班次
  542 +
  543 + "_bclc": oGroupGanttNormalBc.jhlc // 班次里程(最后需要删除)
  544 +
  545 + });
  546 +
  547 + oExcelLp._bcObjGroupList.push({
  548 + fcsj: oGroupGanttNormalBc.fcsj, // 发车时间
  549 + groupIndex: bIsUp ? this._iUpGroupIndex : this._iDownGroupIndex, // 第几圈
  550 + bcIndex: bIsUp == this._bQIsUp ? 0 : 1 // 圈里第几个班次
  551 + });
  552 + }
  553 + }
  554 + }
  555 +
  556 + if (bIsUp) {
  557 + this._iUpGroupIndex ++;
  558 + } else {
  559 + this._iDownGroupIndex ++;
  560 + }
  561 + this._oLpGroupNormalGanttBc = {};
  562 + };
  563 +
  564 + // 添加报到,出场,进场,离场班次
  565 + InternalCalcuExcelBc1.prototype._addBdOutInLcBc = function(oGanttBc, bIsUp) {
  566 + var i;
  567 + var oExcelLp;
  568 + var bcType;
  569 + for (i = 0; i < this._aExcelLp.length; i++) {
  570 + oExcelLp = this._aExcelLp[i];
  571 + if (oGanttBc.lpName == oExcelLp.lpname) {
  572 + bcType = oGanttBc.bcType;
  573 + if (bcType == "bd" || bcType == "out" || bcType == "in" || bcType == "lc") {
  574 + oExcelLp.bcObjList.push({
  575 + "bcsj": oGanttBc.bcsj, // 班次时间
  576 + "ssj": oGanttBc.STOPTIME, // 停站时间
  577 + "eatsj": 0, // 吃饭时间
  578 +
  579 + "tccid": oGanttBc.tcc, // 停车场id
  580 + "qdzid": oGanttBc.qdz, // 起点站id
  581 + "zdzid": oGanttBc.zdz, // 终点站id
  582 +
  583 + "isUp": bIsUp, // 是否上行
  584 + "isFb": null, // 是否分班(_resetBdOutInLcBcGroup方法修正)
  585 +
  586 + "bcType": oGanttBc.bcType, // 班次类型(bc、out、in、lc)
  587 + "fcsj": oGanttBc.fcsj, // 发车时间描述
  588 +
  589 + "groupNo": -99, // 第几圈(_resetBdOutInLcBcGroup方法修正)
  590 + "groupBcNo": -99, // 圈里第几个班次(_resetBdOutInLcBcGroup方法修正)
  591 +
  592 + "_bclc": oGanttBc.jhlc // 班次里程(最后需要删除)
  593 + });
  594 + break;
  595 + }
  596 + }
  597 + }
  598 +
  599 + };
  600 + // 重新计算报到,出场,进场,离场班次的圈索引及班次索引
  601 + InternalCalcuExcelBc1.prototype._resetBdOutInLcBcGroup = function() {
  602 + var i;
  603 + var j;
  604 + var k;
  605 + var sFcsjDesc = [];
  606 + var oExcelLp;
  607 + var oLpBc;
  608 +
  609 + // {"bd":到场班次index,"out":出场班次index, "nextBc": 出场后第一个normal班次索引, "nextBcGroup":出场后第一个normal班次group索引}
  610 + var oBdOutLpBc = {};
  611 + // 到场出场班次组合数组
  612 + var aBdOutLpBc = [];
  613 +
  614 + // {"in":进场班次index,"lc":离场班次index, "preBc": 进场前一个normal班次索引, "preBcGroup":进场前一个normal班次group索引}
  615 + var oInLcLpBc = {};
  616 + // 进场离场班次组合数组
  617 + var aInLcLpBc = [];
  618 +
  619 + for (i = 0; i < this._aExcelLp.length; i++) {
  620 + oExcelLp = this._aExcelLp[i];
  621 +
  622 + // 排序oExcelLp班次列表
  623 + this._fnSortBc(oExcelLp.bcObjList);
  624 +
  625 + aBdOutLpBc = [];
  626 + aInLcLpBc = [];
  627 +
  628 + for (j = 0; j < oExcelLp.bcObjList.length; j++) {
  629 + oLpBc = oExcelLp.bcObjList[j];
  630 +
  631 + if (oLpBc.bcType == "out") { // 出场班次
  632 + oBdOutLpBc = {"bd": null, "out": null, "nextBc": null, "nextBcGroup": null};
  633 + oBdOutLpBc["out"] = j;
  634 + // 查找上一个班次是否是报到班次(不存在有可能,中间分班班次可能没有报到时间)
  635 + if ((j - 1) >= 0 && (j - 1) < oExcelLp.bcObjList.length) {
  636 + if (oExcelLp.bcObjList[j - 1].bcType == "bd") {
  637 + oBdOutLpBc["bd"] = j - 1;
  638 + }
  639 + }
  640 + // 查找下一个班次是否是normal班次(不存在或者不是normal班次,这个报到出场班次组合忽略)
  641 + if ((j + 1) < oExcelLp.bcObjList.length) {
  642 + if (oExcelLp.bcObjList[j + 1].bcType == "normal") {
  643 + for (k = 0; k < oExcelLp._bcObjGroupList.length; k++) {
  644 + if (oExcelLp.bcObjList[j + 1].fcsj == oExcelLp._bcObjGroupList[k].fcsj) {
  645 + oBdOutLpBc["nextBc"] = j + 1;
  646 + oBdOutLpBc["nextBcGroup"] = k;
  647 + aBdOutLpBc.push(oBdOutLpBc);
  648 + break;
  649 + }
  650 + }
  651 + }
  652 + }
  653 + } else if (oLpBc.bcType == "in") { // 进场班次
  654 + oInLcLpBc = {"in": null, "lc": null, "preBc": null, "preBcGroup": null};
  655 + oInLcLpBc["in"] = j;
  656 + // 查找系一个班次是否是离场班次(不存在有可能,中间分班班次可能没有离场时间)
  657 + if ((j + 1) < oExcelLp.bcObjList.length) {
  658 + if (oExcelLp.bcObjList[j + 1].bcType == "lc") {
  659 + oInLcLpBc["lc"] = j + 1;
  660 + }
  661 + }
  662 + // 查找上一个班次是否是normal班次(不存在或者不是normal班次,这个进场离场班次组合忽略)
  663 + if ((j - 1) >= 0 && (j - 1) < oExcelLp.bcObjList.length) {
  664 + if (oExcelLp.bcObjList[j - 1].bcType == "normal") {
  665 + for (k = 0; k < oExcelLp._bcObjGroupList.length; k++) {
  666 + if (oExcelLp.bcObjList[j - 1].fcsj == oExcelLp._bcObjGroupList[k].fcsj) {
  667 + oInLcLpBc["preBc"] = j - 1;
  668 + oInLcLpBc["preBcGroup"] = k;
  669 + aInLcLpBc.push(oInLcLpBc);
  670 + break;
  671 + }
  672 + }
  673 + }
  674 + }
  675 +
  676 + }
  677 +
  678 + }
  679 +
  680 + if (aBdOutLpBc.length == 2) { // 分班(以出场班次为主)
  681 + // 处理第一个出场
  682 + sFcsjDesc = [];
  683 + oBdOutLpBc = aBdOutLpBc[0];
  684 + if (oBdOutLpBc.bd != null) {
  685 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.bd];
  686 + oLpBc.isFb = false;
  687 + oLpBc.groupNo = -1;
  688 + oLpBc.groupBcNo = -1;
  689 + sFcsjDesc.push("(到" + oLpBc.fcsj + ")");
  690 + }
  691 +
  692 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.out];
  693 + oLpBc.isFb = false;
  694 + oLpBc.groupNo = -1;
  695 + oLpBc.groupBcNo = -2;
  696 + sFcsjDesc.push("(出" + oLpBc.fcsj + ")");
  697 +
  698 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.nextBc];
  699 + sFcsjDesc.push("(" + oLpBc.fcsj + ")");
  700 + oLpBc.fcsjDesc = sFcsjDesc.join("");
  701 +
  702 + // 处理第二个出场
  703 + sFcsjDesc = [];
  704 + oBdOutLpBc = aBdOutLpBc[1];
  705 + if (oBdOutLpBc.bd != null) {
  706 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.bd];
  707 + oLpBc.isFb = true;
  708 + oLpBc.groupNo = oExcelLp._bcObjGroupList[oBdOutLpBc.nextBcGroup].groupIndex - 1;
  709 + oLpBc.groupBcNo = oExcelLp._bcObjGroupList[oBdOutLpBc.nextBcGroup].bcIndex;
  710 + sFcsjDesc.push("(到" + oLpBc.fcsj + ")");
  711 + }
  712 +
  713 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.out];
  714 + oLpBc.isFb = true;
  715 + oLpBc.groupNo = ((oExcelLp._bcObjGroupList[oBdOutLpBc.nextBcGroup].bcIndex == 0) ?
  716 + (oExcelLp._bcObjGroupList[oBdOutLpBc.nextBcGroup].groupIndex - 1) :
  717 + oExcelLp._bcObjGroupList[oBdOutLpBc.nextBcGroup].groupIndex);
  718 + oLpBc.groupBcNo = ((oExcelLp._bcObjGroupList[oBdOutLpBc.nextBcGroup].bcIndex == 0) ? 1 : 0);
  719 + sFcsjDesc.push("(出" + oLpBc.fcsj + ")");
  720 +
  721 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.nextBc];
  722 + sFcsjDesc.push("(" + oLpBc.fcsj + ")");
  723 + oLpBc.fcsjDesc = sFcsjDesc.join("");
  724 +
  725 + // 2个以上进场班次,处理第一个和第二个,第一个做为中间进场
  726 + if (aInLcLpBc.length >= 2) {
  727 + sFcsjDesc = [];
  728 + oInLcLpBc = aInLcLpBc[0];
  729 +
  730 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.preBc];
  731 + sFcsjDesc.push("(" + oLpBc.fcsj + ")");
  732 +
  733 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.in];
  734 + oLpBc.isFb = true;
  735 + oLpBc.groupNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ?
  736 + oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex :
  737 + (oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex + 1));
  738 + oLpBc.groupBcNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ? 1 : 0);
  739 + sFcsjDesc.push("(进" + oLpBc.fcsj + ")");
  740 +
  741 + oExcelLp.bcObjList[oInLcLpBc.preBc].fcsjDesc = sFcsjDesc.join("");
  742 +
  743 + sFcsjDesc = [];
  744 + oInLcLpBc = aInLcLpBc[1];
  745 +
  746 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.preBc];
  747 + sFcsjDesc.push("(" + oLpBc.fcsj + ")");
  748 +
  749 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.in];
  750 + oLpBc.isFb = false;
  751 + oLpBc.groupNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ?
  752 + oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex :
  753 + (oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex + 1));
  754 + oLpBc.groupBcNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ? 1 : 0);
  755 + sFcsjDesc.push("(进" + oLpBc.fcsj + ")");
  756 +
  757 + if (oInLcLpBc.lc) {
  758 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.lc];
  759 + oLpBc.isFb = false;
  760 + oLpBc.groupNo = -2;
  761 + oLpBc.groupBcNo = -4;
  762 + sFcsjDesc.push("(离" + oLpBc.fcsj + ")");
  763 + }
  764 + oExcelLp.bcObjList[oInLcLpBc.preBc].fcsjDesc = sFcsjDesc.join("");
  765 + }
  766 +
  767 + // 一个进场班次,做为最后一个进场班次处理
  768 + if (aInLcLpBc.length == 1) {
  769 + sFcsjDesc = [];
  770 + oInLcLpBc = aInLcLpBc[0];
  771 +
  772 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.preBc];
  773 + sFcsjDesc.push("(" + oLpBc.fcsj + ")");
  774 +
  775 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.in];
  776 + oLpBc.isFb = false;
  777 + oLpBc.groupNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ?
  778 + oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex :
  779 + (oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex + 1));
  780 + oLpBc.groupBcNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ? 1 : 0);
  781 + sFcsjDesc.push("(进" + oLpBc.fcsj + ")");
  782 +
  783 + if (oInLcLpBc.lc) {
  784 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.lc];
  785 + oLpBc.isFb = false;
  786 + oLpBc.groupNo = -2;
  787 + oLpBc.groupBcNo = -4;
  788 + sFcsjDesc.push("(离" + oLpBc.fcsj + ")");
  789 + }
  790 + oExcelLp.bcObjList[oInLcLpBc.preBc].fcsjDesc = sFcsjDesc.join("");
  791 + }
  792 +
  793 +
  794 + } else if (aBdOutLpBc.length == 1) {
  795 + // 处理出场
  796 + sFcsjDesc = [];
  797 + oBdOutLpBc = aBdOutLpBc[0];
  798 + if (oBdOutLpBc.bd != null) {
  799 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.bd];
  800 + oLpBc.isFb = false;
  801 + oLpBc.groupNo = -1;
  802 + oLpBc.groupBcNo = -1;
  803 + sFcsjDesc.push("(到" + oLpBc.fcsj + ")");
  804 + }
  805 +
  806 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.out];
  807 + oLpBc.isFb = false;
  808 + oLpBc.groupNo = -1;
  809 + oLpBc.groupBcNo = -2;
  810 + sFcsjDesc.push("(出" + oLpBc.fcsj + ")");
  811 +
  812 + oLpBc = oExcelLp.bcObjList[oBdOutLpBc.nextBc];
  813 + sFcsjDesc.push("(" + oLpBc.fcsj + ")");
  814 + oLpBc.fcsjDesc = sFcsjDesc.join("");
  815 +
  816 + // 处理进场
  817 + if (aInLcLpBc.length > 0) {
  818 + sFcsjDesc = [];
  819 + oInLcLpBc = aInLcLpBc[0];
  820 +
  821 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.preBc];
  822 + sFcsjDesc.push("(" + oLpBc.fcsj + ")");
  823 +
  824 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.in];
  825 + oLpBc.isFb = false;
  826 + oLpBc.groupNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ?
  827 + oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex :
  828 + (oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].groupIndex + 1));
  829 + oLpBc.groupBcNo = ((oExcelLp._bcObjGroupList[oInLcLpBc.preBcGroup].bcIndex == 0) ? 1 : 0);
  830 + sFcsjDesc.push("(进" + oLpBc.fcsj + ")");
  831 +
  832 + if (oInLcLpBc.lc) {
  833 + oLpBc = oExcelLp.bcObjList[oInLcLpBc.lc];
  834 + oLpBc.isFb = false;
  835 + oLpBc.groupNo = -2;
  836 + oLpBc.groupBcNo = -4;
  837 + sFcsjDesc.push("(离" + oLpBc.fcsj + ")");
  838 + }
  839 + oExcelLp.bcObjList[oInLcLpBc.preBc].fcsjDesc = sFcsjDesc.join("");
  840 +
  841 + }
  842 +
  843 + }
  844 +
  845 + // console.log("todo");
  846 +
  847 +
  848 + }
  849 +
  850 + // console.log("ddd");
  851 +
  852 + };
  853 +
  854 + // 判定当前圈是否是有分班后的第一个normal班次
  855 + InternalCalcuExcelBc1.prototype._fnIsFBcQ = function(bIsUp) {
  856 + var oExcelLp;
  857 + var i;
  858 + var oLpPreExcelBc;
  859 + var oLpCurGranttBc;
  860 + var oPreBcFcsj;
  861 + var oCurBcFcsj;
  862 + var idiffTime;
  863 + var bFbFlag = false;
  864 + for (i = 0; i < this._aExcelLp.length; i++) {
  865 + oExcelLp = this._aExcelLp[i];
  866 + if (oExcelLp.bcObjList.length > 0) {
  867 + oLpPreExcelBc = oExcelLp.bcObjList[oExcelLp.bcObjList.length - 1];
  868 + if (oLpPreExcelBc.bcType == "normal") {
  869 + oPreBcFcsj = this._oParam.toTimeObj(
  870 + oLpPreExcelBc.fcsj.indexOf("*") >= 0 ? oLpPreExcelBc.fcsj.substr(1) : oLpPreExcelBc.fcsj
  871 + );
  872 + if (this._oLpGroupNormalGanttBc[oExcelLp.lpname]) {
  873 + oLpCurGranttBc = this._oLpGroupNormalGanttBc[oExcelLp.lpname].normal;
  874 + if (oLpCurGranttBc) {
  875 + oCurBcFcsj = this._oParam.toTimeObj(oLpCurGranttBc.fcsj);
  876 + idiffTime = oCurBcFcsj.diff(oPreBcFcsj, "m");
  877 + if (idiffTime > oLpPreExcelBc.bcsj * 3) {
  878 + bFbFlag = true;
  879 + break;
  880 + }
  881 + }
  882 + }
  883 + }
  884 + }
  885 +
  886 + }
  887 +
  888 + return bFbFlag;
  889 +
  890 + };
  891 +
  892 + /**
  893 + * 内部Excel对象。
  894 + * @param oParam 参数对象
  895 + * @param fnGetGanttBcArray 返回gantt用的班次列表
  896 + * @constructor
  897 + */
  898 + function InternalExcelObj(oParam, fnGetGanttBcArray) {
  899 + // 参数对象
  900 + this._oParam = oParam;
  901 + // 获取gantt班次的方法
  902 + this._fnBc = fnGetGanttBcArray;
  903 +
  904 + // 每一圈是上行开始还是下行开始
  905 + this._qIsUp = oParam.getUpFirstDTimeObj().diff(oParam.getDownFirstDTimeObj()) <= 0 ? false : true;
  906 +
  907 + }
  908 +
  909 + // html5导出excel方法
  910 + InternalExcelObj.prototype.downloadFile = function(data, mimeType, fileName) {
  911 + _fnDownloadFile(data, mimeType, fileName);
  912 + };
  913 + /**
  914 + * 获取班次统计数据。
  915 + */
  916 + InternalExcelObj.prototype.fnGetStatInfoList = function() {
  917 + return _fnCalcuExportStatInfo_sheet(this._fnBc(), this._oParam);
  918 + };
  919 + /**
  920 + * 获取参数数据。
  921 + */
  922 + InternalExcelObj.prototype.fnGetParamInfoList = function() {
  923 + return _fnCalcuExportParam_sheet(this._oParam);
  924 + };
  925 + /**
  926 + * 获取路牌班次数据。
  927 + * @return {*}
  928 + */
  929 + InternalExcelObj.prototype.fnGetLpBcInfoList = function() {
  930 + // 构造显示用lp对象
  931 + var oTempLpFlag = {};
  932 + var aGanttBc = this._fnBc();
  933 + var oGanttBc;
  934 + var aLp = [];
  935 + var oLp;
  936 + var i;
  937 + for (i = 0; i < aGanttBc.length; i++) {
  938 + oGanttBc = aGanttBc[i];
  939 + if (oTempLpFlag[oGanttBc.lpName]) {
  940 + // 已经存在路牌,不处理
  941 + continue;
  942 + }
  943 +
  944 + oLp = {
  945 + "lpname": oGanttBc.lpName, // 路牌名字
  946 + "isUp": this._qIsUp, // 每圈的第一个班次是否上行
  947 + "bcObjList": [], // 内部班次列表(后面计算班次列表)
  948 + "_bcObjGroupList": [], // 每个normal班次对应的group对象 {fcsj: 发车时间, groupIndex: 圈索引, bcIndex: 班次索引},最后返回要删除
  949 + "groupCount": 0, // 总圈数(后面计算总圈数)
  950 + "zlc": 0, // 总里程
  951 + "yylc": 0, // 营运里程
  952 + "kslc": 0, // 空驶里程
  953 + "zgs": 0, // 总工时
  954 + "zbc": 0, // 总班次
  955 + "yygs": 0, // 营运工时
  956 + "yybc": 0, // 营运班次
  957 + "stationRouteId1": 0, // 第一个班次起点站路由id
  958 + "stationRouteId2": 0 // 第二个班次起点站路由id
  959 + };
  960 + oTempLpFlag[oGanttBc.lpName] = {"flag" : true}; // 标记一下
  961 + aLp.push(oLp);
  962 + }
  963 +
  964 + // 计算Excel班次
  965 + var _celb = new InternalCalcuExcelBc1(aLp, aGanttBc, this._oParam, this._qIsUp);
  966 + return _celb.fnGenerateExcelLpBcList();
  967 + };
  968 +
  969 + return InternalExcelObj;
  970 +
  971 +} ());
0 \ No newline at end of file 972 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/v2_2/main_v2_2.js
@@ -39,16 +39,16 @@ var Main_v2_2 = function() { @@ -39,16 +39,16 @@ var Main_v2_2 = function() {
39 var schedule = new InternalScheduleObj_v2_2(paramObj, lpArray); 39 var schedule = new InternalScheduleObj_v2_2(paramObj, lpArray);
40 // 2、生成班次(从第2圈开始) 40 // 2、生成班次(从第2圈开始)
41 schedule.fnCreateBclistWithMasterBc(2, 20); 41 schedule.fnCreateBclistWithMasterBc(2, 20);
42 - // 3、计算吃饭班次  
43 - schedule.fnCalcuEatBc();  
44 - // 4、调整发车间隔 42 + // 3、调整发车间隔
45 schedule.fnAdjustHeadway(); 43 schedule.fnAdjustHeadway();
  44 + // 4、计算吃饭班次
  45 + schedule.fnCalcuEatBc();
46 // // 6、计算末班车 46 // // 6、计算末班车
47 // schedule.fnCalcuLastBc(); 47 // schedule.fnCalcuLastBc();
48 // 7、重新设置停站时间 48 // 7、重新设置停站时间
49 schedule.fnReSetLayoverTime(); 49 schedule.fnReSetLayoverTime();
50 - // // 8、补进出场例保班次  
51 - // schedule.fnCalcuOtherBc(); 50 + // 8、补进出场例保班次
  51 + schedule.fnCalcuOtherBc();
52 52
53 //-------------------- 输出ganut图上的班次,班型描述 ----------------------// 53 //-------------------- 输出ganut图上的班次,班型描述 ----------------------//
54 // TODO:班型再议 54 // TODO:班型再议
@@ -58,21 +58,24 @@ var Main_v2_2 = function() { @@ -58,21 +58,24 @@ var Main_v2_2 = function() {
58 }; 58 };
59 }, 59 },
60 60
61 - //----------------------------------- 导入导出方法 -----------------------------------// 61 + //----------------------------------- 导入导出配置 -----------------------------------//
62 62
63 /** 63 /**
64 * 导出时刻表配置。 64 * 导出时刻表配置。
65 - * @param aInternalLpObj 内部路牌对象列表 65 + * @param fnGetGanttBc 获取gantt班次方法
66 */ 66 */
67 - exportDataConfig: function(aInternalLpObj) { 67 + exportExcelConfig: function(fnGetGanttBc) {
  68 + var oExcel = new Main_v2_2_ExcelObj(_paramObj, fnGetGanttBc);
  69 +
68 $('.exportAddXls').off('click'); 70 $('.exportAddXls').off('click');
69 $('.exportAddXlsx').off('click'); 71 $('.exportAddXlsx').off('click');
70 72
71 $('.exportAddXls').on('click', function() { 73 $('.exportAddXls').on('click', function() {
  74 +
72 var aInfos = { 75 var aInfos = {
73 - "lpObjList": Main_v2_2_excel[0](aInternalLpObj, _paramObj), // 路牌班次信息列表  
74 - "statInfoList": Main_v2_2_excel[1](aInternalLpObj, _paramObj), // 统计项目列表  
75 - "parameterInfoList" : Main_v2_2_excel[2](_paramObj) // 参数对象 76 + "lpObjList": oExcel.fnGetLpBcInfoList(), // 路牌班次信息列表
  77 + "statInfoList": oExcel.fnGetStatInfoList(), // 统计项目列表
  78 + "parameterInfoList" : oExcel.fnGetParamInfoList() // 参数对象
76 }; 79 };
77 80
78 console.log(aInfos); 81 console.log(aInfos);
@@ -88,7 +91,7 @@ var Main_v2_2 = function() { @@ -88,7 +91,7 @@ var Main_v2_2 = function() {
88 contentType: "application/json", 91 contentType: "application/json",
89 data: JSON.stringify(aInfos), 92 data: JSON.stringify(aInfos),
90 success: function(data){ 93 success: function(data){
91 - Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls"); 94 + oExcel.downloadFile(data, "application/octet-stream", "时刻表信息.xls");
92 95
93 $(".exportAdd").removeClass("disabled"); 96 $(".exportAdd").removeClass("disabled");
94 $(".exportAddSpan").html(" 导出数据"); 97 $(".exportAddSpan").html(" 导出数据");
@@ -104,9 +107,9 @@ var Main_v2_2 = function() { @@ -104,9 +107,9 @@ var Main_v2_2 = function() {
104 107
105 $('.exportAddXlsx').on('click', function() { 108 $('.exportAddXlsx').on('click', function() {
106 var aInfos = { 109 var aInfos = {
107 - "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表  
108 - "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj), // 统计项目列表  
109 - "parameterInfoList" : __funCalcuExportData_paramInfoList() // 参数对象 110 + "lpObjList": oExcel.fnGetLpBcInfoList(), // 路牌班次信息列表
  111 + "statInfoList": oExcel.fnGetStatInfoList(), // 统计项目列表
  112 + "parameterInfoList" : oExcel.fnGetParamInfoList() // 参数对象
110 }; 113 };
111 114
112 console.log(aInfos); 115 console.log(aInfos);
@@ -122,7 +125,7 @@ var Main_v2_2 = function() { @@ -122,7 +125,7 @@ var Main_v2_2 = function() {
122 contentType: "application/json", 125 contentType: "application/json",
123 data: JSON.stringify(aInfos), 126 data: JSON.stringify(aInfos),
124 success: function(data){ 127 success: function(data){
125 - Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xlsx"); 128 + oExcel.downloadFile(data, "application/octet-stream", "时刻表信息.xlsx");
126 129
127 $(".exportAdd").removeClass("disabled"); 130 $(".exportAdd").removeClass("disabled");
128 $(".exportAddSpan").html(" 导出数据"); 131 $(".exportAddSpan").html(" 导出数据");
@@ -135,76 +138,8 @@ var Main_v2_2 = function() { @@ -135,76 +138,8 @@ var Main_v2_2 = function() {
135 } 138 }
136 }); 139 });
137 }); 140 });
138 - }, 141 + }
139 142
140 - downloadFile: function (data, mimeType, fileName) {  
141 - var success = false;  
142 - var blob = new Blob([data], { type: mimeType });  
143 - try {  
144 - if (navigator.msSaveBlob)  
145 - navigator.msSaveBlob(blob, fileName);  
146 - else {  
147 - // Try using other saveBlob implementations, if available  
148 - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;  
149 - if (saveBlob === undefined) throw "Not supported";  
150 - saveBlob(blob, fileName);  
151 - }  
152 - success = true;  
153 - } catch (ex) {  
154 - console.log("saveBlob method failed with the following exception:");  
155 - console.log(ex);  
156 - }  
157 -  
158 - if (!success) {  
159 - // Get the blob url creator  
160 - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;  
161 - if (urlCreator) {  
162 - // Try to use a download link  
163 - var link = document.createElement('a');  
164 - if ('download' in link) {  
165 - // Try to simulate a click  
166 - try {  
167 - // Prepare a blob URL  
168 - var url = urlCreator.createObjectURL(blob);  
169 - link.setAttribute('href', url);  
170 -  
171 - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)  
172 - link.setAttribute("download", fileName);  
173 -  
174 - // Simulate clicking the download link  
175 - var event = document.createEvent('MouseEvents');  
176 - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);  
177 - link.dispatchEvent(event);  
178 - success = true;  
179 -  
180 - } catch (ex) {  
181 - console.log("Download link method with simulated click failed with the following exception:");  
182 - console.log(ex);  
183 - }  
184 - }  
185 143
186 - if (!success) {  
187 - // Fallback to window.location method  
188 - try {  
189 - // Prepare a blob URL  
190 - // Use application/octet-stream when using window.location to force download  
191 - var url = urlCreator.createObjectURL(blob);  
192 - window.location = url;  
193 - console.log("Download link method with window.location succeeded");  
194 - success = true;  
195 - } catch (ex) {  
196 - console.log("Download link method with window.location failed with the following exception:");  
197 - console.log(ex);  
198 - }  
199 - }  
200 - }  
201 - }  
202 -  
203 - if (!success) {  
204 - // Fallback to window.open method  
205 - console.log("No methods worked for saving the arraybuffer, using last resort window.open");  
206 - window.open("", '_blank', '');  
207 - }  
208 - }  
209 } 144 }
210 }(); 145 }();
211 \ No newline at end of file 146 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/v2_2/strategy/headway/AdjustHeadwayS1.js
@@ -81,6 +81,10 @@ var AdjustHeadwayS1 = (function() { @@ -81,6 +81,10 @@ var AdjustHeadwayS1 = (function() {
81 oLp = aLp[aLpIndex[i]]; 81 oLp = aLp[aLpIndex[i]];
82 oBc = oLp.getBc(iCurrentGroupIndex, iCurrentBcIndex); 82 oBc = oLp.getBc(iCurrentGroupIndex, iCurrentBcIndex);
83 oBc.addMinuteToFcsj(-1); // 发车时间,到达时间减1分钟 83 oBc.addMinuteToFcsj(-1); // 发车时间,到达时间减1分钟
  84 +
  85 + oLp.fnSetVerticalIntervalTime( // 调整对应的路牌发车间隔
  86 + iCurrentGroupIndex, iCurrentBcIndex,
  87 + oLp.fnGetVerticalIntervalTime(iCurrentGroupIndex, iCurrentBcIndex) - 1);
84 } 88 }
85 } 89 }
86 90
@@ -171,6 +175,10 @@ var AdjustHeadwayS1 = (function() { @@ -171,6 +175,10 @@ var AdjustHeadwayS1 = (function() {
171 oBc = oLp.getBc(iCurrentGroupIndex, iCurrentBcIndex); 175 oBc = oLp.getBc(iCurrentGroupIndex, iCurrentBcIndex);
172 if (oBc) { 176 if (oBc) {
173 oBc.addMinuteToFcsj(-1); // 发车时间,到达时间减1分钟 177 oBc.addMinuteToFcsj(-1); // 发车时间,到达时间减1分钟
  178 +
  179 + oLp.fnSetVerticalIntervalTime( // 调整对应的路牌发车间隔
  180 + iCurrentGroupIndex, iCurrentBcIndex,
  181 + oLp.fnGetVerticalIntervalTime(iCurrentGroupIndex, iCurrentBcIndex) - 1);
174 } 182 }
175 183
176 } 184 }
src/main/resources/static/pages/base/timesmodel/js/v2_2/strategy/headway/AdjustHeadwayS2.js
@@ -29,6 +29,10 @@ var AdjustHeadwayS2 = (function() { @@ -29,6 +29,10 @@ var AdjustHeadwayS2 = (function() {
29 ); 29 );
30 if (oBc) { 30 if (oBc) {
31 oBc.addMinuteToFcsj(iMinute); 31 oBc.addMinuteToFcsj(iMinute);
  32 +
  33 + oLp.fnSetVerticalIntervalTime( // 调整对应的路牌发车间隔
  34 + iBcGroupIndex, iBcIndex,
  35 + oLp.fnGetVerticalIntervalTime(iBcGroupIndex, iBcIndex) + iMinute);
32 } 36 }
33 if (oNextBc) { 37 if (oNextBc) {
34 oNextBc.addMinuteToFcsj(iMinute); 38 oNextBc.addMinuteToFcsj(iMinute);
src/main/resources/static/pages/base/timesmodel/js/v2_2/strategy/headway/AdjustHeadwayS3_eat.js
@@ -88,6 +88,10 @@ var AdjustHeadwayS3_eat = (function() { @@ -88,6 +88,10 @@ var AdjustHeadwayS3_eat = (function() {
88 ); 88 );
89 if (oBc) { 89 if (oBc) {
90 oBc.addMinuteToFcsj(iMinute); 90 oBc.addMinuteToFcsj(iMinute);
  91 +
  92 + oLp.fnSetVerticalIntervalTime( // 调整对应的路牌发车间隔
  93 + iBcGroupIndex, iBcIndex,
  94 + oLp.fnGetVerticalIntervalTime(iBcGroupIndex, iBcIndex) + iMinute);
91 } 95 }
92 if (oNextBc) { 96 if (oNextBc) {
93 oNextBc.addMinuteToFcsj(iMinute); 97 oNextBc.addMinuteToFcsj(iMinute);
src/main/resources/static/pages/base/timesmodel/paramadd.html
@@ -549,11 +549,56 @@ @@ -549,11 +549,56 @@
549 } else if (ganttMap.baseRes == "3") { // v2_2版本 549 } else if (ganttMap.baseRes == "3") { // v2_2版本
550 csMap = getCSMap_v2(paramObj); 550 csMap = getCSMap_v2(paramObj);
551 data = _mainFun_v2_2.BXPplaceClassesTime03(paramObj, csMap.maxCar); 551 data = _mainFun_v2_2.BXPplaceClassesTime03(paramObj, csMap.maxCar);
552 - _mainFun_v2_2.exportDataConfig(data.aInternalLpObj);  
553 } 552 }
554 553
555 echartsDrawGTT.init(data.json,true,true); 554 echartsDrawGTT.init(data.json,true,true);
556 555
  556 + if (ganttMap.baseRes == "3" || ganttMap.baseRes == "1") {
  557 + // 导入导出设置
  558 + // _mainFun_v2_2.exportExcelConfig($_GlobalGraph.getDataArray);
  559 +
  560 + var _dfun = function() {
  561 + // fix,从新的甘特图中获取数据
  562 + var _keyIndex = echartsDrawGTT.get_keyIndex();
  563 + var historyData = echartsDrawGTT.getHistoryData();
  564 + var _data = $.extend(true, [], data, historyData[_keyIndex]);
  565 +
  566 + var _i;
  567 + var _j;
  568 + var _gObj;
  569 +
  570 + var _rtnBcArray = [];
  571 + for (_i = 0; _i < _data.length; _i++) {
  572 + _gObj = _data[_i].value;
  573 + _rtnBcArray.push({
  574 + lpName : _gObj[0],
  575 + fcsj: moment(_gObj[1]).format("HH:mm"),
  576 + ARRIVALTIME: moment(_gObj[2]).format("HH:mm"),
  577 + bcsj: _gObj[3] / 60000,
  578 + lpNo: _gObj[4],
  579 + lpType: _gObj[5],
  580 + bcType: _gObj[6],
  581 + fcno: _gObj[7],
  582 + xlDir: (_gObj[8] == 0 ? "relationshipGraph-up" : "relationshipGraph-down"),
  583 + jhlc: _gObj[9],
  584 + tcc: _gObj[10],
  585 + ttinfo: _gObj[11],
  586 + xl: _gObj[12],
  587 + qdz: _gObj[13],
  588 + zdz: _gObj[14],
  589 + STOPTIME: _gObj[15],
  590 + isfb: _gObj[16]
  591 + });
  592 + }
  593 +
  594 + console.log("重组前数据=" + _data);
  595 + console.log("重组后数据=" + _rtnBcArray);
  596 + return _rtnBcArray;
  597 + };
  598 +
  599 + Main_v2_2.exportExcelConfig(_dfun);
  600 + }
  601 +
557 // var data = obj.getDataArray(); 602 // var data = obj.getDataArray();
558 // // 2、 调整路牌对应的班次总数 603 // // 2、 调整路牌对应的班次总数
559 // updFormParams(params,data); 604 // updFormParams(params,data);
@@ -870,7 +915,7 @@ @@ -870,7 +915,7 @@
870 var _paramObj = _mainFun.getFactory().createParameterObj(map, dataMap); 915 var _paramObj = _mainFun.getFactory().createParameterObj(map, dataMap);
871 916
872 if (!_paramObj.isTwoWayStop()) { // 主站停站使用v2_2版本 917 if (!_paramObj.isTwoWayStop()) { // 主站停站使用v2_2版本
873 - map.clzs = _oSchedule_v2_2.calcuClzx(_paramObj); 918 + map.clzs = InternalScheduleObj.calcuClzx(_paramObj);
874 } else { 919 } else {
875 map.clzs = _paramObj.calcuClzx(); 920 map.clzs = _paramObj.calcuClzx();
876 } 921 }
src/main/resources/static/pages/base/timesmodel/tepms/bctype_temp.html
@@ -58,62 +58,6 @@ @@ -58,62 +58,6 @@
58 58
59 <!-- 表单分组组件 form-group START --> 59 <!-- 表单分组组件 form-group START -->
60 <div class="form-group"> 60 <div class="form-group">
61 - <!-- 早高峰开始时间 (* 必填项) START -->  
62 - <div class="col-md-6">  
63 - <label class="control-label col-md-5">  
64 - <span class="required"> * </span> 早高峰开始时间 :  
65 - </label>  
66 - <div class="col-md-5">  
67 - <input type="text" class="form-control" name="earlyStartTime" value="{{map.earlyStartTime}}" id="zgfkssjInput"  
68 - placeholder="请输入早高峰开始时间">  
69 - </div>  
70 - </div>  
71 - <!-- 早高峰开始时间 (* 必填项) END -->  
72 -  
73 - <!-- 早高峰结束时间 (* 必填项) START -->  
74 - <div class="col-md-6">  
75 - <label class="control-label col-md-5">  
76 - <span class="required"> * </span> 早高峰结束时间 :  
77 - </label>  
78 - <div class="col-md-5">  
79 - <input type="text" class="form-control" name="earlyEndTime" value="{{map.earlyEndTime}}" id="zgfjssjInput"  
80 - placeholder="请输入早高峰结束时间">  
81 - </div>  
82 - </div>  
83 - <!-- 早高峰结束时间 (* 必填项) END -->  
84 - </div>  
85 - <!-- 表单分组组件 form-group END -->  
86 -  
87 - <!-- 表单分组组件 form-group START -->  
88 - <div class="form-group">  
89 - <!-- 晚高峰开始时间 (* 必填项) START -->  
90 - <div class="col-md-6">  
91 - <label class="control-label col-md-5">  
92 - <span class="required"> * </span> 晚高峰开始时间 :  
93 - </label>  
94 - <div class="col-md-5">  
95 - <input type="text" class="form-control" name="lateStartTime" value="{{map.lateStartTime}}" id="wgfkssjInput"  
96 - placeholder="请输入晚高峰开始时间">  
97 - </div>  
98 - </div>  
99 - <!-- 晚高峰开始时间 (* 必填项) END -->  
100 -  
101 - <!-- 晚高峰结束 (* 必填项) START -->  
102 - <div class="col-md-6">  
103 - <label class="control-label col-md-5">  
104 - <span class="required"> * </span> 晚高峰结束时间 :  
105 - </label>  
106 - <div class="col-md-5">  
107 - <input type="text" class="form-control" name="lateEndTime" value="{{map.lateEndTime}}" id="wgfjssjInput"  
108 - placeholder="请输入晚高峰结束时间">  
109 - </div>  
110 - </div>  
111 - <!-- 晚高峰结束 (* 必填项) END -->  
112 - </div>  
113 - <!-- 表单分组组件 form-group END -->  
114 -  
115 - <!-- 表单分组组件 form-group START -->  
116 - <div class="form-group">  
117 <!-- 线路规划类型 (* 必填项) START --> 61 <!-- 线路规划类型 (* 必填项) START -->
118 <div class="col-md-6"> 62 <div class="col-md-6">
119 <label class="control-label col-md-5"> 63 <label class="control-label col-md-5">
@@ -237,76 +181,102 @@ @@ -237,76 +181,102 @@
237 </div> 181 </div>
238 <!-- 表单分组组件 form-group END --> 182 <!-- 表单分组组件 form-group END -->
239 183
240 - <!-- 表单分组组件 form-group START --> 184 + <!-- 表单分组组件 form-group START -->
  185 + <!--<div class="form-group">
  186 + &lt;!&ndash; 低谷最大发车间隙(* 必填项) START &ndash;&gt;
  187 + <div class="col-md-6">
  188 + <label class="control-label col-md-5">
  189 + <span class="required"> * </span> 低谷最大发车间隙:
  190 + </label>
  191 + <div class="col-md-5">
  192 + <input type="text" class="form-control" name="dgmaxfcjx" id="dgmaxfcjxInput" placeholder="请输入低谷最大发车间隙">
  193 + </div>
  194 + </div>
  195 + &lt;!&ndash; 低谷最大发车间隙(* 必填项) END &ndash;&gt;
  196 +
  197 + &lt;!&ndash; 低谷最大停站时间(* 必填项) START &ndash;&gt;
  198 + <div class="col-md-6">
  199 + <label class="control-label col-md-5">
  200 + <span class="required"> * </span> 低谷最大停站时间:
  201 + </label>
  202 + <div class="col-md-5">
  203 + <input type="text" class="form-control" name="dgmaxtzsj" id="dgmaxtzsjInput"
  204 + placeholder="请输入低谷最大停站时间">
  205 + </div>
  206 + </div>
  207 + &lt;!&ndash; 低谷停站时间 (* 必填项) END &ndash;&gt;
  208 + </div>-->
  209 + <!-- 表单分组组件 form-group END -->
  210 +
  211 + <!-- 表单分组组件 form-group START -->
241 <div class="form-group"> 212 <div class="form-group">
242 <div class="col-md-12"> 213 <div class="col-md-12">
243 <div class="col-md-6"> 214 <div class="col-md-6">
244 - <label class="control-label col-md-5"></label>  
245 - <label class="col-md-5">上行行驶时间</label> 215 + <label class="control-label col-md-2"></label>
  216 + <div class="col-md-5">
  217 + <label class="col-md-5">开始时间</label>
  218 + <label class="control-label col-md-1">-</label>
  219 + <label class="col-md-5">结束时间</label>
  220 + </div>
  221 + <label class="control-label col-md-1"> : </label>
  222 + <label class="col-md-4">上行行驶时间</label>
246 </div> 223 </div>
247 <div class="col-md-6"> 224 <div class="col-md-6">
248 <div class="col-md-5"></div> 225 <div class="col-md-5"></div>
249 <label class="col-md-5">下行行驶时间</label> 226 <label class="col-md-5">下行行驶时间</label>
250 -  
251 - <!--<label class="control-label col-md-1"></label>  
252 - <label class="control-label col-md-1">上行发车间隔</label>  
253 - &lt;!&ndash;<label class="control-label col-md-1">上行最大发车间隔</label>&ndash;&gt;  
254 -  
255 - <label class="control-label col-md-2"></label>  
256 - <label class="control-label col-md-1">下行发车间隔</label>-->  
257 - <!--<label class="control-label col-md-1">下行最大发车间隔</label>-->  
258 </div> 227 </div>
259 </div> 228 </div>
260 229
261 <div class="col-md-12"> 230 <div class="col-md-12">
262 <div class="col-md-6"> 231 <div class="col-md-6">
263 - <label class="control-label col-md-5"><span class="required"> * </span>首班-6:30  :</label> 232 + <label class="control-label col-md-2"><span class="required"> * </span>早高峰之前:</label>
  233 + <!-- 早高峰开始时间 (* 必填项) START -->
264 <div class="col-md-5"> 234 <div class="col-md-5">
265 - <input type="text" class="form-control" name="upTravelTime1" id="upTravelTimeInput1" 235 + <div class="col-md-5">
  236 + <input type="text" class="form-control" name="start1" value="04:00" id="startInput1"
  237 + placeholder="开始时间">
  238 + </div>
  239 + <label class="control-label col-md-1">-</label>
  240 + <div class="col-md-5">
  241 + <input type="text" class="form-control" name="end1" value="{{map.earlyStartTime}}" id="endInput1"
  242 + placeholder="结束时间">
  243 + </div>
  244 + </div>
  245 + <label class="control-label col-md-1"> : </label>
  246 + <!-- 早高峰开始时间 (* 必填项) END -->
  247 + <div class="col-md-4">
  248 + <input type="text" class="form-control" name="upTravelTime1" value="{{map.troughUpTime}}" id="upTravelTimeInput1"
266 placeholder="上行行驶时间"> 249 placeholder="上行行驶时间">
267 </div> 250 </div>
268 </div> 251 </div>
269 <div class="col-md-6"> 252 <div class="col-md-6">
270 <div class="col-md-5"></div> 253 <div class="col-md-5"></div>
271 <div class="col-md-5"> 254 <div class="col-md-5">
272 - <input type="text" class="form-control" name="downTravelTime1" id="downTravelTimeInput1" 255 + <input type="text" class="form-control" name="downTravelTime1" value="{{map.troughDownTime}}" id="downTravelTimeInput1"
273 placeholder="下行行驶时间"> 256 placeholder="下行行驶时间">
274 </div> 257 </div>
275 </div> 258 </div>
276 -  
277 - <!--<div class="col-md-3">  
278 - <label class="control-label col-md-1"></label>  
279 - <div class="col-md-5">  
280 - <input type="text" class="form-control" name="upfcjjMin1" id="upfcjjMinInput1"  
281 - placeholder="上行最小间隔">  
282 - </div>  
283 - <label class="control-label col-md-1">-</label>  
284 - <div class="col-md-5">  
285 - <input type="text" class="form-control" name="upfcjjMax1" id="upfcjjMaxInput1"  
286 - placeholder="上行最大间隔">  
287 - </div>  
288 - </div>  
289 -  
290 - <div class="col-md-3">  
291 - <label class="control-label col-md-1"></label>  
292 - <div class="col-md-5">  
293 - <input type="text" class="form-control" name="downfcjjMin1" id="downfcjjMinInput1"  
294 - placeholder="下行最小间隔">  
295 - </div>  
296 - <label class="control-label col-md-1">-</label>  
297 - <div class="col-md-5">  
298 - <input type="text" class="form-control" name="downfcjjMax1" id="downfcjjMaxInput1"  
299 - placeholder="下行最大间隔">  
300 - </div>  
301 - </div>-->  
302 </div> 259 </div>
303 260
304 <!-- 6:31-8:30--> 261 <!-- 6:31-8:30-->
305 <div class="col-md-12"> 262 <div class="col-md-12">
306 <div class="col-md-6"> 263 <div class="col-md-6">
307 - <label class="control-label col-md-5"><span class="required"> * </span>6:31-8:30  :</label>  
308 - <div class="col-md-5">  
309 - <input type="text" class="form-control" valer="{{map.earlyUpTime}}" name="upTravelTime2" id="upTravelTimeInput2" 264 + <label class="control-label col-md-2"><span class="required"> * </span>早高峰:</label>
  265 + <div class="col-md-5">
  266 + <div class="col-md-5">
  267 + <input type="text" class="form-control" name="start2" value="{{map.earlyStartTime}}" id="startInput2"
  268 + placeholder="开始时间">
  269 + </div>
  270 + <label class="control-label col-md-1">-</label>
  271 + <div class="col-md-5">
  272 + <input type="text" class="form-control" name="end2" value="{{map.earlyEndTime}}" id="endInput2"
  273 + placeholder="结束时间">
  274 + </div>
  275 + </div>
  276 + <label class="control-label col-md-1"> : </label>
  277 + <!-- 表单分组组件 form-group END -->
  278 + <div class="col-md-4">
  279 + <input type="text" class="form-control" value="{{map.earlyUpTime}}" name="upTravelTime2" id="upTravelTimeInput2"
310 placeholder="上行行驶时间"> 280 placeholder="上行行驶时间">
311 </div> 281 </div>
312 </div> 282 </div>
@@ -317,39 +287,25 @@ @@ -317,39 +287,25 @@
317 placeholder="下行行驶时间"> 287 placeholder="下行行驶时间">
318 </div> 288 </div>
319 </div> 289 </div>
320 -  
321 - <!--<div class="col-md-3">  
322 - <label class="control-label col-md-1"></label>  
323 - <div class="col-md-5">  
324 - <input type="text" class="form-control" name="upfcjjMin2" id="upfcjjMinInput2"  
325 - placeholder="上行最小间隔">  
326 - </div>  
327 - <label class="control-label col-md-1">-</label>  
328 - <div class="col-md-5">  
329 - <input type="text" class="form-control" name="upfcjjMax2" id="upfcjjMaxInput2"  
330 - placeholder="上行最大间隔">  
331 - </div>  
332 - </div>  
333 -  
334 - <div class="col-md-3">  
335 - <label class="control-label col-md-1"></label>  
336 - <div class="col-md-5">  
337 - <input type="text" class="form-control" name="downfcjjMin2" id="downfcjjMinInput2"  
338 - placeholder="下行最小间隔">  
339 - </div>  
340 - <label class="control-label col-md-1">-</label>  
341 - <div class="col-md-5">  
342 - <input type="text" class="form-control" name="downfcjjMax2" id="downfcjjMaxInput2"  
343 - placeholder="下行最大间隔">  
344 - </div>  
345 - </div>-->  
346 </div> 290 </div>
347 291
348 <!-- 8:31-16:00--> 292 <!-- 8:31-16:00-->
349 <div class="col-md-12"> 293 <div class="col-md-12">
350 <div class="col-md-6"> 294 <div class="col-md-6">
351 - <label class="control-label col-md-5"><span class="required"> * </span>8:31-16:00  :</label> 295 + <label class="control-label col-md-2"><span class="required"> * </span>高峰之间:</label>
352 <div class="col-md-5"> 296 <div class="col-md-5">
  297 + <div class="col-md-5">
  298 + <input type="text" class="form-control" name="start3" value="{{map.earlyEndTime}}" id="startInput3"
  299 + placeholder="开始时间">
  300 + </div>
  301 + <label class="control-label col-md-1">-</label>
  302 + <div class="col-md-5">
  303 + <input type="text" class="form-control" name="end3" value="{{map.lateStartTime}}" id="endInput3"
  304 + placeholder="结束时间">
  305 + </div>
  306 + </div>
  307 + <label class="control-label col-md-1"> : </label>
  308 + <div class="col-md-4">
353 <input type="text" class="form-control" value="{{map.troughUpTime}}" name="upTravelTime3" id="upTravelTimeInput3" 309 <input type="text" class="form-control" value="{{map.troughUpTime}}" name="upTravelTime3" id="upTravelTimeInput3"
354 placeholder="上行行驶时间"> 310 placeholder="上行行驶时间">
355 </div> 311 </div>
@@ -361,39 +317,25 @@ @@ -361,39 +317,25 @@
361 placeholder="下行行驶时间"> 317 placeholder="下行行驶时间">
362 </div> 318 </div>
363 </div> 319 </div>
364 -  
365 - <!--<div class="col-md-3">  
366 - <label class="control-label col-md-1"></label>  
367 - <div class="col-md-5">  
368 - <input type="text" class="form-control" name="upfcjjMin3" id="upfcjjMinInput3"  
369 - placeholder="上行最小间隔">  
370 - </div>  
371 - <label class="control-label col-md-1">-</label>  
372 - <div class="col-md-5">  
373 - <input type="text" class="form-control" name="upfcjjMax3" id="upfcjjMaxInput3"  
374 - placeholder="上行最大间隔">  
375 - </div>  
376 - </div>  
377 -  
378 - <div class="col-md-3">  
379 - <label class="control-label col-md-1"></label>  
380 - <div class="col-md-5">  
381 - <input type="text" class="form-control" name="downfcjjMin3" id="downfcjjMinInput3"  
382 - placeholder="下行最小间隔">  
383 - </div>  
384 - <label class="control-label col-md-1">-</label>  
385 - <div class="col-md-5">  
386 - <input type="text" class="form-control" name="downfcjjMax3" id="downfcjjMaxInput3"  
387 - placeholder="下行最大间隔">  
388 - </div>  
389 - </div>-->  
390 </div> 320 </div>
391 321
392 <!-- 16:01-18:00--> 322 <!-- 16:01-18:00-->
393 <div class="col-md-12"> 323 <div class="col-md-12">
394 <div class="col-md-6"> 324 <div class="col-md-6">
395 - <label class="control-label col-md-5"><span class="required"> * </span>16:01-18:00  :</label> 325 + <label class="control-label col-md-2"><span class="required"> * </span>晚高峰:</label>
396 <div class="col-md-5"> 326 <div class="col-md-5">
  327 + <div class="col-md-5">
  328 + <input type="text" class="form-control" name="start4" value="{{map.lateStartTime}}" id="startInput4"
  329 + placeholder="开始时间">
  330 + </div>
  331 + <label class="control-label col-md-1">-</label>
  332 + <div class="col-md-5">
  333 + <input type="text" class="form-control" name="end4" value="{{map.lateEndTime}}" id="endInput4"
  334 + placeholder="结束时间">
  335 + </div>
  336 + </div>
  337 + <label class="control-label col-md-1"> : </label>
  338 + <div class="col-md-4">
397 <input type="text" class="form-control" value="{{map.lateUpTime}}" name="upTravelTime4" id="upTravelTimeInput4" 339 <input type="text" class="form-control" value="{{map.lateUpTime}}" name="upTravelTime4" id="upTravelTimeInput4"
398 placeholder="上行行驶时间"> 340 placeholder="上行行驶时间">
399 </div> 341 </div>
@@ -405,76 +347,36 @@ @@ -405,76 +347,36 @@
405 placeholder="下行行驶时间"> 347 placeholder="下行行驶时间">
406 </div> 348 </div>
407 </div> 349 </div>
408 -  
409 - <!--<div class="col-md-3">  
410 - <label class="control-label col-md-1"></label>  
411 - <div class="col-md-5">  
412 - <input type="text" class="form-control" name="upfcjjMin4" id="upfcjjMinInput4"  
413 - placeholder="上行最小间隔">  
414 - </div>  
415 - <label class="control-label col-md-1">-</label>  
416 - <div class="col-md-5">  
417 - <input type="text" class="form-control" name="upfcjjMax4" id="upfcjjMaxInput4"  
418 - placeholder="上行最大间隔">  
419 - </div>  
420 - </div>  
421 -  
422 - <div class="col-md-3">  
423 - <label class="control-label col-md-1"></label>  
424 - <div class="col-md-5">  
425 - <input type="text" class="form-control" name="downfcjjMin4" id="downfcjjMinInput4"  
426 - placeholder="下行最小间隔">  
427 - </div>  
428 - <label class="control-label col-md-1">-</label>  
429 - <div class="col-md-5">  
430 - <input type="text" class="form-control" name="downfcjjMax4" id="downfcjjMaxInput4"  
431 - placeholder="下行最大间隔">  
432 - </div>  
433 - </div>-->  
434 </div> 350 </div>
435 351
436 <!-- 18:00-末班--> 352 <!-- 18:00-末班-->
437 <div class="col-md-12"> 353 <div class="col-md-12">
438 <div class="col-md-6"> 354 <div class="col-md-6">
439 - <label class="control-label col-md-5"><span class="required"> * </span>18:00-末班  :</label> 355 + <label class="control-label col-md-2"><span class="required"> * </span>晚高峰之后:</label>
440 <div class="col-md-5"> 356 <div class="col-md-5">
441 - <input type="text" class="form-control" name="upTravelTime5" id="upTravelTimeInput5" 357 + <div class="col-md-5">
  358 + <input type="text" class="form-control" name="start5" value="{{map.lateEndTime}}" id="startInput5"
  359 + placeholder="开始时间">
  360 + </div>
  361 + <label class="control-label col-md-1">-</label>
  362 + <div class="col-md-5">
  363 + <input type="text" class="form-control" name="end5" value="23:59" id="endInput5"
  364 + placeholder="结束时间">
  365 + </div>
  366 + </div>
  367 + <label class="control-label col-md-1"> : </label>
  368 + <div class="col-md-4">
  369 + <input type="text" class="form-control" value="{{map.troughUpTime}}" name="upTravelTime5" id="upTravelTimeInput5"
442 placeholder="上行行驶时间"> 370 placeholder="上行行驶时间">
443 </div> 371 </div>
444 </div> 372 </div>
445 <div class="col-md-6"> 373 <div class="col-md-6">
446 <div class="col-md-5"></div> 374 <div class="col-md-5"></div>
447 <div class="col-md-5"> 375 <div class="col-md-5">
448 - <input type="text" class="form-control" name="downTravelTime5" id="downTravelTimeInput5" 376 + <input type="text" class="form-control" value="{{map.troughDownTime}}" name="downTravelTime5" id="downTravelTimeInput5"
449 placeholder="下行行驶时间"> 377 placeholder="下行行驶时间">
450 </div> 378 </div>
451 </div> 379 </div>
452 -  
453 - <!--<div class="col-md-3">  
454 - <label class="control-label col-md-1"></label>  
455 - <div class="col-md-5">  
456 - <input type="text" class="form-control" name="upfcjjMin5" id="upfcjjMinInput5"  
457 - placeholder="上行最小间隔">  
458 - </div>  
459 - <label class="control-label col-md-1">-</label>  
460 - <div class="col-md-5">  
461 - <input type="text" class="form-control" name="upfcjjMax5" id="upfcjjMaxInput5"  
462 - placeholder="上行最大间隔">  
463 - </div>  
464 - </div>  
465 -  
466 - <div class="col-md-3">  
467 - <label class="control-label col-md-1"></label>  
468 - <div class="col-md-5">  
469 - <input type="text" class="form-control" name="downfcjjMin5" id="downfcjjMinInput5"  
470 - placeholder="下行最小间隔">  
471 - </div>  
472 - <label class="control-label col-md-1">-</label>  
473 - <div class="col-md-5">  
474 - <input type="text" class="form-control" name="downfcjjMax5" id="downfcjjMaxInput5"  
475 - placeholder="下行最大间隔">  
476 - </div>  
477 - </div>-->  
478 </div> 380 </div>
479 </div> 381 </div>
480 <!-- 表单分组组件 form-group END --> 382 <!-- 表单分组组件 form-group END -->
@@ -602,6 +504,8 @@ @@ -602,6 +504,8 @@
602 <input type="hidden" name="downInMileage" value="{{map.downInMileage}}" id="downInlcInput"/> 504 <input type="hidden" name="downInMileage" value="{{map.downInMileage}}" id="downInlcInput"/>
603 <input type="hidden" name="upOutMileage" value="{{map.upOutMileage}}" id="upOutlcInput"/> 505 <input type="hidden" name="upOutMileage" value="{{map.upOutMileage}}" id="upOutlcInput"/>
604 <input type="hidden" name="downOutMileage" value="{{map.downOutMileage}}" id="downOutlcInput"/> 506 <input type="hidden" name="downOutMileage" value="{{map.downOutMileage}}" id="downOutlcInput"/>
  507 + <!--线路等级-->
  508 + <input type="hidden" name="level" value="{{map.line.level}}" id="level"/>
605 509
606 </script> 510 </script>
607 511
@@ -675,56 +579,6 @@ @@ -675,56 +579,6 @@
675 579
676 <!-- 表单分组组件 form-group START --> 580 <!-- 表单分组组件 form-group START -->
677 <div class="form-group"> 581 <div class="form-group">
678 - <!-- 早高峰开始时间(* 必填项) START -->  
679 - <div class="col-md-6">  
680 - <label class="control-label col-md-5">  
681 - <span class="required"> * </span> 早高峰开始时间 :  
682 - </label>  
683 - <div class="col-md-4">  
684 - <p class="form-control-static" data-display="earlyStartTime"> </p>  
685 - </div>  
686 - </div>  
687 - <!-- 早高峰开始时间 (* 必填项) END -->  
688 - <!-- 早高峰结束时间 (* 必填项) START -->  
689 - <div class="col-md-6">  
690 - <label class="control-label col-md-5">  
691 - <span class="required"> * </span> 早高峰结束时间 :  
692 - </label>  
693 - <div class="col-md-4">  
694 - <p class="form-control-static" data-display="earlyEndTime"> </p>  
695 - </div>  
696 - </div>  
697 - <!-- 早高峰结束时间 (* 必填项) END -->  
698 - </div>  
699 - <!-- 表单分组组件 form-group END -->  
700 -  
701 - <!-- 表单分组组件 form-group START -->  
702 - <div class="form-group">  
703 - <!-- 晚高峰开始时间(* 必填项) START -->  
704 - <div class="col-md-6">  
705 - <label class="control-label col-md-5">  
706 - <span class="required"> * </span> 晚高峰开始时间 :  
707 - </label>  
708 - <div class="col-md-4">  
709 - <p class="form-control-static" data-display="lateStartTime"> </p>  
710 - </div>  
711 - </div>  
712 - <!-- 晚高峰开始时间(* 必填项) END -->  
713 - <!-- 晚高峰结束时间(* 必填项) START -->  
714 - <div class="col-md-6">  
715 - <label class="control-label col-md-5">  
716 - <span class="required"> * </span> 晚高峰结束时间 :  
717 - </label>  
718 - <div class="col-md-4">  
719 - <p class="form-control-static" data-display="lateEndTime"> </p>  
720 - </div>  
721 - </div>  
722 - <!-- 晚高峰结束时间(* 必填项) END -->  
723 - </div>  
724 - <!-- 表单分组组件 form-group END -->  
725 -  
726 - <!-- 表单分组组件 form-group START -->  
727 - <div class="form-group">  
728 <!-- 线路规划类型 (* 必填项) START --> 582 <!-- 线路规划类型 (* 必填项) START -->
729 <div class="col-md-6"> 583 <div class="col-md-6">
730 <label class="control-label col-md-5"> 584 <label class="control-label col-md-5">
@@ -829,38 +683,44 @@ @@ -829,38 +683,44 @@
829 </div> 683 </div>
830 <!-- 表单分组组件 form-group END --> 684 <!-- 表单分组组件 form-group END -->
831 685
832 - <!-- 表单分组组件 form-group START -->  
833 - <div class="form-group">  
834 - <!-- 班型与人次 START -->  
835 - <div class="col-md-6">  
836 - <label class="control-label col-md-5">  
837 - <span class="required"> * </span> 班型/人次/车辆 :  
838 - </label>  
839 - <div class="col-md-4">  
840 - <p class="form-control-static" data-display="bxrc"> </p>  
841 - </div>  
842 - </div>  
843 - <!-- 班型与人次 END -->  
844 - <!-- 车辆总数 START -->  
845 - <div class="col-md-6">  
846 - <label class="control-label col-md-5">  
847 - <span class="required"> * </span> 车辆总数    :  
848 - </label>  
849 - <div class="col-md-4">  
850 - <p class="form-control-static" data-display="clzs"> </p>  
851 - </div>  
852 - </div>  
853 - <!-- 车辆总数 END -->  
854 - </div>  
855 - <!-- 表单分组组件 form-group END --> 686 + <!-- 表单分组组件 form-group START -->
  687 + <!-- <div class="form-group">
  688 + &lt;!&ndash; 低谷最大发车间隙(* 必填项) START &ndash;&gt;
  689 + <div class="col-md-6">
  690 + <label class="control-label col-md-5">
  691 + <span class="required"> * </span> 低谷最大发车间隙:
  692 + </label>
  693 + <div class="col-md-4">
  694 + <p class="form-control-static" data-display="dgmaxfcjx"> </p>
  695 + </div>
  696 + </div>
  697 + &lt;!&ndash; 低谷最大发车间隙(* 必填项) END &ndash;&gt;
856 698
  699 + &lt;!&ndash; 低谷最大停站时间(* 必填项) START &ndash;&gt;
  700 + <div class="col-md-6">
  701 + <label class="control-label col-md-5">
  702 + <span class="required"> * </span> 低谷最大停站时间:
  703 + </label>
  704 + <div class="col-md-4">
  705 + <p class="form-control-static" data-display="dgmaxtzsj"> </p>
  706 + </div>
  707 + </div>
  708 + &lt;!&ndash; 低谷最大停站时间(* 必填项) END &ndash;&gt;
  709 + </div>-->
  710 + <!-- 表单分组组件 form-group END -->
857 711
858 <!-- 表单分组组件 form-group START --> 712 <!-- 表单分组组件 form-group START -->
859 <div class="form-group"> 713 <div class="form-group">
860 <div class="col-md-12"> 714 <div class="col-md-12">
861 <div class="col-md-6"> 715 <div class="col-md-6">
862 - <label class="control-label col-md-5"></label>  
863 - <label class="col-md-5">上行行驶时间</label> 716 + <label class="control-label col-md-2"></label>
  717 + <div class="col-md-5">
  718 + <label class="col-md-5">开始时间</label>
  719 + <label class="control-label col-md-1">-</label>
  720 + <label class="col-md-5">结束时间</label>
  721 + </div>
  722 + <label class="control-label col-md-1"> : </label>
  723 + <label class="col-md-4">上行行驶时间</label>
864 </div> 724 </div>
865 <div class="col-md-6"> 725 <div class="col-md-6">
866 <div class="col-md-5"></div> 726 <div class="col-md-5"></div>
@@ -870,8 +730,18 @@ @@ -870,8 +730,18 @@
870 730
871 <div class="col-md-12"> 731 <div class="col-md-12">
872 <div class="col-md-6"> 732 <div class="col-md-6">
873 - <label class="control-label col-md-5"><span class="required"> * </span>首班-6:30  :</label> 733 + <label class="control-label col-md-2"><span class="required"> * </span>早高峰之前:</label>
874 <div class="col-md-5"> 734 <div class="col-md-5">
  735 + <div class="col-md-5">
  736 + <p class="form-control-static" data-display="start1"></p>
  737 + </div>
  738 + <label class="control-label col-md-1">-</label>
  739 + <div class="col-md-5">
  740 + <p class="form-control-static" data-display="end1"></p>
  741 + </div>
  742 + </div>
  743 + <label class="control-label col-md-1"> : </label>
  744 + <div class="col-md-4">
875 <p class="form-control-static" data-display="upTravelTime1"> </p> 745 <p class="form-control-static" data-display="upTravelTime1"> </p>
876 </div> 746 </div>
877 </div> 747 </div>
@@ -886,8 +756,18 @@ @@ -886,8 +756,18 @@
886 <!-- 6:31-8:30--> 756 <!-- 6:31-8:30-->
887 <div class="col-md-12"> 757 <div class="col-md-12">
888 <div class="col-md-6"> 758 <div class="col-md-6">
889 - <label class="control-label col-md-5"><span class="required"> * </span>6:31-8:30  :</label> 759 + <label class="control-label col-md-2"><span class="required"> * </span>早高峰:</label>
890 <div class="col-md-5"> 760 <div class="col-md-5">
  761 + <div class="col-md-5">
  762 + <p class="form-control-static" data-display="start2"></p>
  763 + </div>
  764 + <label class="control-label col-md-1">-</label>
  765 + <div class="col-md-5">
  766 + <p class="form-control-static" data-display="end2"></p>
  767 + </div>
  768 + </div>
  769 + <label class="control-label col-md-1"> : </label>
  770 + <div class="col-md-4">
891 <p class="form-control-static" data-display="upTravelTime2"> </p> 771 <p class="form-control-static" data-display="upTravelTime2"> </p>
892 </div> 772 </div>
893 </div> 773 </div>
@@ -902,8 +782,18 @@ @@ -902,8 +782,18 @@
902 <!-- 8:31-16:00--> 782 <!-- 8:31-16:00-->
903 <div class="col-md-12"> 783 <div class="col-md-12">
904 <div class="col-md-6"> 784 <div class="col-md-6">
905 - <label class="control-label col-md-5"><span class="required"> * </span>8:31-16:00  :</label> 785 + <label class="control-label col-md-2"><span class="required"> * </span>早高峰之后:</label>
906 <div class="col-md-5"> 786 <div class="col-md-5">
  787 + <div class="col-md-5">
  788 + <p class="form-control-static" data-display="start3"></p>
  789 + </div>
  790 + <label class="control-label col-md-1">-</label>
  791 + <div class="col-md-5">
  792 + <p class="form-control-static" data-display="end3"></p>
  793 + </div>
  794 + </div>
  795 + <label class="control-label col-md-1"> : </label>
  796 + <div class="col-md-4">
907 <p class="form-control-static" data-display="upTravelTime3"> </p> 797 <p class="form-control-static" data-display="upTravelTime3"> </p>
908 </div> 798 </div>
909 </div> 799 </div>
@@ -918,8 +808,18 @@ @@ -918,8 +808,18 @@
918 <!-- 16:01-18:00--> 808 <!-- 16:01-18:00-->
919 <div class="col-md-12"> 809 <div class="col-md-12">
920 <div class="col-md-6"> 810 <div class="col-md-6">
921 - <label class="control-label col-md-5"><span class="required"> * </span>16:01-18:00  :</label> 811 + <label class="control-label col-md-2"><span class="required"> * </span>晚高峰:</label>
922 <div class="col-md-5"> 812 <div class="col-md-5">
  813 + <div class="col-md-5">
  814 + <p class="form-control-static" data-display="start4"></p>
  815 + </div>
  816 + <label class="control-label col-md-1">-</label>
  817 + <div class="col-md-5">
  818 + <p class="form-control-static" data-display="end4"></p>
  819 + </div>
  820 + </div>
  821 + <label class="control-label col-md-1"> : </label>
  822 + <div class="col-md-4">
923 <p class="form-control-static" data-display="upTravelTime4"> </p> 823 <p class="form-control-static" data-display="upTravelTime4"> </p>
924 </div> 824 </div>
925 </div> 825 </div>
@@ -934,8 +834,18 @@ @@ -934,8 +834,18 @@
934 <!-- 18:00-末班--> 834 <!-- 18:00-末班-->
935 <div class="col-md-12"> 835 <div class="col-md-12">
936 <div class="col-md-6"> 836 <div class="col-md-6">
937 - <label class="control-label col-md-5"><span class="required"> * </span>18:00-末班  :</label> 837 + <label class="control-label col-md-2"><span class="required"> * </span>晚高峰之后:</label>
938 <div class="col-md-5"> 838 <div class="col-md-5">
  839 + <div class="col-md-5">
  840 + <p class="form-control-static" data-display="start5"></p>
  841 + </div>
  842 + <label class="control-label col-md-1">-</label>
  843 + <div class="col-md-5">
  844 + <p class="form-control-static" data-display="end5"></p>
  845 + </div>
  846 + </div>
  847 + <label class="control-label col-md-1"> : </label>
  848 + <div class="col-md-4">
939 <p class="form-control-static" data-display="upTravelTime5"> </p> 849 <p class="form-control-static" data-display="upTravelTime5"> </p>
940 </div> 850 </div>
941 </div> 851 </div>
@@ -948,4 +858,29 @@ @@ -948,4 +858,29 @@
948 </div> 858 </div>
949 </div> 859 </div>
950 <!-- 表单分组组件 form-group END --> 860 <!-- 表单分组组件 form-group END -->
  861 +
  862 + <!-- 表单分组组件 form-group START -->
  863 + <div class="form-group">
  864 + <!-- 班型与人次 START -->
  865 + <div class="col-md-6">
  866 + <label class="control-label col-md-5">
  867 + <span class="required"> * </span> 班型/人次/车辆 :
  868 + </label>
  869 + <div class="col-md-4">
  870 + <p class="form-control-static" data-display="bxrc"> </p>
  871 + </div>
  872 + </div>
  873 + <!-- 班型与人次 END -->
  874 + <!-- 车辆总数 START -->
  875 + <div class="col-md-6">
  876 + <label class="control-label col-md-5">
  877 + <span class="required"> * </span> 车辆总数    :
  878 + </label>
  879 + <div class="col-md-4">
  880 + <p class="form-control-static" data-display="clzs"> </p>
  881 + </div>
  882 + </div>
  883 + <!-- 车辆总数 END -->
  884 + </div>
  885 + <!-- 表单分组组件 form-group END -->
951 </script> 886 </script>
952 \ No newline at end of file 887 \ No newline at end of file
src/main/resources/static/pages/electricity/list/list.html
@@ -273,7 +273,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -273,7 +273,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
273 if ($("#rq").val() != "") { 273 if ($("#rq").val() != "") {
274 var params=getParamsList(); 274 var params=getParamsList();
275 $get('/ylb/checkDate',params,function(status){ 275 $get('/ylb/checkDate',params,function(status){
276 - if(status=='3'){ 276 + if(status=='2'){
277 layer.msg('只能操作三天内数据.'); 277 layer.msg('只能操作三天内数据.');
278 }else{ 278 }else{
279 var i = layer.load(2); 279 var i = layer.load(2);
@@ -294,7 +294,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -294,7 +294,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
294 if ($("#rq").val() != "") { 294 if ($("#rq").val() != "") {
295 var params=getParamsList(); 295 var params=getParamsList();
296 $get('/ylb/checkDate',params,function(status){ 296 $get('/ylb/checkDate',params,function(status){
297 - if(status=='3'){ 297 + if(status=='2'){
298 layer.msg('只能操作三天内数据.'); 298 layer.msg('只能操作三天内数据.');
299 }else{ 299 }else{
300 var i = layer.load(2); 300 var i = layer.load(2);
@@ -314,7 +314,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -314,7 +314,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
314 $("#saveButton").on('click',function(){ 314 $("#saveButton").on('click',function(){
315 var params_=getParamsList(); 315 var params_=getParamsList();
316 $get('/ylb/checkDate',params_,function(status){ 316 $get('/ylb/checkDate',params_,function(status){
317 - if(status=='3'){ 317 + if(status=='2'){
318 layer.msg('只能操作三天内数据.'); 318 layer.msg('只能操作三天内数据.');
319 }else{ 319 }else{
320 var ylArray = []; 320 var ylArray = [];
@@ -426,7 +426,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -426,7 +426,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
426 if ($("#rq").val() != "") { 426 if ($("#rq").val() != "") {
427 var params=getParamsList(); 427 var params=getParamsList();
428 $get('/ylb/checkDate',params,function(status){ 428 $get('/ylb/checkDate',params,function(status){
429 - if(status=='3'){ 429 + if(status=='2'){
430 layer.msg('只能操作三天内数据.'); 430 layer.msg('只能操作三天内数据.');
431 }else{ 431 }else{
432 var i = layer.load(2); 432 var i = layer.load(2);
@@ -590,7 +590,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -590,7 +590,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
590 var params=getParamsList(); 590 var params=getParamsList();
591 var id = $(this).data('id'); 591 var id = $(this).data('id');
592 $get('/ylb/checkDate',params,function(status){ 592 $get('/ylb/checkDate',params,function(status){
593 - if(status=='3'){ 593 + if(status=='2'){
594 layer.msg('只能操作三天内数据.'); 594 layer.msg('只能操作三天内数据.');
595 }else{ 595 }else{
596 var jsy=$('.in_carpark_jsy[data-id='+id+']', '#dl_oil_list').val(); 596 var jsy=$('.in_carpark_jsy[data-id='+id+']', '#dl_oil_list').val();
@@ -734,7 +734,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -734,7 +734,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
734 $('#removeButton').on('click', function () { 734 $('#removeButton').on('click', function () {
735 var params_=getParamsList(); 735 var params_=getParamsList();
736 $get('/ylb/checkDate',params_,function(status){ 736 $get('/ylb/checkDate',params_,function(status){
737 - if(status=='3'){ 737 + if(status=='2'){
738 layer.msg('只能操作三天内数据.'); 738 layer.msg('只能操作三天内数据.');
739 }else{ 739 }else{
740 var idArray = []; 740 var idArray = [];
src/main/resources/static/pages/forms/statement/historyMessage.html
@@ -159,7 +159,7 @@ @@ -159,7 +159,7 @@
159 var type = "query"; 159 var type = "query";
160 $(".hidden").removeClass("hidden"); 160 $(".hidden").removeClass("hidden");
161 var i = layer.load(2); 161 var i = layer.load(2);
162 - if(code==""||code==null){ 162 +// if(code==""||code==null){
163 $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){ 163 $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){
164 // 把数据填充到模版中 164 // 把数据填充到模版中
165 var tbodyHtml = template('list_history',{list:result}); 165 var tbodyHtml = template('list_history',{list:result});
@@ -173,7 +173,7 @@ @@ -173,7 +173,7 @@
173 $("#export").removeAttr("disabled"); 173 $("#export").removeAttr("disabled");
174 174
175 }); 175 });
176 - }else{ 176 + /* }else{
177 $get('/report/historyMessageList',{line:line,date:date,code:code,type:type},function(result){ 177 $get('/report/historyMessageList',{line:line,date:date,code:code,type:type},function(result){
178 // 把数据填充到模版中 178 // 把数据填充到模版中
179 var tbodyHtml = template('list_history_msg',{list:result}); 179 var tbodyHtml = template('list_history_msg',{list:result});
@@ -187,21 +187,21 @@ @@ -187,21 +187,21 @@
187 $("#export").removeAttr("disabled"); 187 $("#export").removeAttr("disabled");
188 188
189 }); 189 });
190 - } 190 + } */
191 191
192 }); 192 });
193 193
194 $("#export").on("click",function(){ 194 $("#export").on("click",function(){
195 var type = "export"; 195 var type = "export";
196 var i = layer.load(2); 196 var i = layer.load(2);
197 - if(code==""||code==null){ 197 +// if(code==""||code==null){
198 $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){ 198 $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){
199 window.open("/downloadFile/download?fileName=" 199 window.open("/downloadFile/download?fileName="
200 +moment(date).format("YYYYMMDD") 200 +moment(date).format("YYYYMMDD")
201 +"-"+lineName+"-调度历史消息"); 201 +"-"+lineName+"-调度历史消息");
202 layer.close(i); 202 layer.close(i);
203 }); 203 });
204 - }else{ 204 + /* }else{
205 $get('/report/historyMessageList',{line:line,date:date,code:code,type:"export_msg"},function(result){ 205 $get('/report/historyMessageList',{line:line,date:date,code:code,type:"export_msg"},function(result){
206 window.open("/downloadFile/download?fileName=" 206 window.open("/downloadFile/download?fileName="
207 +moment(date).format("YYYYMMDD")+"-"+lineName+"-调度消息分析"); 207 +moment(date).format("YYYYMMDD")+"-"+lineName+"-调度消息分析");
@@ -209,7 +209,7 @@ @@ -209,7 +209,7 @@
209 209
210 }); 210 });
211 211
212 - } 212 + } */
213 }); 213 });
214 214
215 }); 215 });
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -446,7 +446,7 @@ @@ -446,7 +446,7 @@
446 divFrom2 = window.document.getElementById('forms_1'); 446 divFrom2 = window.document.getElementById('forms_1');
447 divFrom2.style.width=divFrom1.offsetWidth+"px"; 447 divFrom2.style.width=divFrom1.offsetWidth+"px";
448 }); 448 });
449 - $.get('/realSchedule/realScheduleList',{line:line,date:date,type:"query"},function(result){ 449 + $.get('/realSchedule/realScheduleList_zrw',{line:line,date:date,type:"query"},function(result){
450 getTime(result); 450 getTime(result);
451 var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); 451 var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
452 $('#forms_2 .scheduleDaily_3').html(scheduleDaily_3); 452 $('#forms_2 .scheduleDaily_3').html(scheduleDaily_3);
@@ -492,6 +492,7 @@ @@ -492,6 +492,7 @@
492 params['xlName'] = xlName; 492 params['xlName'] = xlName;
493 params['type'] = "export"; 493 params['type'] = "export";
494 params['state'] = '2'; 494 params['state'] = '2';
  495 + params['genre'] = 'fqp';
495 $get('/realSchedule/scheduleDailyExport', params, function(result){ 496 $get('/realSchedule/scheduleDailyExport', params, function(result){
496 if(date.length == 10) 497 if(date.length == 10)
497 window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报"); 498 window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报");
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 </div> 42 </div>
43 </form> 43 </form>
44 </div> 44 </div>
45 - <div class="portlet-body"> 45 + <div class="portlet-body" id="ddrbExport">
46 <div class="table-container" id="ddrbBody" style="margin-top: 10px;overflow:auto;min-width: 906px"> 46 <div class="table-container" id="ddrbBody" style="margin-top: 10px;overflow:auto;min-width: 906px">
47 <label>日期:<span id="rqxs"></span>&nbsp;&nbsp;&nbsp;&nbsp;早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label> 47 <label>日期:<span id="rqxs"></span>&nbsp;&nbsp;&nbsp;&nbsp;早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
48 <table class="table table-bordered table-hover table-checkable" id="forms"> 48 <table class="table table-bordered table-hover table-checkable" id="forms">
@@ -111,54 +111,6 @@ @@ -111,54 +111,6 @@
111 <tr> 111 <tr>
112 <td colspan="40">&nbsp;</td> 112 <td colspan="40">&nbsp;</td>
113 </tr> 113 </tr>
114 - <!-- <tr>  
115 - <td colspan="40">合计</td>  
116 - </tr>  
117 - <tr>  
118 - <td>售票</td>  
119 - <td colspan="2">1元</td>  
120 - <td colspan="2">2元</td>  
121 - <td colspan="2">3元</td>  
122 - <td colspan="2">4元</td>  
123 - <td colspan="2">5元</td>  
124 - <td colspan="2">6元</td>  
125 - <td colspan="2">7元</td>  
126 - <td colspan="2">8元</td>  
127 - <td colspan="2">9元</td>  
128 - <td colspan="2">10元</td>  
129 - <td colspan="2">&nbsp;</td>  
130 - <td colspan="2">合计张数</td>  
131 - <td colspan="2">&nbsp;</td>  
132 - <td colspan="2">预售票</td>  
133 - <td colspan="2">1元</td>  
134 - <td colspan="2">1.5元</td>  
135 - <td colspan="2">合计张数</td>  
136 - <td colspan="5">&nbsp;</td>  
137 - </tr>  
138 - <tr>  
139 - <td>张数</td>  
140 - <td colspan="2">&nbsp;</td>  
141 - <td colspan="2">&nbsp;</td>  
142 - <td colspan="2">&nbsp;</td>  
143 - <td colspan="2">&nbsp;</td>  
144 - <td colspan="2">&nbsp;</td>  
145 - <td colspan="2">&nbsp;</td>  
146 - <td colspan="2">&nbsp;</td>  
147 - <td colspan="2">&nbsp;</td>  
148 - <td colspan="2">&nbsp;</td>  
149 - <td colspan="2">&nbsp;</td>  
150 - <td colspan="2">&nbsp;</td>  
151 - <td colspan="2">合计金额</td>  
152 - <td colspan="2">&nbsp;</td>  
153 - <td colspan="2">张数</td>  
154 - <td colspan="2">&nbsp;</td>  
155 - <td colspan="2">&nbsp;</td>  
156 - <td colspan="2">合计金额</td>  
157 - <td colspan="5">&nbsp;</td>  
158 - </tr>  
159 - <tr>  
160 - <td colspan="40">&nbsp;</td>  
161 - </tr> -->  
162 <tr> 114 <tr>
163 <td colspan="2">路牌</td> 115 <td colspan="2">路牌</td>
164 <td colspan="2">车号</td> 116 <td colspan="2">车号</td>
@@ -251,7 +203,7 @@ @@ -251,7 +203,7 @@
251 </div> 203 </div>
252 </div> 204 </div>
253 </div> 205 </div>
254 - 206 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
255 <script> 207 <script>
256 $(function(){ 208 $(function(){
257 209
@@ -363,17 +315,28 @@ @@ -363,17 +315,28 @@
363 layer.msg("请选择时间"); 315 layer.msg("请选择时间");
364 return; 316 return;
365 } 317 }
  318 + /* $("#ddrbExport").table2excel({
  319 + // 不被导出的表格行的CSS class类
  320 + exclude: ".noExl",
  321 + // 导出的Excel文档的名称,(没看到作用)
  322 + name: "Excel Document Name.xlsx",
  323 + // Excel文件的名称
  324 + filename: date+"调度日报"
  325 + }); */
  326 + var lineName = $('#line option:selected').text();
366 params['line'] = line; 327 params['line'] = line;
  328 + params['lineName'] = lineName;
367 params['date'] = date; 329 params['date'] = date;
368 params['xlName'] = xlName; 330 params['xlName'] = xlName;
369 params['type'] = "export"; 331 params['type'] = "export";
370 params['state'] = '2'; 332 params['state'] = '2';
  333 + params['genre'] = 'qp';
371 $get('/realSchedule/scheduleDailyExport', params, function(result){ 334 $get('/realSchedule/scheduleDailyExport', params, function(result){
372 if(date.length == 10) 335 if(date.length == 10)
373 - window.open("/downloadFile/download?fileName=调度日报"+moment(date).format("YYYYMMDD")); 336 + window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报");
374 else 337 else
375 - window.open("/downloadFile/download?fileName=调度日报"+moment(date).format("YYYYMM"));  
376 - }); 338 + window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报");
  339 + });
377 }); 340 });
378 341
379 }); 342 });
src/main/resources/static/pages/forms/statement/statisticsDailyCalc2.html
@@ -312,7 +312,7 @@ @@ -312,7 +312,7 @@
312 params['nature']=nature; 312 params['nature']=nature;
313 var i = layer.load(2); 313 var i = layer.load(2);
314 // $get('/realSchedule/statisticsDailyTj',params,function(result){ 314 // $get('/realSchedule/statisticsDailyTj',params,function(result){
315 - $get('/calcWaybill/calcStatisticsDaily2',params,function(result){ 315 + $get('/calcWaybill/calcStatisticsDaily',params,function(result){
316 // 把数据填充到模版中 316 // 把数据填充到模版中
317 var tbodyHtml = template('statisticsDailyCalc2',{list:result}); 317 var tbodyHtml = template('statisticsDailyCalc2',{list:result});
318 // 把渲染好的模版html文本追加到表格中 318 // 把渲染好的模版html文本追加到表格中
@@ -340,7 +340,7 @@ @@ -340,7 +340,7 @@
340 params['nature']=nature; 340 params['nature']=nature;
341 var i = layer.load(2); 341 var i = layer.load(2);
342 // $get('/realSchedule/statisticsDailyTj',params,function(result){ 342 // $get('/realSchedule/statisticsDailyTj',params,function(result){
343 - $get('/calcWaybill/calcStatisticsDaily2',params,function(result){ 343 + $get('/calcWaybill/calcStatisticsDaily',params,function(result){
344 var dateTime = ""; 344 var dateTime = "";
345 if(date == date2){ 345 if(date == date2){
346 dateTime = moment(date).format("YYYYMMDD"); 346 dateTime = moment(date).format("YYYYMMDD");
@@ -362,45 +362,45 @@ @@ -362,45 +362,45 @@
362 <td>{{obj.fgsName}}</td> 362 <td>{{obj.fgsName}}</td>
363 <td>{{obj.xlName}}</td> 363 <td>{{obj.xlName}}</td>
364 <td>{{obj.jhzlc}}</td> 364 <td>{{obj.jhzlc}}</td>
365 - <td>{{obj.jhlc}}</td>  
366 - <td>{{obj.jcclc}}</td>  
367 - <td>{{obj.sjzgl}}</td>  
368 - <td>{{obj.sjgl}}</td>  
369 - <td>{{obj.sjksgl}}</td>  
370 - <td>{{obj.ssgl}}</td> 365 + <td>{{obj.jhyylc}}</td>
  366 + <td>{{obj.jhkslc}}</td>
  367 + <td>{{obj.sjzlc}}</td>
  368 + <td>{{obj.sjyylc}}</td>
  369 + <td>{{obj.sjkslc}}</td>
  370 + <td>{{obj.sslc}}</td>
371 <td>{{obj.ssbc}}</td> 371 <td>{{obj.ssbc}}</td>
372 - <td>{{obj.ssgl_lz}}</td>  
373 - <td>{{obj.ssgl_dm}}</td>  
374 - <td>{{obj.ssgl_gz}}</td>  
375 - <td>{{obj.ssgl_jf}}</td>  
376 - <td>{{obj.ssgl_zs}}</td>  
377 - <td>{{obj.ssgl_qr}}</td>  
378 - <td>{{obj.ssgl_qc}}</td>  
379 - <td>{{obj.ssgl_kx}}</td>  
380 - <td>{{obj.ssgl_qh}}</td>  
381 - <td>{{obj.ssgl_yw}}</td>  
382 - <td>{{obj.ssgl_other}}</td>  
383 - <td>{{obj.ljgl}}</td>  
384 - <td>{{obj.ljks}}</td>  
385 - <td>{{obj.jhbc}}</td>  
386 - <td>{{obj.jhbc_m}}</td>  
387 - <td>{{obj.jhbc_a}}</td>  
388 - <td>{{obj.sjbc}}</td>  
389 - <td>{{obj.sjbc_m}}</td>  
390 - <td>{{obj.sjbc_a}}</td>  
391 - <td>{{obj.ljbc}}</td>  
392 - <td>{{obj.ljbc_m}}</td>  
393 - <td>{{obj.ljbc_a}}</td>  
394 - <td>{{obj.fzbc}}</td>  
395 - <td>{{obj.fzbc_m}}</td>  
396 - <td>{{obj.fzbc_a}}</td>  
397 - <td>{{obj.dtbc}}</td>  
398 - <td>{{obj.dtbc_m}}</td>  
399 - <td>{{obj.dtbc_a}}</td>  
400 - <td>{{obj.djg}}</td>  
401 - <td>{{obj.djg_m}}</td>  
402 - <td>{{obj.djg_a}}</td>  
403 - <td>{{obj.djg_time}}</td> 372 + <td>{{obj.lzlc}}</td>
  373 + <td>{{obj.dmlc}}</td>
  374 + <td>{{obj.gzlc}}</td>
  375 + <td>{{obj.jflc}}</td>
  376 + <td>{{obj.zslc}}</td>
  377 + <td>{{obj.qrlc}}</td>
  378 + <td>{{obj.qclc}}</td>
  379 + <td>{{obj.kxlc}}</td>
  380 + <td>{{obj.qhlc}}</td>
  381 + <td>{{obj.ywlc}}</td>
  382 + <td>{{obj.qtlc}}</td>
  383 + <td>{{obj.ljlc}}</td>
  384 + <td>{{obj.ljkslc}}</td>
  385 + <td>{{obj.jhbcq}}</td>
  386 + <td>{{obj.jhbcz}}</td>
  387 + <td>{{obj.jhbcw}}</td>
  388 + <td>{{obj.sjbcq}}</td>
  389 + <td>{{obj.sjbcz}}</td>
  390 + <td>{{obj.sjbcw}}</td>
  391 + <td>{{obj.ljbcq}}</td>
  392 + <td>{{obj.ljbcz}}</td>
  393 + <td>{{obj.ljbcw}}</td>
  394 + <td>{{obj.fzbcq}}</td>
  395 + <td>{{obj.fzbcz}}</td>
  396 + <td>{{obj.fzbcw}}</td>
  397 + <td>{{obj.dtbcq}}</td>
  398 + <td>{{obj.dtbcz}}</td>
  399 + <td>{{obj.dtbcw}}</td>
  400 + <td>{{obj.djgq}}</td>
  401 + <td>{{obj.djgz}}</td>
  402 + <td>{{obj.djgw}}</td>
  403 + <td>{{obj.djgsj}}</td>
404 <td>&nbsp;</td> 404 <td>&nbsp;</td>
405 </tr> 405 </tr>
406 {{/each}} 406 {{/each}}
src/main/resources/static/pages/scheduleApp/Gruntfile.js
@@ -89,7 +89,9 @@ module.exports = function (grunt) { @@ -89,7 +89,9 @@ module.exports = function (grunt) {
89 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令 89 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令
90 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令 90 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令
91 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令 91 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令
92 - 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排版计划form中使用) 92 + 'module/common/dts2/queryOption/saOrderOption.js', // saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
  93 + 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用)
  94 + 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用)
93 'module/common/dts2/scheduleplan/saPlaninfoedit.js', // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用) 95 'module/common/dts2/scheduleplan/saPlaninfoedit.js', // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用)
94 'module/common/dts2/scheduleplan/saPlaninfoedit2.js' // saPlaninfoedit2指令(非通用指令,只在调度执勤日报中使用) 96 'module/common/dts2/scheduleplan/saPlaninfoedit2.js' // saPlaninfoedit2指令(非通用指令,只在调度执勤日报中使用)
95 ], 97 ],
@@ -114,7 +116,8 @@ module.exports = function (grunt) { @@ -114,7 +116,8 @@ module.exports = function (grunt) {
114 'module/core/schedulePlanManage/report/ext/route.js', // 排班计划明日运营模块Ext 116 'module/core/schedulePlanManage/report/ext/route.js', // 排班计划明日运营模块Ext
115 'module/core/scheduleRuleManage/route.js', // 排班规则管理模块 117 'module/core/scheduleRuleManage/route.js', // 排班规则管理模块
116 'module/core/ttInfoManage/route.js', // 时刻表管理模块 118 'module/core/ttInfoManage/route.js', // 时刻表管理模块
117 - 'module/core/ttInfoManage/detailedit/route.js' // 时刻表明细管理模块 119 + 'module/core/ttInfoManage/detailedit/route.js', // 时刻表明细管理模块
  120 + 'module/core/ttInfoManage2/route.js' // 智能时刻表管理模块
118 ], 121 ],
119 dest: 'module/common/prj-common-ui-route-state.js' 122 dest: 'module/common/prj-common-ui-route-state.js'
120 }, 123 },
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="BusInfoManageCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="BusInfoManageCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,13 +36,13 @@ @@ -27,13 +36,13 @@
27 <span class="caption-subject bold uppercase">车辆信息表</span> 36 <span class="caption-subject bold uppercase">车辆信息表</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 39 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 添加车辆信息 41 添加车辆信息
33 </a> 42 </a>
34 43
35 <div class="btn-group"> 44 <div class="btn-group">
36 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> 45 + <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown">
37 <i class="fa fa-share"></i> 46 <i class="fa fa-share"></i>
38 <span>数据工具</span> 47 <span>数据工具</span>
39 <i class="fa fa-angle-down"></i> 48 <i class="fa fa-angle-down"></i>
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
@@ -9,11 +9,11 @@ @@ -9,11 +9,11 @@
9 <th style="width: 120px;">内部编号</th> 9 <th style="width: 120px;">内部编号</th>
10 <th style="width: 120px;">设备编号</th> 10 <th style="width: 120px;">设备编号</th>
11 <th style="width: 120px;">车牌号</th> 11 <th style="width: 120px;">车牌号</th>
12 - <th style="width: 150px;">所在公司</th>  
13 - <th style="width: 160px;">所在分公司</th> 12 + <th >所在公司</th>
  13 + <th >所在分公司</th>
14 <th style="width: 60px">电车</th> 14 <th style="width: 60px">电车</th>
15 <th style="width: 80px;" >状态</th> 15 <th style="width: 80px;" >状态</th>
16 - <th style="width: 100%">操作</th> 16 + <th >操作</th>
17 </tr> 17 </tr>
18 <tr role="row" class="filter"> 18 <tr role="row" class="filter">
19 <td></td> 19 <td></td>
@@ -68,9 +68,24 @@ @@ -68,9 +68,24 @@
68 </label> 68 </label>
69 </td> 69 </td>
70 <td> 70 <td>
71 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
72 - ng-click="ctrl.doPage()">  
73 - <i class="fa fa-search"></i> 搜索</button> 71 + <div class="btn-group">
  72 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  73 + ng-click="ctrl.doPage()">
  74 + <i class="fa fa-search"></i> 搜索</button>
  75 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  76 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  77 + <span class="caret"></span>
  78 + <span class="sr-only">dropdown</span>
  79 + </button>
  80 + <ul class="dropdown-menu pull-right">
  81 + <li>
  82 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  83 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  84 + 排序选项
  85 + </a>
  86 + </li>
  87 + </ul>
  88 + </div>
74 89
75 <button class="btn btn-sm red btn-outline filter-cancel" 90 <button class="btn btn-sm red btn-outline filter-cancel"
76 ng-click="ctrl.reset()"> 91 ng-click="ctrl.reset()">
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
@@ -26,6 +26,23 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,6 +26,23 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 uiToRecord: 0 // 页面绑定,当前页到第几条记录 26 uiToRecord: 0 // 页面绑定,当前页到第几条记录
27 }; 27 };
28 28
  29 + // 字段描述
  30 + var columns = [
  31 + {name: "carCode", desc: "车辆编号"},
  32 + {name: "insideCode", desc: "自编号"},
  33 + {name: "equipmentCode", desc: "设备编号"},
  34 + {name: "carPlate", desc: "车牌号"},
  35 + {name: "company", desc: "所在公司"},
  36 + {name: "brancheCompany", desc: "所在分公司"},
  37 + {name: "sfdc", desc: "是否电车"},
  38 + {name: "scrapState", desc: "是否报废"}
  39 + ];
  40 + // 排序字段
  41 + var orderColumns = {
  42 + order: "carCode",
  43 + direction: "ASC"
  44 + };
  45 +
29 // 查询对象 46 // 查询对象
30 var queryClass = service.rest; 47 var queryClass = service.rest;
31 48
@@ -33,6 +50,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -33,6 +50,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
33 getQueryClass: function() { 50 getQueryClass: function() {
34 return queryClass; 51 return queryClass;
35 }, 52 },
  53 + getColumns: function() {
  54 + return columns;
  55 + },
  56 + getOrderColumns: function() {
  57 + return orderColumns;
  58 + },
36 /** 59 /**
37 * 获取查询条件信息, 60 * 获取查询条件信息,
38 * 用于给controller用来和页面数据绑定。 61 * 用于给controller用来和页面数据绑定。
@@ -44,6 +67,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -44,6 +67,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
44 currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 67 currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
45 } 68 }
46 69
  70 + // 重置排序字段条件
  71 + currentSearchCondition.order = orderColumns.order;
  72 + currentSearchCondition.direction = orderColumns.direction;
  73 +
47 return currentSearchCondition; 74 return currentSearchCondition;
48 }, 75 },
49 /** 76 /**
@@ -81,10 +108,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -81,10 +108,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
81 * 数据导出。 108 * 数据导出。
82 * @returns {*|Function|promise|n} 109 * @returns {*|Function|promise|n}
83 */ 110 */
84 - dataExport: function() { 111 + dataExport: function(query) {
85 if (UserPrincipal.getGsStrsQuery().length > 0) { 112 if (UserPrincipal.getGsStrsQuery().length > 0) {
86 return service.dataTools.dataExport( 113 return service.dataTools.dataExport(
87 - {'cgsbm_in': UserPrincipal.getGsStrsQuery().join(",")} 114 + {'QUERY': query}
88 ).$promise; 115 ).$promise;
89 } else { 116 } else {
90 return null; 117 return null;
@@ -104,7 +131,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -104,7 +131,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
104 '$state', 131 '$state',
105 '$uibModal', 132 '$uibModal',
106 'FileDownload_g', 133 'FileDownload_g',
107 - function(busInfoManageService, $state, $uibModal, fileDownload) { 134 + 'UserPrincipal',
  135 + function(busInfoManageService, $state, $uibModal, fileDownload, UserPrincipal) {
108 var self = this; 136 var self = this;
109 137
110 // 切换到form状态 138 // 切换到form状态
@@ -141,7 +169,34 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -141,7 +169,34 @@ angular.module(&#39;ScheduleApp&#39;).controller(
141 169
142 // 导出excel 170 // 导出excel
143 self.exportData = function() { 171 self.exportData = function() {
144 - var p = busInfoManageService.dataExport(); 172 + // 组装查询条件
  173 + var QUERY = [];
  174 + var fgs_query = [];
  175 + var i;
  176 + for (i in UserPrincipal.getGsStrs()) {
  177 + fgs_query.push("'" + UserPrincipal.getGsStrs()[i] + "'");
  178 + }
  179 + QUERY.push(" concat(business_code, '_', branche_company_code) in " + "(" + fgs_query.join(",") + ")");
  180 + var key_map = {
  181 + "car_code": "carCode_like",
  182 + "inside_code": "insideCode_like",
  183 + "equipment_code": "equipmentCode_like",
  184 + "car_plate": "carPlate_like"
  185 + };
  186 +
  187 + var key;
  188 + var value;
  189 + var field;
  190 + var condition = busInfoManageService.getSearchCondition();
  191 + for (key in key_map) {
  192 + value = condition[key_map[key]];
  193 + if (value !== undefined && value !== "") {
  194 + field = key;
  195 + QUERY.push(field + " = " + "'" + value + "'");
  196 + }
  197 + }
  198 +
  199 + var p = busInfoManageService.dataExport(QUERY.join(" and "));
145 if (p) { 200 if (p) {
146 p.then( 201 p.then(
147 function(result) { 202 function(result) {
@@ -208,8 +263,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -208,8 +263,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
208 'BusInfoManageListCtrl', 263 'BusInfoManageListCtrl',
209 [ 264 [
210 'BusInfoManageService', 265 'BusInfoManageService',
211 - '$scope',  
212 - function(service, $scope) { 266 + '$uibModal',
  267 + function(service, $uibModal) {
213 var self = this; 268 var self = this;
214 var Cars = service.getQueryClass(); 269 var Cars = service.getQueryClass();
215 270
@@ -248,6 +303,51 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -248,6 +303,51 @@ angular.module(&#39;ScheduleApp&#39;).controller(
248 }; 303 };
249 304
250 self.doPage(); 305 self.doPage();
  306 +
  307 + self.customOrder = function() {
  308 + // large方式弹出模态对话框
  309 + var modalInstance = $uibModal.open({
  310 + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/orderOptionOpen.html',
  311 + size: "sm",
  312 + animation: true,
  313 + backdrop: 'static',
  314 + resolve: {
  315 + },
  316 + windowClass: 'center-modal',
  317 + controller: "BusInfoManageListOrderOptionModalInstanceCtrl",
  318 + controllerAs: "$ctrl",
  319 + bindToController: true
  320 + });
  321 + modalInstance.result.then(
  322 + function(result) {
  323 + console.log("dataImport.html打开");
  324 + },
  325 + function() {
  326 + console.log("dataImport.html消失");
  327 + }
  328 + );
  329 + };
  330 + }
  331 + ]
  332 +);
  333 +
  334 +angular.module('ScheduleApp').controller(
  335 + "BusInfoManageListOrderOptionModalInstanceCtrl",
  336 + [
  337 + "BusInfoManageService",
  338 + "$modalInstance",
  339 + function(service, $modalInstance) {
  340 + var self = this;
  341 +
  342 + self.columns = service.getColumns();
  343 + self.orderColumns = service.getOrderColumns();
  344 +
  345 + self.confirm = function(result) {
  346 + // console.log(result);
  347 + // console.log(service.getOrderColumns());
  348 + $modalInstance.dismiss("cancel");
  349 +
  350 + }
251 } 351 }
252 ] 352 ]
253 ); 353 );
@@ -294,11 +394,11 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -294,11 +394,11 @@ angular.module(&#39;ScheduleApp&#39;).controller(
294 self.submit = function() { 394 self.submit = function() {
295 console.log(self.busInfoForSave); 395 console.log(self.busInfoForSave);
296 396
297 - // 报废的车辆,修改原来的车辆终端号  
298 - if (self.busInfoForSave.scrapState == true) {  
299 - self.busInfoForSave.equipmentCode = "BF-" + self.busInfoForSave.equipmentCode;  
300 - self.busInfoForSave.scrapCode = "BF-" + self.busInfoForSave.equipmentCode;  
301 - } 397 + // // 报废的车辆,修改原来的车辆终端号
  398 + // if (self.busInfoForSave.scrapState == true) {
  399 + // self.busInfoForSave.equipmentCode = "BF-" + self.busInfoForSave.equipmentCode;
  400 + // self.busInfoForSave.scrapCode = "BF-" + self.busInfoForSave.equipmentCode;
  401 + // }
302 402
303 403
304 // 保存或者更新 404 // 保存或者更新
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <span class="caption-subject bold uppercase">设备信息表</span> 27 <span class="caption-subject bold uppercase">设备信息表</span>
28 </div> 28 </div>
29 <div class="actions"> 29 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 30 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 31 <i class="fa fa-plus"></i>
32 添加设备信息 32 添加设备信息
33 </a> 33 </a>
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
1 <!-- ui-route deviceInfoManage.list --> 1 <!-- ui-route deviceInfoManage.list -->
2 <div ng-controller="DeviceInfoManageListCtrl as ctrl"> 2 <div ng-controller="DeviceInfoManageListCtrl as ctrl">
  3 + <style>
  4 + .dropdown-menu {
  5 + border-color: #32c5d2;
  6 + }
  7 + .btn-group > .dropdown-menu:before {
  8 + border-bottom-color: #32c5d2;
  9 + }
  10 + </style>
  11 +
  12 +
3 <div style="width: 100%; height: 100%; overflow: auto"> 13 <div style="width: 100%; height: 100%; overflow: auto">
4 <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column"> 14 <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column">
5 <thead> 15 <thead>
@@ -11,7 +21,6 @@ @@ -11,7 +21,6 @@
11 <th>旧设备编号</th> 21 <th>旧设备编号</th>
12 <th>新设备编号</th> 22 <th>新设备编号</th>
13 <th style="width: 180px;">操作人/操作时间</th> 23 <th style="width: 180px;">操作人/操作时间</th>
14 - <th style="width: 80px;" >状态</th>  
15 <th style="width: 150pt;">操作</th> 24 <th style="width: 150pt;">操作</th>
16 </tr> 25 </tr>
17 <tr role="row" class="filter"> 26 <tr role="row" class="filter">
@@ -38,14 +47,24 @@ @@ -38,14 +47,24 @@
38 <td></td> 47 <td></td>
39 <td></td> 48 <td></td>
40 <td> 49 <td>
41 - <label class="checkbox-inline input">  
42 - <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']" />已作废  
43 - </label>  
44 - </td>  
45 - <td>  
46 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
47 - ng-click="ctrl.doPage()">  
48 - <i class="fa fa-search"></i> 搜索</button> 50 + <div class="btn-group">
  51 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  52 + ng-click="ctrl.doPage()">
  53 + <i class="fa fa-search"></i> 搜索</button>
  54 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  55 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  56 + <span class="caret"></span>
  57 + <span class="sr-only">dropdown</span>
  58 + </button>
  59 + <ul class="dropdown-menu pull-right">
  60 + <li>
  61 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  62 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  63 + 排序选项
  64 + </a>
  65 + </li>
  66 + </ul>
  67 + </div>
49 68
50 <button class="btn btn-sm red btn-outline filter-cancel" 69 <button class="btn btn-sm red btn-outline filter-cancel"
51 ng-click="ctrl.reset()"> 70 ng-click="ctrl.reset()">
@@ -94,10 +113,6 @@ @@ -94,10 +113,6 @@
94 113
95 </td> 114 </td>
96 <td> 115 <td>
97 - <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span>  
98 - <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span>  
99 - </td>  
100 - <td>  
101 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> 116 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
102 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> 117 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
103 <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> 118 <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
@@ -20,6 +20,20 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -20,6 +20,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(
20 uiToRecord: 0 // 页面绑定,当前页到第几条记录 20 uiToRecord: 0 // 页面绑定,当前页到第几条记录
21 }; 21 };
22 22
  23 + // 字段描述
  24 + var columns = [
  25 + {name: "xl", desc: "线路名称"},
  26 + {name: "clZbh", desc: "车辆内部编号"},
  27 + {name: "qyrq", desc: "启用日期"},
  28 + {name: "oldDeviceNo", desc: "旧设备编号"},
  29 + {name: "newDeviceNo", desc: "新终端号"}
  30 + ];
  31 + // 排序字段
  32 + var orderColumns = {
  33 + order: "xl,clZbh,qyrq",
  34 + direction: "ASC,ASC,DESC"
  35 + };
  36 +
23 // 查询对象 37 // 查询对象
24 var queryClass = service; 38 var queryClass = service;
25 39
@@ -27,6 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -27,6 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
27 getQueryClass: function() { 41 getQueryClass: function() {
28 return queryClass; 42 return queryClass;
29 }, 43 },
  44 + getColumns: function() {
  45 + return columns;
  46 + },
  47 + getOrderColumns: function() {
  48 + return orderColumns;
  49 + },
30 getSearchCondition: function() { 50 getSearchCondition: function() {
31 currentSearchCondition.page = currentPage.uiNumber - 1; 51 currentSearchCondition.page = currentPage.uiNumber - 1;
32 52
@@ -34,6 +54,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -34,6 +54,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
34 currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 54 currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
35 } 55 }
36 56
  57 + // 重置排序字段条件
  58 + currentSearchCondition.order = orderColumns.order;
  59 + currentSearchCondition.direction = orderColumns.direction;
  60 +
37 return currentSearchCondition; 61 return currentSearchCondition;
38 }, 62 },
39 getPage: function(page) { 63 getPage: function(page) {
@@ -92,7 +116,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -92,7 +116,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
92 'DeviceInfoManageListCtrl', 116 'DeviceInfoManageListCtrl',
93 [ 117 [
94 'DeviceInfoManageService', 118 'DeviceInfoManageService',
95 - function(service) { 119 + '$uibModal',
  120 + function(service, $uibModal) {
96 var self = this; 121 var self = this;
97 var CarDevice = service.getQueryClass(); 122 var CarDevice = service.getQueryClass();
98 123
@@ -127,11 +152,55 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -127,11 +152,55 @@ angular.module(&#39;ScheduleApp&#39;).controller(
127 152
128 self.doPage(); 153 self.doPage();
129 154
  155 + self.customOrder = function() {
  156 + // large方式弹出模态对话框
  157 + var modalInstance = $uibModal.open({
  158 + templateUrl: '/pages/scheduleApp/module/basicInfo/deviceInfoManage/orderOptionOpen.html',
  159 + size: "sm",
  160 + animation: true,
  161 + backdrop: 'static',
  162 + resolve: {
  163 + },
  164 + windowClass: 'center-modal',
  165 + controller: "DeviceInfoManageListOrderOptionModalInstanceCtrl",
  166 + controllerAs: "$ctrl",
  167 + bindToController: true
  168 + });
  169 + modalInstance.result.then(
  170 + function(result) {
  171 + console.log("dataImport.html打开");
  172 + },
  173 + function() {
  174 + console.log("dataImport.html消失");
  175 + }
  176 + );
  177 + };
130 178
131 } 179 }
132 ] 180 ]
133 ); 181 );
134 182
  183 +angular.module('ScheduleApp').controller(
  184 + "DeviceInfoManageListOrderOptionModalInstanceCtrl",
  185 + [
  186 + "DeviceInfoManageService",
  187 + "$modalInstance",
  188 + function(service, $modalInstance) {
  189 + var self = this;
  190 +
  191 + self.columns = service.getColumns();
  192 + self.orderColumns = service.getOrderColumns();
  193 +
  194 + self.confirm = function(result) {
  195 + // console.log(result);
  196 + // console.log(service.getOrderColumns());
  197 + $modalInstance.dismiss("cancel");
  198 +
  199 + }
  200 + }
  201 + ]
  202 +);
  203 +
135 // form.html控制器 204 // form.html控制器
136 angular.module('ScheduleApp').controller( 205 angular.module('ScheduleApp').controller(
137 'DeviceInfoManageFormCtrl', 206 'DeviceInfoManageFormCtrl',
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/service.js
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { 2 angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
3 return $resource( 3 return $resource(
4 '/cde_sc/:id', 4 '/cde_sc/:id',
5 - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id'}, 5 + {order: 'xl,clZbh,qyrq', direction: 'ASC,ASC,DESC', id: '@id'},
6 { 6 {
7 list: { 7 list: {
8 method: 'GET', 8 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="EmployeeInfoManageCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="EmployeeInfoManageCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,13 +36,13 @@ @@ -27,13 +36,13 @@
27 <span class="caption-subject bold uppercase">人员信息表</span> 36 <span class="caption-subject bold uppercase">人员信息表</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 39 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 添加人员信息 41 添加人员信息
33 </a> 42 </a>
34 43
35 <div class="btn-group"> 44 <div class="btn-group">
36 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> 45 + <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown">
37 <i class="fa fa-share"></i> 46 <i class="fa fa-share"></i>
38 <span>数据工具</span> 47 <span>数据工具</span>
39 <i class="fa fa-angle-down"></i> 48 <i class="fa fa-angle-down"></i>
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <th style="width: 15%;">所在公司</th> 12 <th style="width: 15%;">所在公司</th>
13 <th >分公司</th> 13 <th >分公司</th>
14 <th style="width: 20%;">工种</th> 14 <th style="width: 20%;">工种</th>
15 - <th style="width: 21%">操作</th> 15 + <th >操作</th>
16 </tr> 16 </tr>
17 <tr role="row" class="filter"> 17 <tr role="row" class="filter">
18 <td> 18 <td>
@@ -73,16 +73,29 @@ @@ -73,16 +73,29 @@
73 </sa-Select5> 73 </sa-Select5>
74 </td> 74 </td>
75 <td> 75 <td>
76 - <div>  
77 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 76 + <div class="btn-group">
  77 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
78 ng-click="ctrl.doPage()"> 78 ng-click="ctrl.doPage()">
79 <i class="fa fa-search"></i> 搜索</button> 79 <i class="fa fa-search"></i> 搜索</button>
80 -  
81 - <button class="btn btn-sm red btn-outline filter-cancel"  
82 - ng-click="ctrl.reset()">  
83 - <i class="fa fa-times"></i> 重置</button> 80 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  81 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  82 + <span class="caret"></span>
  83 + <span class="sr-only">dropdown</span>
  84 + </button>
  85 + <ul class="dropdown-menu pull-right">
  86 + <li>
  87 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  88 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  89 + 排序选项
  90 + </a>
  91 + </li>
  92 + </ul>
84 </div> 93 </div>
85 94
  95 + <button class="btn btn-sm red btn-outline filter-cancel"
  96 + ng-click="ctrl.reset()">
  97 + <i class="fa fa-times"></i> 重置</button>
  98 +
86 </td> 99 </td>
87 100
88 </tr> 101 </tr>
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
@@ -26,6 +26,21 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,6 +26,21 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 uiToRecord: 0 // 页面绑定,当前页到第几条记录 26 uiToRecord: 0 // 页面绑定,当前页到第几条记录
27 }; 27 };
28 28
  29 + // 字段描述
  30 + var columns = [
  31 + {name: "personnelName", desc: "姓名"},
  32 + {name: "jobCodeori", desc: "工号"},
  33 + {name: "personnelType", desc: "性别"},
  34 + {name: "company", desc: "所在公司"},
  35 + {name: "brancheCompany", desc: "分公司"},
  36 + {name: "posts", desc: "工种"}
  37 + ];
  38 + // 排序字段
  39 + var orderColumns = {
  40 + order: "jobCodeori",
  41 + direction: "ASC"
  42 + };
  43 +
29 // 查询对象 44 // 查询对象
30 var queryClass = service.rest; 45 var queryClass = service.rest;
31 46
@@ -33,6 +48,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -33,6 +48,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
33 getQueryClass: function() { 48 getQueryClass: function() {
34 return queryClass; 49 return queryClass;
35 }, 50 },
  51 + getColumns: function() {
  52 + return columns;
  53 + },
  54 + getOrderColumns: function() {
  55 + return orderColumns;
  56 + },
36 /** 57 /**
37 * 获取查询条件信息, 58 * 获取查询条件信息,
38 * 用于给controller用来和页面数据绑定。 59 * 用于给controller用来和页面数据绑定。
@@ -44,6 +65,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -44,6 +65,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
44 currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 65 currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
45 } 66 }
46 67
  68 + // 重置排序字段条件
  69 + currentSearchCondition.order = orderColumns.order;
  70 + currentSearchCondition.direction = orderColumns.direction;
  71 +
47 return currentSearchCondition; 72 return currentSearchCondition;
48 }, 73 },
49 /** 74 /**
@@ -214,7 +239,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -214,7 +239,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
214 'EmployeeInfoManageListCtrl', 239 'EmployeeInfoManageListCtrl',
215 [ 240 [
216 'EmployeeInfoManageService', 241 'EmployeeInfoManageService',
217 - function(service) { 242 + '$uibModal',
  243 + function(service, $uibModal) {
218 var self = this; 244 var self = this;
219 var Employee = service.getQueryClass(); 245 var Employee = service.getQueryClass();
220 246
@@ -254,6 +280,51 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -254,6 +280,51 @@ angular.module(&#39;ScheduleApp&#39;).controller(
254 280
255 self.doPage(); 281 self.doPage();
256 282
  283 + self.customOrder = function() {
  284 + // large方式弹出模态对话框
  285 + var modalInstance = $uibModal.open({
  286 + templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/orderOptionOpen.html',
  287 + size: "sm",
  288 + animation: true,
  289 + backdrop: 'static',
  290 + resolve: {
  291 + },
  292 + windowClass: 'center-modal',
  293 + controller: "EmployeeInfoManageListOrderOptionModalInstanceCtrl",
  294 + controllerAs: "$ctrl",
  295 + bindToController: true
  296 + });
  297 + modalInstance.result.then(
  298 + function(result) {
  299 + console.log("dataImport.html打开");
  300 + },
  301 + function() {
  302 + console.log("dataImport.html消失");
  303 + }
  304 + );
  305 + };
  306 +
  307 + }
  308 + ]
  309 +);
  310 +
  311 +angular.module('ScheduleApp').controller(
  312 + "EmployeeInfoManageListOrderOptionModalInstanceCtrl",
  313 + [
  314 + "EmployeeInfoManageService",
  315 + "$modalInstance",
  316 + function(service, $modalInstance) {
  317 + var self = this;
  318 +
  319 + self.columns = service.getColumns();
  320 + self.orderColumns = service.getOrderColumns();
  321 +
  322 + self.confirm = function(result) {
  323 + // console.log(result);
  324 + // console.log(service.getOrderColumns());
  325 + $modalInstance.dismiss("cancel");
  326 +
  327 + }
257 } 328 }
258 ] 329 ]
259 ); 330 );
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/service.js
@@ -7,7 +7,7 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -7,7 +7,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
7 return { 7 return {
8 rest : $resource( 8 rest : $resource(
9 '/ee/:id', 9 '/ee/:id',
10 - {order: 'jobCode', direction: 'ASC', id: '@id'}, 10 + {order: 'jobCodeori', direction: 'ASC', id: '@id'},
11 { 11 {
12 list: { 12 list: {
13 method: 'GET', 13 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/common/dts2/queryOption/saOrderOption.js 0 → 100644
  1 +/**
  2 + * saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
  3 + * 属性如下:
  4 + * name(必须):控件的名字
  5 + * columns(必须,独立作用域):字段名字列表,格式:[{name:[字段名],desc:[字段描述]}...]
  6 + * ordercolumns(必须,独立作用域):字段排序列表,格式:{order: '字段1,字段2',direction: 'ASC,DESC'}
  7 + */
  8 +angular.module('ScheduleApp').directive(
  9 + 'saOrderoption',
  10 + [
  11 + function() {
  12 + return {
  13 + restrict: 'E',
  14 + templateUrl: '/pages/scheduleApp/module/common/dts2/queryOption/saOrderOptionTemplate.html',
  15 + scope: {
  16 + columns: '=',
  17 + ordercolumns: '='
  18 + },
  19 + controllerAs: '$saOrderOptionCtrl',
  20 + bindToController: true,
  21 + controller: function() {
  22 + var self = this;
  23 +
  24 + // 字段列表是否预载入
  25 + self.$$columns_loaded = false;
  26 + // 字段排序是否预载入
  27 + self.$$ordercolumns_loaded = false;
  28 +
  29 +
  30 + // 每组选项内部数据源
  31 + // 格式:[{column:[选中的字段名],dir:[ASC/DESC]}]
  32 + self.$$selectgroupds = [];
  33 +
  34 + // TODO:选择事件
  35 +
  36 + self.$$select_column_change = function() {
  37 + self.$$refresh_selectgroupds();
  38 + };
  39 +
  40 + self.$$select_dir_change = function() {
  41 + self.$$refresh_selectgroupds();
  42 + };
  43 +
  44 + self.$$add_option_click = function(index) {
  45 + self.$$selectgroupds.splice(index, 0, {
  46 + column: self.columns[0].name,
  47 + dir: "ASC"
  48 + });
  49 + self.$$refresh_selectgroupds();
  50 + };
  51 + self.$$del_option_click = function(index) {
  52 + self.$$selectgroupds.splice(index, 1);
  53 + self.$$refresh_selectgroupds();
  54 + };
  55 +
  56 + // 刷新选项内部数据源
  57 + self.$$refresh_selectgroupds = function() {
  58 + if (!self.$$columns_loaded || !self.$$ordercolumns_loaded || self.columns.length == 0) {
  59 + // 没有载入完成,或者字段列表为空
  60 + return;
  61 + }
  62 +
  63 + if (self.$$selectgroupds.length == 0) { // 默认添加一组排序
  64 + self.$$selectgroupds.push({
  65 + column: self.columns[0].name,
  66 + dir: "ASC"
  67 + });
  68 + }
  69 +
  70 + // 重新计算ordercolumns
  71 +
  72 + var aColumn = [];
  73 + var aDir = [];
  74 + for (var i = 0; i < self.$$selectgroupds.length; i++) {
  75 + aColumn.push(self.$$selectgroupds[i].column);
  76 + aDir.push(self.$$selectgroupds[i].dir);
  77 + }
  78 + if (self.ordercolumns) {
  79 + self.ordercolumns.order = aColumn.join(",");
  80 + self.ordercolumns.direction = aDir.join(",");
  81 + } else {
  82 + self.ordercolumns = {order: aColumn.join(","), direction: aDir.join(",")}
  83 + }
  84 +
  85 + }
  86 + },
  87 + compile: function(tElem, tAttrs) {
  88 + // 获取所有属性,并验证
  89 + var $name_attr = tAttrs['name']; // 控件的名字
  90 + if (!$name_attr) {
  91 + throw "必须有名称属性";
  92 + }
  93 +
  94 + // controlAs名字
  95 + var ctrlAs = '$saOrderOptionCtrl';
  96 +
  97 + // TODO:
  98 +
  99 +
  100 +
  101 + return {
  102 + pre: function(scope, element, attr) {
  103 +
  104 + },
  105 +
  106 + post: function(scope, element, attr) {
  107 +
  108 + //--------------------- 监控属性方法 -------------------//
  109 + // 监控字段名字列表
  110 + scope.$watch(
  111 + function() {
  112 + return scope[ctrlAs].columns;
  113 + },
  114 + function(newValue, oldValue) {
  115 + if (!scope[ctrlAs].$$columns_loaded) {
  116 + // TODO:格式判定以后做,假设格式是对的
  117 +
  118 +
  119 + }
  120 +
  121 + scope[ctrlAs].$$columns_loaded = true;
  122 + scope[ctrlAs].$$refresh_selectgroupds();
  123 + },
  124 + true
  125 + );
  126 + // 监控字段排序列表
  127 + scope.$watch(
  128 + function() {
  129 + return scope[ctrlAs].ordercolumns;
  130 + },
  131 + function(newValue, oldValue) {
  132 + if (!scope[ctrlAs].$$ordercolumns_loaded) {
  133 + if (newValue) {
  134 + var aColumns = []; // 排序的字段
  135 + var aDirs = []; // 排序字段对应的排序方向
  136 +
  137 + if (newValue.order) {
  138 + aColumns = newValue.order.split(",");
  139 + }
  140 + if (newValue.direction) {
  141 + aDirs = newValue.direction.split(",");
  142 + }
  143 +
  144 + for (var i = 0; i < aColumns.length; i++) {
  145 + if (i < aDirs.length) {
  146 + scope[ctrlAs].$$selectgroupds.push({
  147 + column: aColumns[i],
  148 + dir: aDirs[i]
  149 + });
  150 + } else {
  151 + scope[ctrlAs].$$selectgroupds.push({
  152 + column: aColumns[i],
  153 + dir: 'ASC'
  154 + });
  155 + }
  156 + }
  157 + }
  158 + }
  159 + scope[ctrlAs].$$ordercolumns_loaded = true;
  160 + scope[ctrlAs].$$refresh_selectgroupds();
  161 +
  162 + },
  163 + true
  164 + );
  165 + }
  166 +
  167 + };
  168 + }
  169 + };
  170 + }
  171 + ]
  172 +);
0 \ No newline at end of file 173 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts2/queryOption/saOrderOptionTemplate.html 0 → 100644
  1 +<style>
  2 + .option_panel {
  3 + height: 100%;
  4 + margin: 0;
  5 + padding: 0;
  6 + }
  7 + .option_panel .detail-wrap {
  8 + padding: 0;
  9 + max-height: 300px;
  10 + border: 1px solid #ddd;
  11 + background: #fafafa;
  12 + border-radius: 10px !important;
  13 + moz-user-select: -moz-none;
  14 + -moz-user-select: none;
  15 + -o-user-select: none;
  16 + -khtml-user-select: none;
  17 + -webkit-user-select: none;
  18 + -ms-user-select: none;
  19 + user-select: none;
  20 + overflow: auto;
  21 + }
  22 +
  23 + .option_panel .detail-wrap > .option {
  24 + margin-top: 5px;
  25 + }
  26 +
  27 + .option_panel .detail-wrap > .option:nth-last-child(1) {
  28 + margin-bottom: 5px;
  29 + }
  30 +
  31 + .option_panel .detail-wrap > .option .option_column {
  32 + padding-left: 3px;
  33 + padding-right: 5px;
  34 + }
  35 + .option_panel .detail-wrap > .option .option_dir {
  36 + padding-left: 0px;
  37 + padding-right: 5px;
  38 + }
  39 + .option_panel .detail-wrap > .option .option_opt {
  40 + width: 70px;
  41 + padding-left: 0px;
  42 + padding-right: 0px;
  43 + }
  44 +
  45 + .option_panel .detail-wrap .option .form-control {
  46 + font-size: 10px;
  47 + }
  48 +
  49 +
  50 + .option_scrollbar::-webkit-scrollbar {
  51 + width: 18px;
  52 + height: 18px;
  53 + }
  54 +
  55 + .option_scrollbar::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {
  56 + border-radius: 999px;
  57 + border: 5px solid transparent;
  58 + }
  59 +
  60 + .option_scrollbar::-webkit-scrollbar-track {
  61 + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset;
  62 + }
  63 +
  64 + .option_scrollbar::-webkit-scrollbar-thumb {
  65 + min-height: 20px;
  66 + background-clip: content-box;
  67 + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset;
  68 + }
  69 +
  70 + .option_scrollbar::-webkit-scrollbar-corner {
  71 + background: transparent;
  72 + }
  73 +
  74 +</style>
  75 +
  76 +<div>
  77 + <div class="option_panel">
  78 + <div class="detail-wrap option_scrollbar">
  79 +
  80 + <div class="col-md-12 option" ng-repeat="$option in $saOrderOptionCtrl.$$selectgroupds track by $index" ng-init="rowIndex = $index">
  81 + <div class="col-md-5 option_column">
  82 + <select class="form-control aria-invalid="false" ng-model="$option.column" ng-change="$saOrderOptionCtrl.$$select_column_change()">
  83 + <option ng-repeat="$column in $saOrderOptionCtrl.columns track by $index"
  84 + ng-init="colIndex = $index"
  85 + ng-selected="$option.column==$column.name"
  86 + value="{{$column.name}}">
  87 + {{$column.desc}}
  88 + </option>
  89 + </select>
  90 + </div>
  91 + <div class="col-md-3 option_dir">
  92 + <select class="form-control aria-invalid="false" ng-model="$option.dir" ng-change="$saOrderOptionCtrl.$$select_dir_change()">
  93 + <option value="ASC" ng-selected="$option.dir=='ASC'">升序</option>
  94 + <option value="DESC" ng-selected="$option.dir=='DESC'">降序</option>
  95 + </select>
  96 + </div>
  97 + <div class="col-md-3 btn-group option_opt">
  98 + <button type="button" class="btn btn-default" ng-click="$saOrderOptionCtrl.$$add_option_click(rowIndex)">+</button>
  99 + <button type="button" class="btn btn-default" ng-click="$saOrderOptionCtrl.$$del_option_click(rowIndex)">-</button>
  100 + </div>
  101 +
  102 + </div>
  103 +
  104 +
  105 + </div>
  106 +
  107 +
  108 + </div>
  109 +
  110 +</div>
0 \ No newline at end of file 111 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saScpdate.js
1 /** 1 /**
2 - * saScpdate指令(非通用指令,只在排计划form中使用)。 2 + * saScpdate指令(非通用指令,只在排计划form中使用)。
3 * 属性如下: 3 * 属性如下:
4 * name(必须):控件的名字 4 * name(必须):控件的名字
5 * xlid(必须):线路id 5 * xlid(必须):线路id
@@ -139,7 +139,9 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -139,7 +139,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(
139 outbc: obj.outbc, 139 outbc: obj.outbc,
140 yybc: obj.yybc, 140 yybc: obj.yybc,
141 141
142 - errorbc: obj.errorbc 142 + errorbc: obj.errorbc,
  143 +
  144 + lineVersion: obj.lineVersion
143 145
144 }); 146 });
145 147
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saScpdateTemplate.html
@@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
64 popover-class="increase-popover-width" 64 popover-class="increase-popover-width"
65 popover-trigger="mouseenter"> 65 popover-trigger="mouseenter">
66 <h3 class="col-md-8"> 66 <h3 class="col-md-8">
67 - <a ui-sref="ttInfoDetailManage_edit3({xlid: info.xlid, ttid : info.ttid, xlname: info.xlname, ttname : info.ttname, rflag : true})"> 67 + <a ui-sref="ttInfoDetailManage_edit3({xlid: info.xlid, ttid : info.ttid, xlname: info.xlname, ttname : info.ttname, rflag : true, lineversion : info.lineVersion})">
68 {{info.ttname}} 68 {{info.ttname}}
69 </a> 69 </a>
70 </h3> 70 </h3>
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saSrule.js 0 → 100644
  1 +/**
  2 + * saSrule指令(非通用指令,只在排班计划form中使用)。
  3 + * 属性如下:
  4 + * name(必须):控件的名字
  5 + * xlid(必须):线路id
  6 + * from(必须):独立作用域-绑定的开始时间属性名
  7 + * to(必须):独立作用域-绑定的结束时间属性名
  8 + * error(必须):独立作用域-绑定的错误描述属性名
  9 + */
  10 +angular.module('ScheduleApp').directive(
  11 + 'saSrule',
  12 + [
  13 + 'SchedulePlanManageService_g',
  14 + function(service) {
  15 + return {
  16 + restrict: 'E',
  17 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saSruleTemplate.html',
  18 + scope: {
  19 + from: '=',
  20 + to: '=',
  21 + xlid: '=',
  22 + error: '='
  23 + },
  24 + controllerAs: '$saSruleCtrl',
  25 + bindToController: true,
  26 + controller: function() {
  27 + var self = this;
  28 +
  29 + // 内部ng-model值,用于和required配对
  30 + self.$$internalmodel = undefined;
  31 +
  32 + // 内部数据源(时刻表的一些信息)
  33 + self.$$count = 0;
  34 + self.$$qyCount = 0;
  35 + self.$$qyErrorCount = 0;
  36 + self.$$errorInfos = [];
  37 +
  38 + },
  39 + compile: function(tElem, tAttrs) {
  40 + // 获取所有属性,并验证
  41 + var $name_attr = tAttrs['name']; // 控件的名字
  42 + if (!$name_attr) {
  43 + throw "必须有名称属性";
  44 + }
  45 +
  46 + // controlAs名字
  47 + var ctrlAs = '$saSruleCtrl';
  48 +
  49 + // 线路id
  50 + var xl_id = undefined;
  51 + // 开始时间
  52 + var from_date = undefined;
  53 + // 结束时间
  54 + var to_date = undefined;
  55 +
  56 + // 内部添加required验证,将所有的错误应用到required验证上去
  57 + tElem.find("div").attr("required", "");
  58 +
  59 + return {
  60 + pre: function(scope, element, attr) {
  61 +
  62 + },
  63 +
  64 + post: function(scope, element, attr) {
  65 + // 属性值
  66 + if ($name_attr) {
  67 + scope[ctrlAs]["$name_attr"] = $name_attr;
  68 + }
  69 +
  70 + // 开始日期open属性,及方法
  71 + scope[ctrlAs].$$fromDateOpen = false;
  72 + scope[ctrlAs].$$fromDate_open = function() {
  73 + scope[ctrlAs].$$fromDateOpen = true;
  74 + };
  75 +
  76 + // 结束日期open属性,及方法
  77 + scope[ctrlAs].$$toDateOpen = false;
  78 + scope[ctrlAs].$$toDate_open = function() {
  79 + scope[ctrlAs].$$toDateOpen = true;
  80 + };
  81 +
  82 + // 内部模型刷新
  83 + scope[ctrlAs].$$internal_model_refresh = function() {
  84 + if (!xl_id) {
  85 + scope[ctrlAs].$$internalmodel = undefined;
  86 + scope[ctrlAs].error = "线路必须选择";
  87 + return;
  88 + }
  89 + if (!from_date) {
  90 + scope[ctrlAs].$$internalmodel = undefined;
  91 + scope[ctrlAs].error = "开始日期必须选择";
  92 + return;
  93 + }
  94 + if (!to_date) {
  95 + scope[ctrlAs].$$internalmodel = undefined;
  96 + scope[ctrlAs].error = "结束日期必须选择";
  97 + return;
  98 + }
  99 + if (from_date > to_date) {
  100 + scope[ctrlAs].$$internalmodel = undefined;
  101 + scope[ctrlAs].error = "开始日期必须在结束日期之前";
  102 + return;
  103 + }
  104 +
  105 + scope[ctrlAs].$$count = 0;
  106 + scope[ctrlAs].$$qyCount = 0;
  107 + scope[ctrlAs].$$qyErrorCount = 0;
  108 + scope[ctrlAs].$$errorInfos = [];
  109 +
  110 + if (scope[ctrlAs].$$qyCount == 0) {
  111 + scope[ctrlAs].$$internalmodel = undefined;
  112 + scope[ctrlAs].error = "无可启用的规则数";
  113 + }
  114 +
  115 + var QClass = service.v_rules;
  116 + QClass.val({xlid: xl_id, from: from_date, to: to_date},
  117 + function(result) {
  118 + scope[ctrlAs].$$count = result.data.count;
  119 + scope[ctrlAs].$$qyCount = result.data.qyCount;
  120 + scope[ctrlAs].$$qyErrorCount = result.data.qyErrorCount;
  121 +
  122 + angular.forEach(result.data.errorInfos, function(obj) {
  123 + scope[ctrlAs].$$errorInfos.push({
  124 + ruleId: obj.ruleId,
  125 + clZbh: obj.clZbh,
  126 + qyrq: moment(obj.qyrq).format("YYYY年MM月DD日"),
  127 + infos: obj.errorDescList.join("")
  128 + });
  129 + });
  130 +
  131 + if (scope[ctrlAs].$$qyErrorCount > 0) {
  132 + scope[ctrlAs].$$internalmodel = undefined;
  133 + scope[ctrlAs].error = "有错误的规则";
  134 + } else {
  135 + scope[ctrlAs].$$internalmodel = "ok";
  136 + scope[ctrlAs].$$errorInfos = [];
  137 + }
  138 + },
  139 + function() {
  140 + scope[ctrlAs].$$internalmodel = undefined;
  141 + scope[ctrlAs].error = "获取规则数据失败!";
  142 + }
  143 + );
  144 +
  145 + scope[ctrlAs].$$internalmodel = "ok";
  146 + };
  147 +
  148 + scope[ctrlAs].$$internal_model_refresh(); // 初始执行
  149 +
  150 + //--------------------- 监控属性方法 -------------------//
  151 + // 监控线路id模型值变化
  152 + scope.$watch(
  153 + function() {
  154 + return scope[ctrlAs].xlid;
  155 + },
  156 + function(newValue, oldValue) {
  157 + xl_id = newValue;
  158 + scope[ctrlAs].$$internal_model_refresh();
  159 + }
  160 + );
  161 +
  162 + // 监控开始时间模型值变化
  163 + scope.$watch(
  164 + function() {
  165 + return scope[ctrlAs].from;
  166 + },
  167 + function(newValue, oldValue) {
  168 + from_date = newValue;
  169 + scope[ctrlAs].$$internal_model_refresh();
  170 + }
  171 + );
  172 + // 监控结束时间模型值变化
  173 + scope.$watch(
  174 + function() {
  175 + return scope[ctrlAs].to;
  176 + },
  177 + function(newValue, oldValue) {
  178 + to_date = newValue;
  179 + scope[ctrlAs].$$internal_model_refresh();
  180 + }
  181 + );
  182 + }
  183 + };
  184 + }
  185 + };
  186 + }
  187 + ]
  188 +);
0 \ No newline at end of file 189 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saSruleTemplate.html 0 → 100644
  1 +<div name="{{$saSruleCtrl.$name_attr}}" ng-model="$saSruleCtrl.$$internalmodel">
  2 + <style>
  3 + .s-rule-select {
  4 + min-height: 180px;
  5 + border: 1px solid #ddd;
  6 + }
  7 + .s-rule-select .s-rule-input {
  8 + margin: 0px 5px 5px 5px;
  9 + padding-top: 7px;
  10 + padding-left: 0;
  11 + }
  12 + .s-rule-select .s-rule-select-cont {
  13 + text-align: left;
  14 + min-height: 100px;
  15 + padding-right: 0px;
  16 + }
  17 + .s-rule-select .s-rule-select-body {
  18 + margin-top: 10px;
  19 + overflow: auto;
  20 + width: auto;
  21 + min-height: 100px;
  22 + }
  23 +
  24 +
  25 + </style>
  26 +
  27 +
  28 + <div class="col-md-12 s-rule-select">
  29 + <div class="col-md-12 s-rule-input">
  30 + <div class="col-md-12">
  31 + 总规则{{$saSruleCtrl.$$count}}条,启用规则{{$saSruleCtrl.$$qyCount}}条,错误规则{{$saSruleCtrl.$$qyErrorCount}}条
  32 + </div>
  33 + </div>
  34 + <div class="col-md-12 s-rule-select-cont">
  35 + <div class="s-rule-select-body">
  36 +
  37 + <div ng-repeat="info in $saSruleCtrl.$$errorInfos track by $index">
  38 + <a ui-sref="scheduleRuleManage_edit({id: info.ruleId})">
  39 + {{info.clZbh}},{{info.qyrq}},{{info.infos}}
  40 + </a>
  41 +
  42 + </div>
  43 +
  44 + </div>
  45 + </div>
  46 + </div>
  47 +
  48 +</div>
0 \ No newline at end of file 49 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -4451,8 +4451,180 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -4451,8 +4451,180 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4451 } 4451 }
4452 ] 4452 ]
4453 ); 4453 );
  4454 +/**
  4455 + * saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
  4456 + * 属性如下:
  4457 + * name(必须):控件的名字
  4458 + * columns(必须,独立作用域):字段名字列表,格式:[{name:[字段名],desc:[字段描述]}...]
  4459 + * ordercolumns(必须,独立作用域):字段排序列表,格式:{order: '字段1,字段2',direction: 'ASC,DESC'}
  4460 + */
  4461 +angular.module('ScheduleApp').directive(
  4462 + 'saOrderoption',
  4463 + [
  4464 + function() {
  4465 + return {
  4466 + restrict: 'E',
  4467 + templateUrl: '/pages/scheduleApp/module/common/dts2/queryOption/saOrderOptionTemplate.html',
  4468 + scope: {
  4469 + columns: '=',
  4470 + ordercolumns: '='
  4471 + },
  4472 + controllerAs: '$saOrderOptionCtrl',
  4473 + bindToController: true,
  4474 + controller: function() {
  4475 + var self = this;
  4476 +
  4477 + // 字段列表是否预载入
  4478 + self.$$columns_loaded = false;
  4479 + // 字段排序是否预载入
  4480 + self.$$ordercolumns_loaded = false;
  4481 +
  4482 +
  4483 + // 每组选项内部数据源
  4484 + // 格式:[{column:[选中的字段名],dir:[ASC/DESC]}]
  4485 + self.$$selectgroupds = [];
  4486 +
  4487 + // TODO:选择事件
  4488 +
  4489 + self.$$select_column_change = function() {
  4490 + self.$$refresh_selectgroupds();
  4491 + };
  4492 +
  4493 + self.$$select_dir_change = function() {
  4494 + self.$$refresh_selectgroupds();
  4495 + };
  4496 +
  4497 + self.$$add_option_click = function(index) {
  4498 + self.$$selectgroupds.splice(index, 0, {
  4499 + column: self.columns[0].name,
  4500 + dir: "ASC"
  4501 + });
  4502 + self.$$refresh_selectgroupds();
  4503 + };
  4504 + self.$$del_option_click = function(index) {
  4505 + self.$$selectgroupds.splice(index, 1);
  4506 + self.$$refresh_selectgroupds();
  4507 + };
  4508 +
  4509 + // 刷新选项内部数据源
  4510 + self.$$refresh_selectgroupds = function() {
  4511 + if (!self.$$columns_loaded || !self.$$ordercolumns_loaded || self.columns.length == 0) {
  4512 + // 没有载入完成,或者字段列表为空
  4513 + return;
  4514 + }
  4515 +
  4516 + if (self.$$selectgroupds.length == 0) { // 默认添加一组排序
  4517 + self.$$selectgroupds.push({
  4518 + column: self.columns[0].name,
  4519 + dir: "ASC"
  4520 + });
  4521 + }
  4522 +
  4523 + // 重新计算ordercolumns
  4524 +
  4525 + var aColumn = [];
  4526 + var aDir = [];
  4527 + for (var i = 0; i < self.$$selectgroupds.length; i++) {
  4528 + aColumn.push(self.$$selectgroupds[i].column);
  4529 + aDir.push(self.$$selectgroupds[i].dir);
  4530 + }
  4531 + if (self.ordercolumns) {
  4532 + self.ordercolumns.order = aColumn.join(",");
  4533 + self.ordercolumns.direction = aDir.join(",");
  4534 + } else {
  4535 + self.ordercolumns = {order: aColumn.join(","), direction: aDir.join(",")}
  4536 + }
  4537 +
  4538 + }
  4539 + },
  4540 + compile: function(tElem, tAttrs) {
  4541 + // 获取所有属性,并验证
  4542 + var $name_attr = tAttrs['name']; // 控件的名字
  4543 + if (!$name_attr) {
  4544 + throw "必须有名称属性";
  4545 + }
  4546 +
  4547 + // controlAs名字
  4548 + var ctrlAs = '$saOrderOptionCtrl';
  4549 +
  4550 + // TODO:
  4551 +
  4552 +
  4553 +
  4554 + return {
  4555 + pre: function(scope, element, attr) {
  4556 +
  4557 + },
  4558 +
  4559 + post: function(scope, element, attr) {
  4560 +
  4561 + //--------------------- 监控属性方法 -------------------//
  4562 + // 监控字段名字列表
  4563 + scope.$watch(
  4564 + function() {
  4565 + return scope[ctrlAs].columns;
  4566 + },
  4567 + function(newValue, oldValue) {
  4568 + if (!scope[ctrlAs].$$columns_loaded) {
  4569 + // TODO:格式判定以后做,假设格式是对的
  4570 +
  4571 +
  4572 + }
  4573 +
  4574 + scope[ctrlAs].$$columns_loaded = true;
  4575 + scope[ctrlAs].$$refresh_selectgroupds();
  4576 + },
  4577 + true
  4578 + );
  4579 + // 监控字段排序列表
  4580 + scope.$watch(
  4581 + function() {
  4582 + return scope[ctrlAs].ordercolumns;
  4583 + },
  4584 + function(newValue, oldValue) {
  4585 + if (!scope[ctrlAs].$$ordercolumns_loaded) {
  4586 + if (newValue) {
  4587 + var aColumns = []; // 排序的字段
  4588 + var aDirs = []; // 排序字段对应的排序方向
  4589 +
  4590 + if (newValue.order) {
  4591 + aColumns = newValue.order.split(",");
  4592 + }
  4593 + if (newValue.direction) {
  4594 + aDirs = newValue.direction.split(",");
  4595 + }
  4596 +
  4597 + for (var i = 0; i < aColumns.length; i++) {
  4598 + if (i < aDirs.length) {
  4599 + scope[ctrlAs].$$selectgroupds.push({
  4600 + column: aColumns[i],
  4601 + dir: aDirs[i]
  4602 + });
  4603 + } else {
  4604 + scope[ctrlAs].$$selectgroupds.push({
  4605 + column: aColumns[i],
  4606 + dir: 'ASC'
  4607 + });
  4608 + }
  4609 + }
  4610 + }
  4611 + }
  4612 + scope[ctrlAs].$$ordercolumns_loaded = true;
  4613 + scope[ctrlAs].$$refresh_selectgroupds();
  4614 +
  4615 + },
  4616 + true
  4617 + );
  4618 + }
  4619 +
  4620 + };
  4621 + }
  4622 + };
  4623 + }
  4624 + ]
  4625 +);
4454 /** 4626 /**
4455 - * saScpdate指令(非通用指令,只在排计划form中使用)。 4627 + * saScpdate指令(非通用指令,只在排计划form中使用)。
4456 * 属性如下: 4628 * 属性如下:
4457 * name(必须):控件的名字 4629 * name(必须):控件的名字
4458 * xlid(必须):线路id 4630 * xlid(必须):线路id
@@ -4592,7 +4764,9 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -4592,7 +4764,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4592 outbc: obj.outbc, 4764 outbc: obj.outbc,
4593 yybc: obj.yybc, 4765 yybc: obj.yybc,
4594 4766
4595 - errorbc: obj.errorbc 4767 + errorbc: obj.errorbc,
  4768 +
  4769 + lineVersion: obj.lineVersion
4596 4770
4597 }); 4771 });
4598 4772
@@ -4680,6 +4854,194 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -4680,6 +4854,194 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4680 } 4854 }
4681 ] 4855 ]
4682 ); 4856 );
  4857 +/**
  4858 + * saSrule指令(非通用指令,只在排班计划form中使用)。
  4859 + * 属性如下:
  4860 + * name(必须):控件的名字
  4861 + * xlid(必须):线路id
  4862 + * from(必须):独立作用域-绑定的开始时间属性名
  4863 + * to(必须):独立作用域-绑定的结束时间属性名
  4864 + * error(必须):独立作用域-绑定的错误描述属性名
  4865 + */
  4866 +angular.module('ScheduleApp').directive(
  4867 + 'saSrule',
  4868 + [
  4869 + 'SchedulePlanManageService_g',
  4870 + function(service) {
  4871 + return {
  4872 + restrict: 'E',
  4873 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saSruleTemplate.html',
  4874 + scope: {
  4875 + from: '=',
  4876 + to: '=',
  4877 + xlid: '=',
  4878 + error: '='
  4879 + },
  4880 + controllerAs: '$saSruleCtrl',
  4881 + bindToController: true,
  4882 + controller: function() {
  4883 + var self = this;
  4884 +
  4885 + // 内部ng-model值,用于和required配对
  4886 + self.$$internalmodel = undefined;
  4887 +
  4888 + // 内部数据源(时刻表的一些信息)
  4889 + self.$$count = 0;
  4890 + self.$$qyCount = 0;
  4891 + self.$$qyErrorCount = 0;
  4892 + self.$$errorInfos = [];
  4893 +
  4894 + },
  4895 + compile: function(tElem, tAttrs) {
  4896 + // 获取所有属性,并验证
  4897 + var $name_attr = tAttrs['name']; // 控件的名字
  4898 + if (!$name_attr) {
  4899 + throw "必须有名称属性";
  4900 + }
  4901 +
  4902 + // controlAs名字
  4903 + var ctrlAs = '$saSruleCtrl';
  4904 +
  4905 + // 线路id
  4906 + var xl_id = undefined;
  4907 + // 开始时间
  4908 + var from_date = undefined;
  4909 + // 结束时间
  4910 + var to_date = undefined;
  4911 +
  4912 + // 内部添加required验证,将所有的错误应用到required验证上去
  4913 + tElem.find("div").attr("required", "");
  4914 +
  4915 + return {
  4916 + pre: function(scope, element, attr) {
  4917 +
  4918 + },
  4919 +
  4920 + post: function(scope, element, attr) {
  4921 + // 属性值
  4922 + if ($name_attr) {
  4923 + scope[ctrlAs]["$name_attr"] = $name_attr;
  4924 + }
  4925 +
  4926 + // 开始日期open属性,及方法
  4927 + scope[ctrlAs].$$fromDateOpen = false;
  4928 + scope[ctrlAs].$$fromDate_open = function() {
  4929 + scope[ctrlAs].$$fromDateOpen = true;
  4930 + };
  4931 +
  4932 + // 结束日期open属性,及方法
  4933 + scope[ctrlAs].$$toDateOpen = false;
  4934 + scope[ctrlAs].$$toDate_open = function() {
  4935 + scope[ctrlAs].$$toDateOpen = true;
  4936 + };
  4937 +
  4938 + // 内部模型刷新
  4939 + scope[ctrlAs].$$internal_model_refresh = function() {
  4940 + if (!xl_id) {
  4941 + scope[ctrlAs].$$internalmodel = undefined;
  4942 + scope[ctrlAs].error = "线路必须选择";
  4943 + return;
  4944 + }
  4945 + if (!from_date) {
  4946 + scope[ctrlAs].$$internalmodel = undefined;
  4947 + scope[ctrlAs].error = "开始日期必须选择";
  4948 + return;
  4949 + }
  4950 + if (!to_date) {
  4951 + scope[ctrlAs].$$internalmodel = undefined;
  4952 + scope[ctrlAs].error = "结束日期必须选择";
  4953 + return;
  4954 + }
  4955 + if (from_date > to_date) {
  4956 + scope[ctrlAs].$$internalmodel = undefined;
  4957 + scope[ctrlAs].error = "开始日期必须在结束日期之前";
  4958 + return;
  4959 + }
  4960 +
  4961 + scope[ctrlAs].$$count = 0;
  4962 + scope[ctrlAs].$$qyCount = 0;
  4963 + scope[ctrlAs].$$qyErrorCount = 0;
  4964 + scope[ctrlAs].$$errorInfos = [];
  4965 +
  4966 + if (scope[ctrlAs].$$qyCount == 0) {
  4967 + scope[ctrlAs].$$internalmodel = undefined;
  4968 + scope[ctrlAs].error = "无可启用的规则数";
  4969 + }
  4970 +
  4971 + var QClass = service.v_rules;
  4972 + QClass.val({xlid: xl_id, from: from_date, to: to_date},
  4973 + function(result) {
  4974 + scope[ctrlAs].$$count = result.data.count;
  4975 + scope[ctrlAs].$$qyCount = result.data.qyCount;
  4976 + scope[ctrlAs].$$qyErrorCount = result.data.qyErrorCount;
  4977 +
  4978 + angular.forEach(result.data.errorInfos, function(obj) {
  4979 + scope[ctrlAs].$$errorInfos.push({
  4980 + ruleId: obj.ruleId,
  4981 + clZbh: obj.clZbh,
  4982 + qyrq: moment(obj.qyrq).format("YYYY年MM月DD日"),
  4983 + infos: obj.errorDescList.join("")
  4984 + });
  4985 + });
  4986 +
  4987 + if (scope[ctrlAs].$$qyErrorCount > 0) {
  4988 + scope[ctrlAs].$$internalmodel = undefined;
  4989 + scope[ctrlAs].error = "有错误的规则";
  4990 + } else {
  4991 + scope[ctrlAs].$$internalmodel = "ok";
  4992 + scope[ctrlAs].$$errorInfos = [];
  4993 + }
  4994 + },
  4995 + function() {
  4996 + scope[ctrlAs].$$internalmodel = undefined;
  4997 + scope[ctrlAs].error = "获取规则数据失败!";
  4998 + }
  4999 + );
  5000 +
  5001 + scope[ctrlAs].$$internalmodel = "ok";
  5002 + };
  5003 +
  5004 + scope[ctrlAs].$$internal_model_refresh(); // 初始执行
  5005 +
  5006 + //--------------------- 监控属性方法 -------------------//
  5007 + // 监控线路id模型值变化
  5008 + scope.$watch(
  5009 + function() {
  5010 + return scope[ctrlAs].xlid;
  5011 + },
  5012 + function(newValue, oldValue) {
  5013 + xl_id = newValue;
  5014 + scope[ctrlAs].$$internal_model_refresh();
  5015 + }
  5016 + );
  5017 +
  5018 + // 监控开始时间模型值变化
  5019 + scope.$watch(
  5020 + function() {
  5021 + return scope[ctrlAs].from;
  5022 + },
  5023 + function(newValue, oldValue) {
  5024 + from_date = newValue;
  5025 + scope[ctrlAs].$$internal_model_refresh();
  5026 + }
  5027 + );
  5028 + // 监控结束时间模型值变化
  5029 + scope.$watch(
  5030 + function() {
  5031 + return scope[ctrlAs].to;
  5032 + },
  5033 + function(newValue, oldValue) {
  5034 + to_date = newValue;
  5035 + scope[ctrlAs].$$internal_model_refresh();
  5036 + }
  5037 + );
  5038 + }
  5039 + };
  5040 + }
  5041 + };
  5042 + }
  5043 + ]
  5044 +);
4683 /** 5045 /**
4684 * saPlaninfoedit指令,排班明细编辑控件,用在调度执勤日报的修改功能 5046 * saPlaninfoedit指令,排班明细编辑控件,用在调度执勤日报的修改功能
4685 * name(必须),控件的名字 5047 * name(必须),控件的名字
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
@@ -126,6 +126,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -126,6 +126,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
126 transformResponse: function(rs) { 126 transformResponse: function(rs) {
127 var dst = angular.fromJson(rs); 127 var dst = angular.fromJson(rs);
128 if (dst.status == 'SUCCESS') { 128 if (dst.status == 'SUCCESS') {
  129 +
  130 + // 将编码和名称合并成新的字段
  131 + for (var i = 0; i < dst.data.length; i++) {
  132 + dst.data[i]["code_name"] = dst.data[i]["zcode"] + "_" + dst.data[i]["zname"];
  133 + }
  134 +
129 return dst.data; 135 return dst.data;
130 } else { 136 } else {
131 return dst; // 业务错误留给控制器处理 137 return dst; // 业务错误留给控制器处理
@@ -441,6 +447,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -441,6 +447,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
441 } 447 }
442 ) 448 )
443 }, 449 },
  450 + cc_cars_2: { // 车辆不能重复配置2
  451 + template: {'xlId': -1, 'clId': -1}, // 查询参数模版
  452 + remote: $resource( // $resource封装对象
  453 + '/cci/validate_cars_2',
  454 + {},
  455 + {
  456 + do: {
  457 + method: 'GET'
  458 + }
  459 + }
  460 + )
  461 + },
444 cc_cars_gs: { // 车辆是否属于当前用户所属公司 462 cc_cars_gs: { // 车辆是否属于当前用户所属公司
445 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 463 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
446 remote: $resource( // $resource封装对象 464 remote: $resource( // $resource封装对象
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
@@ -84,7 +84,7 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -84,7 +84,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
84 angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { 84 angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
85 return $resource( 85 return $resource(
86 '/cde_sc/:id', 86 '/cde_sc/:id',
87 - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id'}, 87 + {order: 'xl,clZbh,qyrq', direction: 'ASC,ASC,DESC', id: '@id'},
88 { 88 {
89 list: { 89 list: {
90 method: 'GET', 90 method: 'GET',
@@ -129,7 +129,7 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -129,7 +129,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
129 return { 129 return {
130 rest : $resource( 130 rest : $resource(
131 '/ee/:id', 131 '/ee/:id',
132 - {order: 'jobCode', direction: 'ASC', id: '@id'}, 132 + {order: 'jobCodeori', direction: 'ASC', id: '@id'},
133 { 133 {
134 list: { 134 list: {
135 method: 'GET', 135 method: 'GET',
@@ -189,7 +189,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService_g&#39;, [&#39;$resource&#39;, &#39;UserP @@ -189,7 +189,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService_g&#39;, [&#39;$resource&#39;, &#39;UserP
189 return { 189 return {
190 rest : $resource( 190 rest : $resource(
191 '/cci/:id', 191 '/cci/:id',
192 - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id'}, 192 + {order: 'xl.name,cl.insideCode,isCancel', direction: 'ASC', id: '@id'},
193 { 193 {
194 list: { 194 list: {
195 method: 'GET', 195 method: 'GET',
@@ -260,7 +260,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeConfigService_g&#39;, [&#39;$resource&#39;, f @@ -260,7 +260,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeConfigService_g&#39;, [&#39;$resource&#39;, f
260 return { 260 return {
261 rest : $resource( 261 rest : $resource(
262 '/eci/:id', 262 '/eci/:id',
263 - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id'}, 263 + {order: 'xl.name,isCancel,dbbmFormula', direction: 'ASC', id: '@id'},
264 { 264 {
265 list: { 265 list: {
266 method: 'GET', 266 method: 'GET',
@@ -459,7 +459,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource @@ -459,7 +459,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource
459 return { 459 return {
460 rest : $resource( 460 rest : $resource(
461 '/spc/:id', 461 '/spc/:id',
462 - {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id'}, 462 + {order: 'xl.name,createDate', direction: 'DESC,DESC', id: '@id'},
463 { 463 {
464 list: { 464 list: {
465 method: 'GET', 465 method: 'GET',
@@ -511,6 +511,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource @@ -511,6 +511,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource
511 method: 'GET' 511 method: 'GET'
512 } 512 }
513 } 513 }
  514 + ),
  515 + v_rules: $resource(
  516 + '/spc/valttrule/:xlid/:from/:to',
  517 + {xlid: '@xlid', from: '@from', to: '@to'},
  518 + {
  519 + val: {
  520 + method: 'GET'
  521 + }
  522 + }
514 ) 523 )
515 }; 524 };
516 }]); 525 }]);
@@ -618,7 +627,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource @@ -618,7 +627,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource
618 return { 627 return {
619 rest: $resource( 628 rest: $resource(
620 '/sr1fc/:id', 629 '/sr1fc/:id',
621 - {order: 'xl.id,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'}, 630 + {order: 'xl.name,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'},
622 { 631 {
623 list: { 632 list: {
624 method: 'GET', 633 method: 'GET',
@@ -681,7 +690,7 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -681,7 +690,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
681 return { 690 return {
682 rest: $resource( 691 rest: $resource(
683 '/tic_ec/:id', 692 '/tic_ec/:id',
684 - {order: 'xl,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'}, 693 + {order: 'xl.name,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'},
685 { 694 {
686 list: { 695 list: {
687 method: 'GET', 696 method: 'GET',
@@ -1004,6 +1013,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -1004,6 +1013,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1004 transformResponse: function(rs) { 1013 transformResponse: function(rs) {
1005 var dst = angular.fromJson(rs); 1014 var dst = angular.fromJson(rs);
1006 if (dst.status == 'SUCCESS') { 1015 if (dst.status == 'SUCCESS') {
  1016 +
  1017 + // 将编码和名称合并成新的字段
  1018 + for (var i = 0; i < dst.data.length; i++) {
  1019 + dst.data[i]["code_name"] = dst.data[i]["zcode"] + "_" + dst.data[i]["zname"];
  1020 + }
  1021 +
1007 return dst.data; 1022 return dst.data;
1008 } else { 1023 } else {
1009 return dst; // 业务错误留给控制器处理 1024 return dst; // 业务错误留给控制器处理
@@ -1319,6 +1334,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -1319,6 +1334,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1319 } 1334 }
1320 ) 1335 )
1321 }, 1336 },
  1337 + cc_cars_2: { // 车辆不能重复配置2
  1338 + template: {'xlId': -1, 'clId': -1}, // 查询参数模版
  1339 + remote: $resource( // $resource封装对象
  1340 + '/cci/validate_cars_2',
  1341 + {},
  1342 + {
  1343 + do: {
  1344 + method: 'GET'
  1345 + }
  1346 + }
  1347 + )
  1348 + },
1322 cc_cars_gs: { // 车辆是否属于当前用户所属公司 1349 cc_cars_gs: { // 车辆是否属于当前用户所属公司
1323 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 1350 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
1324 remote: $resource( // $resource封装对象 1351 remote: $resource( // $resource封装对象
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
@@ -1287,4 +1287,99 @@ ScheduleApp.config([ @@ -1287,4 +1287,99 @@ ScheduleApp.config([
1287 ; 1287 ;
1288 1288
1289 } 1289 }
  1290 +]);
  1291 +// ui route 配置
  1292 +
  1293 +/** 时刻表管理配置route */
  1294 +ScheduleApp.config([
  1295 + '$stateProvider',
  1296 + '$urlRouterProvider',
  1297 + function($stateProvider, $urlRouterProvider) {
  1298 + // 默认路由
  1299 + //$urlRouterProvider.otherwise('/busConfig.html');
  1300 +
  1301 + $stateProvider
  1302 + .state("ttInfoManage2", { // index页面
  1303 + url: '/ttInfoManage2',
  1304 + views: {
  1305 + "": {
  1306 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/index.html'
  1307 + },
  1308 + "ttInfoManage2_list@ttInfoManage2": {
  1309 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/list.html'
  1310 + }
  1311 + },
  1312 +
  1313 + resolve: {
  1314 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1315 + return $ocLazyLoad.load({
  1316 + name: 'ttInfoManage2_module',
  1317 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1318 + files: [
  1319 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1320 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1321 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  1322 + ]
  1323 + });
  1324 + }]
  1325 + }
  1326 + })
  1327 + .state("ttInfoManage2_form", { // 添加时刻表信息form
  1328 + url: '/ttInfoManage2_form',
  1329 + views: {
  1330 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/form.html'}
  1331 + },
  1332 + resolve: {
  1333 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1334 + return $ocLazyLoad.load({
  1335 + name: 'ttInfoManage2_form_module',
  1336 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1337 + files: [
  1338 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1339 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1340 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  1341 + ]
  1342 + });
  1343 + }]
  1344 + }
  1345 + })
  1346 + .state("ttInfoManage2_edit", { // 修改时刻表信息form
  1347 + url: '/ttInfoManage2_edit/:id',
  1348 + views: {
  1349 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/edit.html'}
  1350 + },
  1351 + resolve: {
  1352 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1353 + return $ocLazyLoad.load({
  1354 + name: 'ttInfoManage2_edit_module',
  1355 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1356 + files: [
  1357 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1358 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1359 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  1360 + ]
  1361 + });
  1362 + }]
  1363 + }
  1364 + })
  1365 + .state("ttInfoManage2_detail", { // 时刻表详细信息
  1366 + url: '/ttInfoManage2_detail/:id',
  1367 + views: {
  1368 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/detail.html'}
  1369 + },
  1370 + resolve: {
  1371 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1372 + return $ocLazyLoad.load({
  1373 + name: 'ttInfoManage2_detail_module',
  1374 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1375 + files: [
  1376 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  1377 + ]
  1378 + });
  1379 + }]
  1380 + }
  1381 + })
  1382 +
  1383 +
  1384 + }
1290 ]); 1385 ]);
1291 \ No newline at end of file 1386 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/busConfig/detail.html
@@ -58,6 +58,22 @@ @@ -58,6 +58,22 @@
58 </div> 58 </div>
59 59
60 <div class="form-group has-success has-feedback"> 60 <div class="form-group has-success has-feedback">
  61 + <label class="col-md-2 control-label">所在公司:</label>
  62 + <div class="col-md-3">
  63 + <input type="text" class="form-control" name="cl"
  64 + ng-model="ctrl.busConfigForDetail.cl.company" readonly/>
  65 + </div>
  66 + </div>
  67 +
  68 + <div class="form-group has-success has-feedback">
  69 + <label class="col-md-2 control-label">所在分公司:</label>
  70 + <div class="col-md-3">
  71 + <input type="text" class="form-control" name="cl"
  72 + ng-model="ctrl.busConfigForDetail.cl.brancheCompany" readonly/>
  73 + </div>
  74 + </div>
  75 +
  76 + <div class="form-group has-success has-feedback">
61 <label class="col-md-2 control-label">启用日期*:</label> 77 <label class="col-md-2 control-label">启用日期*:</label>
62 <div class="col-md-4"> 78 <div class="col-md-4">
63 <input type="text" class="form-control" 79 <input type="text" class="form-control"
src/main/resources/static/pages/scheduleApp/module/core/busConfig/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="BusConfigCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="BusConfigCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,13 +36,13 @@ @@ -27,13 +36,13 @@
27 <span class="caption-subject bold uppercase">配置表</span> 36 <span class="caption-subject bold uppercase">配置表</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 39 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 添加配置 41 添加配置
33 </a> 42 </a>
34 43
35 <div class="btn-group"> 44 <div class="btn-group">
36 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> 45 + <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown">
37 <i class="fa fa-share"></i> 46 <i class="fa fa-share"></i>
38 <span>数据工具</span> 47 <span>数据工具</span>
39 <i class="fa fa-angle-down"></i> 48 <i class="fa fa-angle-down"></i>
src/main/resources/static/pages/scheduleApp/module/core/busConfig/list.html
@@ -6,12 +6,14 @@ @@ -6,12 +6,14 @@
6 <tr role="row" class="heading"> 6 <tr role="row" class="heading">
7 <th style="width: 70px;">序号</th> 7 <th style="width: 70px;">序号</th>
8 <th style="width: 150px;">线路</th> 8 <th style="width: 150px;">线路</th>
9 - <th style="width: 150px;">内部编号</th>  
10 - <th style="width: 150px;">设备编号</th>  
11 - <th style="width: 150px;">启用日期</th> 9 + <th style="width: 150px;">所在公司</th>
  10 + <th style="width: 160px;">所在分公司</th>
  11 + <th style="width: 100px;">内部编号</th>
  12 + <th style="width: 100px;">设备编号</th>
  13 + <th style="width: 100px;">启用日期</th>
12 <th >停车点</th> 14 <th >停车点</th>
13 <th style="width: 80px;" >状态</th> 15 <th style="width: 80px;" >状态</th>
14 - <th style="width: 21%">操作</th> 16 + <th>操作</th>
15 </tr> 17 </tr>
16 <tr role="row" class="filter"> 18 <tr role="row" class="filter">
17 <td></td> 19 <td></td>
@@ -32,6 +34,36 @@ @@ -32,6 +34,36 @@
32 </div> 34 </div>
33 </td> 35 </td>
34 <td> 36 <td>
  37 + <sa-Select5 name="gs"
  38 + model="ctrl.searchCondition()"
  39 + cmaps="{'cl.businessCode_eq': 'businessCode'}"
  40 + dcname="cl.businessCode_eq"
  41 + icname="businessCode"
  42 + dsparams="{{ {type: 'ajax', param:{'upCode_eq': '88' }, atype:'gs' } | json }}"
  43 + iterobjname="item"
  44 + iterobjexp="item.businessName"
  45 + searchph="请输拼音..."
  46 + searchexp="this.businessName"
  47 + required
  48 + >
  49 + </sa-Select5>
  50 + </td>
  51 + <td>
  52 + <sa-Select5 name="fgs"
  53 + model="ctrl.searchCondition()"
  54 + cmaps="{'cl.brancheCompanyCode_eq': 'businessCode'}"
  55 + dcname="cl.brancheCompanyCode_eq"
  56 + icname="businessCode"
  57 + dsparams="{{ {type: 'ajax', param:{'upCode_eq': ctrl.searchCondition()['cl.businessCode_eq'] }, atype:'gs' } | json }}"
  58 + iterobjname="item"
  59 + iterobjexp="item.businessName"
  60 + searchph="请输拼音..."
  61 + searchexp="this.businessName"
  62 + required
  63 + >
  64 + </sa-Select5>
  65 + </td>
  66 + <td>
35 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition()['cl.insideCode_like']" placeholder="输入内部编号..."/> 67 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition()['cl.insideCode_like']" placeholder="输入内部编号..."/>
36 </td> 68 </td>
37 <td></td> 69 <td></td>
@@ -43,9 +75,24 @@ @@ -43,9 +75,24 @@
43 </label> 75 </label>
44 </td> 76 </td>
45 <td> 77 <td>
46 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
47 - ng-click="ctrl.doPage()">  
48 - <i class="fa fa-search"></i> 搜索</button> 78 + <div class="btn-group">
  79 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  80 + ng-click="ctrl.doPage()">
  81 + <i class="fa fa-search"></i> 搜索</button>
  82 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  83 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  84 + <span class="caret"></span>
  85 + <span class="sr-only">dropdown</span>
  86 + </button>
  87 + <ul class="dropdown-menu pull-right">
  88 + <li>
  89 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  90 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  91 + 排序选项
  92 + </a>
  93 + </li>
  94 + </ul>
  95 + </div>
49 96
50 <button class="btn btn-sm red btn-outline filter-cancel" 97 <button class="btn btn-sm red btn-outline filter-cancel"
51 ng-click="ctrl.reset()"> 98 ng-click="ctrl.reset()">
@@ -69,6 +116,12 @@ @@ -69,6 +116,12 @@
69 <span ng-bind="info.xl.name"></span> 116 <span ng-bind="info.xl.name"></span>
70 </td> 117 </td>
71 <td> 118 <td>
  119 + <span ng-bind="info.cl.company"></span>
  120 + </td>
  121 + <td>
  122 + <span ng-bind="info.cl.brancheCompany"></span>
  123 + </td>
  124 + <td>
72 <span ng-bind="info.cl.insideCode"></span> 125 <span ng-bind="info.cl.insideCode"></span>
73 </td> 126 </td>
74 <td> 127 <td>
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
@@ -19,6 +19,22 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -19,6 +19,22 @@ angular.module(&#39;ScheduleApp&#39;).factory(
19 uiToRecord: 0 // 页面绑定,当前页到第几条记录 19 uiToRecord: 0 // 页面绑定,当前页到第几条记录
20 }; 20 };
21 21
  22 + // 字段描述
  23 + var columns = [
  24 + {name: "xl.name", desc: "线路名称"},
  25 + {name: "company", desc: "所在公司"},
  26 + {name: "brancheCompany", desc: "分公司"},
  27 + {name: "cl.insideCode", desc: "内部编号"},
  28 + {name: "equipmentCode", desc: "设备编号"},
  29 + {name: "qyrq", desc: "启用日期"},
  30 + {name: "isCancel", desc: "是否作废"}
  31 + ];
  32 + // 排序字段
  33 + var orderColumns = {
  34 + order: "xl.name,cl.insideCode,isCancel",
  35 + direction: "ASC,ASC,ASC"
  36 + };
  37 +
22 // 查询对象 38 // 查询对象
23 var queryClass = service.rest; 39 var queryClass = service.rest;
24 40
@@ -26,6 +42,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,6 +42,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 getQueryClass: function() { 42 getQueryClass: function() {
27 return queryClass; 43 return queryClass;
28 }, 44 },
  45 + getColumns: function() {
  46 + return columns;
  47 + },
  48 + getOrderColumns: function() {
  49 + return orderColumns;
  50 + },
29 /** 51 /**
30 * 获取查询条件信息, 52 * 获取查询条件信息,
31 * 用于给controller用来和页面数据绑定。 53 * 用于给controller用来和页面数据绑定。
@@ -38,6 +60,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -38,6 +60,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
38 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 60 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
39 } 61 }
40 62
  63 + // 重置排序字段条件
  64 + currentSearchCondition.order = orderColumns.order;
  65 + currentSearchCondition.direction = orderColumns.direction;
  66 +
41 return currentSearchCondition; 67 return currentSearchCondition;
42 }, 68 },
43 /** 69 /**
@@ -193,7 +219,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -193,7 +219,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
193 'BusConfigListCtrl', 219 'BusConfigListCtrl',
194 [ 220 [
195 'BusConfigService', 221 'BusConfigService',
196 - function(service) { 222 + '$uibModal',
  223 + function(service, $uibModal) {
197 var self = this; 224 var self = this;
198 var BusConfig = service.getQueryClass(); 225 var BusConfig = service.getQueryClass();
199 226
@@ -228,6 +255,51 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -228,6 +255,51 @@ angular.module(&#39;ScheduleApp&#39;).controller(
228 255
229 self.doPage(); 256 self.doPage();
230 257
  258 + self.customOrder = function() {
  259 + // large方式弹出模态对话框
  260 + var modalInstance = $uibModal.open({
  261 + templateUrl: '/pages/scheduleApp/module/core/busConfig/orderOptionOpen.html',
  262 + size: "sm",
  263 + animation: true,
  264 + backdrop: 'static',
  265 + resolve: {
  266 + },
  267 + windowClass: 'center-modal',
  268 + controller: "BusConfigListOrderOptionModalInstanceCtrl",
  269 + controllerAs: "$ctrl",
  270 + bindToController: true
  271 + });
  272 + modalInstance.result.then(
  273 + function(result) {
  274 + console.log("dataImport.html打开");
  275 + },
  276 + function() {
  277 + console.log("dataImport.html消失");
  278 + }
  279 + );
  280 + };
  281 +
  282 + }
  283 + ]
  284 +);
  285 +
  286 +angular.module('ScheduleApp').controller(
  287 + "BusConfigListOrderOptionModalInstanceCtrl",
  288 + [
  289 + "BusConfigService",
  290 + "$modalInstance",
  291 + function(service, $modalInstance) {
  292 + var self = this;
  293 +
  294 + self.columns = service.getColumns();
  295 + self.orderColumns = service.getOrderColumns();
  296 +
  297 + self.confirm = function(result) {
  298 + // console.log(result);
  299 + // console.log(service.getOrderColumns());
  300 + $modalInstance.dismiss("cancel");
  301 +
  302 + }
231 } 303 }
232 ] 304 ]
233 ); 305 );
src/main/resources/static/pages/scheduleApp/module/core/busConfig/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/busConfig/service.js
@@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService_g&#39;, [&#39;$resource&#39;, &#39;UserP @@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService_g&#39;, [&#39;$resource&#39;, &#39;UserP
3 return { 3 return {
4 rest : $resource( 4 rest : $resource(
5 '/cci/:id', 5 '/cci/:id',
6 - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id'}, 6 + {order: 'xl.name,cl.insideCode,isCancel', direction: 'ASC', id: '@id'},
7 { 7 {
8 list: { 8 list: {
9 method: 'GET', 9 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="EmployeeConfigCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="EmployeeConfigCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,13 +36,13 @@ @@ -27,13 +36,13 @@
27 <span class="caption-subject bold uppercase">配置表</span> 36 <span class="caption-subject bold uppercase">配置表</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 39 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 添加配置 41 添加配置
33 </a> 42 </a>
34 43
35 <div class="btn-group"> 44 <div class="btn-group">
36 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> 45 + <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown">
37 <i class="fa fa-share"></i> 46 <i class="fa fa-share"></i>
38 <span>数据工具</span> 47 <span>数据工具</span>
39 <i class="fa fa-angle-down"></i> 48 <i class="fa fa-angle-down"></i>
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/list.html
@@ -51,9 +51,24 @@ @@ -51,9 +51,24 @@
51 </label> 51 </label>
52 </td> 52 </td>
53 <td> 53 <td>
54 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
55 - ng-click="ctrl.doPage()">  
56 - <i class="fa fa-search"></i> 搜索</button> 54 + <div class="btn-group">
  55 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  56 + ng-click="ctrl.doPage()">
  57 + <i class="fa fa-search"></i> 搜索</button>
  58 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  59 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  60 + <span class="caret"></span>
  61 + <span class="sr-only">dropdown</span>
  62 + </button>
  63 + <ul class="dropdown-menu pull-right">
  64 + <li>
  65 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  66 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  67 + 排序选项
  68 + </a>
  69 + </li>
  70 + </ul>
  71 + </div>
57 72
58 <button class="btn btn-sm red btn-outline filter-cancel" 73 <button class="btn btn-sm red btn-outline filter-cancel"
59 ng-click="ctrl.reset()"> 74 ng-click="ctrl.reset()">
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
@@ -19,6 +19,22 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -19,6 +19,22 @@ angular.module(&#39;ScheduleApp&#39;).factory(
19 uiToRecord: 0 // 页面绑定,当前页到第几条记录 19 uiToRecord: 0 // 页面绑定,当前页到第几条记录
20 }; 20 };
21 21
  22 + // 字段描述
  23 + var columns = [
  24 + {name: "xl.name", desc: "线路名称"},
  25 + {name: "dbbmFormula", desc: "搭班编码"},
  26 + {name: "jsy.jobCodeori", desc: "驾驶员工号"},
  27 + {name: "jsy.personnelName", desc: "驾驶员姓名"},
  28 + {name: "spy.jobCodeori", desc: "售票员工号"},
  29 + {name: "spy.personnelName", desc: "售票员姓名"},
  30 + {name: "isCancel", desc: "是否作废"}
  31 + ];
  32 + // 排序字段
  33 + var orderColumns = {
  34 + order: "xl.name,isCancel,dbbmFormula",
  35 + direction: "ASC,ASC,ASC"
  36 + };
  37 +
22 // 查询对象类 38 // 查询对象类
23 var queryClass = service.rest; 39 var queryClass = service.rest;
24 40
@@ -26,6 +42,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,6 +42,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 getQueryClass: function() { 42 getQueryClass: function() {
27 return queryClass; 43 return queryClass;
28 }, 44 },
  45 + getColumns: function() {
  46 + return columns;
  47 + },
  48 + getOrderColumns: function() {
  49 + return orderColumns;
  50 + },
29 /** 51 /**
30 * 获取查询条件信息, 52 * 获取查询条件信息,
31 * 用于给controller用来和页面数据绑定。 53 * 用于给controller用来和页面数据绑定。
@@ -38,6 +60,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -38,6 +60,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
38 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 60 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
39 } 61 }
40 62
  63 + // 重置排序字段条件
  64 + currentSearchCondition.order = orderColumns.order;
  65 + currentSearchCondition.direction = orderColumns.direction;
  66 +
41 return currentSearchCondition; 67 return currentSearchCondition;
42 }, 68 },
43 /** 69 /**
@@ -198,7 +224,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -198,7 +224,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
198 'EmployeeConfigListCtrl', 224 'EmployeeConfigListCtrl',
199 [ 225 [
200 'EmployeeConfigService', 226 'EmployeeConfigService',
201 - function(service) { 227 + '$uibModal',
  228 + function(service, $uibModal) {
202 var self = this; 229 var self = this;
203 var EmpConfig = service.getQueryClass(); 230 var EmpConfig = service.getQueryClass();
204 231
@@ -232,6 +259,51 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -232,6 +259,51 @@ angular.module(&#39;ScheduleApp&#39;).controller(
232 }; 259 };
233 260
234 self.doPage(); 261 self.doPage();
  262 +
  263 + self.customOrder = function() {
  264 + // large方式弹出模态对话框
  265 + var modalInstance = $uibModal.open({
  266 + templateUrl: '/pages/scheduleApp/module/core/employeeConfig/orderOptionOpen.html',
  267 + size: "sm",
  268 + animation: true,
  269 + backdrop: 'static',
  270 + resolve: {
  271 + },
  272 + windowClass: 'center-modal',
  273 + controller: "EmployeeConfigListOrderOptionModalInstanceCtrl",
  274 + controllerAs: "$ctrl",
  275 + bindToController: true
  276 + });
  277 + modalInstance.result.then(
  278 + function(result) {
  279 + console.log("dataImport.html打开");
  280 + },
  281 + function() {
  282 + console.log("dataImport.html消失");
  283 + }
  284 + );
  285 + };
  286 + }
  287 + ]
  288 +);
  289 +
  290 +angular.module('ScheduleApp').controller(
  291 + "EmployeeConfigListOrderOptionModalInstanceCtrl",
  292 + [
  293 + "EmployeeConfigService",
  294 + "$modalInstance",
  295 + function(service, $modalInstance) {
  296 + var self = this;
  297 +
  298 + self.columns = service.getColumns();
  299 + self.orderColumns = service.getOrderColumns();
  300 +
  301 + self.confirm = function(result) {
  302 + // console.log(result);
  303 + // console.log(service.getOrderColumns());
  304 + $modalInstance.dismiss("cancel");
  305 +
  306 + }
235 } 307 }
236 ] 308 ]
237 ); 309 );
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/service.js
@@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeConfigService_g&#39;, [&#39;$resource&#39;, f @@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeConfigService_g&#39;, [&#39;$resource&#39;, f
3 return { 3 return {
4 rest : $resource( 4 rest : $resource(
5 '/eci/:id', 5 '/eci/:id',
6 - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id'}, 6 + {order: 'xl.name,isCancel,dbbmFormula', direction: 'ASC', id: '@id'},
7 { 7 {
8 list: { 8 list: {
9 method: 'GET', 9 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="GuideboardManageCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="GuideboardManageCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,13 +36,13 @@ @@ -27,13 +36,13 @@
27 <span class="caption-subject bold uppercase">路牌表</span> 36 <span class="caption-subject bold uppercase">路牌表</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a ui-sref="guideboardManage_form" class="btn btn-circle blue"> 39 + <a ui-sref="guideboardManage_form" class="btn blue">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 添加路牌 41 添加路牌
33 </a> 42 </a>
34 43
35 <div class="btn-group"> 44 <div class="btn-group">
36 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> 45 + <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown">
37 <i class="fa fa-share"></i> 46 <i class="fa fa-share"></i>
38 <span>数据工具</span> 47 <span>数据工具</span>
39 <i class="fa fa-angle-down"></i> 48 <i class="fa fa-angle-down"></i>
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/list.html
@@ -41,9 +41,24 @@ @@ -41,9 +41,24 @@
41 </label> 41 </label>
42 </td> 42 </td>
43 <td> 43 <td>
44 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
45 - ng-click="ctrl.doPage()">  
46 - <i class="fa fa-search"></i> 搜索</button> 44 + <div class="btn-group">
  45 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  46 + ng-click="ctrl.doPage()">
  47 + <i class="fa fa-search"></i> 搜索</button>
  48 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  49 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  50 + <span class="caret"></span>
  51 + <span class="sr-only">dropdown</span>
  52 + </button>
  53 + <ul class="dropdown-menu pull-right">
  54 + <li>
  55 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  56 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  57 + 排序选项
  58 + </a>
  59 + </li>
  60 + </ul>
  61 + </div>
47 62
48 <button class="btn btn-sm red btn-outline filter-cancel" 63 <button class="btn btn-sm red btn-outline filter-cancel"
49 ng-click="ctrl.reset()"> 64 ng-click="ctrl.reset()">
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/module.js
@@ -20,6 +20,20 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -20,6 +20,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(
20 uiToRecord: 0 // 页面绑定,当前页到第几条记录 20 uiToRecord: 0 // 页面绑定,当前页到第几条记录
21 }; 21 };
22 22
  23 + // 字段描述
  24 + var columns = [
  25 + {name: "xl.name", desc: "线路名称"},
  26 + {name: "lpNo", desc: "路牌编号"},
  27 + {name: "lpName", desc: "路牌名称"},
  28 + {name: "lpType", desc: "路牌类型"},
  29 + {name: "isCancel", desc: "是否作废"}
  30 + ];
  31 + // 排序字段
  32 + var orderColumns = {
  33 + order: "xl.name,isCancel,lpNo",
  34 + direction: "DESC,ASC,ASC"
  35 + };
  36 +
23 // 查询对象类 37 // 查询对象类
24 var queryClass = service.rest; 38 var queryClass = service.rest;
25 39
@@ -27,7 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -27,7 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
27 getGbQueryClass: function() { 41 getGbQueryClass: function() {
28 return queryClass; 42 return queryClass;
29 }, 43 },
30 - 44 + getColumns: function() {
  45 + return columns;
  46 + },
  47 + getOrderColumns: function() {
  48 + return orderColumns;
  49 + },
31 /** 50 /**
32 * 获取查询条件信息, 51 * 获取查询条件信息,
33 * 用于给controller用来和页面数据绑定。 52 * 用于给controller用来和页面数据绑定。
@@ -40,6 +59,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -40,6 +59,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
40 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 59 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
41 } 60 }
42 61
  62 + // 重置排序字段条件
  63 + currentSearchCondition.order = orderColumns.order;
  64 + currentSearchCondition.direction = orderColumns.direction;
  65 +
43 return currentSearchCondition; 66 return currentSearchCondition;
44 }, 67 },
45 /** 68 /**
@@ -201,7 +224,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -201,7 +224,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
201 'GuideboardManageListCtrl', 224 'GuideboardManageListCtrl',
202 [ 225 [
203 'GuideboardManageService', 226 'GuideboardManageService',
204 - function(service) { 227 + '$uibModal',
  228 + function(service, $uibModal) {
205 var self = this; 229 var self = this;
206 var Gb = service.getGbQueryClass(); 230 var Gb = service.getGbQueryClass();
207 231
@@ -236,6 +260,51 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -236,6 +260,51 @@ angular.module(&#39;ScheduleApp&#39;).controller(
236 }; 260 };
237 261
238 self.doPage(); 262 self.doPage();
  263 +
  264 + self.customOrder = function() {
  265 + // large方式弹出模态对话框
  266 + var modalInstance = $uibModal.open({
  267 + templateUrl: '/pages/scheduleApp/module/core/guideboardManage/orderOptionOpen.html',
  268 + size: "sm",
  269 + animation: true,
  270 + backdrop: 'static',
  271 + resolve: {
  272 + },
  273 + windowClass: 'center-modal',
  274 + controller: "GuideboardManageListOrderOptionModalInstanceCtrl",
  275 + controllerAs: "$ctrl",
  276 + bindToController: true
  277 + });
  278 + modalInstance.result.then(
  279 + function(result) {
  280 + console.log("dataImport.html打开");
  281 + },
  282 + function() {
  283 + console.log("dataImport.html消失");
  284 + }
  285 + );
  286 + };
  287 + }
  288 + ]
  289 +);
  290 +
  291 +angular.module('ScheduleApp').controller(
  292 + "GuideboardManageListOrderOptionModalInstanceCtrl",
  293 + [
  294 + "GuideboardManageService",
  295 + "$modalInstance",
  296 + function(service, $modalInstance) {
  297 + var self = this;
  298 +
  299 + self.columns = service.getColumns();
  300 + self.orderColumns = service.getOrderColumns();
  301 +
  302 + self.confirm = function(result) {
  303 + // console.log(result);
  304 + // console.log(service.getOrderColumns());
  305 + $modalInstance.dismiss("cancel");
  306 +
  307 + }
239 } 308 }
240 ] 309 ]
241 ); 310 );
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/service.js
@@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;GuideboardManageService_g&#39;, [&#39;$resource&#39;, @@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;GuideboardManageService_g&#39;, [&#39;$resource&#39;,
3 return { 3 return {
4 rest: $resource( 4 rest: $resource(
5 '/gic/:id', 5 '/gic/:id',
6 - {order: 'xl,isCancel,lpNo', direction: 'DESC,ASC,ASC', id: '@id'}, 6 + {order: 'xl.name,isCancel,lpNo', direction: 'DESC,ASC,ASC', id: '@id'},
7 { 7 {
8 list: { 8 list: {
9 method: 'GET', 9 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="RerunManageCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="RerunManageCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,7 +36,7 @@ @@ -27,7 +36,7 @@
27 <span class="caption-subject bold uppercase">套跑信息</span> 36 <span class="caption-subject bold uppercase">套跑信息</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 39 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 添加套跑 41 添加套跑
33 </a> 42 </a>
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/list.html
@@ -5,13 +5,13 @@ @@ -5,13 +5,13 @@
5 <tr role="row" class="heading"> 5 <tr role="row" class="heading">
6 <th style="width: 70px;">序号</th> 6 <th style="width: 70px;">序号</th>
7 <th style="width: 150px;">套跑线路</th> 7 <th style="width: 150px;">套跑线路</th>
8 - <th style="width: 180px">套跑时刻表/路牌</th> 8 + <th >套跑时刻表/路牌</th>
9 <th style="width: 100px">套跑类型</th> 9 <th style="width: 100px">套跑类型</th>
10 <th style="width: 150px;">线路</th> 10 <th style="width: 150px;">线路</th>
11 - <th style="width: 50px">路牌</th> 11 + <th style="width: 100px">路牌</th>
12 <th width="100px">车辆</th> 12 <th width="100px">车辆</th>
13 <th width="80px">状态</th> 13 <th width="80px">状态</th>
14 - <th style="width: 21%">操作</th> 14 + <th >操作</th>
15 </tr> 15 </tr>
16 <tr role="row" class="filter"> 16 <tr role="row" class="filter">
17 <td></td> 17 <td></td>
@@ -40,9 +40,24 @@ @@ -40,9 +40,24 @@
40 </label> 40 </label>
41 </td> 41 </td>
42 <td> 42 <td>
43 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
44 - ng-click="ctrl.doPage()">  
45 - <i class="fa fa-search"></i> 搜索</button> 43 + <div class="btn-group">
  44 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  45 + ng-click="ctrl.doPage()">
  46 + <i class="fa fa-search"></i> 搜索</button>
  47 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  48 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  49 + <span class="caret"></span>
  50 + <span class="sr-only">dropdown</span>
  51 + </button>
  52 + <ul class="dropdown-menu pull-right">
  53 + <li>
  54 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  55 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  56 + 排序选项
  57 + </a>
  58 + </li>
  59 + </ul>
  60 + </div>
46 61
47 <button class="btn btn-sm red btn-outline filter-cancel" 62 <button class="btn btn-sm red btn-outline filter-cancel"
48 ng-click="ctrl.reset()"> 63 ng-click="ctrl.reset()">
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/module.js
@@ -19,6 +19,21 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -19,6 +19,21 @@ angular.module(&#39;ScheduleApp&#39;).factory(
19 uiToRecord: 0 // 页面绑定,当前页到第几条记录 19 uiToRecord: 0 // 页面绑定,当前页到第几条记录
20 }; 20 };
21 21
  22 + // 字段描述
  23 + var columns = [
  24 + {name: "rerunXl.name", desc: "套跑线路"},
  25 + {name: "rerunTtinfo.name", desc: "套跑时刻表"},
  26 + {name: "rerunLp.lpName", desc: "套跑路牌"},
  27 + {name: "rerunType", desc: "套跑类型"},
  28 + {name: "useXl.name", desc: "线路"},
  29 + {name: "isCancel", desc: "是否作废"}
  30 + ];
  31 + // 排序字段
  32 + var orderColumns = {
  33 + order: "rerunXl.name,isCancel",
  34 + direction: "ASC,ASC"
  35 + };
  36 +
22 // 查询对象 37 // 查询对象
23 var queryClass = service.rest; 38 var queryClass = service.rest;
24 39
@@ -26,6 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,6 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 getQueryClass: function() { 41 getQueryClass: function() {
27 return queryClass; 42 return queryClass;
28 }, 43 },
  44 + getColumns: function() {
  45 + return columns;
  46 + },
  47 + getOrderColumns: function() {
  48 + return orderColumns;
  49 + },
29 getSearchCondition: function() { 50 getSearchCondition: function() {
30 currentSearchCondition.page = currentPage.uiNumber - 1; 51 currentSearchCondition.page = currentPage.uiNumber - 1;
31 52
@@ -34,6 +55,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -34,6 +55,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
34 currentSearchCondition["rerunXl.cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 55 currentSearchCondition["rerunXl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
35 } 56 }
36 57
  58 + // 重置排序字段条件
  59 + currentSearchCondition.order = orderColumns.order;
  60 + currentSearchCondition.direction = orderColumns.direction;
  61 +
37 return currentSearchCondition; 62 return currentSearchCondition;
38 }, 63 },
39 getPage: function(page) { 64 getPage: function(page) {
@@ -91,7 +116,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -91,7 +116,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
91 'RerunManageListCtrl', 116 'RerunManageListCtrl',
92 [ 117 [
93 'RerunManageService', 118 'RerunManageService',
94 - function(service) { 119 + '$uibModal',
  120 + function(service, $uibModal) {
95 var self = this; 121 var self = this;
96 var RM = service.getQueryClass(); 122 var RM = service.getQueryClass();
97 123
@@ -126,11 +152,55 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -126,11 +152,55 @@ angular.module(&#39;ScheduleApp&#39;).controller(
126 152
127 self.doPage(); 153 self.doPage();
128 154
  155 + self.customOrder = function() {
  156 + // large方式弹出模态对话框
  157 + var modalInstance = $uibModal.open({
  158 + templateUrl: '/pages/scheduleApp/module/core/rerunManage/orderOptionOpen.html',
  159 + size: "sm",
  160 + animation: true,
  161 + backdrop: 'static',
  162 + resolve: {
  163 + },
  164 + windowClass: 'center-modal',
  165 + controller: "RerunManageListOrderOptionModalInstanceCtrl",
  166 + controllerAs: "$ctrl",
  167 + bindToController: true
  168 + });
  169 + modalInstance.result.then(
  170 + function(result) {
  171 + console.log("dataImport.html打开");
  172 + },
  173 + function() {
  174 + console.log("dataImport.html消失");
  175 + }
  176 + );
  177 + };
129 178
130 } 179 }
131 ] 180 ]
132 ); 181 );
133 182
  183 +angular.module('ScheduleApp').controller(
  184 + "RerunManageListOrderOptionModalInstanceCtrl",
  185 + [
  186 + "RerunManageService",
  187 + "$modalInstance",
  188 + function(service, $modalInstance) {
  189 + var self = this;
  190 +
  191 + self.columns = service.getColumns();
  192 + self.orderColumns = service.getOrderColumns();
  193 +
  194 + self.confirm = function(result) {
  195 + // console.log(result);
  196 + // console.log(service.getOrderColumns());
  197 + $modalInstance.dismiss("cancel");
  198 +
  199 + }
  200 + }
  201 + ]
  202 +);
  203 +
134 // form.html控制器 204 // form.html控制器
135 angular.module('ScheduleApp').controller( 205 angular.module('ScheduleApp').controller(
136 'RerunManageFormCtrl', 206 'RerunManageFormCtrl',
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/service.js
@@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;rerunManageService_g&#39;, [&#39;$resource&#39;, func @@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;rerunManageService_g&#39;, [&#39;$resource&#39;, func
3 return { 3 return {
4 rest: $resource( 4 rest: $resource(
5 '/rms/:id', 5 '/rms/:id',
6 - {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id'}, 6 + {order: 'rerunXl.name,isCancel', direction: 'ASC', id: '@id'},
7 { 7 {
8 list: { 8 list: {
9 method: 'GET', 9 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/form.html
@@ -127,6 +127,23 @@ @@ -127,6 +127,23 @@
127 </div> 127 </div>
128 128
129 <div class="form-group has-success has-feedback"> 129 <div class="form-group has-success has-feedback">
  130 + <label class="col-md-2 control-label">规则信息*:</label>
  131 + <div class="col-md-6">
  132 + <sa-Srule name="s_rule_s_t_date"
  133 + xlid="ctrl.schedulePlanManageForSave.xl.id"
  134 + from="ctrl.schedulePlanManageForSave.scheduleFromTime"
  135 + to="ctrl.schedulePlanManageForSave.scheduleToTime"
  136 + error="ctrl.sruleerror"
  137 + required
  138 + >
  139 + </sa-Srule>
  140 + </div>
  141 + <div class="alert alert-danger well-sm" ng-show="myForm.s_rule_s_t_date.$error.required">
  142 + {{ctrl.sruleerror}}
  143 + </div>
  144 + </div>
  145 +
  146 + <div class="form-group has-success has-feedback">
130 <label class="col-md-2 control-label">模式1(历史排班优先):</label> 147 <label class="col-md-2 control-label">模式1(历史排班优先):</label>
131 <div class="col-md-3"> 148 <div class="col-md-3">
132 <sa-Radiogroup model="ctrl.schedulePlanManageForSave.isHistoryPlanFirst" dicgroup="truefalseType" name="isHistoryPlanFirst"></sa-Radiogroup> 149 <sa-Radiogroup model="ctrl.schedulePlanManageForSave.isHistoryPlanFirst" dicgroup="truefalseType" name="isHistoryPlanFirst"></sa-Radiogroup>
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="SchedulePlanManageCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="SchedulePlanManageCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,7 +36,7 @@ @@ -27,7 +36,7 @@
27 <span class="caption-subject bold uppercase">排班计划</span> 36 <span class="caption-subject bold uppercase">排班计划</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 39 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 生成计划 41 生成计划
33 </a> 42 </a>
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
@@ -63,9 +63,24 @@ @@ -63,9 +63,24 @@
63 <td></td> 63 <td></td>
64 <td></td> 64 <td></td>
65 <td> 65 <td>
66 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
67 - ng-click="ctrl.doPage()">  
68 - <i class="fa fa-search"></i> 搜索</button> 66 + <div class="btn-group">
  67 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  68 + ng-click="ctrl.doPage()">
  69 + <i class="fa fa-search"></i> 搜索</button>
  70 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  71 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  72 + <span class="caret"></span>
  73 + <span class="sr-only">dropdown</span>
  74 + </button>
  75 + <ul class="dropdown-menu pull-right">
  76 + <li>
  77 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  78 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  79 + 排序选项
  80 + </a>
  81 + </li>
  82 + </ul>
  83 + </div>
69 84
70 <button class="btn btn-sm red btn-outline filter-cancel" 85 <button class="btn btn-sm red btn-outline filter-cancel"
71 ng-click="ctrl.reset()"> 86 ng-click="ctrl.reset()">
@@ -93,7 +108,7 @@ @@ -93,7 +108,7 @@
93 tooltip-placement="top" 108 tooltip-placement="top"
94 uib-tooltip="{{tinfo.ttInfoName}}" 109 uib-tooltip="{{tinfo.ttInfoName}}"
95 tooltip-class="headClass" 110 tooltip-class="headClass"
96 - ui-sref="ttInfoDetailManage_edit3({xlid: info.xl.id, ttid : tinfo.ttInfoId, xlname: info.xl.name, ttname : tinfo.ttInfoName, rflag : true})"> 111 + ui-sref="ttInfoDetailManage_edit3({xlid: info.xl.id, ttid : tinfo.ttInfoId, xlname: info.xl.name, ttname : tinfo.ttInfoName, rflag : true, lineversion: tinfo.lineVersion})">
97 <i class="fa fa-table" aria-hidden="true"></i> 112 <i class="fa fa-table" aria-hidden="true"></i>
98 {{tinfo.ttInfoName}} 113 {{tinfo.ttInfoName}}
99 </a> 114 </a>
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/module.js
@@ -19,6 +19,19 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -19,6 +19,19 @@ angular.module(&#39;ScheduleApp&#39;).factory(
19 uiToRecord: 0 // 页面绑定,当前页到第几条记录 19 uiToRecord: 0 // 页面绑定,当前页到第几条记录
20 }; 20 };
21 21
  22 + // 字段描述
  23 + var columns = [
  24 + {name: "xl.name", desc: "线路名称"},
  25 + {name: "scheduleFromTime", desc: "排班开始日期"},
  26 + {name: "scheduleToTime", desc: "排班结束日期"},
  27 + {name: "createDate", desc: "操作时间"}
  28 + ];
  29 + // 排序字段
  30 + var orderColumns = {
  31 + order: "xl.name,createDate",
  32 + direction: "DESC,DESC"
  33 + };
  34 +
22 // 查询对象 35 // 查询对象
23 var queryClass = service.rest; 36 var queryClass = service.rest;
24 37
@@ -26,6 +39,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,6 +39,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 getQueryClass: function() { 39 getQueryClass: function() {
27 return queryClass; 40 return queryClass;
28 }, 41 },
  42 + getColumns: function() {
  43 + return columns;
  44 + },
  45 + getOrderColumns: function() {
  46 + return orderColumns;
  47 + },
29 getSearchCondition: function() { 48 getSearchCondition: function() {
30 currentSearchCondition.page = currentPage.uiNumber - 1; 49 currentSearchCondition.page = currentPage.uiNumber - 1;
31 50
@@ -34,6 +53,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -34,6 +53,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
34 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 53 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
35 } 54 }
36 55
  56 + // 重置排序字段条件
  57 + currentSearchCondition.order = orderColumns.order;
  58 + currentSearchCondition.direction = orderColumns.direction;
  59 +
37 return currentSearchCondition; 60 return currentSearchCondition;
38 }, 61 },
39 getPage: function(page) { 62 getPage: function(page) {
@@ -90,7 +113,9 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -90,7 +113,9 @@ angular.module(&#39;ScheduleApp&#39;).controller(
90 [ 113 [
91 'SchedulePlanManageService', 114 'SchedulePlanManageService',
92 '$filter', 115 '$filter',
93 - function(service, $filter) { 116 + 'TTInfoManageService_g',
  117 + '$uibModal',
  118 + function(service, $filter, ttInfoService, $uibModal) {
94 var self = this; 119 var self = this;
95 // 日期 日期控件开关 120 // 日期 日期控件开关
96 self.scheduleFromTime = false; 121 self.scheduleFromTime = false;
@@ -118,24 +143,31 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -118,24 +143,31 @@ angular.module(&#39;ScheduleApp&#39;).controller(
118 // 重新组装关联时刻表信息 143 // 重新组装关联时刻表信息
119 if (page.content) { 144 if (page.content) {
120 angular.forEach(page.content, function(ttinfo) { 145 angular.forEach(page.content, function(ttinfo) {
121 - var rst = [];  
122 - var temp1 = [];  
123 - var temp2 = [];  
124 - if (ttinfo.ttInfoNames && ttinfo.ttInfoIds) {  
125 - temp1 = ttinfo.ttInfoNames.split(",");  
126 - temp2 = ttinfo.ttInfoIds.split(",");  
127 - } 146 + (function(obj) {
  147 + var rst = [];
  148 + var temp1 = [];
  149 + var temp2 = [];
  150 + if (obj.ttInfoNames && obj.ttInfoIds) {
  151 + temp1 = obj.ttInfoNames.split(",");
  152 + temp2 = obj.ttInfoIds.split(",");
  153 + }
128 154
129 - if (temp1.length == temp2.length) {  
130 - for (var i = 0; i < temp1.length; i++) {  
131 - rst.push({  
132 - ttInfoName: temp1[i],  
133 - ttInfoId: temp2[i]  
134 - }); 155 + if (temp1.length == temp2.length) {
  156 + for (var i = 0; i < temp1.length; i++) {
  157 + (function(index) {
  158 + ttInfoService.rest.get({id: temp2[index]}, function(value) {
  159 + rst.push({
  160 + ttInfoName: temp1[index],
  161 + ttInfoId: temp2[index],
  162 + lineVersion: value.lineVersion
  163 + });
  164 + });
  165 + })(i);
  166 + }
135 } 167 }
136 - }  
137 168
138 - ttinfo.rst = rst; 169 + ttinfo.rst = rst;
  170 + })(ttinfo);
139 }); 171 });
140 } 172 }
141 }); 173 });
@@ -184,6 +216,51 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -184,6 +216,51 @@ angular.module(&#39;ScheduleApp&#39;).controller(
184 // 转换日期成str 216 // 转换日期成str
185 self.toDateStr = function(time) { 217 self.toDateStr = function(time) {
186 return $filter('date')(new Date(time), 'yyyy-MM-dd'); 218 return $filter('date')(new Date(time), 'yyyy-MM-dd');
  219 + };
  220 +
  221 + self.customOrder = function() {
  222 + // large方式弹出模态对话框
  223 + var modalInstance = $uibModal.open({
  224 + templateUrl: '/pages/scheduleApp/module/core/schedulePlanManage/orderOptionOpen.html',
  225 + size: "sm",
  226 + animation: true,
  227 + backdrop: 'static',
  228 + resolve: {
  229 + },
  230 + windowClass: 'center-modal',
  231 + controller: "SchedulePlanManageListOrderOptionModalInstanceCtrl",
  232 + controllerAs: "$ctrl",
  233 + bindToController: true
  234 + });
  235 + modalInstance.result.then(
  236 + function(result) {
  237 + console.log("dataImport.html打开");
  238 + },
  239 + function() {
  240 + console.log("dataImport.html消失");
  241 + }
  242 + );
  243 + };
  244 + }
  245 + ]
  246 +);
  247 +
  248 +angular.module('ScheduleApp').controller(
  249 + "SchedulePlanManageListOrderOptionModalInstanceCtrl",
  250 + [
  251 + "SchedulePlanManageService",
  252 + "$modalInstance",
  253 + function(service, $modalInstance) {
  254 + var self = this;
  255 +
  256 + self.columns = service.getColumns();
  257 + self.orderColumns = service.getOrderColumns();
  258 +
  259 + self.confirm = function(result) {
  260 + // console.log(result);
  261 + // console.log(service.getOrderColumns());
  262 + $modalInstance.dismiss("cancel");
  263 +
187 } 264 }
188 } 265 }
189 ] 266 ]
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
@@ -65,6 +65,7 @@ @@ -65,6 +65,7 @@
65 </div> 65 </div>
66 <!-- 隐藏块,显示验证信息 --> 66 <!-- 隐藏块,显示验证信息 -->
67 <div class="alert alert-danger well-sm" ng-show="myForm.ddr.$error.required"> 67 <div class="alert alert-danger well-sm" ng-show="myForm.ddr.$error.required">
  68 + <i class="fa fa-times-circle" aria-hidden="true"></i>
68 调度原因必须选择 69 调度原因必须选择
69 </div> 70 </div>
70 </div> 71 </div>
@@ -87,6 +88,7 @@ @@ -87,6 +88,7 @@
87 </div> 88 </div>
88 <!-- 隐藏块,显示验证信息 --> 89 <!-- 隐藏块,显示验证信息 -->
89 <div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required"> 90 <div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required">
  91 + <i class="fa fa-times-circle" aria-hidden="true"></i>
90 车辆1必须选择 92 车辆1必须选择
91 </div> 93 </div>
92 94
@@ -96,6 +98,7 @@ @@ -96,6 +98,7 @@
96 remotevtype="cc_cars_gs" 98 remotevtype="cc_cars_gs"
97 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl1.id} | json}}" /> 99 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl1.id} | json}}" />
98 <div class="alert alert-danger well-sm" ng-show="myForm.cl1_h_gs.$error.remote"> 100 <div class="alert alert-danger well-sm" ng-show="myForm.cl1_h_gs.$error.remote">
  101 + <i class="fa fa-times-circle" aria-hidden="true"></i>
99 {{$remote_msg}} 102 {{$remote_msg}}
100 </div> 103 </div>
101 <!-- 分公司权限 --> 104 <!-- 分公司权限 -->
@@ -109,6 +112,18 @@ @@ -109,6 +112,18 @@
109 <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> 112 <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
110 {{ctrl.cl1_h_fgs_warn}} 113 {{ctrl.cl1_h_fgs_warn}}
111 </div> 114 </div>
  115 +
  116 + <!-- 车辆配置判定 -->
  117 + <input type="hidden" name="cl1_h_xl" ng-model="ctrl.formData.cl1.id"
  118 + remote-Warn
  119 + remotewtype="cc_cars_2"
  120 + remotewparam="{{ {'xlId': ctrl.xlId, 'clId': ctrl.formData.cl1.id} | json}}"
  121 + remotewmsgprop="cl1_h_xl_warn" />
  122 + <div class="alert alert-warning well-sm" ng-show="ctrl.cl1_h_xl_warn">
  123 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  124 + {{ctrl.cl1_h_xl_warn}}
  125 + </div>
  126 +
112 </div> 127 </div>
113 <div class="form-group"> 128 <div class="form-group">
114 <label class="col-md-5 control-label">车辆2:</label> 129 <label class="col-md-5 control-label">车辆2:</label>
@@ -133,6 +148,7 @@ @@ -133,6 +148,7 @@
133 remotevtype="cc_cars_gs" 148 remotevtype="cc_cars_gs"
134 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl2.id} | json}}" /> 149 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl2.id} | json}}" />
135 <div class="alert alert-danger well-sm" ng-show="myForm.cl2_h_gs.$error.remote"> 150 <div class="alert alert-danger well-sm" ng-show="myForm.cl2_h_gs.$error.remote">
  151 + <i class="fa fa-times-circle" aria-hidden="true"></i>
136 {{$remote_msg}} 152 {{$remote_msg}}
137 </div> 153 </div>
138 <!-- 分公司权限 --> 154 <!-- 分公司权限 -->
@@ -147,6 +163,17 @@ @@ -147,6 +163,17 @@
147 {{ctrl.cl2_h_fgs_warn}} 163 {{ctrl.cl2_h_fgs_warn}}
148 </div> 164 </div>
149 165
  166 + <!-- 车辆配置判定 -->
  167 + <input type="hidden" name="cl2_h_xl" ng-model="ctrl.formData.cl2.id"
  168 + remote-Warn
  169 + remotewtype="cc_cars_2"
  170 + remotewparam="{{ {'xlId': ctrl.xlId, 'clId': ctrl.formData.cl2.id} | json}}"
  171 + remotewmsgprop="cl2_h_xl_warn" />
  172 + <div class="alert alert-warning well-sm" ng-show="ctrl.cl2_h_xl_warn">
  173 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  174 + {{ctrl.cl2_h_xl_warn}}
  175 + </div>
  176 +
150 </div> 177 </div>
151 178
152 <div class="form-group has-success has-feedback"> 179 <div class="form-group has-success has-feedback">
@@ -168,6 +195,7 @@ @@ -168,6 +195,7 @@
168 </div> 195 </div>
169 <!-- 隐藏块,显示验证信息 --> 196 <!-- 隐藏块,显示验证信息 -->
170 <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required"> 197 <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">
  198 + <i class="fa fa-times-circle" aria-hidden="true"></i>
171 驾驶员必须选择 199 驾驶员必须选择
172 </div> 200 </div>
173 201
@@ -177,6 +205,7 @@ @@ -177,6 +205,7 @@
177 remotevtype="ec_jsy_gs" 205 remotevtype="ec_jsy_gs"
178 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j1.id} | json}}" /> 206 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j1.id} | json}}" />
179 <div class="alert alert-danger well-sm" ng-show="myForm.j1_h_gs.$error.remote"> 207 <div class="alert alert-danger well-sm" ng-show="myForm.j1_h_gs.$error.remote">
  208 + <i class="fa fa-times-circle" aria-hidden="true"></i>
180 {{$remote_msg}} 209 {{$remote_msg}}
181 </div> 210 </div>
182 <!-- 分公司权限 --> 211 <!-- 分公司权限 -->
@@ -216,6 +245,7 @@ @@ -216,6 +245,7 @@
216 remotevtype="ec_spy_gs" 245 remotevtype="ec_spy_gs"
217 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s1.id} | json}}" /> 246 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s1.id} | json}}" />
218 <div class="alert alert-danger well-sm" ng-show="myForm.s1_h_gs.$error.remote"> 247 <div class="alert alert-danger well-sm" ng-show="myForm.s1_h_gs.$error.remote">
  248 + <i class="fa fa-times-circle" aria-hidden="true"></i>
219 {{$remote_msg}} 249 {{$remote_msg}}
220 </div> 250 </div>
221 <!-- 分公司权限 --> 251 <!-- 分公司权限 -->
@@ -254,6 +284,7 @@ @@ -254,6 +284,7 @@
254 remotevtype="ec_jsy_gs" 284 remotevtype="ec_jsy_gs"
255 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j2.id} | json}}" /> 285 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j2.id} | json}}" />
256 <div class="alert alert-danger well-sm" ng-show="myForm.j2_h_gs.$error.remote"> 286 <div class="alert alert-danger well-sm" ng-show="myForm.j2_h_gs.$error.remote">
  287 + <i class="fa fa-times-circle" aria-hidden="true"></i>
257 {{$remote_msg}} 288 {{$remote_msg}}
258 </div> 289 </div>
259 <!-- 分公司权限 --> 290 <!-- 分公司权限 -->
@@ -293,6 +324,7 @@ @@ -293,6 +324,7 @@
293 remotevtype="ec_spy_gs" 324 remotevtype="ec_spy_gs"
294 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s2.id} | json}}" /> 325 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s2.id} | json}}" />
295 <div class="alert alert-danger well-sm" ng-show="myForm.s2_h_gs.$error.remote"> 326 <div class="alert alert-danger well-sm" ng-show="myForm.s2_h_gs.$error.remote">
  327 + <i class="fa fa-times-circle" aria-hidden="true"></i>
296 {{$remote_msg}} 328 {{$remote_msg}}
297 </div> 329 </div>
298 <!-- 分公司权限 --> 330 <!-- 分公司权限 -->
@@ -332,6 +364,7 @@ @@ -332,6 +364,7 @@
332 remotevtype="ec_jsy_gs" 364 remotevtype="ec_jsy_gs"
333 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j3.id} | json}}" /> 365 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j3.id} | json}}" />
334 <div class="alert alert-danger well-sm" ng-show="myForm.j3_h_gs.$error.remote"> 366 <div class="alert alert-danger well-sm" ng-show="myForm.j3_h_gs.$error.remote">
  367 + <i class="fa fa-times-circle" aria-hidden="true"></i>
335 {{$remote_msg}} 368 {{$remote_msg}}
336 </div> 369 </div>
337 <!-- 分公司权限 --> 370 <!-- 分公司权限 -->
@@ -371,6 +404,7 @@ @@ -371,6 +404,7 @@
371 remotevtype="ec_spy_gs" 404 remotevtype="ec_spy_gs"
372 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s3.id} | json}}" /> 405 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s3.id} | json}}" />
373 <div class="alert alert-danger well-sm" ng-show="myForm.s3_h_gs.$error.remote"> 406 <div class="alert alert-danger well-sm" ng-show="myForm.s3_h_gs.$error.remote">
  407 + <i class="fa fa-times-circle" aria-hidden="true"></i>
374 {{$remote_msg}} 408 {{$remote_msg}}
375 </div> 409 </div>
376 <!-- 分公司权限 --> 410 <!-- 分公司权限 -->
@@ -399,6 +433,7 @@ @@ -399,6 +433,7 @@
399 </div> 433 </div>
400 <!-- 隐藏块,显示验证信息 --> 434 <!-- 隐藏块,显示验证信息 -->
401 <div class="alert alert-danger well-sm" ng-show="myForm.ddrdesc.$error.maxlength"> 435 <div class="alert alert-danger well-sm" ng-show="myForm.ddrdesc.$error.maxlength">
  436 + <i class="fa fa-times-circle" aria-hidden="true"></i>
402 最大100个字 437 最大100个字
403 </div> 438 </div>
404 </div> 439 </div>
@@ -443,7 +478,7 @@ @@ -443,7 +478,7 @@
443 <div class="col-md-offset-3 col-md-4"> 478 <div class="col-md-offset-3 col-md-4">
444 <button type="submit" class="btn green" 479 <button type="submit" class="btn green"
445 ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> 480 ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
446 - <a type="button" class="btn default" ui-sref="schedulePlanReportExtManage" ><i class="fa fa-times"></i> 取消</a> 481 + <a type="button" class="btn default" ui-sref="schedulePlanReportExtManage" ><i class="fa fa-times-circle"></i> 取消</a>
447 </div> 482 </div>
448 </div> 483 </div>
449 </div> 484 </div>
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
@@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource @@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource
3 return { 3 return {
4 rest : $resource( 4 rest : $resource(
5 '/spc/:id', 5 '/spc/:id',
6 - {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id'}, 6 + {order: 'xl.name,createDate', direction: 'DESC,DESC', id: '@id'},
7 { 7 {
8 list: { 8 list: {
9 method: 'GET', 9 method: 'GET',
@@ -55,6 +55,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource @@ -55,6 +55,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource
55 method: 'GET' 55 method: 'GET'
56 } 56 }
57 } 57 }
  58 + ),
  59 + v_rules: $resource(
  60 + '/spc/valttrule/:xlid/:from/:to',
  61 + {xlid: '@xlid', from: '@from', to: '@to'},
  62 + {
  63 + val: {
  64 + method: 'GET'
  65 + }
  66 + }
58 ) 67 )
59 }; 68 };
60 }]); 69 }]);
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="ScheduleRuleManageCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="ScheduleRuleManageCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -27,13 +36,13 @@ @@ -27,13 +36,13 @@
27 <span class="caption-subject bold uppercase">排班规则</span> 36 <span class="caption-subject bold uppercase">排班规则</span>
28 </div> 37 </div>
29 <div class="actions"> 38 <div class="actions">
30 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> 39 + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 40 <i class="fa fa-plus"></i>
32 添加规则 41 添加规则
33 </a> 42 </a>
34 43
35 <div class="btn-group"> 44 <div class="btn-group">
36 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> 45 + <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown">
37 <i class="fa fa-share"></i> 46 <i class="fa fa-share"></i>
38 <span>数据工具</span> 47 <span>数据工具</span>
39 <i class="fa fa-angle-down"></i> 48 <i class="fa fa-angle-down"></i>
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/list.html
@@ -44,9 +44,24 @@ @@ -44,9 +44,24 @@
44 <td></td> 44 <td></td>
45 <td></td> 45 <td></td>
46 <td> 46 <td>
47 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
48 - ng-click="ctrl.doPage()">  
49 - <i class="fa fa-search"></i> 搜索</button> 47 + <div class="btn-group">
  48 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  49 + ng-click="ctrl.doPage()">
  50 + <i class="fa fa-search"></i> 搜索</button>
  51 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  52 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  53 + <span class="caret"></span>
  54 + <span class="sr-only">dropdown</span>
  55 + </button>
  56 + <ul class="dropdown-menu pull-right">
  57 + <li>
  58 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  59 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  60 + 排序选项
  61 + </a>
  62 + </li>
  63 + </ul>
  64 + </div>
50 65
51 <button class="btn btn-sm red btn-outline filter-cancel" 66 <button class="btn btn-sm red btn-outline filter-cancel"
52 ng-click="ctrl.reset()"> 67 ng-click="ctrl.reset()">
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/module.js
@@ -19,6 +19,19 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -19,6 +19,19 @@ angular.module(&#39;ScheduleApp&#39;).factory(
19 uiToRecord: 0 // 页面绑定,当前页到第几条记录 19 uiToRecord: 0 // 页面绑定,当前页到第几条记录
20 }; 20 };
21 21
  22 + // 字段描述
  23 + var columns = [
  24 + {name: "xl.name", desc: "线路名称"},
  25 + {name: "updateDate", desc: "修改时间"},
  26 + {name: "qyrq", desc: "启用日期"},
  27 + {name: "carConfigInfo.cl.insideCode", desc: "车辆"}
  28 + ];
  29 + // 排序字段
  30 + var orderColumns = {
  31 + order: "xl.name,updateDate,carConfigInfo.cl.insideCode",
  32 + direction: "ASC,DESC,ASC"
  33 + };
  34 +
22 // 查询对象 35 // 查询对象
23 var queryClass = service.rest; 36 var queryClass = service.rest;
24 37
@@ -26,7 +39,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,7 +39,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 getQueryClass: function() { 39 getQueryClass: function() {
27 return queryClass; 40 return queryClass;
28 }, 41 },
29 - 42 + getColumns: function() {
  43 + return columns;
  44 + },
  45 + getOrderColumns: function() {
  46 + return orderColumns;
  47 + },
30 /** 48 /**
31 * 获取查询条件信息, 49 * 获取查询条件信息,
32 * 用于给controller用来和页面数据绑定。 50 * 用于给controller用来和页面数据绑定。
@@ -39,6 +57,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -39,6 +57,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
39 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 57 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
40 } 58 }
41 59
  60 + // 重置排序字段条件
  61 + currentSearchCondition.order = orderColumns.order;
  62 + currentSearchCondition.direction = orderColumns.direction;
  63 +
42 return currentSearchCondition; 64 return currentSearchCondition;
43 }, 65 },
44 getPage: function(page) { 66 getPage: function(page) {
@@ -209,7 +231,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -209,7 +231,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
209 'ScheduleRuleManageListCtrl', 231 'ScheduleRuleManageListCtrl',
210 [ 232 [
211 'ScheduleRuleManageService', 233 'ScheduleRuleManageService',
212 - function(service) { 234 + '$uibModal',
  235 + function(service, $uibModal) {
213 var self = this; 236 var self = this;
214 var ScheduleRuleManage = service.getQueryClass(); 237 var ScheduleRuleManage = service.getQueryClass();
215 238
@@ -250,6 +273,51 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -250,6 +273,51 @@ angular.module(&#39;ScheduleApp&#39;).controller(
250 return type == "FBGSMODE"; 273 return type == "FBGSMODE";
251 } 274 }
252 275
  276 + self.customOrder = function() {
  277 + // large方式弹出模态对话框
  278 + var modalInstance = $uibModal.open({
  279 + templateUrl: '/pages/scheduleApp/module/core/scheduleRuleManage/orderOptionOpen.html',
  280 + size: "sm",
  281 + animation: true,
  282 + backdrop: 'static',
  283 + resolve: {
  284 + },
  285 + windowClass: 'center-modal',
  286 + controller: "ScheduleRuleManageListOrderOptionModalInstanceCtrl",
  287 + controllerAs: "$ctrl",
  288 + bindToController: true
  289 + });
  290 + modalInstance.result.then(
  291 + function(result) {
  292 + console.log("dataImport.html打开");
  293 + },
  294 + function() {
  295 + console.log("dataImport.html消失");
  296 + }
  297 + );
  298 + };
  299 +
  300 + }
  301 + ]
  302 +);
  303 +
  304 +angular.module('ScheduleApp').controller(
  305 + "ScheduleRuleManageListOrderOptionModalInstanceCtrl",
  306 + [
  307 + "ScheduleRuleManageService",
  308 + "$modalInstance",
  309 + function(service, $modalInstance) {
  310 + var self = this;
  311 +
  312 + self.columns = service.getColumns();
  313 + self.orderColumns = service.getOrderColumns();
  314 +
  315 + self.confirm = function(result) {
  316 + // console.log(result);
  317 + // console.log(service.getOrderColumns());
  318 + $modalInstance.dismiss("cancel");
  319 +
  320 + }
253 } 321 }
254 ] 322 ]
255 ); 323 );
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/service.js
@@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource @@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource
3 return { 3 return {
4 rest: $resource( 4 rest: $resource(
5 '/sr1fc/:id', 5 '/sr1fc/:id',
6 - {order: 'xl.id,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'}, 6 + {order: 'xl.name,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'},
7 { 7 {
8 list: { 8 list: {
9 method: 'GET', 9 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html
@@ -97,8 +97,8 @@ @@ -97,8 +97,8 @@
97 <sa-Select5 name="qdz" 97 <sa-Select5 name="qdz"
98 model="ctrl.TimeTableDetailForSave" 98 model="ctrl.TimeTableDetailForSave"
99 cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}" 99 cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}"
100 - dcname="qdzCode"  
101 - icname="zcode" 100 + dcname="qcode_name"
  101 + icname="code_name"
102 dsparams="{{ {type: 'ajax', param: {'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir, 'lineversion': ctrl.TimeTableDetailForSave.lineVersion}, atype:'zd_tcc' } | json }}" 102 dsparams="{{ {type: 'ajax', param: {'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir, 'lineversion': ctrl.TimeTableDetailForSave.lineVersion}, atype:'zd_tcc' } | json }}"
103 iterobjname="item" 103 iterobjname="item"
104 iterobjexp="item.aname" 104 iterobjexp="item.aname"
@@ -118,8 +118,8 @@ @@ -118,8 +118,8 @@
118 <sa-Select5 name="zdz" 118 <sa-Select5 name="zdz"
119 model="ctrl.TimeTableDetailForSave" 119 model="ctrl.TimeTableDetailForSave"
120 cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}" 120 cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}"
121 - dcname="zdzCode"  
122 - icname="zcode" 121 + dcname="zcode_name"
  122 + icname="code_name"
123 dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir, 'lineversion': ctrl.TimeTableDetailForSave.lineVersion}, atype:'zd_tcc' } | json }}" 123 dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir, 'lineversion': ctrl.TimeTableDetailForSave.lineVersion}, atype:'zd_tcc' } | json }}"
124 iterobjname="item" 124 iterobjname="item"
125 iterobjexp="item.aname" 125 iterobjexp="item.aname"
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
@@ -511,6 +511,10 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -511,6 +511,10 @@ angular.module(&#39;ScheduleApp&#39;).controller(
511 "->路牌" + self.TimeTableDetailForSave.lp.lpName + 511 "->路牌" + self.TimeTableDetailForSave.lp.lpName +
512 "->发车顺序号" + self.TimeTableDetailForSave.fcno + 512 "->发车顺序号" + self.TimeTableDetailForSave.fcno +
513 "->班次详细信息"; 513 "->班次详细信息";
  514 +
  515 + // 添加编码加名字组合字段
  516 + self.TimeTableDetailForSave["qcode_name"] = self.TimeTableDetailForSave["qdzCode"] + "_" + self.TimeTableDetailForSave["qdzName"];
  517 + self.TimeTableDetailForSave["zcode_name"] = self.TimeTableDetailForSave["zdzCode"] + "_" + self.TimeTableDetailForSave["zdzName"];
514 }); 518 });
515 519
516 } else { // 此单元格为空,使用columnBcInfo填充 520 } else { // 此单元格为空,使用columnBcInfo填充
@@ -540,6 +544,11 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -540,6 +544,11 @@ angular.module(&#39;ScheduleApp&#39;).controller(
540 //if (self.busInfoForSave) { 544 //if (self.busInfoForSave) {
541 // delete $stateParams.id; 545 // delete $stateParams.id;
542 //} 546 //}
  547 +
  548 + // 删除编码加名字组合字段
  549 + delete self.TimeTableDetailForSave["qcode_name"];
  550 + delete self.TimeTableDetailForSave["zcode_name"];
  551 +
543 self.TimeTableDetailForSave.$save(function(value) { 552 self.TimeTableDetailForSave.$save(function(value) {
544 // 修正内部edit的值 553 // 修正内部edit的值
545 var detailInfos = service.getEditInfo().detailInfos; 554 var detailInfos = service.getEditInfo().detailInfos;
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/index.html
@@ -20,6 +20,15 @@ @@ -20,6 +20,15 @@
20 20
21 <div class="row"> 21 <div class="row">
22 <div class="col-md-12" ng-controller="TtInfoManageIndexCtrl as ctrl"> 22 <div class="col-md-12" ng-controller="TtInfoManageIndexCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
23 <div class="portlet light bordered"> 32 <div class="portlet light bordered">
24 <div class="portlet-title"> 33 <div class="portlet-title">
25 <div class="caption font-dark"> 34 <div class="caption font-dark">
@@ -31,7 +40,7 @@ @@ -31,7 +40,7 @@
31 <!--<i class="fa fa-plus"></i>--> 40 <!--<i class="fa fa-plus"></i>-->
32 <!--测试--> 41 <!--测试-->
33 <!--</a>--> 42 <!--</a>-->
34 - <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()"> 43 + <a href="javascript:" class="btn blue" ng-click="ctrl.toTtInfoManageForm()">
35 <i class="fa fa-plus"></i> 44 <i class="fa fa-plus"></i>
36 添加时刻表 45 添加时刻表
37 </a> 46 </a>
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
@@ -47,9 +47,24 @@ @@ -47,9 +47,24 @@
47 </td> 47 </td>
48 <td></td> 48 <td></td>
49 <td> 49 <td>
50 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"  
51 - ng-click="ctrl.doPage()">  
52 - <i class="fa fa-search"></i> 搜索</button> 50 + <div class="btn-group">
  51 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  52 + ng-click="ctrl.doPage()">
  53 + <i class="fa fa-search"></i> 搜索</button>
  54 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  55 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  56 + <span class="caret"></span>
  57 + <span class="sr-only">dropdown</span>
  58 + </button>
  59 + <ul class="dropdown-menu pull-right">
  60 + <li>
  61 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  62 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  63 + 排序选项
  64 + </a>
  65 + </li>
  66 + </ul>
  67 + </div>
53 68
54 <button class="btn btn-sm red btn-outline filter-cancel" 69 <button class="btn btn-sm red btn-outline filter-cancel"
55 ng-click="ctrl.reset()"> 70 ng-click="ctrl.reset()">
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/module.js
@@ -19,6 +19,21 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -19,6 +19,21 @@ angular.module(&#39;ScheduleApp&#39;).factory(
19 uiToRecord: 0 // 页面绑定,当前页到第几条记录 19 uiToRecord: 0 // 页面绑定,当前页到第几条记录
20 }; 20 };
21 21
  22 + // 字段描述
  23 + var columns = [
  24 + {name: "xl.name", desc: "线路名称"},
  25 + {name: "name", desc: "时刻表名称"},
  26 + {name: "xlDir", desc: "上下行"},
  27 + {name: "isEnableDisTemplate", desc: "是否启用"},
  28 + {name: "qyrq", desc: "启用日期"},
  29 + {name: "isCancel", desc: "是否作废"}
  30 + ];
  31 + // 排序字段
  32 + var orderColumns = {
  33 + order: "xl.name,isCancel,isEnableDisTemplate,qyrq",
  34 + direction: "DESC,ASC,DESC,DESC"
  35 + };
  36 +
22 // 查询对象类 37 // 查询对象类
23 var queryClass = service.rest; 38 var queryClass = service.rest;
24 39
@@ -26,6 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -26,6 +41,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
26 getTtInfoQueryClass: function() { 41 getTtInfoQueryClass: function() {
27 return queryClass; 42 return queryClass;
28 }, 43 },
  44 + getColumns: function() {
  45 + return columns;
  46 + },
  47 + getOrderColumns: function() {
  48 + return orderColumns;
  49 + },
29 getSearchCondition: function() { 50 getSearchCondition: function() {
30 currentSearchCondition.page = currentPage.uiNumber - 1; 51 currentSearchCondition.page = currentPage.uiNumber - 1;
31 52
@@ -34,6 +55,10 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -34,6 +55,10 @@ angular.module(&#39;ScheduleApp&#39;).factory(
34 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(","); 55 currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
35 } 56 }
36 57
  58 + // 重置排序字段条件
  59 + currentSearchCondition.order = orderColumns.order;
  60 + currentSearchCondition.direction = orderColumns.direction;
  61 +
37 return currentSearchCondition; 62 return currentSearchCondition;
38 }, 63 },
39 getPage: function(page) { 64 getPage: function(page) {
@@ -125,7 +150,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -125,7 +150,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
125 [ 150 [
126 'TtInfoManageService', 151 'TtInfoManageService',
127 'FileDownload_g', 152 'FileDownload_g',
128 - function(service, fileDownload) { 153 + '$uibModal',
  154 + function(service, fileDownload, $uibModal) {
129 var self = this; 155 var self = this;
130 var TtInfo = service.getTtInfoQueryClass(); 156 var TtInfo = service.getTtInfoQueryClass();
131 157
@@ -204,7 +230,50 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -204,7 +230,50 @@ angular.module(&#39;ScheduleApp&#39;).controller(
204 230
205 }; 231 };
206 232
207 - // TODO: 233 + self.customOrder = function() {
  234 + // large方式弹出模态对话框
  235 + var modalInstance = $uibModal.open({
  236 + templateUrl: '/pages/scheduleApp/module/core/ttInfoManage/orderOptionOpen.html',
  237 + size: "sm",
  238 + animation: true,
  239 + backdrop: 'static',
  240 + resolve: {
  241 + },
  242 + windowClass: 'center-modal',
  243 + controller: "TtInfoManageListOrderOptionModalInstanceCtrl",
  244 + controllerAs: "$ctrl",
  245 + bindToController: true
  246 + });
  247 + modalInstance.result.then(
  248 + function(result) {
  249 + console.log("dataImport.html打开");
  250 + },
  251 + function() {
  252 + console.log("dataImport.html消失");
  253 + }
  254 + );
  255 + };
  256 + }
  257 + ]
  258 +);
  259 +
  260 +angular.module('ScheduleApp').controller(
  261 + "TtInfoManageListOrderOptionModalInstanceCtrl",
  262 + [
  263 + "TtInfoManageService",
  264 + "$modalInstance",
  265 + function(service, $modalInstance) {
  266 + var self = this;
  267 +
  268 + self.columns = service.getColumns();
  269 + self.orderColumns = service.getOrderColumns();
  270 +
  271 + self.confirm = function(result) {
  272 + // console.log(result);
  273 + // console.log(service.getOrderColumns());
  274 + $modalInstance.dismiss("cancel");
  275 +
  276 + }
208 } 277 }
209 ] 278 ]
210 ); 279 );
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
@@ -7,7 +7,7 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -7,7 +7,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
7 return { 7 return {
8 rest: $resource( 8 rest: $resource(
9 '/tic_ec/:id', 9 '/tic_ec/:id',
10 - {order: 'xl,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'}, 10 + {order: 'xl.name,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'},
11 { 11 {
12 list: { 12 list: {
13 method: 'GET', 13 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/detail.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>智能时刻表管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="ttInfoManage2">智能时刻表管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">时刻表基础信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="TtInfoManage2DetailCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase"
  30 + ng-bind="ctrl.title"></span>
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="portlet-body form">
  35 + <form class="form-horizontal" novalidate name="myForm">
  36 + <!--<div class="alert alert-danger display-hide">-->
  37 + <!--<button class="close" data-close="alert"></button>-->
  38 + <!--您的输入有误,请检查下面的输入项-->
  39 + <!--</div>-->
  40 +
  41 +
  42 + <!-- 其他信息放置在这里 -->
  43 + <div class="form-body">
  44 + <div class="form-group has-success has-feedback">
  45 + <label class="col-md-2 control-label">线路*:</label>
  46 + <div class="col-md-4">
  47 + <input type="text" class="form-control"
  48 + name="xl" ng-model="ctrl.ttInfoManageForDetail.xl.name" readonly/>
  49 + </div>
  50 + </div>
  51 +
  52 + <div class="form-group has-success has-feedback">
  53 + <label class="col-md-2 control-label">线路走向*:</label>
  54 + <div class="col-md-4">
  55 + <sa-Radiogroup model="ctrl.ttInfoManageForDetail.xlDir" dicgroup="LineTrend2" name="xlDir" disabled="true"></sa-Radiogroup>
  56 + </div>
  57 + </div>
  58 +
  59 + <div class="form-group has-success has-feedback">
  60 + <label class="col-md-2 control-label">时刻表名字*:</label>
  61 + <div class="col-md-4">
  62 + <input type="text" class="form-control"
  63 + name="name" ng-model="ctrl.ttInfoManageForDetail.name" readonly/>
  64 + </div>
  65 + </div>
  66 +
  67 + <div class="form-group has-success has-feedback">
  68 + <label class="col-md-2 control-label">启用日期*:</label>
  69 + <div class="col-md-4">
  70 + <input type="text" class="form-control"
  71 + name="qyrq" uib-datepicker-popup="yyyy年MM月dd日"
  72 + ng-model="ctrl.ttInfoManageForDetail.qyrq" readonly/>
  73 + </div>
  74 + </div>
  75 +
  76 + <div class="form-group has-success has-feedback">
  77 + <label class="col-md-2 control-label">是否启用*:</label>
  78 + <div class="col-md-4">
  79 + <sa-Radiogroup model="ctrl.ttInfoManageForDetail.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" disabled="true"></sa-Radiogroup>
  80 + </div>
  81 +
  82 + </div>
  83 +
  84 + <!--<div class="form-group">-->
  85 + <!--<label class="col-md-2 control-label">路牌数量:</label>-->
  86 + <!--<div class="col-md-4">-->
  87 + <!--<input type="number" class="form-control" ng-value="ctrl.ttInfoManageForDetail.lpCount"-->
  88 + <!--name="lpCount" placeholder="请输入路牌数" min="1" readonly/>-->
  89 + <!--</div>-->
  90 + <!--</div>-->
  91 +
  92 + <!--<div class="form-group">-->
  93 + <!--<label class="col-md-2 control-label">营运圈数:</label>-->
  94 + <!--<div class="col-md-4">-->
  95 + <!--<input type="number" class="form-control" ng-value="ctrl.ttInfoManageForDetail.loopCount"-->
  96 + <!--name="loopCount" placeholder="请输入圈数" min="1" readonly/>-->
  97 + <!--</div>-->
  98 + <!--</div>-->
  99 +
  100 + <!--<div class="form-group">-->
  101 + <!--<label class="col-md-2 control-label">停车场:</label>-->
  102 + <!--<div class="col-md-4">-->
  103 + <!--<input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.xl.carParkCode | dict:'CarPark':'未知' "-->
  104 + <!--name="carParkCode" readonly/>-->
  105 + <!--</div>-->
  106 + <!--</div>-->
  107 +
  108 + <div class="form-group">
  109 + <label class="col-md-2 control-label">常规有效日:</label>
  110 + <div class="col-md-6">
  111 + <sa-Checkboxgroup model="ctrl.timeTableManageForForm"
  112 + name="rule_days"
  113 + dcvalue="{{ctrl.ttInfoManageForDetail.rule_days}}"
  114 + disabled >
  115 + </sa-Checkboxgroup>
  116 + </div>
  117 + </div>
  118 +
  119 + <div class="form-group">
  120 + <label class="col-md-2 control-label">特殊有效日:</label>
  121 + <div class="col-md-6">
  122 + <sa-Dategroup model="ctrl.ttInfoManageForDetail"
  123 + name="special_days"
  124 + dcvalue="{{ctrl.timeTableManageForDetail.special_days}}"
  125 + disabled
  126 + >
  127 + </sa-Dategroup>
  128 + </div>
  129 + </div>
  130 +
  131 + <!--<div class="form-group">-->
  132 + <!--<label class="col-md-2 control-label">备注:</label>-->
  133 + <!--</div>-->
  134 +
  135 + <div class="form-group">
  136 + <label class="col-md-2 control-label">创建人:</label>
  137 + <div class="col-md-4">
  138 + <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.createBy.name"
  139 + name="createBy" readonly/>
  140 + </div>
  141 + </div>
  142 +
  143 + <div class="form-group">
  144 + <label class="col-md-2 control-label">创建时间:</label>
  145 + <div class="col-md-4">
  146 + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForDetail.createDate"
  147 + name="createDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss"
  148 + readonly/>
  149 + </div>
  150 + </div>
  151 +
  152 + <div class="form-group">
  153 + <label class="col-md-2 control-label">更新人:</label>
  154 + <div class="col-md-4">
  155 + <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.updateBy.name"
  156 + name="updateBy" readonly/>
  157 + </div>
  158 + </div>
  159 +
  160 + <div class="form-group">
  161 + <label class="col-md-2 control-label">更新时间:</label>
  162 + <div class="col-md-4">
  163 + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForDetail.updateDate"
  164 + name="updateDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss"
  165 + readonly/>
  166 + </div>
  167 + </div>
  168 +
  169 + <!-- 其他form-group -->
  170 +
  171 + </div>
  172 +
  173 + </form>
  174 +
  175 + </div>
  176 +
  177 +</div>
0 \ No newline at end of file 178 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/edit.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>智能时刻表管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="ttInfoManage2">智能时刻表管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">修改时刻表基础信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="TtInfoManage2FormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 + <!--<div class="alert alert-danger display-hide">-->
  36 + <!--<button class="close" data-close="alert"></button>-->
  37 + <!--您的输入有误,请检查下面的输入项-->
  38 + <!--</div>-->
  39 +
  40 +
  41 + <!-- 其他信息放置在这里 -->
  42 + <div class="form-body">
  43 + <div class="form-group has-success has-feedback">
  44 + <label class="col-md-2 control-label">线路*:</label>
  45 + <div class="col-md-3">
  46 + <sa-Select5 name="xl"
  47 + model="ctrl.ttInfoManageForForm"
  48 + cmaps="{'xl.id' : 'id'}"
  49 + dcname="xl.id"
  50 + icname="id"
  51 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  52 + iterobjname="item"
  53 + iterobjexp="item.name"
  54 + searchph="请输拼音..."
  55 + searchexp="this.name"
  56 + required >
  57 + </sa-Select5>
  58 + </div>
  59 + <!-- 隐藏块,显示验证信息 -->
  60 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  61 + 线路必须选择
  62 + </div>
  63 + </div>
  64 +
  65 + <div class="form-group has-success has-feedback">
  66 + <label class="col-md-2 control-label">线路走向*:</label>
  67 + <div class="col-md-3">
  68 + <sa-Radiogroup model="ctrl.ttInfoManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup>
  69 + </div>
  70 + <!-- 隐藏块,显示验证信息 -->
  71 + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">
  72 + 线路走向必须填写
  73 + </div>
  74 + </div>
  75 +
  76 + <div class="form-group has-success has-feedback">
  77 + <label class="col-md-2 control-label">时刻表名字*:</label>
  78 + <div class="col-md-3">
  79 + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForForm.name"
  80 + name="name" placeholder="请输入时刻表名字..." required
  81 + remote-Validation
  82 + remotevtype="tic_name"
  83 + remotevparam="{{ {'id_eq': ctrl.ttInfoManageForForm.id, 'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'name_eq': ctrl.ttInfoManageForForm.name} | json}}"
  84 + />
  85 + </div>
  86 +
  87 + <!-- 隐藏块,显示验证信息 -->
  88 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required">
  89 + 时刻表名字必须填写
  90 + </div>
  91 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote">
  92 + 相同线路下的时刻表不能同名
  93 + </div>
  94 + </div>
  95 +
  96 + <div class="form-group has-success has-feedback">
  97 + <label class="col-md-2 control-label">启用日期*:</label>
  98 + <div class="col-md-3">
  99 + <div class="input-group">
  100 + <input type="text" class="form-control"
  101 + name="qyrq" placeholder="请选择启用日期..."
  102 + uib-datepicker-popup="yyyy年MM月dd日"
  103 + is-open="ctrl.qyrqOpen"
  104 + ng-model="ctrl.ttInfoManageForForm.qyrq" readonly required/>
  105 + <span class="input-group-btn">
  106 + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">
  107 + <i class="glyphicon glyphicon-calendar"></i>
  108 + </button>
  109 + </span>
  110 + </div>
  111 + </div>
  112 +
  113 + <!-- 隐藏块,显示验证信息 -->
  114 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  115 + 启用日期必须填写
  116 + </div>
  117 + </div>
  118 +
  119 + <div class="form-group has-success has-feedback">
  120 + <label class="col-md-2 control-label">是否启用*:</label>
  121 + <div class="col-md-3">
  122 + <sa-Radiogroup model="ctrl.ttInfoManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup>
  123 + </div>
  124 +
  125 + <!-- 隐藏块,显示验证信息 -->
  126 + <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required">
  127 + 是否启用必须选择
  128 + </div>
  129 +
  130 + </div>
  131 +
  132 + <!--<div class="form-group">-->
  133 + <!--<label class="col-md-2 control-label">路牌数量:</label>-->
  134 + <!--<div class="col-md-3">-->
  135 + <!--<input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.lpCount"-->
  136 + <!--name="lpCount" placeholder="请输入路牌数..." min="1"/>-->
  137 + <!--</div>-->
  138 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number">-->
  139 + <!--必须输入数字-->
  140 + <!--</div>-->
  141 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min">-->
  142 + <!--路爬数量必须大于1-->
  143 + <!--</div>-->
  144 + <!--</div>-->
  145 +
  146 + <!--<div class="form-group">-->
  147 + <!--<label class="col-md-2 control-label">营运圈数:</label>-->
  148 + <!--<div class="col-md-3">-->
  149 + <!--<input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.loopCount"-->
  150 + <!--name="loopCount" placeholder="请输入圈数..." min="1"/>-->
  151 + <!--</div>-->
  152 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number">-->
  153 + <!--必须输入数字-->
  154 + <!--</div>-->
  155 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min">-->
  156 + <!--营运圈数必须大于1-->
  157 + <!--</div>-->
  158 + <!--</div>-->
  159 +
  160 + <div class="form-group">
  161 + <label class="col-md-2 control-label">常规有效日:</label>
  162 + <div class="col-md-6">
  163 + <sa-Checkboxgroup model="ctrl.ttInfoManageForForm"
  164 + name="rule_days"
  165 + dcvalue="{{ctrl.ttInfoManageForForm.rule_days}}"
  166 + dcname="rule_days"
  167 + required >
  168 + </sa-Checkboxgroup>
  169 +
  170 + <input type="hidden" name="rule_days_h" ng-model="ctrl.ttInfoManageForForm.rule_days"
  171 + remote-Warn
  172 + remotewtype="tic_n_d"
  173 + remotewparam="{{ {'id_eq': ctrl.ttInfoManageForForm.id, 'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'rule_days_eq': ctrl.ttInfoManageForForm.rule_days} | json}}"
  174 + remotewmsgprop="rule_days_warn"
  175 + />
  176 +
  177 + </div>
  178 + <div class="alert alert-danger well-sm" ng-show="myForm.rule_days.$error.required">
  179 + 请操作一下1
  180 + </div>
  181 + <div class="alert alert-warning well-sm" ng-show="ctrl.rule_days_warn">
  182 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  183 + {{ctrl.rule_days_warn}}
  184 + </div>
  185 + </div>
  186 +
  187 + <div class="form-group">
  188 + <label class="col-md-2 control-label">特殊有效日:</label>
  189 + <div class="col-md-6">
  190 + <sa-Dategroup model="ctrl.ttInfoManageForForm"
  191 + name="special_days"
  192 + dcvalue="{{ctrl.ttInfoManageForForm.special_days}}"
  193 + dcname="special_days"
  194 + >
  195 + </sa-Dategroup>
  196 +
  197 + <input type="hidden" name="special_days_h" ng-model="ctrl.ttInfoManageForForm.special_days"
  198 + remote-Warn
  199 + remotewtype="tic_s_d"
  200 + remotewparam="{{ {'id_eq': ctrl.ttInfoManageForForm.id, 'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'special_days_eq': ctrl.ttInfoManageForForm.special_days} | json}}"
  201 + remotewmsgprop="rule_special_days_warn"
  202 + />
  203 + </div>
  204 + <div class="alert alert-danger well-sm" ng-show="myForm.special_days.$error.required">
  205 + 请操作一下2
  206 + </div>
  207 +
  208 + <div class="alert alert-warning well-sm" ng-show="ctrl.rule_special_days_warn">
  209 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  210 + {{ctrl.rule_special_days_warn}}
  211 + </div>
  212 + </div>
  213 +
  214 + <!--<div class="form-group">-->
  215 + <!--<label class="col-md-2 control-label">备注:</label>-->
  216 + <!--</div>-->
  217 +
  218 + <!-- 其他form-group -->
  219 +
  220 + </div>
  221 +
  222 + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 -->
  223 + <div class="form-actions">
  224 + <div class="row">
  225 + <div class="col-md-offset-3 col-md-4">
  226 + <button type="submit" class="btn green"
  227 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  228 + <a type="button" class="btn default" ui-sref="ttInfoManage2" ><i class="fa fa-times"></i> 取消</a>
  229 + </div>
  230 + </div>
  231 + </div>
  232 +
  233 + </form>
  234 +
  235 + </div>
  236 +
  237 +
  238 +</div>
0 \ No newline at end of file 239 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/form.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>智能时刻表管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="ttInfoManage2">智能时刻表管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">添加时刻表基础信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="TtInfoManage2FormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 + <!--<div class="alert alert-danger display-hide">-->
  36 + <!--<button class="close" data-close="alert"></button>-->
  37 + <!--您的输入有误,请检查下面的输入项-->
  38 + <!--</div>-->
  39 +
  40 +
  41 + <!-- 其他信息放置在这里 -->
  42 + <div class="form-body">
  43 + <div class="form-group has-success has-feedback">
  44 + <label class="col-md-2 control-label">线路*:</label>
  45 + <div class="col-md-3">
  46 + <sa-Select5 name="xl"
  47 + model="ctrl.ttInfoManageForForm"
  48 + cmaps="{'xl.id' : 'id'}"
  49 + dcname="xl.id"
  50 + icname="id"
  51 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  52 + iterobjname="item"
  53 + iterobjexp="item.name"
  54 + searchph="请输拼音..."
  55 + searchexp="this.name"
  56 + required >
  57 + </sa-Select5>
  58 + </div>
  59 + <!-- 隐藏块,显示验证信息 -->
  60 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  61 + 线路必须选择
  62 + </div>
  63 + </div>
  64 +
  65 + <div class="form-group has-success has-feedback">
  66 + <label class="col-md-2 control-label">线路走向*:</label>
  67 + <div class="col-md-3">
  68 + <sa-Radiogroup model="ctrl.ttInfoManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup>
  69 + </div>
  70 + <!-- 隐藏块,显示验证信息 -->
  71 + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">
  72 + 线路走向必须填写
  73 + </div>
  74 + </div>
  75 +
  76 + <div class="form-group has-success has-feedback">
  77 + <label class="col-md-2 control-label">时刻表名字*:</label>
  78 + <div class="col-md-3">
  79 + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForForm.name"
  80 + name="name" placeholder="请输入时刻表名字..." required
  81 + remote-Validation
  82 + remotevtype="tic_name"
  83 + remotevparam="{{ {'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'name_eq': ctrl.ttInfoManageForForm.name} | json}}"
  84 + />
  85 + </div>
  86 +
  87 + <!-- 隐藏块,显示验证信息 -->
  88 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required">
  89 + 时刻表名字必须填写
  90 + </div>
  91 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote">
  92 + 相同线路下的时刻表不能同名
  93 + </div>
  94 + </div>
  95 +
  96 + <div class="form-group has-success has-feedback">
  97 + <label class="col-md-2 control-label">启用日期*:</label>
  98 + <div class="col-md-3">
  99 + <div class="input-group">
  100 + <input type="text" class="form-control"
  101 + name="qyrq" placeholder="请选择启用日期..."
  102 + uib-datepicker-popup="yyyy年MM月dd日"
  103 + is-open="ctrl.qyrqOpen"
  104 + ng-model="ctrl.ttInfoManageForForm.qyrq" readonly required/>
  105 + <span class="input-group-btn">
  106 + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">
  107 + <i class="glyphicon glyphicon-calendar"></i>
  108 + </button>
  109 + </span>
  110 + </div>
  111 + </div>
  112 +
  113 + <!-- 隐藏块,显示验证信息 -->
  114 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  115 + 启用日期必须填写
  116 + </div>
  117 + </div>
  118 +
  119 + <div class="form-group has-success has-feedback">
  120 + <label class="col-md-2 control-label">是否启用*:</label>
  121 + <div class="col-md-3">
  122 + <sa-Radiogroup model="ctrl.ttInfoManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup>
  123 + </div>
  124 +
  125 + <!-- 隐藏块,显示验证信息 -->
  126 + <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required">
  127 + 是否启用必须选择
  128 + </div>
  129 +
  130 + </div>
  131 +
  132 + <!--<div class="form-group">-->
  133 + <!--<label class="col-md-2 control-label">路牌数量:</label>-->
  134 + <!--<div class="col-md-3">-->
  135 + <!--<input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.lpCount"-->
  136 + <!--name="lpCount" placeholder="请输入路牌数..." min="1"/>-->
  137 + <!--</div>-->
  138 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number">-->
  139 + <!--必须输入数字-->
  140 + <!--</div>-->
  141 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min">-->
  142 + <!--路爬数量必须大于1-->
  143 + <!--</div>-->
  144 + <!--</div>-->
  145 +
  146 + <!--<div class="form-group">-->
  147 + <!--<label class="col-md-2 control-label">营运圈数:</label>-->
  148 + <!--<div class="col-md-3">-->
  149 + <!--<input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.loopCount"-->
  150 + <!--name="loopCount" placeholder="请输入圈数..." min="1"/>-->
  151 + <!--</div>-->
  152 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number">-->
  153 + <!--必须输入数字-->
  154 + <!--</div>-->
  155 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min">-->
  156 + <!--营运圈数必须大于1-->
  157 + <!--</div>-->
  158 + <!--</div>-->
  159 +
  160 + <div class="form-group">
  161 + <label class="col-md-2 control-label">常规有效日:</label>
  162 + <div class="col-md-6">
  163 + <sa-Checkboxgroup model="ctrl.ttInfoManageForForm"
  164 + name="rule_days"
  165 + dcvalue="{{ctrl.ttInfoManageForForm.rule_days}}"
  166 + dcname="rule_days"
  167 + required >
  168 + </sa-Checkboxgroup>
  169 +
  170 + <input type="hidden" name="rule_days_h" ng-model="ctrl.ttInfoManageForForm.rule_days"
  171 + remote-Warn
  172 + remotewtype="tic_n_d"
  173 + remotewparam="{{ {'id_eq': ctrl.ttInfoManageForForm.id, 'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'rule_days_eq': ctrl.ttInfoManageForForm.rule_days} | json}}"
  174 + remotewmsgprop="rule_days_warn"
  175 + />
  176 + </div>
  177 + <div class="alert alert-danger well-sm" ng-show="myForm.rule_days.$error.required">
  178 + 请操作一下1
  179 + </div>
  180 + <div class="alert alert-warning well-sm" ng-show="ctrl.rule_days_warn">
  181 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  182 + {{ctrl.rule_days_warn}}
  183 + </div>
  184 + </div>
  185 +
  186 + <div class="form-group">
  187 + <label class="col-md-2 control-label">特殊有效日:</label>
  188 + <div class="col-md-6">
  189 + <sa-Dategroup model="ctrl.ttInfoManageForForm"
  190 + name="special_days"
  191 + dcvalue="{{ctrl.ttInfoManageForForm.special_days}}"
  192 + dcname="special_days"
  193 + >
  194 + </sa-Dategroup>
  195 +
  196 + <input type="hidden" name="special_days_h" ng-model="ctrl.ttInfoManageForForm.special_days"
  197 + remote-Warn
  198 + remotewtype="tic_s_d"
  199 + remotewparam="{{ {'id_eq': ctrl.ttInfoManageForForm.id, 'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'special_days_eq': ctrl.ttInfoManageForForm.special_days} | json}}"
  200 + remotewmsgprop="rule_special_days_warn"
  201 + />
  202 + </div>
  203 + <div class="alert alert-danger well-sm" ng-show="myForm.special_days.$error.required">
  204 + 请操作一下2
  205 + </div>
  206 +
  207 + <div class="alert alert-warning well-sm" ng-show="ctrl.rule_special_days_warn">
  208 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  209 + {{ctrl.rule_special_days_warn}}
  210 + </div>
  211 + </div>
  212 +
  213 + <!--<div class="form-group">-->
  214 + <!--<label class="col-md-2 control-label">备注:</label>-->
  215 + <!--</div>-->
  216 +
  217 + <!-- 其他form-group -->
  218 +
  219 + </div>
  220 +
  221 + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 -->
  222 + <div class="form-actions">
  223 + <div class="row">
  224 + <div class="col-md-offset-3 col-md-4">
  225 + <button type="submit" class="btn green"
  226 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  227 + <a type="button" class="btn default" ui-sref="ttInfoManage2" ><i class="fa fa-times"></i> 取消</a>
  228 + </div>
  229 + </div>
  230 + </div>
  231 +
  232 + </form>
  233 +
  234 + </div>
  235 +
  236 +
  237 +</div>
0 \ No newline at end of file 238 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/index.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>智能时刻表管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <span class="active">智能时刻表管理</span>
  18 + </li>
  19 +</ul>
  20 +
  21 +<div class="row">
  22 + <div class="col-md-12" ng-controller="TtInfoManage2IndexCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
  32 + <div class="portlet light bordered">
  33 + <div class="portlet-title">
  34 + <div class="caption font-dark">
  35 + <i class="fa fa-database font-dark"></i>
  36 + <span class="caption-subject bold uppercase">时刻表</span>
  37 + </div>
  38 + <div class="actions">
  39 + <!--<a ui-sref="ttInfoManage_test" class="btn btn-circle blue">-->
  40 + <!--<i class="fa fa-plus"></i>-->
  41 + <!--测试-->
  42 + <!--</a>-->
  43 + <a href="javascript:" class="btn blue" ng-click="ctrl.toTtInfoManageForm()">
  44 + <i class="fa fa-plus"></i>
  45 + 添加时刻表
  46 + </a>
  47 +
  48 + </div>
  49 + </div>
  50 +
  51 + <div class="portlet-body">
  52 + <div ui-view="ttInfoManage2_list"></div>
  53 + </div>
  54 + </div>
  55 + </div>
  56 +</div>
0 \ No newline at end of file 57 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/list.html 0 → 100644
  1 +<!-- ui-route employeeInfoManage.list -->
  2 +<div ng-controller="TtInfoManage2ListCtrl as ctrl">
  3 + <div class="fixDiv">
  4 + <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column">
  5 + <thead>
  6 + <tr role="row" class="heading">
  7 + <th style="width: 70px;">序号</th>
  8 + <th style="width: 150px;">线路</th>
  9 + <th style="width: 180px;">时刻表名称</th>
  10 + <th style="width: 80px">上下行</th>
  11 + <th style="width: 50px;">启用</th>
  12 + <th style="width: 130px">操作日期</th>
  13 + <th style="width: 80px">状态</th>
  14 + <th style="width: 60%">时刻表明细</th>
  15 + <th style="width: 40%">操作</th>
  16 + </tr>
  17 + <tr role="row" class="filter">
  18 + <td></td>
  19 + <td>
  20 + <sa-Select5 name="xl"
  21 + model="ctrl.searchCondition()"
  22 + cmaps="{'xl.id_eq' : 'id'}"
  23 + dcname="xl.id_eq"
  24 + icname="id"
  25 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  26 + iterobjname="item"
  27 + iterobjexp="item.name"
  28 + searchph="请输拼音..."
  29 + searchexp="this.name"
  30 + required >
  31 + </sa-Select5>
  32 + </td>
  33 + <td>
  34 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().name_like" placeholder="输入时刻表名称..."/>
  35 + </td>
  36 + <td></td>
  37 + <td>
  38 + <label class="checkbox-inline">
  39 + <input type="checkbox" ng-model="ctrl.searchCondition()['isEnableDisTemplate_eq']"/>是
  40 + </label>
  41 + </td>
  42 + <td></td>
  43 + <td>
  44 + <label class="checkbox-inline">
  45 + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>已作废
  46 + </label>
  47 + </td>
  48 + <td></td>
  49 + <td>
  50 + <div class="btn-group">
  51 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  52 + ng-click="ctrl.doPage()">
  53 + <i class="fa fa-search"></i> 搜索</button>
  54 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  55 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  56 + <span class="caret"></span>
  57 + <span class="sr-only">dropdown</span>
  58 + </button>
  59 + <ul class="dropdown-menu pull-right">
  60 + <li>
  61 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  62 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  63 + 排序选项
  64 + </a>
  65 + </li>
  66 + </ul>
  67 + </div>
  68 +
  69 + <button class="btn btn-sm red btn-outline filter-cancel"
  70 + ng-click="ctrl.reset()">
  71 + <i class="fa fa-times"></i> 重置</button>
  72 + </td>
  73 + </tr>
  74 +
  75 + </thead>
  76 + <tbody>
  77 + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}">
  78 + <td>
  79 + <div>
  80 + <a href="#">
  81 + <i class="fa fa-list-ol" aria-hidden="true"></i>
  82 + {{$index + ctrl.page().number * 10 + 1}}
  83 + </a>
  84 + </div>
  85 + </td>
  86 + <td>
  87 + <div>
  88 + <a href="#">
  89 + <span ng-bind="info.xl.name"></span>
  90 + </a>
  91 + </div>
  92 + <div>
  93 + <a href="#"
  94 + ng-mouseenter="ctrl.getLineVersionTip(info)"
  95 + tooltip-animation="false"
  96 + tooltip-placement="top"
  97 + uib-tooltip="{{ctrl.lineVersionTip}}"
  98 + tooltip-class="headClass">
  99 +
  100 + <span ng-bind="'线路版本:' + info.lineVersion"></span>
  101 + </a>
  102 +
  103 + </div>
  104 +
  105 +
  106 + </td>
  107 + <td>
  108 + <div>
  109 + <a href="#"
  110 + tooltip-animation="false"
  111 + tooltip-placement="top"
  112 + uib-tooltip="{{info.name}}"
  113 + tooltip-class="headClass">
  114 + {{info.name}}
  115 + </a>
  116 + </div>
  117 + </td>
  118 + <td>
  119 + <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span>
  120 + </td>
  121 + <td>
  122 + <span ng-bind="info.isEnableDisTemplate | dict:'truefalseType':'未知' "></span>
  123 + </td>
  124 + <td>
  125 + <div>
  126 + <a href="#"
  127 + tooltip-animation="false"
  128 + tooltip-placement="top"
  129 + uib-tooltip="启用时间:{{info.qyrq | date: 'yyyy-MM-dd HH:mm:ss' }}"
  130 + tooltip-class="headClass">
  131 + 启用
  132 + <span ng-bind="(info.qyrq | date: 'yyyy-MM-dd')"></span>
  133 + </a>
  134 + </div>
  135 +
  136 + <div>
  137 + <a href="#"
  138 + tooltip-animation="false"
  139 + tooltip-placement="top"
  140 + uib-tooltip="备份时间:{{info.lastBackUpDate | date: 'yyyy-MM-dd HH:mm:ss' }}"
  141 + tooltip-class="headClass">
  142 + 备份
  143 + <span ng-bind="(info.lastBackUpDate | date: 'yyyy-MM-dd')"></span>
  144 + </a>
  145 + </div>
  146 +
  147 + <div>
  148 + <a href="#"
  149 + tooltip-animation="false"
  150 + tooltip-placement="top"
  151 + uib-tooltip="创建时间:{{info.createDate | date: 'yyyy-MM-dd HH:mm:ss' }}"
  152 + tooltip-class="headClass">
  153 + 创建
  154 + <span ng-bind="(info.createDate | date: 'yyyy-MM-dd')"></span>
  155 + </a>
  156 + </div>
  157 +
  158 + <div>
  159 + <a href="#"
  160 + tooltip-animation="false"
  161 + tooltip-placement="top"
  162 + uib-tooltip="更新时间:{{info.updateDate | date: 'yyyy-MM-dd HH:mm:ss' }}"
  163 + tooltip-class="headClass">
  164 + 更新
  165 + <span ng-bind="(info.updateDate | date: 'yyyy-MM-dd')"></span>
  166 + </a>
  167 + </div>
  168 +
  169 + <!--<div>-->
  170 + <!--<a href="#"-->
  171 + <!--tooltip-animation="false"-->
  172 + <!--tooltip-placement="top"-->
  173 + <!--uib-tooltip="备份时间:{{info.lastBackUpDate | date: 'yyyy-MM-dd HH:mm:ss' }}"-->
  174 + <!--tooltip-class="headClass">-->
  175 +
  176 + <!--<i class="fa fa-hdd-o" aria-hidden="true"></i>-->
  177 + <!--<span ng-bind="info.lastBackUpDate | date: 'yyyy-MM-dd'"></span>-->
  178 + <!--</a>-->
  179 +
  180 + <!--</div>-->
  181 +
  182 + </td>
  183 + <td>
  184 + <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span>
  185 + <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span>
  186 + </td>
  187 + <td>
  188 + <a ng-click="ctrl.toTtInfoDetailAuto(info.id)"
  189 + class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 动态生成 </a>
  190 + </td>
  191 + <td>
  192 + <a ui-sref="ttInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
  193 + <a ui-sref="ttInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>
  194 + </td>
  195 + </tr>
  196 + </tbody>
  197 + </table>
  198 + </div>
  199 +
  200 + <div class="pageBar">
  201 + <div class="pageBarLeft">
  202 + {{'显示从' + ctrl.page()['uiFromRecord'] + '到' + ctrl.page()['uiToRecord'] + ' 共' + ctrl.page()['totalElements'] + '条' + ' 每页显示10条'}}
  203 + </div>
  204 +
  205 + <div class="pageBarRight">
  206 + <uib-pagination total-items="ctrl.page()['totalElements']"
  207 + ng-model="ctrl.page()['uiNumber']"
  208 + ng-change="ctrl.doPage()"
  209 + rotate="false"
  210 + max-size="10"
  211 + boundary-links="true"
  212 + first-text="首页"
  213 + previous-text="上一页"
  214 + next-text="下一页"
  215 + last-text="尾页">
  216 + </uib-pagination>
  217 + </div>
  218 + </div>
  219 +
  220 +</div>
0 \ No newline at end of file 221 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/module.js 0 → 100644
  1 +// 时刻表管理service,包装外部定义的globalservice,并保存一定的操作状态
  2 +angular.module('ScheduleApp').factory(
  3 + 'TtInfoManage2Service',
  4 + [
  5 + 'TTInfoManageService_g',
  6 + 'TimeTableDetailManageService_g',
  7 + 'UserPrincipal',
  8 + function(service, dservice, UserPrincipal) {
  9 + // 当前查询的内容条件搜索对象
  10 + var currentSearchCondition = {page: 0, 'isCancel_eq': false, 'isEnableDisTemplate_eq': true};
  11 + // 当前查询返回的信息
  12 + var currentPage = { // 后台spring data返回的格式
  13 + totalElements: 0,
  14 + number: 0, // 后台返回的页码,spring返回从0开始
  15 + content: [],
  16 +
  17 + uiNumber: 1, // 页面绑定的页码
  18 + uiFromRecord: 0, // 页面绑定,当前页第几条记录
  19 + uiToRecord: 0 // 页面绑定,当前页到第几条记录
  20 + };
  21 +
  22 + // 字段描述
  23 + var columns = [
  24 + {name: "xl.name", desc: "线路名称"},
  25 + {name: "name", desc: "时刻表名称"},
  26 + {name: "xlDir", desc: "上下行"},
  27 + {name: "isEnableDisTemplate", desc: "是否启用"},
  28 + {name: "qyrq", desc: "启用日期"},
  29 + {name: "isCancel", desc: "是否作废"}
  30 + ];
  31 + // 排序字段
  32 + var orderColumns = {
  33 + order: "xl.name,isCancel,isEnableDisTemplate,qyrq",
  34 + direction: "DESC,ASC,DESC,DESC"
  35 + };
  36 +
  37 + // 查询对象类
  38 + var queryClass = service.rest;
  39 +
  40 + return {
  41 + getTtInfoQueryClass: function() {
  42 + return queryClass;
  43 + },
  44 + getColumns: function() {
  45 + return columns;
  46 + },
  47 + getOrderColumns: function() {
  48 + return orderColumns;
  49 + },
  50 + getSearchCondition: function() {
  51 + currentSearchCondition.page = currentPage.uiNumber - 1;
  52 +
  53 + // 加公司判定
  54 + if (UserPrincipal.getGsStrs().length > 0) {
  55 + currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  56 + }
  57 +
  58 + // 重置排序字段条件
  59 + currentSearchCondition.order = orderColumns.order;
  60 + currentSearchCondition.direction = orderColumns.direction;
  61 +
  62 + return currentSearchCondition;
  63 + },
  64 + getPage: function(page) {
  65 + if (page) {
  66 + currentPage.totalElements = page.totalElements;
  67 + currentPage.number = page.number;
  68 + currentPage.content = page.content;
  69 +
  70 + // 计算当前页开始记录,结束记录
  71 + if (page.numberOfElements && page.numberOfElements > 0) {
  72 + currentPage.uiFromRecord = page.number * 10 + 1;
  73 + currentPage.uiToRecord = page.number * 10 + page.numberOfElements;
  74 + }
  75 + }
  76 + return currentPage;
  77 + },
  78 + resetStatus: function() {
  79 + currentSearchCondition = {page: 0, 'isCancel_eq': false};
  80 + currentPage = {
  81 + totalElements: 0,
  82 + number: 0,
  83 + content: [],
  84 + uiNumber: 1,
  85 + uiFromRecord: 0,
  86 + uiToRecord: 0
  87 + };
  88 + },
  89 + /**
  90 + * 数据导出。
  91 + * @returns {*|Function|promise|n}
  92 + */
  93 + dataExport: function(ttinfoid) {
  94 + var param = {};
  95 + param.type = 'exportFile';
  96 + param.ttinfoid = ttinfoid;
  97 + return dservice.dataTools.dataExport(param).$promise;
  98 + },
  99 +
  100 + /**
  101 + * 备份。
  102 + * @returns {*|Function|promise|n}
  103 + */
  104 + backupinfo: function(ttinfoid) {
  105 + var param = {};
  106 + param.ttinfoid = ttinfoid;
  107 + return service.backup.do(param).$promise;
  108 + },
  109 +
  110 + /**
  111 + * 获取线路版本描述。
  112 + * @param lineId
  113 + * @param version
  114 + * @returns {*|Function|promise|n}
  115 + */
  116 + versiondesc: function(lineId, version) {
  117 + var param = {};
  118 + param.lineId = lineId;
  119 + param.version = version;
  120 + return service.versiondesc.do(param).$promise;
  121 + }
  122 +
  123 +
  124 +
  125 + // TODO:
  126 + }
  127 + }
  128 + ]
  129 +);
  130 +
  131 +// index.html控制器
  132 +angular.module('ScheduleApp').controller(
  133 + 'TtInfoManage2IndexCtrl',
  134 + [
  135 + '$state',
  136 + function($state) {
  137 + var self = this;
  138 +
  139 + // 切换到时刻表form界面
  140 + self.toTtInfoManageForm = function() {
  141 + $state.go('ttInfoManage2_form');
  142 + }
  143 + }
  144 + ]
  145 +);
  146 +
  147 +// list.html控制器
  148 +angular.module('ScheduleApp').controller(
  149 + 'TtInfoManage2ListCtrl',
  150 + [
  151 + 'TtInfoManage2Service',
  152 + 'FileDownload_g',
  153 + '$uibModal',
  154 + function(service, fileDownload, $uibModal) {
  155 + var self = this;
  156 + var TtInfo = service.getTtInfoQueryClass();
  157 +
  158 + self.page = function() {
  159 + return service.getPage();
  160 + };
  161 +
  162 + self.searchCondition = function() {
  163 + return service.getSearchCondition();
  164 + };
  165 +
  166 + self.doPage = function() {
  167 + var page = TtInfo.list(self.searchCondition(), function() {
  168 + service.getPage(page);
  169 + });
  170 + };
  171 + self.reset = function() {
  172 + service.resetStatus();
  173 + var page = TtInfo.list(self.searchCondition(), function() {
  174 + service.getPage(page);
  175 + });
  176 + };
  177 + self.toggleTtinfo = function(id) {
  178 + TtInfo.delete({id: id}, function(result) {
  179 + if (result.message) { // 暂时这样做,之后全局拦截
  180 + alert("失败:" + result.message);
  181 + } else {
  182 + self.doPage();
  183 + }
  184 + });
  185 + };
  186 + // 导出excel
  187 + self.exportData = function(ttinfoid) {
  188 + service.dataExport(ttinfoid).then(
  189 + function(result) {
  190 + fileDownload.downloadFile(result.data, "application/octet-stream", "时刻表.xls");
  191 + },
  192 + function(result) {
  193 + console.log("exportData failed:" + result);
  194 + }
  195 + );
  196 + };
  197 +
  198 + // 备份信息
  199 + self.backupinfo = function(ttinfoid) {
  200 + service.backupinfo(ttinfoid).then(
  201 + function(result) {
  202 + self.doPage();
  203 + console.log("备份成功!");
  204 + },
  205 + function(result) {
  206 + console.log("备份失败:" + result);
  207 + }
  208 + );
  209 + };
  210 +
  211 + self.doPage();
  212 +
  213 + // TODO:跳转到自动生成时刻表页面(jquery页面),之后会替换为Angularjs版本
  214 + self.toTtInfoDetailAuto = function(ttinfoid) {
  215 + showPjax();
  216 + $.pjax({url: 'pages/base/timesmodel/add.html?no=' + ttinfoid, container: pjaxContainer});
  217 + };
  218 +
  219 + self.lineVersionTip = "载入中...";
  220 + var currentTTInfoForLineVersion;
  221 + self.getLineVersionTip = function(info) {
  222 + if (currentTTInfoForLineVersion != info) {
  223 + service.versiondesc(info.xl.id, info.lineVersion).then(
  224 + function(result) {
  225 + self.lineVersionTip = result.desc;
  226 + currentTTInfoForLineVersion = info;
  227 + }
  228 + );
  229 + }
  230 +
  231 + };
  232 +
  233 + self.customOrder = function() {
  234 + // large方式弹出模态对话框
  235 + var modalInstance = $uibModal.open({
  236 + templateUrl: '/pages/scheduleApp/module/core/ttInfoManage2/orderOptionOpen.html',
  237 + size: "sm",
  238 + animation: true,
  239 + backdrop: 'static',
  240 + resolve: {
  241 + },
  242 + windowClass: 'center-modal',
  243 + controller: "TtInfoManage2ListOrderOptionModalInstanceCtrl",
  244 + controllerAs: "$ctrl",
  245 + bindToController: true
  246 + });
  247 + modalInstance.result.then(
  248 + function(result) {
  249 + console.log("dataImport.html打开");
  250 + },
  251 + function() {
  252 + console.log("dataImport.html消失");
  253 + }
  254 + );
  255 + };
  256 + }
  257 + ]
  258 +);
  259 +
  260 +angular.module('ScheduleApp').controller(
  261 + "TtInfoManage2ListOrderOptionModalInstanceCtrl",
  262 + [
  263 + "TtInfoManage2Service",
  264 + "$modalInstance",
  265 + function(service, $modalInstance) {
  266 + var self = this;
  267 +
  268 + self.columns = service.getColumns();
  269 + self.orderColumns = service.getOrderColumns();
  270 +
  271 + self.confirm = function(result) {
  272 + // console.log(result);
  273 + // console.log(service.getOrderColumns());
  274 + $modalInstance.dismiss("cancel");
  275 +
  276 + }
  277 + }
  278 + ]
  279 +);
  280 +
  281 +// form.html控制器
  282 +angular.module('ScheduleApp').controller(
  283 + 'TtInfoManage2FormCtrl',
  284 + [
  285 + 'TtInfoManage2Service',
  286 + '$stateParams',
  287 + '$state',
  288 + function(service, $stateParams, $state) {
  289 + var self = this;
  290 + var TtInfo = service.getTtInfoQueryClass();
  291 +
  292 + // 启用日期 日期控件开关
  293 + self.qyrqOpen = false;
  294 + self.qyrq_open = function() {
  295 + self.qyrqOpen = true;
  296 + };
  297 +
  298 + // 欲保存的表单信息,双向绑定
  299 + self.ttInfoManageForForm = new TtInfo;
  300 + self.ttInfoManageForForm.xl = {};
  301 +
  302 + // 如果是修改,获取传过来的id,从后台获取一份数据,用于绑定页面form值
  303 + var id = $stateParams.id;
  304 + if (id) {
  305 + TtInfo.get({id: id}, function(value) {
  306 + self.ttInfoManageForForm = value;
  307 + });
  308 + } else {
  309 + // 初始表单,使用查询条件获取线路id
  310 + self.ttInfoManageForForm.xl.id = service.getSearchCondition()['xl.id_eq'];
  311 + }
  312 +
  313 + // form提交方法
  314 + self.submit = function() {
  315 + self.ttInfoManageForForm.$save(function() {
  316 + $state.go("ttInfoManage2");
  317 + });
  318 + };
  319 + }
  320 + ]
  321 +);
  322 +
  323 +// detail.html控制器
  324 +angular.module('ScheduleApp').controller(
  325 + 'TtInfoManage2DetailCtrl',
  326 + [
  327 + 'TtInfoManage2Service',
  328 + '$stateParams',
  329 + function(service, $stateParams) {
  330 + var self = this;
  331 + var TtInfo = service.getTtInfoQueryClass();
  332 + var id = $stateParams.id;
  333 +
  334 + self.title = "";
  335 + self.ttInfoManageForDetail = {};
  336 +
  337 + TtInfo.get({id: id}, function(value) {
  338 + self.ttInfoManageForDetail = value;
  339 + self.title = self.ttInfoManageForDetail.xl.name +
  340 + "(" +
  341 + self.ttInfoManageForDetail.name +
  342 + ")" +
  343 + "时刻表基础信息";
  344 + });
  345 + }
  346 + ]
  347 +);
0 \ No newline at end of file 348 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/orderOptionOpen.html 0 → 100644
  1 +<div class="modal-header">
  2 + <div class="modal-title">
  3 + <h3>
  4 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  5 + <span class="caption-subject bold uppercase">排序字段选择</span>
  6 + </h3>
  7 + </div>
  8 +</div>
  9 +<div class="modal-body">
  10 + <!--order={{$ctrl.orderColumns.order}}-->
  11 + <!--<br>-->
  12 + <!--direction={{$ctrl.orderColumns.direction}}-->
  13 + <sa-Orderoption name="orderOptions" columns="$ctrl.columns" ordercolumns="$ctrl.orderColumns">
  14 + </sa-Orderoption>
  15 +</div>
  16 +<div class="modal-footer">
  17 + <button class="btn btn-primary" ng-click="$ctrl.confirm($ctrl.orderColumns)">确定</button>
  18 +</div>
0 \ No newline at end of file 19 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage2/route.js 0 → 100644
  1 +// ui route 配置
  2 +
  3 +/** 时刻表管理配置route */
  4 +ScheduleApp.config([
  5 + '$stateProvider',
  6 + '$urlRouterProvider',
  7 + function($stateProvider, $urlRouterProvider) {
  8 + // 默认路由
  9 + //$urlRouterProvider.otherwise('/busConfig.html');
  10 +
  11 + $stateProvider
  12 + .state("ttInfoManage2", { // index页面
  13 + url: '/ttInfoManage2',
  14 + views: {
  15 + "": {
  16 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/index.html'
  17 + },
  18 + "ttInfoManage2_list@ttInfoManage2": {
  19 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/list.html'
  20 + }
  21 + },
  22 +
  23 + resolve: {
  24 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  25 + return $ocLazyLoad.load({
  26 + name: 'ttInfoManage2_module',
  27 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  28 + files: [
  29 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  30 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  31 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  32 + ]
  33 + });
  34 + }]
  35 + }
  36 + })
  37 + .state("ttInfoManage2_form", { // 添加时刻表信息form
  38 + url: '/ttInfoManage2_form',
  39 + views: {
  40 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/form.html'}
  41 + },
  42 + resolve: {
  43 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  44 + return $ocLazyLoad.load({
  45 + name: 'ttInfoManage2_form_module',
  46 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  47 + files: [
  48 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  49 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  50 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  51 + ]
  52 + });
  53 + }]
  54 + }
  55 + })
  56 + .state("ttInfoManage2_edit", { // 修改时刻表信息form
  57 + url: '/ttInfoManage2_edit/:id',
  58 + views: {
  59 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/edit.html'}
  60 + },
  61 + resolve: {
  62 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  63 + return $ocLazyLoad.load({
  64 + name: 'ttInfoManage2_edit_module',
  65 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  66 + files: [
  67 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  68 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  69 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  70 + ]
  71 + });
  72 + }]
  73 + }
  74 + })
  75 + .state("ttInfoManage2_detail", { // 时刻表详细信息
  76 + url: '/ttInfoManage2_detail/:id',
  77 + views: {
  78 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage2/detail.html'}
  79 + },
  80 + resolve: {
  81 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  82 + return $ocLazyLoad.load({
  83 + name: 'ttInfoManage2_detail_module',
  84 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  85 + files: [
  86 + "pages/scheduleApp/module/core/ttInfoManage2/module.js"
  87 + ]
  88 + });
  89 + }]
  90 + }
  91 + })
  92 +
  93 +
  94 + }
  95 +]);
0 \ No newline at end of file 96 \ No newline at end of file
src/main/resources/static/pages/trafficManage/js/timeTempletUploadRecord.js
@@ -201,7 +201,7 @@ @@ -201,7 +201,7 @@
201 // 绑定查询事件 201 // 绑定查询事件
202 $("#search").click(searchM); 202 $("#search").click(searchM);
203 // 查询方法 203 // 查询方法
204 - function searchM(p, pagination) { 204 + function searchM() {
205 var params = {}; 205 var params = {};
206 // 取得输入框的值 206 // 取得输入框的值
207 var inputs = $(".breadcrumb input,select"); 207 var inputs = $(".breadcrumb input,select");
@@ -209,6 +209,19 @@ @@ -209,6 +209,19 @@
209 $.each(inputs, function(i, element) { 209 $.each(inputs, function(i, element) {
210 params[$(element).attr("name")] = $(element).val(); 210 params[$(element).attr("name")] = $(element).val();
211 }); 211 });
  212 + page = 0;
  213 + loadTableDate(params,true);
  214 + }
  215 +
  216 + function loadTableDate(param,isPon) {
  217 + // 搜索参数
  218 + var params = {};
  219 + if(param)
  220 + params = param;
  221 + // 排序(按更新时间)
  222 + params['order'] = 'id';
  223 + // 记录当前页数
  224 + params['page'] = page;
212 var i = layer.load(2); 225 var i = layer.load(2);
213 $get('/skb_log', params, function(data) { 226 $get('/skb_log', params, function(data) {
214 var content = data.content; 227 var content = data.content;
@@ -217,7 +230,7 @@ @@ -217,7 +230,7 @@
217 list : content 230 list : content
218 }); 231 });
219 $('#datatable_logger tbody').html(bodyHtm); 232 $('#datatable_logger tbody').html(bodyHtm);
220 - if(pagination && data.content.length > 0){ 233 + if(isPon && data.content.length > 0){
221 //重新分页 234 //重新分页
222 initPagination = true; 235 initPagination = true;
223 showPagination(data); 236 showPagination(data);
@@ -250,10 +263,8 @@ @@ -250,10 +263,8 @@
250 initPagination = false; 263 initPagination = false;
251 return; 264 return;
252 } 265 }
253 -  
254 -  
255 page = num - 1; 266 page = num - 1;
256 - searchM(null, false); 267 + loadTableDate(null, false);
257 } 268 }
258 }); 269 });
259 } 270 }
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/wxsb.html 0 → 100644
  1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-wxsb-modal">
  2 + <div class="uk-modal-dialog">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>维修上报</h2></div>
  6 + <form class="uk-form uk-form-horizontal">
  7 + </form>
  8 + </div>
  9 +
  10 + <script id="schedule-wxsb-form-temp" type="text/html">
  11 + <input type="hidden" name="id" value="{{id}}"/>
  12 + <div class="uk-grid">
  13 + <div class="uk-width-1-2">
  14 + <div class="uk-form-row">
  15 + <label class="uk-form-label" >车辆编码</label>
  16 + <div class="uk-form-controls">
  17 + <input type="text" name="nbbm" value="{{clZbh}}" readonly>
  18 + </div>
  19 + </div>
  20 + </div>
  21 + <div class="uk-width-1-2">
  22 + <div class="uk-form-row">
  23 + <label class="uk-form-label" >报修类型</label>
  24 + <div class="uk-form-controls">
  25 + <select name="bxType"></select>
  26 + </div>
  27 + </div>
  28 + </div>
  29 + </div>
  30 + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
  31 + <button type="button" class="uk-button uk-modal-close">取消</button>
  32 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
  33 + </div>
  34 + </script>
  35 +
  36 + <script>
  37 + (function() {
  38 + var modal = '#schedule-wxsb-modal'
  39 + ,sch;
  40 +
  41 + $(modal).on('init', function(e, data) {
  42 + e.stopPropagation();
  43 + sch=data.sch;
  44 + var formHtml = template('schedule-wxsb-form-temp', sch);
  45 + $('form', modal).html(formHtml);
  46 +
  47 + //班次类型字典
  48 + var bxtypes=[{code:"9101", des:"轨迹不连续"}, {code:"9102", des:"无轨迹"}, {code:"9103", des:"收不到调度指令"}, {code:"9104", des:"漂移"}, {code:"9109", des:"其它"}],opts='';
  49 + for(var i = 0;i < bxtypes.length;i++){
  50 + opts+='<option value="'+bxtypes[i].code+'">'+bxtypes[i].des+'</option>';
  51 + }
  52 + $('[name=bxType]', modal).html(opts);
  53 +
  54 + //submit
  55 + var f = $('form', modal).formValidation(gb_form_validation_opts);
  56 + f.on('success.form.fv', function(e) {
  57 + e.preventDefault();
  58 + $('[type=submit]', f).attr('disabled', 'disabled');
  59 + var data = $(this).serializeJSON();
  60 + gb_common.$post('/realSchedule/wxsb', data, function(rs){
  61 + //更新班次信息
  62 + notify_succ('操作成功!');
  63 + UIkit.modal(modal).hide();
  64 + });
  65 + });
  66 + });
  67 + })();
  68 + </script>
  69 +</div>
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
@@ -281,6 +281,11 @@ var gb_schedule_context_menu = (function () { @@ -281,6 +281,11 @@ var gb_schedule_context_menu = (function () {
281 open_modal(folder + '/sub_task_v2/main.html', { 281 open_modal(folder + '/sub_task_v2/main.html', {
282 sch: sch 282 sch: sch
283 }, modal_opts); 283 }, modal_opts);
  284 + },
  285 + wxsb: function (sch) {
  286 + open_modal(folder + '/wxsb.html', {
  287 + sch: sch
  288 + }, modal_opts);
284 } 289 }
285 }; 290 };
286 291
@@ -339,9 +344,13 @@ var gb_schedule_context_menu = (function () { @@ -339,9 +344,13 @@ var gb_schedule_context_menu = (function () {
339 'wdtz': { 344 'wdtz': {
340 name: '误点调整' 345 name: '误点调整'
341 }, 346 },
342 - 'sep4': '---------', 347 + 'sep5': '---------',
343 'lp_change': { 348 'lp_change': {
344 name: '路牌对调' 349 name: '路牌对调'
  350 + },
  351 + 'sep6': '---------',
  352 + 'wxsb': {
  353 + name: '维修上报'
345 } 354 }
346 } 355 }
347 }); 356 });