| | |
| | | private IProcessStreamPermissionService processStreamPermissionService; |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | |
| | | @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"); |
| | | if (stream.getPsvId() != null) { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getPsvId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),5); |
| | | }else { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getComponentId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),"5"); |
| | | ,stream.getProcessName(),stream.getProcessCode(),5); |
| | | } |
| | | productMixService.save(productMix); |
| | | //添加权限验证 |
| | |
| | | stream.setProcessName(stream.getProcessName().toUpperCase()); |
| | | stream.setProcessCode(null); |
| | | boolean b = super.updateById(stream); |
| | | //同步修改结构树 |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(stream.getProcessName()); |
| | | productMix.setCode(stream.getProcessCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | ProcessInfo processInfo = new ProcessInfo(); |