Commit a5ec7aa4295aed19a1fcee77b4a93ea88911a4a0

Authored by 潘钊
2 parents a911871a 218b4344

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

src/main/java/com/bsth/repository/StationRepository.java
... ... @@ -40,10 +40,17 @@ public interface StationRepository extends BaseRepository<Station, Integer> {
40 40 /*@Query(value = "SELECT s.b_jwpoints,s.id FROM bsth_c_station s where s.station_name like ?1"
41 41 , nativeQuery=true)
42 42 List<Object[]> findStationName(String stationName);*/
43   - @Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
  43 + /*@Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
44 44 " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" +
45 45 " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " +
46 46 " LEFT JOIN bsth_c_station b on a.station = b. id) t where t.station_name LIKE ?2"
  47 + , nativeQuery=true)*/
  48 + @Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
  49 + " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" +
  50 + " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " +
  51 + " LEFT JOIN " +
  52 + " (SELECT r.id,r.b_jwpoints,r.station_name from bsth_c_station r where r.destroy = 0 and r.station_name LIKE ?2 ) " +
  53 + " b on a.station = b. id) t where t.station_name LIKE ?2 "
47 54 , nativeQuery=true)
48 55 List<Object[]> findStationName(Integer dir , String stationName);
49 56  
... ... @@ -101,18 +108,24 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; {
101 108 "y = ?9 , " +
102 109 "b_polygon_grid = ST_GeomFromText(?10) , " +
103 110 "g_polygon_grid = ST_GeomFromText(?11) , " +
104   - "destroy = ?12 , " +
105   - "radius = ?13 , " +
106   - "shapes_type = ?14 , " +
107   - "versions = ?15 , " +
108   - "descriptions = ?16 " +
109   - " WHERE id = ?17 ", nativeQuery=true)
  111 + /*"destroy = ?12 , " +*/
  112 + "radius = ?12 , " +
  113 + "shapes_type = ?13 , " +
  114 + "versions = ?14 , " +
  115 + "descriptions = ?15 " +
  116 + " WHERE id = ?16 ", nativeQuery=true)
110 117 public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints,
  118 +
  119 + Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid,
  120 +
  121 + Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId);
  122 +
  123 + /*public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints,
111 124  
112 125 Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid,
113 126  
114 127 Integer destroy, Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId);
115   -
  128 + */
116 129  
117 130 @Query(value = "select st_astext(g_polygon_grid) as g_polygon_grid, shapes_type,concat(g_lonx, ' ', g_laty) as g_center_point ,radius, station_cod,station_name from bsth_c_station where station_cod=?1", nativeQuery = true)
118 131 public Object[][] bufferAera(String stationCode);
... ...
src/main/java/com/bsth/service/impl/StationServiceImpl.java
... ... @@ -930,7 +930,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
930 930 Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString());
931 931 Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString());
932 932 // 更新
933   - repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId);
  933 + /*repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId);*/
  934 + repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, radius, shapesType, versions, descriptions, stationId);
934 935 // 站点路由Id
935 936 Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString());
936 937 StationRoute resultS = routeRepository.findOne(stationRouteId);
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -3714,7 +3714,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3714 3714 List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);
3715 3715  
3716 3716 Map<String, Object> nMap=new HashMap<String, Object>();
3717   - nMap.put("date", date);
  3717 + nMap.put("date", xlName+date);
3718 3718 nMap.put("jls", list1.get(0).get("jls"));
3719 3719 nMap.put("sjgl", list1.get(0).get("sjgl"));
3720 3720 for (Map<String, Object> m : list1) {
... ...
src/main/resources/static/pages/base/line/add.html
... ... @@ -228,7 +228,14 @@
228 228 </div>
229 229 </div>
230 230 <!-- 是否营运 END -->
231   -
  231 + <!-- 权证车辆数 START -->
  232 + <div class="col-md-6">
  233 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  234 + <div class="col-md-4">
  235 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  236 + </div>
  237 + </div>
  238 + <!-- 权证车辆数 END -->
232 239  
233 240 </div>
234 241 <!-- 表单分组组件 form-group END -->
... ...
src/main/resources/static/pages/base/line/details.html
... ... @@ -220,7 +220,14 @@
220 220 </div>
221 221 </div>
222 222 <!-- 是否营运 END -->
223   -
  223 + <!-- 权证车辆数 START -->
  224 + <div class="col-md-6">
  225 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  226 + <div class="col-md-4">
  227 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  228 + </div>
  229 + </div>
  230 + <!-- 权证车辆数 END -->
224 231  
225 232 </div>
226 233 <!-- 表单分组组件 form-group END -->
... ...
src/main/resources/static/pages/base/line/edit.html
... ... @@ -43,7 +43,7 @@
43 43 <!-- 表单内容 START -->
44 44 <div class="form-body">
45 45 <input type="hidden" name="id" id="lineId">
46   -
  46 + <input type="hidden" name="inUse" id="inUse">
47 47 <!-- 表单分组组件 form-group START -->
48 48 <div class="form-group">
49 49 <!-- 线路编码 (* 必填项) START -->
... ... @@ -229,7 +229,14 @@
229 229 </div>
230 230 <!-- 是否营运 END -->
231 231  
232   -
  232 + <!-- 权证车辆数 START -->
  233 + <div class="col-md-6">
  234 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  235 + <div class="col-md-4">
  236 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  237 + </div>
  238 + </div>
  239 + <!-- 权证车辆数 END -->
233 240 </div>
234 241 <!-- 表单分组组件 form-group END -->
235 242 <!-- 表单分组组件 form-group START -->
... ...
src/main/resources/static/pages/base/line/js/line-add-form.js
... ... @@ -116,6 +116,7 @@ $(function(){
116 116 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度.
117 117 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度.
118 118 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度.
  119 + 'warrantCar' : {number : true,digits : true,maxlength: 8},
119 120 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。
120 121 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。
121 122 },
... ...
src/main/resources/static/pages/base/line/js/line-edit-form.js
... ... @@ -171,6 +171,7 @@
171 171 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度.
172 172 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度.
173 173 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度.
  174 + 'warrantCar' : {number : true,digits : true,maxlength: 8},
174 175 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。
175 176 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。
176 177 },
... ...
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
... ... @@ -382,13 +382,14 @@ var BaseFun = function() {
382 382 *
383 383 *
384 384 **/
385   - abstractBcByWorkTime : function(bxlpbc , map , dataMap , saa , cara , bxrcObj , dgminpcs ,deletebcNum) {
  385 + abstractBcByWorkTime : function(bxlpbc , map , dataMap , saa , cara , bxrcObj , dgminpcs ,deletebcNum ,zwxeLpNum) {
386 386 var rsultA = new Array() , dgzjsj = baseF.getDateTime('13:00');
387 387 // 定义13:00 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
388 388 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj));
389 389 // 定义早高峰结束 ~ 13:00 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
390 390 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj));
391 391 var sumGs = 0;
  392 + dgminpcs = zwxeLpNum==0 ? bxlpbc.length : dgminpcs;
392 393 for(var a = 0 ; a < bxlpbc.length ; a++) {
393 394 // 定义该版型下对应的路牌的班次数组、班次数组长度、该路牌上是否有首末班车。
394 395 var lpbc = bxlpbc[a].lpbc, lpbclen_ = lpbc.length;
... ... @@ -396,6 +397,7 @@ var BaseFun = function() {
396 397 continue;
397 398 var isFlag = baseF.lpDownIsHaveFirstAndLastBc(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array();
398 399 if(bxrcObj.type == '五工二休') {
  400 + // continue;
399 401 // 定义晚高峰后能剔除多少班次数.
400 402 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj));
401 403 if(isFlag) {
... ... @@ -409,11 +411,12 @@ var BaseFun = function() {
409 411 // 剔除不在高峰时间段内的班次.
410 412 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , 'desc' , false);
411 413 }else {
  414 + //continue;
412 415 // 单档 一个路牌一档劳动力
413 416 if(bxlpbc[a].keepOff==1) {
414 417 // 如果低谷至少配车数大于零,则该班型下的路牌 存在一些 分班路牌,这里的分班 指的是 这个路牌先满足的前提条件就是 是单档。
415   - // 为了满足工时的要求,在低谷断开一段时间.
416   - if(dgminpcs > 0) {
  418 + // 为了满足工时的要求,在低谷断开一段时间.a <= dgminpcs
  419 + if(a <= dgminpcs) {
417 420 if( a % 2 == 0) {
418 421 if(deletebcNum < swmaxtcbcNum || isFlag) {
419 422 tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum});
... ... @@ -433,10 +436,10 @@ var BaseFun = function() {
433 436 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true);
434 437 baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , true , a);
435 438 // 该班型下的路牌 不存在分班路牌.
436   - }else if(dgminpcs == 0){
  439 + }else {
437 440 // 按规则剔除班次.不分班.路牌班次不会断开.
438 441 baseF.isdk02(lpbc , dataMap , saa , deletebcNum , false);
439   - //baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , false , a);
  442 + baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , false , a);
440 443 }
441 444 // 双档 一个路牌两档劳动力
442 445 }else if(bxlpbc[a].keepOff==2) {
... ... @@ -459,8 +462,8 @@ var BaseFun = function() {
459 462 var markAfterGs = baseF.getSumWorkTime(tList , dataMap, saa);
460 463 var gsDx = parseFloat((markAfterGs - bzgs).toFixed(2));
461 464 lpbc.sort(function(m,n){return m.fcno-n.fcno});
462   - if(isOff) {
463   - if(gsDx > 1.5) {
  465 + if(gsDx > 1.5) {
  466 + if(isOff) {
464 467 var hoursDx = parseFloat((gsDx - 1.5).toFixed(2));
465 468 // console.log(gsDx , hoursDx ,Math.ceil(hoursDx*60));
466 469 var minueDx = Math.ceil(hoursDx*60);
... ... @@ -471,14 +474,15 @@ var BaseFun = function() {
471 474 lpbc.splice( (s+1) , bs*2);
472 475 }else {
473 476 lpbc.splice( s , bs*2);
  477 + lpbc[s-bs*2 +1].isfb = 1;
  478 + lpbc[s-bs*2 +1].STOPTIME = 0;
474 479 }
475 480 break;
476 481 }
477 482 }
  483 + }else {
478 484  
479 485 }
480   - }else {
481   -
482 486 }
483 487 },
484 488  
... ... @@ -606,8 +610,10 @@ var BaseFun = function() {
606 610 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.
607 611 if(!baseF.isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) {
608 612 if(order == 'asc') {
609   - arr[a-1].isfb = isfb ? 1 : 0;
610   - arr[a-1].STOPTIME = 0;
  613 + if(a>0) {
  614 + arr[a-1].isfb = isfb ? 1 : 0;
  615 + arr[a-1].STOPTIME = 0;
  616 + }
611 617 }else if(order == 'desc') {
612 618 var index_ = a + tcbcgzA[t].deletebcNum * 2;
613 619 arr[index_].STOPTIME = 0;
... ... @@ -636,6 +642,7 @@ var BaseFun = function() {
636 642 dgmaxtzsj = parseInt(map.dgmaxtzsj);
637 643 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙.
638 644 var dgminpcs = Math.round((dataMap.dgxxsjArr[0] + dataMap.dgxxsjArr[1] + dataMap.dgtzsj[0] + dataMap.dgtzsj[1]) / dgmaxfcjx);
  645 + var zwxeLpNum = baseF.cuontZwxeLpNum(bxrclist);
639 646 // var dgminpcs = 4;
640 647 // 定义返回数组.
641 648 var rs = new Array();
... ... @@ -710,12 +717,23 @@ var BaseFun = function() {
710 717 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length);
711 718 // console.log(bxlpbc);
712 719 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班.
713   - rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum));
  720 + rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum ,zwxeLpNum));
714 721 }
715 722 }
716 723 return rs;
717 724 },
718 725  
  726 + cuontZwxeLpNum : function(list) {
  727 + var count = 0;
  728 + for(var c = 0 ; c<list.length;c++) {
  729 + if(list[c].type == '五工二休') {
  730 + count = list[c].fpcls;
  731 + break;
  732 + }
  733 + }
  734 + return count;
  735 + },
  736 +
