Commit 048bc1fd77f0379ef4cd78aa90c02ada5fba3c33

Authored by 徐烜
1 parent 2412f0c0

PSM-8

src/main/java/com/bsth/controller/schedule/SchedulePlanController.java
... ... @@ -4,11 +4,10 @@ import com.bsth.controller.BaseController;
4 4 import com.bsth.entity.schedule.SchedulePlan;
5 5 import com.bsth.service.schedule.SchedulePlanService;
6 6 import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestBody;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RequestMethod;
10   -import org.springframework.web.bind.annotation.RestController;
  7 +import org.springframework.web.bind.annotation.*;
11 8  
  9 +import java.util.Date;
  10 +import java.util.List;
12 11 import java.util.Map;
13 12  
14 13 /**
... ... @@ -35,5 +34,21 @@ public class SchedulePlanController extends BaseController<SchedulePlan, Long> {
35 34 return baseService.save(t);
36 35 }
37 36  
  37 + // TODO:
  38 +// @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
  39 +// public List<Map<String, Object>> findGroupInfo(
  40 +// Integer xlid, Date scheduleDate) {
  41 +//
  42 +// }
  43 +
  44 + @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
  45 + public List<Map<String, Object>> findGroupInfo(
  46 + @PathVariable(value = "xlid") Integer xlid,
  47 + @PathVariable(value = "date") Date scheduleDate) {
  48 + return schedulePlanService.findGroupInfo(xlid, scheduleDate);
  49 + }
  50 +
  51 +// public int updateGroupInfo
  52 +
38 53  
39 54 }
... ...
src/main/java/com/bsth/repository/schedule/SchedulePlanRepository.java
... ... @@ -6,8 +6,15 @@ import org.springframework.data.domain.Page;
6 6 import org.springframework.data.domain.Pageable;
7 7 import org.springframework.data.jpa.domain.Specification;
8 8 import org.springframework.data.jpa.repository.EntityGraph;
  9 +import org.springframework.data.jpa.repository.Query;
  10 +import org.springframework.data.repository.query.Param;
9 11 import org.springframework.stereotype.Repository;
10 12  
  13 +import javax.persistence.SqlResultSetMapping;
  14 +import java.util.Date;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
11 18 /**
12 19 * Created by xu on 16/6/16.
13 20 */
... ... @@ -17,4 +24,37 @@ public interface SchedulePlanRepository extends BaseRepository&lt;SchedulePlan, Lon
17 24 @Override
18 25 Page<SchedulePlan> findAll(Specification<SchedulePlan> spec, Pageable pageable);
19 26  
  27 + @Query(value = " select " +
  28 + "xl_name as xlName, " +
  29 + "schedule_date as scheduleDate, " +
  30 + "lp_name as lpName, " +
  31 + "cl_zbh as clZbh, " +
  32 + "group_concat(distinct fcsj) ccsj, " +
  33 + "group_concat(distinct j_gh) jsyGh, " +
  34 + "group_concat(distinct j_name) jsyName, " +
  35 + "group_concat(distinct s_gh) spyGh, " +
  36 + "group_concat(distinct s_name) spyName, " +
  37 + "max(create_date) as createDate " +
  38 + "from bsth_c_s_sp_info " +
  39 + "where bc_type = 'out' and " +
  40 + "xl = ?1 and " +
  41 + "schedule_date = ?2 " +
  42 + "group by xl_name, schedule_date, lp_name " +
  43 + "order by xl_name, schedule_date, lp ", nativeQuery = true)
  44 + List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate);
  45 +
  46 + @Query(value = "update " +
  47 + "bsth_c_s_sp_info " +
  48 + "set cl = :p1, cl_zbh = :p2 " +
  49 + "where xl = :p3 and " +
  50 + "schedule_date = :p4 and " +
  51 + "lp_name = :p5 ",
  52 + nativeQuery = true)
  53 + int updateGroupInfo_clinfo(
  54 + @Param("p1") Integer clid,
  55 + @Param("p2") String clZbh,
  56 + @Param("p3") Integer xlid,
  57 + @Param("p4") Date scheduleDate,
  58 + @Param("p5") String lpName);
  59 +
