| | |
| | | package com.qianwen.smartman.modules.tool.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | | import com.qianwen.core.mp.support.Condition; |
| | | import com.qianwen.core.mp.support.Query; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.tool.convert.ToolModelConvert; |
| | | import com.qianwen.smartman.modules.tool.entity.Tool; |
| | | import com.qianwen.smartman.modules.tool.entity.ToolCategory; |
| | | import com.qianwen.smartman.modules.tool.entity.ToolModel; |
| | | import com.qianwen.smartman.modules.tool.mapper.ToolModelMapper; |
| | |
| | | import com.qianwen.smartman.modules.tool.service.IToolManageService; |
| | | import com.qianwen.smartman.modules.tool.service.IToolModelService; |
| | | import com.qianwen.smartman.modules.tool.vo.ToolModelVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/tool/service/impl/ToolModelServiceImpl.class */ |
| | |
| | | @Lazy |
| | | private IToolManageService toolManageService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1669172377: |
| | | if (implMethodName.equals("getToolCategoryId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 106223670: |
| | | if (implMethodName.equals("getToolModelId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1959895411: |
| | | if (implMethodName.equals("getModel")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tool/entity/ToolModel") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getModel(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tool/entity/Tool") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getToolModelId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tool/entity/ToolModel") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getToolCategoryId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.tool.service.IToolModelService |
| | | public IPage<ToolModelVO> page(String keyWord, Long categoryId, Boolean isShowChild, Query query) { |
| | |
| | | } |
| | | |
| | | private void checkName(ToolModelVO toolModelVO) { |
| | | long count = count(Wrappers.<ToolModel>lambdaQuery() |
| | | .ne(Func.isNotEmpty(toolModelVO.getId()), ToolModel::getId, toolModelVO.getId()) |
| | | .eq(ToolModel::getToolCategoryId, toolModelVO.getToolCategoryId()) |
| | | .eq(ToolModel::getModel, toolModelVO.getModel())); |
| | | /* |
| | | long count = count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().ne(Func.isNotEmpty(toolModelVO.getId()), (v0) -> { |
| | | return v0.getId(); |
| | | }, toolModelVO.getId()).eq((v0) -> { |
| | | return v0.getToolCategoryId(); |
| | | }, toolModelVO.getToolCategoryId())).eq((v0) -> { |
| | | return v0.getModel(); |
| | | }, toolModelVO.getModel())); |
| | | }, toolModelVO.getModel()));*/ |
| | | if (count > 0) { |
| | | throw new ServiceException(MessageUtils.message("tool.model.name.already.exists", new Object[0])); |
| | | } |
| | |
| | | |
| | | @Override // org.springblade.modules.tool.service.IToolModelService |
| | | public boolean remove(List<Long> ids) { |
| | | long count = this.toolManageService.count(Wrappers.<Tool>lambdaQuery().in(Tool::getToolModelId, ids)); |
| | | /* |
| | | long count = this.toolManageService.count((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getToolModelId(); |
| | | }, ids)); |
| | | }, ids));*/ |
| | | if (count > 0) { |
| | | throw new ServiceException(MessageUtils.message("tool.model.have.tool.can.not.delete", new Object[0])); |
| | | } |