719 737 /**
720 738 * @description (TODO) 更新路牌数组的路牌名称.
721 739 * @param cara 路牌数组
... ... @@ -762,7 +780,11 @@ var BaseFun = function() {
762 780 * 相同班型下的日平均工时满足 参数的日平均工时 范围在 [10分钟]内浮动.
763 781 *
764 782 *
765   - * 第七步 确定吃饭时间.
  783 + * 第七步 确定吃饭时间(吃时间初步定位20分钟). 一般情况下
  784 + *
  785 + * 早餐 :10:15以后到12:30之间用餐的12:30是指用餐结束时间哦.
  786 + *
  787 + * 午餐 :一般在18:00以后在19:00以前.
766 788 *
767 789 * 第八步 确定进出场、早晚例保时间.
768 790 *
... ... @@ -771,19 +793,17 @@ var BaseFun = function() {
771 793 BXPplaceClassesTime02 : function(saa , cara , map , seMap , dataMap) {
772 794  
773 795 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数].
774   - var jsonArray = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);
775   -
  796 + var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);
  797 +
776 798 // 第二步 纵向调整
777   - baseF.evenStartDepartSpace(jsonArray , dataMap);
  799 + baseF.evenStartDepartSpace(allLMapBc , dataMap);
778 800  
779 801 // 第三步 剔除首末班车以外的班次,并确认首末班车.
780   - var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(jsonArray , dataMap);
781   -
  802 + var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(allLMapBc , dataMap);
  803 + // return {'json':markArray,'bxrcgs':null};
782 804 // 第四步 横向调整
783 805 baseF.resizeByPitStopTime(cara , markArray , dataMap);
784   -
785 806 // return {'json':markArray,'bxrcgs':null};
786   -
787 807 /**
788 808 * 第五步 把班型合理的分配到各个路牌上.
789 809 *
... ... @@ -797,7 +817,132 @@ var BaseFun = function() {
797 817 baseF.bxAlloTotLp(list,cara);
798 818 // 第六步 抽车来满足工时.
799 819 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map);
800   - return {'json':baseF.addjcclcbc01(cara,tempA,dataMap,saa,map),'bxrcgs':null};
  820 + // return {'json':tempA,'bxrcgs':null};
  821 + // 第七步 确定吃饭时间.
  822 + baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map);
  823 + baseF.resizeByPitStopTime(cara , tempA , dataMap);
  824 + baseF.updfcno01(tempA,0);
  825 + // return {'json':tempA,'bxrcgs':null};
  826 + // 确定进出场、早晚例保时间.并返回班次数组集合
  827 + return {'json':baseF.addInOutFieldBc(cara,tempA,dataMap,saa,map),'bxrcgs':null};
  828 + },
  829 +
  830 + markeEatTime : function(list , markArray , cara , saa , dataMap ,map) {
  831 + var cfddDm = parseInt(map.cfdd);
  832 + var mLen = markArray.length,cLen=cara.length,sLen =list.length ;
  833 + if(mLen<=0 || cLen<=0 || sLen<=0)
  834 + return false;
  835 + for(var c = 0 ; c<cLen ; c++) {
  836 + var lpNo=cara[c].lpNo,lpType;
  837 + for(var s = 0 ; s<sLen;s++ ) {
  838 + if(list[s].sslp[0].lpNo==lpNo) {
  839 + lpType = list[s].type;
  840 + break;
  841 + }
  842 + }
  843 + if(lpType=='五工二休')
  844 + continue;
  845 + var lpbcArray = new Array();
  846 + for(var m = 0 ; m < mLen; m++) {
  847 + if(markArray[m].lpNo==lpNo)
  848 + lpbcArray.push(markArray[m]);
  849 + }
  850 + lpbcArray.sort(function(a,b){return a.fcint - b.fcint});
  851 + baseF.isHaveBc(baseF.getDateTime('10:15') , baseF.getDateTime('12:15'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 0);
  852 + //baseF.isHaveBc(baseF.getDateTime('18:00') , baseF.getDateTime('19:00'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 1);
  853 + }
  854 + },
  855 +
  856 + isHaveBc : function(kssj , jssj , bcArray,cfddDm , dataMap , lpObj , map, markArray , cfIndex) {
  857 + var canCf = new Array(), countTzsj = 0, isLast = new Array();
  858 + for(var b = 0 ; b<bcArray.length;b++) {
  859 + var bcddsj = baseF.getDateTime(bcArray[b].ARRIVALTIME);
  860 + if(bcddsj<=jssj) {
  861 + countTzsj += bcArray[b].STOPTIME;
  862 + canCf.push(bcArray[b]);
  863 + }
  864 + /*if(bcddsj>= kssj && bcddsj<=jssj) {
  865 + countTzsj += bcArray[b].STOPTIME;
  866 + canCf.push(bcArray[b]);
  867 + }
  868 + if(bcddsj < kssj)
  869 + isLast.push(bcArray[b]);*/
  870 + }
  871 + if(canCf.length>0) {
  872 + console.log('countTzsj:' + countTzsj + 'length:' + canCf.length);
  873 + var fxDm = baseF.dirDmToIndex(canCf[canCf.length-1].xlDir);
  874 + // console.log(countTzsj , canCf[canCf.length-1].fcsj);
  875 + if(cfddDm == fxDm && canCf.length>2) {
  876 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  877 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  878 + var obj = baseF.getbcObj(
  879 + baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  880 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  881 + markArray.push(obj);
  882 + if(tzdx<0) {
  883 + // canCf[canCf.length-1].STOPTIME = 0;
  884 + var fcsj = baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME);
  885 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  886 + canCf[canCf.length-1].fcsj = baseF.getTimeStr(fcsj);
  887 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-1].bcsj);
  888 + canCf[canCf.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  889 + }
  890 + }else {
  891 + var obj = baseF.getbcObj(
  892 + baseF.getDateTime(canCf[canCf.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  893 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  894 + markArray.push(obj);
  895 +
  896 + }
  897 + }
  898 + /*if(canCf.length>0) {
  899 + var fxDm = baseF.dirDmToIndex(canCf[canCf.length-1].xlDir);
  900 + // console.log(countTzsj , canCf[canCf.length-1].fcsj);
  901 + if(cfddDm == fxDm && canCf.length>2) {
  902 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  903 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  904 + var obj = baseF.getbcObj(
  905 + baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  906 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  907 + markArray.push(obj);
  908 + if(tzdx<0) {
  909 + // canCf[canCf.length-1].STOPTIME = 0;
  910 + var fcsj = baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME);
  911 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  912 + canCf[canCf.length-1].fcsj = baseF.getTimeStr(fcsj);
  913 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-1].bcsj);
  914 + canCf[canCf.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  915 + }
  916 + }else {
  917 + var obj = baseF.getbcObj(
  918 + baseF.getDateTime(canCf[canCf.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  919 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  920 + markArray.push(obj);
  921 +
  922 + }
  923 + }else if(isLast.length>0) {
  924 + var fxDm = baseF.dirDmToIndex(isLast[isLast.length-1].xlDir);
  925 + if(cfddDm ==fxDm && canCf.length>2) {
  926 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  927 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  928 + var obj = baseF.getbcObj(
  929 + baseF.getDateTime(isLast[isLast.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  930 + dataMap.dira[cfddDm], isLast[isLast.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  931 + markArray.push(obj);
  932 + if(tzdx<0) {
  933 + var fcsj = baseF.getDateTime(isLast[isLast.length-2].ARRIVALTIME);
  934 + fcsj.setMinutes(fcsj.getMinutes() + isLast[isLast.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  935 + isLast[isLast.length-1].fcsj = baseF.getTimeStr(fcsj);
  936 + fcsj.setMinutes(fcsj.getMinutes() +isLast[isLast.length-1].bcsj);
  937 + isLast[isLast.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  938 + }
  939 + }else {
  940 + var obj = baseF.getbcObj(
  941 + baseF.getDateTime(isLast[isLast.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  942 + dataMap.dira[cfddDm], isLast[isLast.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  943 + markArray.push(obj);
  944 + }
  945 + }*/
801 946 },
802 947  
803 948 /**
... ... @@ -930,12 +1075,13 @@ var BaseFun = function() {
930 1075 var lLen = list.length , cLen = clzs.length;
931 1076 if(lLen<= 0 || cLen<=0 )
932 1077 return false;
933   - // 最多车次与总车次的比例.
934   - var blnum = Math.round(cLen/list[0].fpcls);
  1078 + list.sort(function(a,b){return a.fpcls-b.fpcls});
935 1079 // 定义已经分配出去的路牌.
936 1080 var rs = new Array();
937 1081 // 遍历
938 1082 for(var r = 0 ; r < lLen ; r++) {
  1083 + // 车次与总车次的比例.
  1084 + var blnum = Math.round(cLen/list[r].fpcls);
939 1085 // 得到没有分配出去的路牌.
940 1086 var dxa = baseF.chaji_array(clzs,rs);
941 1087 // 定义当前车次数.
... ... @@ -943,29 +1089,32 @@ var BaseFun = function() {
943 1089 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组.
944 1090 var index = 0 , sslp = new Array();
945 1091 // 当前车次所有占比例.
946   - var tempint = parseInt(rsnum/blnum);
  1092 + //var tempint = parseInt(rsnum/blnum);
947 1093 // 判断如果比例小1 则为当前车次数.
948   - blnum = tempint <= 1 ? rsnum : blnum;
  1094 + //blnum = tempint <= 1 ? rsnum : blnum;
949 1095 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前.
950 1096 if(r < lLen-1) {
951 1097 // 遍历
952   - for(var c = 0 ; c < tempint ; c++) {
  1098 + for(var c = 0 ; c < rsnum ; c++) {
953 1099 // 创建新的没有分配出去的路牌数组.
954 1100 var temp = dxa.concat();
955 1101 // 创建切割路牌数组.
956 1102 var tagA = new Array();
957 1103 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前.
958 1104 if(index <= (dxa.length-blnum) ) {
959   - tagA = temp.splice(index,blnum);
  1105 + /*tagA = temp.splice(index,blnum);*/
  1106 + tagA = temp.splice(index,1);
960 1107 }else {
961   - tagA = temp.splice((dxa.length-blnum),blnum);
  1108 + /*tagA = temp.splice((dxa.length-blnum),blnum);*/
  1109 + tagA = temp.splice((dxa.length-blnum),1);
962 1110 }
963 1111 // 组合切割路牌数组.赋值给已分配出去的路牌.
964 1112 rs = rs.concat(tagA);
965 1113 // 赋值给分配到班型车次下的路牌数组.
966 1114 sslp = sslp.concat(tagA);
967 1115 // 记录切割下标.
968   - index = index + 1 + blnum;
  1116 + index = index + blnum;
  1117 + // index = index + blnum;
