Commit ae6c249c50324cccb31984d5bc6c6ea112cf69c9

Authored by 潘钊
2 parents 6922cf4a a4d55c0f

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

src/main/java/com/bsth/controller/schedule/RerunController.java
... ... @@ -20,7 +20,7 @@ public class RerunController extends BaseController<RerunRule, Long> {
20 20  
21 21 @Override
22 22 public RerunRule findById(@PathVariable("id") Long aLong) {
23   - return super.findById(aLong);
  23 + return rerunRuleRepository.findOneExtend(aLong);
24 24 }
25 25  
26 26 /**
... ... @@ -37,4 +37,5 @@ public class RerunController extends BaseController<RerunRule, Long> {
37 37 return baseService.save(t);
38 38 }
39 39  
  40 +
40 41 }
... ...
src/main/java/com/bsth/entity/schedule/rule/RerunRule.java
... ... @@ -24,8 +24,23 @@ import java.util.Date;
24 24 @NamedAttributeNode("useLp"),
25 25 @NamedAttributeNode("useCarConfig"),
26 26 @NamedAttributeNode("useEmployeeConfig")
  27 +
  28 + // TODO:subgraph貌似没有用,再议
  29 +// subgraphs = {
  30 +// @NamedSubgraph(name = "useCarConfig", attributeNodes = {
  31 +// @NamedAttributeNode("xl"),
  32 +// @NamedAttributeNode("cl")
  33 +// }),
  34 +// @NamedSubgraph(name = "useEmployeeConfig", attributeNodes = {
  35 +// @NamedAttributeNode("jsy"),
  36 +// @NamedAttributeNode("spy"),
  37 +// @NamedAttributeNode("xl")
  38 +// })
  39 +// }
27 40 })
28 41 })
  42 +
  43 +
29 44 public class RerunRule {
30 45 /** 主键Id */
31 46 @Id
... ... @@ -65,6 +80,10 @@ public class RerunRule {
65 80 @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
66 81 private EmployeeConfigInfo useEmployeeConfig;
67 82  
  83 + /** 是否删除(标记) */
  84 + @Column(nullable = false)
  85 + private Boolean isCancel = false;
  86 +
68 87 /** 创建人 */
69 88 @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
70 89 private SysUser createBy;
... ... @@ -186,6 +205,14 @@ public class RerunRule {
186 205 return updateDate;
187 206 }
188 207  
  208 + public Boolean getIsCancel() {
  209 + return isCancel;
  210 + }
  211 +
  212 + public void setIsCancel(Boolean isCancel) {
  213 + this.isCancel = isCancel;
  214 + }
  215 +
189 216 public void setUpdateDate(Date updateDate) {
190 217 this.updateDate = updateDate;
191 218 }
... ...
src/main/java/com/bsth/service/schedule/RerunServiceImpl.java
1 1 package com.bsth.service.schedule;
2 2  
  3 +import com.bsth.common.ResponseCode;
3 4 import com.bsth.entity.schedule.rule.RerunRule;
  5 +import com.bsth.repository.schedule.RerunRuleRepository;
4 6 import com.bsth.service.impl.BaseServiceImpl;
  7 +import org.springframework.beans.factory.annotation.Autowired;
5 8 import org.springframework.stereotype.Service;
6 9  
  10 +import javax.transaction.Transactional;
  11 +import java.util.HashMap;
  12 +import java.util.Map;
  13 +
7 14 /**
8 15 * Created by xu on 16/10/20.
9 16 */
10 17 @Service
11 18 public class RerunServiceImpl extends BaseServiceImpl<RerunRule, Long> implements RerunService {
  19 +
  20 + @Autowired
  21 + private RerunRuleRepository rerunRuleRepository;
  22 +
  23 + @Override
  24 + @Transactional
  25 + public Map<String, Object> delete(Long aLong) {
  26 + // 获取带作废的数据
  27 + RerunRule rerunRule = rerunRuleRepository.findOne(aLong);
  28 +
  29 + toogleIsCancel(rerunRule);
  30 +
  31 + Map<String, Object> map = new HashMap<>();
  32 + map.put("status", ResponseCode.SUCCESS);
  33 +
  34 + return map;
  35 +
  36 + }
  37 +
  38 + /**
  39 + * 撤销/作废切换。
  40 + * @param rerunRule
  41 + */
  42 + private void toogleIsCancel(RerunRule rerunRule) {
  43 + boolean isCancel = rerunRule.getIsCancel();
  44 + if (isCancel) {
  45 + rerunRule.setIsCancel(false);
  46 + } else {
  47 + rerunRule.setIsCancel(true);
  48 + }
  49 + }
12 50 }
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -309,7 +309,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;rerunManageService_g&#39;, [&#39;$resource&#39;, func
309 309 return {
310 310 rest: $resource(
311 311 'rms/:id',
312   - {order: 'rerunXl.name,createDate', direction: 'DESC', id: '@id_route'},
  312 + {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id_route'},
313 313 {
314 314 list: {
315 315 method: 'GET',
... ...
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/detail.html
1 1 <div class="page-head">
2 2 <div class="page-title">
3   - <h1>排班规则管理</h1>
  3 + <h1>套跑管理</h1>
4 4 </div>
5 5 </div>
6 6  
... ... @@ -14,20 +14,19 @@
14 14 <i class="fa fa-circle"></i>
15 15 </li>
16 16 <li>
17   - <a ui-sref="scheduleRuleManage">排班规则管理</a>
  17 + <a ui-sref="rerunManage">套跑管理</a>
18 18 <i class="fa fa-circle"></i>
19 19 </li>
20 20 <li>
21   - <span class="active">排班规则详细信息</span>
  21 + <span class="active">套跑详细信息</span>
22 22 </li>
23 23 </ul>
24 24  
25   -<div class="portlet light bordered" ng-controller="ScheduleRuleManageDetailCtrl as ctrl">
  25 +<div class="portlet light bordered" ng-controller="RerunManageDetailCtrl as ctrl">
26 26 <div class="portlet-title">
27 27 <div class="caption">
28 28 <i class="icon-equalizer font-red-sunglo"></i> <span
29   - class="caption-subject font-red-sunglo bold uppercase"
30   - ng-bind="ctrl.title"></span>
  29 + class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title"></span>
31 30 </div>
32 31 </div>
33 32  
... ... @@ -44,73 +43,90 @@
44 43 <div class="form-group has-success has-feedback">
45 44 <label class="col-md-2 control-label">线路*:</label>
46 45 <div class="col-md-3">
47   - <input type="text" class="form-control"
48   - name="xl" ng-model="ctrl.scheduleRuleManageForDetail.xl.name" readonly/>
  46 + <input type="text" name="rerunXl" class="form-control" ng-value="ctrl.rerunManageForDetail.rerunXl.name" readonly />
49 47 </div>
50 48 </div>
51   -
52 49 <div class="form-group has-success has-feedback">
53   - <label class="col-md-2 control-label">车辆*:</label>
  50 + <label class="col-md-2 control-label">时刻表*:</label>
54 51 <div class="col-md-3">
55   - <input type="text" class="form-control" name="cl"
56   - ng-model="ctrl.scheduleRuleManageForDetail.carConfigInfo.cl.insideCode" readonly/>
  52 + <input type="text" name="rerunTtinfo" class="form-control" ng-value="ctrl.rerunManageForDetail.rerunTtinfo.name" readonly/>
57 53 </div>
58 54 </div>
59   -
60 55 <div class="form-group has-success has-feedback">
61   - <label class="col-md-2 control-label">启用日期*:</label>
62   - <div class="col-md-4">
63   - <input type="text" class="form-control"
64   - name="qyrq" uib-datepicker-popup="yyyy年MM月dd日"
65   - ng-model="ctrl.scheduleRuleManageForDetail.qyrq" readonly/>
  56 + <label class="col-md-2 control-label">路牌*:</label>
  57 + <div class="col-md-3">
  58 + <input type="text" name="rerunLp" class="form-control" ng-value="ctrl.rerunManageForDetail.rerunLp.lpName" readonly/>
66 59 </div>
67 60 </div>
68 61  
69 62 <div class="form-group has-success has-feedback">
70   - <label class="col-md-2 control-label">路牌范围*:</label>
71   - <div class="col-md-4">
72   - <input type="text" class="form-control"
73   - ng-model="ctrl.scheduleRuleManageForDetail.lpNames" readonly/>
  63 + <label class="col-md-2 control-label">套跑班次*:</label>
  64 + <div class="col-md-6">
  65 + <sa-Bcgroup model="ctrl.rerunManageForDetail"
  66 + name="rerunTtinfodetailIds"
  67 + dataparams="{{ {'xlId': ctrl.rerunManageForDetail.rerunXl.id, 'ttinfoId' : ctrl.rerunManageForDetail.rerunTtinfo.id, 'lpId' : ctrl.rerunManageForDetail.rerunLp.id} | json }}"
  68 + bcttinfoidsvalue="{{ctrl.rerunManageForDetail.rerunTtinfodetailIds}}"
  69 + bcttinfoidsname="rerunTtinfodetailIds"
  70 + required >
  71 + </sa-Bcgroup>
  72 + </div>
  73 + <div class="alert alert-danger well-sm" ng-show="myForm.rerunTtinfodetailIds.$error.required">
  74 + 套跑班次必须选择
74 75 </div>
75 76 </div>
76 77  
77 78 <div class="form-group has-success has-feedback">
78   - <label class="col-md-2 control-label">起始路牌*:</label>
79   - <div class="col-md-4">
80   - <input type="text" class="form-control"
81   - ng-model="ctrl.scheduleRuleManageForDetail.lpStart" readonly/>
  79 + <label class="col-md-2 control-label">套跑类型*:</label>
  80 + <div class="col-md-3">
  81 + <sa-Radiogroup model="ctrl.rerunManageForDetail.rerunType" dicgroup="rerunType" name="rerunType" disabled="true"></sa-Radiogroup>
82 82 </div>
83 83 </div>
84 84  
85   - <div class="form-group has-success has-feedback">
86   - <label class="col-md-2 control-label">人员范围*:</label>
87   - <div class="col-md-4">
88   - <input type="text" class="form-control"
89   - ng-model="ctrl.scheduleRuleManageForDetail.ryDbbms" readonly/>
  85 + <div class="form-group has-success has-feedback"
  86 + ng-if="ctrl.rerunManageForDetail.rerunType == 'dylp'">
  87 + <label class="col-md-2 control-label">线路2*:</label>
  88 + <div class="col-md-3">
  89 + <input type="text" name="useXl" class="form-control" ng-value="ctrl.rerunManageForDetail.useXl.name" readonly/>
  90 + </div>
  91 + </div>
  92 + <div class="form-group has-success has-feedback"
  93 + ng-if="ctrl.rerunManageForDetail.rerunType == 'dylp'">
  94 + <label class="col-md-2 control-label">路牌*:</label>
  95 + <div class="col-md-3">
  96 + <input type="text" name="useLp" class="form-control" ng-value="ctrl.rerunManageForDetail.useLp.lpName" readonly/>
90 97 </div>
91 98 </div>
92 99  
93   - <div class="form-group has-success has-feedback">
94   - <label class="col-md-2 control-label">起始人员*:</label>
95   - <div class="col-md-4">
96   - <input type="text" class="form-control"
97   - ng-model="ctrl.scheduleRuleManageForDetail.ryStart" readonly/>
  100 +
  101 + <div class="form-group has-success has-feedback"
  102 + ng-if="ctrl.rerunManageForDetail.rerunType == 'dybc'">
  103 + <label class="col-md-2 control-label">车辆配置*:</label>
  104 + <div class="col-md-3">
  105 + <input type="text" name="useCarConfig" class="form-control" ng-value="ctrl.rerunManageForDetail.useCarConfig.cl.insideCode" readonly/>
98 106 </div>
99 107 </div>
100 108  
101   - <div class="form-group">
102   - <label class="col-md-2 control-label">翻班格式:</label>
103   - <div class="col-md-4">
104   - <input type="text" class="form-control"
105   - ng-model="ctrl.scheduleRuleManageForDetail.fbgs" readonly/>
  109 + <div class="form-group has-success has-feedback"
  110 + ng-if="ctrl.rerunManageForDetail.rerunType == 'dybc'">
  111 + <label class="col-md-2 control-label">人员配置-驾驶员*:</label>
  112 + <div class="col-md-3">
  113 + <input type="text" name="useEmployeeConfig_jsy" class="form-control" ng-value="ctrl.rerunManageForDetail.useEmployeeConfig.jsy.personnelName + '-' + ctrl.rerunManageForDetail.useEmployeeConfig.jsy.jobCode" readonly/>
106 114 </div>
107 115 </div>
108 116  
109   - <!-- 其他form-group -->
  117 + <div class="form-group has-success has-feedback"
  118 + ng-if="ctrl.rerunManageForDetail.rerunType == 'dybc'">
  119 + <label class="col-md-2 control-label">人员配置-售票员*:</label>
  120 + <div class="col-md-3">
  121 + <input type="text" name="useEmployeeConfig_spy" class="form-control" ng-value="ctrl.rerunManageForDetail.useEmployeeConfig.spy.personnelName + '-' + ctrl.rerunManageForDetail.useEmployeeConfig.spy.jobCode" readonly/>
  122 + </div>
  123 + </div>
110 124  
111 125 </div>
112 126  
113 127 </form>
114 128  
115 129 </div>
  130 +
  131 +
116 132 </div>
117 133 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/edit.html
... ... @@ -69,7 +69,7 @@
69 69 cmaps="{'rerunTtinfo.id' : 'id'}"
70 70 dcname="rerunTtinfo.id"
71 71 icname="id"
72   - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id}, atype:'ttInfo' } | json }}"
  72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false}, atype:'ttInfo' } | json }}"
