yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.smartman.common.constant.CommonConstant;
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.oss.model.OssFile;
import com.qianwen.core.secure.utils.AuthUtil;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.smartman.modules.dnc.convert.DncFactoryFileConvert;
import com.qianwen.smartman.modules.dnc.dto.DncOperationLogDto;
import com.qianwen.smartman.modules.dnc.entity.DncFactoryFile;
import com.qianwen.smartman.modules.dnc.enums.DncEnums;
import com.qianwen.smartman.modules.dnc.mapper.DncFactoryFileMapper;
import com.qianwen.smartman.modules.dnc.service.IDncFactoryFileService;
import com.qianwen.smartman.modules.dnc.service.IDncOperationLogService;
import com.qianwen.smartman.modules.dnc.service.IObsFileService;
import com.qianwen.smartman.modules.dnc.vo.DncFactoryFileVO;
import com.qianwen.smartman.modules.dnc.vo.FileHistoryVO;
import com.qianwen.smartman.modules.dnc.vo.FileVersionSwitchVO;
import com.qianwen.smartman.modules.resource.builder.oss.OssBuilder;
import com.qianwen.smartman.modules.system.entity.User;
import com.qianwen.smartman.modules.system.service.IUserService;
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/DncFactoryFileServiceImpl.class */
public class DncFactoryFileServiceImpl extends BaseServiceImpl<DncFactoryFileMapper, DncFactoryFile> implements IDncFactoryFileService {
    private final IUserService userService;
    private final IDncOperationLogService dncOperationLogService;
    private final IObsFileService obsFileService;
    private final OssBuilder ossBuilder;
 
