lyh
2025-02-14 f2f8241dd52ef12ec109f6f4f0f13042055338ac
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java
@@ -5,6 +5,7 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser;
@@ -17,6 +18,7 @@
import org.jeecg.modules.dnc.ucenter.Department;
import org.jeecg.modules.dnc.ucenter.UserDepartExt;
import org.jeecg.modules.dnc.utils.ValidateUtil;
import org.jeecg.modules.system.entity.MdcProduction;
import org.jeecg.modules.system.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -142,8 +144,8 @@
    @AutoLog(value = "产品表-获取已分配的部门")
    @ApiOperation(value = "产品表-获取已分配的部门", notes = "产品表-获取已分配的部门")
    @GetMapping("/get/perm/depart/{nodeType}/{paramId}")
    public QueryListResponseResult<Department> getDepartPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId")  String paramId) {
        List<Department> list = productInfoService.getDepartPermsList(nodeType, paramId);
    public QueryListResponseResult<MdcProduction> getDepartPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId")  String paramId) {
        List<MdcProduction> list = productInfoService.getDepartPermsList(nodeType, paramId);
        if(list == null)
            list = Collections.emptyList();
        return new QueryListResponseResult(CommonCode.SUCCESS, list);
@@ -152,8 +154,8 @@
    @AutoLog(value = "产品表-获取未分配的部门")
    @ApiOperation(value = "产品表-获取未分配的部门", notes = "产品表-获取未分配的部门")
    @GetMapping("/get/non/perm/depart/{nodeType}/{paramId}")
    public QueryListResponseResult<Department> getDepartNonPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId")  String paramId) {
        List<Department> list = productInfoService.getDepartNonPermsList(nodeType, paramId);
    public QueryListResponseResult<MdcProduction> getDepartNonPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId")  String paramId) {
        List<MdcProduction> list = productInfoService.getDepartNonPermsList(nodeType, paramId);
        if(list == null)
            list = Collections.emptyList();
        return new QueryListResponseResult(CommonCode.SUCCESS, list);
@@ -253,4 +255,21 @@
            list = Collections.emptyList();
        return new QueryListResponseResult<>(CommonCode.SUCCESS, list);
    }
    /**
     * 产品结构树-通过类型就行删除
     * @param id
     * @param type
     * @return
     */
    @AutoLog(value = "产品结构树-通过类型就行删除")
    @ApiOperation(value = "产品结构树-通过类型就行删除", notes = "产品结构树-通过类型就行删除")
    @DeleteMapping("/delete/{id}/{type}")
    public Result<?> deleteProductTreeByType(@PathVariable("id") String id, @PathVariable("type") Integer type) {
        boolean b =productInfoService.deleteProductTree(id, type);
        if (b){
            return Result.ok("删除成功!");
        }
        return Result.error("删除失败!");
    }
}