Commit 479dc468 authored by wei's avatar wei 🎱

重新计算案信息

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