lyh
2025-03-07 b864148d2a9afd5e1627b761da923cca8f8dfbd2
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ComponentInfoSeServiceImpl.java
@@ -1,6 +1,5 @@
package org.jeecg.modules.dnc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -8,7 +7,7 @@
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.dnc.dto.ComponentExt;
import org.jeecg.modules.dnc.entity.*;
import org.jeecg.modules.dnc.exception.ExceptionCast;
import org.jeecg.modules.dnc.mapper.ComponentInfoMapper;
import org.jeecg.modules.dnc.mapper.ProductInfoMapper;
@@ -16,14 +15,10 @@
import org.jeecg.modules.dnc.response.ComponentInfoCode;
import org.jeecg.modules.dnc.response.ProductInfoCode;
import org.jeecg.modules.dnc.response.UcenterCode;
import org.jeecg.modules.dnc.service.*;
import org.jeecg.modules.dnc.ucenter.Department;
import org.jeecg.modules.dnc.utils.ValidateUtil;
import org.jeecg.modules.dnc.entity.*;
import org.jeecg.modules.system.entity.MdcProduction;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.dnc.entity.ComponentInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@@ -50,7 +45,7 @@
    @Autowired
    private IProcessStreamService processStreamService;
    @Autowired
    private IDocInfoService docInfoService;
    private IProductMixService productMixService;
    @Autowired
    private IDocRelativeService iDocRelativeService;
    @Autowired
@@ -125,7 +120,10 @@
        if (!b) {
            ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR);
        }
        //去除默认新增工序,转为手动添加
        //添加结构树
        ProductMix productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(productInfo.getProductId())
                ,componentInfo.getComponentName(),componentInfo.getComponentCode(),"2");
        productMixService.save(productMix);
        //添加权限
        PermissionStreamNew stream = new PermissionStreamNew();
        stream.setUserId(userId);
@@ -278,6 +276,9 @@
        b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(componentInfo.getComponentId(),"2","1");
        if(!b)
            ExceptionCast.cast(CommonCode.FAIL);
        b = productMixService.removeById(id);
        if (!b)
            ExceptionCast.cast(CommonCode.FAIL);
        return super.removeById(id);
    }