Commit 74d17902 authored by wei's avatar wei 🎱

更新案卷为最大密级,年限,文件数,总文件页数

parent 89e2421b
......@@ -390,6 +390,10 @@ public class Constants {
* 密级字典
*/
public static final String SECRET_CODE = "SecretCode";
/**
* 归档保管年限
*/
public static final String DOC_STORAGE_PERIOD = "DocStoragePeriod";
/**
* 载体类型字典
*/
......
......@@ -276,9 +276,9 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
String volumeNumber = extFilesVO.getVolumeNumber();
int pageNumber = 0; //文件页数
String secretCode = ""; //最大密级
Integer secretCodeDictSeq = 0;
Integer secretCodeDictSeq = -99;//初始化最小值
String storagePeriod = ""; //最大年限
Integer storagePeriodDictSeq = 0;
Integer storagePeriodDictSeq = -99;//初始化最小值
// 案卷下的文档
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
......@@ -288,16 +288,20 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
List<ExtTransferDocLinkVO> extTransferDocLinkVOList = extTransferDocLinkService.findRecursion(queryDoc).getContent();
for (ExtTransferDocLinkVO extTransferDocLinkVO : extTransferDocLinkVOList) {
// 最大密级
String secretCodeDoc = extTransferDocLinkVO.getSource().getSecretCode();
List<DictDataVO> dictDataVOByKey = this.getDictDataVOByKey(Constants.SECRET_CODE, secretCodeDoc);
// todo 获取最大密级和年限
if (CollectionUtils.isNotEmpty(dictDataVOByKey)) {
DictDataVO dictDataVO = dictDataVOByKey.get(0);
String dictKey = dictDataVO.getDictKey();
secretCodeDictSeq = dictDataVO.getDictSeq();
secretCode = this.getCompareMax(Constants.SECRET_CODE, secretCode, secretCodeDictSeq);
}
//storagePeriod = this.getCompareMax(Constants.SECRET_CODE, extTransferDocLinkVO.getStoragePeriod());
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();
}
pageNumber += extTransferDocLinkVO.getPageNumber();
}
......@@ -310,16 +314,15 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
}
}
private String getCompareMax(String dictCode, String dictKey, Integer max) {
private DictDataVO getCompareMax(String dictCode, String dictKey, Integer max) {
List<DictDataVO> dictDataVOList = this.getDictDataVOByKey(dictCode, dictKey);
if (CollectionUtils.isNotEmpty(dictDataVOList)) {
DictDataVO dictDataVO = dictDataVOList.get(0);
Integer dictSeq = dictDataVO.getDictSeq();
if (dictSeq > max) {
return dictDataVO.getDictKey();
if (dictDataVO.getDictSeq() > max) {
return dictDataVO;
}
}
return dictKey;
return null;
}
private List<DictDataVO> getDictDataVOByKey(String dictCode, String dictKey) {
......
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