20 60 }
... ...
src/main/java/com/bsth/service/schedule/SchedulePlanService.java
... ... @@ -3,8 +3,31 @@ package com.bsth.service.schedule;
3 3 import com.bsth.entity.schedule.SchedulePlan;
4 4 import com.bsth.service.BaseService;
5 5  
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
6 10 /**
7 11 * Created by xu on 16/6/16.
8 12 */
9 13 public interface SchedulePlanService extends BaseService<SchedulePlan, Long> {
  14 +
  15 + /**
  16 + * 查找分组排班信息。
  17 + * @param xlid 线路Id
  18 + * @param scheduleDate 排班日期
  19 + * @return
  20 + */
  21 + List<Map<String, Object>> findGroupInfo(Integer xlid, Date scheduleDate);
  22 +
  23 + /**
  24 + * 更新分组排班信息。
  25 + * @param clid 车辆id
  26 + * @param clZbh 车辆自编号
  27 + * @param xlid 线路id
  28 + * @param scheduleDate 排班日期
  29 + * @param lpName 路牌名字
  30 + * @return
  31 + */
  32 + int updateGroupInfo_clinfo(Integer clid, String clZbh, Integer xlid, Date scheduleDate, String lpName);
10 33 }
... ...
src/main/java/com/bsth/service/schedule/SchedulePlanServiceImpl.java
... ... @@ -5,7 +5,6 @@ import com.bsth.entity.schedule.*;
5 5 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
6 6 import com.bsth.repository.schedule.SchedulePlanInfoRepository;
7 7 import com.bsth.repository.schedule.SchedulePlanRepository;
8   -import com.bsth.service.LineService;
9 8 import com.bsth.service.impl.BaseServiceImpl;
10 9 import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;
11 10 import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output;
... ... @@ -31,10 +30,6 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt;
31 30 @Autowired
32 31 private KieBase kieBase;
33 32 @Autowired
34   - private ScheduleRule1FlatService scheduleRule1FlatService;
35   - @Autowired
36   - private LineService lineService;
37   - @Autowired
38 33 private IStrategy strategy;
39 34 @Autowired
40 35 private SchedulePlanRepository schedulePlanRepository;
... ... @@ -126,5 +121,91 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt;
126 121 return super.save(schedulePlan);
127 122 }
128 123  
  124 + @Override
  125 + public List<Map<String, Object>> findGroupInfo(Integer xlid, Date scheduleDate) {
  126 + List<Object[]> groupInfos = schedulePlanRepository.findGroupInfo(xlid, scheduleDate);
  127 + List<Map<String, Object>> ret = new ArrayList<>();
  128 + for (Object[] datas : groupInfos) {
  129 + // TODO:貌似springdata没有优雅的方式把List<Object[]>转换成List<Map<String, Object>>方法,
  130 + // TODO:可能jpa有相关标注,以后找到,此方法就作废
  131 +
  132 + Map<String, Object> map = new HashMap<>();
  133 +
  134 + // 线路名称
  135 + map.put("xlName", datas[0]);
  136 + // 排班时间
  137 + map.put("scheduleDate", datas[1]);
  138 + // 路牌名字
  139 + map.put("lpName", datas[2]);
  140 + // 车辆自编号
  141 + map.put("clZbh", datas[3]);
  142 + // 出场时间,如果有多个,需要分开
  143 + Object ccsj = datas[4];
  144 + if (ccsj != null) {
  145 + String[] ccsj_array = ((String) ccsj).split(",");
  146 + if (ccsj_array.length > 1) {
  147 + map.put("ccsj1", ccsj_array[0]);
  148 + map.put("ccsj2", ccsj_array[1]);
  149 + } else {
  150 + map.put("ccsj1", ccsj_array[0]);
  151 + }
  152 + }
  153 + // 驾驶员工号,如果有多个,需要分开
  154 + Object jsyGh = datas[5];
  155 + if (jsyGh != null) {
  156 + String[] jsyGh_array = ((String) jsyGh).split(",");
  157 + if (jsyGh_array.length > 1) {
  158 + map.put("jsy1Gh", jsyGh_array[0]);
  159 + map.put("jsy2Gh", jsyGh_array[1]);
  160 + } else {
  161 + map.put("jsy1Gh", jsyGh_array[0]);
  162 + }
  163 + }
  164 + // 驾驶员名字,如果有多个,需要分开
  165 + Object jsyName = datas[6];
  166 + if (jsyName != null) {
  167 + String[] jsyName_array = ((String) jsyName).split(",");
  168 + if (jsyName_array.length > 1) {
  169 + map.put("jsy1Name", jsyName_array[0]);
  170 + map.put("jsy2Name", jsyName_array[1]);
  171 + } else {
  172 + map.put("jsy1Name", jsyName_array[0]);
  173 + }
  174 + }
  175 + // 售票员工号,如果有多个,需要分开
  176 + Object spyGh = datas[7];
  177 + if (spyGh != null) {
  178 + String[] spyGh_array = ((String) spyGh).split(",");
  179 + if (spyGh_array.length > 1) {
  180 + map.put("spy1Gh", spyGh_array[0]);
  181 + map.put("spy2Gh", spyGh_array[1]);
  182 + } else {
  183 + map.put("spy1Gh", spyGh_array[0]);
  184 + }
  185 + }
  186 + // 售票员名字,如果有多个,需要分开
  187 + Object spyName = datas[8];
  188 + if (spyName != null) {
  189 + String[] spyName_array = ((String) spyName).split(",");
  190 + if (spyName_array.length > 1) {
  191 + map.put("spy1Name", spyName_array[0]);
  192 + map.put("spy2Name", spyName_array[1]);
  193 + } else {
  194 + map.put("spy1Name", spyName_array[0]);
  195 + }
  196 + }
  197 + // 创建时间
  198 + map.put("createDate", datas[9]);
  199 +
  200 + // TODO:可能还有其他字段
  201 +
  202 + ret.add(map);
  203 + }
  204 + return ret;
  205 + }
