| | |
| | | <artifactId>spring-test</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | /** $column.columnComment */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long materialId; |
| | | @Excel(name = "文件材料序号", handler = NumberFormatHandler.class) |
| | | @Excel(name = "文件材料序号", handler = NumberFormatHandler.class, headerColor = IndexedColors.BLACK) |
| | | private Long fileNumber; |
| | | |
| | | |
| | | @Excel(name = "文件编号") |
| | | @Excel(name = "文件编号", headerColor = IndexedColors.BLACK) |
| | | private String documentNumber; |
| | | |
| | | |
| | |
| | | private Date date; |
| | | |
| | | /** $column.columnComment */ |
| | | @Excel(name = "页号", handler = NumberFormatHandler.class, headerColor = IndexedColors.BLACK) |
| | | // @Excel(name = "页号", handler = NumberFormatHandler.class, headerColor = IndexedColors.BLACK) |
| | | private Long pageNumber; |
| | | |
| | | @Excel(name = "页号", height = 10,width = 10,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE) |
| | | private String pageNumberFormatted; |
| | | /** $column.columnComment */ |
| | | @Excel(name = "页次", headerColor = IndexedColors.BLACK) |
| | | private Long pageOrder; |
| | |
| | | @Excel(name = "日期", width = 10, dateFormat = "yyyy-MM-dd", height = 10,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE) |
| | | |
| | | private Date date; |
| | | @Excel(name = "页号", height = 10,width = 10,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE) |
| | | |
| | | // 页号(原始数值,用于计算) |
| | | private Long pageNumber; |
| | | |
| | | // 格式化后的页号,用于显示范围,如"38-38"或"23-38" |
| | | @Excel(name = "页号", height = 10,width = 10,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE) |
| | | private String pageNumberFormatted; |
| | | @Excel(name = "备注", height = 20,width=10,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE) |
| | | private String remarks; |
| | | |
| | |
| | | // @Excel(name = "图片", cellType = Excel.ColumnType.IMAGE) |
| | | // private String url; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | private Date date; |
| | | @Excel(name = "页号",width = 10, headerFontSize=12, headerColor = IndexedColors.BLACK, headerFontBold = true) |
| | | |
| | | private String pageNumberFormatted; |
| | | private Long pageNumber; |
| | | @Excel(name = "备注",width = 8, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true) |
| | | private String remarks; |
| | | |
| | | public DocumentMaterialsVoSmall(Long num, String documentNumber, String creator, String title, Date date, Long pageNumber, String remarks) { |
| | | public DocumentMaterialsVoSmall(Long num, String documentNumber, String creator, String title, Date date, String pageNumberFormatted, String remarks) { |
| | | this.num = num; |
| | | this.documentNumber = documentNumber; |
| | | this.creator = creator; |
| | | this.title = title; |
| | | this.date = date; |
| | | this.pageNumber = pageNumber; |
| | | this.pageNumberFormatted = pageNumberFormatted; |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | |
| | | package com.ruoyi.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.domain.DocumentMaterials; |
| | | import com.ruoyi.domain.vo.DocumentMaterialFileStyle; |
| | | import com.ruoyi.domain.vo.DocumentMaterialsFileList; |
| | | import com.ruoyi.domain.vo.DocumentMaterialsVo; |
| | | import com.ruoyi.domain.vo.DocumentMaterialsVoLarge; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | /** |
| | | * 【文件材料综合信息】Mapper接口 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-07-26 |
| | | */ |
| | | @Mapper |
| | | public interface DocumentMaterialsMapper extends BaseMapper<DocumentMaterials> { |
| | | |
| | | @Select("update document_materials SET url = #{url},size_type=#{sizeType}, file_number=#{fileNumber},page_order=#{pageOrder},width=#{width},height=#{height},horizontal_resolution=#{horizontalResolution},vertical_resolution=#{verticalResolution},file_size=#{fileSize}, format=#{format} where page_number = #{pageNumber} and record_id=#{recordId}") |
| | | Long updateInfoByPageNumber(@Param("pageNumber") Long pageNumber,@Param("sizeType") String sizeType, @Param("fileNumber") Long fileNumber,@Param("pageOrder") Long pageOrder,@Param("width") int width, @Param("height") int height, @Param("horizontalResolution") int horizontalResolution, @Param("verticalResolution") int verticalResolution, @Param("fileSize") Double fileSize,@Param("url") String url,@Param("format") String format, @Param("recordId") Long recordId); |
| | | |
| | | |
| | | //根据题名拿到最大的pageOrder |
| | | @Select("select count(*) from document_materials where title=#{title} and page_number<#{pageNumber} and stage=#{stage} and record_id=#{recordId}") |
| | | Long getMaxPageOrder(@Param("title")String title,@Param("pageNumber") Long pageNumber,@Param("stage") String stage, @Param("recordId") Long recordId); |
| | | |
| | | //计算文件的序号,title有可能重复 |
| | | @Select("select count(distinct(concat_ws(',', title, stage)))-1 from document_materials where page_number<=#{pageNumber} and record_id=#{recordId}") |
| | | Long getFileNumber(@Param("pageNumber") Long pageNumber, @Param("recordId") Long recordId); |
| | | |
| | | |
| | | |
| | | |
| | | //查询卷内目录 |
| | | @Select( |
| | | "select ROW_NUMBER() OVER (ORDER BY page_number) AS num, document_number, creator,title, date, page_number,dm.remarks, ar.record_id, publicity from document_materials as dm, archive_records as ar \n" + |
| | | " WHERE ar.id = dm.record_id and page_number IN (\n" + |
| | | " SELECT MIN(page_number)\n" + |
| | | " FROM document_materials where record_id=#{recordId}\n" + |
| | | " GROUP BY stage, title) and ar.id =#{recordId} order by page_number ;") |
| | | List<DocumentMaterialsVo> getArchiveMatInfo(@Param("recordId") int recordId); |
| | | |
| | | |
| | | @Select( "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,ar.record_id, file_number, \n" + |
| | | " document_number, creator, title, date, page_number, page_order, \n" + |
| | | " stage, publicity, is_attachment, dm.retention_period, security_level, is_sensitive,\n" + |
| | | " is_canceled, format, size_type, horizontal_resolution, vertical_resolution, width,\n" + |
| | | " height, file_size, attachment_history_numbers,url, dm.remarks\n" + |
| | | " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" + |
| | | "and dm.record_id=#{recordId} and file_style!='其它材料' ") |
| | | List<DocumentMaterialsVoLarge> getDocumentMaterialsvoLarge(@Param("recordId") int recordId); |
| | | @Select( "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,file_style, ar.record_id, ar.inquiry_number, ar.case_title, " + |
| | | " document_number, title, page_number, \n" + |
| | | " publicity, dm.retention_period, dm.remarks\n" + |
| | | " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" + |
| | | "and dm.record_id=#{recordId} and file_style!='其它材料' ") |
| | | List<DocumentMaterialsFileList> getDocumentMaterialsFileList(@Param("recordId") int recordId); |
| | | @Select("select count(*) as cnt, file_style from document_materials " + |
| | | "where record_id=#{recordId} GROUP BY file_style") |
| | | |
| | | List<DocumentMaterialFileStyle> getFileStyleInfo(@Param("recordId") int recordId); |
| | | |
| | | @Select("select if(count(*) < max(page_number), false, true) as res from document_materials where record_id=#{recordId}") |
| | | boolean isPageNumberLegal(@Param("recordId") int recordId); |
| | | |
| | | |
| | | //拿到除其它材料之外的全部数据的个数 |
| | | @Select("select count(*) FROM document_materials where file_style!='其他材料' and record_id=#{recordId}") |
| | | int getCount(@Param("recordId") int recordId); |
| | | |
| | | |
| | | //判断卷内目录是否全部上传了附件 |
| | | @Select("select if(num=total_count, true, false) as res from (\n" + |
| | | "SELECT\n" + |
| | | " ROW_NUMBER() OVER (ORDER BY page_number) AS num, SUM(CASE WHEN dm.url IS NOT NULL THEN 1 ELSE 0 END) OVER() AS total_count\n" + |
| | | " from document_materials as dm, archive_records as ar \n" + |
| | | " WHERE ar.id = dm.record_id and page_number IN (SELECT MIN(page_number) \n" + |
| | | " FROM document_materials where record_id=#{recordId}\n" + |
| | | " GROUP BY stage, title) and ar.id =#{recordId} order by page_number desc limit 1) as res ") |
| | | Boolean judgeArchiveInfo( @Param("recordId") int recordId); |
| | | |
| | | } |
| | | package com.ruoyi.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.ruoyi.domain.DocumentMaterials;
|
| | | import com.ruoyi.domain.vo.DocumentMaterialFileStyle;
|
| | | import com.ruoyi.domain.vo.DocumentMaterialsFileList;
|
| | | import com.ruoyi.domain.vo.DocumentMaterialsVo;
|
| | | import com.ruoyi.domain.vo.DocumentMaterialsVoLarge;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.apache.ibatis.annotations.Select;
|
| | |
|
| | | import java.util.List;
|
| | | /**
|
| | | * 【文件材料综合信息】Mapper接口
|
| | | *
|
| | | * @author ruoyi
|
| | | * @date 2025-07-26
|
| | | */
|
| | | @Mapper
|
| | | public interface DocumentMaterialsMapper extends BaseMapper<DocumentMaterials> {
|
| | |
|
| | | @Select("update document_materials SET url = #{url},size_type=#{sizeType}, file_number=#{fileNumber},page_order=#{pageOrder},width=#{width},height=#{height},horizontal_resolution=#{horizontalResolution},vertical_resolution=#{verticalResolution},file_size=#{fileSize}, format=#{format} where page_number = #{pageNumber} and record_id=#{recordId}")
|
| | | Long updateInfoByPageNumber(@Param("pageNumber") Long pageNumber,@Param("sizeType") String sizeType, @Param("fileNumber") Long fileNumber,@Param("pageOrder") Long pageOrder,@Param("width") int width, @Param("height") int height, @Param("horizontalResolution") int horizontalResolution, @Param("verticalResolution") int verticalResolution, @Param("fileSize") Double fileSize,@Param("url") String url,@Param("format") String format, @Param("recordId") Long recordId);
|
| | |
|
| | |
|
| | | //根据题名拿到最大的pageOrder
|
| | | @Select("select count(*) from document_materials where title=#{title} and page_number<#{pageNumber} and stage=#{stage} and record_id=#{recordId}")
|
| | | Long getMaxPageOrder(@Param("title")String title,@Param("pageNumber") Long pageNumber,@Param("stage") String stage, @Param("recordId") Long recordId);
|
| | |
|
| | | //计算文件的序号,title有可能重复
|
| | | @Select("select count(distinct(concat_ws(',', title, stage)))-1 from document_materials where page_number<=#{pageNumber} and record_id=#{recordId}")
|
| | | Long getFileNumber(@Param("pageNumber") Long pageNumber, @Param("recordId") Long recordId);
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | //查询卷内目录
|
| | | @Select(
|
| | | "select ROW_NUMBER() OVER (ORDER BY page_number) AS num, document_number, creator,title, date, page_number,dm.remarks, ar.record_id, publicity from document_materials as dm, archive_records as ar \n" +
|
| | | " WHERE ar.id = dm.record_id and page_number IN (\n" +
|
| | | " SELECT MIN(page_number)\n" +
|
| | | " FROM document_materials where record_id=#{recordId}\n" +
|
| | | " GROUP BY stage, title) and ar.id =#{recordId} order by page_number ;")
|
| | | List<DocumentMaterialsVo> getArchiveMatInfo(@Param("recordId") int recordId);
|
| | |
|
| | |
|
| | | @Select( "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,ar.record_id, file_number, \n" +
|
| | | " document_number, creator, title, date, page_number, page_order, \n" +
|
| | | " stage, publicity, is_attachment, dm.retention_period, security_level, is_sensitive,\n" +
|
| | | " is_canceled, format, size_type, horizontal_resolution, vertical_resolution, width,\n" +
|
| | | " height, file_size, attachment_history_numbers,url, dm.remarks\n" +
|
| | | " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
|
| | | "and dm.record_id=#{recordId} and file_style!='其它材料' ")
|
| | | List<DocumentMaterialsVoLarge> getDocumentMaterialsvoLarge(@Param("recordId") int recordId);
|
| | | @Select( "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,file_style, ar.record_id, ar.inquiry_number, ar.case_title, " +
|
| | | " document_number, title, page_number, \n" +
|
| | | " publicity, dm.retention_period, dm.remarks\n" +
|
| | | " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
|
| | | "and dm.record_id=#{recordId} and file_style!='其它材料' ")
|
| | | List<DocumentMaterialsFileList> getDocumentMaterialsFileList(@Param("recordId") int recordId);
|
| | | @Select("select count(*) as cnt, file_style from document_materials " +
|
| | | "where record_id=#{recordId} GROUP BY file_style")
|
| | |
|
| | | List<DocumentMaterialFileStyle> getFileStyleInfo(@Param("recordId") int recordId);
|
| | |
|
| | | @Select("select if(count(*) < max(page_number), false, true) as res from document_materials where record_id=#{recordId}")
|
| | | boolean isPageNumberLegal(@Param("recordId") int recordId);
|
| | |
|
| | |
|
| | | //拿到除其它材料之外的全部数据的个数
|
| | | @Select("select count(*) FROM document_materials where file_style!='其他材料' and record_id=#{recordId}")
|
| | | int getCount(@Param("recordId") int recordId);
|
| | | |
| | | //获取指定案卷的最大页号
|
| | | @Select("select max(page_number) FROM document_materials where record_id=#{recordId}")
|
| | | Long getMaxPageNumber(@Param("recordId") int recordId);
|
| | |
|
| | |
|
| | | //判断卷内目录是否全部上传了附件
|
| | | @Select("select if(num=total_count, true, false) as res from (\n" +
|
| | | "SELECT\n" +
|
| | | " ROW_NUMBER() OVER (ORDER BY page_number) AS num, SUM(CASE WHEN dm.url IS NOT NULL THEN 1 ELSE 0 END) OVER() AS total_count\n" +
|
| | | " from document_materials as dm, archive_records as ar \n" +
|
| | | " WHERE ar.id = dm.record_id and page_number IN (SELECT MIN(page_number) \n" +
|
| | | " FROM document_materials where record_id=#{recordId}\n" +
|
| | | " GROUP BY stage, title) and ar.id =#{recordId} order by page_number desc limit 1) as res ")
|
| | | Boolean judgeArchiveInfo( @Param("recordId") int recordId);
|
| | |
|
| | | }
|
| | |
|
| | |
| | | public int updateStatusByIds(Long [] ids); |
| | | public List<ArchiveRecordSmall> findByIds(ArchiveRecords archiveRecords); |
| | | |
| | | AjaxResult mySave(ArchiveRecords archiveRecords); |
| | | |
| | | boolean whether(@Param("recordId") Long recordId); |
| | | |
| | | |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ArchiveRecords; |
| | | import com.ruoyi.domain.Archiverecordstouser; |
| | | import com.ruoyi.domain.vo.AnalysisResult; |
| | | import com.ruoyi.domain.vo.ArchiveInfoVo; |
| | | import com.ruoyi.domain.vo.ArchiveRecordSmall; |
| | | import com.ruoyi.mapper.ArchiveRecordsMapper; |
| | | import com.ruoyi.mapper.ArchiverecordstouserMapper; |
| | | import com.ruoyi.service.IArchiveRecordsService; |
| | | import com.ruoyi.service.IArchiverecordstouserService; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | // @Autowired |
| | | // private ArchiveRecordsMapper archiveRecordsMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private IArchiverecordstouserService archiverecordstouserService; |
| | | @Autowired |
| | | private ArchiverecordstouserMapper archiverecordstouserMapper; |
| | | |
| | |
| | | |
| | | @Override |
| | | public int updateArchiveById(String status, Long id) { |
| | | |
| | | // 获取当前用户ID |
| | | Long userId = SecurityUtils.getUserId(); |
| | | // 可以在这里使用userId进行授权操作 |
| | | archiverecordstouserService.deleteArchiverecordstouserByRecordId(id, userId); |
| | | this.baseMapper.updateStatusById(status, id); |
| | | return 0; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult mySave(ArchiveRecords archiveRecords) { |
| | | |
| | | |
| | | //检查是否有重复数据插入 |
| | | // 检查是否有重复数据插入 |
| | | LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId,archiveRecords.getRecordId()); |
| | | List<ArchiveRecords> list = list(lqw); |
| | |
| | | return this.baseMapper.whether(recordId); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public int insertDocumentMaterials(DocumentMaterials documentMaterials) { |
| | | |
| | | |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | documentMaterials.setCreatedAt(date); |
| | | System.out.println(documentMaterials.getFileStyle()); |
| | |
| | | boolean res = false; |
| | | try { |
| | | res = this.save(documentMaterials); |
| | | |
| | | } catch (Exception e) { |
| | | System.out.println(e); |
| | | throw new ErrorcodeExceptionextends(500, "同一个案卷内,不允许页码重复!"); |
| | |
| | | |
| | | @Override |
| | | public List<DocumentMaterialsVo> findArchMInfo(String recordId) { |
| | | return this.baseMapper.getArchiveMatInfo(Integer.parseInt(recordId)); |
| | | // 获取原始数据列表 |
| | | List<DocumentMaterialsVo> dataList = this.baseMapper.getArchiveMatInfo(Integer.parseInt(recordId)); |
| | | |
| | | // 获取该案卷的最大页号(总页数) |
| | | Long totalPages = this.baseMapper.getMaxPageNumber(Integer.parseInt(recordId)); |
| | | |
| | | // 如果数据列表不为空 |
| | | if (dataList != null && !dataList.isEmpty() && totalPages != null) { |
| | | int size = dataList.size(); |
| | | |
| | | // 遍历所有条目,设置pageNumberFormatted |
| | | for (int i = 0; i < size; i++) { |
| | | DocumentMaterialsVo item = dataList.get(i); |
| | | Long pageNumber = item.getPageNumber(); |
| | | |
| | | if (i == size - 1) { |
| | | // 最后一行:格式化页号为"最后一页页号-总页数"的形式 |
| | | item.setPageNumberFormatted(pageNumber + "-" + totalPages); |
| | | } else { |
| | | // 其他行:直接使用pageNumber的值 |
| | | item.setPageNumberFormatted(pageNumber != null ? pageNumber.toString() : ""); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return dataList; |
| | | } |
| | | |
| | | @Override |
| | |
| | | BeanUtils.copyProperties(archiveCategory, documentMaterials); |
| | | documentMaterials.setRecordId(Long.parseLong(recordId)); |
| | | documentMaterials.setVisible(1); |
| | | // 验证必填字段 |
| | | if (StringUtils.isEmpty(documentMaterials.getTitle())) { |
| | | throw new ErrorcodeExceptionextends(400, "文件题名不能为空"); |
| | | } |
| | | if (StringUtils.isEmpty(documentMaterials.getFileStyle())) { |
| | | throw new ErrorcodeExceptionextends(400, "材料类型不能为空"); |
| | | } |
| | | // 材料类型不是"其它材料"时,页号必须输入 |
| | | if (!"其他材料".equals(documentMaterials.getFileStyle()) && documentMaterials.getPageNumber() == null) { |
| | | throw new ErrorcodeExceptionextends(400, "当前材料类型非其它材料,页号必须输入"); |
| | | } |
| | | if (StringUtils.isEmpty(documentMaterials.getIsAttachment())) { |
| | | throw new ErrorcodeExceptionextends(400, "是否为附件不能为空"); |
| | | } |
| | | if (StringUtils.isEmpty(documentMaterials.getStage())) { |
| | | throw new ErrorcodeExceptionextends(400, "所处阶段不能为空"); |
| | | } |
| | | if (StringUtils.isEmpty(documentMaterials.getRetentionPeriod())) { |
| | | throw new ErrorcodeExceptionextends(400, "保管期限不能为空"); |
| | | } |
| | | if (StringUtils.isEmpty(documentMaterials.getIsSensitive())) { |
| | | throw new ErrorcodeExceptionextends(400, "是否敏感不能为空"); |
| | | } |
| | | if (StringUtils.isEmpty(documentMaterials.getIsCanceled())) { |
| | | throw new ErrorcodeExceptionextends(400, "是否注销不能为空"); |
| | | } |
| | | this.insertDocumentMaterials(documentMaterials); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | <build> |
| | | <plugins> |
| | | |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>2.5.15</version> |
| | | <configuration> |
| | | |
| | | <includeSystemScope>true</includeSystemScope> |
| | | <mainClass>com.ruoyi.RuoYiApplication</mainClass> |
| | | <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> |
| | | </configuration> |
| | | <executions> |
| | |
| | | <configuration> |
| | | <source>1.8</source> |
| | | <target>1.8</target> |
| | | <encoding>UTF-8</encoding> |
| | | <!-- <compilerArgs>--> |
| | | <!-- <arg>-XDignore.symbol.file</arg>--> |
| | | <!-- </compilerArgs>--> |
| | | <!-- <fork>true</fork>--> |
| | | </configuration> |
| | | </plugin> |
| | | |
| | | </plugins> |
| | | |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | | |
| | |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelExp; |
| | | import com.ruoyi.common.utils.poi.ExcelUtilManySheetFour; |
| | | import com.ruoyi.common.utils.poi.ExcelUtilManySheetSecond; |
| | | import com.ruoyi.domain.ArchiveRecords; |
| | | import com.ruoyi.domain.DocumentMaterials; |
| | | import com.ruoyi.domain.vo.*; |
| | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelExp; |
| | | import com.ruoyi.common.utils.poi.ExcelUtilManySheet; |
| | | import com.ruoyi.common.utils.poi.ExcelUtilManySheetSecond; |
| | | import com.ruoyi.domain.ArchiveCategory; |
| | | import com.ruoyi.domain.ArchiveProjectName; |
| | | import com.ruoyi.domain.ArchiveRecords; |
| | | import com.ruoyi.domain.DocumentMaterials; |
| | | import com.ruoyi.domain.vo.*; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import com.ruoyi.framework.web.domain.server.Sys; |
| | | import com.ruoyi.service.IArchiveProjectNameService; |
| | | import com.ruoyi.service.IArchiveRecordsService; |
| | | import com.ruoyi.service.IDocumentMaterialsService; |
| | | import com.ruoyi.service.impl.BarcodeService; |
| | |
| | | @RequestMapping("/system/materials") |
| | | public class DocumentMaterialsController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IArchiveProjectNameService iArchiveProjectNameService; |
| | | @Autowired |
| | | private BarcodeService barcodeService; |
| | | @Autowired |
| | |
| | | { |
| | | //09-备考表.pdf |
| | | String pdf09Path = "09-备考表.pdf"; |
| | | |
| | | //根据项目名称拿到公司名称和项目负责人 |
| | | |
| | | String compName = "广州盈家档案管理有限公司"; |
| | | String li_person = "仇翀"; |
| | | String sh_person = "曾瑞莹"; |
| | | ArchiveRecords archiveRecords = iArchiveRecordsService.selectArchiveRecordsById(id); |
| | | ArchiveProjectName tmp = new ArchiveProjectName(); |
| | | tmp.setName(archiveRecords.getProjectName()); |
| | | List<ArchiveProjectName> projectName = iArchiveProjectNameService.selectArchiveProjectNameList(tmp); |
| | | if(!projectName.isEmpty()) |
| | | { |
| | | if(StringUtils.isEmpty(projectName.get(0).getCompanyName())) |
| | | compName = projectName.get(0).getCompanyName(); |
| | | if(StringUtils.isEmpty(projectName.get(0).getCreatePerson())) |
| | | li_person = projectName.get(0).getCreatePerson(); |
| | | } |
| | | // pdfGenerateService.generateFileStyleInfo(pdf09Path, aIV.getRecordId(), id); |
| | | //拿到相关数据 |
| | | List<DocumentMaterialFileStyle> dmfs = documentMaterialsService.findFileStyleInfo(Math.toIntExact(id)); |
| | |
| | | hs.put("picPages", picPages); |
| | | hs.put("texPages", texPages); |
| | | hs.put("volumeNumber", recordId); |
| | | hs.put("company", compName); |
| | | hs.put("time", cdt); |
| | | |
| | | if (!getLicense()) { |
| | |
| | | try { |
| | | |
| | | // 获取 Word 模板所在路径 |
| | | String filepath = "09-备考表.docx"; |
| | | // String filepath = "09-备考表.docx"; |
| | | // // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | // XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | // ); |
| | | // 获取 Word 模板所在路径 |
| | | ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); |
| | | org.springframework.core.io.Resource resource = resolver.getResource("classpath:09.docx"); |
| | | // String filepath = resource.getFile().getAbsolutePath(); |
| | | // // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | // XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | // ); |
| | | |
| | | InputStream inputStream = resource.getInputStream(); |
| | | // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(hs |
| | | ); |
| | | |
| | | String renderedDocPath = "rendered_output.docx"; |
| | |
| | | |
| | | //拿到卷内目录的excel |
| | | List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(), |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumber(), res1.getRemarks())).collect(Collectors.toList()); |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList()); |
| | | if(!dsvs.isEmpty()) { |
| | | String recordId = dsvs.get(0).getRecordId(); |
| | | byte[] imgr = barcodeService.generateBarcodeImage(recordId); |
| | |
| | | import com.itextpdf.text.*; |
| | | import com.itextpdf.text.pdf.PdfPCell; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.poi.*; |
| | | import com.ruoyi.domain.ArchiveProjectName; |
| | | import com.ruoyi.domain.ArchiveRecords; |
| | | import com.ruoyi.domain.DocumentMaterials; |
| | | import com.ruoyi.domain.vo.*; |
| | | import com.ruoyi.service.IArchiveProjectNameService; |
| | | import com.ruoyi.service.IArchiveRecordsService; |
| | | import com.ruoyi.service.IDocumentMaterialsService; |
| | | import com.ruoyi.service.impl.BarcodeService; |
| | |
| | | private BarcodeService barcodeService; |
| | | @Autowired |
| | | private IDocumentMaterialsService documentMaterialsService; |
| | | |
| | | @Autowired |
| | | private IArchiveProjectNameService iArchiveProjectNameService; |
| | | @Autowired |
| | | private IArchiveRecordsService iArchiveRecordsService; |
| | | |
| | |
| | | picPages = documentMaterialFileStyle.getCnt(); |
| | | } |
| | | } |
| | | |
| | | |
| | | String compName = "广州盈家档案管理有限公司"; |
| | | String li_person = "仇翀"; |
| | | String sh_person = "曾瑞莹"; |
| | | ArchiveRecords archiveRecords1 = iArchiveRecordsService.selectArchiveRecordsById(ids[i]); |
| | | ArchiveProjectName tmp = new ArchiveProjectName(); |
| | | tmp.setName(archiveRecords1.getProjectName()); |
| | | List<ArchiveProjectName> projectName = iArchiveProjectNameService.selectArchiveProjectNameList(tmp); |
| | | if(!projectName.isEmpty()) |
| | | { |
| | | if(StringUtils.isEmpty(projectName.get(0).getCompanyName())) |
| | | compName = projectName.get(0).getCompanyName(); |
| | | if(StringUtils.isEmpty(projectName.get(0).getCreatePerson())) |
| | | li_person = projectName.get(0).getCreatePerson(); |
| | | } |
| | | allPages = texPages + picPages + patPages; |
| | | hs.put("pages", allPages); |
| | | hs.put("patPages", patPages); |
| | | hs.put("picPages", picPages); |
| | | hs.put("texPages", texPages); |
| | | hs.put("volumeNumber", aIV.getRecordId()); |
| | | hs.put("company", compName); |
| | | |
| | | hs.put("time", cdt); |
| | | |
| | | if (!getLicense()) { |
| | |
| | | |
| | | try { |
| | | |
| | | // 获取 Word 模板所在路径 |
| | | String filepath = "09-备考表.docx"; |
| | | ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); |
| | | org.springframework.core.io.Resource resource = resolver.getResource("classpath:09.docx"); |
| | | // String filepath = resource.getFile().getAbsolutePath(); |
| | | // // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | // XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | // ); |
| | | |
| | | InputStream inputStream = resource.getInputStream(); |
| | | // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(hs |
| | | ); |
| | | |
| | | String renderedDocPath = "rendered_output.docx"; |
| | |
| | | |
| | | //拿到卷内目录的excel |
| | | List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(), |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumber(), res1.getRemarks())).collect(Collectors.toList()); |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList()); |
| | | if(!dsvs.isEmpty()) { |
| | | String recordId = dsvs.get(0).getRecordId(); |
| | | byte[] imgr = barcodeService.generateBarcodeImage(recordId); |
| | |
| | | picPages = documentMaterialFileStyle.getCnt(); |
| | | } |
| | | } |
| | | |
| | | String compName = "广州盈家档案管理有限公司"; |
| | | String li_person = "仇翀"; |
| | | String sh_person = "曾瑞莹"; |
| | | ArchiveRecords archiveRecords = iArchiveRecordsService.selectArchiveRecordsById(id); |
| | | ArchiveProjectName tmp = new ArchiveProjectName(); |
| | | tmp.setName(archiveRecords.getProjectName()); |
| | | List<ArchiveProjectName> projectName = iArchiveProjectNameService.selectArchiveProjectNameList(tmp); |
| | | if(!projectName.isEmpty()) |
| | | { |
| | | if(StringUtils.isEmpty(projectName.get(0).getCompanyName())) |
| | | compName = projectName.get(0).getCompanyName(); |
| | | if(StringUtils.isEmpty(projectName.get(0).getCreatePerson())) |
| | | li_person = projectName.get(0).getCreatePerson(); |
| | | } |
| | | |
| | | allPages = texPages + picPages + patPages; |
| | | hs.put("pages", allPages); |
| | | hs.put("patPages", patPages); |
| | | hs.put("picPages", picPages); |
| | | hs.put("texPages", texPages); |
| | | hs.put("volumeNumber", aIV.getRecordId()); |
| | | hs.put("company", compName); |
| | | |
| | | hs.put("time", cdt); |
| | | |
| | | if (!getLicense()) { |
| | |
| | | try { |
| | | |
| | | // 获取 Word 模板所在路径 |
| | | String filepath = "09-备考表.docx"; |
| | | // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | ); |
| | | ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); |
| | | org.springframework.core.io.Resource resource = resolver.getResource("classpath:09.docx"); |
| | | // String filepath = resource.getFile().getAbsolutePath(); |
| | | // // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | // XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | // ); |
| | | |
| | | InputStream inputStream = resource.getInputStream(); |
| | | // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(hs |
| | | ); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | String renderedDocPath = "rendered_output.docx"; |
| | | File renderedFile = new File(renderedDocPath); |
| | |
| | | |
| | | |
| | | |
| | | com.aspose.words.Document doc = new com.aspose.words.Document("09-备考表.docx"); |
| | | // com.aspose.words.Document doc = new com.aspose.words.Document("09.docx"); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | //拿到卷内目录的excel |
| | | List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res -> new DocumentMaterialsVoSmall(res.getNum(), res.getDocumentNumber(),res.getCreator(), |
| | | res.getTitle(), res.getDate(), res.getPageNumber(), res.getRemarks())).collect(Collectors.toList()); |
| | | res.getTitle(), res.getDate(), res.getPageNumberFormatted(), res.getRemarks())).collect(Collectors.toList()); |
| | | |
| | | String recordId = dsvs.get(0).getRecordId(); |
| | | byte[] imgr = barcodeService.generateBarcodeImage(recordId); |
| | |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- JSON工具类 --> |
| | | <dependency> |
| | | <groupId>com.fasterxml.jackson.core</groupId> |
| | |
| | | <version>5.5.13</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.sun.xml.messaging.saaj</groupId> |
| | | <artifactId>saaj-impl</artifactId> |
| | | <version>3.0.2</version> |
| | | </dependency> |
| | | |
| | | <!-- 也可以同时添加这个 --> |
| | | <dependency> |
| | | <groupId>javax.xml.soap</groupId> |
| | | <artifactId>javax.xml.soap-api</artifactId> |
| | | <version>1.4.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | <!-- <build>--> |
| | | <!-- <plugins>--> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.apache.maven.plugins</groupId>--> |
| | | <!-- <artifactId>maven-compiler-plugin</artifactId>--> |
| | | <!-- <version>3.1</version>--> |
| | | <!-- <configuration>--> |
| | | <!-- <source>1.8</source>--> |
| | | <!-- <target>1.8</target>--> |
| | | <!-- <encoding>UTF-8</encoding>--> |
| | | <!-- <compilerArgs>--> |
| | | <!-- <arg>-XDignore.symbol.file</arg>--> |
| | | <!-- </compilerArgs>--> |
| | | <!-- <fork>true</fork>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | <!-- </plugins>--> |
| | | <!-- </build>--> |
| | | |
| | | <!-- <build>--> |
| | | <!-- <plugins>--> |
| | | |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.apache.maven.plugins</groupId>--> |
| | |
| | | style.setWrapText(true); |
| | | Font headerFont = wb.createFont(); |
| | | headerFont.setFontName(excel.headerFontName()); |
| | | headerFont.setFontHeightInPoints((short) 12); |
| | | headerFont.setFontHeightInPoints((short) 10); |
| | | headerFont.setBold(excel.headerFontBold()); |
| | | headerFont.setColor(excel.headerColor().index); |
| | | style.setFont(headerFont); |
| | |
| | | } |
| | | return val; |
| | | } |
| | | } |
| | | } |