969 1118 }
970 1119 // 分配到班型车次下的路牌数组.
971 1120 list[r].sslp = sslp;
... ... @@ -1084,6 +1233,7 @@ var BaseFun = function() {
1084 1233 if(len_>0 && bcCount > 0) {
1085 1234 // 定义该时间区间内的发车间隙.
1086 1235 var _fcjx = parseInt(Math.ceil(zzsj/bcCount));
  1236 + console.log(_fcjx);
1087 1237 if(tagboolean) {
1088 1238 if(_fcjx>gfmaxfcjx)
1089 1239 _fcjx = 20;
... ... @@ -1091,7 +1241,6 @@ var BaseFun = function() {
1091 1241 if(_fcjx>dgmaxfcjx)
1092 1242 _fcjx = dgmaxfcjx;
1093 1243 }
1094   - // console.log(_fcjx);
1095 1244 // 定义修改班次的起始时间点.
1096 1245 var fcnosj = new Date(kssj);
1097 1246 for(var l = 0 ; l< len_ ; l++) {
... ... @@ -1154,8 +1303,10 @@ var BaseFun = function() {
1154 1303 var sslpbcA = new Array();
1155 1304 for(var j =0 ; j < tLen ; j++) {
1156 1305 // 判断当期遍历的班次是否属于当前的路牌.如果是则添加到当前的路牌班次数组集合.
1157   - if(tempa[j].lpNo == cara[t].lpNo)
  1306 + if(tempa[j].lpNo == cara[t].lpNo) {
  1307 + tempa[j].fcint = baseF.getDateTime(tempa[j].fcsj).getTime();
1158 1308 sslpbcA.push(tempa[j]);
  1309 + }
1159 1310 }
1160 1311 if(sslpbcA.length > 0) {
1161 1312 // 按发车时间顺序排序.
... ... @@ -1166,10 +1317,10 @@ var BaseFun = function() {
1166 1317 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj),
1167 1318 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME),
1168 1319 dqbcfcsj = baseF.getDateTime(sslpbcA[r].fcsj);
  1320 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  1321 + var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir); // dataMap.smbcsjArr
1169 1322 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.)
1170 1323 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000);
1171   - // 定义当前班次方向下标代码[0代表上行;1代表下行].
1172   - var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir);
1173 1324 // 定义是否高峰
1174 1325 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap);
1175 1326 // 获取行驶时间.
... ... @@ -1178,40 +1329,75 @@ var BaseFun = function() {
1178 1329 baseF.dirDmToIndex(sslpbcA[r].xlDir));
1179 1330 normmintzsj = xxsj*0.1;
1180 1331 normmaxtzsj = xxsj*0.15;
  1332 + var flag = false;
1181 1333 // 如果小于零
1182   - if(dxmin <= 0 && sslpbcA[r].isfb ==0 ) {
  1334 + if(dxmin < 0 && sslpbcA[r].isfb ==0) {
1183 1335 // 根据不同时段的停站时间.重新赋值停站时间.
1184   - dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  1336 + if(sslpbcA[r].bcType=='normal' && sslpbcA[r+1].bcType =='normal')
  1337 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  1338 + else
  1339 + dxmin = 0;
  1340 + flag = true;
  1341 + }else if(dxmin==0){
  1342 + dxmin = 0;
  1343 + flag = true;
1185 1344 }else {
1186 1345 // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
1187   - if(dxmin >= dgmaxtzsj && dxmin < 180) {
  1346 + if(dxmin >= dgmaxtzsj && dxmin < 180 && sslpbcA[r].isfb==0) {
1188 1347 dxmin = dgmaxtzsj;
  1348 + flag = true;
1189 1349 // 如果大于零 并且 小于等于行业标准的最小停站时间
1190 1350 }else if(dxmin > 0 && dxmin <= normmintzsj ) {
1191 1351 // dxmin = dxmin;
  1352 + flag = true;
1192 1353 // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
1193 1354 }else if(dxmin > normmintzsj && dxmin <= normmaxtzsj ) {
1194 1355 // dxmin = dxmin;
  1356 + flag = true;
1195 1357 // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
1196 1358 }else if(dxmin > normmaxtzsj && dxmin < dgmaxtzsj ) {
1197 1359 // dxmin = dxmin;
  1360 + flag = true;
  1361 + }else if (dxmin >= 180){
  1362 + dxmin = 0;
  1363 + }
  1364 + }
  1365 + if(flag) {
  1366 + if(!baseF.isDirSmbc(baseF.dirDmToIndex(sslpbcA[r+1].xlDir) , sslpbcA[r+1].fcsj , dataMap)) {
  1367 + // 修改当前班次的停站时间.
  1368 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1369 + // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.
  1370 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);
  1371 + // 修改下一个班次的发车时间.
  1372 + sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);
  1373 + // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.
  1374 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);
  1375 + // 修改下一个班次的到达时间.
  1376 + sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);
  1377 + }else {
  1378 + if(r>0) {
  1379 + // 修改当前班次的停站时间.
  1380 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1381 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].STOPTIME);
  1382 + sslpbcA[r].ARRIVALTIME = baseF.getTimeStr(sgbcfcsj);
  1383 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].bcsj);
  1384 + sslpbcA[r].fcsj = baseF.getTimeStr(sgbcfcsj);
  1385 + sslpbcA[r-1].STOPTIME = parseInt( ( sgbcfcsj - baseF.getDateTime(sslpbcA[r-1].ARRIVALTIME))/60000);
  1386 + }
1198 1387 }
1199 1388 }
1200   - // 修改当前班次的停站时间.
1201   - sslpbcA[r].STOPTIME = parseInt(dxmin) ;
1202   - // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.
1203   - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);
1204   - // 修改下一个班次的发车时间.
1205   - sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);
1206   - // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.
1207   - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);
1208   - // 修改下一个班次的到达时间.
1209   - sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);
1210 1389 }
1211 1390 }
1212 1391 }
1213 1392 },
1214 1393  
  1394 + isDirSmbc : function(dirDm , fcsj , dataMap) {
  1395 + var falg = false;
  1396 + if(fcsj == dataMap.smbcsjArr[dirDm].kssj || fcsj == dataMap.smbcsjArr[dirDm].jssj)
  1397 + falg = true;
  1398 + return falg;
  1399 + },
  1400 +
1215 1401 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) {
1216 1402 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap);
1217 1403 var list = baseF.splitBxRc(map.bxrc);
... ... @@ -1297,10 +1483,19 @@ var BaseFun = function() {
1297 1483 dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);*/
1298 1484 var rsjar = baseF.tzsztest(cara,jar3,dataMap);
1299 1485 // return {'json':rsjar,'bxrcgs':bxrcgs};
1300   - return {'json':baseF.addjcclcbc01(cara,rsjar,dataMap,saa,map),'bxrcgs':bxrcgs};
  1486 + return {'json':baseF.addInOutFieldBc(cara,rsjar,dataMap,saa,map),'bxrcgs':bxrcgs};
