| | |
| | | package com.qianwen.smartman.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.DncConstant; |
| | | import com.qianwen.smartman.common.utils.LocalDateTimeUtils; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import com.qianwen.core.excel.util.ExcelUtil; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.oss.OssTemplate; |
| | |
| | | import com.qianwen.core.secure.utils.AuthUtil; |
| | | import com.qianwen.core.tool.api.ResultCode; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.DncConstant; |
| | | import com.qianwen.smartman.common.utils.LocalDateTimeUtils; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.cps.service.IWorkstationService; |
| | | import com.qianwen.smartman.modules.cps.vo.WorkstationVO; |
| | | import com.qianwen.smartman.modules.dnc.context.DncFileNameProcessRuleContext; |
| | |
| | | import com.qianwen.smartman.modules.dnc.vo.EntityInfoVO; |
| | | import com.qianwen.smartman.modules.dnc.vo.FtpDirectoryVO; |
| | | import com.qianwen.smartman.modules.resource.builder.oss.OssBuilder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.util.StrUtil; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/dnc/service/impl/DockingFtpServiceImpl.class */ |
| | |
| | | private final IDncOperationLogService logService; |
| | | private final IDncFixedSpaceService fixedSpaceService; |
| | | private final IDncWsRelationTdService wsRelationTdService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1041904421: |
| | | if (implMethodName.equals("getParentId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -557259320: |
| | | if (implMethodName.equals("getWorkstationId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75127775: |
| | | if (implMethodName.equals("getTdId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 388778789: |
| | | if (implMethodName.equals("getSpaceLocation")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 537556537: |
| | | if (implMethodName.equals("getIsCurrent")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 727664238: |
| | | if (implMethodName.equals("getOriginalFilename")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 973507584: |
| | | if (implMethodName.equals("getCovertTime")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 989020860: |
| | | if (implMethodName.equals("getStorageSpaceId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1342380108: |
| | | if (implMethodName.equals("getFileType")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1343131517: |
| | | if (implMethodName.equals("getFilename")) { |
| | | 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/TransferDirectoryFile") && 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/TransferDirectoryFile") && 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/TransferDirectoryFile") && 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/TransferDirectoryFile") && 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/DncWsRelationTd") && 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/DncWsRelationTd") && 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/DncWsRelationTd") && 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/DncWsRelationTd") && 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/TransferDirectoryFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getFilename(); |
| | | }; |
| | | } |
| | | 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/String;")) { |
| | | return (v0) -> { |
| | | return v0.getFilename(); |
| | | }; |
| | | } |
| | | 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/DncFixedSpace") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/DncFixedSpace") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/DncFixedSpace") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTdId(); |
| | | }; |
| | | } |
| | | 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/DncFixedSpace") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTdId(); |
| | | }; |
| | | } |
| | | 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/util/Date;")) { |
| | | return (v0) -> { |
| | | return v0.getCovertTime(); |
| | | }; |
| | | } |
| | | 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/DncFixedSpace") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getSpaceLocation(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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/DncFixedSpace") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getParentId(); |
| | | }; |
| | | } |
| | | 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/DncFixedSpace") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getParentId(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | 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.getStorageSpaceId(); |
| | | }; |
| | | } |
| | | 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.getStorageSpaceId(); |
| | | }; |
| | | } |
| | | 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.getStorageSpaceId(); |
| | | }; |
| | | } |
| | | 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.getStorageSpaceId(); |
| | | }; |
| | | } |
| | | 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.getStorageSpaceId(); |
| | | }; |
| | | } |
| | | 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.getStorageSpaceId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public DockingFtpServiceImpl(final ITransferDirectoryService transferDirectoryService, final ITransferDirectoryFileService transferDirectoryFileService, final IWorkstationService workstationService, final OssBuilder ossBuilder, final IDncOperationLogService logService, final IDncFixedSpaceService fixedSpaceService, final IDncWsRelationTdService wsRelationTdService) { |
| | | this.transferDirectoryService = transferDirectoryService; |
| | |
| | | if (dncFixedSpace == null) { |
| | | throw new ServiceException(MessageUtils.message("dnc.ftp.relation.workstation.normal.use", new Object[0])); |
| | | } |
| | | TransferDirectoryFile transferDirectoryFile = this.transferDirectoryFileService.getOne(new QueryWrapper<TransferDirectoryFile>().lambda() |
| | | .eq(TransferDirectoryFile::getTransferDirectoryId, transferDirectory.getId()) |
| | | .eq(TransferDirectoryFile::getOriginalFilename, fileName) |
| | | .eq(TransferDirectoryFile::getFileType, 1) |
| | | .eq(Func.isNotEmpty(dncFixedSpace), TransferDirectoryFile::getStorageSpaceId, dncFixedSpace.getId()) |
| | | .eq(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.YES.getCode())); |
| | | /* |
| | | TransferDirectoryFile transferDirectoryFile = (TransferDirectoryFile) this.transferDirectoryFileService.getOne((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) new QueryWrapper().lambda().eq((v0) -> { |
| | | return v0.getTransferDirectoryId(); |
| | | }, transferDirectory.getId())).eq((v0) -> { |
| | |
| | | return v0.getStorageSpaceId(); |
| | | }, dncFixedSpace.getId()).eq((v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }, DncEnums.CurrentVersion.YES.getCode())); |
| | | }, DncEnums.CurrentVersion.YES.getCode()));*/ |
| | | if (transferDirectoryFile == null) { |
| | | throw new ServiceException(MessageUtils.message("dnc.file.is.not.exists", new Object[0])); |
| | | } |
| | |
| | | OssFile ossFile = template.statFile(((BladeFile) Objects.requireNonNull(bladeFile)).getName()); |
| | | log.info("OssFile:{}", ossFile); |
| | | String hash = ossFile.getHash(); |
| | | TransferDirectoryFile currentFile = this.transferDirectoryFileService.getOne(Wrappers.<TransferDirectoryFile>lambdaQuery() |
| | | .eq(TransferDirectoryFile::getTransferDirectoryId, transferDirectory.getId()) |
| | | .eq(TransferDirectoryFile::getFilename, fileName) |
| | | .eq(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.YES.getCode()) |
| | | .eq(TransferDirectoryFile::getFileType, DncEnums.FileType.PROCESSING_PROGRAM.getCode()) |
| | | .eq(TransferDirectoryFile::getStorageSpaceId, dncFixedSpace.getId())); |
| | | /* |
| | | TransferDirectoryFile currentFile = (TransferDirectoryFile) this.transferDirectoryFileService.getOne((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getTransferDirectoryId(); |
| | | }, transferDirectory.getId())).eq((v0) -> { |
| | |
| | | return v0.getFileType(); |
| | | }, DncEnums.FileType.PROCESSING_PROGRAM.getCode())).eq((v0) -> { |
| | | return v0.getStorageSpaceId(); |
| | | }, dncFixedSpace.getId())); |
| | | }, dncFixedSpace.getId()));*/ |
| | | TransferDirectoryFile directoryFile = TransferDirectoryFile.builder().transferDirectoryId(transferDirectory.getId()).workstationId(workStationId).fileType(1).fileSource(DncEnums.FileSource.FTP.getCode()).filename(fileName).originalFilename(fileName).contentMd5(hash).contentLength(Long.valueOf(ossFile.getLength())).contentType(ossFile.getContentType()).objectKey(bladeFile.getName()).suffix(getFileSuffix(fileName)).storageSpace(dncFixedSpace.getSpaceLocation()).storageSpaceId(dncFixedSpace.getId()).isCurrent(DncEnums.CurrentVersion.YES.getCode()).whetherArchive(DncEnums.WhetherArchive.Archive.getCode()).link(ossFile.getLink()).build(); |
| | | if (Func.isNull(currentFile)) { |
| | | directoryFile.setVersion(CommonConstant.VERSION_NUM); |
| | |
| | | } |
| | | |
| | | private void coverFile(String path, Long workStationId) { |
| | | this.transferDirectoryFileService.update(Wrappers.<TransferDirectoryFile>lambdaUpdate() |
| | | .set(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.NO.getCode()) |
| | | .set(TransferDirectoryFile::getCovertTime, DateTime.now()) |
| | | .eq(TransferDirectoryFile::getFileType, DncEnums.FileType.PROCESSING_PROGRAM.getCode()) |
| | | .eq(TransferDirectoryFile::getOriginalFilename, path) |
| | | .eq(TransferDirectoryFile::getWorkstationId, workStationId) |
| | | .eq(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.YES.getCode())); |
| | | |
| | | /* |
| | | this.transferDirectoryFileService.update((Wrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }, DncEnums.CurrentVersion.NO.getCode())).set((v0) -> { |
| | |
| | | return v0.getWorkstationId(); |
| | | }, workStationId)).eq((v0) -> { |
| | | return v0.getIsCurrent(); |
| | | }, DncEnums.CurrentVersion.YES.getCode())); |
| | | }, DncEnums.CurrentVersion.YES.getCode()));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDockingFtpService |
| | |
| | | Long storageSpaceId = dncFixedSpace.getId(); |
| | | String oldName = fileName(oldFileName); |
| | | String newName = fileName(newFileName); |
| | | |
| | | Long count = Long.valueOf(this.transferDirectoryFileService.count(Wrappers.<TransferDirectoryFile>lambdaQuery() |
| | | .eq(TransferDirectoryFile::getWorkstationId, workstationId) |
| | | .eq(TransferDirectoryFile::getStorageSpaceId, storageSpaceId) |
| | | .eq(TransferDirectoryFile::getFileType, DncEnums.FileType.PROCESSING_PROGRAM.getCode()) |
| | | .eq(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.YES.getCode()) |
| | | .eq(TransferDirectoryFile::getOriginalFilename, newName))); |
| | | |
| | | /* |
| | | Long count = Long.valueOf(this.transferDirectoryFileService.count((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, workstationId)).eq((v0) -> { |
| | |
| | | return v0.getIsCurrent(); |
| | | }, DncEnums.CurrentVersion.YES.getCode())).eq((v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }, newName))); |
| | | }, newName)));*/ |
| | | if (count.longValue() > 0) { |
| | | throw new ServiceException(MessageUtils.message("dnc.file.name.exist", new Object[0])); |
| | | } |
| | |
| | | TransferDirectory directory = (TransferDirectory) this.transferDirectoryService.getById(directoryFile.getTransferDirectoryId()); |
| | | WorkstationVO workstationVO = this.workstationService.getDetail(workstationId); |
| | | this.logService.insertLog(new DncOperationLogDto().setLink(directoryFile.getLink()).setWorkstationId(directoryFile.getWorkstationId()).setTargetPathName(workstationVO.getGroupName() + "/" + workstationVO.getName() + "/" + directoryFile.getOriginalFilename()).setTargetPathId(directory.getGroupAllPath()).setTargetType(DncEnums.LogFileSourceType.PROCESSING_PROGRAM.getCode()).setOperationTime(DateTime.now()).setSourceType(DncEnums.LogFileSourceType.FTP.getCode()).setOperationResponse(1).setOperationType(DncEnums.LogOperationType.TO_UPDATE.getCode()).setSuffix(directoryFile.getSuffix()).setObjectKey(directoryFile.getObjectKey()).setFileName(directoryFile.getFilename()).setVersion(directoryFile.getVersion()).setSourcePathName(DncConstant.FTP_PATH).setOperatorName("机床回传").setFileId(directoryFile.getId())); |
| | | |
| | | return this.transferDirectoryFileService.update(Wrappers.<TransferDirectoryFile>lambdaUpdate() |
| | | .set(TransferDirectoryFile::getOriginalFilename, newName) |
| | | .set(TransferDirectoryFile::getFilename, newName) |
| | | .eq(TransferDirectoryFile::getFileType, DncEnums.FileType.PROCESSING_PROGRAM.getCode()) |
| | | .eq(TransferDirectoryFile::getWorkstationId, workstationId) |
| | | .eq(TransferDirectoryFile::getStorageSpaceId, storageSpaceId) |
| | | .eq(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.YES.getCode()) |
| | | .and(i -> i.eq(TransferDirectoryFile::getOriginalFilename, oldName).or().eq(TransferDirectoryFile::getFilename, oldName))); |
| | | /* |
| | | return this.transferDirectoryFileService.update((Wrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> { |
| | | return v0.getOriginalFilename(); |
| | | }, newName)).set((v0) -> { |
| | |
| | | }, oldName)).or()).eq((v0) -> { |
| | | return v0.getFilename(); |
| | | }, oldName); |
| | | })); |
| | | }));*/ |
| | | } |
| | | |
| | | private TransferDirectoryFile getTransferDirectoryFile(Long storageSpaceId, String oldFileName, Long workstationId) { |
| | | return (TransferDirectoryFile)this.transferDirectoryFileService.getOne(Wrappers.<TransferDirectoryFile>lambdaQuery() |
| | | .eq(TransferDirectoryFile::getWorkstationId, workstationId) |
| | | .eq(TransferDirectoryFile::getFileType, DncEnums.FileType.PROCESSING_PROGRAM.getCode()) |
| | | .eq(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.YES.getCode()) |
| | | .eq(TransferDirectoryFile::getStorageSpaceId, storageSpaceId) |
| | | .and(i -> i.eq(TransferDirectoryFile::getOriginalFilename, oldFileName).or().eq(TransferDirectoryFile::getFilename, oldFileName))); |
| | | /* |
| | | return (TransferDirectoryFile) this.transferDirectoryFileService.getOne((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, workstationId)).eq((v0) -> { |
| | |
| | | }, oldFileName)).or()).eq((v0) -> { |
| | | return v0.getFilename(); |
| | | }, oldFileName); |
| | | })); |
| | | }));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDockingFtpService |
| | |
| | | throw new ServiceException(MessageUtils.message("dnc.transfer.directory.no", new Object[0])); |
| | | } |
| | | String fileName = fileName(path); |
| | | |
| | | return Optional.<TransferDirectoryFile>ofNullable(this.transferDirectoryFileService.getOne(new QueryWrapper<TransferDirectoryFile>().lambda() |
| | | .eq(TransferDirectoryFile::getTransferDirectoryId, transferDirectory.getId()) |
| | | .eq(TransferDirectoryFile::getOriginalFilename, fileName) |
| | | .eq(TransferDirectoryFile::getFileType, Integer.valueOf(1)) |
| | | .eq(TransferDirectoryFile::getIsCurrent, DncEnums.CurrentVersion.YES.getCode()) |
| | | .eq(Func.isNotEmpty(dncFixedSpace), TransferDirectoryFile::getStorageSpaceId, dncFixedSpace.getId())) |
| | | ) |
| | | |
| | | .orElse(new TransferDirectoryFile()); |
| | | |
| | | /* |
| | | return (TransferDirectoryFile) Optional.ofNullable(this.transferDirectoryFileService.getOne(((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) new QueryWrapper().lambda().eq((v0) -> { |
| | | return v0.getTransferDirectoryId(); |
| | | }, transferDirectory.getId())).eq((v0) -> { |
| | |
| | | }, DncEnums.CurrentVersion.YES.getCode())).eq(Func.isNotEmpty(dncFixedSpace), (v0) -> { |
| | | return v0.getStorageSpaceId(); |
| | | }, dncFixedSpace.getId()))).orElse(new TransferDirectoryFile()); |
| | | */ |
| | | } |
| | | |
| | | private DncFixedSpace getDirectoryName(String path, Long workstationId) { |
| | | DncFixedSpace dncFixedSpace; |
| | | |
| | | DncFixedSpace dncFixedSpace2; |
| | | DncFixedSpace fixedSpace = null; |
| | | String[] split = StrUtil.split(path, "/"); |
| | |
| | | int len = split.length; |
| | | if (len < 2) { |
| | | Long rootNodeId = this.fixedSpaceService.getRootNodeId(String.valueOf(workstationId)).getRootNodeId(); |
| | | if (Func.isNotEmpty(rootNodeId)) { |
| | | DncFixedSpace dncFixedSpace = (DncFixedSpace)this.fixedSpaceService.getById(rootNodeId); |
| | | if (dncFixedSpace != null) { |
| | | fixedSpace = dncFixedSpace; |
| | | } |
| | | } |
| | | /* |
| | | if (Func.isNotEmpty(rootNodeId) && (dncFixedSpace2 = (DncFixedSpace) this.fixedSpaceService.getById(rootNodeId)) != null) { |
| | | fixedSpace = dncFixedSpace2; |
| | | } |
| | | }*/ |
| | | } |
| | | if (len >= 2) { |
| | | String substr = path.substring(0, path.lastIndexOf("/")); |
| | | Long parentId = getFtpNodeParentId(substr, workstationId); |
| | | String directoryName = substr.substring(substr.lastIndexOf("/") + 1); |
| | | DncWsRelationTd wsRelationTd = this.wsRelationTdService.getOne(Wrappers.<DncWsRelationTd>lambdaQuery().eq(DncWsRelationTd::getWorkstationId, workstationId)); |
| | | |
| | | if (wsRelationTd != null) { |
| | | DncFixedSpace dncFixedSpace = this.fixedSpaceService.getOne(Wrappers.<DncFixedSpace>lambdaQuery() |
| | | .eq(DncFixedSpace::getTdId, wsRelationTd.getTransferDirectorId()) |
| | | .eq(DncFixedSpace::getParentId, parentId) |
| | | .eq(DncFixedSpace::getName, directoryName)); |
| | | if (dncFixedSpace != null) { |
| | | fixedSpace = dncFixedSpace; |
| | | } |
| | | } |
| | | |
| | | /* |
| | | DncWsRelationTd wsRelationTd = (DncWsRelationTd) this.wsRelationTdService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, workstationId)); |
| | | if (wsRelationTd != null && (dncFixedSpace = (DncFixedSpace) this.fixedSpaceService.getOne((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | }, workstationId));*/ |
| | | /* |
| | | if (wsRelationTd != null) && (dncFixedSpace = (DncFixedSpace) this.fixedSpaceService.getOne((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getTdId(); |
| | | }, wsRelationTd.getTransferDirectorId())).eq((v0) -> { |
| | | return v0.getParentId(); |
| | |
| | | return v0.getName(); |
| | | }, directoryName))) != null) { |
| | | fixedSpace = dncFixedSpace; |
| | | } |
| | | }*/ |
| | | } |
| | | } |
| | | return fixedSpace; |
| | |
| | | } |
| | | |
| | | private TransferDirectory getTransferDirectoryByPath(Long workstationId) { |
| | | DncWsRelationTd dncWsRelationTd = this.wsRelationTdService.getOne(Wrappers.<DncWsRelationTd>lambdaQuery().eq(DncWsRelationTd::getWorkstationId, workstationId)); |
| | | /* |
| | | DncWsRelationTd dncWsRelationTd = (DncWsRelationTd) this.wsRelationTdService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, workstationId)); |
| | | }, workstationId));*/ |
| | | if (dncWsRelationTd == null) { |
| | | throw new ServiceException(MessageUtils.message("dnc.workstation.not.binding.ftp.directory", new Object[0])); |
| | | } |
| | |
| | | Long rootNodeId; |
| | | Long workstationId = getWorkstationByPath(); |
| | | int length = path.split("/").length; |
| | | DncWsRelationTd dncWsRelationTd = this.wsRelationTdService.getOne(Wrappers.<DncWsRelationTd>lambdaQuery().eq(DncWsRelationTd::getWorkstationId, workstationId)); |
| | | /* |
| | | DncWsRelationTd dncWsRelationTd = (DncWsRelationTd) this.wsRelationTdService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, workstationId)); |
| | | }, workstationId));*/ |
| | | if (dncWsRelationTd == null) { |
| | | throw new ServiceException(MessageUtils.message("dnc.workstation.not.binding.ftp.directory", new Object[0])); |
| | | } |
| | |
| | | if (Func.isEmpty(fileList)) { |
| | | return Lists.newArrayList(); |
| | | } |
| | | List<Long> artFileIds = (List) fileList.stream().filter(s -> { |
| | | List<Long> artFileIds = fileList.stream().filter(s -> { |
| | | return DncEnums.FileSource.PROCESSING_PROGRAM.getCode().equals(s.getFileSource()); |
| | | }).map((v0) -> { |
| | | return v0.getCraftFileId(); |
| | | }).collect(Collectors.toList()); |
| | | Map<Long, ArtFileInformationDTO> artFileInformationMap = this.transferDirectoryFileService.artFileInformationMap(artFileIds); |
| | | if (StrUtil.isBlank(path) && (rootNodeId = this.fixedSpaceService.getRootNodeId(String.valueOf(workstationId)).getRootNodeId()) != null) { |
| | | List<EntityInfoVO> collect = (List) fileList.stream().filter(s2 -> { |
| | | List<EntityInfoVO> collect = fileList.stream().filter(s2 -> { |
| | | return rootNodeId.equals(s2.getStorageSpaceId()); |
| | | }).map(c -> { |
| | | EntityInfoVO build = EntityInfoVO.builder().id(String.valueOf(c.getId())).objectKey(c.getObjectKey()).isDirectory(Boolean.FALSE).canWrite(Boolean.FALSE).name(c.getOriginalFilename()).size(c.getContentLength()).creationTime(c.getCreateTime() != null ? LocalDateTimeUtils.DateToLocalDateTime(c.getCreateTime()) : LocalDateTime.now()).updateTime(c.getLastModified() == null ? LocalDateTime.now() : LocalDateTimeUtils.DateToLocalDateTime(c.getLastModified())).owner(String.valueOf(c.getCreateUser())).hash(c.getContentMd5()).build(); |
| | |
| | | List<EntityInfoVO> fixSpaceList2 = getFixSpaceList(fixSpaceVOList); |
| | | collect2.addAll(fixSpaceList2); |
| | | } |
| | | List<TransferDirectoryFile> files = (List) fileList.stream().filter(s3 -> { |
| | | List<TransferDirectoryFile> files = fileList.stream().filter(s3 -> { |
| | | return dncFixedSpace.getId().equals(s3.getStorageSpaceId()); |
| | | }).collect(Collectors.toList()); |
| | | if (Func.isNotEmpty(files)) { |
| | | List<EntityInfoVO> entityInfos = (List) files.stream().map(c2 -> { |
| | | List<EntityInfoVO> entityInfos = files.stream().map(c2 -> { |
| | | EntityInfoVO build = EntityInfoVO.builder().id(String.valueOf(c2.getId())).isDirectory(Boolean.FALSE).canWrite(Boolean.FALSE).name(c2.getOriginalFilename()).size(c2.getContentLength()).creationTime(c2.getCreateTime() != null ? LocalDateTimeUtils.DateToLocalDateTime(c2.getCreateTime()) : LocalDateTime.now()).updateTime(c2.getLastModified() == null ? LocalDateTime.now() : LocalDateTimeUtils.DateToLocalDateTime(c2.getLastModified())).owner(String.valueOf(c2.getCreateUser())).hash(c2.getContentMd5()).build(); |
| | | return getEntityInfoVO(artFileInformationMap, c2, build); |
| | | }).collect(Collectors.toList()); |
| | |
| | | } |
| | | return collect2; |
| | | } else { |
| | | return new ArrayList(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private DncFixedSpace getDirectory(String path, Long workstationId) { |
| | | DncFixedSpace dncFixedSpace; |
| | | //DncFixedSpace dncFixedSpace; |
| | | DncFixedSpace fixedSpace = null; |
| | | String directoryName = ""; |
| | | String[] split = StrUtil.split(path, "/"); |
| | |
| | | directoryName = path.substring(path.lastIndexOf("/") + 1); |
| | | } |
| | | Long parentId = getFtpNodeParentId(path, workstationId); |
| | | DncWsRelationTd wsRelationTd = this.wsRelationTdService.getOne(Wrappers.<DncWsRelationTd>lambdaQuery().eq(DncWsRelationTd::getWorkstationId, workstationId)); |
| | | if (wsRelationTd != null) { |
| | | DncFixedSpace dncFixedSpace = this.fixedSpaceService.getOne(Wrappers.<DncFixedSpace>lambdaQuery() |
| | | .eq(DncFixedSpace::getTdId, wsRelationTd.getTransferDirectorId()) |
| | | .eq(DncFixedSpace::getName, directoryName) |
| | | .eq(DncFixedSpace::getParentId, parentId) |
| | | .eq(DncFixedSpace::getSpaceLocation, CommonConstant.CREATE_SAME_DIRECTORY)); |
| | | if (dncFixedSpace != null) |
| | | fixedSpace = dncFixedSpace; |
| | | } |
| | | |
| | | /* |
| | | DncWsRelationTd wsRelationTd = (DncWsRelationTd) this.wsRelationTdService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, workstationId)); |
| | |
| | | return v0.getSpaceLocation(); |
| | | }, CommonConstant.CREATE_SAME_DIRECTORY))) != null) { |
| | | fixedSpace = dncFixedSpace; |
| | | } |
| | | }*/ |
| | | } |
| | | return fixedSpace; |
| | | } |
| | |
| | | private Long getFtpNodeParentId(String path, Long workstationId) { |
| | | String completePathName; |
| | | Long rootNodeId = this.fixedSpaceService.getRootNodeId(String.valueOf(workstationId)).getRootNodeId(); |
| | | DncFixedSpace rootNode = (DncFixedSpace) this.fixedSpaceService.getById(rootNodeId); |
| | | DncFixedSpace rootNode = this.fixedSpaceService.getById(rootNodeId); |
| | | String rootName = rootNode.getName(); |
| | | if (Func.isNotBlank(path)) { |
| | | completePathName = rootName + "/" + path; |
| | |
| | | } |
| | | Map<Long, String> stringMap = this.fixedSpaceService.getFixSpaceLocation(workstationId); |
| | | String str = completePathName; |
| | | Long nodeId = (Long) ((List) stringMap.entrySet().stream().filter(kvEntry -> { |
| | | Long nodeId = (Long) (stringMap.entrySet().stream().filter(kvEntry -> { |
| | | return Objects.equals(str, kvEntry.getValue()); |
| | | }).map((v0) -> { |
| | | return v0.getKey(); |