1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package org.jeecg.modules.dnc.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.dnc.entity.ProductMix;
import org.jeecg.modules.dnc.service.IProductInfoService;
import org.jeecg.modules.dnc.service.IProductMixService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
@Slf4j
@Api(tags = "结构树")
@RestController
@RequestMapping("/nc/product")
public class ProductMixController {
    @Autowired
    private IProductMixService iProductMixService;
 
    @Autowired
    private IProductInfoService iProductInfoService;
    /**
     * 获取产品结构树
     * @return
     */
    @AutoLog(value = "获取产品结构树")
    @ApiOperation(value = "获取产品结构树", notes = "获取产品结构树")
    @GetMapping(value = "/getTree")
    public Result<?> getTree() {
        List<ProductMix> productMixList = iProductMixService.getTree();
        return Result.OK(productMixList);
    }
 
    /**
     * 获取具体层级实体
     * @param id,type
     * @return
     */
    @AutoLog(value = "获取具体层级实体")
    @ApiOperation(value = "获取具体层级实体", notes = "获取具体层级实体")
    @GetMapping(value = "/getTreeById")
    public Result<?> getTreeById(String id, Integer type) {
        return iProductInfoService.getTreeById(id, type);
    }
}