Commit 9f913848b9f184da1a6fc14afc98e3c2d8e2d936
1 parent
4c0aef88
线路值勤日报,修改班次时,跨线路修改班次车提示报警
Showing
6 changed files
with
89 additions
and
1 deletions
src/main/java/com/bsth/controller/schedule/core/CarConfigInfoController.java
| @@ -63,6 +63,20 @@ public class CarConfigInfoController extends BController<CarConfigInfo, Long> { | @@ -63,6 +63,20 @@ public class CarConfigInfoController extends BController<CarConfigInfo, Long> { | ||
| 63 | return rtn; | 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 | @RequestMapping(value = "/validate_cars_gs", method = RequestMethod.GET) | 80 | @RequestMapping(value = "/validate_cars_gs", method = RequestMethod.GET) |
| 67 | public Map<String, Object> validate_cars_gs(HttpServletRequest request, @RequestParam Map<String, Object> param) { | 81 | public Map<String, Object> validate_cars_gs(HttpServletRequest request, @RequestParam Map<String, Object> param) { |
| 68 | HttpSession session = request.getSession(); | 82 | HttpSession session = request.getSession(); |
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
| @@ -10,7 +10,10 @@ import java.util.List; | @@ -10,7 +10,10 @@ import java.util.List; | ||
| 10 | * Created by xu on 16/5/9. | 10 | * Created by xu on 16/5/9. |
| 11 | */ | 11 | */ |
| 12 | public interface CarConfigInfoService extends BService<CarConfigInfo, Long> { | 12 | public interface CarConfigInfoService extends BService<CarConfigInfo, Long> { |
| 13 | + // 判定车辆是否配置在其他线路上 | ||
| 13 | void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException; | 14 | void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException; |
| 15 | + // 判定车辆是否配置在其他线路上2 | ||
| 16 | + void validate_cars(Integer xlId, Integer clId) throws ScheduleException; | ||
| 14 | // 判定车辆是否配置在当前线路中 | 17 | // 判定车辆是否配置在当前线路中 |
| 15 | void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException; | 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<CarConfigInfo, Long> | @@ -130,6 +130,18 @@ public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> | ||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | @Override | 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 | public void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException { | 145 | public void validate_cars_config(CarConfigInfo carConfigInfo) throws ScheduleException { |
| 134 | Map<String, Object> param = new HashMap<>(); | 146 | Map<String, Object> param = new HashMap<>(); |
| 135 | param.put("xl.id_eq", carConfigInfo.getXl().getId()); | 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('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -447,6 +447,18 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', 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 | cc_cars_gs: { // 车辆是否属于当前用户所属公司 | 462 | cc_cars_gs: { // 车辆是否属于当前用户所属公司 |
| 451 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | 463 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 |
| 452 | remote: $resource( // $resource封装对象 | 464 | remote: $resource( // $resource封装对象 |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| @@ -1325,6 +1325,18 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -1325,6 +1325,18 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', 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 | cc_cars_gs: { // 车辆是否属于当前用户所属公司 | 1340 | cc_cars_gs: { // 车辆是否属于当前用户所属公司 |
| 1329 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | 1341 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 |
| 1330 | remote: $resource( // $resource封装对象 | 1342 | remote: $resource( // $resource封装对象 |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
| @@ -65,6 +65,7 @@ | @@ -65,6 +65,7 @@ | ||
| 65 | </div> | 65 | </div> |
| 66 | <!-- 隐藏块,显示验证信息 --> | 66 | <!-- 隐藏块,显示验证信息 --> |
| 67 | <div class="alert alert-danger well-sm" ng-show="myForm.ddr.$error.required"> | 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 | </div> | 70 | </div> |
| 70 | </div> | 71 | </div> |
| @@ -87,6 +88,7 @@ | @@ -87,6 +88,7 @@ | ||
| 87 | </div> | 88 | </div> |
| 88 | <!-- 隐藏块,显示验证信息 --> | 89 | <!-- 隐藏块,显示验证信息 --> |
| 89 | <div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required"> | 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 | 车辆1必须选择 | 92 | 车辆1必须选择 |
| 91 | </div> | 93 | </div> |
| 92 | 94 | ||
| @@ -96,6 +98,7 @@ | @@ -96,6 +98,7 @@ | ||
| 96 | remotevtype="cc_cars_gs" | 98 | remotevtype="cc_cars_gs" |
| 97 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl1.id} | json}}" /> | 99 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl1.id} | json}}" /> |
| 98 | <div class="alert alert-danger well-sm" ng-show="myForm.cl1_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 102 | {{$remote_msg}} |
| 100 | </div> | 103 | </div> |
| 101 | <!-- 分公司权限 --> | 104 | <!-- 分公司权限 --> |
| @@ -109,6 +112,18 @@ | @@ -109,6 +112,18 @@ | ||
| 109 | <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> | 112 | <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> |
| 110 | {{ctrl.cl1_h_fgs_warn}} | 113 | {{ctrl.cl1_h_fgs_warn}} |
| 111 | </div> | 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 | </div> | 127 | </div> |
| 113 | <div class="form-group"> | 128 | <div class="form-group"> |
| 114 | <label class="col-md-5 control-label">车辆2:</label> | 129 | <label class="col-md-5 control-label">车辆2:</label> |
| @@ -133,6 +148,7 @@ | @@ -133,6 +148,7 @@ | ||
| 133 | remotevtype="cc_cars_gs" | 148 | remotevtype="cc_cars_gs" |
| 134 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl2.id} | json}}" /> | 149 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'cl.id_eq': ctrl.formData.cl2.id} | json}}" /> |
| 135 | <div class="alert alert-danger well-sm" ng-show="myForm.cl2_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 152 | {{$remote_msg}} |
| 137 | </div> | 153 | </div> |
| 138 | <!-- 分公司权限 --> | 154 | <!-- 分公司权限 --> |
| @@ -147,6 +163,17 @@ | @@ -147,6 +163,17 @@ | ||
| 147 | {{ctrl.cl2_h_fgs_warn}} | 163 | {{ctrl.cl2_h_fgs_warn}} |
| 148 | </div> | 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 | </div> | 177 | </div> |
| 151 | 178 | ||
| 152 | <div class="form-group has-success has-feedback"> | 179 | <div class="form-group has-success has-feedback"> |
| @@ -168,6 +195,7 @@ | @@ -168,6 +195,7 @@ | ||
| 168 | </div> | 195 | </div> |
| 169 | <!-- 隐藏块,显示验证信息 --> | 196 | <!-- 隐藏块,显示验证信息 --> |
| 170 | <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required"> | 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 | </div> | 200 | </div> |
| 173 | 201 | ||
| @@ -177,6 +205,7 @@ | @@ -177,6 +205,7 @@ | ||
| 177 | remotevtype="ec_jsy_gs" | 205 | remotevtype="ec_jsy_gs" |
| 178 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j1.id} | json}}" /> | 206 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j1.id} | json}}" /> |
| 179 | <div class="alert alert-danger well-sm" ng-show="myForm.j1_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 209 | {{$remote_msg}} |
| 181 | </div> | 210 | </div> |
| 182 | <!-- 分公司权限 --> | 211 | <!-- 分公司权限 --> |
| @@ -216,6 +245,7 @@ | @@ -216,6 +245,7 @@ | ||
| 216 | remotevtype="ec_spy_gs" | 245 | remotevtype="ec_spy_gs" |
| 217 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s1.id} | json}}" /> | 246 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s1.id} | json}}" /> |
| 218 | <div class="alert alert-danger well-sm" ng-show="myForm.s1_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 249 | {{$remote_msg}} |
| 220 | </div> | 250 | </div> |
| 221 | <!-- 分公司权限 --> | 251 | <!-- 分公司权限 --> |
| @@ -254,6 +284,7 @@ | @@ -254,6 +284,7 @@ | ||
| 254 | remotevtype="ec_jsy_gs" | 284 | remotevtype="ec_jsy_gs" |
| 255 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j2.id} | json}}" /> | 285 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j2.id} | json}}" /> |
| 256 | <div class="alert alert-danger well-sm" ng-show="myForm.j2_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 288 | {{$remote_msg}} |
| 258 | </div> | 289 | </div> |
| 259 | <!-- 分公司权限 --> | 290 | <!-- 分公司权限 --> |
| @@ -293,6 +324,7 @@ | @@ -293,6 +324,7 @@ | ||
| 293 | remotevtype="ec_spy_gs" | 324 | remotevtype="ec_spy_gs" |
| 294 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s2.id} | json}}" /> | 325 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s2.id} | json}}" /> |
| 295 | <div class="alert alert-danger well-sm" ng-show="myForm.s2_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 328 | {{$remote_msg}} |
| 297 | </div> | 329 | </div> |
| 298 | <!-- 分公司权限 --> | 330 | <!-- 分公司权限 --> |
| @@ -332,6 +364,7 @@ | @@ -332,6 +364,7 @@ | ||
| 332 | remotevtype="ec_jsy_gs" | 364 | remotevtype="ec_jsy_gs" |
| 333 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j3.id} | json}}" /> | 365 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j3.id} | json}}" /> |
| 334 | <div class="alert alert-danger well-sm" ng-show="myForm.j3_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 368 | {{$remote_msg}} |
| 336 | </div> | 369 | </div> |
| 337 | <!-- 分公司权限 --> | 370 | <!-- 分公司权限 --> |
| @@ -371,6 +404,7 @@ | @@ -371,6 +404,7 @@ | ||
| 371 | remotevtype="ec_spy_gs" | 404 | remotevtype="ec_spy_gs" |
| 372 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s3.id} | json}}" /> | 405 | remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s3.id} | json}}" /> |
| 373 | <div class="alert alert-danger well-sm" ng-show="myForm.s3_h_gs.$error.remote"> | 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 | {{$remote_msg}} | 408 | {{$remote_msg}} |
| 375 | </div> | 409 | </div> |
| 376 | <!-- 分公司权限 --> | 410 | <!-- 分公司权限 --> |
| @@ -399,6 +433,7 @@ | @@ -399,6 +433,7 @@ | ||
| 399 | </div> | 433 | </div> |
| 400 | <!-- 隐藏块,显示验证信息 --> | 434 | <!-- 隐藏块,显示验证信息 --> |
| 401 | <div class="alert alert-danger well-sm" ng-show="myForm.ddrdesc.$error.maxlength"> | 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 | 最大100个字 | 437 | 最大100个字 |
| 403 | </div> | 438 | </div> |
| 404 | </div> | 439 | </div> |
| @@ -443,7 +478,7 @@ | @@ -443,7 +478,7 @@ | ||
| 443 | <div class="col-md-offset-3 col-md-4"> | 478 | <div class="col-md-offset-3 col-md-4"> |
| 444 | <button type="submit" class="btn green" | 479 | <button type="submit" class="btn green" |
| 445 | ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | 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 | </div> | 482 | </div> |
| 448 | </div> | 483 | </div> |
| 449 | </div> | 484 | </div> |