Commit 8fce2047 authored by wei's avatar wei 🎱

删除移交单接口,编制状态下先删除link关系,在删除移交单

parent 479dc468
......@@ -78,6 +78,14 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
autoTaskService.generateTransferDocumentWordSign(extTransferDocumentVO);
return ApiResult.ok(ApiResult.SUCCESS, "生成移交单附件成功");
}
@ApiOperation(value = "生成移交单附件", notes = "生成移交单附件")
@DeleteMapping(value = "/batchByIds")
public ApiResult batchByIds(@RequestParam("ids") String ids) {
extTransferDocumentService.batchByIds(ids);
return ApiResult.ok(ApiResult.SUCCESS, "生成移交单附件成功");
}
}
......@@ -37,4 +37,6 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext
void saveFilesDocLink(List<ExtFilesUpdateVO> extFilesUpdateVOList);
void returnDocumentByDocId(Long docId);
void batchByIds(String ids);
}
......@@ -275,6 +275,23 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
this.updateExtFilesByBelongingCaseFile(Arrays.asList(target));
}
@Override
public void batchByIds(String ids) {
for (String id : ids.split(",")) {
SearchQueryCondition searchQueryCondition = SearchUtil.buildQueryWithOpenAttr("targetId", SearchItem.Operator.EQ, id, "target");
List<ExtTransferDocLinkVO> extTransferDocLinkVOList = (List<ExtTransferDocLinkVO>) extTransferDocLinkService.findRecursion(searchQueryCondition).getContent();
String state = extTransferDocLinkVOList.get(0).getTarget().getState();
// 编制状态下删除
if (Constants.EDIT.equals(state)) {
List<Long> transferDocLinkIds = extTransferDocLinkVOList.stream().map(ExtTransferDocLinkVO::getId).collect(Collectors.toList());
// 删除移交单文档关系关系
extTransferDocLinkService.deleteAllById(transferDocLinkIds);
// 删除移交单
this.delete(Long.parseLong(id));
}
}
}
@Override
public DxUserInfoVO getSignInfo(List<DxWfProcessTaskVO> activities, String activityName) {
for (DxWfProcessTaskVO wf : activities) {
......
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