129 206  
  207 + @Override
  208 + public int updateGroupInfo_clinfo(Integer clid, String clZbh, Integer xlid, Date scheduleDate, String lpName) {
  209 + return schedulePlanRepository.updateGroupInfo_clinfo(clid, clZbh, xlid, scheduleDate, lpName);
  210 + }
130 211 }
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -389,6 +389,16 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource
389 389 method: 'DELETE'
390 390 }
391 391 }
  392 + ),
  393 + groupinfo : $resource(
  394 + '/spc/groupinfos/:xlid/:sdate',
  395 + {},
  396 + {
  397 + list: {
  398 + method: 'GET',
  399 + isArray: true
  400 + }
  401 + }
392 402 )
393 403 };
394 404 }]);
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
... ... @@ -764,6 +764,29 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi
764 764 }
765 765 })
766 766  
  767 + .state("schedulePlanReportManage_edit", {
  768 + url: '/schedulePlanReportManage_edit/:xlid/:sdate/:lp',
  769 + views: {
  770 + "": {
  771 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/edit_report.html'
  772 + }
  773 + },
  774 +
  775 + resolve: {
  776 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  777 + return $ocLazyLoad.load({
  778 + name: 'schedulePlanReportManage_edit_module',
  779 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  780 + files: [
  781 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  782 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  783 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js"
  784 + ]
  785 + });
  786 + }]
  787 + }
  788 + })
  789 +
