| | |
| | | package com.qianwen.smartman.modules.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.tool.utils.BeanUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.modules.system.entity.Region; |
| | | import com.qianwen.smartman.modules.system.excel.RegionExcel; |
| | | import com.qianwen.smartman.modules.system.mapper.RegionMapper; |
| | | import com.qianwen.smartman.modules.system.service.IRegionService; |
| | | import com.qianwen.smartman.modules.system.vo.RegionVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/service/impl/RegionServiceImpl.class */ |
| | | public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements IRegionService { |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -542933587: |
| | | if (implMethodName.equals("getParentCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | 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/system/entity/Region") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/system/entity/Region") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getParentCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | |
| | | @Override // org.springblade.modules.system.service.IRegionService |
| | | public boolean submit(Region region) { |
| | | Long cnt = this.baseMapper.selectCount(Wrappers.<Region>query().lambda().eq(Region::getCode, region.getCode())); |
| | | /* |
| | | Long cnt = ((RegionMapper) this.baseMapper).selectCount((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, region.getCode())); |
| | | }, region.getCode()));*/ |
| | | if (cnt.longValue() > 0) { |
| | | return updateById(region); |
| | | } |
| | |
| | | |
| | | @Override // org.springblade.modules.system.service.IRegionService |
| | | public boolean removeRegion(String id) { |
| | | Long cnt = this.baseMapper.selectCount(Wrappers.<Region>query().lambda().eq(Region::getParentCode, id)); |
| | | /* |
| | | Long cnt = ((RegionMapper) this.baseMapper).selectCount((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getParentCode(); |
| | | }, id)); |
| | | }, id));*/ |
| | | if (cnt.longValue() > 0) { |
| | | throw new ServiceException("请先删除子节点!"); |
| | | } |