| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | 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; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import liquibase.pro.packaged.P; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.ProcessStreamMapper; |
| | | import org.jeecg.modules.dnc.request.ProcessStreamRequest; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | |
| | | |
| | | import org.jeecg.modules.dnc.request.ProcessStreamRequest; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IProcessStreamPermissionService processStreamPermissionService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | private IProductMixService productMixService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //添加用户权限 |
| | | b = productPermissionService.add(stream.getProcessId(), userId,"5"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | //添加结构树 |
| | | ProductMix productMix; |
| | | if (stream.getPartsId() != null) { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getPartsId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),"5"); |
| | | }else { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getComponentId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),"5"); |
| | | } |
| | | productMixService.save(productMix); |
| | | //添加权限验证 |
| | | PermissionStreamNew permissionStream = new PermissionStreamNew(); |
| | | permissionStream.setUserId(userId); |
| | |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_HAS_DOC); |
| | | } |
| | | boolean b = productMixService.removeById(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(id); |
| | | } |
| | | |