767 790 // 线路运营概览模块
768 791 .state("busLineInfoStat", {
769 792 url: '/busLineInfoStat',
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/edit_report.html 0 → 100644
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list_report.html
... ... @@ -7,22 +7,20 @@
7 7 <th style="width: 50px;">序号</th>
8 8 <th style="width: 230px;">线路</th>
9 9 <th style="width: 180px">日期</th>
10   - <th>路牌</th>
11   - <th style="width: 80px;">车辆</th>
12   - <th>出场1</th>
13   - <th style="width: 80px;">驾工1</th>
14   - <th style="width: 80px;">驾1</th>
15   - <th>售工1</th>
16   - <th>售1</th>
17   - <th>出场2</th>
18   - <th>驾工2</th>
19   - <th>驾2</th>
20   - <th>售工2</th>
21   - <th>售2</th>
22   - <th>排班人</th>
  10 + <th style="width: 60px">路牌</th>
  11 + <th style="width: 100px;">车辆</th>
  12 + <th style="width: 80px;">出场1</th>
  13 + <th style="width: 100px;">驾工1</th>
  14 + <th style="width: 100px;">驾1</th>
  15 + <th style="width: 100px;">售工1</th>
  16 + <th style="width: 100px;">售1</th>
  17 + <th style="width: 80px;">出场2</th>
  18 + <th style="width: 100px;">驾工2</th>
  19 + <th style="width: 100px;">驾2</th>
  20 + <th style="width: 100px;">售工2</th>
  21 + <th style="width: 100px;">售2</th>
23 22 <th style="width: 150px;">排班时间</th>
24   - <th style="width: 300px;">时刻表</th>
25   - <th style="width: 260px">操作</th>
  23 + <th>时刻表</th>
26 24 </tr>
27 25 <tr role="row" class="filter">
28 26 <td></td>
... ... @@ -30,8 +28,8 @@
30 28 <sa-Select3 model="ctrl.searchCondition()"
31 29 name="xl"
32 30 placeholder="请输拼音..."
33   - dcvalue="{{ctrl.searchCondition()['xl.id_eq']}}"
34   - dcname="xl.id_eq"
  31 + dcvalue="{{ctrl.searchCondition()['xlid']}}"
  32 + dcname="xlid"
35 33 icname="id"
36 34 icnames="name"
37 35 datatype="xl">
... ... @@ -40,12 +38,12 @@
40 38 <td>
41 39 <div class="input-group">
42 40 <input type="text" class="form-control"
43   - name="scrapDate" placeholder="选择日期..."
44   - uib-datepicker-popup="yyyy年MM月dd日"
45   - is-open="ctrl.scrapDateOpen"
46   - ng-model="ctrl.busInfoForSave.scrapDate" readonly/>
  41 + name="scheduleDate" placeholder="选择日期..."
  42 + uib-datepicker-popup="yyyy-MM-dd"
  43 + is-open="ctrl.scheduleDateOpen"
  44 + ng-model="ctrl.searchCondition().sdate" readonly/>
47 45 <span class="input-group-btn">
48   - <button type="button" class="btn btn-default" ng-click="ctrl.scrapDate_open()">
  46 + <button type="button" class="btn btn-default" ng-click="ctrl.scheduleDate_open()">
49 47 <i class="glyphicon glyphicon-calendar"></i>
50 48 </button>
51 49 </span>
... ... @@ -64,18 +62,6 @@
64 62 <td></td>
65 63 <td></td>
66 64 <td></td>
67   - <td></td>
68   - <td></td>
69   - <td>
70   - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
71   - ng-click="ctrl.pageChanaged()">
72   - <i class="fa fa-search"></i> 搜索</button>
73   -
74   - <button class="btn btn-sm red btn-outline filter-cancel"
75   - ng-click="ctrl.resetSearchCondition()">
76   - <i class="fa fa-times"></i> 重置</button>
77   - </td>
78   -
79 65 </tr>
80 66 </thead>
81 67 <tbody>
... ... @@ -87,46 +73,65 @@
87 73 <span ng-bind="info.xlName"></span>
88 74 </td>
89 75 <td>
90   - <span ng-bind="info.scheduleData"></span>
  76 + <span ng-bind="info.scheduleDate | date: 'yyyy-MM-dd'"></span>
91 77 </td>
92 78 <td>
93 79 <span ng-bind="info.lpName"></span>
94 80 </td>
95 81 <td>
96   - <span ng-bind="info.clZbh"></span>
97   - </td>
98   - <td>
99   - <span ng-bind="info.ccsj1"></span>
  82 + <a class="btn btn-success" ng-click="ctrl.goEditForm()">
  83 + <span ng-bind="info.clZbh"></span>
  84 + </a>
100 85 </td>
101 86 <td>
102   - <span ng-bind="info.jsy1Gh"></span>
  87 + <a class="btn btn-success" ng-show="info.ccsj1">
  88 + <span ng-bind="info.ccsj1"></span>
  89 + </a>
103 90 </td>
104 91 <td>
105   - <span ng-bind="info.jsy1Name"></span>
  92 + <a class="btn btn-success" ng-show="info.jsy1Gh">
  93 + <span ng-bind="info.jsy1Gh"></span>
  94 + </a>
106 95 </td>
107 96 <td>
108   - <span ng-bind="info.spy1Gh"></span>
  97 + <a class="btn btn-success" ng-show="info.jsy1Name">
  98 + <span ng-bind="info.jsy1Name"></span>
  99 + </a>
109 100 </td>
110 101 <td>
111   - <span ng-bind="info.spy1Name"></span>
  102 + <a class="btn btn-success" ng-show="info.spy1Gh">
  103 + <span ng-bind="info.spy1Gh"></span>
  104 + </a>
112 105 </td>
113 106 <td>
114   - <span ng-bind="info.ccsj2"></span>
  107 + <a class="btn btn-success" ng-show="info.spy1Name">
  108 + <span ng-bind="info.spy1Name"></span>
  109 + </a>
115 110 </td>
116 111 <td>
117   - <span ng-bind="info.jsy2Gh"></span>
  112 + <a class="btn btn-success" ng-show="info.ccsj2">
  113 + <span ng-bind="info.ccsj2"></span>
  114 + </a>
118 115 </td>
119 116 <td>
120   - <span ng-bind="info.jsy2Name"></span>
  117 + <a class="btn btn-success" ng-show="info.jsy2Gh">
  118 + <span ng-bind="info.jsy2Gh"></span>
  119 + </a>
121 120 </td>
122 121 <td>
123   - <span ng-bind="info.spy2Gh"></span>
  122 + <a class="btn btn-success" ng-show="info.jsy2Name">
  123 + <span ng-bind="info.jsy2Name"></span>
  124 + </a>
124 125 </td>
125 126 <td>
126   - <span ng-bind="info.spy2Name"></span>
  127 + <a class="btn btn-success" ng-show="info.spy2Gh">
  128 + <span ng-bind="info.spy2Gh"></span>
  129 + </a>
127 130 </td>
128 131 <td>
129   - <span ng-bind="info.createUser"></span>
  132 + <a class="btn btn-success" ng-show="info.spy2Name">
  133 + <span ng-bind="info.spy2Name"></span>
  134 + </a>
130 135 </td>
131 136 <td>
132 137 <span ng-bind="info.createDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
... ... @@ -134,14 +139,6 @@
134 139 <td>
135 140 <span ng-bind="info.ttinfoName"></span>
136 141 </td>
137   - <td>
138   - <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
139   - <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
140   - <a ui-sref="schedulePlanInfoManage({spid : info.id, xlname : info.xl.name, ttname : info.ttInfo.name, stime : info.scheduleFromTime, etime : info.scheduleToTime})"
141   - class="btn default blue-stripe btn-sm"> 排班明细 </a>
142   - <a ng-click="ctrl.deletePlan(info.id)"
143   - class="btn default blue-stripe btn-sm"> 修改 </a>
144   - </td>
145 142 </tr>
146 143 </tbody>
147 144 </table>
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js
1 1 // 调度值勤日报管理 service controller 等写在一起
2 2 // TODO:使用的global服务需要修正
3   -angular.module('ScheduleApp').factory('SchedulePlanReportManageService', ['BusLineInfoStatService_g', function(service) {
  3 +angular.module('ScheduleApp').factory('SchedulePlanReportManageService', ['SchedulePlanManageService_g', function(service) {
4 4 /** 当前的查询条件信息 */
5 5 var currentSearchCondition = {};
6 6  
... ... @@ -22,20 +22,23 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanReportManageService&#39;, [&#39;BusLi
22 22 }
23 23 },
24 24 /**
25   - * 设置当前页码。
26   - * @param cpn 从1开始,后台是从0开始的
27   - */
28   - setCurrentPageNo: function(cpn) {
29   - currentPageNo = cpn;
30   - },
31   - /**
32 25 * 组装查询参数,返回一个promise查询结果。
33 26 * @param params 查询参数
34 27 * @return 返回一个 promise
35 28 */
36 29 getPage: function() {
37 30 var params = currentSearchCondition; // 查询条件
38   - return service.list(params).$promise;
  31 +
  32 + // TODO:如果没有选中线路、日期,默认选中一个
  33 + if (!params.xlid) {
  34 + currentSearchCondition.xlid = 2;
  35 + }
  36 + if (!params.sdate) {
  37 + currentSearchCondition.sdate = new Date();
  38 + currentSearchCondition.sdate.setTime(1472140800000);
  39 + }
  40 +
  41 + return service.groupinfo.list(params).$promise;
39 42 },
40 43 /**
41 44 * 获取明细信息。
... ... @@ -61,199 +64,82 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanReportManageService&#39;, [&#39;BusLi
61 64 angular.module('ScheduleApp').controller('SchedulePlanReportManageCtrl', [
62 65 'SchedulePlanReportManageService', '$state',
63 66 function(schedulePlanReportManageService, $state) {
64   - var self = this;
  67 + var self = this;
65 68  
66   - // 切换到form状态
67   - self.goForm = function() {
68   - alert("切换");
  69 + // 切换到form状态
  70 + self.goForm = function() {
  71 + alert("切换");
  72 + }
69 73 }
70   -}]);
  74 +]);
71 75  
72 76 angular.module('ScheduleApp').controller('SchedulePlanReportManageListCtrl', [
73   - 'SchedulePlanReportManageService',
74   - function(schedulePlanReportManageService) {
75   - var self = this;
76   - self.pageInfo = {
77   - infos: []
78   - };
  77 + 'SchedulePlanReportManageService', '$scope', '$state',
  78 + function(schedulePlanReportManageService, $scope, $state) {
79 79  
80   - // 初始创建的时候,获取一次列表数据
81   - schedulePlanReportManageService.getPage().then(
82   - function(result) {
83   - //self.pageInfo.totalItems = result.totalElements;
84   - //self.pageInfo.currentPage = result.number + 1;
85   - //self.pageInfo.infos = result.content;
86   - //busLineInfoStatService.setCurrentPageNo(result.number + 1);
87   -
88   - // 模拟数据:
89   - self.pageInfo.infos.push({
90   - xlName: '闵行11路',
91   - scheduleData: '2016-01-01',
92   - lpName: '1',
93   - clZbh: 'B-90948',
94   - ccsj1: '04:50',
95   - jsy1Gh: '089249',
96   - jsy1Name: '瞿春明',
97   - spy1Gh: '',
98   - spy1Name: '',
99   - ccsj2: '',
100   - jsy2Gh: '',
101   - jsy2Name: '',
102   - spy2Gh: '',
103   - spy2Name: '',
104   - createUser: '',
105   - createDate: '',
106   - ttinfoName: '闵行11路时刻表0817'
107   - });
108   - self.pageInfo.infos.push({
109   - xlName: '闵行11路',
110   - scheduleData: '2016-01-01',
111   - lpName: '2',
112   - clZbh: 'B-91017',
113   - ccsj1: '04:50',
114   - jsy1Gh: '096532',
115   - jsy1Name: '吴伟清',
116   - spy1Gh: '',
117   - spy1Name: '',
118   - ccsj2: '',
119   - jsy2Gh: '',
120   - jsy2Name: '',
121   - spy2Gh: '',
122   - spy2Name: '',
123   - createUser: '',
124   - createDate: '',
125   - ttinfoName: '闵行11路时刻表0817'
126   - });
127   - self.pageInfo.infos.push({
128   - xlName: '闵行11路',
129   - scheduleData: '2016-01-01',
130   - lpName: '3',
131   - clZbh: 'B-91029',
132   - ccsj1: '05:20',
133   - jsy1Gh: '093261',
134   - jsy1Name: '施建强',
135   - spy1Gh: '',
136   - spy1Name: '',
137   - ccsj2: '',
138   - jsy2Gh: '',
139   - jsy2Name: '',
140   - spy2Gh: '',
141   - spy2Name: '',
142   - createUser: '',
143   - createDate: '',
144   - ttinfoName: '闵行11路时刻表0817'
145   - });
146   - self.pageInfo.infos.push({
147   - xlName: '闵行11路',
148   - scheduleData: '2016-01-01',
149   - lpName: '4',
150   - clZbh: 'B-91041',
151   - ccsj1: '05:30',
152   - jsy1Gh: '096153',
153   - jsy1Name: '沈晓峰',
154   - spy1Gh: '',
155   - spy1Name: '',
156   - ccsj2: '',
157   - jsy2Gh: '',
158   - jsy2Name: '',
159   - spy2Gh: '',
160   - spy2Name: '',
161   - createUser: '',
162   - createDate: '',
163   - ttinfoName: '闵行11路时刻表0817'
164   - });
165   - self.pageInfo.infos.push({
166   - xlName: '闵行11路',
167   - scheduleData: '2016-01-01',
168   - lpName: '5',
169   - clZbh: 'B-91063',
170   - ccsj1: '05:40',
171   - jsy1Gh: '084890',
172   - jsy1Name: '陆海国',
173   - spy1Gh: '',
174   - spy1Name: '',
175   - ccsj2: '',
176   - jsy2Gh: '',
177   - jsy2Name: '',
178   - spy2Gh: '',
179   - spy2Name: '',
180   - createUser: '',
181   - createDate: '',
182   - ttinfoName: '闵行11路时刻表0817'
183   - });
184   - self.pageInfo.infos.push({
185   - xlName: '闵行11路',
186   - scheduleData: '2016-01-01',
187   - lpName: '6',
188   - clZbh: 'B-91071',
189   - ccsj1: '05:50',
190   - jsy1Gh: '096020',
191   - jsy1Name: '唐斌',
192   - spy1Gh: '',
193   - spy1Name: '',
194   - ccsj2: '',
195   - jsy2Gh: '',
196   - jsy2Name: '',
197   - spy2Gh: '',
198   - spy2Name: '',
199   - createUser: '',
200   - createDate: '',
201   - ttinfoName: '闵行11路时刻表0817'
202   - });
203   - self.pageInfo.infos.push({
204   - xlName: '闵行11路',
205   - scheduleData: '2016-01-01',
206   - lpName: '7',
207   - clZbh: 'B-91075',
208   - ccsj1: '06:00',
209   - jsy1Gh: '092228',
210   - jsy1Name: '李光明',
211   - spy1Gh: '',
212   - spy1Name: '',
213   - ccsj2: '',
214   - jsy2Gh: '',
215   - jsy2Name: '',
216   - spy2Gh: '',
217   - spy2Name: '',
218   - createUser: '',
219   - createDate: '',
220   - ttinfoName: '闵行11路时刻表0817'
221   - });
222   - },
223   - function(result) {
224   - alert("出错啦!");
225   - }
226   - );
  80 + var self = this;
  81 + self.pageInfo = {
  82 + infos: []
  83 + };
227 84  
228   - //$scope.$watch("ctrl.pageInfo.currentPage", function() {
229   - // alert("dfdfdf");
230   - //});
  85 + // 日期 日期控件开关
  86 + self.scheduleDateOpen = false;
  87 + self.scheduleDate_open = function() {
  88 + self.scheduleDateOpen = true;
  89 + };
231 90  
232   - // 翻页的时候调用
233   - self.pageChanaged = function() {
234   - schedulePlanReportManageService.setCurrentPageNo(self.pageInfo.currentPage);
  91 + // 初始创建的时候,获取一次列表数据
235 92 schedulePlanReportManageService.getPage().then(
236 93 function(result) {
237   - //self.pageInfo.totalItems = result.totalElements;
238   - //self.pageInfo.currentPage = result.number + 1;
239   - //self.pageInfo.infos = result.content;
240   - //busLineInfoStatService.setCurrentPageNo(result.number + 1);
  94 + self.pageInfo.infos = result;
241 95 },
242 96 function(result) {
243 97 alert("出错啦!");
244 98 }
245 99 );
246   - };
247   - // 获取查询条件数据
248   - self.searchCondition = function() {
249   - return schedulePlanReportManageService.getSearchCondition();
250   - };
251   - // 重置查询条件
252   - self.resetSearchCondition = function() {
253   - return schedulePlanReportManageService.resetSearchCondition();
254   - };
255 100  
256   -}]);
  101 + // 翻页的时候调用
  102 + self.pageChanaged = function() {
  103 + schedulePlanReportManageService.getPage().then(
  104 + function(result) {
  105 + self.pageInfo.infos = result;
  106 + },
  107 + function(result) {
  108 + alert("出错啦!");
  109 + }
  110 + );
  111 + };
  112 + // 获取查询条件数据
  113 + self.searchCondition = function() {
  114 + return schedulePlanReportManageService.getSearchCondition();
  115 + };
  116 + // 重置查询条件
  117 + self.resetSearchCondition = function() {
  118 + return schedulePlanReportManageService.resetSearchCondition();
  119 + };
  120 +
  121 + // 监控条件变化,触发查询
  122 + $scope.$watch(
  123 + function() {
  124 + return schedulePlanReportManageService.getSearchCondition();
  125 + },
  126 + function(newValue, oldValue) {
  127 + if (newValue) {
  128 + if (newValue.xlid && newValue.sdate) {
  129 + self.pageChanaged();
  130 + }
  131 + }
  132 + },
  133 + true
  134 + );
  135 +
  136 + // 切换到修改页面
  137 + self.goEditForm = function() {
  138 + //$state.go("schedulePlanReportManage_edit");
  139 + }
  140 +
  141 + }
  142 +]);
257 143  
258 144 angular.module('ScheduleApp').controller('SchedulePlanReportManageFormCtrl', ['SchedulePlanReportManageService', '$stateParams', '$state', function(schedulePlanReportManageService, $stateParams, $state) {
259 145 // TODO:
... ...