Commit a6aa90e0e8efddd76ccc34bcb3d0f221aadf9512
1 parent
c49536a5
update
Showing
5 changed files
with
55 additions
and
4 deletions
src/main/java/com/bsth/controller/schedule/SchedulePlanInfoController.java
| ... | ... | @@ -2,9 +2,18 @@ package com.bsth.controller.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.controller.BaseController; |
| 4 | 4 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 5 | +import com.google.common.base.Splitter; | |
| 6 | +import org.springframework.data.domain.Page; | |
| 7 | +import org.springframework.data.domain.PageRequest; | |
| 8 | +import org.springframework.data.domain.Sort; | |
| 5 | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 6 | 12 | import org.springframework.web.bind.annotation.RestController; |
| 7 | 13 | |
| 14 | +import java.util.List; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 8 | 17 | /** |
| 9 | 18 | * Created by xu on 16/6/16. |
| 10 | 19 | */ |
| ... | ... | @@ -12,4 +21,32 @@ import org.springframework.web.bind.annotation.RestController; |
| 12 | 21 | @RequestMapping("spic") |
| 13 | 22 | public class SchedulePlanInfoController extends BaseController<SchedulePlanInfo, Long> { |
| 14 | 23 | |
| 24 | + /** | |
| 25 | + * | |
| 26 | + * @Title: list | |
| 27 | + * @Description: TODO(多条件分页查询) | |
| 28 | + * @param @param map 查询条件 | |
| 29 | + * @param @param page 页码 | |
| 30 | + * @param @param size 每页显示数量 | |
| 31 | + * @throws | |
| 32 | + */ | |
| 33 | + @RequestMapping(method = RequestMethod.GET) | |
| 34 | + public Page<SchedulePlanInfo> list(@RequestParam Map<String, Object> map, | |
| 35 | + @RequestParam(defaultValue = "0") int page, | |
| 36 | + @RequestParam(defaultValue = "10") int size, | |
| 37 | + @RequestParam(defaultValue = "id") String order, | |
| 38 | + @RequestParam(defaultValue = "DESC") String direction){ | |
| 39 | + | |
| 40 | + Sort.Direction d; | |
| 41 | + | |
| 42 | + if(null != direction && direction.equals("ASC")) | |
| 43 | + d = Sort.Direction.ASC; | |
| 44 | + else | |
| 45 | + d = Sort.Direction.DESC; | |
| 46 | + | |
| 47 | + // order由 col1,col2,col3 这样传入 | |
| 48 | + List<String> list = Splitter.on(",").trimResults().splitToList(order); | |
| 49 | + return baseService.list(map, new PageRequest(page, size, new Sort(d, list))); | |
| 50 | + } | |
| 51 | + | |
| 15 | 52 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/index_info.html
| ... | ... | @@ -28,7 +28,11 @@ |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <div class="caption font-dark"> |
| 30 | 30 | <i class="fa fa-database font-dark"></i> |
| 31 | - <span class="caption-subject bold uppercase">85路(85路0328平表-时刻表)排班明细</span> | |
| 31 | + <span class="caption-subject bold uppercase"> | |
| 32 | + {{xlname + "(" + ttname + "-时刻表)"}} | |
| 33 | + <span ng-bind="stime | date: 'yyyy-MM-dd ' + '至'"></span> | |
| 34 | + <span ng-bind="etime | date: 'yyyy-MM-dd ' + '排班明细列表'"></span> | |
| 35 | + </span> | |
| 32 | 36 | </div> |
| 33 | 37 | <div class="actions"> |
| 34 | 38 | <a href="javascirpt:" class="btn btn-circle blue" > | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
| ... | ... | @@ -66,7 +66,8 @@ |
| 66 | 66 | <td> |
| 67 | 67 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 68 | 68 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 69 | - <a ui-sref="schedulePlanInfoManage({spid : info.id})" class="btn default blue-stripe btn-sm"> 排班明细 </a> | |
| 69 | + <a ui-sref="schedulePlanInfoManage({spid : info.id, xlname : info.xl.name, ttname : info.ttInfo.name, stime : info.scheduleFromTime, etime : info.scheduleToTime})" | |
| 70 | + class="btn default blue-stripe btn-sm"> 排班明细 </a> | |
| 70 | 71 | </td> |
| 71 | 72 | </tr> |
| 72 | 73 | </tbody> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanInfoManage.js
| ... | ... | @@ -49,7 +49,16 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['Schedul |
| 49 | 49 | angular.module('ScheduleApp').controller('SchedulePlanInfoManageCtrl', ['SchedulePlanInfoManageService', '$state', '$stateParams', '$scope', function(schedulePlanInfoManageService, $state, $stateParams, $scope) { |
| 50 | 50 | var self = this; |
| 51 | 51 | var spid = $stateParams.spid; // 排班规则id |
| 52 | + var xlname = $stateParams.xlname; // 线路名字 | |
| 53 | + var ttname = $stateParams.ttname; // 时刻表名字 | |
| 54 | + var stime = $stateParams.stime; // 开始时间 | |
| 55 | + var etime = $stateParams.etime; // 结束时间 | |
| 56 | + | |
| 52 | 57 | $scope.spid = spid; |
| 58 | + $scope.xlname = xlname; | |
| 59 | + $scope.ttname = ttname; | |
| 60 | + $scope.stime = stime; | |
| 61 | + $scope.etime = etime; | |
| 53 | 62 | |
| 54 | 63 | // 切换到form状态 |
| 55 | 64 | self.goForm = function() { | ... | ... |
src/main/resources/static/pages/scheduleApp/module/main.js
| ... | ... | @@ -733,7 +733,7 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi |
| 733 | 733 | |
| 734 | 734 | // 排班计划明细管理模块 |
| 735 | 735 | .state("schedulePlanInfoManage", { |
| 736 | - url: '/schedulePlanInfoManage/:spid', | |
| 736 | + url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime', | |
| 737 | 737 | views: { |
| 738 | 738 | "": { |
| 739 | 739 | templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_info.html' |
| ... | ... | @@ -1069,7 +1069,7 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso |
| 1069 | 1069 | return { |
| 1070 | 1070 | rest : $resource( |
| 1071 | 1071 | '/spic/:id', |
| 1072 | - {order: 'scheduleDate', direction: 'ASC', id: '@id_route'}, | |
| 1072 | + {order: 'scheduleDate,lp,fcno', direction: 'ASC', id: '@id_route'}, | |
| 1073 | 1073 | { |
| 1074 | 1074 | list: { |
| 1075 | 1075 | method: 'GET', | ... | ... |