1301 1487 },
1302 1488  
1303   - addjcclcbc01 : function(cara,rsjar,dataMap,saa,map) {
  1489 + /**
  1490 + * @description (TODO) 添加进出场班次.
  1491 + * @param cara 路牌
  1492 + * @param rsjar 班次集合数组
  1493 + * @param dataMap dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].
  1494 + * @param saa 封装的一些 停站时间、周转时间、行驶时间、行驶里程等.
  1495 + * @param map 表单参数对象.
  1496 + *
  1497 + */
  1498 + addInOutFieldBc : function(cara,rsjar,dataMap,saa,map) {
1304 1499 var resultJA = new Array(),bcs = 0;
1305 1500 for(var m = 0 ; m < cara.length; m++) {
1306 1501 // 获取路牌编号.
... ... @@ -1319,7 +1514,7 @@ var BaseFun = function() {
1319 1514 lpbc_.sort(function(a,b){return a.fcno-b.fcno});
1320 1515 baseF.addcfbc01(lpbc_,dataMap,map);
1321 1516 // 按照发车序号顺序排序.
1322   - // lpbc_.sort(function(a,b){return a.fcno-b.fcno});
  1517 + lpbc_.sort(function(a,b){return a.fcno-b.fcno});
1323 1518 var tt = baseF.addjclbbc01(lpbc_,dataMap,saa[0].lbsj,map);
1324 1519 bcs = baseF.updfcno01(tt,bcs);
1325 1520 resultJA = resultJA.concat(tt);
... ... @@ -1344,8 +1539,8 @@ var BaseFun = function() {
1344 1539 addcfbc01 : function(lpbcar,dataMap,map) {
1345 1540 var gs = 0 ,sicftag = true;
1346 1541 for(var g = 0 ; g <lpbcar.length-1;g++ ) {
1347   - if( parseInt((baseF.getDateTime(lpbcar[g+1].fcsj) - baseF.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 80
1348   - && lpbcar[g].STOPTIME==0 ) {
  1542 + if( parseInt((baseF.getDateTime(lpbcar[g+1].fcsj) - baseF.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 180
  1543 + && lpbcar[g].STOPTIME==0 && lpbcar[g].bcType =='normal' ) {
1349 1544 lpbcar[g].isfb = 1;
1350 1545 }
1351 1546 /*gs = gs + lpbcar[g].bcsj + lpbcar[g].STOPTIME;
... ... @@ -1767,25 +1962,7 @@ var BaseFun = function() {
1767 1962 dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out,
1768 1963 dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次
1769 1964 fcno ++;
1770   - }/*else if(b > 0 && b < bc.length-1){
1771   - var jcbckssj = baseF.getDateTime(bc[b].ARRIVALTIME)
1772   - var ccbckssj = baseF.getDateTime(bc[b+1].fcsj)
1773   - var dx = parseInt((ccbckssj - jcbckssj)/60000);
1774   - if(bc[b].STOPTIME==0) {
1775   - // bc[b].STOPTIME = 0;
1776   - //console.log(bc[b].fcno);
1777   - var fcno_ = bc[b].fcno + 2;
1778   - stas = true;
1779   - // console.log(bc[b],bc[b+1],b);
1780   - result.push(baseF.getbcObj(
1781   - jcbckssj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,
1782   - dataMap.dira[fxdm],fcno_++,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次
1783   - var ccfx = baseF.dirDmToIndex(bc[b+1].xlDir);
1784   - result.push(baseF.getbcObj(
1785   - ccbckssj,dataMap.ccsjArr[ccfx],car,dataMap.bcTypeArr.out,
1786   - dataMap.dira[ccfx],fcno_++,dataMap.cclcArr[ccfx],gatps,0,dataMap.qdzArr[ccfx],null,null,0,0));// 出场班次
1787   - }
1788   - }*/else if(b==bc.length-1){
  1965 + }else if(b==bc.length-1){
1789 1966 var fcno_ = dxfno + 2;
1790 1967 var qdbcddsj = baseF.getDateTime(bc[b].ARRIVALTIME);
1791 1968 result.push(baseF.getbcObj(
... ...
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
... ... @@ -968,7 +968,7 @@ var RelationshipGraph = function () {
968 968 for(var z = 0 ;z < tza.length;z++) {
969 969 if(tza[z].lpNo == lpNo && tza[z].bcsj >0 ) {
970 970 timeNum = timeNum + tza[z].bcsj + tza[z].STOPTIME;
971   - if( tza[z].bcType !='bd' && tza[z].bcType !='lc' ) {
  971 + if( tza[z].bcType !='bd' && tza[z].bcType !='lc' && tza[z].bcType !='cf') {
972 972 tempNum ++;
973 973 }
974 974 }
... ... @@ -983,32 +983,6 @@ var RelationshipGraph = function () {
983 983 $(textNodes[1]).text("总班次:"+(tempNum));
984 984 // $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this);
985 985 }
986   - /*for(var a=0;a<array.length;a++) {
987   - debugger;
988   - var tempNum = 0,timeNum = 0,lpNo = '';
989   - for(var g = 0 ; g <gdata.length;g++) {
990   - var temp_i = parseInt(d3.select(gdata[g]).attr('y'))-this.configuration.offsetY;
991   - if(temp_i<array[a] && temp_i>minValue) {
992   - var parentNodeCName = d3.select(gdata[g]).attr('id'),
993   - // nodes = d3.selectAll('text[parent-node='+ parentNodeCName +']')[0]
994   - $_d = d3.select(gdata[g]).data()[0];
995   - lpNo = $_d.lpNo;
996   - timeNum = timeNum + parseInt($_d.STOPTIME) + parseInt($_d.bcsj);
997   - if($_d.bcType!='bd' && $_d.bcType!='lc' && $_d.bcType!='cf' && $_d.bcsj>0)
998   - tempNum++;
999   - }
1000   - }
1001   - minValue = array[a];
1002   - var className = 'statis_container_' + array[a];
1003   - var textNodes = $("."+className).children("text");
1004   - var hours = parseInt(timeNum/60);
1005   - var mimus = timeNum%60,zgs = hours + (mimus==0? "": "." + mimus);
1006   - var zgs = parseFloat((timeNum/60).toFixed(2));
1007   - var zgs = timeNum;
1008   - $(textNodes[0]).text("总工时:" + zgs);
1009   - $(textNodes[1]).text("总班次:"+(tempNum));
1010   - $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this);
1011   - }*/
1012 986 }
1013 987  
1014 988 }, {
... ... @@ -3027,7 +3001,9 @@ var RelationshipGraph = function () {
3027 3001 nowDate.setMinutes(parseInt(tm.min)+d.bcsj);// 10.3.1、设置分钟.
3028 3002 // 9.1.4、修改当前班次的到达时间.
3029 3003 d.ARRIVALTIME = BaseFun.getTimeStr(nowDate);
3030   - d.STOPTIME = d.isfb ==1 ? 0 : parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000);
  3004 + d.STOPTIME = d.isfb == 1 ? 0 : parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000);
  3005 + // parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000)
  3006 +
3031 3007 /**
3032 3008 * 9.2、修改元素沿X轴方向的X坐标属性值.
3033 3009 *
... ... @@ -3144,6 +3120,38 @@ var RelationshipGraph = function () {
3144 3120 }
3145 3121 }
3146 3122 }else {
  3123 + var dataMap = $_GlobalGraph.configuration.dataMap;
  3124 + // 定义是否高峰
  3125 + var flag = BaseFun.isPeakTimeScope(BaseFun.getDateTime(nodeContext.lastData.fcsj) , dataMap);
  3126 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  3127 + var cctag = BaseFun.dirDmToIndex(nodeContext.lastData.xlDir);
  3128 + // 获取行驶时间.
  3129 + var xxsj = BaseFun.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , nowDate, dataMap.pcxssjArr , dataMap.gfxxsjArr , cctag);
  3130 + var normmintzsj = xxsj*0.1,normmaxtzsj = xxsj*0.15;
  3131 + // 如果小于零
  3132 + if(dxMinues <= 0 && nodeContext.lastData.isfb ==0 ) {
  3133 + // 根据不同时段的停站时间.重新赋值停站时间.
  3134 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  3135 + }else {
  3136 + // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
  3137 + if(dxMinues >= dataMap.dgmaxtzsj && dxMinues < 180) {
  3138 + dxMinues = dataMap.dgmaxtzsj;
  3139 + // 如果大于零 并且 小于等于行业标准的最小停站时间
  3140 + }else if(dxMinues > 0 && dxMinues <= normmintzsj ) {
  3141 + // dxmin = dxmin;
  3142 + // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
  3143 + }else if(dxMinues > normmintzsj && dxMinues <= normmaxtzsj ) {
  3144 + // dxmin = dxmin;
  3145 + // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
  3146 + }else if(dxMinues > normmaxtzsj && dxMinues < dataMap.dgmaxtzsj ) {
  3147 + // dxmin = dxmin;
  3148 + }else if (dxMinues >= 180){
  3149 + dxMinues = 0;
  3150 + }
  3151 + }
  3152 + // 修改当前班次的停站时间.
  3153 + // nodeContext.lastData.STOPTIME = dxMinues;
  3154 + // d.STOPTIME = parseInt(dxmin) ;
3147 3155 /**
3148 3156 * 11.2.1、如果是正常班次
3149 3157 *
... ... @@ -3370,11 +3378,41 @@ var RelationshipGraph = function () {
3370 3378 }
3371 3379 }
3372 3380 }else {
  3381 + var dxMinues = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(_obj.lastData.ARRIVALTIME)) / 60000);
3373 3382 /**
3374 3383 * 1.5.6、修改上个元素班次与当前班次的停站时间和text元素的文本属性值.
3375 3384 *
3376 3385 **/
3377   - _obj.lastData.STOPTIME = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(_obj.lastData.ARRIVALTIME)) / 60000);
  3386 + var dataMap = $_GlobalGraph.configuration.dataMap;
  3387 + // 定义是否高峰
  3388 + var flag = BaseFun.isPeakTimeScope(BaseFun.getDateTime(nodeContext.lastData.fcsj) , dataMap);
  3389 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  3390 + var cctag = BaseFun.dirDmToIndex(nodeContext.lastData.xlDir);
  3391 + // 获取行驶时间.
  3392 + var xxsj = BaseFun.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , nowDate, dataMap.pcxssjArr , dataMap.gfxxsjArr , cctag);
  3393 + var normmintzsj = xxsj*0.1,normmaxtzsj = xxsj*0.15;
  3394 + // 如果小于零
  3395 + if(dxMinues <= 0 && nodeContext.lastData.isfb ==0 ) {
  3396 + // 根据不同时段的停站时间.重新赋值停站时间.
  3397 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  3398 + }else {
  3399 + // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
  3400 + if(dxMinues >= dataMap.dgmaxtzsj && dxMinues < 180) {
  3401 + dxMinues = dataMap.dgmaxtzsj;
  3402 + // 如果大于零 并且 小于等于行业标准的最小停站时间
  3403 + }else if(dxMinues > 0 && dxMinues <= normmintzsj ) {
  3404 + // dxmin = dxmin;
  3405 + // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
  3406 + }else if(dxMinues > normmintzsj && dxMinues <= normmaxtzsj ) {
  3407 + // dxmin = dxmin;
  3408 + // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
  3409 + }else if(dxMinues > normmaxtzsj && dxMinues < dataMap.dgmaxtzsj ) {
  3410 + // dxmin = dxmin;
  3411 + }else if (dxMinues >= 180){
  3412 + dxMinues = 0;
  3413 + }
  3414 + }
  3415 + _obj.lastData.STOPTIME = dxMinues;
3378 3416 for(var t = 0 ; t < _obj.lastTextNodes.length ;t++) {
3379 3417 var nowTextNode = d3.select(_obj.lastTextNodes[t]);
3380 3418 if(nowTextNode.attr('text-type')=='gap')
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js
... ... @@ -420,7 +420,8 @@
420 420 * @return 返回甘特图的参数配置信息.
421 421 * */
422 422 function getGraphArgus(p) {
423   - var MULTIPLE = Math.round(105/parseInt(p.stopAraay[0].sxsj)) >=4 ? Math.round(90/parseInt(p.stopAraay[0].sxsj)) : Math.round(90/parseInt(p.stopAraay[0].sxsj)) *2;
  423 + var bs = p.stopAraay[0].sxsj > 40 ? 4 : 2;
  424 + var MULTIPLE = Math.round(105/parseInt(p.stopAraay[0].sxsj)) >3 ? Math.round(90/parseInt(p.stopAraay[0].sxsj)) : Math.round(90/parseInt(p.stopAraay[0].sxsj)) *bs;
424 425 var VALUEKEYNAME = 'Worldwide Gross' ,
425 426 DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = p.yAxisCarArray.length*60 + 240,
426 427 MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60,
... ...
src/main/resources/static/pages/forms/mould/countByBus1.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/countByBus2.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/countByLine.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -70,7 +70,7 @@ word-wrap: break-word;
70 70 <table class="table table-bordered table-hover table-checkable" id="forms">
71 71 <thead>
72 72 <tr>
73   - <th colspan="40">线路调度日报</th>
  73 + <th colspan="40"><lable id="xlmc"></lable>线路调度日报</th>
74 74 </tr>
75 75 <tr>
76 76 <td rowspan="3"><span >路线名</span></td>
... ... @@ -407,6 +407,7 @@ word-wrap: break-word;
407 407 layer.msg("请选择时间");
408 408 return;
409 409 }
  410 + $("#xlmc").html(xlName);
410 411 $("#ddrbBody").height($(window).height()-100);
411 412 $("c").html("全日");
412 413 $("#export").removeAttr("disabled");
... ...
src/main/resources/static/pages/scheduleApp/Gruntfile.js
... ... @@ -87,7 +87,8 @@ module.exports = function (grunt) {
87 87 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令
88 88 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令
89 89 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排版计划form中使用)
90   - 'module/common/dts2/scheduleplan/saPlaninfoedit.js' // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用)
  90 + 'module/common/dts2/scheduleplan/saPlaninfoedit.js', // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用)
  91 + 'module/common/dts2/scheduleplan/saPlaninfoedit2.js' // saPlaninfoedit2指令(非通用指令,只在调度执勤日报中使用)
91 92 ],
92 93 dest: 'module/common/prj-common-directive.js'
93 94 },
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect5.js
... ... @@ -196,8 +196,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
196 196 */
197 197 scope[ctrlAs].$$internal_validate_model = function() {
198 198 // TODO:
199   - console.log(scope[ctrlAs].$$internal_select_value);
200   - console.log(scope[ctrlAs].$$data_real);
  199 + //console.log(scope[ctrlAs].$$internal_select_value);
  200 + //console.log(scope[ctrlAs].$$data_real);
201 201  
202 202 if (scope[ctrlAs].$$internal_select_value) {
203 203 var select_value_temp = scope[ctrlAs].$$internal_select_value;
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saPlanInfoEdit2.js 0 → 100644
  1 +/**
  2 + * saPlaninfoedit2指令,排班明细编辑控件,用在调度执勤日报的修改功能
  3 + * name(必须),控件的名字
  4 + * ds,外部数据源
  5 + * fd, 表单数据源
  6 + */
  7 +angular.module('ScheduleApp').directive(
  8 + 'saPlaninfoedit2',
  9 + [
  10 + function() {
  11 + return {
  12 + restrict: 'E',
  13 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html',
  14 + scope: { // 独立作用域
  15 + ds: '=ngModel', // 时刻明细数据源头
  16 + fd: '=formData' // 表单数据源(车辆、驾驶员、售票员信息)
  17 + },
  18 + controllerAs: '$saPlanInfoEditCtrl',
  19 + bindToController: true,
  20 + controller: function() {
  21 + //var self = this;
  22 +
  23 + },
  24 +
  25 + compile: function(tElem, tAttrs) {
  26 + // 获取属性
  27 + var $attr_name = tAttrs["name"]; // 控件的名字
  28 + if (!$attr_name) {
  29 + throw {msg: "saPlaninfoedit2指令name属性不能为空"};
  30 + }
  31 +
  32 + // 内部controlAs名字
  33 + var ctrlAs = '$saPlanInfoEditCtrl';
  34 +
  35 +
  36 + // 内部变量,原始车辆,人员数据
  37 + var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组
  38 + var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组
  39 + var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组
  40 + var old_isfb = false; // 是否有分班
  41 + var old_isfb_index = 0; // 分班开始索引
  42 + var old_hasJCBC = false; // 是否有进场班次
  43 + var old_max_fcno = 0; // 最大发车顺序号
  44 + var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号
  45 + var old_half_bcs = 0; // 一般的班次数量
  46 +
  47 + // 内部变量,变更的车辆,变更的人员
  48 + var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号)
  49 + var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号)
  50 + var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号)
  51 + var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号)
  52 + var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号)
  53 + var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号)
  54 +
  55 +
  56 + // 表单值,被赋值的次数
  57 + var form_data_assign_count = {
  58 + cl1 : 1,
  59 + cl2 : 1,
  60 + j1 : 1,
  61 + j2 : 1,
  62 + j3 : 1,
  63 + s1 : 1,
  64 + s2 : 1,
  65 + s3 : 1
  66 + };
  67 +
  68 + return {
  69 + pre: function(scope, element, attr) {
  70 +
  71 + },
  72 + post: function(scope, element, attr) {
  73 +
  74 + /**
  75 + * 刷新车辆数据。
  76 + */
  77 + scope[ctrlAs].$$internal_refresh_dsdata_cl = function() {
  78 + if (new_cl1) {
  79 + var new_cl1_id = new_cl1.split("_")[0];
  80 + var new_cl1_zbh = new_cl1.split("_")[1];
  81 +
  82 + if (new_cl2) {
  83 + var new_cl2_id = new_cl2.split("_")[0];
  84 + var new_cl2_zbh = new_cl2.split("_")[1];
  85 +
  86 + if (old_isfb) { // 使用分班判定
  87 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  88 + if (index < old_isfb_index) {
  89 + obj.cl = new_cl1_id;
  90 + obj.clZbh = new_cl1_zbh;
  91 + } else {
  92 + obj.cl = new_cl2_id;
  93 + obj.clZbh = new_cl2_zbh;
  94 + }
  95 + });
  96 +
  97 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  98 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  99 + if (obj.fcno <= old_firstJCBCFcno) {
  100 + obj.cl = new_cl1_id;
  101 + obj.clZbh = new_cl1_zbh;
  102 + } else {
  103 + obj.cl = new_cl2_id;
  104 + obj.clZbh = new_cl2_zbh;
  105 + }
  106 + });
  107 + } else { // 使用一半一半班次判定
  108 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  109 + if (index < old_half_bcs) {
  110 + obj.cl = new_cl1_id;
  111 + obj.clZbh = new_cl1_zbh;
  112 + } else {
  113 + obj.cl = new_cl2_id;
  114 + obj.clZbh = new_cl2_zbh;
  115 + }
  116 + });
  117 + }
  118 +
  119 + } else {
  120 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  121 + obj.cl = new_cl1_id;
  122 + obj.clZbh = new_cl1_zbh;
  123 + });
  124 + }
  125 +
  126 + } else {
  127 + // 清空,不使用旧的
  128 + angular.forEach(old_cl, function(value, key) {
  129 + angular.forEach(value, function(i) {
  130 + //scope[ctrlAs].ds[i].cl = key.split("_")[0];
  131 + //scope[ctrlAs].ds[i].clZbh = key.split("_")[1];
  132 + scope[ctrlAs].ds[i].cl = undefined;
  133 + scope[ctrlAs].ds[i].clZbh = undefined;
  134 + });
  135 + });
  136 + }
  137 + };
  138 +
  139 + /**
  140 + * 刷新驾驶员数据。
  141 + */
  142 + scope[ctrlAs].$$internal_refresh_dsdata_j = function() {
  143 + if (new_j1) {
  144 + var new_j1_id = new_j1.split("_")[0];
  145 + var new_j1_name = new_j1.split("_")[1];
  146 + var new_j1_gh = new_j1.split("_")[2];
  147 + if (new_j1_gh && new_j1_gh.indexOf("-") > 0) {
  148 + new_j1_gh = new_j1_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  149 + }
  150 +
  151 + if (new_j2) {
  152 + var new_j2_id = new_j2.split("_")[0];
  153 + var new_j2_name = new_j2.split("_")[1];
  154 + var new_j2_gh = new_j2.split("_")[2];
  155 + if (new_j2_gh && new_j2_gh.indexOf("-") > 0) {
  156 + new_j2_gh = new_j2_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  157 + }
  158 +
  159 + if (old_isfb) { // 使用分班判定
  160 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  161 + if (index < old_isfb_index) {
  162 + obj.j = new_j1_id;
  163 + obj.jGh = new_j1_gh;
  164 + obj.jName = new_j1_name;
  165 + } else {
  166 + obj.j = new_j2_id;
  167 + obj.jGh = new_j2_gh;
  168 + obj.jName = new_j2_name;
  169 + }
  170 + });
  171 +
  172 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  173 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  174 + if (obj.fcno <= old_firstJCBCFcno) {
  175 + obj.j = new_j1_id;
  176 + obj.jGh = new_j1_gh;
  177 + obj.jName = new_j1_name;
  178 + } else {
  179 + obj.j = new_j2_id;
  180 + obj.jGh = new_j2_gh;
  181 + obj.jName = new_j2_name;
  182 + }
  183 + });
  184 + } else { // 使用一半一半班次判定
  185 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  186 + if (index < old_half_bcs) {
  187 + obj.j = new_j1_id;
  188 + obj.jGh = new_j1_gh;
  189 + obj.jName = new_j1_name;
  190 + } else {
  191 + obj.j = new_j2_id;
  192 + obj.jGh = new_j2_gh;
  193 + obj.jName = new_j2_name;
  194 + }
  195 + });
  196 + }
  197 +
  198 + } else {
  199 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  200 + obj.j = new_j1_id;
  201 + obj.jGh = new_j1_gh;
  202 + obj.jName = new_j1_name;
  203 + });
  204 + }
  205 +
  206 + } else {
  207 + // 清空,不使用使用旧的
  208 + angular.forEach(old_j, function(value, key) {
  209 + angular.forEach(value, function(i) {
  210 + //scope[ctrlAs].ds[i].j = key.split("_")[0];
  211 + //scope[ctrlAs].ds[i].jName = key.split("_")[1];
  212 + //scope[ctrlAs].ds[i].jGh = key.split("_")[2];
  213 + scope[ctrlAs].ds[i].j = undefined;
  214 + scope[ctrlAs].ds[i].jName = undefined;
  215 + scope[ctrlAs].ds[i].jGh = undefined;
  216 + });
  217 + });
  218 + }
  219 + };
  220 +
  221 + /**
  222 + * 刷新售票员数据(和驾驶员配对的,有驾驶员,才有售票员)。
  223 + */
  224 + scope[ctrlAs].$$internal_refresh_dsdata_s = function() {
  225 + var j_id = undefined;
  226 + var s_id = undefined;
  227 + var s_gh = undefined;
  228 + var s_name = undefined;
  229 +
  230 + if (new_j1) {
  231 + j_id = new_j1.split("_")[0];
  232 + if (new_s1) {
  233 + s_id = new_s1.split("_")[0];
  234 + s_name = new_s1.split("_")[1];
  235 + s_gh = new_s1.split("_")[2];
  236 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  237 + s_gh = s_gh.substr(3);
  238 + }
  239 + } else {
  240 + s_id = undefined;
  241 + s_gh = undefined;
  242 + s_name = undefined
  243 + }
  244 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  245 + if (obj.j == j_id) {
  246 + obj.s = s_id;
  247 + obj.sGh = s_gh;
  248 + obj.sName = s_name;
  249 + }
  250 + });
  251 + }
  252 + if (new_j2) {
  253 + j_id = new_j2.split("_")[0];
  254 + if (new_s2) {
  255 + s_id = new_s2.split("_")[0];
  256 + s_name = new_s2.split("_")[1];
  257 + s_gh = new_s2.split("_")[2];
  258 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  259 + s_gh = s_gh.substr(3);
  260 + }
  261 + } else {
  262 + s_id = undefined;
  263 + s_gh = undefined;
  264 + s_name = undefined
  265 + }
  266 +
  267 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  268 + if (obj.j == j_id) {
  269 + obj.s = s_id;
  270 + obj.sGh = s_gh;
  271 + obj.sName = s_name;
  272 + }
  273 + });
  274 + }
  275 + };
  276 +
  277 +
  278 + //-------------- 监控表单车辆1的变化 ----------------//
  279 + scope.$watch(
  280 + function() {
  281 + return scope[ctrlAs].fd.cl1;
  282 + },
  283 + function(newValue, oldValue) {
  284 + // 初始化new_cl1
  285 + if (newValue.id) {
  286 + if (newValue.id && newValue.zbh) {
  287 + new_cl1 = newValue.id + "_" + newValue.zbh;
  288 + } else {
  289 + new_cl1 = undefined;
  290 + }
  291 + } else {
  292 + new_cl1 = undefined;
  293 + }
  294 +
  295 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  296 + },
  297 + true
  298 + );
  299 +
  300 + //-------------- 监控表单车辆2的变化 ----------------//
  301 + scope.$watch(
  302 + function() {
  303 + return scope[ctrlAs].fd.cl2;
  304 + },
  305 + function(newValue, oldValue) {
  306 + // 初始化new_cl2
  307 + if (newValue.id) {
  308 + if (newValue.id && newValue.zbh) {
  309 + new_cl2 = newValue.id + "_" + newValue.zbh;
  310 + } else {
  311 + new_cl2 = undefined;
  312 + }
  313 + } else {
  314 + new_cl2 = undefined;
  315 + }
  316 +
  317 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  318 + },
  319 + true
  320 + );
  321 +
  322 + //-------------- 监控表单驾驶员1的变化 ----------------//
  323 + scope.$watch(
  324 + function() {
  325 + return scope[ctrlAs].fd.j1;
  326 + },
  327 + function(newValue, oldValue) {
  328 + // 初始化j1
  329 + if (newValue.id) {
  330 + if (newValue.id && newValue.name && newValue.jobCode) {
  331 + new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  332 + } else {
  333 + new_j1 = undefined;
  334 + }
  335 + } else {
  336 + new_j1 = undefined;
  337 + }
  338 +
  339 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  340 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  341 + },
  342 + true
  343 + );
  344 +
  345 + //-------------- 监控表单售票员1的变化 ----------------//
  346 + scope.$watch(
  347 + function() {
  348 + return scope[ctrlAs].fd.s1;
  349 + },
  350 + function(newValue, oldValue) {
  351 + // 初始化s1
  352 + if (newValue.id) {
  353 + if (newValue.id && newValue.name && newValue.jobCode) {
  354 + new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  355 + } else {
  356 + new_s1 = undefined;
  357 + }
  358 + } else {
  359 + new_s1 = undefined;
  360 + }
  361 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  362 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  363 + },
  364 + true
  365 + );
  366 +
  367 + //-------------- 监控表单驾驶员2的变化 ----------------//
  368 + scope.$watch(
  369 + function() {
  370 + return scope[ctrlAs].fd.j2;
  371 + },
  372 + function(newValue, oldValue) {
  373 + // 初始化j2
  374 + if (newValue.id) {
  375 + if (newValue.id && newValue.name && newValue.jobCode) {
  376 + new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  377 + } else {
  378 + new_j2 = undefined;
  379 + }
  380 + } else {
  381 + new_j2 = undefined;
  382 + }
  383 +
  384 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  385 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  386 + },
  387 + true
  388 + );
  389 +
  390 + //-------------- 监控表单售票员2的变化 ----------------//
  391 + scope.$watch(
  392 + function() {
  393 + return scope[ctrlAs].fd.s2;
  394 + },
  395 + function(newValue, oldValue) {
  396 + // 初始化s2
  397 + if (newValue && newValue.id) {
  398 + if (newValue.id && newValue.name && newValue.jobCode) {
  399 + new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  400 + } else {
  401 + new_s2 = undefined;
  402 + }
  403 + } else {
  404 + new_s2 = undefined;
  405 + }
  406 +
  407 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  408 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  409 + },
  410 + true
  411 + );
  412 +
  413 + //-------------------- 监控ds的变化,更新数据源,初始化formdata的数据 ---------------//
  414 + scope.$watch(
  415 + function() {
  416 + return scope[ctrlAs].ds;
  417 + },
  418 + function(newValue, oldValue) {
  419 + if (newValue && newValue.length > 0) {
  420 + var j1 = newValue[0].j;
  421 +
  422 + var cl_ids = []; // 车辆ids数组(有顺序)
  423 + var j_s_ids = []; // 驾驶员ids,售票员ids,[{j:id,s:id},...](有顺序)
  424 + var isRepeat = false;
  425 + var i = 0;
  426 +
  427 + angular.forEach(newValue, function(obj, index) {
  428 + var k1 = obj.cl + "_" + obj.clZbh;
  429 + var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh;
  430 + var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh;
  431 +
  432 + if (!old_cl[k1]) {
  433 + old_cl[k1] = [];
  434 + }
  435 + if (!old_j[k2] && k2) {
  436 + old_j[k2] = [];
  437 + }
  438 + if (!old_s[k3] && k3) {
  439 + old_s[k3] = [];
  440 + }
  441 +
  442 + // 闭包
  443 + (function(i) {
  444 + old_cl[k1].push(i);
  445 + if (k2) {
  446 + old_j[k2].push(i);
  447 + }
  448 + if (k3) {
  449 + old_s[k3].push(i);
  450 + }
  451 + })(index);
  452 +
  453 + // 判断是否分班
  454 + if (j1 != obj.j && !old_isfb) {
  455 + old_isfb = true;
  456 + old_isfb_index = index;
  457 + }
  458 +
  459 + // 判断进出场
  460 + if (obj.bcType == 'in' && !old_hasJCBC) {
  461 + old_hasJCBC = true;
  462 + old_firstJCBCFcno = obj.fcno;
  463 + }
  464 +
  465 + //-------------- formdata用数据处理 -------------//
  466 + // 车辆处理
  467 + isRepeat = false;
  468 + if (obj.cl) {
  469 + for (i = 0; i < cl_ids.length; i++) {
  470 + if (cl_ids[i] == obj.cl) {
  471 + isRepeat = true;
  472 + break;
  473 + }
  474 + }
  475 + if (!isRepeat) {
  476 + cl_ids.push(obj.cl);
  477 + }
  478 + }
  479 +
  480 + // 人员处理(以驾驶员id为主,没有的话,售票员不管了)
  481 + isRepeat = false;
  482 + if (obj.j) {
  483 + for (i = 0; i < j_s_ids.length; i++) {
  484 + if (j_s_ids[i].j == obj.j) {
  485 + isRepeat = true;
  486 + break;
  487 + }
  488 + }
  489 + if (!isRepeat) {
  490 + j_s_ids.push({
  491 + j: obj.j,
  492 + s: !obj.s? undefined: obj.s
  493 + });
  494 + }
  495 + }
  496 + });
  497 +
  498 + old_max_fcno = newValue[newValue.length - 1].fcno;
  499 + old_half_bcs = newValue.length / 2;
  500 +
  501 + // 更新formdata
  502 + for (i = 0; i < cl_ids.length; i++) { // 车辆更新前两辆
  503 + if (i >= 2) {
  504 + break;
  505 + } else {
  506 + form_data_assign_count["cl" + (i + 1)] = 0;
  507 + scope[ctrlAs].fd["cl" + (i + 1)].id = cl_ids[i];
  508 + }
  509 + }
  510 + for (i = 0; i < j_s_ids.length; i++) { // 人员更新
  511 + if (i >= 3) {
  512 + break;
  513 + } else {
  514 + form_data_assign_count["j" + (i + 1)] = 0;
  515 + scope[ctrlAs].fd["j" + (i + 1)].id = j_s_ids[i].j;
  516 +
  517 + form_data_assign_count["s" + (i + 1)] = 0;
  518 + scope[ctrlAs].fd["s" + (i + 1)].id = j_s_ids[i].s;
  519 + }
  520 + }
  521 + }
  522 + }
  523 + );
  524 + }
  525 + }
  526 + }
  527 + };
  528 + }
  529 + ]
  530 +);
