Commit 9f913848b9f184da1a6fc14afc98e3c2d8e2d936

Authored by 徐烜
1 parent 4c0aef88

线路值勤日报,修改班次时,跨线路修改班次车提示报警

src/main/java/com/bsth/controller/schedule/core/CarConfigInfoController.java
... ... @@ -63,6 +63,20 @@ public class CarConfigInfoController extends BController<CarConfigInfo, Long> {
63 63 return rtn;
64 64 }
65 65  
  66 + @RequestMapping(value = "/validate_cars_2", method = RequestMethod.GET)
  67 + public Map<String, Object> validate_cars(@RequestParam Integer xlId, @RequestParam Integer clId) {
  68 + Map<String, Object> rtn = new HashMap<>();
  69 + try {
  70 + carConfigInfoService.validate_cars(xlId, clId);
  71 + rtn.put("status", ResponseCode.SUCCESS);
  72 + } catch (ScheduleException exp) {
  73 + rtn.put("status", ResponseCode.ERROR);
  74 + rtn.put("msg", exp.getMessage());
  75 + }
  76 +
  77 + return rtn;
  78 + }
  79 +
66 80 @RequestMapping(value = "/validate_cars_gs", method = RequestMethod.GET)
67 81 public Map<String, Object> validate_cars_gs(HttpServletRequest request, @RequestParam Map<String, Object> param) {
68 82 HttpSession session = request.getSession();
... ...
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
... ... @@ -10,7 +10,10 @@ import java.util.List;
10 10 * Created by xu on 16/5/9.
11 11 */
12 12 public interface CarConfigInfoService extends BService<CarConfigInfo, Long> {
  13 + // 判定车辆是否配置在其他线路上
13 14 void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException;
  15 + // 判定车辆是否配置在其他线路上2
  16 + void validate_cars(Integer xlId, Integer clId) throws ScheduleException;
14 17 // 判定车辆是否配置在当前线路中
15 18 void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException;
16 19 // 判定车辆所属公司和当前用户的所属公司
... ...
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
... ... @@ -130,6 +130,18 @@ public class CarConfigInfoServiceImpl extends BServiceImpl&lt;CarConfigInfo, Long&gt;
130 130 }
131 131  
132 132 @Override
  133 + public void validate_cars(Integer xlId, Integer clId) throws ScheduleException {
  134 + Map<String, Object> param = new HashMap<>();
  135 + param.put("cl.id_eq", clId);
  136 + List<CarConfigInfo> carConfigInfos = list(param);
  137 + for (CarConfigInfo carConfigInfo : carConfigInfos) {
  138 + if (!carConfigInfo.getXl().getId().equals(xlId)) {
  139 + throw new ScheduleException("车辆不配置在当前线路下,配置在" + carConfigInfo.getXl().getName() + "线路中!");
  140 + }
  141 + }
  142 + }
  143 +
  144 + @Override
133 145 public void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException {
134 146 Map<String, Object> param = new HashMap<>();
135 147 param.put("xl.id_eq", carConfigInfo.getXl().getId());
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
... ... @@ -447,6 +447,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
447 447 }
448 448 )
449 449 },
  450 + cc_cars_2: { // 车辆不能重复配置2
  451 + template: {'xlId': -1, 'clId': -1}, // 查询参数模版
  452 + remote: $resource( // $resource封装对象
  453 + '/cci/validate_cars_2',
  454 + {},
  455 + {
  456 + do: {
  457 + method: 'GET'
  458 + }
  459 + }
  460 + )
  461 + },
450 462 cc_cars_gs: { // 车辆是否属于当前用户所属公司
451 463 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
452 464 remote: $resource( // $resource封装对象
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -1325,6 +1325,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1325 1325 }
1326 1326 )
1327 1327 },
  1328 + cc_cars_2: { // 车辆不能重复配置2
  1329 + template: {'xlId': -1, 'clId': -1}, // 查询参数模版
  1330 + remote: $resource( // $resource封装对象
  1331 + '/cci/validate_cars_2',
  1332 + {},
  1333 + {
  1334 + do: {
  1335 + method: 'GET'
  1336 + }
  1337 + }
  1338 + )
  1339 + },
1328 1340 cc_cars_gs: { // 车辆是否属于当前用户所属公司
1329 1341 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
1330 1342 remote: $resource( // $resource封装对象
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
... ... @@ -65,6 +65,7 @@
65 65 </div>
66 66 <!-- 隐藏块,显示验证信息 -->
67 67 <div class="alert alert-danger well-sm" ng-show="myForm.ddr.$error.required">
  68 + <i class="fa fa-times-circle" aria-hidden="true"></i>
68 69 调度原因必须选择
69 70 </div>
70 71 </div>
... ... @@ -87,6 +88,7 @@
87 88 </div>
88 89 <!-- 隐藏块,显示验证信息 -->
89 90 <div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required">
  91 + <i class="fa fa-times-circle" aria-hidden="true"></i>
90 92 车辆1必须选择
91 93 </div>
92 94  
... ... @@ -96,6 +98,7 @@
96 98 remotevtype="cc_cars_gs"
97 99 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl1.id} | json}}" />
98 100 <div class="alert alert-danger well-sm" ng-show="myForm.cl1_h_gs.$error.remote">
  101 + <i class="fa fa-times-circle" aria-hidden="true"></i>
