Commit 0310ef29 by 刘鑫

fix: 1. 工程师推荐时查对应小组内的工程师信息 2. 时间秒转小时,分钟数据错误问题(超过24个小时)

1 parent 2021b667
...@@ -284,7 +284,7 @@ public class OrderAssignCheck { ...@@ -284,7 +284,7 @@ public class OrderAssignCheck {
} }
private LocalTime point2LocalTime(int point) { private LocalTime point2LocalTime(int point) {
int hour = point / 60; int hour = point / 360;
int minute = point % 60; int minute = point % 60;
return LocalTime.of(hour, minute, 0); return LocalTime.of(hour, minute, 0);
} }
......
...@@ -146,6 +146,17 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ ...@@ -146,6 +146,17 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
"WHERE ei.bean_status = 1 AND ote.team_id = :teamId AND ote.engineer_code = :engineerCode AND ote.`status` = 1", nativeQuery = true) "WHERE ei.bean_status = 1 AND ote.team_id = :teamId AND ote.engineer_code = :engineerCode AND ote.`status` = 1", nativeQuery = true)
EngineerInfoEntity selectEngineerByEngineerCodeAndTeamId(@Param("engineerCode") String engineerCode, @Param("teamId") String teamId); EngineerInfoEntity selectEngineerByEngineerCodeAndTeamId(@Param("engineerCode") String engineerCode, @Param("teamId") String teamId);
/**
* 查询工作队下的指定工程师信息
*
* @param teamIds 工作队
* @return 工作队下没有工程师则返回空
*/
@Query(value = "SELECT ei.* from org_team_engineer ote left join engineer_info ei ON ote.engineer_code = ei.engineer_code " +
"WHERE ei.bean_status = 1 AND ote.`status` = 1 AND ote.team_id IN(:teamIds)", nativeQuery = true)
Set<EngineerInfoEntity> selectEngineerByEngineerCodeAndTeamIdIn(@Param("teamIds") List<String> teamIds);
@Query(value = "SELECT esg.engineer_code FROM engineer_skill_group esg WHERE engineer_code = :engineerCode and skill_group_code in (:skillGroupCodes) and status = 1", nativeQuery = true) @Query(value = "SELECT esg.engineer_code FROM engineer_skill_group esg WHERE engineer_code = :engineerCode and skill_group_code in (:skillGroupCodes) and status = 1", nativeQuery = true)
List<String> findByEngineerCodesBySkillCodes(@Param("engineerCode") String engineerCode, @Param("skillGroupCodes") Set<String> skillGroupCodes); List<String> findByEngineerCodesBySkillCodes(@Param("engineerCode") String engineerCode, @Param("skillGroupCodes") Set<String> skillGroupCodes);
} }
...@@ -519,8 +519,9 @@ public class OrderAssignImpl implements OrderAssign { ...@@ -519,8 +519,9 @@ public class OrderAssignImpl implements OrderAssign {
teams = orgTeamDao.findByGroupIdIn(collect); teams = orgTeamDao.findByGroupIdIn(collect);
break; break;
} }
List<String> groupIds = teams.stream().map(OrgTeamEntity::getGroupId).collect(Collectors.toList()); List<String> teamIds = teams.stream().map(OrgTeamEntity::getTeamId).distinct().collect(Collectors.toList());
return engineerInfoDao.findByGroupIdIn(groupIds).stream().map(EngineerInfoEntity::getEngineerCode).collect(Collectors.toSet()); Set<EngineerInfoEntity> engineerInfoEntities = engineerInfoDao.selectEngineerByEngineerCodeAndTeamIdIn(teamIds);
return engineerInfoEntities.stream().map(EngineerInfoEntity::getEngineerCode).collect(Collectors.toSet());
} else { } else {
return new HashSet<>(); return new HashSet<>();
} }
...@@ -534,8 +535,10 @@ public class OrderAssignImpl implements OrderAssign { ...@@ -534,8 +535,10 @@ public class OrderAssignImpl implements OrderAssign {
} else if (levelType.equals("team")) { } else if (levelType.equals("team")) {
teams = orgTeamDao.findAllByTeamId(levelValue); teams = orgTeamDao.findAllByTeamId(levelValue);
} }
List<String> groupIds = teams.stream().map(OrgTeamEntity::getGroupId).collect(Collectors.toList()); //查询工作队下的工程师
return engineerInfoDao.findByGroupIdIn(groupIds).stream().map(EngineerInfoEntity::getEngineerCode).collect(Collectors.toSet()); List<String> teamIds = teams.stream().map(OrgTeamEntity::getTeamId).distinct().collect(Collectors.toList());
Set<EngineerInfoEntity> engineerInfoEntities = engineerInfoDao.selectEngineerByEngineerCodeAndTeamIdIn(teamIds);
return engineerInfoEntities.stream().map(EngineerInfoEntity::getEngineerCode).collect(Collectors.toSet());
} }
private Set<String> searchEngineerByKey(String key) { private Set<String> searchEngineerByKey(String key) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!