Commit 479dc468 authored by wei's avatar wei 🎱

重新计算案信息

parent 2f594b4d
......@@ -292,47 +292,44 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
private void updateExtFilesByBelongingCaseFile(List<ExtFilesVO> extFilesVOList) {
for (ExtFilesVO extFilesVO : extFilesVOList) {
String volumeNumber = extFilesVO.getVolumeNumber();
Long targetId = extFilesVO.getId();
int pageNumber = 0; //文件页数
String secretCode = ""; //最大密级
Integer secretCodeDictSeq = -99;//初始化最小值
String storagePeriod = ""; //最大年限
Integer storagePeriodDictSeq = -99;//初始化最小值
// 案卷下的文档
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder()
.item(new SearchItem("belongingCaseFile", SearchItem.Operator.EQ, volumeNumber, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
List<ExtTransferDocLinkVO> extTransferDocLinkVOList = extTransferDocLinkService.findRecursion(queryDoc).getContent();
extTransferDocLinkVOList = extTransferDocLinkVOList.stream().filter(obj ->
!obj.getSource().getArchivingStatus().equals(ExtDxDocumentServiceImpl.ARCHIVE_INVALIDATED)
&& !obj.getSource().getArchivingStatus().equals(ExtDxDocumentServiceImpl.ARCHIVE_NOT_RECEIVED))
.collect(Collectors.toList());
for (ExtTransferDocLinkVO extTransferDocLinkVO : extTransferDocLinkVOList) {
SearchQueryCondition searchProgram = SearchUtil.buildQueryWithOpenAttr("targetId", SearchItem.Operator.EQ, targetId, "source");
List<ExtFilesDocLinkVO> extFilesDocLinkVOList = extFilesDocLinkService.findRecursion(searchProgram).getContent();
for (ExtFilesDocLinkVO extFilesDocLinkVO : extFilesDocLinkVOList) {
// 最大密级
String secretCodeDoc = extTransferDocLinkVO.getSource().getSecretCode();
String secretCodeDoc = extFilesDocLinkVO.getSource().getSecretCode();
DictDataVO secretCodeDocMax = this.getCompareMax(Constants.SECRET_CODE, secretCodeDoc, secretCodeDictSeq);
if (ObjectUtils.isNotEmpty(secretCodeDocMax)) {
secretCodeDictSeq = secretCodeDocMax.getDictSeq();
secretCode = secretCodeDocMax.getDictKey();
}
// 最大年限
String storagePeriodDoc = extTransferDocLinkVO.getStoragePeriod();
DictDataVO storagePeriodDocMax = this.getCompareMax(Constants.DOC_STORAGE_PERIOD, storagePeriodDoc, storagePeriodDictSeq);
if (ObjectUtils.isNotEmpty(storagePeriodDocMax)) {
storagePeriodDictSeq = storagePeriodDocMax.getDictSeq();
storagePeriod = storagePeriodDocMax.getDictKey();
SearchQueryCondition search = SearchUtil.buildQuery("sourceId", SearchItem.Operator.EQ, extFilesDocLinkVO.getSourceId());
List<ExtTransferDocLinkVO> extTransferDocLinkVOList = extTransferDocLinkService.findRecursion(search).getContent();
if (CollectionUtils.isNotEmpty(extTransferDocLinkVOList)) {
ExtTransferDocLinkVO extTransferDocLinkVO = extTransferDocLinkVOList.get(0);
String storagePeriodDoc = extTransferDocLinkVO.getStoragePeriod();
DictDataVO storagePeriodDocMax = this.getCompareMax(Constants.DOC_STORAGE_PERIOD, storagePeriodDoc, storagePeriodDictSeq);
if (ObjectUtils.isNotEmpty(storagePeriodDocMax)) {
storagePeriodDictSeq = storagePeriodDocMax.getDictSeq();
storagePeriod = storagePeriodDocMax.getDictKey();
}
pageNumber += extTransferDocLinkVO.getPageNumber() == null ? 0 : extTransferDocLinkVO.getPageNumber();
}
pageNumber += extTransferDocLinkVO.getPageNumber() == null ? 0 : extTransferDocLinkVO.getPageNumber();
}
ExtFilesUpdateVO filesUpdateVO = new ExtFilesUpdateVO();
filesUpdateVO.setSecretCode(secretCode);
filesUpdateVO.setStoragePeriod(storagePeriod);
filesUpdateVO.setFileNumber(extTransferDocLinkVOList.size());
filesUpdateVO.setFileNumber(extFilesDocLinkVOList.size());
filesUpdateVO.setPageNumber(pageNumber);
extFilesService.updateExtFiles(extFilesVO, filesUpdateVO);
}
......
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