|
@@ -3,15 +3,22 @@ package me.zhengjie.archives.service.impl;
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Collection;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
|
|
@@ -21,18 +28,18 @@ import me.zhengjie.archives.entity.ArchivesEntity;
|
|
|
import me.zhengjie.archives.entity.FileInfoEntity;
|
|
import me.zhengjie.archives.entity.FileInfoEntity;
|
|
|
import me.zhengjie.archives.entity.ModelEntity;
|
|
import me.zhengjie.archives.entity.ModelEntity;
|
|
|
import me.zhengjie.archives.plus.AbstractServiceImpl;
|
|
import me.zhengjie.archives.plus.AbstractServiceImpl;
|
|
|
|
|
+import me.zhengjie.archives.plus.QueryMap;
|
|
|
import me.zhengjie.archives.service.ArchivesService;
|
|
import me.zhengjie.archives.service.ArchivesService;
|
|
|
import me.zhengjie.archives.service.FileInfoService;
|
|
import me.zhengjie.archives.service.FileInfoService;
|
|
|
-import me.zhengjie.archives.util.HtmlConvertPdf;
|
|
|
|
|
import me.zhengjie.archives.util.HtmlConvertToPdf;
|
|
import me.zhengjie.archives.util.HtmlConvertToPdf;
|
|
|
import me.zhengjie.archives.util.HtmlToImage;
|
|
import me.zhengjie.archives.util.HtmlToImage;
|
|
|
import me.zhengjie.archives.util.PdfUtils;
|
|
import me.zhengjie.archives.util.PdfUtils;
|
|
|
import me.zhengjie.archives.vo.ArchivesVo;
|
|
import me.zhengjie.archives.vo.ArchivesVo;
|
|
|
import me.zhengjie.archives.vo.CasePortraitVo;
|
|
import me.zhengjie.archives.vo.CasePortraitVo;
|
|
|
-import me.zhengjie.base.ResponseDTO;
|
|
|
|
|
import me.zhengjie.config.FileProperties;
|
|
import me.zhengjie.config.FileProperties;
|
|
|
import me.zhengjie.modules.system.service.DictDetailService;
|
|
import me.zhengjie.modules.system.service.DictDetailService;
|
|
|
import me.zhengjie.utils.BeanCopyUtils;
|
|
import me.zhengjie.utils.BeanCopyUtils;
|
|
|
|
|
+import me.zhengjie.utils.DateUtil;
|
|
|
import me.zhengjie.utils.FileUtil;
|
|
import me.zhengjie.utils.FileUtil;
|
|
|
import me.zhengjie.utils.PageUtil;
|
|
import me.zhengjie.utils.PageUtil;
|
|
|
import me.zhengjie.utils.UUIDGenerator;
|
|
import me.zhengjie.utils.UUIDGenerator;
|
|
@@ -54,7 +61,16 @@ public class ArchivesServiceImpl extends AbstractServiceImpl<IArchivesDao, Archi
|
|
|
IPage<ArchivesEntity> page = new Page<>(req.getIndex(), req.getSize());
|
|
IPage<ArchivesEntity> page = new Page<>(req.getIndex(), req.getSize());
|
|
|
ArchivesEntity entity = BeanCopyUtils.convertObj(req, ArchivesEntity.class);
|
|
ArchivesEntity entity = BeanCopyUtils.convertObj(req, ArchivesEntity.class);
|
|
|
entity.setIsDelete("1");
|
|
entity.setIsDelete("1");
|
|
|
- page = page(page, entity);
|
|
|
|
|
|
|
+ QueryMap queryMap = new QueryMap();
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
+ List<String> accept = req.getAcceptDate();
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(accept)) {
|
|
|
|
|
+ map.put("startTime", accept.get(0).replaceAll("-", ""));
|
|
|
|
|
+ map.put("endTime", accept.get(1).replaceAll("-", ""));
|
|
|
|
|
+ queryMap.setMap(map);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ page = page(page, entity, queryMap);
|
|
|
String previewPath = dictDetailService.getValueByName("file_path").get("preview_path");
|
|
String previewPath = dictDetailService.getValueByName("file_path").get("preview_path");
|
|
|
|
|
|
|
|
for (ArchivesEntity archive : page.getRecords()) {
|
|
for (ArchivesEntity archive : page.getRecords()) {
|
|
@@ -75,9 +91,9 @@ public class ArchivesServiceImpl extends AbstractServiceImpl<IArchivesDao, Archi
|
|
|
String fileRelatePath = FileUtil.getUploadPath(path);
|
|
String fileRelatePath = FileUtil.getUploadPath(path);
|
|
|
String filePath = path + fileRelatePath;
|
|
String filePath = path + fileRelatePath;
|
|
|
String pageHtml = model.getContent();
|
|
String pageHtml = model.getContent();
|
|
|
-
|
|
|
|
|
- ArchivesEntity archive=this.getById(archives.getId());
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ ArchivesEntity archive = this.getById(archives.getId());
|
|
|
|
|
+
|
|
|
pageHtml.replace("{{notarialNum}}", archive.getNotarialNum());
|
|
pageHtml.replace("{{notarialNum}}", archive.getNotarialNum());
|
|
|
pageHtml.replace("{{notarizedItem}}", archive.getNotarizedItem());
|
|
pageHtml.replace("{{notarizedItem}}", archive.getNotarizedItem());
|
|
|
pageHtml.replace("{{partyName}}", archive.getPartyName());
|
|
pageHtml.replace("{{partyName}}", archive.getPartyName());
|
|
@@ -158,28 +174,66 @@ public class ArchivesServiceImpl extends AbstractServiceImpl<IArchivesDao, Archi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void image(CasePortraitVo archives) throws Exception {
|
|
public void image(CasePortraitVo archives) throws Exception {
|
|
|
-
|
|
|
|
|
|
|
+ // 查询对应的值
|
|
|
|
|
+ ArchivesEntity entity = this.getById(archives.getId());
|
|
|
|
|
+ // 保管期限
|
|
|
|
|
+ String saveTerm = dictDetailService.getLabelByValue("saveTerm_type", entity.getSaveTerm());
|
|
|
|
|
+ // 案卷类型
|
|
|
|
|
+ // String dossierType=
|
|
|
|
|
+ // dictDetailService.getValueByName("dossier_type").get(entity.getDossierType());
|
|
|
|
|
+ // TODO 当事人很多,需要修改字体-------------------页号开始------------------------
|
|
|
QueryWrapper<ModelEntity> queryWrapper = new QueryWrapper<ModelEntity>();
|
|
QueryWrapper<ModelEntity> queryWrapper = new QueryWrapper<ModelEntity>();
|
|
|
queryWrapper.eq("code", 1);
|
|
queryWrapper.eq("code", 1);
|
|
|
ModelEntity model = modelDao.selectOne(queryWrapper);
|
|
ModelEntity model = modelDao.selectOne(queryWrapper);
|
|
|
String path = properties.getPath().getPath();
|
|
String path = properties.getPath().getPath();
|
|
|
String fileRelatePath = FileUtil.getUploadPath(path);
|
|
String fileRelatePath = FileUtil.getUploadPath(path);
|
|
|
String filePath = path + fileRelatePath;
|
|
String filePath = path + fileRelatePath;
|
|
|
- String html = model.getContent();
|
|
|
|
|
|
|
+ String headPageHtml = model.getContent();
|
|
|
|
|
+ // 替换内容
|
|
|
|
|
+ headPageHtml = headPageHtml.replace("${year}", entity.getAnnual())
|
|
|
|
|
+ .replace("${notarialNum}", entity.getNotarialNum())
|
|
|
|
|
+ .replace("${notarizedItem}", entity.getNotarizedItem()).replace("${partyName}", entity.getPartyName())
|
|
|
|
|
+ .replace("${undertaker}", entity.getUndertaker()).replace("${notary}", entity.getNotary())
|
|
|
|
|
+ .replace("${undertaker}", entity.getUndertaker())
|
|
|
|
|
+ .replace("${acceptDate}", DateUtil.format(entity.getAcceptDate()))
|
|
|
|
|
+ .replace("${completeDate}", DateUtil.format(entity.getCompleteDate()))
|
|
|
|
|
+ .replace("${filingDate}", DateUtil.format(entity.getFilingDate())).replace("${saveTerm}", saveTerm)
|
|
|
|
|
+ .replace("${dossierNum}", entity.getDossierNum()).replace("${acceptNum}", entity.getAcceptNum())
|
|
|
|
|
+ .replace("${fondsNum}", entity.getFondsNum()).replace("${catalogNum}", entity.getCatalogNum())
|
|
|
|
|
+ .replace("${caseNum}", entity.getCaseNum())
|
|
|
|
|
+
|
|
|
|
|
+ ;
|
|
|
|
|
+
|
|
|
|
|
+ String headPagePath = filePath + UUIDGenerator.uuid() + ".html";
|
|
|
|
|
+ String headPageToImage = filePath + UUIDGenerator.uuid() + ".jpg";
|
|
|
|
|
+ // 先写入文本
|
|
|
|
|
+ FileUtil.writeUtf8String(headPageHtml, headPagePath);
|
|
|
|
|
+ // 然后生成jpg
|
|
|
|
|
+ String exePath = dictDetailService.getValueByName("file_path").get("exe_path");
|
|
|
|
|
+ HtmlToImage.htmlToImg(exePath, headPagePath, headPageToImage);
|
|
|
|
|
+ // -------------------页号结束------------------------
|
|
|
|
|
+ // --------------------目录号开始---------
|
|
|
|
|
+ queryWrapper = new QueryWrapper<ModelEntity>();
|
|
|
|
|
+ queryWrapper.eq("code", 2);
|
|
|
|
|
+ model = modelDao.selectOne(queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ String catalogHtml = model.getContent();
|
|
|
int j = 0;
|
|
int j = 0;
|
|
|
List<String> pages = archives.getPages();
|
|
List<String> pages = archives.getPages();
|
|
|
for (int i = 0; i < pages.size(); i++) {
|
|
for (int i = 0; i < pages.size(); i++) {
|
|
|
j = i + 1;
|
|
j = i + 1;
|
|
|
- html = html.replace("${num" + j + "}", pages.get(i));
|
|
|
|
|
|
|
+ catalogHtml = catalogHtml.replace("${num" + j + "}", pages.get(i));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String htmlPath = filePath + UUIDGenerator.uuid() + ".html";
|
|
|
|
|
- String htmlToImage = filePath + UUIDGenerator.uuid() + ".jpg";
|
|
|
|
|
|
|
+ String catalogPath = filePath + UUIDGenerator.uuid() + ".html";
|
|
|
|
|
+ String catalogToImage = filePath + UUIDGenerator.uuid() + ".jpg";
|
|
|
// 先写入文本
|
|
// 先写入文本
|
|
|
- FileUtil.writeUtf8String(html, htmlPath);
|
|
|
|
|
|
|
+ FileUtil.writeUtf8String(catalogHtml, catalogPath);
|
|
|
// 然后生成jpg
|
|
// 然后生成jpg
|
|
|
- String exePath = dictDetailService.getValueByName("file_path").get("exe_path");
|
|
|
|
|
- HtmlToImage.htmlToImg(exePath, htmlPath, htmlToImage);
|
|
|
|
|
|
|
+ // String exePath =
|
|
|
|
|
+ // dictDetailService.getValueByName("file_path").get("exe_path");
|
|
|
|
|
+ HtmlToImage.htmlToImg(exePath, catalogPath, catalogToImage);
|
|
|
|
|
+ // ------------------------目录号结束
|
|
|
// HtmlConvertPdf.createPdfFile(html, htmlToPdf);
|
|
// HtmlConvertPdf.createPdfFile(html, htmlToPdf);
|
|
|
List<String> imageIds = archives.getImageIds();
|
|
List<String> imageIds = archives.getImageIds();
|
|
|
List<FileInfoEntity> fileInfos = fileInfoService.listByIds(imageIds);
|
|
List<FileInfoEntity> fileInfos = fileInfoService.listByIds(imageIds);
|
|
@@ -188,12 +242,13 @@ public class ArchivesServiceImpl extends AbstractServiceImpl<IArchivesDao, Archi
|
|
|
map.put(fileInfo.getId(), fileInfo.getPath());
|
|
map.put(fileInfo.getId(), fileInfo.getPath());
|
|
|
}
|
|
}
|
|
|
List<File> files = new ArrayList<File>();
|
|
List<File> files = new ArrayList<File>();
|
|
|
- // 封面放在第一位
|
|
|
|
|
- files.add(new File(htmlToImage));
|
|
|
|
|
|
|
+ // 页头第一个
|
|
|
|
|
+ files.add(new File(headPageToImage));
|
|
|
|
|
+ // 目录放在第二个
|
|
|
|
|
+ files.add(new File(catalogToImage));
|
|
|
for (String str : imageIds) {
|
|
for (String str : imageIds) {
|
|
|
files.add(new File(path + map.get(str)));
|
|
files.add(new File(path + map.get(str)));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
String fileName = "merge_pdf" + UUIDGenerator.uuid() + ".pdf";
|
|
String fileName = "merge_pdf" + UUIDGenerator.uuid() + ".pdf";
|
|
|
String toPdfTarget = filePath + fileName;
|
|
String toPdfTarget = filePath + fileName;
|
|
|
// pdf进行合并
|
|
// pdf进行合并
|
|
@@ -209,37 +264,137 @@ public class ArchivesServiceImpl extends AbstractServiceImpl<IArchivesDao, Archi
|
|
|
ArchivesEntity archiveEntity = new ArchivesEntity();
|
|
ArchivesEntity archiveEntity = new ArchivesEntity();
|
|
|
archiveEntity.setId(archives.getId());
|
|
archiveEntity.setId(archives.getId());
|
|
|
archiveEntity.setPdfPath(fileRelatePath + fileName);
|
|
archiveEntity.setPdfPath(fileRelatePath + fileName);
|
|
|
|
|
+ archiveEntity.setImageJson(JSON.toJSONString(archives));
|
|
|
|
|
+ if (StringUtils.isNotBlank(archives.getIsRedo()) && archives.getIsRedo().equals("1")) {
|
|
|
|
|
+ int redoCount = entity.getRedoCount() == null ? 0 : entity.getRedoCount() + 1;
|
|
|
|
|
+ archiveEntity.setRedoCount(redoCount);
|
|
|
|
|
+ }
|
|
|
archiveEntity.setStatus("1");
|
|
archiveEntity.setStatus("1");
|
|
|
|
|
+ // archiveEntity.set
|
|
|
this.updateById(archiveEntity);
|
|
this.updateById(archiveEntity);
|
|
|
|
|
+ // 将图片id和档案绑定
|
|
|
|
|
+ // Wrapper<FileInfoEntity> updateWrapper
|
|
|
|
|
+
|
|
|
|
|
+ UpdateWrapper<FileInfoEntity> updateWrapper = new UpdateWrapper<>();
|
|
|
|
|
+ updateWrapper.in("id", imageIds);
|
|
|
|
|
+ updateWrapper.set("loan_no", archives.getId());
|
|
|
|
|
+
|
|
|
|
|
+ this.fileInfoService.update(updateWrapper);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- public void print(CasePortraitVo archives) throws Exception {
|
|
|
|
|
- String path = properties.getPath().getPath();
|
|
|
|
|
- String fileRelatePath = FileUtil.getUploadPath(path);
|
|
|
|
|
- String filePath = path + fileRelatePath;
|
|
|
|
|
|
|
|
|
|
- List<String> imageIds = archives.getImageIds();
|
|
|
|
|
- List<FileInfoEntity> fileInfos = fileInfoService.listByIds(imageIds);
|
|
|
|
|
- Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
- for (FileInfoEntity fileInfo : fileInfos) {
|
|
|
|
|
- map.put(fileInfo.getId(), fileInfo.getPath());
|
|
|
|
|
- }
|
|
|
|
|
- List<File> files = new ArrayList<File>();
|
|
|
|
|
- for (String str : imageIds) {
|
|
|
|
|
- files.add(new File(path + map.get(str)));
|
|
|
|
|
- }
|
|
|
|
|
- String fileName = "merge_pdf" + UUIDGenerator.uuid() + ".pdf";
|
|
|
|
|
- String toPdfTarget = filePath + fileName;
|
|
|
|
|
- // pdf进行合并
|
|
|
|
|
- PdfUtils.manyImageToOnePdf(files, toPdfTarget);
|
|
|
|
|
|
|
+// public void print(CasePortraitVo archives) throws Exception {
|
|
|
|
|
+// String path = properties.getPath().getPath();
|
|
|
|
|
+// String fileRelatePath = FileUtil.getUploadPath(path);
|
|
|
|
|
+// String filePath = path + fileRelatePath;
|
|
|
|
|
+//
|
|
|
|
|
+// List<String> imageIds = archives.getImageIds();
|
|
|
|
|
+// List<FileInfoEntity> fileInfos = fileInfoService.listByIds(imageIds);
|
|
|
|
|
+// Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
+// for (FileInfoEntity fileInfo : fileInfos) {
|
|
|
|
|
+// map.put(fileInfo.getId(), fileInfo.getPath());
|
|
|
|
|
+// }
|
|
|
|
|
+// List<File> files = new ArrayList<File>();
|
|
|
|
|
+// for (String str : imageIds) {
|
|
|
|
|
+// files.add(new File(path + map.get(str)));
|
|
|
|
|
+// }
|
|
|
|
|
+// String fileName = "merge_pdf" + UUIDGenerator.uuid() + ".pdf";
|
|
|
|
|
+// String toPdfTarget = filePath + fileName;
|
|
|
|
|
+// // pdf进行合并
|
|
|
|
|
+// PdfUtils.manyImageToOnePdf(files, toPdfTarget);
|
|
|
|
|
+// ArchivesEntity archiveEntity = new ArchivesEntity();
|
|
|
|
|
+// archiveEntity.setId(archives.getId());
|
|
|
|
|
+// archiveEntity.setPdfPath(fileRelatePath + fileName);
|
|
|
|
|
+// archiveEntity.setStatus("1");
|
|
|
|
|
+// this.updateById(archiveEntity);
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ public void mergeSubmit(CasePortraitVo archives) throws Exception {
|
|
|
ArchivesEntity archiveEntity = new ArchivesEntity();
|
|
ArchivesEntity archiveEntity = new ArchivesEntity();
|
|
|
archiveEntity.setId(archives.getId());
|
|
archiveEntity.setId(archives.getId());
|
|
|
- archiveEntity.setPdfPath(fileRelatePath + fileName);
|
|
|
|
|
- archiveEntity.setStatus("1");
|
|
|
|
|
- this.updateById(archiveEntity);
|
|
|
|
|
|
|
+ archiveEntity.setStatus("2");
|
|
|
|
|
+ image(archives);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除没有用到的图片,
|
|
|
|
|
+ */
|
|
|
|
|
+ public void deleteNoUserImage() {
|
|
|
|
|
+ String path = properties.getPath().getPath();
|
|
|
|
|
+ QueryWrapper<ArchivesEntity> qw = new QueryWrapper<>();
|
|
|
|
|
+ qw.eq("status", 1);
|
|
|
|
|
+ qw.eq("is_clean", 0);
|
|
|
|
|
+ qw.apply("redo_count != clean_count");
|
|
|
|
|
+ int i = 1;
|
|
|
|
|
+ while (true) {
|
|
|
|
|
+ qw.last("limit" + 10 * i);
|
|
|
|
|
+ List<ArchivesEntity> archives = this.list(qw);
|
|
|
|
|
+ for (ArchivesEntity a : archives) {
|
|
|
|
|
+ ArchivesEntity deleteImagePre = new ArchivesEntity();
|
|
|
|
|
+ deleteImagePre.setId(a.getId());
|
|
|
|
|
+ deleteImagePre.setIsClean("1");
|
|
|
|
|
+ this.updateById(deleteImagePre);
|
|
|
|
|
+ if (StringUtils.isNotBlank(a.getImageJson())) {
|
|
|
|
|
+ // 处理图片中,
|
|
|
|
|
+ CasePortraitVo casePort = JSONObject.parseObject(a.getImageJson(), CasePortraitVo.class);
|
|
|
|
|
+ List<String> imageIds = casePort.getImageIds();
|
|
|
|
|
+ // 查询id的值
|
|
|
|
|
+ FileInfoEntity fileInfo = new FileInfoEntity();
|
|
|
|
|
+ // fileInfo.setLoanNo(String.valueOf(a.getId()));
|
|
|
|
|
+// Map<String, FileInfoEntity> allFileIds = fileInfoService.list(fileInfo).stream()
|
|
|
|
|
+// .collect(Collectors.toMap(obj -> obj.getId(), obj -> obj));
|
|
|
|
|
+ List<FileInfoEntity> fileInfos = fileInfoService.list(fileInfo);
|
|
|
|
|
+ List<String> allFileIds = new ArrayList<>();
|
|
|
|
|
+ Map<String, FileInfoEntity> map = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
+ for (FileInfoEntity fi : fileInfos) {
|
|
|
|
|
+ map.put(fi.getId(), fi);
|
|
|
|
|
+ allFileIds.add(fi.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ Collection<String> intersection = CollectionUtils.intersection(allFileIds, imageIds);
|
|
|
|
|
+ // 开始删除数据
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(intersection)) {
|
|
|
|
|
+ for (String imagePath : intersection) {
|
|
|
|
|
+ FileInfoEntity fileInfoEntity = map.get(imagePath);
|
|
|
|
|
+ FileUtils.deleteQuietly(new File(path + fileInfoEntity.getPath()));
|
|
|
|
|
+ FileUtils.deleteQuietly(new File(path + fileInfoEntity.getSmallPath()));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ArchivesEntity deleteImageAfter = new ArchivesEntity();
|
|
|
|
|
+ deleteImageAfter.setId(a.getId());
|
|
|
|
|
+ deleteImageAfter.setIsClean("0");
|
|
|
|
|
+ deleteImageAfter.setCleanCount(a.getRedoCount());
|
|
|
|
|
+ this.updateById(deleteImageAfter);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- public void mergeSubmit(CasePortraitVo archives) throws Exception {
|
|
|
|
|
- print(archives);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
|
+ // 声明一个List集合
|
|
|
|
|
+ List<Student> list = new ArrayList<>();
|
|
|
|
|
+ list.add(new Student());
|
|
|
|
|
+ list.add(new Student());
|
|
|
|
|
+ list.add(new Student());
|
|
|
|
|
+ list.add(new Student());
|
|
|
|
|
+
|
|
|
|
|
+ // 将list转map 【key为1个属性,value为对象本身】 (map的键去重)
|
|
|
|
|
+
|
|
|
|
|
+ list.stream().collect(Collectors.toMap(Student::getNo, obj -> obj, (key1, key2) -> key1));
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+class Student {
|
|
|
|
|
+ String no; // 学号
|
|
|
|
|
+ String name; // 姓名
|
|
|
|
|
+ // 构造方法忽略
|
|
|
|
|
+ // set、get 方法忽略
|
|
|
|
|
+
|
|
|
|
|
+ String getNo() {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+}
|