| | |
| | | package com.qianwen.smartman.modules.tpm.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.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | 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.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.qianwen.core.excel.util.ExcelUtil; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.service.impl.BladeServiceImpl; |
| | |
| | | import com.qianwen.core.oss.model.BladeFile; |
| | | import com.qianwen.core.tool.utils.DateUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.resource.builder.oss.OssBuilder; |
| | | import com.qianwen.smartman.modules.system.service.ICodeGeneratorService; |
| | | import com.qianwen.smartman.modules.tpm.convert.CheckRecordConvert; |
| | |
| | | import com.qianwen.smartman.modules.tpm.vo.CheckRecordVO; |
| | | import com.qianwen.smartman.modules.tpm.vo.RecordFilesVO; |
| | | import com.qianwen.smartman.modules.tpm.vo.excel.CheckRecordExcel; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/tpm/service/impl/CheckRecordServiceImpl.class */ |
| | |
| | | private final CheckRecordMapper checkRecordMapper; |
| | | private final ICodeGeneratorService codeGeneratorService; |
| | | private final OssBuilder ossBuilder; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case 85916175: |
| | | if (implMethodName.equals("getCheckResult")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 388478047: |
| | | if (implMethodName.equals("getCheckCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 497623742: |
| | | if (implMethodName.equals("getCheckRecordId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 539848180: |
| | | if (implMethodName.equals("getCheckProjectCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 540162706: |
| | | if (implMethodName.equals("getCheckProjectName")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 653075170: |
| | | if (implMethodName.equals("getCheckProjectId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 761390710: |
| | | if (implMethodName.equals("getRemark")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1071464927: |
| | | if (implMethodName.equals("getCreateTime")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1342380108: |
| | | if (implMethodName.equals("getFileType")) { |
| | | 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/tpm/entity/CheckRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckProjectName(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckResult(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getRemark(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckCode(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckProjectCode(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | 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; |
| | | 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/tpm/entity/CheckRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCheckProjectId(); |
| | | }; |
| | | } |
| | | 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/tpm/entity/CheckRecordFile") && 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/tpm/entity/CheckRecordFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getFileType(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public CheckRecordServiceImpl(final ICheckRecordItemService itemService, final ICheckRecordFileService fileService, final CheckRecordMapper checkRecordMapper, final ICodeGeneratorService codeGeneratorService, final OssBuilder ossBuilder) { |
| | | this.itemService = itemService; |
| | |
| | | if (Func.isEmpty(itemList)) { |
| | | throw new ServiceException(MessageUtils.message("cps.tpm.check.item.can.not.empty", new Object[0])); |
| | | } |
| | | List<CheckRecordItem> items = (List) itemList.stream().map(c -> { |
| | | List<CheckRecordItem> items = itemList.stream().map(c -> { |
| | | return CheckRecordItem.builder().checkRecordId(checkRecord.getId()).checkValue(c.getCheckValue()).itemId(c.getItemId()).name(c.getName()).valueType(c.getValueType()).requirement(c.getRequirement()).standardValue(c.getStandardValue()).build(); |
| | | }).collect(Collectors.toList()); |
| | | this.itemService.saveBatch(items); |
| | | List<CheckRecordFileDTO> pictureList = vo.getPictureList(); |
| | | if (Func.isNotEmpty(pictureList)) { |
| | | List<CheckRecordFile> files = (List) pictureList.stream().map(c2 -> { |
| | | List<CheckRecordFile> files = pictureList.stream().map(c2 -> { |
| | | return CheckRecordFile.builder().checkRecordId(checkRecord.getId()).fileName(c2.getFileName()).objectKey(c2.getObjectKey()).link(c2.getLink()).contentType(c2.getContentType()).fileSize(c2.getFileSize()).uploadTime(c2.getUploadTime()).fileType(FileTypeEnum.PICTURE.getType()).build(); |
| | | }).collect(Collectors.toList()); |
| | | this.fileService.saveBatch(files); |
| | | } |
| | | List<CheckRecordFileDTO> fileList = vo.getFileList(); |
| | | if (Func.isNotEmpty(fileList)) { |
| | | List<CheckRecordFile> files2 = (List) fileList.stream().map(c3 -> { |
| | | List<CheckRecordFile> files2 = fileList.stream().map(c3 -> { |
| | | return CheckRecordFile.builder().checkRecordId(checkRecord.getId()).fileName(c3.getFileName()).objectKey(c3.getObjectKey()).link(c3.getLink()).contentType(c3.getContentType()).fileSize(c3.getFileSize()).uploadTime(c3.getUploadTime()).fileType(FileTypeEnum.FILE.getType()).build(); |
| | | }).collect(Collectors.toList()); |
| | | this.fileService.saveBatch(files2); |
| | |
| | | } |
| | | |
| | | private void validCheckCode(String code) { |
| | | long count = count((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCheckCode(); |
| | | }, code)); |
| | | long count = count(Wrappers.<CheckRecord>lambdaQuery().eq(CheckRecord::getCheckCode, code)); |
| | | if (count > 0) { |
| | | throw new ServiceException(MessageUtils.message("cps.tpm.check.record.code.exists", new Object[0])); |
| | | } |
| | |
| | | public boolean deleteCheckRecord(List<String> ids) { |
| | | if (Func.isNotEmpty(ids)) { |
| | | removeByIds(Func.toLongList(ids)); |
| | | |
| | | this.itemService.remove(Wrappers.<CheckRecordItem>lambdaQuery().in(CheckRecordItem::getCheckRecordId, ids)); |
| | | this.fileService.remove(Wrappers.<CheckRecordFile>lambdaQuery().in(CheckRecordFile::getCheckRecordId, ids)); |
| | | /* |
| | | this.itemService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }, ids)); |
| | | this.fileService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }, ids)); |
| | | }, ids));*/ |
| | | return true; |
| | | } |
| | | return true; |
| | |
| | | Long checkProjectId = vo.getCheckProjectId(); |
| | | Integer checkResult = vo.getCheckResult(); |
| | | String remark = vo.getRemark(); |
| | | update(Wrappers.<CheckRecord>lambdaUpdate() |
| | | .set(Func.isNotEmpty(checkProjectId), CheckRecord::getCheckProjectId, checkProjectId) |
| | | .set(Func.isNotEmpty(vo.getCheckProjectCode()), CheckRecord::getCheckProjectCode, vo.getCheckProjectCode()) |
| | | .set(Func.isNotEmpty(vo.getCheckProjectName()), CheckRecord::getCheckProjectName, vo.getCheckProjectName()) |
| | | .set(Func.isNotEmpty(checkResult), CheckRecord::getCheckResult, checkResult) |
| | | .set(CheckRecord::getRemark, remark) |
| | | .eq(CheckRecord::getId, id)); |
| | | /* |
| | | update((Wrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set(Func.isNotEmpty(checkProjectId), (v0) -> { |
| | | return v0.getCheckProjectId(); |
| | | }, checkProjectId)).set(Func.isNotEmpty(vo.getCheckProjectCode()), (v0) -> { |
| | |
| | | return v0.getRemark(); |
| | | }, remark)).eq((v0) -> { |
| | | return v0.getId(); |
| | | }, id)); |
| | | }, id));*/ |
| | | List<CheckRecordItemDTO> itemList = vo.getItemList(); |
| | | if (Func.isNotEmpty(checkProjectId)) { |
| | | this.itemService.remove((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }, id)); |
| | | this.itemService.remove(Wrappers.<CheckRecordItem>lambdaQuery().eq(CheckRecordItem::getCheckRecordId, id)); |
| | | |
| | | if (Func.isNotEmpty(itemList)) { |
| | | List<CheckRecordItem> items = (List) itemList.stream().map(c -> { |
| | | List<CheckRecordItem> items = itemList.stream().map(c -> { |
| | | return CheckRecordItem.builder().checkRecordId(id).itemId(c.getItemId()).checkValue(c.getCheckValue()).name(c.getName()).valueType(c.getValueType()).requirement(c.getRequirement()).standardValue(c.getStandardValue()).build(); |
| | | }).collect(Collectors.toList()); |
| | | this.itemService.saveBatch(items); |
| | |
| | | public boolean removeItems(String recordId, List<String> ids) { |
| | | boolean flag = true; |
| | | if (Func.isNotEmpty(ids)) { |
| | | flag = this.itemService.remove(Wrappers.<CheckRecordItem>lambdaQuery() |
| | | .eq(CheckRecordItem::getCheckRecordId, recordId) |
| | | .in(CheckRecordItem::getId, ids)); |
| | | /* |
| | | flag = this.itemService.remove((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }, recordId)).in((v0) -> { |
| | | return v0.getId(); |
| | | }, ids)); |
| | | */ |
| | | } |
| | | return flag; |
| | | } |
| | |
| | | public boolean removeFiles(String recordId, List<String> ids) { |
| | | boolean flag = true; |
| | | if (Func.isNotEmpty(ids)) { |
| | | flag = this.fileService.remove(Wrappers.<CheckRecordFile>lambdaQuery() |
| | | .eq(CheckRecordFile::getCheckRecordId, recordId) |
| | | .in(CheckRecordFile::getId, ids)); |
| | | /* |
| | | flag = this.fileService.remove((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }, recordId)).in((v0) -> { |
| | | return v0.getId(); |
| | | }, ids)); |
| | | }, ids));*/ |
| | | } |
| | | return flag; |
| | | } |
| | |
| | | List<CheckRecordFileDTO> files = vo.getFiles(); |
| | | boolean fileFlag = true; |
| | | if (Func.isNotEmpty(files)) { |
| | | List<CheckRecordFile> recordFiles = (List) files.stream().map(c -> { |
| | | List<CheckRecordFile> recordFiles = files.stream().map(c -> { |
| | | return CheckRecordFile.builder().checkRecordId(recordId).fileName(c.getFileName()).link(c.getLink()).objectKey(c.getObjectKey()).contentType(c.getContentType()).fileSize(c.getFileSize()).uploadTime(c.getUploadTime()).fileType(FileTypeEnum.FILE.getType()).build(); |
| | | }).collect(Collectors.toList()); |
| | | fileFlag = this.fileService.saveBatch(recordFiles); |
| | |
| | | List<CheckRecordFileDTO> pictures = vo.getPictures(); |
| | | boolean pictureFlag = true; |
| | | if (Func.isNotEmpty(pictures)) { |
| | | List<CheckRecordFile> recordFiles2 = (List) pictures.stream().map(c2 -> { |
| | | List<CheckRecordFile> recordFiles2 = pictures.stream().map(c2 -> { |
| | | return CheckRecordFile.builder().checkRecordId(recordId).fileName(c2.getFileName()).link(c2.getLink()).objectKey(c2.getObjectKey()).contentType(c2.getContentType()).fileSize(c2.getFileSize()).uploadTime(c2.getUploadTime()).fileType(FileTypeEnum.PICTURE.getType()).build(); |
| | | }).collect(Collectors.toList()); |
| | | pictureFlag = this.fileService.saveBatch(recordFiles2); |
| | |
| | | if (Func.isNotEmpty(todayPage)) { |
| | | return page.setRecords(todayPage); |
| | | } |
| | | return page.setRecords(new ArrayList()); |
| | | return page.setRecords(new ArrayList<>()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.tpm.service.ICheckRecordService |
| | |
| | | LocalDate localDate = LocalDate.now(); |
| | | Date now = DateUtil.toDate(localDate); |
| | | Date plusDays = DateUtil.plusDays(now, 1L); |
| | | return Long.valueOf(count(Wrappers.<CheckRecord>lambdaQuery().between(CheckRecord::getCreateTime, now, plusDays))); |
| | | /* |
| | | return Long.valueOf(count((Wrapper) Wrappers.lambdaQuery().between((v0) -> { |
| | | return v0.getCreateTime(); |
| | | }, now, plusDays))); |
| | | }, now, plusDays)));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.tpm.service.ICheckRecordService |
| | | public CheckRecordDetailVO detail(String id) { |
| | | List<CheckRecordFile> files = this.fileService.list(Wrappers.<CheckRecordFile>lambdaQuery().eq(CheckRecordFile::getCheckRecordId, id).eq(CheckRecordFile::getFileType, FileTypeEnum.FILE.getType())); |
| | | List<CheckRecordFile> pictures = this.fileService.list(Wrappers.<CheckRecordFile>lambdaQuery().eq(CheckRecordFile::getCheckRecordId, id).eq(CheckRecordFile::getFileType, FileTypeEnum.PICTURE.getType())); |
| | | |
| | | /* |
| | | List<CheckRecordFile> files = this.fileService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCheckRecordId(); |
| | | }, id)).eq((v0) -> { |
| | |
| | | return v0.getCheckRecordId(); |
| | | }, id)).eq((v0) -> { |
| | | return v0.getFileType(); |
| | | }, FileTypeEnum.PICTURE.getType())); |
| | | }, FileTypeEnum.PICTURE.getType()));*/ |
| | | List<CheckRecordItemVO> items = this.itemService.listItem(id); |
| | | return CheckRecordDetailVO.builder().files(CheckRecordConvert.INSTANCE.convertFile(files)).pictures(CheckRecordConvert.INSTANCE.convertFile(pictures)).items(items).build(); |
| | | } |