73 73 dsparamsextra="{'type':'all'}"
74 74 iterobjname="item"
75 75 iterobjexp="item.name + '-' + item.xl.name"
... ... @@ -183,7 +183,7 @@
183 183 cmaps="{'useCarConfig.id' : 'id'}"
184 184 dcname="useCarConfig.id"
185 185 icname="id"
186   - dsparams="{{ {type: 'ajax', param:{'type': 'all'}, atype:'cci2' } | json }}"
  186 + dsparams="{{ {type: 'ajax', param:{'type': 'all', 'isCancel_eq': false}, atype:'cci2' } | json }}"
187 187 iterobjname="item"
188 188 iterobjexp="item.cl.insideCode + '-' + item.xl.name"
189 189 searchph="请输拼音..."
... ... @@ -205,7 +205,7 @@
205 205 cmaps="{'useEmployeeConfig.id' : 'id'}"
206 206 dcname="useEmployeeConfig.id"
207 207 icname="id"
208   - dsparams="{{ {type: 'ajax', param:{'type': 'all'}, atype:'eci3' } | json }}"
  208 + dsparams="{{ {type: 'ajax', param:{'type': 'all', 'isCancel_eq': false}, atype:'eci3' } | json }}"
209 209 iterobjname="item"
210 210 iterobjexp="item.xl.name + '---' + '驾:' + item.jsy.personnelName + '<' + item.jsy.jobCode + '>' + ' ' + (item.spy == null ? ' ' : ('售:' + item.spy.personnelName + '<' + item.spy.jobCode + '>'))"
211 211 searchph="请输拼音..."
... ...
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/form.html
... ... @@ -69,7 +69,7 @@
69 69 cmaps="{'rerunTtinfo.id' : 'id'}"
70 70 dcname="rerunTtinfo.id"
71 71 icname="id"
72   - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id}, atype:'ttInfo' } | json }}"
  72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false}, atype:'ttInfo' } | json }}"