0 531 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -1501,8 +1501,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1501 1501 */
1502 1502 scope[ctrlAs].$$internal_validate_model = function() {
1503 1503 // TODO:
1504   - console.log(scope[ctrlAs].$$internal_select_value);
1505   - console.log(scope[ctrlAs].$$data_real);
  1504 + //console.log(scope[ctrlAs].$$internal_select_value);
  1505 + //console.log(scope[ctrlAs].$$data_real);
1506 1506  
1507 1507 if (scope[ctrlAs].$$internal_select_value) {
1508 1508 var select_value_temp = scope[ctrlAs].$$internal_select_value;
... ... @@ -1515,7 +1515,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1515 1515 }
1516 1516 }
1517 1517 if (obj) { // 在data中判定有没有
1518   - // TODO:
  1518 + // 初始化的时候,模拟选中uiselect
1519 1519 scope[ctrlAs].$$internal_select_fn(obj);
1520 1520  
1521 1521 for (var k = 0; k < scope[ctrlAs].$$data.length; k++) {
... ... @@ -4771,4 +4771,534 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4771 4771 };
4772 4772 }
4773 4773 ]
  4774 +);
  4775 +/**
  4776 + * saPlaninfoedit2指令,排班明细编辑控件,用在调度执勤日报的修改功能
  4777 + * name(必须),控件的名字
  4778 + * ds,外部数据源
  4779 + * fd, 表单数据源
  4780 + */
  4781 +angular.module('ScheduleApp').directive(
  4782 + 'saPlaninfoedit2',
  4783 + [
  4784 + function() {
  4785 + return {
  4786 + restrict: 'E',
  4787 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html',
  4788 + scope: { // 独立作用域
  4789 + ds: '=ngModel', // 时刻明细数据源头
  4790 + fd: '=formData' // 表单数据源(车辆、驾驶员、售票员信息)
  4791 + },
  4792 + controllerAs: '$saPlanInfoEditCtrl',
  4793 + bindToController: true,
  4794 + controller: function() {
  4795 + //var self = this;
  4796 +
  4797 + },
  4798 +
  4799 + compile: function(tElem, tAttrs) {
  4800 + // 获取属性
  4801 + var $attr_name = tAttrs["name"]; // 控件的名字
  4802 + if (!$attr_name) {
  4803 + throw {msg: "saPlaninfoedit2指令name属性不能为空"};
  4804 + }
  4805 +
  4806 + // 内部controlAs名字
  4807 + var ctrlAs = '$saPlanInfoEditCtrl';
  4808 +
  4809 +
  4810 + // 内部变量,原始车辆,人员数据
  4811 + var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组
  4812 + var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组
  4813 + var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组
  4814 + var old_isfb = false; // 是否有分班
  4815 + var old_isfb_index = 0; // 分班开始索引
  4816 + var old_hasJCBC = false; // 是否有进场班次
  4817 + var old_max_fcno = 0; // 最大发车顺序号
  4818 + var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号
  4819 + var old_half_bcs = 0; // 一般的班次数量
  4820 +
  4821 + // 内部变量,变更的车辆,变更的人员
  4822 + var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号)
  4823 + var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号)
  4824 + var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号)
  4825 + var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号)
  4826 + var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号)
  4827 + var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号)
  4828 +
  4829 +
  4830 + // 表单值,被赋值的次数
  4831 + var form_data_assign_count = {
  4832 + cl1 : 1,
  4833 + cl2 : 1,
  4834 + j1 : 1,
  4835 + j2 : 1,
  4836 + j3 : 1,
  4837 + s1 : 1,
  4838 + s2 : 1,
  4839 + s3 : 1
  4840 + };
  4841 +
  4842 + return {
  4843 + pre: function(scope, element, attr) {
  4844 +
  4845 + },
  4846 + post: function(scope, element, attr) {
  4847 +
  4848 + /**
  4849 + * 刷新车辆数据。
  4850 + */
  4851 + scope[ctrlAs].$$internal_refresh_dsdata_cl = function() {
  4852 + if (new_cl1) {
  4853 + var new_cl1_id = new_cl1.split("_")[0];
  4854 + var new_cl1_zbh = new_cl1.split("_")[1];
  4855 +
  4856 + if (new_cl2) {
  4857 + var new_cl2_id = new_cl2.split("_")[0];
  4858 + var new_cl2_zbh = new_cl2.split("_")[1];
  4859 +
  4860 + if (old_isfb) { // 使用分班判定
  4861 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4862 + if (index < old_isfb_index) {
  4863 + obj.cl = new_cl1_id;
  4864 + obj.clZbh = new_cl1_zbh;
  4865 + } else {
  4866 + obj.cl = new_cl2_id;
  4867 + obj.clZbh = new_cl2_zbh;
  4868 + }
  4869 + });
  4870 +
  4871 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  4872 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4873 + if (obj.fcno <= old_firstJCBCFcno) {
  4874 + obj.cl = new_cl1_id;
  4875 + obj.clZbh = new_cl1_zbh;
  4876 + } else {
  4877 + obj.cl = new_cl2_id;
  4878 + obj.clZbh = new_cl2_zbh;
  4879 + }
  4880 + });
  4881 + } else { // 使用一半一半班次判定
  4882 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4883 + if (index < old_half_bcs) {
  4884 + obj.cl = new_cl1_id;
  4885 + obj.clZbh = new_cl1_zbh;
  4886 + } else {
  4887 + obj.cl = new_cl2_id;
  4888 + obj.clZbh = new_cl2_zbh;
  4889 + }
  4890 + });
  4891 + }
  4892 +
  4893 + } else {
  4894 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4895 + obj.cl = new_cl1_id;
  4896 + obj.clZbh = new_cl1_zbh;
  4897 + });
  4898 + }
  4899 +
  4900 + } else {
  4901 + // 清空,不使用旧的
  4902 + angular.forEach(old_cl, function(value, key) {
  4903 + angular.forEach(value, function(i) {
  4904 + //scope[ctrlAs].ds[i].cl = key.split("_")[0];
  4905 + //scope[ctrlAs].ds[i].clZbh = key.split("_")[1];
  4906 + scope[ctrlAs].ds[i].cl = undefined;
  4907 + scope[ctrlAs].ds[i].clZbh = undefined;
  4908 + });
  4909 + });
  4910 + }
  4911 + };
  4912 +
  4913 + /**
  4914 + * 刷新驾驶员数据。
  4915 + */
  4916 + scope[ctrlAs].$$internal_refresh_dsdata_j = function() {
  4917 + if (new_j1) {
  4918 + var new_j1_id = new_j1.split("_")[0];
  4919 + var new_j1_name = new_j1.split("_")[1];
  4920 + var new_j1_gh = new_j1.split("_")[2];
  4921 + if (new_j1_gh && new_j1_gh.indexOf("-") > 0) {
  4922 + new_j1_gh = new_j1_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  4923 + }
  4924 +
  4925 + if (new_j2) {
  4926 + var new_j2_id = new_j2.split("_")[0];
  4927 + var new_j2_name = new_j2.split("_")[1];
  4928 + var new_j2_gh = new_j2.split("_")[2];
  4929 + if (new_j2_gh && new_j2_gh.indexOf("-") > 0) {
  4930 + new_j2_gh = new_j2_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  4931 + }
  4932 +
  4933 + if (old_isfb) { // 使用分班判定
  4934 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4935 + if (index < old_isfb_index) {
  4936 + obj.j = new_j1_id;
  4937 + obj.jGh = new_j1_gh;
  4938 + obj.jName = new_j1_name;
  4939 + } else {
  4940 + obj.j = new_j2_id;
  4941 + obj.jGh = new_j2_gh;
  4942 + obj.jName = new_j2_name;
  4943 + }
  4944 + });
  4945 +
  4946 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  4947 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4948 + if (obj.fcno <= old_firstJCBCFcno) {
  4949 + obj.j = new_j1_id;
  4950 + obj.jGh = new_j1_gh;
  4951 + obj.jName = new_j1_name;
  4952 + } else {
  4953 + obj.j = new_j2_id;
  4954 + obj.jGh = new_j2_gh;
  4955 + obj.jName = new_j2_name;
  4956 + }
  4957 + });
  4958 + } else { // 使用一半一半班次判定
  4959 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4960 + if (index < old_half_bcs) {
  4961 + obj.j = new_j1_id;
  4962 + obj.jGh = new_j1_gh;
  4963 + obj.jName = new_j1_name;
  4964 + } else {
  4965 + obj.j = new_j2_id;
  4966 + obj.jGh = new_j2_gh;
  4967 + obj.jName = new_j2_name;
  4968 + }
  4969 + });
  4970 + }
  4971 +
  4972 + } else {
  4973 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4974 + obj.j = new_j1_id;
  4975 + obj.jGh = new_j1_gh;
  4976 + obj.jName = new_j1_name;
  4977 + });
  4978 + }
  4979 +
  4980 + } else {
  4981 + // 清空,不使用使用旧的
  4982 + angular.forEach(old_j, function(value, key) {
  4983 + angular.forEach(value, function(i) {
  4984 + //scope[ctrlAs].ds[i].j = key.split("_")[0];
  4985 + //scope[ctrlAs].ds[i].jName = key.split("_")[1];
  4986 + //scope[ctrlAs].ds[i].jGh = key.split("_")[2];
  4987 + scope[ctrlAs].ds[i].j = undefined;
  4988 + scope[ctrlAs].ds[i].jName = undefined;
  4989 + scope[ctrlAs].ds[i].jGh = undefined;
  4990 + });
  4991 + });
  4992 + }
  4993 + };
  4994 +
  4995 + /**
  4996 + * 刷新售票员数据(和驾驶员配对的,有驾驶员,才有售票员)。
  4997 + */
  4998 + scope[ctrlAs].$$internal_refresh_dsdata_s = function() {
  4999 + var j_id = undefined;
  5000 + var s_id = undefined;
  5001 + var s_gh = undefined;
  5002 + var s_name = undefined;
  5003 +
  5004 + if (new_j1) {
  5005 + j_id = new_j1.split("_")[0];
  5006 + if (new_s1) {
  5007 + s_id = new_s1.split("_")[0];
  5008 + s_name = new_s1.split("_")[1];
  5009 + s_gh = new_s1.split("_")[2];
  5010 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  5011 + s_gh = s_gh.substr(3);
  5012 + }
  5013 + } else {
  5014 + s_id = undefined;
  5015 + s_gh = undefined;
  5016 + s_name = undefined
  5017 + }
  5018 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  5019 + if (obj.j == j_id) {
  5020 + obj.s = s_id;
  5021 + obj.sGh = s_gh;
  5022 + obj.sName = s_name;
  5023 + }
  5024 + });
  5025 + }
  5026 + if (new_j2) {
  5027 + j_id = new_j2.split("_")[0];
  5028 + if (new_s2) {
  5029 + s_id = new_s2.split("_")[0];
  5030 + s_name = new_s2.split("_")[1];
  5031 + s_gh = new_s2.split("_")[2];
  5032 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  5033 + s_gh = s_gh.substr(3);
  5034 + }
  5035 + } else {
  5036 + s_id = undefined;
  5037 + s_gh = undefined;
  5038 + s_name = undefined
  5039 + }
  5040 +
  5041 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  5042 + if (obj.j == j_id) {
  5043 + obj.s = s_id;
  5044 + obj.sGh = s_gh;
  5045 + obj.sName = s_name;
  5046 + }
  5047 + });
  5048 + }
  5049 + };
  5050 +
  5051 +
  5052 + //-------------- 监控表单车辆1的变化 ----------------//
  5053 + scope.$watch(
  5054 + function() {
  5055 + return scope[ctrlAs].fd.cl1;
  5056 + },
  5057 + function(newValue, oldValue) {
  5058 + // 初始化new_cl1
  5059 + if (newValue.id) {
  5060 + if (newValue.id && newValue.zbh) {
  5061 + new_cl1 = newValue.id + "_" + newValue.zbh;
  5062 + } else {
  5063 + new_cl1 = undefined;
  5064 + }
  5065 + } else {
  5066 + new_cl1 = undefined;
  5067 + }
  5068 +
  5069 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  5070 + },
  5071 + true
  5072 + );
  5073 +
  5074 + //-------------- 监控表单车辆2的变化 ----------------//
  5075 + scope.$watch(
  5076 + function() {
  5077 + return scope[ctrlAs].fd.cl2;
  5078 + },
  5079 + function(newValue, oldValue) {
  5080 + // 初始化new_cl2
  5081 + if (newValue.id) {
  5082 + if (newValue.id && newValue.zbh) {
  5083 + new_cl2 = newValue.id + "_" + newValue.zbh;
  5084 + } else {
  5085 + new_cl2 = undefined;
  5086 + }
  5087 + } else {
  5088 + new_cl2 = undefined;
  5089 + }
  5090 +
  5091 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  5092 + },
  5093 + true
  5094 + );
  5095 +
  5096 + //-------------- 监控表单驾驶员1的变化 ----------------//
  5097 + scope.$watch(
  5098 + function() {
  5099 + return scope[ctrlAs].fd.j1;
  5100 + },
  5101 + function(newValue, oldValue) {
  5102 + // 初始化j1
  5103 + if (newValue.id) {
  5104 + if (newValue.id && newValue.name && newValue.jobCode) {
  5105 + new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5106 + } else {
  5107 + new_j1 = undefined;
  5108 + }
  5109 + } else {
  5110 + new_j1 = undefined;
  5111 + }
  5112 +
  5113 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5114 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5115 + },
  5116 + true
  5117 + );
  5118 +
  5119 + //-------------- 监控表单售票员1的变化 ----------------//
  5120 + scope.$watch(
  5121 + function() {
  5122 + return scope[ctrlAs].fd.s1;
  5123 + },
  5124 + function(newValue, oldValue) {
  5125 + // 初始化s1
  5126 + if (newValue.id) {
  5127 + if (newValue.id && newValue.name && newValue.jobCode) {
  5128 + new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5129 + } else {
  5130 + new_s1 = undefined;
  5131 + }
  5132 + } else {
  5133 + new_s1 = undefined;
  5134 + }
  5135 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5136 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5137 + },
  5138 + true
  5139 + );
  5140 +
  5141 + //-------------- 监控表单驾驶员2的变化 ----------------//
  5142 + scope.$watch(
  5143 + function() {
  5144 + return scope[ctrlAs].fd.j2;
  5145 + },
  5146 + function(newValue, oldValue) {
  5147 + // 初始化j2
  5148 + if (newValue.id) {
  5149 + if (newValue.id && newValue.name && newValue.jobCode) {
  5150 + new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5151 + } else {
  5152 + new_j2 = undefined;
  5153 + }
  5154 + } else {
  5155 + new_j2 = undefined;
  5156 + }
  5157 +
  5158 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5159 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5160 + },
  5161 + true
  5162 + );
  5163 +
  5164 + //-------------- 监控表单售票员2的变化 ----------------//
  5165 + scope.$watch(
  5166 + function() {
  5167 + return scope[ctrlAs].fd.s2;
  5168 + },
  5169 + function(newValue, oldValue) {
  5170 + // 初始化s2
  5171 + if (newValue && newValue.id) {
  5172 + if (newValue.id && newValue.name && newValue.jobCode) {
  5173 + new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5174 + } else {
  5175 + new_s2 = undefined;
  5176 + }
  5177 + } else {
  5178 + new_s2 = undefined;
  5179 + }
  5180 +
  5181 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5182 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5183 + },
  5184 + true
  5185 + );
  5186 +
  5187 + //-------------------- 监控ds的变化,更新数据源,初始化formdata的数据 ---------------//
  5188 + scope.$watch(
  5189 + function() {
  5190 + return scope[ctrlAs].ds;
  5191 + },
  5192 + function(newValue, oldValue) {
  5193 + if (newValue && newValue.length > 0) {
  5194 + var j1 = newValue[0].j;
  5195 +
  5196 + var cl_ids = []; // 车辆ids数组(有顺序)
  5197 + var j_s_ids = []; // 驾驶员ids,售票员ids,[{j:id,s:id},...](有顺序)
  5198 + var isRepeat = false;
  5199 + var i = 0;
  5200 +
  5201 + angular.forEach(newValue, function(obj, index) {
  5202 + var k1 = obj.cl + "_" + obj.clZbh;
  5203 + var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh;
  5204 + var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh;
  5205 +
  5206 + if (!old_cl[k1]) {
  5207 + old_cl[k1] = [];
  5208 + }
  5209 + if (!old_j[k2] && k2) {
  5210 + old_j[k2] = [];
  5211 + }
  5212 + if (!old_s[k3] && k3) {
  5213 + old_s[k3] = [];
  5214 + }
  5215 +
  5216 + // 闭包
  5217 + (function(i) {
  5218 + old_cl[k1].push(i);
  5219 + if (k2) {
  5220 + old_j[k2].push(i);
  5221 + }
  5222 + if (k3) {
  5223 + old_s[k3].push(i);
  5224 + }
  5225 + })(index);
  5226 +
  5227 + // 判断是否分班
  5228 + if (j1 != obj.j && !old_isfb) {
  5229 + old_isfb = true;
  5230 + old_isfb_index = index;
  5231 + }
  5232 +
  5233 + // 判断进出场
  5234 + if (obj.bcType == 'in' && !old_hasJCBC) {
  5235 + old_hasJCBC = true;
  5236 + old_firstJCBCFcno = obj.fcno;
  5237 + }
  5238 +
  5239 + //-------------- formdata用数据处理 -------------//
  5240 + // 车辆处理
  5241 + isRepeat = false;
  5242 + if (obj.cl) {
  5243 + for (i = 0; i < cl_ids.length; i++) {
  5244 + if (cl_ids[i] == obj.cl) {
  5245 + isRepeat = true;
  5246 + break;
  5247 + }
  5248 + }
  5249 + if (!isRepeat) {
  5250 + cl_ids.push(obj.cl);
  5251 + }
  5252 + }
  5253 +
  5254 + // 人员处理(以驾驶员id为主,没有的话,售票员不管了)
  5255 + isRepeat = false;
  5256 + if (obj.j) {
  5257 + for (i = 0; i < j_s_ids.length; i++) {
  5258 + if (j_s_ids[i].j == obj.j) {
  5259 + isRepeat = true;
  5260 + break;
  5261 + }
  5262 + }
  5263 + if (!isRepeat) {
  5264 + j_s_ids.push({
  5265 + j: obj.j,
  5266 + s: !obj.s? undefined: obj.s
  5267 + });
  5268 + }
  5269 + }
  5270 + });
  5271 +
  5272 + old_max_fcno = newValue[newValue.length - 1].fcno;
  5273 + old_half_bcs = newValue.length / 2;
  5274 +
  5275 + // 更新formdata
  5276 + for (i = 0; i < cl_ids.length; i++) { // 车辆更新前两辆
  5277 + if (i >= 2) {
  5278 + break;
  5279 + } else {
  5280 + form_data_assign_count["cl" + (i + 1)] = 0;
  5281 + scope[ctrlAs].fd["cl" + (i + 1)].id = cl_ids[i];
  5282 + }
  5283 + }
  5284 + for (i = 0; i < j_s_ids.length; i++) { // 人员更新
  5285 + if (i >= 3) {
  5286 + break;
  5287 + } else {
  5288 + form_data_assign_count["j" + (i + 1)] = 0;
  5289 + scope[ctrlAs].fd["j" + (i + 1)].id = j_s_ids[i].j;
  5290 +
  5291 + form_data_assign_count["s" + (i + 1)] = 0;
  5292 + scope[ctrlAs].fd["s" + (i + 1)].id = j_s_ids[i].s;
  5293 + }
  5294 + }
  5295 + }
  5296 + }
  5297 + );
  5298 + }
  5299 + }
  5300 + }
  5301 + };
  5302 + }
  5303 + ]
