Commit c1ead991 by 刘鑫

fix(容量):最大空闲时间 计算不能直接取对应枚举

1 parent aae7ca0e
...@@ -246,7 +246,7 @@ public class CapacityUtils { ...@@ -246,7 +246,7 @@ public class CapacityUtils {
long engineerMaxDuration = Optional.ofNullable(timeSlots).orElse(Collections.emptyList()) long engineerMaxDuration = Optional.ofNullable(timeSlots).orElse(Collections.emptyList())
.stream() .stream()
.mapToLong(OccupyInfoDetail::getDuration) .mapToLong(t1 -> Duration.between(t1.getBeginTime(), t1.getEndTime()).abs().toMinutes())
.sum(); .sum();
engineerMaxDurationList.add(engineerMaxDuration); engineerMaxDurationList.add(engineerMaxDuration);
}); });
......
...@@ -118,16 +118,18 @@ public class CapacityQueryServiceImpl implements CapacityQueryService { ...@@ -118,16 +118,18 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
} }
//分站、网点ID //分站、网点ID
List<String> groupIdList = mapBlockInBlockIdsList.stream().map(MapBlockInfoEntity::getGroupId).distinct() List<String> teamIdList = mapBlockInBlockIdsList.stream().map(MapBlockInfoEntity::getTeamId).distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
final String groupId = groupIdList.get(0); List<String> groupList = mapBlockInBlockIdsList.stream().map(MapBlockInfoEntity::getGroupId).distinct()
.collect(Collectors.toList());
final String teamId = teamIdList.get(0);
//3. 查询分站下拥有对应技能的工程师(排重) 技能码转换为对应的技能汉字 //3. 查询分站下拥有对应技能的工程师(排重) 技能码转换为对应的技能汉字
List<SkillInfoEntity> querySkillGroup = new ArrayList<>(); List<SkillInfoEntity> querySkillGroup = new ArrayList<>();
Set<EngineerInfoEntity> allFulfillEngineer = Sets.newConcurrentHashSet(); Set<EngineerInfoEntity> allFulfillEngineer = Sets.newConcurrentHashSet();
for (CapacityQueryDTO.Service service : services) { for (CapacityQueryDTO.Service service : services) {
Set<EngineerInfoEntity> engineerInfoEntities = engineerInfoDao.listByBrandAndTypeAndSkillAndGroupId(service.getBrand(), Set<EngineerInfoEntity> engineerInfoEntities = engineerInfoDao.listByBrandAndTypeAndSkillAndTeamId(service.getBrand(),
service.getProductType(), service.getServiceType(), groupId); service.getProductType(), service.getServiceType(), teamId);
//查询对应的技能信息 //查询对应的技能信息
SkillInfoEntity skillInfo = skillInfoDao.getByBrandAndTypeAndSkill(service.getBrand(), SkillInfoEntity skillInfo = skillInfoDao.getByBrandAndTypeAndSkill(service.getBrand(),
...@@ -154,7 +156,7 @@ public class CapacityQueryServiceImpl implements CapacityQueryService { ...@@ -154,7 +156,7 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
LocalDate currentDate = beginDate; LocalDate currentDate = beginDate;
//定义返回值 //定义返回值
CapacityQueryDTO.Result result = new CapacityQueryDTO.Result(); CapacityQueryDTO.Result result = new CapacityQueryDTO.Result();
result.setGroupId(groupId); result.setGroupId(groupList.get(0));
result.setTakeTime(totalTakeTime); result.setTakeTime(totalTakeTime);
final int corePoolSize = Runtime.getRuntime().availableProcessors(); final int corePoolSize = Runtime.getRuntime().availableProcessors();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!