| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.pro.packaged.S; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.ProcessSpecVersionPermissionMapper; |
| | | import org.jeecg.modules.dnc.mapper.ProductInfoMapper; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.service.support.ProductTreeWrapper; |
| | | import org.jeecg.modules.dnc.ucenter.UserDepartExt; |
| | | 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.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import redis.clients.jedis.Jedis; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | private IProcessStreamPermissionService iProcessStreamPermissionService; |
| | | @Autowired |
| | | private IWorkStepPermissionService iWorkStepPermissionService; |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //添加结构树 |
| | | ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0,productInfo.getProductName(),productInfo.getProductNo(),"1"); |
| | | productMixService.save(productMix); |
| | | //添加用户权限 |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setUserId(userId); |
| | |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(id, "1","1"); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(id); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(id); |
| | | } |
| | | |