73 73 dsparamsextra="{'type':'all'}"
74 74 iterobjname="item"
75 75 iterobjexp="item.name + '-' + item.xl.name"
... ... @@ -183,7 +183,7 @@
183 183 cmaps="{'useCarConfig.id' : 'id'}"
184 184 dcname="useCarConfig.id"
185 185 icname="id"
186   - dsparams="{{ {type: 'ajax', param:{'type': 'all'}, atype:'cci2' } | json }}"
  186 + dsparams="{{ {type: 'ajax', param:{'type': 'all', 'isCancel_eq': false}, atype:'cci2' } | json }}"
187 187 iterobjname="item"
188 188 iterobjexp="item.cl.insideCode + '-' + item.xl.name"
189 189 searchph="请输拼音..."
... ... @@ -205,7 +205,7 @@
205 205 cmaps="{'useEmployeeConfig.id' : 'id'}"
206 206 dcname="useEmployeeConfig.id"
207 207 icname="id"
208   - dsparams="{{ {type: 'ajax', param:{'type': 'all'}, atype:'eci3' } | json }}"
  208 + dsparams="{{ {type: 'ajax', param:{'type': 'all', 'isCancel_eq': false}, atype:'eci3' } | json }}"
209 209 iterobjname="item"
210 210 iterobjexp="item.xl.name + '---' + '驾:' + item.jsy.personnelName + '<' + item.jsy.jobCode + '>' + ' ' + (item.spy == null ? ' ' : ('售:' + item.spy.personnelName + '<' + item.spy.jobCode + '>'))"
211 211 searchph="请输拼音..."
... ...
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/list.html
... ... @@ -5,12 +5,12 @@
5 5 <tr role="row" class="heading">
6 6 <th style="width: 5%;">序号</th>
7 7 <th style="width: 15%;">套跑线路</th>
8   - <th style="width: 15%;">套跑路牌</th>
  8 + <th style="width: 100px">套跑路牌</th>
