| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ArchiveCategory; |
| | | import com.ruoyi.domain.DocumentMaterials; |
| | | import com.ruoyi.domain.vo.DocumentMaterialFileSmallVo; |
| | | import com.ruoyi.domain.vo.DocumentMaterialFileStyle; |
| | | import com.ruoyi.domain.vo.DocumentMaterialsVo; |
| | | import com.ruoyi.domain.vo.DocumentMaterialsVoLarge; |
| | | import com.ruoyi.domain.vo.*; |
| | | import com.ruoyi.mapper.DocumentMaterialsMapper; |
| | | import com.ruoyi.service.IDocumentMaterialsService; |
| | | import com.ruoyi.util.ErrorcodeExceptionextends; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 【文件材料综合信息】Service业务层处理 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-07-26 |
| | | */ |
| | | @Service |
| | | public class DocumentMaterialsServiceImpl extends ServiceImpl<DocumentMaterialsMapper, DocumentMaterials> implements IDocumentMaterialsService { |
| | | private LambdaQueryWrapper<DocumentMaterials> buildCondition(DocumentMaterials documentMaterials){ |
| | |
| | | .like(!StringUtils.isEmpty(documentMaterials.getRetentionPeriod()), DocumentMaterials::getRetentionPeriod, documentMaterials.getRetentionPeriod()) |
| | | .like(!StringUtils.isEmpty(documentMaterials.getSecurityLevel()), DocumentMaterials::getSecurityLevel, documentMaterials.getSecurityLevel()) |
| | | .eq(documentMaterials.getDate()!=null, DocumentMaterials::getDate, documentMaterials.getDate()) |
| | | .eq(documentMaterials.getRecordId()!=null, DocumentMaterials::getRecordId, documentMaterials.getRecordId()); |
| | | // .like(!StringUtils.isEmpty(archiveRecords.getFilingNumber()), ArchiveRecords::getFilingNumber, archiveRecords.getFilingNumber()) |
| | | .eq(documentMaterials.getRecordId()!=null, DocumentMaterials::getRecordId, documentMaterials.getRecordId()) |
| | | .eq(documentMaterials.getPageNumber()!=null, DocumentMaterials::getPageNumber, documentMaterials.getPageNumber()); |
| | | |
| | | // .like(!StringUtils.isEmpty(archiveRecords.getFilingNumber()), ArchiveRecords::getFilingNumber, archiveRecords.getFilingNumber()) |
| | | // .like(!StringUtils.isEmpty(archiveRecords.getArchiveRoomNumber()), ArchiveRecords::getArchiveRoomNumber, archiveRecords.getArchiveRoomNumber()) |
| | | // .like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId()); |
| | | // // .like(!StringUtils.isEmpty(zfProperty.getLocation()), ZfProperty::getLocation, zfProperty.getLocation()) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DocumentMaterialsFileList> selectDocumentMaterialsFileList(Long id) { |
| | | return this.baseMapper.getDocumentMaterialsFileList(Math.toIntExact(id)); |
| | | } |
| | | |
| | | @Override |
| | | public int insertDocumentMaterials(DocumentMaterials documentMaterials) { |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Long getFiNum(Long pageNumber) { |
| | | return this.baseMapper.getFileNumber(pageNumber); |
| | | public Long getFiNum(Long pageNumber, Long recordId) { |
| | | return this.baseMapper.getFileNumber(pageNumber, recordId); |
| | | } |
| | | |
| | | @Override |
| | | public int updateByPageNumber(Long pageNumber, String sizeType, Long fileNumber, int width, int height, int horizontalResolution, int verticalResolution, double fileSize, String url, String format) { |
| | | public int updateByPageNumber(Long pageNumber, String sizeType, Long fileNumber, int width, int height, int horizontalResolution, int verticalResolution, double fileSize, String url, String format, Long recordId) { |
| | | //根据pageNumber拿到title,然后计算pageOrder |
| | | LambdaQueryWrapper<DocumentMaterials> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(pageNumber!=null, DocumentMaterials::getPageNumber, pageNumber); |
| | |
| | | if(pageNumber.equals(1)) |
| | | pageOrder = 1L; |
| | | else { |
| | | Long maxPOrder = this.baseMapper.getMaxPageOrder(records.get(0).getTitle(), pageNumber, records.get(0).getStage()); |
| | | Long maxPOrder = this.baseMapper.getMaxPageOrder(records.get(0).getTitle(), pageNumber, records.get(0).getStage(), recordId); |
| | | if (maxPOrder != null) |
| | | pageOrder = maxPOrder + 1; |
| | | } |
| | | |
| | | this.baseMapper.updateInfoByPageNumber(pageNumber, sizeType,fileNumber,pageOrder, width, height, horizontalResolution, verticalResolution, fileSize, url,format); |
| | | this.baseMapper.updateInfoByPageNumber(pageNumber, sizeType,fileNumber,pageOrder, width, height, horizontalResolution, verticalResolution, fileSize, url,format, recordId); |
| | | |
| | | return 0; |
| | | } |
| | |
| | | } |
| | | |
| | | return AjaxResult.success(); } |
| | | |
| | | @Override |
| | | public DocumentMaterials selectByPageNumber(Long pageNumber, Integer recordId) { |
| | | LambdaQueryWrapper<DocumentMaterials> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(pageNumber!=null, DocumentMaterials::getPageNumber, pageNumber); |
| | | lqw.eq(recordId!=null, DocumentMaterials::getRecordId, recordId); |
| | | List<DocumentMaterials> ls = list(lqw); |
| | | if(!ls.isEmpty()) |
| | | return ls.get(0); |
| | | else |
| | | return null; |
| | | } |
| | | } |