| | |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //添加结构树 |
| | | ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0L,productInfo.getProductName(),productInfo.getProductNo(),1); |
| | | ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0L, |
| | | productInfo.getProductName(),productInfo.getProductNo(),1,new Date()); |
| | | productMixService.save(productMix); |
| | | //添加用户部门 |
| | | if(StrUtil.isNotBlank(user.getProductionIds())){ |
| | | String[] split = user.getProductionIds().split(","); |
| | | String[] departIds = split; |
| | | for (String departId : departIds) { |
| | | ProductDepartment productDepartment = new ProductDepartment(); |
| | | productDepartment.setProductId(productInfo.getProductId()); |
| | | productDepartment.setDepartId(departId); |
| | | productDepartmentService.save(productDepartment); |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setDepartId(departId); |
| | | stream.setBusinessType("1"); |
| | | permissionStreamNewService.save(stream); |
| | | } |
| | | } |
| | | //添加用户权限 |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setUserId(userId); |
| | | stream.setBusinessType("1"); |
| | | return permissionStreamNewService.save(stream); |
| | | return permissionStreamNewService.addPermissionStreamNew(stream); |
| | | } |
| | | |
| | | @Override |