feat: 新增获取混凝土比例树接口
This commit is contained in:
@@ -24,6 +24,8 @@ import mjkf.xinke.main.modular.ratioconcrete.service.RatioConcreteService;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "混凝土比例控制器")
|
||||
@ApiSupport(author = "SNOWY_TEAM", order = 1)
|
||||
@@ -42,6 +44,27 @@ public class RatioConcreteController {
|
||||
return CommonResult.data(ratioConcreteService.page(ratioConcretePageParam));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation("获取混凝土比例树")
|
||||
@GetMapping("/main/ratioconcrete/tree")
|
||||
public CommonResult<Map<String, ?>> tree(RatioConcretePageParam ratioConcretePageParam) {
|
||||
var query = ratioConcreteService.getQuery(ratioConcretePageParam);
|
||||
var items = ratioConcreteService.list(query);
|
||||
var tree = items.stream().collect(Collectors.groupingBy(
|
||||
RatioConcrete::getName,
|
||||
Collectors.groupingBy(
|
||||
RatioConcrete::getRockSize,
|
||||
Collectors.groupingBy(
|
||||
RatioConcrete::getConcreteStrength,
|
||||
Collectors.groupingBy(RatioConcrete::getCementStrength)
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
return CommonResult.data(tree);
|
||||
}
|
||||
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation("添加混凝土比例")
|
||||
@CommonLog("添加混凝土比例")
|
||||
|
||||
Reference in New Issue
Block a user