9 9 <th style="width: 10%;">时刻表</th>
10 10 <th style="width: 10%;">线路</th>
11   - <th>路牌</th>
12   - <th>车辆</th>
13   - <th>套跑类型</th>
  11 + <th style="width: 100px">路牌</th>
  12 + <th width="100px">车辆</th>
  13 + <th width="100px">套跑类型</th>
14 14 <th style="width: 21%">操作</th>
15 15 </tr>
16 16 <tr role="row" class="filter">
... ... @@ -19,8 +19,8 @@
19 19 <sa-Select3 model="ctrl.searchCondition()"
20 20 name="xl"
21 21 placeholder="请输拼音..."
22   - dcvalue="{{ctrl.searchCondition()['xl.id_eq']}}"
23   - dcname="xl.id_eq"
  22 + dcvalue="{{ctrl.searchCondition()['rerunXl.id_eq']}}"
  23 + dcname="rerunXl.id_eq"
24 24 icname="id"
25 25 icnames="name"
26 26 datatype="xl">
... ... @@ -45,7 +45,7 @@
45 45 </tr>
46 46 </thead>
47 47 <tbody>
48   - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX">
  48 + <tr ng-repeat="info in ctrl.pageInfo.infos" ng-class="{odd: true, gradeX: true, danger: info.isCancel}">
