Commit 40969116 by 王力

Merge branch 'dev_orderlist0717' into 'develop'

Dev orderlist0717

See merge request !253
2 parents a94dc1ad b291733d
...@@ -126,20 +126,18 @@ public class DispatchServiceImpl implements DispatchService { ...@@ -126,20 +126,18 @@ public class DispatchServiceImpl implements DispatchService {
public Result<?> getDispatchEngineerOrderList(DispatchEngineerOrderListReq reqDTO) throws BusinessException { public Result<?> getDispatchEngineerOrderList(DispatchEngineerOrderListReq reqDTO) throws BusinessException {
// 派工台技术员预约单列表 // 派工台技术员预约单列表
// 获取技能耗时
HashMap<String, Integer> skillTakeTime = this.querySkillTakeTime();
// 获取技能信息 // 获取技能信息
HashMap<String, SkillInfo> skillInfo = this.querySkillInfo(); HashMap<String, SkillInfo> skillInfo = this.querySkillInfo();
// 获取groupIds // 获取groupIds
List<String> groupIds = this.queryOrgGroupIds(reqDTO.getLevelType(), reqDTO.getLevelValue(), reqDTO.getBranchIds(), List<String> teamIds = this.queryOrgTeamIds(reqDTO.getLevelType(), reqDTO.getLevelValue(), reqDTO.getBranchIds(),
reqDTO.getGroupIds(), reqDTO.getTeamIds()); reqDTO.getGroupIds(), reqDTO.getTeamIds());
if (groupIds.isEmpty()) { if (teamIds.isEmpty()) {
throw new BusinessException("大区/分部/小组组织结构配置可能错误或缺失,请联系管理员/研发"); throw new BusinessException("大区/分部/小组组织结构配置可能错误或缺失,请联系管理员/研发");
} }
// 获取engineer列表 // 获取engineer列表
List<EngineerInfo> engineers = this.queryEngineers(groupIds, reqDTO.getEngineerCodes(), reqDTO.getKey()); List<EngineerInfo> engineers = this.queryEngineers(teamIds, reqDTO.getEngineerCodes(), reqDTO.getKey());
if (engineers.isEmpty()) { if (engineers.isEmpty()) {
// 该group下没有技术员,返回空 // 该group下没有技术员,返回空
DispatchEngineerOrderListResp res = new DispatchEngineerOrderListResp(); DispatchEngineerOrderListResp res = new DispatchEngineerOrderListResp();
...@@ -398,13 +396,16 @@ public class DispatchServiceImpl implements DispatchService { ...@@ -398,13 +396,16 @@ public class DispatchServiceImpl implements DispatchService {
} }
private List<EngineerInfo> queryEngineers(List<String> groupIds, List<String> engineerCodes, String key) { private List<EngineerInfo> queryEngineers(List<String> teamIds, List<String> engineerCodes, String key) {
// 通过groupIds获取技术员列表 // 通过groupIds获取技术员列表
LambdaQueryWrapper<EngineerInfo> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EngineerInfo> lqw = new LambdaQueryWrapper<>();
lqw.in(EngineerInfo::getGroupId, groupIds);
lqw.eq(EngineerInfo::getBeanStatus, 1); lqw.eq(EngineerInfo::getBeanStatus, 1);
lqw.in(ListUtils.isNotEmpty(engineerCodes), EngineerInfo::getEngineerCode, engineerCodes); lqw.in(ListUtils.isNotEmpty(engineerCodes), EngineerInfo::getEngineerCode, engineerCodes);
String inTeamIds = teamIds.stream().map(Object::toString).collect(Collectors.joining(","));
String sql = String.format("select 1 from org_team_engineer ot where ot.engineer_code = engineer_info.engineer_code and ot.team_id in (%s)", inTeamIds);
lqw.exists(sql);
if (StringUtils.isNotEmpty(key)) { if (StringUtils.isNotEmpty(key)) {
lqw.and(w -> lqw.and(w ->
w.like(EngineerInfo::getPhone, key) w.like(EngineerInfo::getPhone, key)
...@@ -418,7 +419,7 @@ public class DispatchServiceImpl implements DispatchService { ...@@ -418,7 +419,7 @@ public class DispatchServiceImpl implements DispatchService {
return engineerInfoMPDao.selectList(lqw); return engineerInfoMPDao.selectList(lqw);
} }
private List<String> queryOrgGroupIds(String levelType, String levelIds, List<String> branchIds, List<String> groupIds, List<String> teamIds) { private List<String> queryOrgTeamIds(String levelType, String levelIds, List<String> branchIds, List<String> groupIds, List<String> teamIds) {
LambdaQueryWrapper<OrgTeam> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgTeam> lqw = new LambdaQueryWrapper<>();
lqw.eq(levelType.equals("cluster"), OrgTeam::getClusterId, levelIds); lqw.eq(levelType.equals("cluster"), OrgTeam::getClusterId, levelIds);
lqw.eq(levelType.equals("branch"), OrgTeam::getBranchId, levelIds); lqw.eq(levelType.equals("branch"), OrgTeam::getBranchId, levelIds);
...@@ -427,8 +428,8 @@ public class DispatchServiceImpl implements DispatchService { ...@@ -427,8 +428,8 @@ public class DispatchServiceImpl implements DispatchService {
lqw.in(ListUtils.isNotEmpty(groupIds), OrgTeam::getGroupId, groupIds); lqw.in(ListUtils.isNotEmpty(groupIds), OrgTeam::getGroupId, groupIds);
lqw.in(ListUtils.isNotEmpty(teamIds), OrgTeam::getTeamId, teamIds); lqw.in(ListUtils.isNotEmpty(teamIds), OrgTeam::getTeamId, teamIds);
List<OrgTeam> groups = orgTeamMPDao.selectList(lqw); List<OrgTeam> teams = orgTeamMPDao.selectList(lqw);
return groups.stream().map(OrgTeam::getGroupId).collect(Collectors.toList()); return teams.stream().map(OrgTeam::getTeamId).collect(Collectors.toList());
} }
private HashMap<String, Integer> querySkillTakeTime() { private HashMap<String, Integer> querySkillTakeTime() {
......
...@@ -70,7 +70,7 @@ public class OrderAssignImpl implements OrderAssign { ...@@ -70,7 +70,7 @@ public class OrderAssignImpl implements OrderAssign {
String date = TimeUtils.timestamp2DateTime(order.getExpectTimeBegin(), TimeUtils.DATE_GAP_FORMAT); String date = TimeUtils.timestamp2DateTime(order.getExpectTimeBegin(), TimeUtils.DATE_GAP_FORMAT);
// 获取group内的小组成 // 获取符合筛选条件的技术
List<String> engineerCodes = this.searchEngineerCodes(order, distance, key, recommend); List<String> engineerCodes = this.searchEngineerCodes(order, distance, key, recommend);
List<EngineerInfo> engineers = engineerInfoMPDao.selectByEngineerCodes(engineerCodes); List<EngineerInfo> engineers = engineerInfoMPDao.selectByEngineerCodes(engineerCodes);
...@@ -306,13 +306,14 @@ public class OrderAssignImpl implements OrderAssign { ...@@ -306,13 +306,14 @@ public class OrderAssignImpl implements OrderAssign {
return new ArrayList<>(); return new ArrayList<>();
} }
/*
if (StringUtils.isEmpty(distance)) { if (StringUtils.isEmpty(distance)) {
return new ArrayList<>(engineerCodes1); return new ArrayList<>(engineerCodes1);
} }
//进行距离匹配TODO //进行距离匹配TODO
*/
return null; return new ArrayList<>(engineerCodes1);
} }
private Set<String> searchEngineerByRecommend(OrderRequest order, String recommend) { private Set<String> searchEngineerByRecommend(OrderRequest order, String recommend) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!