4774 5304 );
4775 5305 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
... ... @@ -59,14 +59,14 @@
59 59 iterobjexp="item.insideCode"
60 60 searchph="请输拼音..."
61 61 searchexp="this.insideCode"
62   - <!--required -->
  62 + required
63 63 >
64 64 </sa-Select5>
65 65 </div>
66   - <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->
67   - <!--<div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required">-->
68   - <!--车辆1必须选择-->
69   - <!--</div>-->
  66 + <!-- 隐藏块,显示验证信息 -->
  67 + <div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required">
  68 + 车辆1必须选择
  69 + </div>
70 70 </div>
71 71 <div class="form-group has-success has-feedback">
72 72 <label class="col-md-5 control-label">车辆2:</label>
... ... @@ -99,14 +99,14 @@
99 99 iterobjexp="item.personnelName + '(' + item.jobCode + ')'"
100 100 searchph="请输拼音..."
101 101 searchexp="this.personnelName"
102   - <!--required -->
  102 + required
103 103 >
104 104 </sa-Select5>
105 105 </div>
106   - <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->
107   - <!--<div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">-->
108   - <!--驾驶员必须选择-->
109   - <!--</div>-->
  106 + <!-- 隐藏块,显示验证信息 -->
  107 + <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">
  108 + 驾驶员必须选择
  109 + </div>
