| | |
| | | private String recordId; |
| | | |
| | | /** 发问号 */ |
| | | @Excel(name = "发问号") |
| | | @Excel(name = "发文号") |
| | | private String inquiryNumber; |
| | | |
| | | public String getEveryProjectName() { |
| | |
| | | this.everyProjectName = everyProjectName; |
| | | } |
| | | |
| | | @Excel(name = "每个案卷属于的项目名称") |
| | | @Excel(name = "项目名称") |
| | | |
| | | private String everyProjectName; |
| | | /** 案卷题名 */ |
| | |
| | | |
| | | /** 密级 */ |
| | | @Excel(name = "密级") |
| | | |
| | | private String securityClassification; |
| | | |
| | | @Excel(name = "案卷状态") |
| New file |
| | |
| | | package com.ruoyi.domain.vo; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ArchiveRecordModelExp { |
| | | /** 档案号 */ |
| | | @Excel(name = "档案号") |
| | | private String recordId; |
| | | |
| | | /** 发问号 */ |
| | | @Excel(name = "发文号") |
| | | private String inquiryNumber; |
| | | |
| | | |
| | | @Excel(name = "项目名称") |
| | | |
| | | private String everyProjectName; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | @Data |
| | | public class ArchiveRecordModelOther { |
| | | |
| | | |
| | | |
| | | /** 档案号 */ |
| | | @Excel(name = "档案号") |
| | | private String recordId; |
| | | |
| | | |
| | | |
| | | |
| | | /** 案卷题名 */ |
| | | @Excel(name = "案卷题名") |
| | | private String caseTitle; |
| | | |
| | | /** 公开属性 */ |
| | | @Excel(name = "公开属性") |
| | | private String publicAttribute; |
| | | |
| | | /** 编制单位 */ |
| | | @Excel(name = "编制单位") |
| | | private String preparationUnit; |
| | | |
| | | /** 编制日期 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "编制日期", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date preparationDate; |
| | | |
| | | /** 保管期限 */ |
| | | @Excel(name = "保管期限") |
| | | private String retentionPeriod; |
| | | |
| | | /** 密级 */ |
| | | @Excel(name = "密级", readConverterExp = "该页另存=普通") |
| | | private String securityClassification; |
| | | |
| | | @Excel(name = "案卷状态") |
| | | private String recordStatus; |
| | | |
| | | /** 案卷页数 */ |
| | | @Excel(name = "案卷页数") |
| | | private Long pageCount; |
| | | |
| | | /** 立案号 */ |
| | | @Excel(name = "立案号") |
| | | private String filingNumber; |
| | | |
| | | /** 建设单位 */ |
| | | @Excel(name = "建设单位") |
| | | private String constructionUnit; |
| | | |
| | | /** 建设地址 */ |
| | | @Excel(name = "建设地址") |
| | | private String constructionAddress; |
| | | |
| | | /** 建设项目名称 */ |
| | | @Excel(name = "建设项目名称") |
| | | private String projectName; |
| | | |
| | | /** 项目编号 */ |
| | | @Excel(name = "项目编号") |
| | | private String projectNumber; |
| | | |
| | | /** 扫描加工公司 */ |
| | | @Excel(name = "扫描加工公司") |
| | | private String scanningCompany; |
| | | |
| | | /** 档案管(室)号 */ |
| | | @Excel(name = "档案管(室)号") |
| | | private String archiveRoomNumber; |
| | | |
| | | /** 缩微号 */ |
| | | @Excel(name = "缩微号") |
| | | private String microfilmNumber; |
| | | |
| | | /** 备注 */ |
| | | @Excel(name = "备注") |
| | | private String remarks; |
| | | |
| | | |
| | | |
| | | |
| | | /** 历史相关发文号 */ |
| | | @Excel(name = "历史相关发文号") |
| | | private String historicalReferenceNumber; |
| | | } |
| | |
| | | private String retentionPeriod; |
| | | |
| | | /** $column.columnComment */ |
| | | @Excel(name = "密级") |
| | | @Excel(name = "密级", readConverterExp = "该页另存=普通,普通=普通") |
| | | private String securityLevel; |
| | | |
| | | /** $column.columnComment */ |
| | |
| | | private String retentionPeriod; |
| | | |
| | | /** $column.columnComment */ |
| | | @Excel(name = "密级") |
| | | @Excel(name = "密级", readConverterExp = "该页另存=普通,普通=普通") |
| | | private String securityLevel; |
| | | |
| | | /** $column.columnComment */ |
| | |
| | | |
| | | |
| | | //根据题名拿到最大的pageOrder |
| | | @Select("select count(*) from document_materials where title=#{title} and page_number<#{pageNumber} and stage=#{stage}") |
| | | Long getMaxPageOrder(@Param("title")String title,@Param("pageNumber") Long pageNumber,@Param("stage") String stage); |
| | | @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); |
| | | |
| | | //计算文件的序号 |
| | | @Select("select count(distinct(title))-1 from document_materials where page_number<=#{pageNumber}") |
| | | Long getFileNumber(@Param("pageNumber") Long pageNumber); |
| | | @Select("select count(distinct(title))-1 from document_materials where page_number<=#{pageNumber} and record_id=#{recordId}") |
| | | Long getFileNumber(@Param("pageNumber") Long pageNumber, @Param("recordId") Long recordId); |
| | | |
| | | |
| | | |
| | | |
| | | //查询卷内目录 |
| | | @Select( |
| | |
| | | |
| | | public int updateStatusByIds(Long [] ids); |
| | | public List<ArchiveRecordSmall> findByIds(ArchiveRecords archiveRecords); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDocumentMaterialsByMaterialId(String materialId); |
| | | public Long getFiNum(Long pageNumber); |
| | | public Long getFiNum(Long pageNumber, Long recordId); |
| | | public int updateByPageNumber(Long pageNumber,String sizeType, Long fileNumber, int wid, int hei, int wdpi, int hdpi, double sz,String url,String format, Long recordId); |
| | | public List<DocumentMaterialsVo> findArchMInfo(String recordId); |
| | | |
| | |
| | | public List<DocumentMaterialFileStyle> findFileStyleInfo(@Param("recordId") int recordId); |
| | | |
| | | public AjaxResult importExcel(MultipartFile file, String recordId); |
| | | |
| | | |
| | | //根据pageNumber拿到document_materials的信息 |
| | | DocumentMaterials selectByPageNumber(Long pageNumber, Integer recordId); |
| | | } |
| | |
| | | |
| | | for (ArchiveRecords archiveRecords : dataList) { |
| | | // physcialService.mySave(physcial); |
| | | archiveRecords.setRecordStatus("未录入"); |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | archiveRecords.setCreateTime(date); |
| | | this.mySave(archiveRecords); |
| | | } |
| | | |
| | |
| | | if (list.size() > 0) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据recordId进行数据修改 |
| | | this.baseMapper.update(archiveRecords, lqw); |
| | | return AjaxResult.success(); |
| | | // if() |
| | | |
| | | this.baseMapper.update(archiveRecords, lqw); |
| | | return AjaxResult.success(); |
| | | |
| | | |
| | | } |
| | | else { |
| | | Long userid = SecurityUtils.getUserId(); |
| | | if(userid==1) { |
| | | if (save(archiveRecords)) { |
| | | return AjaxResult.success(); |
| | | } else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | else |
| | | return AjaxResult.error("档案号不存在!"); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | .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 Long getFiNum(Long pageNumber) { |
| | | return this.baseMapper.getFileNumber(pageNumber); |
| | | public Long getFiNum(Long pageNumber, Long recordId) { |
| | | return this.baseMapper.getFileNumber(pageNumber, recordId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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; |
| | | } |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.web.controller.archive; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.domain.ArchiveRecords; |
| | | import com.ruoyi.domain.vo.AnalysisResult; |
| | | import com.ruoyi.domain.vo.ArchiveRecordModelExp; |
| | | import com.ruoyi.domain.vo.ArchiveRecordModelOther; |
| | | import com.ruoyi.domain.vo.DocumentMaterialFileSmallVo; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import com.ruoyi.service.IArchiveRecordsService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | { |
| | | return new AjaxResult(200, archiveRecordsService.updateArchiveById(Long.parseLong(id))+""); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/model") |
| | | public void getExportModel(HttpServletResponse response){ |
| | | List<ArchiveRecordModelExp> list = Collections.singletonList(new ArchiveRecordModelExp()); |
| | | ExcelUtil<ArchiveRecordModelExp> util = new ExcelUtil<>(ArchiveRecordModelExp.class); |
| | | util.exportExcel(response,list,"档案信息导入模板"); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/modelOther") |
| | | public void getExportModelOther(HttpServletResponse response){ |
| | | List<ArchiveRecordModelOther> list = Collections.singletonList(new ArchiveRecordModelOther()); |
| | | ExcelUtil<ArchiveRecordModelOther> util = new ExcelUtil<>(ArchiveRecordModelOther.class); |
| | | util.exportExcel(response,list,"档案信息导入模板"); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import javax.imageio.ImageIO; |
| | |
| | | import com.ruoyi.domain.DocumentMaterials; |
| | | import com.ruoyi.domain.vo.DocumentMaterialFileSmallVo; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import com.ruoyi.framework.web.domain.server.Sys; |
| | | import com.ruoyi.service.IDocumentMaterialsService; |
| | | import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; |
| | | import org.apache.commons.imaging.ImageInfo; |
| | |
| | | return "A0"; |
| | | } |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, Long recordId) throws Exception |
| | | @PostMapping("/upload/{recordId}") |
| | | public AjaxResult uploadFile(MultipartFile file, @PathVariable Long recordId) throws Exception |
| | | { |
| | | // System.out.println("sdfd9999999999999999999999999999999"); |
| | | try |
| | |
| | | //分割文件名 |
| | | String [] nams = fname.split("\\."); |
| | | Long nam = Long.parseLong(nams[0]); |
| | | //文件名称 |
| | | String pname = nams[1]; |
| | | ajax.put("url", url); |
| | | //拿到图像属性 |
| | | BufferedImage bufferedImage = ImageIO.read(file.getInputStream()); |
| | | int wid = bufferedImage.getWidth(); |
| | | int hei = bufferedImage.getHeight(); |
| | | double sz = Double.parseDouble(String.format("%.2f", file.getSize()*1.0/1024)); |
| | | System.out.println(wid+":"+hei+":"+sz); |
| | | //拿到图像的dpi信息 |
| | | //根据页号拿到案卷的详细信息 |
| | | System.out.println("0-------------"); |
| | | System.out.println(recordId); |
| | | DocumentMaterials doc = documentMaterialsService.selectByPageNumber(nam, Math.toIntExact(recordId)); |
| | | if(doc==null) |
| | | return AjaxResult.error("无对应页号,请检查清楚附件以及对应的输入!"); |
| | | else{ |
| | | if(doc.getSecurityLevel().equals("该页另存")) |
| | | { |
| | | //替换为了准备好的图像 |
| | | //读取服务器上的图像 |
| | | // new InputStream(); |
| | | String fp = filePath + "\\0071.jpg"; |
| | | Path path = Paths.get(fp); |
| | | File fil = new File(fp); |
| | | //拿到图像属性 |
| | | BufferedImage bufferedImage = ImageIO.read(Files.newInputStream(path)); |
| | | int wid = bufferedImage.getWidth(); |
| | | int hei = bufferedImage.getHeight(); |
| | | double sz = Double.parseDouble(String.format("%.2f", Files.size(path)*1.0/1024)); |
| | | System.out.println("ddsdsdsd"); |
| | | System.out.println(wid+":"+hei+":"+sz); |
| | | |
| | | ImageInfo info = Imaging.getImageInfo(file.getBytes()); |
| | | //拿到图像的dpi信息 |
| | | |
| | | ImageInfo info = Imaging.getImageInfo(Files.readAllBytes(path)); |
| | | |
| | | |
| | | int wdpi = info.getPhysicalWidthDpi() ; |
| | | int hdpi = info.getPhysicalHeightDpi(); |
| | | System.out.println("DPI: " + info.getPhysicalWidthDpi()); |
| | | //计算fileNumber |
| | | Long fileNumber = documentMaterialsService.getFiNum(nam); |
| | | //计算sizeType |
| | | String sizeType = getPageSize(wid*hei); |
| | | //插入数据库对应的url当中 |
| | | documentMaterialsService.updateByPageNumber(nam, sizeType, fileNumber,wid, hei,wdpi, hdpi, sz, fileName, pname, recordId); |
| | | // System.out.println(url); |
| | | int wdpi = info.getPhysicalWidthDpi() ; |
| | | int hdpi = info.getPhysicalHeightDpi(); |
| | | System.out.println("DPI: " + info.getPhysicalWidthDpi()); |
| | | //计算fileNumber |
| | | Long fileNumber = documentMaterialsService.getFiNum(nam,recordId); |
| | | //计算sizeType |
| | | String sizeType = getPageSize(wid*hei); |
| | | String us = "/profile/upload/0071.jpg"; |
| | | documentMaterialsService.updateByPageNumber(nam, sizeType, fileNumber,wid, hei,wdpi, hdpi, sz, us, "jpg", recordId); |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | //文件名称 |
| | | String pname = nams[1]; |
| | | ajax.put("url", url); |
| | | //拿到图像属性 |
| | | BufferedImage bufferedImage = ImageIO.read(file.getInputStream()); |
| | | int wid = bufferedImage.getWidth(); |
| | | int hei = bufferedImage.getHeight(); |
| | | double sz = Double.parseDouble(String.format("%.2f", file.getSize()*1.0/1024)); |
| | | System.out.println(wid+":"+hei+":"+sz); |
| | | //拿到图像的dpi信息 |
| | | |
| | | ImageInfo info = Imaging.getImageInfo(file.getBytes()); |
| | | |
| | | |
| | | int wdpi = info.getPhysicalWidthDpi() ; |
| | | int hdpi = info.getPhysicalHeightDpi(); |
| | | System.out.println("DPI: " + info.getPhysicalWidthDpi()); |
| | | //计算fileNumber |
| | | Long fileNumber = documentMaterialsService.getFiNum(nam, recordId); |
| | | //计算sizeType |
| | | String sizeType = getPageSize(wid*hei); |
| | | //插入数据库对应的url当中 |
| | | documentMaterialsService.updateByPageNumber(nam, sizeType, fileNumber,wid, hei,wdpi, hdpi, sz, fileName, pname, recordId); |
| | | // |
| | | } |
| | | } |
| | | System.out.println(url); |
| | | // System.out.println(fileName); |
| | | ajax.put("fileName", fileName); |
| | | // System.out.println(FileUtils.getName(fileName)); |