Commit f315d0e70f1007807ae84d3f8464801b30466a63
1 parent
a2a66ec8
浦东公交计划调度功能优化
1、修改EmployeeConfigInfoServiceImpl,修正人员配置提示逻辑,判断人员配置时,已作废的不判断,每个人员都要判断驾驶员和售票员是否配置过
Showing
1 changed file
with
27 additions
and
4 deletions
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
| @@ -116,15 +116,26 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | @@ -116,15 +116,26 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 116 | throw new ScheduleException("线路未选择"); | 116 | throw new ScheduleException("线路未选择"); |
| 117 | } else { | 117 | } else { |
| 118 | // param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | 118 | // param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); |
| 119 | - param.put("isCancel_eq", false); | 119 | + param.put("isCancel_eq", false); // 未作废的人员配置 |
| 120 | + | ||
| 120 | if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { | 121 | if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { |
| 121 | throw new ScheduleException("驾驶员未选择"); | 122 | throw new ScheduleException("驾驶员未选择"); |
| 122 | } else { | 123 | } else { |
| 124 | + // 检测人员是否已经配置在其他线路的驾驶员列表中 | ||
| 123 | param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); | 125 | param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); |
| 124 | List<EmployeeConfigInfo> employeeConfigInfos = list(param); | 126 | List<EmployeeConfigInfo> employeeConfigInfos = list(param); |
| 125 | if (!CollectionUtils.isEmpty(list(param))) { | 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<EmployeeConfigIn | @@ -207,14 +218,26 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 207 | throw new ScheduleException("线路未选择"); | 218 | throw new ScheduleException("线路未选择"); |
| 208 | } else { | 219 | } else { |
| 209 | // param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | 220 | // param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); |
| 221 | + param.put("isCancel_eq", false); // 未作废的人员配置 | ||
| 222 | + | ||
| 210 | if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { | 223 | if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { |
| 211 | throw new ScheduleException("售票员未选择"); | 224 | throw new ScheduleException("售票员未选择"); |
| 212 | } else { | 225 | } else { |
| 226 | + // 检测人员是否已经配置在其他线路售票员列表中 | ||
| 213 | param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); | 227 | param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); |
| 214 | List<EmployeeConfigInfo> employeeConfigInfos = list(param); | 228 | List<EmployeeConfigInfo> employeeConfigInfos = list(param); |
| 215 | if (!CollectionUtils.isEmpty(list(param))) { | 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<EmployeeConfigIn | @@ -287,7 +310,7 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 287 | @Transactional | 310 | @Transactional |
| 288 | @Override | 311 | @Override |
| 289 | public List<String> validate_get_destory_info() { | 312 | public List<String> validate_get_destory_info() { |
| 290 | - // 1、查找当前用户是否有运营计划管理,没有的话不分析是否有停用人鱼信息 | 313 | + // 1、查找当前用户是否有运营计划管理,没有的话不分析是否有停用人员信息 |
| 291 | List<Module> moduleList = this.moduleService.findByCurrentUser(); | 314 | List<Module> moduleList = this.moduleService.findByCurrentUser(); |
| 292 | boolean hasPlanModule = false; | 315 | boolean hasPlanModule = false; |
| 293 | for (Module module : moduleList) { | 316 | for (Module module : moduleList) { |