| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class ComponentInfoSeServiceImpl extends ServiceImpl<ComponentInfoMapper, ComponentInfo> implements IComponentInfoService { |
| | |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //添加结构树 |
| | | ProductMix productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(productInfo.getProductId()) |
| | | ,componentInfo.getComponentName(),componentInfo.getComponentCode(),2); |
| | | ProductMix productMix=null; |
| | | if (componentInfo.getParentId() != null) { |
| | | //子部件 |
| | | productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(componentInfo.getParentId()) |
| | | ,componentInfo.getComponentName(),componentInfo.getComponentCode(),2,new Date()); |
| | | }else { |
| | | productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(productInfo.getProductId()) |
| | | ,componentInfo.getComponentName(),componentInfo.getComponentCode(),2,new Date()); |
| | | } |
| | | productMixService.save(productMix); |
| | | //添加权限 |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setUserId(userId); |
| | | stream.setBusinessId(componentInfo.getComponentId()); |
| | | stream.setBusinessType("2"); |
| | | return permissionStreamNewService.save(stream); |
| | | return permissionStreamNewService.addPermissionStreamNew(stream); |
| | | } |
| | | |
| | | @Override |