|
|
@@ -1,7 +1,10 @@
|
|
|
package me.zhengjie.archives.service.impl;
|
|
|
|
|
|
import java.io.File;
|
|
|
+<<<<<<< HEAD
|
|
|
import java.time.LocalDate;
|
|
|
+=======
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
@@ -24,7 +27,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import me.zhengjie.annotation.rest.AnonymousPostMapping;
|
|
|
import me.zhengjie.archives.dao.IGzArchivesDao;
|
|
|
import me.zhengjie.archives.dao.IModelDao;
|
|
|
+<<<<<<< HEAD
|
|
|
import me.zhengjie.archives.dto.GzDetailDto;
|
|
|
+=======
|
|
|
+import me.zhengjie.archives.dto.ArchivesDto;
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
import me.zhengjie.archives.entity.ArchivesEntity;
|
|
|
import me.zhengjie.archives.entity.FileInfoEntity;
|
|
|
import me.zhengjie.archives.entity.GzArchivesEntity;
|
|
|
@@ -47,7 +54,10 @@ import me.zhengjie.archives.vo.GzArchivesVo;
|
|
|
import me.zhengjie.archives.vo.GzPortraitVo;
|
|
|
import me.zhengjie.base.ResponseDTO;
|
|
|
import me.zhengjie.config.FileProperties;
|
|
|
+<<<<<<< HEAD
|
|
|
import me.zhengjie.exception.BadRequestException;
|
|
|
+=======
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
import me.zhengjie.modules.system.service.DictDetailService;
|
|
|
import me.zhengjie.utils.DateUtil;
|
|
|
import me.zhengjie.utils.FileUtil;
|
|
|
@@ -153,7 +163,11 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
List<String> fileInfoImages = new ArrayList<>();
|
|
|
List<String> gzFileImages = new ArrayList<>();
|
|
|
// 判断
|
|
|
+<<<<<<< HEAD
|
|
|
for (String imageId : imageIds) {
|
|
|
+=======
|
|
|
+ for (String imageId : fileInfoImages) {
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
if (imageId.length() == 32) {
|
|
|
gzFileImages.add(imageId);
|
|
|
} else {
|
|
|
@@ -161,6 +175,7 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
}
|
|
|
}
|
|
|
// 这个是新的图片地址
|
|
|
+<<<<<<< HEAD
|
|
|
Map<String, FileInfoEntity> fileInfoMap = new HashMap<>();
|
|
|
if(CollectionUtils.isNotEmpty(fileInfoImages)) {
|
|
|
List<FileInfoEntity> fileInfo = fileInfoService.listByIds(fileInfoImages);
|
|
|
@@ -188,6 +203,27 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
files.add(new File(path + fileInfoMap.get(imageId).getPath()));
|
|
|
}
|
|
|
|
|
|
+=======
|
|
|
+ List<FileInfoEntity> fileInfo = fileInfoService.listByIds(fileInfoImages);
|
|
|
+ Map<String, FileInfoEntity> fileInfoMap = new HashMap<>();
|
|
|
+ for (FileInfoEntity file : fileInfo) {
|
|
|
+ fileInfoMap.put(file.getId(), file);
|
|
|
+ }
|
|
|
+ // ------------------------这个是老的地址
|
|
|
+ QueryWrapper<GzFileTempEntity> tempFile = new QueryWrapper<>();
|
|
|
+ tempFile.eq("pid", archives.getId());
|
|
|
+ List<GzFileTempEntity> tempFiles = gzFileTempService.list(tempFile);
|
|
|
+ Map<String, GzFileTempEntity> tempFilesMap = new HashMap<>();
|
|
|
+ for (GzFileTempEntity file : tempFiles) {
|
|
|
+ tempFilesMap.put(file.getId(), file);
|
|
|
+ }
|
|
|
+ for (String imageId : imageIds) {
|
|
|
+ if (imageId.length() == 32) {
|
|
|
+ GzFileTempEntity gzFileEntity = tempFilesMap.get(imageId);
|
|
|
+ files.add(new File(gzFileEntity.getFilePath() + gzFileEntity.getFileName()));
|
|
|
+ } else {
|
|
|
+ files.add(new File(path + fileInfoMap.get(imageId)));
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -200,7 +236,11 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
entity = new GzArchivesEntity();
|
|
|
entity.setId(archives.getId());
|
|
|
entity.setRecflag("1");
|
|
|
+<<<<<<< HEAD
|
|
|
entity.setPdftime(LocalDate.now());
|
|
|
+=======
|
|
|
+ entity.setUpdatetime(LocalDateTime.now());
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
this.updateById(entity);
|
|
|
// -------------------
|
|
|
GzArchivesExEntity archiveEntity = new GzArchivesExEntity();
|
|
|
@@ -209,6 +249,7 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
if (gzEx == null) {
|
|
|
gzEx = new GzArchivesExEntity();
|
|
|
gzEx.setPdfPath(fileRelatePath + fileName);
|
|
|
+<<<<<<< HEAD
|
|
|
gzEx.setGzArchivesId(archives.getId());
|
|
|
gzEx.setImageJson(JSON.toJSONString(archives));
|
|
|
gzEx.setCreateTime(LocalDateTime.now());
|
|
|
@@ -223,6 +264,17 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
gzEx.setPdfPath(fileRelatePath+fileName);
|
|
|
gzEx.setUpdateTime(LocalDateTime.now());
|
|
|
gzArchivesExService.updateById(gzEx);
|
|
|
+=======
|
|
|
+ gzEx.setImageJson(JSON.toJSONString(archives));
|
|
|
+ gzEx.setCreateTime(LocalDateTime.now());
|
|
|
+ gzEx.setUpdateTime(LocalDateTime.now());
|
|
|
+ gzArchivesExService.save(gzEx);
|
|
|
+ } else {
|
|
|
+ gzEx.setPdfPath(fileRelatePath + fileName);
|
|
|
+ gzEx.setImageJson(JSON.toJSONString(archives));
|
|
|
+ gzEx.setUpdateTime(LocalDateTime.now());
|
|
|
+ gzArchivesExService.updateById(archiveEntity);
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
}
|
|
|
UpdateWrapper<FileInfoEntity> updateWrapper = new UpdateWrapper<>();
|
|
|
updateWrapper.in("id", imageIds);
|
|
|
@@ -233,10 +285,17 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
}
|
|
|
|
|
|
@AnonymousPostMapping("/detail")
|
|
|
+<<<<<<< HEAD
|
|
|
public ResponseDTO<GzDetailDto> detail(GzArchivesVo req) {
|
|
|
GzArchivesEntity entity = this.getById(req.getId());
|
|
|
// GzArchivesDto dto = BeanCopyUtils.convertObj(entity, GzArchivesDto.class);
|
|
|
GzDetailDto dto = new GzDetailDto();
|
|
|
+=======
|
|
|
+ public ResponseDTO<ArchivesDto> detail(GzArchivesVo req) {
|
|
|
+ GzArchivesEntity entity = this.getById(req.getId());
|
|
|
+// GzArchivesDto dto = BeanCopyUtils.convertObj(entity, GzArchivesDto.class);
|
|
|
+ ArchivesDto dto = new ArchivesDto();
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
convertArchives(entity, dto);
|
|
|
// 先查询有没有处理过,然后再处理老的数据
|
|
|
GzArchivesExEntity gzExEntity = new GzArchivesExEntity();
|
|
|
@@ -244,6 +303,7 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
gzExEntity = gzArchivesExService.getOne(gzExEntity);
|
|
|
if (gzExEntity != null) {
|
|
|
String previewPath = dictDetailService.getValueByName("file_path").get("preview_path");
|
|
|
+<<<<<<< HEAD
|
|
|
Map<String,String> pdfFileName = new HashMap<>();
|
|
|
pdfFileName.put("pdfPath", previewPath + gzExEntity.getPdfPath());
|
|
|
// 卷宗号
|
|
|
@@ -251,6 +311,11 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
List<Map<String,String>> pdfList=new ArrayList<>();
|
|
|
pdfList.add(pdfFileName);
|
|
|
dto.setFilePath(pdfList);
|
|
|
+=======
|
|
|
+ List<String> pdfs = new ArrayList<>();
|
|
|
+ pdfs.add(previewPath + gzExEntity.getPdfPath());
|
|
|
+ dto.setPdfPaths(pdfs);
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
return ResponseDTO.success(dto);
|
|
|
}
|
|
|
QueryWrapper<GzDetailEntity> qw = new QueryWrapper<>();
|
|
|
@@ -262,6 +327,7 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
String gzPath = dictDetailService.getValueByName("file_path").get("gz_path");
|
|
|
List<GzFilepathEntity> gzFilePaths = gzFilepathService.list(gzFilepathQw);
|
|
|
if (CollectionUtils.isNotEmpty(gzFilePaths)) {
|
|
|
+<<<<<<< HEAD
|
|
|
List<Map<String,String>> pdfs = new ArrayList<>();
|
|
|
for (GzFilepathEntity gz : gzFilePaths) {
|
|
|
//pdfs.add(gzPath + gz.getSubpath() + gz.getFilename() + gz.getExt());
|
|
|
@@ -271,6 +337,13 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
pdfs.add(pdfFileName);
|
|
|
}
|
|
|
dto.setFilePath(pdfs);
|
|
|
+=======
|
|
|
+ List<String> pdfs = new ArrayList<>();
|
|
|
+ for (GzFilepathEntity gz : gzFilePaths) {
|
|
|
+ pdfs.add(gzPath + gz.getSubpath() + gz.getFilename() + gz.getExt());
|
|
|
+ }
|
|
|
+ dto.setPdfPaths(pdfs);
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
return ResponseDTO.success(dto);
|
|
|
}
|
|
|
return ResponseDTO.success(dto);
|
|
|
@@ -290,17 +363,28 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
map.put("endTime", endDate);
|
|
|
queryMap.setMap(map);
|
|
|
}
|
|
|
+<<<<<<< HEAD
|
|
|
List<String> submitTime = req.getSubmitTimes();
|
|
|
+=======
|
|
|
+ List<String> submitTime = req.getSubmitTime();
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
if (CollectionUtils.isNotEmpty(submitTime)) {
|
|
|
map.put("submitStartTime", submitTime.get(0));
|
|
|
map.put("submitEndTime", submitTime.get(1));
|
|
|
queryMap.setMap(map);
|
|
|
}
|
|
|
page = page(page, gzArchives, queryMap);
|
|
|
+<<<<<<< HEAD
|
|
|
List<GzDetailDto> list = new ArrayList<>();
|
|
|
if (page.getRecords() != null) {
|
|
|
for (GzArchivesEntity gz : page.getRecords()) {
|
|
|
GzDetailDto archivesEntity = new GzDetailDto();
|
|
|
+=======
|
|
|
+ List<ArchivesDto> list = new ArrayList<>();
|
|
|
+ if (page.getRecords() != null) {
|
|
|
+ for (GzArchivesEntity gz : page.getRecords()) {
|
|
|
+ ArchivesDto archivesEntity = new ArchivesDto();
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
convertArchives(gz, archivesEntity);
|
|
|
list.add(archivesEntity);
|
|
|
}
|
|
|
@@ -308,7 +392,11 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
return PageUtil.toPage(list, page.getTotal());
|
|
|
}
|
|
|
|
|
|
+<<<<<<< HEAD
|
|
|
private void convertArchives(GzArchivesEntity gz, GzDetailDto archivesEntity) {
|
|
|
+=======
|
|
|
+ private void convertArchives(GzArchivesEntity gz, ArchivesDto archivesEntity) {
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
sb.append(gz.getYear() + "-");
|
|
|
sb.append(gz.getNotarizationtypefull() + "-");
|
|
|
@@ -332,7 +420,10 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
archivesEntity.setSecrecyType(gz.getSecretclass());
|
|
|
archivesEntity.setNotaryFullName(gz.getNotarialOfficeFull());
|
|
|
archivesEntity.setCaseNum(gz.getFileno());
|
|
|
+<<<<<<< HEAD
|
|
|
archivesEntity.setStatus(gz.getRecflag());
|
|
|
+=======
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
archivesEntity.setFondsNum(gz.getFondcode());
|
|
|
archivesEntity.setCatalogNum(gz.getMenuno());
|
|
|
archivesEntity.setBoxNum(gz.getBoxnumber());
|
|
|
@@ -344,6 +435,7 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
System.out.println("1.2".split("\\.")[1]);
|
|
|
}
|
|
|
|
|
|
+<<<<<<< HEAD
|
|
|
public ResponseDTO<GzArchivesEntity> edit(@RequestBody GzArchivesVo req) {
|
|
|
GzArchivesEntity entity = getById(req.getId());
|
|
|
String arcno=entity.getArcno();
|
|
|
@@ -362,6 +454,12 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
this.updateById(entity);
|
|
|
|
|
|
return ResponseDTO.success();
|
|
|
+=======
|
|
|
+ public ResponseDTO<ArchivesEntity> edit(@RequestBody GzArchivesVo req) {
|
|
|
+ GzArchivesEntity gz = new GzArchivesEntity();
|
|
|
+ convertGz(gz, req);
|
|
|
+ return null;
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
}
|
|
|
|
|
|
private void convertGz(GzArchivesEntity gz, GzArchivesVo archivesEntity) {
|
|
|
@@ -396,8 +494,11 @@ public class GzArchivesServiceImpl extends AbstractServiceImpl<IGzArchivesDao, G
|
|
|
if (StringUtils.isNotBlank(archivesEntity.getFilingDate())) {
|
|
|
gz.setFiledate(DateUtil.parseYmd(archivesEntity.getFilingDate()));
|
|
|
}
|
|
|
+<<<<<<< HEAD
|
|
|
//设置状态值
|
|
|
gz.setRecflag(archivesEntity.getStatus());
|
|
|
+=======
|
|
|
+>>>>>>> 0c389bffe198548263c292beabdd50c2415fd8f3
|
|
|
// 保管类型
|
|
|
gz.setSecretclass(archivesEntity.getSecrecyType());
|
|
|
// 保管期限
|