Commit f315d0e70f1007807ae84d3f8464801b30466a63

Authored by 徐烜
1 parent a2a66ec8

浦东公交计划调度功能优化

1、修改EmployeeConfigInfoServiceImpl,修正人员配置提示逻辑,判断人员配置时,已作废的不判断,每个人员都要判断驾驶员和售票员是否配置过
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
... ... @@ -116,15 +116,26 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn
116 116 throw new ScheduleException("线路未选择");
117 117 } else {
118 118 // param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
119   - param.put("isCancel_eq", false);
  119 + param.put("isCancel_eq", false); // 未作废的人员配置
  120 +
120 121 if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) {
121 122 throw new ScheduleException("驾驶员未选择");
122 123 } else {
  124 + // 检测人员是否已经配置在其他线路的驾驶员列表中
123 125 param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId());
124 126 List<EmployeeConfigInfo> employeeConfigInfos = list(param);
125 127 if (!CollectionUtils.isEmpty(list(param))) {
126   - throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!");
  128 + throw new ScheduleException("人员已经配置在线路[" + employeeConfigInfos.get(0).getXl().getName() + "]驾驶员列表中!");
127 129 }
  130 +
  131 + // 检测人员是否已经配置在其他线路的售票员列表中
  132 + param.remove("jsy.id_eq");
  133 + param.put("spy.id_eq", employeeConfigInfo.getJsy().getId());
  134 + employeeConfigInfos = list(param);
  135 + if (!CollectionUtils.isEmpty(list(param))) {
  136 + throw new ScheduleException("人员已经配置在线路[" + employeeConfigInfos.get(0).getXl().getName() + "]售票员列表中!");
  137 + }
  138 +
128 139 }
129 140 }
130 141 }
... ... @@ -207,14 +218,26 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
207 218 throw new ScheduleException("线路未选择");
208 219 } else {
209 220 // param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
  221 + param.put("isCancel_eq", false); // 未作废的人员配置
  222 +
210 223 if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) {
211 224 throw new ScheduleException("售票员未选择");
212 225 } else {
  226 + // 检测人员是否已经配置在其他线路售票员列表中
213 227 param.put("spy.id_eq", employeeConfigInfo.getSpy().getId());
214 228 List<EmployeeConfigInfo> employeeConfigInfos = list(param);
215 229 if (!CollectionUtils.isEmpty(list(param))) {
216   - throw new ScheduleException("售票员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!");
  230 + throw new ScheduleException("人员已经配置在线路[" + employeeConfigInfos.get(0).getXl().getName() + "]售票员列表中!");
217 231 }
  232 +
  233 + // 检测人员是否已经配置在其他线路的驾驶员列表中
  234 + param.remove("spy.id_eq");
  235 + param.put("jsy.id_eq", employeeConfigInfo.getSpy().getId());
  236 + employeeConfigInfos = list(param);
  237 + if (!CollectionUtils.isEmpty(list(param))) {
  238 + throw new ScheduleException("人员已经配置在线路[" + employeeConfigInfos.get(0).getXl().getName() + "]驾驶员列表中!");
  239 + }
  240 +
218 241 }
219 242 }
220 243 }
... ... @@ -287,7 +310,7 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
287 310 @Transactional
288 311 @Override
289 312 public List<String> validate_get_destory_info() {
290   - // 1、查找当前用户是否有运营计划管理,没有的话不分析是否有停用人信息
  313 + // 1、查找当前用户是否有运营计划管理,没有的话不分析是否有停用人信息
291 314 List<Module> moduleList = this.moduleService.findByCurrentUser();
292 315 boolean hasPlanModule = false;
293 316 for (Module module : moduleList) {
... ...