Commit 10aea61f61e2f02ae78c9231ed209822eb2a6f5a

Authored by 徐烜
1 parent f55db84b

1、车辆设备管理,只有新增,没有修改、作废,启用日期使用保存的时间

2、调度值勤日报,修改人员时,后台加入人员是否配置在当前线路下的检测,前台使用remoteValidate指令检测
src/main/java/com/bsth/controller/schedule/core/EmployeeConfigInfoController.java
... ... @@ -70,6 +70,27 @@ public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo
70 70 return rtn;
71 71 }
72 72  
  73 + @RequestMapping(value = "/validate_jsy_config", method = RequestMethod.GET)
  74 + public Map<String, Object> validate_jsy_config(@RequestParam Map<String, Object> param) {
  75 + Map<String, Object> rtn = new HashMap<>();
  76 + try {
  77 + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  78 + null,
  79 + param.get("xl.id_eq"),
  80 + param.get("xl.name_eq"),
  81 + param.get("jsy.id_eq"),
  82 + null
  83 + );
  84 + employeeConfigInfoService.validate_jsy_config(employeeConfigInfo);
  85 + rtn.put("status", ResponseCode.SUCCESS);
  86 + } catch (ScheduleException exp) {
  87 + rtn.put("status", ResponseCode.ERROR);
  88 + rtn.put("msg", exp.getMessage());
  89 + }
  90 +
  91 + return rtn;
  92 + }
  93 +
73 94 @RequestMapping(value = "/validate_spy", method = RequestMethod.GET)
74 95 public Map<String, Object> validate_spy(@RequestParam Map<String, Object> param) {
75 96 Map<String, Object> rtn = new HashMap<>();
... ... @@ -89,4 +110,24 @@ public class EmployeeConfigInfoController extends BController&lt;EmployeeConfigInfo
89 110 }
90 111 return rtn;
91 112 }
  113 +
  114 + @RequestMapping(value = "/validate_spy_config", method = RequestMethod.GET)
  115 + public Map<String, Object> validate_spy_config(@RequestParam Map<String, Object> param) {
  116 + Map<String, Object> rtn = new HashMap<>();
  117 + try {
  118 + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  119 + null,
  120 + param.get("xl.id_eq"),
  121 + param.get("xl.name_eq"),
  122 + null,
  123 + param.get("spy.id_eq")
  124 + );
  125 + employeeConfigInfoService.validate_spy_config(employeeConfigInfo);
  126 + rtn.put("status", ResponseCode.SUCCESS);
  127 + } catch (ScheduleException exp) {
  128 + rtn.put("status", ResponseCode.ERROR);
  129 + rtn.put("msg", exp.getMessage());
  130 + }
  131 + return rtn;
  132 + }
92 133 }
... ...
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoService.java
... ... @@ -7,8 +7,14 @@ import com.bsth.service.schedule.exception.ScheduleException;
7 7 * Created by xu on 16/5/10.
8 8 */
9 9 public interface EmployeeConfigInfoService extends BService<EmployeeConfigInfo, Long> {
  10 + // 验证驾驶员配置是否重复配置
10 11 void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  12 + // 验证售票员配置是否重复配置
11 13 void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  14 + // 验证驾驶员是否配置在指定线路
  15 + void validate_jsy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  16 + // 验证售票员是否配置在指定线路
  17 + void validate_spy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
12 18 void toggleCancel(Long id) throws ScheduleException;
13 19 Long getMaxDbbm(Integer xlId);
14 20 }
... ...
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
... ... @@ -100,6 +100,18 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
100 100  
101 101 @Transactional
102 102 @Override
  103 + public void validate_jsy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
  104 + Map<String, Object> param = new HashMap<>();
  105 + param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
  106 + param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId());
  107 + List<EmployeeConfigInfo> employeeConfigInfos = list(param);
  108 + if (CollectionUtils.isEmpty(employeeConfigInfos)) {
  109 + throw new ScheduleException("驾驶员没有配置在当前线路中,不属于当前线路!");
  110 + }
  111 + }
  112 +
  113 + @Transactional
  114 + @Override
103 115 public void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
104 116 // 售票员不能重复配置
105 117 Map<String, Object> param = new HashMap<>();
... ... @@ -127,6 +139,18 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
127 139  
128 140 @Transactional
129 141 @Override
  142 + public void validate_spy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
  143 + Map<String, Object> param = new HashMap<>();
  144 + param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
  145 + param.put("spy.id_eq", employeeConfigInfo.getSpy().getId());
  146 + List<EmployeeConfigInfo> employeeConfigInfos = list(param);
  147 + if (CollectionUtils.isEmpty(employeeConfigInfos)) {
  148 + throw new ScheduleException("售票员没有配置在当前线路中,不属于当前线路!");
  149 + }
  150 + }
  151 +
  152 + @Transactional
  153 + @Override
