| | |
| | | package com.qianwen.smartman.modules.dnc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.constant.CommonGroupConstant; |
| | | import com.qianwen.smartman.common.constant.DncConstant; |
| | | import com.qianwen.smartman.common.enums.CommonGroupTypeEnum; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | | import com.qianwen.core.secure.utils.AuthUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.CommonGroupConstant; |
| | | import com.qianwen.smartman.common.constant.DncConstant; |
| | | import com.qianwen.smartman.common.enums.CommonGroupTypeEnum; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.cps.entity.Workstation; |
| | | import com.qianwen.smartman.modules.cps.service.ICommonGroupService; |
| | | import com.qianwen.smartman.modules.cps.service.IWorkstationService; |
| | |
| | | import com.qianwen.smartman.modules.dnc.service.ITransferDirectoryFileService; |
| | | import com.qianwen.smartman.modules.dnc.service.ITransferDirectoryGroupService; |
| | | import com.qianwen.smartman.modules.dnc.service.ITransferDirectoryService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/dnc/service/impl/TransferDirectoryGroupServiceImpl.class */ |
| | |
| | | @Lazy |
| | | private ITransferDirectoryFileService directoryFileService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -557259320: |
| | | if (implMethodName.equals("getWorkstationId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case -307107987: |
| | | if (implMethodName.equals("getWorkstationGroupId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 364793949: |
| | | if (implMethodName.equals("getGroupAllPath")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1330288580: |
| | | if (implMethodName.equals("getGroupId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1956478023: |
| | | if (implMethodName.equals("getTransferDirectoryId")) { |
| | | z = true; |
| | | 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/dnc/entity/TransferDirectory") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectory") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectory") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupAllPath(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectory") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectoryFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTransferDirectoryId(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectoryGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getWorkstationGroupId(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectoryGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getWorkstationGroupId(); |
| | | }; |
| | | } |
| | | break; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | 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/dnc/entity/TransferDirectory") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getTenantId(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectory") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupId(); |
| | | }; |
| | | } |
| | | 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/dnc/entity/TransferDirectory") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.ITransferDirectoryGroupService |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | TransferDirectoryGroup transferDirectoryGroup = TransferDirectoryGroup.builder().build(); |
| | | String parentAllPath = ""; |
| | | if (transferDirectoryGroupDto.getWorkStationGroupParentId() != null) { |
| | | parentGroup = getOne(Wrappers.<TransferDirectoryGroup>lambdaQuery().eq(TransferDirectoryGroup::getWorkstationGroupId, transferDirectoryGroupDto.getWorkStationGroupId())); |
| | | /* |
| | | parentGroup = (TransferDirectoryGroup) getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationGroupId(); |
| | | }, transferDirectoryGroupDto.getWorkStationGroupId())); |
| | | }, transferDirectoryGroupDto.getWorkStationGroupId()));*/ |
| | | if (parentGroup != null) { |
| | | parentAllPath = parentGroup.getAllPath(); |
| | | transferDirectoryGroup.setParentId(parentGroup.getId()); |
| | |
| | | public void deleteWorkstationGroup(Long workstationGroupId) { |
| | | Long rootNodeId = getRootNodeId(); |
| | | if (Func.isNotEmpty(workstationGroupId) && !workstationGroupId.equals(rootNodeId)) { |
| | | TransferDirectoryGroup group = getOne(Wrappers.<TransferDirectoryGroup>lambdaQuery().eq(TransferDirectoryGroup::getWorkstationGroupId, workstationGroupId)); |
| | | /* |
| | | TransferDirectoryGroup group = (TransferDirectoryGroup) getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationGroupId(); |
| | | }, workstationGroupId)); |
| | | }, workstationGroupId));*/ |
| | | if (Func.isNotEmpty(group)) { |
| | | List<Workstation> workstationList = this.workstationService.listWorkStationByGroupId(Collections.singletonList(String.valueOf(group.getWorkstationGroupId()))); |
| | | if (Func.isNotEmpty(workstationList)) { |
| | | List<Long> ids = (List) workstationList.stream().map((v0) -> { |
| | | List<Long> ids = workstationList.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<TransferDirectory> list = this.transferDirectoryService.list(Wrappers.<TransferDirectory>lambdaQuery().in(TransferDirectory::getWorkstationId, ids)); |
| | | /* |
| | | List<TransferDirectory> list = this.transferDirectoryService.list((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, ids)); |
| | | }, ids));*/ |
| | | if (Func.isNotEmpty(list)) { |
| | | this.transferDirectoryService.update(Wrappers.<TransferDirectory>lambdaUpdate().in(TransferDirectory::getWorkstationId, ids) |
| | | .set(TransferDirectory::getGroupAllPath, "/" + rootNodeId) |
| | | .set(TransferDirectory::getGroupId, rootNodeId)); |
| | | List<TransferDirectoryFile> files = this.directoryFileService.list(Wrappers.<TransferDirectoryFile>lambdaQuery().in(TransferDirectoryFile::getTransferDirectoryId, list.stream().map(TransferDirectory::getId).collect(Collectors.toList()))); |
| | | |
| | | /* |
| | | this.transferDirectoryService.update((Wrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().in((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, ids)).set((v0) -> { |
| | |
| | | }, (Collection) list.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()))); |
| | | */ |
| | | for (TransferDirectoryFile file : files) { |
| | | this.directoryFileService.saveOperationLog(file, DncEnums.LogOperationType.MOVE.getCode()); |
| | | } |
| | |
| | | if (DncConstant.WORK_STATION_FILE.equals(name)) { |
| | | throw new ServiceException(MessageUtils.message("dnc.file.name.exist.same.parent.directory", new Object[0])); |
| | | } |
| | | List<TransferDirectory> transferDirectories = this.transferDirectoryService.list(Wrappers.<TransferDirectory>lambdaQuery() |
| | | .eq(TransferDirectory::getName, name) |
| | | .eq(Func.isNotEmpty(parentId), TransferDirectory::getGroupId, parentId) |
| | | .eq(TransferDirectory::getTenantId, tenantId)); |
| | | |
| | | /* |
| | | List<TransferDirectory> transferDirectories = this.transferDirectoryService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getName(); |
| | | }, name)).eq(Func.isNotEmpty(parentId), (v0) -> { |
| | | return v0.getGroupId(); |
| | | }, parentId).eq((v0) -> { |
| | | return v0.getTenantId(); |
| | | }, tenantId)); |
| | | }, tenantId));*/ |
| | | if (Func.isNotEmpty(transferDirectories)) { |
| | | throw new ServiceException(MessageUtils.message("workstation.directory.name.already.exists", new Object[0])); |
| | | } |