110 110 </div>
111 111  
112 112 <div class="form-group has-success has-feedback">
... ... @@ -204,18 +204,26 @@
204 204 <div class="form-group has-success has-feedback">
205 205 <label class="col-md-2 control-label">排班明细:</label>
206 206 <div class="col-md-10">
207   - <sa-Planinfoedit name="spi"
208   - ng-model="ctrl.formData.planInfos"
209   - ng-model-options="{ getterSetter: true }"
210   - cl1="{{ctrl.formData.cl1}}"
211   - cl2="{{ctrl.formData.cl2}}"
212   - j1="{{ctrl.formData.j1}}"
213   - j2="{{ctrl.formData.j2}}"
214   - s1="{{ctrl.formData.s1}}"
215   - s2="{{ctrl.formData.s2}}"
  207 + <!--<sa-Planinfoedit name="spi"-->
  208 + <!--ng-model="ctrl.planInfos"-->
  209 + <!--ng-model-options="{ getterSetter: true }"-->
  210 + <!--cl1="{{ctrl.formData.cl1}}"-->
  211 + <!--cl2="{{ctrl.formData.cl2}}"-->
  212 + <!--j1="{{ctrl.formData.j1}}"-->
  213 + <!--j2="{{ctrl.formData.j2}}"-->
  214 + <!--s1="{{ctrl.formData.s1}}"-->
  215 + <!--s2="{{ctrl.formData.s2}}"-->
  216 + <!-->
  217 +
  218 + <!--</sa-Planinfoedit>-->
  219 +
  220 + <sa-Planinfoedit2 name="spi"
  221 + ng-model="ctrl.planInfos"
  222 + ng-model-options="{ getterSetter: true }"
  223 + form-data="ctrl.formData"
216 224 >
217 225  
218   - </sa-Planinfoedit>
  226 + </sa-Planinfoedit2>
219 227 </div>
220 228 </div>
221 229 </div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js
... ... @@ -264,7 +264,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
264 264 self.formData.j3 = {}; // 驾驶员3
265 265 self.formData.s3 = {}; // 售票员3
266 266  
267   - self.formData.planInfos = undefined; // 排班明细
  267 + self.planInfos = undefined; // 排班明细
268 268  
269 269 var sdd = new Date();
270 270 sdd.setTime(self.sd);
... ... @@ -277,12 +277,12 @@ angular.module(&#39;ScheduleApp&#39;).controller(
277 277  
278 278 // 获取排班明细数据
279 279 SPlanInfo.list(params, function(rst) {
280   - self.formData.planInfos = rst.content;
  280 + self.planInfos = rst.content;
281 281 });
282 282  
283 283 // 提交方法
284 284 self.submit = function() {
285   - service.batchUpdatePlanInfo(self.formData.planInfos).then(
  285 + service.batchUpdatePlanInfo(self.planInfos).then(
286 286 function() {
287 287 $state.go("schedulePlanReportExtManage");
288 288 },
... ...