49 49 <td>
50 50 <span ng-bind="$index + 1"></span>
51 51 </td>
... ... @@ -68,15 +68,16 @@
68 68 <span ng-bind="info.useCarConfig.cl.insideCode"></span>
69 69 </td>
70 70 <td>
71   - <span ng-bind="info.useLp.rerunType | dict:'rerunType':'未知' "></span>
  71 + <span ng-bind="info.rerunType | dict:'rerunType':'未知' "></span>
72 72 </td>
73 73  
74 74 <td>
75 75 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
76 76 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
77 77 <a ui-sref="rerunManage_detail({id : info.id})" class="btn default blue-stripe btn-sm"> 详细 </a>
78   - <a ui-sref="rerunManage_edit({id : info.id})" class="btn default blue-stripe btn-sm"> 修改 </a>
79   - <a ng-click="ctrl.deleteRule(info.id)" class="btn default blue-stripe btn-sm"> 删除 </a>
  78 + <a ui-sref="rerunManage_edit({id : info.id})" class="btn default blue-stripe btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>
  79 + <a ng-click="ctrl.toggleRerun(info.id)" class="btn default blue-stripe btn-sm" ng-if="info.isCancel == '0'"> 作废 </a>
  80 + <a ng-click="ctrl.toggleRerun(info.id)" class="btn default blue-stripe btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>
