lyh
2025-03-19 ed839069a1df066d9559263129e999de7e9c2ccc
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ComponentInfoSeServiceImpl.java
@@ -24,10 +24,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.*;
@Service
public class ComponentInfoSeServiceImpl extends ServiceImpl<ComponentInfoMapper, ComponentInfo> implements IComponentInfoService {
@@ -121,15 +118,22 @@
            ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR);
        }
        //添加结构树
        ProductMix productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(productInfo.getProductId())
                ,componentInfo.getComponentName(),componentInfo.getComponentCode(),2);
        ProductMix productMix=null;
        if (componentInfo.getParentId() != null) {
            //子部件
            productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(componentInfo.getParentId())
                    ,componentInfo.getComponentName(),componentInfo.getComponentCode(),2,new Date());
        }else {
            productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(productInfo.getProductId())
                    ,componentInfo.getComponentName(),componentInfo.getComponentCode(),2,new Date());
        }
        productMixService.save(productMix);
        //添加权限
        PermissionStreamNew stream = new PermissionStreamNew();
        stream.setUserId(userId);
        stream.setBusinessId(componentInfo.getComponentId());
        stream.setBusinessType("2");
        return permissionStreamNewService.save(stream);
        return permissionStreamNewService.addPermissionStreamNew(stream);
    }
    @Override