130 154 public void delete(Long aLong) throws ScheduleException {
131 155 toggleCancel(aLong);
132 156 }
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
... ... @@ -166,26 +166,26 @@
166 166 <!--</div>-->
167 167 <!--</div>-->
168 168  
169   - <div class="form-group has-success has-feedback">
170   - <label class="col-md-2 control-label">启用日期:</label>
171   - <div class="col-md-3">
172   - <div class="input-group">
173   - <input type="datetime-local" class="form-control" name="qyrq"
174   - ng-model="ctrl.deviceInfoForSave.qyrq" required
175   - remote-Validation
176   - remotevtype="cde1"
177   - remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}" />
178   -
179   - </div>
180   - </div>
181   - <!-- 隐藏块,显示验证信息 -->
182   - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
183   - 启用日期必须选择,精确到具体时间
184   - </div>
185   - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">
186   - {{$remote_msg}}
187   - </div>
188   - </div>
  169 + <!--<div class="form-group has-success has-feedback">-->
  170 + <!--<label class="col-md-2 control-label">启用日期:</label>-->
  171 + <!--<div class="col-md-3">-->
  172 + <!--<div class="input-group">-->
  173 + <!--<input type="datetime-local" class="form-control" name="qyrq"-->
  174 + <!--ng-model="ctrl.deviceInfoForSave.qyrq" required-->
  175 + <!--remote-Validation-->
  176 + <!--remotevtype="cde1"-->
  177 + <!--remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}" />-->
  178 +
  179 + <!--</div>-->
  180 + <!--</div>-->
  181 + <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->
  182 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">-->
  183 + <!--启用日期必须选择,精确到具体时间-->
  184 + <!--</div>-->
  185 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">-->
  186 + <!--{{$remote_msg}}-->
  187 + <!--</div>-->
  188 + <!--</div>-->
189 189  
190 190 <!-- 其他form-group -->
191 191  
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
... ... @@ -101,13 +101,13 @@
101 101 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
102 102 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
103 103 <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
104   - <a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>
105   - <a sweetalert
106   - sweet-options="{title: '是否作废车辆设备历史信息?',text: '内部编号:' + info.clZbh, html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
107   - sweet-on-confirm="ctrl.toggleCarDevice(info.id)"
108   - class="btn btn-danger btn-sm"
109   - ng-if="info.isCancel == '0'">作废</a>
110   - <a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>
  104 + <!--<a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>-->
  105 + <!--<a sweetalert-->
  106 + <!--sweet-options="{title: '是否作废车辆设备历史信息?',text: '内部编号:' + info.clZbh, html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"-->
  107 + <!--sweet-on-confirm="ctrl.toggleCarDevice(info.id)"-->
  108 + <!--class="btn btn-danger btn-sm"-->
  109 + <!--ng-if="info.isCancel == '0'">作废</a>-->
  110 + <!--<a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>-->
111 111 </td>
112 112 </tr>
113 113 </tbody>
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
... ... @@ -163,6 +163,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
163 163 // 提交方法
164 164 self.submit = function() {
165 165 console.log(self.deviceInfoForSave);
  166 + // 修改逻辑,只有新增,没有修改,作废,启用日期就是保存的日期
  167 + self.deviceInfoForSave.qyrq = new Date().getTime();
166 168  
167 169 // 保存或者更新
168 170 self.deviceInfoForSave.$save(function() {
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
... ... @@ -453,6 +453,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
453 453 }
454 454 )
455 455 },
  456 + ec_jsy_config: { // 驾驶员是否配置在指定线路中
  457 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  458 + remote: $resource( // $resource封装对象
  459 + '/eci/validate_jsy_config',
  460 + {},
  461 + {
  462 + do: {
  463 + method: 'GET'
  464 + }
  465 + }
  466 + )
  467 + },
456 468 ec_spy: { // 售票员不能重复配置
457 469 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
458 470 remote: $resource( // $resource封装对象
... ... @@ -465,6 +477,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
465 477 }
466 478 )
467 479 },
  480 + ec_spy_config: { // 售票员是否配置在指定线路中
  481 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  482 + remote: $resource( // $resource封装对象
  483 + '/eci/validate_spy_config',
  484 + {},
  485 + {
  486 + do: {
  487 + method: 'GET'
  488 + }
  489 + }
  490 + )
  491 + },
