Commit d795b2df authored by wei's avatar wei 🎱

移交单流程档案组审批节点退档-档案未接收 记录移交单number

parent 2f07340b
......@@ -13,8 +13,6 @@ import java.util.Map;
* @date: 2024-8-2 15:26:32
**/
public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocumentServiceShadow<V> {
/**
* 获取文档和文件夹
*
......@@ -22,10 +20,11 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum
* @param parentId 目录夹id
* @return
*/
Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId,Long dxDocumentFolderId);
Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId, Long dxDocumentFolderId);
/**
* 生成图册目录
*
* @param docId
* @return
*/
......@@ -39,5 +38,12 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum
*/
DxDocumentVO startWorkflow(Long id);
void updateArchivingStatus(Long id, String archivingStatus);
/**
* 更新归档状态
*
* @param id
* @param archivingStatus
* @param transferDocumentId 移交单编号
*/
void updateArchivingStatus(Long id, String archivingStatus, String transferDocumentCode);
}
......@@ -181,7 +181,7 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
if (CollectionUtils.isNotEmpty(transferDocLinkVOList)) {
for (ExtTransferDocLinkVO extTransferDocLinkVO : transferDocLinkVOList) {
Long sourceId = extTransferDocLinkVO.getSourceId();
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVED);
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVED, "");
}
}
}
......@@ -189,14 +189,15 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Override
public void returnDocument(Long transferDocLinkId) {
// 1.删除移交单关系绑定关系
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, transferDocLinkId);
SearchQueryCondition searchProgram = SearchUtil.buildQueryWithOpenAttr("id", SearchItem.Operator.EQ, transferDocLinkId, "target");
List<ExtTransferDocLinkVO> transferDocLinkVOList = extTransferDocLinkService.findRecursion(searchProgram).getContent();
ExtTransferDocLinkVO extTransferDocLinkVO = transferDocLinkVOList.get(0);
extTransferDocLinkService.delete(transferDocLinkId);
// 2.更新文档状态为档案未接收,退档人,退档时间
Long sourceId = extTransferDocLinkVO.getSourceId();
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVE_NOT_RECEIVED);
String number = extTransferDocLinkVO.getTarget().getNumber();
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVE_NOT_RECEIVED, number);
// 3.删除案卷文档关系
List<ExtFilesDocLinkVO> extFilesDocLinkVOList = extFilesDocLinkService.getFilesDocLinkBySourceId(sourceId);
......@@ -257,7 +258,7 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Override
public void returnDocumentByDocId(Long docId) {
// 1.更新文档状态为归档已作废
extDxDocumentService.updateArchivingStatus(docId, ExtDxDocumentServiceImpl.ARCHIVE_INVALIDATED);
extDxDocumentService.updateArchivingStatus(docId, ExtDxDocumentServiceImpl.ARCHIVE_INVALIDATED, "");
// 2.删除绑定关系
List<ExtFilesDocLinkVO> extFilesDocLinkVOList = extFilesDocLinkService.getFilesDocLinkBySourceId(docId);
ExtFilesDocLinkVO extFilesDocLinkVO = extFilesDocLinkVOList.get(0);
......
......@@ -124,11 +124,19 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
}
@Override
public void updateArchivingStatus(Long id, String archivingStatus) {
public void updateArchivingStatus(Long id, String archivingStatus, String transferDocumentCode) {
DxDocumentVO dxDocumentVO = this.get(id);
DxUserVO currentUser = userHelper.getCurrentUser();
Long userId = currentUser.getUserId();
DxUserInfoVO dxUserInfoVO = (DxUserInfoVO) userService.get(userId);
// 移交单流程档案组审批节点退档-档案未接收
if (ARCHIVE_NOT_RECEIVED.equals(archivingStatus)) {
dxDocumentVO.setTransferDocumentId(transferDocumentCode);
dxDocumentVO.setDxRefundPersonUser(dxUserInfoVO);
dxDocumentVO.setDxRefundPersonUserId(dxUserInfoVO.getUserId());
dxDocumentVO.setDxRefundPersonUserIdType("DxUser");
dxDocumentVO.setWithdrawalTime(LocalDateTime.now());
}
// 无前置状态,直接已归档。置空退档人,和退档时间,移交单号
if (ARCHIVED.equals(archivingStatus)) {
dxDocumentVO.setTransferDocumentId(null);
......@@ -137,10 +145,9 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
dxDocumentVO.setDxRefundPersonUserIdType(null);
dxDocumentVO.setWithdrawalTime(null);
}
// 列表上退档-归档已作废 // 移交单流程档案组审批节点退档-档案未接收
if (ARCHIVE_INVALIDATED.equals(archivingStatus) || ARCHIVE_NOT_RECEIVED.equals(archivingStatus)) {
// 修改归档已作废-是否再已归档状态下
if (ARCHIVE_INVALIDATED.equals(archivingStatus) && !dxDocumentVO.getArchivingStatus().equals(ARCHIVED)) {
// 列表上退档-归档已作废
if (ARCHIVE_INVALIDATED.equals(archivingStatus)) {
if (!dxDocumentVO.getArchivingStatus().equals(ARCHIVED)) {
throw new DxBusinessException("500", "不是已归档状态");
}
dxDocumentVO.setDxRefundPersonUser(dxUserInfoVO);
......
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