|
|
|
@@ -16,6 +16,9 @@ import org.springframework.data.domain.PageRequest; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* (Component)表服务实现类 |
|
|
|
@@ -30,6 +33,8 @@ public class ComponentServiceImpl implements ComponentService { |
|
|
|
|
|
|
|
@Value("${pipeline.control_strategy}") |
|
|
|
private String controlStrategy; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 通过ID查询单条数据 |
|
|
|
* |
|
|
|
@@ -46,6 +51,13 @@ public class ComponentServiceImpl implements ComponentService { |
|
|
|
return this.componentDao.queryById(id); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<Integer, List<Component>> queryAllGroupedByCategory() { |
|
|
|
List<Component> componentList = this.componentDao.queryAll(); |
|
|
|
Map<Integer,List<Component>> groupedComponent = componentList.stream().collect(Collectors.groupingBy(Component::getCategoryId)); |
|
|
|
return groupedComponent; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 分页查询 |
|
|
|
* |
|
|
|
@@ -150,4 +162,6 @@ public class ComponentServiceImpl implements ComponentService { |
|
|
|
component.setState(0); |
|
|
|
return this.componentDao.update(component)>0?"删除成功":"删除失败"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |