Commit 987dc164 authored by wei's avatar wei 🎱

移交单下文件清单-退档,解除关系,重新计算案卷信息

parent a968250a
......@@ -56,9 +56,8 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
@ApiOperation(value = "移交单下文件清单-退档", notes = "移交单下文件清单退档")
@PostMapping(value = "/returnDocument")
public ApiResult returnDocument(@RequestParam("id") Long id,
@RequestParam("docId") Long docId) {
extTransferDocumentService.returnDocument(id, docId);
public ApiResult returnDocument(@RequestParam("transferDocLink") Long transferDocLink) {
extTransferDocumentService.returnDocument(transferDocLink);
return ApiResult.ok(ApiResult.SUCCESS, "退档成功");
}
}
......
......@@ -32,7 +32,7 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext
void updateArchivingStatus(Long id);
void returnDocument(Long id, Long docId);
void returnDocument(Long transferDocLink);
void saveFilesDocLink(List<ExtFilesUpdateVO> extFilesUpdateVOList);
}
......@@ -44,6 +44,7 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;
......@@ -187,8 +188,29 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
}
@Override
public void returnDocument(Long id, Long docId) {
public void returnDocument(Long transferDocLink) {
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, transferDocLink);
List<ExtTransferDocLinkVO> transferDocLinkVOList = extTransferDocLinkService.findRecursion(searchProgram).getContent();
ExtTransferDocLinkVO extTransferDocLinkVO = transferDocLinkVOList.get(0);
// 1.更新文档状态为档案未接收
Long sourceId = extTransferDocLinkVO.getSourceId();
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVE_NOT_RECEIVED);
// 2.删除绑定关系
String belongingCaseFile = extTransferDocLinkVO.getBelongingCaseFile();
if (StringUtils.isNotBlank(belongingCaseFile)) {
List<ExtFilesVO> extFilesVOList = extFilesService.findRecursionByVolumeNumber(belongingCaseFile);
Long id = extFilesVOList.get(0).getId();
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.searchItems(SearchItems.builder()
.item(new SearchItem("targetId", SearchItem.Operator.EQ, id, null))
.item(new SearchItem("sourceId", SearchItem.Operator.EQ, sourceId, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
ExtFilesDocLinkVO extFilesDocLinkVO = (ExtFilesDocLinkVO) extFilesDocLinkService.findRecursion(queryDoc).getContent().get(0);
ExtFilesVO target = extFilesDocLinkVO.getTarget();
extFilesDocLinkService.delete(extFilesDocLinkVO.getId());
// 3.重新计算案卷信息
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target), "");
}
}
@Override
......
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