99 102 {{$remote_msg}}
100 103 </div>
101 104 <!-- 分公司权限 -->
... ... @@ -109,6 +112,18 @@
109 112 <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
110 113 {{ctrl.cl1_h_fgs_warn}}
111 114 </div>
  115 +
  116 + <!-- 车辆配置判定 -->
  117 + <input type="hidden" name="cl1_h_xl" ng-model="ctrl.formData.cl1.id"
  118 + remote-Warn
  119 + remotewtype="cc_cars_2"
  120 + remotewparam="{{ {'xlId': ctrl.xlId, 'clId': ctrl.formData.cl1.id} | json}}"
  121 + remotewmsgprop="cl1_h_xl_warn" />
  122 + <div class="alert alert-warning well-sm" ng-show="ctrl.cl1_h_xl_warn">
  123 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  124 + {{ctrl.cl1_h_xl_warn}}
  125 + </div>
  126 +
112 127 </div>
113 128 <div class="form-group">
114 129 <label class="col-md-5 control-label">车辆2:</label>
... ... @@ -133,6 +148,7 @@
133 148 remotevtype="cc_cars_gs"
134 149 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl2.id} | json}}" />
135 150 <div class="alert alert-danger well-sm" ng-show="myForm.cl2_h_gs.$error.remote">
  151 + <i class="fa fa-times-circle" aria-hidden="true"></i>
136 152 {{$remote_msg}}
137 153 </div>
138 154 <!-- 分公司权限 -->
... ... @@ -147,6 +163,17 @@
147 163 {{ctrl.cl2_h_fgs_warn}}
148 164 </div>
149 165  
  166 + <!-- 车辆配置判定 -->
  167 + <input type="hidden" name="cl2_h_xl" ng-model="ctrl.formData.cl2.id"
  168 + remote-Warn
  169 + remotewtype="cc_cars_2"
  170 + remotewparam="{{ {'xlId': ctrl.xlId, 'clId': ctrl.formData.cl2.id} | json}}"
  171 + remotewmsgprop="cl2_h_xl_warn" />
  172 + <div class="alert alert-warning well-sm" ng-show="ctrl.cl2_h_xl_warn">
  173 + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  174 + {{ctrl.cl2_h_xl_warn}}
  175 + </div>
  176 +
150 177 </div>
151 178  
152 179 <div class="form-group has-success has-feedback">
... ... @@ -168,6 +195,7 @@
168 195 </div>
169 196 <!-- 隐藏块,显示验证信息 -->
170 197 <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">
  198 + <i class="fa fa-times-circle" aria-hidden="true"></i>
171 199 驾驶员必须选择
172 200 </div>
173 201  
... ... @@ -177,6 +205,7 @@
177 205 remotevtype="ec_jsy_gs"
178 206 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j1.id} | json}}" />
179 207 <div class="alert alert-danger well-sm" ng-show="myForm.j1_h_gs.$error.remote">
  208 + <i class="fa fa-times-circle" aria-hidden="true"></i>
180 209 {{$remote_msg}}
181 210 </div>
182 211 <!-- 分公司权限 -->
... ... @@ -216,6 +245,7 @@
216 245 remotevtype="ec_spy_gs"
217 246 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s1.id} | json}}" />
218 247 <div class="alert alert-danger well-sm" ng-show="myForm.s1_h_gs.$error.remote">
  248 + <i class="fa fa-times-circle" aria-hidden="true"></i>
219 249 {{$remote_msg}}
220 250 </div>
221 251 <!-- 分公司权限 -->
... ... @@ -254,6 +284,7 @@
254 284 remotevtype="ec_jsy_gs"
255 285 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j2.id} | json}}" />
256 286 <div class="alert alert-danger well-sm" ng-show="myForm.j2_h_gs.$error.remote">
  287 + <i class="fa fa-times-circle" aria-hidden="true"></i>
257 288 {{$remote_msg}}
258 289 </div>
259 290 <!-- 分公司权限 -->
... ... @@ -293,6 +324,7 @@
293 324 remotevtype="ec_spy_gs"
294 325 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s2.id} | json}}" />
295 326 <div class="alert alert-danger well-sm" ng-show="myForm.s2_h_gs.$error.remote">
  327 + <i class="fa fa-times-circle" aria-hidden="true"></i>
296 328 {{$remote_msg}}
297 329 </div>
298 330 <!-- 分公司权限 -->
... ... @@ -332,6 +364,7 @@
332 364 remotevtype="ec_jsy_gs"
333 365 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j3.id} | json}}" />
334 366 <div class="alert alert-danger well-sm" ng-show="myForm.j3_h_gs.$error.remote">
  367 + <i class="fa fa-times-circle" aria-hidden="true"></i>
335 368 {{$remote_msg}}
336 369 </div>
337 370 <!-- 分公司权限 -->
... ... @@ -371,6 +404,7 @@
371 404 remotevtype="ec_spy_gs"
372 405 remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s3.id} | json}}" />
373 406 <div class="alert alert-danger well-sm" ng-show="myForm.s3_h_gs.$error.remote">
  407 + <i class="fa fa-times-circle" aria-hidden="true"></i>
374 408 {{$remote_msg}}
375 409 </div>
376 410 <!-- 分公司权限 -->
... ... @@ -399,6 +433,7 @@
399 433 </div>
400 434 <!-- 隐藏块,显示验证信息 -->
401 435 <div class="alert alert-danger well-sm" ng-show="myForm.ddrdesc.$error.maxlength">
  436 + <i class="fa fa-times-circle" aria-hidden="true"></i>
402 437 最大100个字
403 438 </div>
404 439 </div>
... ... @@ -443,7 +478,7 @@
443 478 <div class="col-md-offset-3 col-md-4">
444 479 <button type="submit" class="btn green"
445 480 ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
446   - <a type="button" class="btn default" ui-sref="schedulePlanReportExtManage" ><i class="fa fa-times"></i> 取消</a>
  481 + <a type="button" class="btn default" ui-sref="schedulePlanReportExtManage" ><i class="fa fa-times-circle"></i> 取消</a>
447 482 </div>
448 483 </div>
449 484 </div>
... ...