468 492  
469 493 cde1: { // 车辆设备启用日期验证
470 494 template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -1331,6 +1331,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1331 1331 }
1332 1332 )
1333 1333 },
  1334 + ec_jsy_config: { // 驾驶员是否配置在指定线路中
  1335 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  1336 + remote: $resource( // $resource封装对象
  1337 + '/eci/validate_jsy_config',
  1338 + {},
  1339 + {
  1340 + do: {
  1341 + method: 'GET'
  1342 + }
  1343 + }
  1344 + )
  1345 + },
1334 1346 ec_spy: { // 售票员不能重复配置
1335 1347 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
1336 1348 remote: $resource( // $resource封装对象
... ... @@ -1343,6 +1355,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1343 1355 }
1344 1356 )
1345 1357 },
  1358 + ec_spy_config: { // 售票员是否配置在指定线路中
  1359 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  1360 + remote: $resource( // $resource封装对象
  1361 + '/eci/validate_spy_config',
  1362 + {},
  1363 + {
  1364 + do: {
  1365 + method: 'GET'
  1366 + }
  1367 + }
  1368 + )
  1369 + },
1346 1370  
1347 1371 cde1: { // 车辆设备启用日期验证
1348 1372 template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
... ... @@ -129,6 +129,14 @@
129 129 <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">
130 130 驾驶员必须选择
131 131 </div>
  132 +
  133 + <input type="hidden" name="j1_h" ng-model="ctrl.formData.j1.id"
  134 + remote-Validation
  135 + remotevtype="ec_jsy_config"
  136 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j1.id} | json}}" />
  137 + <div class="alert alert-danger well-sm" ng-show="myForm.j1_h.$error.remote">
  138 + {{$remote_msg}}
  139 + </div>
132 140 </div>
133 141  
134 142 <div class="form-group">
... ... @@ -147,6 +155,14 @@
147 155 >
148 156 </sa-Select5>
149 157 </div>
  158 +
  159 + <input type="hidden" name="s1_h" ng-model="ctrl.formData.s1.id"
  160 + remote-Validation
  161 + remotevtype="ec_spy_config"
  162 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s1.id} | json}}" />
  163 + <div class="alert alert-danger well-sm" ng-show="myForm.s1_h.$error.remote">
  164 + {{$remote_msg}}
  165 + </div>
150 166 </div>
151 167  
152 168 <div class="form-group">
... ... @@ -165,6 +181,14 @@
165 181 >
166 182 </sa-Select5>
167 183 </div>
  184 +
  185 + <input type="hidden" name="j2_h" ng-model="ctrl.formData.j2.id"
  186 + remote-Validation
  187 + remotevtype="ec_jsy_config"
  188 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j2.id} | json}}" />
  189 + <div class="alert alert-danger well-sm" ng-show="myForm.j2_h.$error.remote">
  190 + {{$remote_msg}}
  191 + </div>
168 192 </div>
169 193  
170 194 <div class="form-group">
... ... @@ -183,6 +207,14 @@
183 207 >
184 208 </sa-Select5>
185 209 </div>
  210 +
  211 + <input type="hidden" name="s2_h" ng-model="ctrl.formData.s2.id"
  212 + remote-Validation
  213 + remotevtype="ec_spy_config"
  214 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s2.id} | json}}" />
  215 + <div class="alert alert-danger well-sm" ng-show="myForm.s2_h.$error.remote">
  216 + {{$remote_msg}}
  217 + </div>
186 218 </div>
187 219  
188 220 <div class="form-group">
... ... @@ -201,6 +233,14 @@
201 233 >
202 234 </sa-Select5>
203 235 </div>
  236 +
  237 + <input type="hidden" name="j3_h" ng-model="ctrl.formData.j3.id"
  238 + remote-Validation
  239 + remotevtype="ec_jsy_config"
  240 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j3.id} | json}}" />
  241 + <div class="alert alert-danger well-sm" ng-show="myForm.j3_h.$error.remote">
  242 + {{$remote_msg}}
  243 + </div>
204 244 </div>
205 245  
206 246 <div class="form-group">
... ... @@ -219,6 +259,14 @@
219 259 >
220 260 </sa-Select5>
221 261 </div>
  262 +
  263 + <input type="hidden" name="s3_h" ng-model="ctrl.formData.s3.id"
  264 + remote-Validation
  265 + remotevtype="ec_spy_config"
  266 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s3.id} | json}}" />
  267 + <div class="alert alert-danger well-sm" ng-show="myForm.s3_h.$error.remote">
  268 + {{$remote_msg}}
  269 + </div>
222 270 </div>
223 271  
224 272 <div class="form-group">
... ...