80 81 </td>
81 82 </tr>
82 83 </tbody>
... ...
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/main.js
... ... @@ -131,29 +131,35 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;RerunManageListCtrl&#39;, [&#39;RerunManageSer
131 131 self.pageChanaged();
132 132 };
133 133  
134   - // 删除规则
135   - self.deleteRule = function(id) {
  134 + // 作废/撤销
  135 + self.toggleRerun = function(id) {
  136 + // TODO:
136 137 rerunManageService.deleteDetail(id).then(
137 138 function(result) {
138   - alert("删除成功!");
139   -
140   - rerunManageService.getPage().then(
141   - function(result) {
142   - self.pageInfo.totalItems = result.totalElements;
143   - self.pageInfo.currentPage = result.number + 1;
144   - self.pageInfo.infos = result.content;
145   - rerunManageService.setCurrentPageNo(result.number + 1);
146   - },
147   - function(result) {
148   - alert("出错啦!");
149   - }
150   - );
  139 + if (result.message) { // 暂时这样做,之后全局拦截
  140 + alert("失败:" + result.message);
  141 + } else {
  142 + alert("成功!");
  143 +
  144 + rerunManageService.getPage().then(
  145 + function(result) {
  146 + self.pageInfo.totalItems = result.totalElements;
  147 + self.pageInfo.currentPage = result.number + 1;
  148 + self.pageInfo.infos = result.content;
  149 + rerunManageService.setCurrentPageNo(result.number + 1);
  150 + },
  151 + function(result) {
  152 + alert("出错啦!");
  153 + }
  154 + );
  155 + }
  156 +
151 157 },
152 158 function(result) {
153   - alert("出错啦!");
  159 + alert("出错啦!" + result);
154 160 }
155 161 );
156   - }
  162 + };
157 163  
158 164 }]);
159 165  
... ... @@ -203,9 +209,17 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;RerunManageFormCtrl&#39;, [&#39;RerunManageSer
203 209 if (self.rerunManageForSave.rerunType == 'dylp') {
204 210 delete self.rerunManageForSave.useCarConfig;
205 211 delete self.rerunManageForSave.useEmployeeConfig;
  212 +
  213 + // 关联对象只取id
  214 + self.rerunManageForSave.useXl = {id: self.rerunManageForSave.useXl.id};
  215 + self.rerunManageForSave.useLp = {id: self.rerunManageForSave.useLp.id}
206 216 } else if (self.rerunManageForSave.rerunType == 'dybc') {
207 217 delete self.rerunManageForSave.useXl;
208 218 delete self.rerunManageForSave.useLp;
  219 +
  220 + // 关联对象只取id
  221 + self.rerunManageForSave.useCarConfig = {id: self.rerunManageForSave.useCarConfig.id};
  222 + self.rerunManageForSave.useEmployeeConfig = {id: self.rerunManageForSave.useEmployeeConfig.id};
209 223 } else {
210 224 return;
211 225 }
... ...