    private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
        String implMethodName = lambda.getImplMethodName();
        boolean z = true;
        switch (implMethodName.hashCode()) {
            case 98245393:
                if (implMethodName.equals("getId")) {
                    z = true;
                    break;
                }
                break;
            case 537556537:
                if (implMethodName.equals("getIsCurrent")) {
                    z = true;
                    break;
                }
                break;
            case 804592199:
                if (implMethodName.equals("getSuffix")) {
                    z = true;
                    break;
                }
                break;
            case 1071464927:
                if (implMethodName.equals("getCreateTime")) {
                    z = true;
                    break;
                }
                break;
            case 1343131517:
                if (implMethodName.equals("getFilename")) {
                    z = true;
                    break;
                }
                break;
            case 1388468386:
                if (implMethodName.equals("getVersion")) {
                    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/dnc/entity/DncFactoryFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getVersion();
                    };
                }
                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/DncFactoryFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
                    return (v0) -> {
                        return v0.getSuffix();
                    };
                }
                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/util/Date;")) {
                    return (v0) -> {
                        return v0.getCreateTime();
                    };
                }
                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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && 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/DncFactoryFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getIsCurrent();
                    };
                }
                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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
                    return (v0) -> {
                        return v0.getId();
                    };
                }
                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");
    }
 
    public DncFactoryFileServiceImpl(final IUserService userService, final IDncOperationLogService dncOperationLogService, final IObsFileService obsFileService, final OssBuilder ossBuilder) {
        this.userService = userService;
        this.dncOperationLogService = dncOperationLogService;
        this.obsFileService = obsFileService;
        this.ossBuilder = ossBuilder;
    }
 
    @Override // org.springblade.modules.dnc.service.IDncFactoryFileService
    public DncFactoryFileVO addFactoryFile(DncFactoryFileVO dncFactoryFileVO) {
        DncFactoryFile dncFactoryFile = DncFactoryFileConvert.INSTANCE.convert(dncFactoryFileVO);
        String filename = dncFactoryFileVO.getFilename();
        DncFactoryFile oldFile = (DncFactoryFile) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getFilename();
        }, filename)).eq((v0) -> {
            return v0.getIsCurrent();
        }, DncEnums.CurrentVersion.YES.getCode()));
        OssFile ossFile = this.ossBuilder.template().statFile(dncFactoryFile.getObjectKey());
        String hash = ossFile.getHash();
        if (Func.isNull(oldFile)) {
            dncFactoryFile.setContentMd5(hash);
            dncFactoryFile.setVersion(CommonConstant.VERSION_NUM);
            saveFactoryFile(dncFactoryFileVO, dncFactoryFile, filename);
        } else if (!hash.equals(oldFile.getContentMd5())) {
            update((Wrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().eq((v0) -> {
                return v0.getFilename();
            }, filename)).set((v0) -> {
                return v0.getIsCurrent();
            }, DncEnums.CurrentVersion.NO.getCode()));
            dncFactoryFile.setContentMd5(hash);
            dncFactoryFile.setVersion(Integer.valueOf((oldFile.getVersion() != null ? oldFile.getVersion() : CommonConstant.VERSION_NUM).intValue() + CommonConstant.VERSION_NUM.intValue()));
            saveFactoryFile(dncFactoryFileVO, dncFactoryFile, filename);
        }
        return dncFactoryFileVO;
    }
 
    private void saveFactoryFile(DncFactoryFileVO dncFactoryFileVO, DncFactoryFile dncFactoryFile, String filename) {
        dncFactoryFile.setIsCurrent(DncEnums.CurrentVersion.YES.getCode());
        save(dncFactoryFile);
        DncOperationLogDto dncOperationLogDto = new DncOperationLogDto();
        dncOperationLogDto.setFileId(dncFactoryFile.getId()).setFileName(filename).setObjectKey(dncFactoryFileVO.getObjectKey()).setSuffix(dncFactoryFileVO.getSuffix()).setOperatorId(AuthUtil.getUserId()).setOperatorName(AuthUtil.getUserAccount()).setOperationType(DncEnums.LogOperationType.UPLOAD.getCode()).setOperationResponse(CommonConstant.VERSION_NUM).setOperationTime(new Date()).setSourceType(DncEnums.LogFileSourceType.LOCAL_FILE.getCode()).setTargetType(DncEnums.LogFileSourceType.STATION_FILE.getCode()).setLink(dncFactoryFileVO.getLink()).setFileLocation(DncEnums.FileLocation.ETHERNET.getCode()).setVersion(dncFactoryFile.getVersion());
        this.dncOperationLogService.insertLog(dncOperationLogDto);
    }
 
    @Override // org.springblade.modules.dnc.service.IDncFactoryFileService
    public void writeFileLog(DncFactoryFile dncFactoryFile) {
        DncOperationLogDto dncOperationLogDto = new DncOperationLogDto();
        dncOperationLogDto.setFileId(dncFactoryFile.getId()).setFileName(dncFactoryFile.getFilename()).setObjectKey(dncFactoryFile.getObjectKey()).setSuffix(dncFactoryFile.getSuffix()).setOperatorId(AuthUtil.getUserId()).setOperatorName(AuthUtil.getUserAccount()).setOperationType(DncEnums.LogOperationType.DELETE.getCode()).setOperationResponse(CommonConstant.VERSION_NUM).setOperationTime(new Date()).setSourceType(DncEnums.LogFileSourceType.STATION_FILE.getCode()).setTargetType(DncEnums.LogFileSourceType.STATION_FILE.getCode()).setLink(dncFactoryFile.getLink()).setFileLocation(DncEnums.FileLocation.ETHERNET.getCode()).setVersion(dncFactoryFile.getVersion());
        this.dncOperationLogService.insertLog(dncOperationLogDto);
    }
 
    @Override // org.springblade.modules.dnc.service.IDncFactoryFileService
    public Boolean verifyFileName(String fileName, String objectKey) {
        DncFactoryFile one = (DncFactoryFile) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getFilename();
        }, fileName)).eq((v0) -> {
            return v0.getIsCurrent();
        }, DncEnums.CurrentVersion.YES.getCode()));
        if (one != null) {
            boolean result = this.obsFileService.verifyFileContent(objectKey, one.getContentMd5());
            if (result) {
                return true;
            }
        }
        return false;
    }
 
    @Override // org.springblade.modules.dnc.service.IDncFactoryFileService
    public IPage<DncFactoryFileVO> listPages(String keywords, Query query) {
        Map<Long, User> userMap = (Map) this.userService.list().stream().collect(Collectors.toMap((v0) -> {
            return v0.getId();
        }, Function.identity()));
        IPage<DncFactoryFile> pages = page(Condition.getPage(query), (Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getIsCurrent();
        }, DncEnums.CurrentVersion.YES.getCode())).and(Func.isNotEmpty(keywords), i -> {
            LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) i.likeRight((v0) -> {
                return v0.getFilename();
            }, keywords)).or()).likeRight((v0) -> {
                return v0.getSuffix();
            }, keywords);
        }).orderByDesc((v0) -> {
            return v0.getCreateTime();
        }));
        IPage<DncFactoryFileVO> convert = DncFactoryFileConvert.INSTANCE.convert(pages);
        convert.getRecords().forEach(s -> {
            User upUser = (User) userMap.get(s.getUpdateUser());
            User crUser = (User) userMap.get(s.getCreateUser());
            s.setUpdateUserName(upUser != null ? upUser.getAccount() : "");
            s.setCreateUserName(crUser != null ? crUser.getAccount() : "");
            s.setVersionDesc(Func.isNotEmpty(s.getVersion()) ? s.getVersion() + CommonConstant.FILE_SUFFIX : "");
        });
        return convert;
    }
 
    @Override // org.springblade.modules.dnc.service.IDncFactoryFileService
    public List<FileHistoryVO> getFactoryFileHistory(String fileId) {
        Map<Long, User> userMap = (Map) this.userService.list().stream().collect(Collectors.toMap((v0) -> {
            return v0.getId();
        }, Function.identity()));
        DncFactoryFile dncFactoryFile = (DncFactoryFile) getById(fileId);
        if (dncFactoryFile == null) {
            throw new ServiceException(MessageUtils.message("dnc.file.is.not.exists", new Object[0]));
        }
        List<DncFactoryFile> list = list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getFilename();
        }, dncFactoryFile.getFilename())).orderByDesc((v0) -> {
            return v0.getVersion();
        }));
        if (Func.isNotEmpty(list)) {
            return (List) list.stream().map(s -> {
                return FileHistoryVO.builder().id(s.getId()).createTime(s.getCreateTime()).filename(s.getFilename()).objectKey(s.getObjectKey()).isCurrent(s.getIsCurrent()).link(s.getLink()).contentMd5(s.getContentMd5()).contentLength(s.getContentLength()).contentType(s.getContentType()).suffix(s.getSuffix()).createUser(((User) userMap.get(s.getCreateUser())).getAccount()).updateUser(((User) userMap.get(s.getUpdateUser())).getAccount()).updateTime(s.getUpdateTime()).version(s.getVersion() != null ? String.valueOf(s.getVersion()) : "1").versionDesc(s.getVersion() != null ? s.getVersion() + CommonConstant.FILE_SUFFIX : CommonConstant.VERSION_NUM + CommonConstant.FILE_SUFFIX).build();
            }).collect(Collectors.toList());
        }
        return new ArrayList();
    }
 
    @Override // org.springblade.modules.dnc.service.IDncFactoryFileService
    @Transactional(rollbackFor = {Exception.class})
    public Boolean switchVersion(FileVersionSwitchVO fileVersionSwitchVO) {
        boolean result = false;
        if (Func.isNotBlank(fileVersionSwitchVO.getSwitchFileId()) && Func.isNotBlank(fileVersionSwitchVO.getCurrentFileId())) {
            DncFactoryFile file = (DncFactoryFile) getById(fileVersionSwitchVO.getCurrentFileId());
            if (file == null || !DncEnums.CurrentVersion.YES.getCode().equals(file.getIsCurrent())) {
                throw new ServiceException(MessageUtils.message("dnc.workstation.file.is.not.exist.or.is.not.current.version", new Object[0]));
            }
            boolean updateSwitch = update((Wrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> {
                return v0.getIsCurrent();
            }, DncEnums.CurrentVersion.YES.getCode())).eq((v0) -> {
                return v0.getId();
            }, fileVersionSwitchVO.getSwitchFileId()));
            boolean updateCurrent = update((Wrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> {
                return v0.getIsCurrent();
            }, DncEnums.CurrentVersion.NO.getCode())).eq((v0) -> {
                return v0.getId();
            }, fileVersionSwitchVO.getCurrentFileId()));
            if (updateSwitch && updateCurrent) {
                result = true;
            }
        }
        return Boolean.valueOf(result);
    }
}