lyh
2025-04-01 4e2be858f4ccbb7490b59ed584fd1c829eb4d556
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/PartsInfoServiceImpl.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 PartsInfoServiceImpl extends ServiceImpl<PartsInfoMapper, PartsInfo> implements IPartsInfoService {
@@ -111,14 +108,14 @@
        }
        //添加结构树
        ProductMix productMix = new ProductMix(Long.parseLong(partsInfo.getPartsId()),Long.parseLong(partsInfo.getComponentId())
                ,partsInfo.getPartsName(),partsInfo.getPartsCode(),"3");
                ,partsInfo.getPartsName(),partsInfo.getPartsCode(),3,new Date());
        productMixService.save(productMix);
        //添加用户权限
        PermissionStreamNew stream = new PermissionStreamNew();
        stream.setBusinessId(partsInfo.getPartsId());
        stream.setBusinessType("3");
        stream.setUserId(userId);
        return permissionStreamNewService.save(stream);
        return permissionStreamNewService.addPermissionStreamNew(stream);
    }
    @Override
@@ -138,6 +135,11 @@
        partsInfo.setProductId(null);
        partsInfo.setComponentId(null);
        boolean b = super.updateById(partsInfo);
        //同步修改结构树
        ProductMix productMix = productMixService.getById(Long.parseLong(id));
        productMix.setName(partsInfo.getPartsName());
        productMix.setCode(partsInfo.getPartsCode());
        productMixService.updateById(productMix);
        if(!b)
            return false;
        PartsPermission permission = partsPermissionService.getByPartsIdAndUserId(id, userId);