Commit 3bd7e3f6 authored by wei's avatar wei 🎱

流程种退档,删除关系,和案卷关系冲洗计算,案卷信息。列表上退档接口,删除案卷关系重新计算案卷信息

parent e0ce1399
...@@ -41,7 +41,7 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex ...@@ -41,7 +41,7 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
return ApiResult.ok(extTransferDocumentService.getTransferDocProjectById(id)); return ApiResult.ok(extTransferDocumentService.getTransferDocProjectById(id));
} }
@ApiOperation(value = "获取文档列表", notes = "获取文档列表") @ApiOperation(value = "获取要归档的文档列表", notes = "获取要归档的文档列表")
@PostMapping(value = "/getDxDocumentList") @PostMapping(value = "/getDxDocumentList")
public ApiResult getDxDocumentList(@RequestBody SearchQueryCondition searchQueryCondition) { public ApiResult getDxDocumentList(@RequestBody SearchQueryCondition searchQueryCondition) {
return ApiResult.ok(extTransferDocumentService.getDxDocumentList(searchQueryCondition)); return ApiResult.ok(extTransferDocumentService.getDxDocumentList(searchQueryCondition));
...@@ -54,12 +54,19 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex ...@@ -54,12 +54,19 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
return ApiResult.ok(ApiResult.SUCCESS, "保存文档案卷关联关系成功"); return ApiResult.ok(ApiResult.SUCCESS, "保存文档案卷关联关系成功");
} }
@ApiOperation(value = "移交单下文件清单-退档", notes = "移交单下文件清单退档") @ApiOperation(value = "移交单下文件清单-退档(档案未接收)", notes = "移交单下文件清单退档")
@PostMapping(value = "/returnDocument") @PostMapping(value = "/returnDocument")
public ApiResult returnDocument(@RequestParam("transferDocLinkId") Long transferDocLinkId) { public ApiResult returnDocument(@RequestParam("transferDocLinkId") Long transferDocLinkId) {
extTransferDocumentService.returnDocument(transferDocLinkId); extTransferDocumentService.returnDocument(transferDocLinkId);
return ApiResult.ok(ApiResult.SUCCESS, "退档成功"); return ApiResult.ok(ApiResult.SUCCESS, "退档成功");
} }
@ApiOperation(value = "列表上-退档(归档已作废)", notes = "移交单下文件清单退档")
@PostMapping(value = "/returnDocumentByDocId")
public ApiResult returnDocumentByDocId(@RequestParam("docId") Long docId) {
extTransferDocumentService.returnDocumentByDocId(docId);
return ApiResult.ok(ApiResult.SUCCESS, "退档成功");
}
} }
...@@ -25,10 +25,10 @@ public interface ExtFilesDocLinkService<V extends ExtFilesDocLinkVO> extends Ext ...@@ -25,10 +25,10 @@ public interface ExtFilesDocLinkService<V extends ExtFilesDocLinkVO> extends Ext
/** /**
* 根据文档ID查询关联文件的target * 根据文档ID查询关联文件的target
* *
* @param targetId * @param sourceId
* @return * @return
*/ */
List<ExtFilesDocLinkVO> getFilesDocLinkBySourceId(Long targetId); List<ExtFilesDocLinkVO> getFilesDocLinkBySourceId(Long sourceId);
/** /**
* 保存案卷和文件关联关系 * 保存案卷和文件关联关系
......
...@@ -35,4 +35,6 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext ...@@ -35,4 +35,6 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext
void returnDocument(Long transferDocLinkId); void returnDocument(Long transferDocLinkId);
void saveFilesDocLink(List<ExtFilesUpdateVO> extFilesUpdateVOList); void saveFilesDocLink(List<ExtFilesUpdateVO> extFilesUpdateVOList);
void returnDocumentByDocId(Long docId);
} }
...@@ -39,5 +39,5 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum ...@@ -39,5 +39,5 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum
*/ */
DxDocumentVO startWorkflow(Long id); DxDocumentVO startWorkflow(Long id);
void updateArchivingStatus(Long id, String archivingStatus); void updateArchivingStatus(Long id, String archivingStatus, String sourceType);
} }
...@@ -42,6 +42,7 @@ public class ExtFilesDocLinkServiceImpl<V extends ExtFilesDocLinkVO> implements ...@@ -42,6 +42,7 @@ public class ExtFilesDocLinkServiceImpl<V extends ExtFilesDocLinkVO> implements
@Override @Override
public List<ExtFilesDocLinkVO> getFilesDocLinkByTargetId(Long targetId) { public List<ExtFilesDocLinkVO> getFilesDocLinkByTargetId(Long targetId) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder() SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target").build())
.openProp(SearchQueryCondition.builder().name("source").build()) .openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder() .searchItems(SearchItems.builder()
.item(new SearchItem("targetId", SearchItem.Operator.EQ, targetId, null)) .item(new SearchItem("targetId", SearchItem.Operator.EQ, targetId, null))
...@@ -54,6 +55,7 @@ public class ExtFilesDocLinkServiceImpl<V extends ExtFilesDocLinkVO> implements ...@@ -54,6 +55,7 @@ public class ExtFilesDocLinkServiceImpl<V extends ExtFilesDocLinkVO> implements
public List<ExtFilesDocLinkVO> getFilesDocLinkBySourceId(Long sourceId) { public List<ExtFilesDocLinkVO> getFilesDocLinkBySourceId(Long sourceId) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder() SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target").build()) .openProp(SearchQueryCondition.builder().name("target").build())
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder() .searchItems(SearchItems.builder()
.item(new SearchItem("sourceId", SearchItem.Operator.EQ, sourceId, null)) .item(new SearchItem("sourceId", SearchItem.Operator.EQ, sourceId, null))
.operator(SearchItems.BooleanOperator.AND).build()).build(); .operator(SearchItems.BooleanOperator.AND).build()).build();
......
...@@ -173,7 +173,6 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -173,7 +173,6 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Override @Override
public void updateArchivingStatus(Long id) { public void updateArchivingStatus(Long id) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder() SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder() .searchItems(SearchItems.builder()
.item(new SearchItem("targetId", SearchItem.Operator.EQ, id, null)) .item(new SearchItem("targetId", SearchItem.Operator.EQ, id, null))
.operator(SearchItems.BooleanOperator.AND).build()).build(); .operator(SearchItems.BooleanOperator.AND).build()).build();
...@@ -189,26 +188,23 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -189,26 +188,23 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Override @Override
public void returnDocument(Long transferDocLinkId) { public void returnDocument(Long transferDocLinkId) {
// 1.删除移交单关系绑定关系
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, transferDocLinkId); SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, transferDocLinkId);
List<ExtTransferDocLinkVO> transferDocLinkVOList = extTransferDocLinkService.findRecursion(searchProgram).getContent(); List<ExtTransferDocLinkVO> transferDocLinkVOList = extTransferDocLinkService.findRecursion(searchProgram).getContent();
ExtTransferDocLinkVO extTransferDocLinkVO = transferDocLinkVOList.get(0); ExtTransferDocLinkVO extTransferDocLinkVO = transferDocLinkVOList.get(0);
// 1.更新文档状态为档案未接收 extTransferDocLinkService.delete(transferDocLinkId);
// 2.更新文档状态为档案未接收,退档人,退档时间
Long sourceId = extTransferDocLinkVO.getSourceId(); Long sourceId = extTransferDocLinkVO.getSourceId();
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVE_NOT_RECEIVED); extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVE_NOT_RECEIVED);
// 2.删除绑定关系
String belongingCaseFile = extTransferDocLinkVO.getBelongingCaseFile(); // 3.删除案卷文档关系
if (StringUtils.isNotBlank(belongingCaseFile)) { List<ExtFilesDocLinkVO> extFilesDocLinkVOList = extFilesDocLinkService.getFilesDocLinkBySourceId(sourceId);
List<ExtFilesVO> extFilesVOList = extFilesService.findRecursionByVolumeNumber(belongingCaseFile); if (CollectionUtils.isNotEmpty(extFilesDocLinkVOList)) {
Long id = extFilesVOList.get(0).getId(); ExtFilesDocLinkVO extFilesDocLinkVO = extFilesDocLinkVOList.get(0);
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(); ExtFilesVO target = extFilesDocLinkVO.getTarget();
extFilesDocLinkService.delete(extFilesDocLinkVO.getId()); extFilesDocLinkService.delete(extFilesDocLinkVO.getId());
// 3.重新计算案卷信息 // 4.重新计算案卷信息
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target), ""); this.updateExtFilesByBelongingCaseFile(Arrays.asList(target), "");
} }
} }
...@@ -258,6 +254,19 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -258,6 +254,19 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
} }
} }
@Override
public void returnDocumentByDocId(Long docId) {
// 1.更新文档状态为归档已作废
extDxDocumentService.updateArchivingStatus(docId, ExtDxDocumentServiceImpl.ARCHIVE_INVALIDATED);
// 2.删除绑定关系
List<ExtFilesDocLinkVO> extFilesDocLinkVOList = extFilesDocLinkService.getFilesDocLinkBySourceId(docId);
ExtFilesDocLinkVO extFilesDocLinkVO = extFilesDocLinkVOList.get(0);
ExtFilesVO target = extFilesDocLinkVO.getTarget();
extFilesDocLinkService.delete(extFilesDocLinkVO.getId());
// 3.重新计算案卷信息
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target), "");
}
@Override @Override
public DxUserInfoVO getSignInfo(List<DxWfProcessTaskVO> activities, String activityName) { public DxUserInfoVO getSignInfo(List<DxWfProcessTaskVO> activities, String activityName) {
for (DxWfProcessTaskVO wf : activities) { for (DxWfProcessTaskVO wf : activities) {
......
...@@ -21,7 +21,9 @@ import com.yonde.dex.basedata.data.search.SearchQueryBuilder; ...@@ -21,7 +21,9 @@ import com.yonde.dex.basedata.data.search.SearchQueryBuilder;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType; import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.users.DxUserVO;
import com.yonde.dex.basedata.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basedata.users.UserHelper;
import com.yonde.dex.dfs.feign.FileManagerFeignService; import com.yonde.dex.dfs.feign.FileManagerFeignService;
import com.yonde.dex.dfs.vo.RepoFileVO; import com.yonde.dex.dfs.vo.RepoFileVO;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign; import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
...@@ -71,6 +73,9 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe ...@@ -71,6 +73,9 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
@Autowired @Autowired
private WfcProcessFeign wfcProcessFeign; private WfcProcessFeign wfcProcessFeign;
@Autowired
private UserHelper userHelper;
@Override @Override
public void beforeSave(Collection<V> target) { public void beforeSave(Collection<V> target) {
for (V v : target) { for (V v : target) {
...@@ -113,14 +118,30 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe ...@@ -113,14 +118,30 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
} }
@Override @Override
public void updateArchivingStatus(Long id, String archivingStatus) { public void updateArchivingStatus(Long id, String archivingStatus, String sourceType) {
DxDocumentVO dxDocumentVO = this.get(id); DxDocumentVO dxDocumentVO = this.get(id);
if (StringUtils.isBlank(dxDocumentVO.getArchivingStatus())) { DxUserVO currentUser = userHelper.getCurrentUser();
// 移交单流程档案组审批节点 退档
if (ARCHIVE_NOT_RECEIVED.equals(archivingStatus)) {
}
// 无前置状态,直接已归档。置空退档人,和退档时间
if (ARCHIVED.equals(archivingStatus)) {
}
// 列表上退档
if (ARCHIVE_INVALIDATED.equals(archivingStatus)) {
if (!dxDocumentVO.getArchivingStatus().equals(ARCHIVED)) {
throw new DxBusinessException("500", "不是已归档状态");
}
}
// 更新文档状态
dxDocumentVO.setArchivingStatus(archivingStatus); dxDocumentVO.setArchivingStatus(archivingStatus);
dxDocumentVO.setOperator(OperatorType.MODIFY); dxDocumentVO.setOperator(OperatorType.MODIFY);
this.save((V) dxDocumentVO); this.save((V) dxDocumentVO);
} }
}
private String getProcessDefKey(String subTypeName) { private String getProcessDefKey(String subTypeName) {
log.info("getProcessDefKey.subTypeName:{}", subTypeName); log.info("getProcessDefKey.subTypeName:{}", subTypeName);
......
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