Commit 781170ce authored by wei's avatar wei 🎱

校验文件档号是否重复,

parent cb1ebf44
......@@ -67,7 +67,9 @@ public class ExtFilesDocLinkServiceImpl<V extends ExtFilesDocLinkVO> implements
extFilesDocLinkVOList.add(extFilesDocLinkVO);
}
}
this.saveRecursion((V) extFilesDocLinkVOList);
if (CollectionUtils.isNotEmpty(extFilesDocLinkVOList)) {
this.saveRecursion((V) extFilesDocLinkVOList);
}
}
}
......
......@@ -3,6 +3,7 @@ package com.inet.dcs.document.core.service.impl;
import com.inet.dcs.document.common.vo.ExtFilesDocLinkVO;
import com.inet.dcs.document.common.vo.ExtFilesUpdateVO;
import com.inet.dcs.document.common.vo.ExtFilesVO;
import com.inet.dcs.document.core.constants.Constants;
import com.inet.dcs.document.core.repository.ExtFilesRepository;
import com.inet.dcs.document.core.service.ExtFilesDocLinkService;
import com.inet.dcs.document.core.service.ExtFilesService;
......@@ -18,9 +19,13 @@ import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign;
import com.yonde.dex.context.common.vo.DxContextProjectVO;
import com.yonde.dex.context.common.vo.DxContextVO;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import com.yonde.dex.dict.feign.DictDataFeignService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -52,6 +57,9 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
@Autowired
private ExtFilesDocLinkService extFilesDocLinkService;
@Autowired
private DictDataFeignService dictDataService;
@Override
public void beforeSave(Collection<V> target) {
// 全宗号+项目号+项目代号+类别代号+盒号(三位流水号)+后缀“-(两位数字流水号)例如:2-20114272031-QH03-JS01-001-(01)
......@@ -160,14 +168,48 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
@Override
public void updateExtFiles(List<ExtFilesUpdateVO> extFilesUpdateVOList) {
List<ExtFilesVO> extFilesVOList = Lists.newArrayList();
List<DictDataVO> secretCodeDictList = dictDataService.getDictDatas(Constants.SECRET_CODE);
for (ExtFilesUpdateVO extFilesUpdateVO : extFilesUpdateVOList) {
List<ExtFilesVO> filesVOS = this.findRecursionByVolumeNumber(extFilesUpdateVO.getBelongingCaseFile());
if (CollectionUtils.isNotEmpty(filesVOS)) {
ExtFilesVO extFilesVO = filesVOS.get(0);
extFilesVO.setSecretCode(extFilesUpdateVO.getSecretCode());
extFilesVO.setStoragePeriod(extFilesUpdateVO.getStoragePeriod());
extFilesVO.setFileNumber(extFilesUpdateVO.getFileNumber());
extFilesVO.setPageNumber(extFilesUpdateVO.getPageNumber());
// 密级
String secretCode = extFilesVO.getSecretCode();
if (StringUtils.isBlank(secretCode)) {
secretCode = extFilesUpdateVO.getSecretCode();
} else {
}
extFilesVO.setSecretCode(secretCode);
// 年限
String storagePeriod = extFilesVO.getStoragePeriod();
if (StringUtils.isBlank(storagePeriod)) {
storagePeriod = extFilesUpdateVO.getStoragePeriod();
} else {
}
extFilesVO.setStoragePeriod(storagePeriod);
// 文件数
Integer fileNumber = extFilesVO.getFileNumber();
if (ObjectUtils.isEmpty(fileNumber)) {
fileNumber = extFilesUpdateVO.getFileNumber();
} else {
}
extFilesVO.setFileNumber(fileNumber);
// 总文件页数
Integer pageNumber = extFilesVO.getPageNumber();
if (ObjectUtils.isEmpty(pageNumber)) {
pageNumber = extFilesUpdateVO.getPageNumber();
} else {
}
extFilesVO.setPageNumber(pageNumber);
extFilesVO.setOperator(OperatorType.MODIFY);
extFilesVOList.add(extFilesVO);
}
......
......@@ -81,10 +81,22 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
if (CollectionUtils.isEmpty(transferDocLinkVOList)) {
return;
}
// todo 2.校验文件档号是否重复
List<String> distinct = transferDocLinkVOList.stream()
.map(ExtTransferDocLinkVO::getArchiveNumber).distinct().collect(Collectors.toList());
if (distinct.size() != transferDocLinkVOList.size()) {
throw new DxBusinessException("500", "文件清单中:文件归档号寸在重复");
}
for (ExtTransferDocLinkVO extTransferDocLinkVO : transferDocLinkVOList) {
String archiveNumber = extTransferDocLinkVO.getArchiveNumber();
// TODO 查询linK判断是否数据库存在
}
log.info("=================开始=绑定案卷关系同时反更新案卷信息================");
// 2.绑定案卷文件关联关系
// 3.绑定案卷文件关联关系
this.saveFilesDocLink(transferDocLinkVOList);
// 3.更新案卷下部分信息
// 4.更新案卷下部分信息
this.updateExtFilesByBelongingCaseFile(transferDocLinkVOList);
log.info("=================结束=绑定案卷关系同时反更新案卷信息================");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment