Commit 60016f2a authored by wei's avatar wei 🎱

保存移交单文档关联关系所属案卷和年限

parent 3005be71
......@@ -13,6 +13,10 @@ import java.io.Serializable;
*/
@Data
public class ExtFilesUpdateVO implements Serializable {
/**
* 移交单和文档关联关系ID
*/
private String transferDocLinkId;
/**
* 项目代号
*/
......
......@@ -51,9 +51,7 @@ public class ExtTransferDocLinkServiceImpl<V extends ExtTransferDocLinkVO> imple
SearchQueryCondition query = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, id);
ExtTransferDocLinkVO extTransferDocLink = this.findRecursion(query).getContent().get(0);
extTransferDocLink.setBelongingCaseFile(extTransferDocLinkVO.getBelongingCaseFile());
extTransferDocLink.setVolumeNumber(extTransferDocLinkVO.getVolumeNumber());
extTransferDocLink.setStoragePeriod(extTransferDocLinkVO.getStoragePeriod());
extTransferDocLink.setArchiveNumber(extTransferDocLinkVO.getArchiveNumber());
extTransferDocLink.setOperator(OperatorType.MODIFY);
this.saveRecursion((V) extTransferDocLink);
......
......@@ -23,6 +23,7 @@ import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign;
import com.yonde.dex.context.common.vo.DxContextProjectVO;
......@@ -206,7 +207,7 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
ExtFilesVO target = extFilesDocLinkVO.getTarget();
extFilesDocLinkService.delete(extFilesDocLinkVO.getId());
// 4.重新计算案卷信息
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target), "");
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target));
}
}
......@@ -217,10 +218,10 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
List<Long> extFilesDocLinkIds = Lists.newArrayList();
ExtFilesUpdateVO extFilesUpdateVO = extFilesUpdateVOList.get(0);
String storagePeriod = extFilesUpdateVO.getStoragePeriod();
SearchQueryCondition queryCondition = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, extFilesUpdateVO.getFilesId());
ExtFilesVO extFilesVO = (ExtFilesVO) extFilesService.findRecursion(queryCondition).getContent().get(0);
String volumeNumber = extFilesVO.getVolumeNumber(); //新案卷名称
String storagePeriod = extFilesUpdateVO.getStoragePeriod(); //保管年限
newExtFilesVOList.add(extFilesVO);
for (ExtFilesUpdateVO extFilesUpdate : extFilesUpdateVOList) {
......@@ -238,12 +239,19 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
extFilesUpdate.setExtFilesVO(extFilesVO);
extFilesUpdate.setDxDocumentVO(dxDocumentVO);
// 保存移交单文档关联关系所属案卷和年限
SearchQueryCondition queryTransferDocLink = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, extFilesUpdate.getTransferDocLinkId());
ExtTransferDocLinkVO extTransferDocLinkVO = (ExtTransferDocLinkVO) extTransferDocLinkService.findRecursion(queryTransferDocLink).getContent().get(0);
extTransferDocLinkVO.setBelongingCaseFile(volumeNumber);
extTransferDocLinkVO.setStoragePeriod(storagePeriod);
extTransferDocLinkVO.setOperator(OperatorType.MODIFY);
extTransferDocLinkService.saveRecursion(extTransferDocLinkVO);
}
// 1.删除以前关系并重新计算以前案卷下为文档下最大密级、保管年限、文件数,总文件数
if (CollectionUtils.isNotEmpty(extFilesDocLinkIds)) {
extFilesDocLinkService.deleteAllById(extFilesDocLinkIds);
this.updateExtFilesByBelongingCaseFile(oldExtFilesVOList, "");
this.updateExtFilesByBelongingCaseFile(oldExtFilesVOList);
}
// 2.绑定新的案卷文档关联关系
......@@ -251,7 +259,7 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
// 3.重新计算案卷下为文档下最大密级、保管年限、文件数,总文件数
if (CollectionUtils.isNotEmpty(newExtFilesVOList)) {
this.updateExtFilesByBelongingCaseFile(newExtFilesVOList, storagePeriod);
this.updateExtFilesByBelongingCaseFile(newExtFilesVOList);
}
}
......@@ -265,7 +273,7 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
ExtFilesVO target = extFilesDocLinkVO.getTarget();
extFilesDocLinkService.delete(extFilesDocLinkVO.getId());
// 3.重新计算案卷信息
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target), "");
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target));
}
@Override
......@@ -283,7 +291,7 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
return null;
}
private void updateExtFilesByBelongingCaseFile(List<ExtFilesVO> extFilesVOList, String newStoragePeriod) {
private void updateExtFilesByBelongingCaseFile(List<ExtFilesVO> extFilesVOList) {
for (ExtFilesVO extFilesVO : extFilesVOList) {
String volumeNumber = extFilesVO.getVolumeNumber();
int pageNumber = 0; //文件页数
......@@ -320,13 +328,6 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
}
pageNumber += extTransferDocLinkVO.getPageNumber();
}
// 从页面操作过来的年限和卷下的文件年限 单独判断一下大小。
if (StringUtils.isNotBlank(newStoragePeriod)) {
DictDataVO storagePeriodDocMax = this.getCompareMax(Constants.DOC_STORAGE_PERIOD, newStoragePeriod, storagePeriodDictSeq);
if (ObjectUtils.isNotEmpty(storagePeriodDocMax)) {
storagePeriod = storagePeriodDocMax.getDictKey();
}
}
ExtFilesUpdateVO filesUpdateVO = new ExtFilesUpdateVO();
filesUpdateVO.setSecretCode(secretCode);
......
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