lyh
2025-03-19 ed839069a1df066d9559263129e999de7e9c2ccc
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProductInfoServiceImpl.java
@@ -108,14 +108,31 @@
            ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR);
        }
        //添加结构树
        ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0L,productInfo.getProductName(),productInfo.getProductNo(),1);
        ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0L,
                productInfo.getProductName(),productInfo.getProductNo(),1,new Date());
        productMixService.save(productMix);
        //添加用户部门
        if(StrUtil.isNotBlank(user.getProductionIds())){
            String[] split = user.getProductionIds().split(",");
            String[] departIds = split;
            for (String departId : departIds) {
                ProductDepartment productDepartment = new ProductDepartment();
                productDepartment.setProductId(productInfo.getProductId());
                productDepartment.setDepartId(departId);
                productDepartmentService.save(productDepartment);
                PermissionStreamNew stream = new PermissionStreamNew();
                stream.setBusinessId(productInfo.getProductId());
                stream.setDepartId(departId);
                stream.setBusinessType("1");
                permissionStreamNewService.save(stream);
            }
        }
        //添加用户权限
        PermissionStreamNew stream = new PermissionStreamNew();
        stream.setBusinessId(productInfo.getProductId());
        stream.setUserId(userId);
        stream.setBusinessType("1");
        return permissionStreamNewService.save(stream);
        return permissionStreamNewService.addPermissionStreamNew(stream);
    }
    @Override