lyh
2025-06-25 e756af0f5bfd1addbd5d5c145441fb34aad91a28
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductMixController.java
@@ -1,11 +1,12 @@
package org.jeecg.modules.dnc.controller;
import cn.hutool.core.lang.tree.Tree;
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;
@@ -22,6 +23,8 @@
    @Autowired
    private IProductMixService iProductMixService;
    @Autowired
    private IProductInfoService iProductInfoService;
    /**
     * 获取产品结构树
     * @return
@@ -30,6 +33,31 @@
    @ApiOperation(value = "获取产品结构树", notes = "获取产品结构树")
    @GetMapping(value = "/getTree")
    public Result<?> getTree() {
        return Result.OK(iProductMixService.getTree());
        List<ProductMix> productMixList = iProductMixService.getTree();
        return Result.OK(productMixList);
    }
    /**
     * 获取全部产品树(包括设备类与nc文件)
     * @return
     */
    @AutoLog(value = "获取全部产品树")
    @ApiOperation(value = "获取全部产品树", notes = "获取全部产品树")
    @GetMapping(value = "/getAllTree")
    public Result<?> getAllTree() {
        List<ProductMix> productMixList = iProductMixService.getProductMixTree();
        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);
    }
}