| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | 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.service.impl.ServiceImpl; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | |
| | | @Autowired |
| | | private IProcessSpecVersionDepartmentService processSpecVersionDepartmentService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | private IProductMixService productMixService; |
| | | /** |
| | | * 根据用户id获取授权的工艺规程版本表信息 |
| | | * @param userId |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //添加用户权限 |
| | | b = productPermissionService.add(ProcessSpecVersion.getId(), userId,"4"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //添加结构树 |
| | | ProductMix productMix = new ProductMix(Long.parseLong(ProcessSpecVersion.getId()),Long.parseLong(ProcessSpecVersion.getPartsId()) |
| | | ,ProcessSpecVersion.getProcessSpecVersionName(),ProcessSpecVersion.getProcessSpecVersionCode(),"4"); |
| | | productMixService.save(productMix); |
| | | //添加用户权限 |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(ProcessSpecVersion.getId()); |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(processSpecVersion.getId(),"4","1"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(processSpecVersion.getId()); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(processSpecVersion.getId()); |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 根据工艺规程id查询,下级工序工步数量 |
| | | * @param processSpecId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> getProcessSpecVersionCount(String processSpecId){ |
| | | return null; |
| | | } |
| | | } |