|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.supervision.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.supervision.exception.BusinessException;
|
|
|
|
|
import com.supervision.model.*;
|
|
|
|
@ -13,6 +14,7 @@ import com.supervision.vo.ask.AskPhysicalHistoryResVO;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -33,14 +35,19 @@ public class AskPhysicalServiceImpl implements AskPhysicalService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<ConfigPhysicalToolResVO> queryPhysicalToolList() {
|
|
|
|
|
|
|
|
|
|
List<ConfigPhysicalTool> list = toolService.lambdaQuery().list();
|
|
|
|
|
return list.stream().collect(Collectors.groupingBy(ConfigPhysicalTool::getType)).entrySet().stream().map(e ->{
|
|
|
|
|
ConfigPhysicalToolResVO tool = new ConfigPhysicalToolResVO();
|
|
|
|
|
tool.setToolType(e.getKey());
|
|
|
|
|
int priority = 999;
|
|
|
|
|
if (CollectionUtil.isNotEmpty(e.getValue()) && null != e.getValue().get(0).getTypePriority()) {
|
|
|
|
|
priority = e.getValue().get(0).getTypePriority();
|
|
|
|
|
}
|
|
|
|
|
tool.setPriority(priority);
|
|
|
|
|
tool.setToolList(e.getValue());
|
|
|
|
|
return tool;
|
|
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
}).sorted(Comparator.comparingInt(ConfigPhysicalToolResVO::getPriority)).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|