Commit 826e4d18 authored by wei's avatar wei 🎱

从文档里面排除,移交单下的文件

parent a89283a0
...@@ -197,6 +197,11 @@ public class Constants { ...@@ -197,6 +197,11 @@ public class Constants {
*/ */
public static final String COMPLETED = "completed"; public static final String COMPLETED = "completed";
/**
* 移交单已完成
*/
public static final String COMPLETE = "Complete";
/** /**
* IED计划已完成 * IED计划已完成
*/ */
......
...@@ -3,6 +3,7 @@ package com.inet.dcs.document.core.controller; ...@@ -3,6 +3,7 @@ package com.inet.dcs.document.core.controller;
import com.inet.dcs.document.common.vo.ExtTransferDocumentVO; import com.inet.dcs.document.common.vo.ExtTransferDocumentVO;
import com.inet.dcs.document.core.controller.shadow.ExtTransferDocumentControllerShadow; import com.inet.dcs.document.core.controller.shadow.ExtTransferDocumentControllerShadow;
import com.inet.dcs.document.core.service.ExtTransferDocumentService; import com.inet.dcs.document.core.service.ExtTransferDocumentService;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.ApiResult; import com.yonde.dex.basedata.entity.api.ApiResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -44,6 +45,12 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex ...@@ -44,6 +45,12 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
public ApiResult getTransferDocProjectById(@RequestParam("id") Long id) { public ApiResult getTransferDocProjectById(@RequestParam("id") Long id) {
return ApiResult.ok(extTransferDocumentService.getTransferDocProjectById(id)); return ApiResult.ok(extTransferDocumentService.getTransferDocProjectById(id));
} }
@ApiOperation(value = "获取文档列表", notes = "获取文档列表", httpMethod = "POST")
@GetMapping(value = "/getDxDocumentList")
public ApiResult getDxDocumentList(@RequestBody SearchQueryCondition searchQueryCondition) {
return ApiResult.ok(extTransferDocumentService.getDxDocumentList(searchQueryCondition));
}
} }
...@@ -3,6 +3,9 @@ package com.inet.dcs.document.core.service; ...@@ -3,6 +3,9 @@ package com.inet.dcs.document.core.service;
import com.inet.dcs.document.common.vo.ExtTransferDocumentVO; import com.inet.dcs.document.common.vo.ExtTransferDocumentVO;
import com.inet.dcs.document.common.vo.archivesOtherVO.ExtTransferDocProjectVO; import com.inet.dcs.document.common.vo.archivesOtherVO.ExtTransferDocProjectVO;
import com.inet.dcs.document.core.service.shadow.ExtTransferDocumentServiceShadow; import com.inet.dcs.document.core.service.shadow.ExtTransferDocumentServiceShadow;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
/** /**
* @description: ExtTransferDocument-service * @description: ExtTransferDocument-service
* @author: dexadmin * @author: dexadmin
...@@ -16,4 +19,6 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext ...@@ -16,4 +19,6 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext
void updateExtFiles(ExtTransferDocumentVO extTransferDocumentVO); void updateExtFiles(ExtTransferDocumentVO extTransferDocumentVO);
ExtTransferDocProjectVO getTransferDocProjectById(Long id); ExtTransferDocProjectVO getTransferDocProjectById(Long id);
DxPageImpl getDxDocumentList(SearchQueryCondition searchQueryCondition);
} }
...@@ -10,6 +10,7 @@ import com.inet.dcs.document.core.service.ExtFilesDocLinkService; ...@@ -10,6 +10,7 @@ import com.inet.dcs.document.core.service.ExtFilesDocLinkService;
import com.inet.dcs.document.core.service.ExtFilesService; import com.inet.dcs.document.core.service.ExtFilesService;
import com.inet.dcs.document.core.service.ExtTransferDocLinkService; import com.inet.dcs.document.core.service.ExtTransferDocLinkService;
import com.inet.dcs.document.core.service.ExtTransferDocumentService; import com.inet.dcs.document.core.service.ExtTransferDocumentService;
import com.inet.dcs.document.core.service.expand.ExtDxDocumentService;
import com.inet.dcs.document.core.util.SearchUtil; import com.inet.dcs.document.core.util.SearchUtil;
import com.inet.dcs.document.entity.po.ExtTransferDocument; import com.inet.dcs.document.entity.po.ExtTransferDocument;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
...@@ -19,6 +20,7 @@ import com.yonde.dex.basedata.entity.data.DxPageImpl; ...@@ -19,6 +20,7 @@ import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign; import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign;
import com.yonde.dex.context.common.vo.DxContextProjectVO; import com.yonde.dex.context.common.vo.DxContextProjectVO;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign; import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -38,7 +40,7 @@ import java.util.stream.Collectors; ...@@ -38,7 +40,7 @@ import java.util.stream.Collectors;
**/ **/
@Slf4j @Slf4j
@Service(ExtTransferDocumentServiceImpl.BEAN_NAME) @Service(ExtTransferDocumentServiceImpl.BEAN_NAME)
public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> implements ExtTransferDocumentService<V> { public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> implements ExtTransferDocumentService<V>, DxDaoPluginExpander<V> {
public static final String BEAN_NAME = "extTransferDocumentServiceImpl"; public static final String BEAN_NAME = "extTransferDocumentServiceImpl";
...@@ -63,6 +65,17 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -63,6 +65,17 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Autowired @Autowired
private ExtDxContextProjectServiceFeign extDxContextProjectServiceFeign; private ExtDxContextProjectServiceFeign extDxContextProjectServiceFeign;
@Autowired
private ExtDxDocumentService extDxDocumentService;
/* @Override
public void beforeSave(Collection<V> target) {
// 校验是否存在归档中文件
for (V v : target) {
target
}
}*/
@Override @Override
public ExtTransferDocumentVO startWorkflow(Long id) { public ExtTransferDocumentVO startWorkflow(Long id) {
ExtTransferDocumentVO extTransferDocumentVO = this.get(id); ExtTransferDocumentVO extTransferDocumentVO = this.get(id);
...@@ -130,6 +143,27 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -130,6 +143,27 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
} }
} }
@Override
public DxPageImpl getDxDocumentList(SearchQueryCondition searchQueryCondition) {
// 查询不是已完成状态的移交单文档
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder()
.item(new SearchItem("target.state", SearchItem.Operator.NEQ, Constants.COMPLETE, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
List<ExtTransferDocLinkVO> transferDocLinkVOList = extTransferDocLinkService.findRecursion(queryDoc).getContent();
// 从文档里面排除
if (CollectionUtils.isNotEmpty(transferDocLinkVOList)) {
log.info("transferDocLinkVOList.size={}", transferDocLinkVOList.size());
List<Long> sourceIds = transferDocLinkVOList.stream().map(ExtTransferDocLinkVO::getSourceId).collect(Collectors.toList());
SearchItem searchItem = new SearchItem("id", SearchItem.Operator.NOTIN, sourceIds, null);
searchQueryCondition.getSearchItems().addItem(searchItem);
}
return extDxDocumentService.findRecursion(searchQueryCondition);
}
private void saveFilesDocLink(List<ExtTransferDocLinkVO> transferDocLinkVOList) { private void saveFilesDocLink(List<ExtTransferDocLinkVO> transferDocLinkVOList) {
List<ExtFilesUpdateVO> extFilesUpdateVOList = Lists.newArrayList(); List<ExtFilesUpdateVO> extFilesUpdateVOList = Lists.newArrayList();
for (ExtTransferDocLinkVO extTransferDocLinkVO : transferDocLinkVOList) { for (ExtTransferDocLinkVO extTransferDocLinkVO : transferDocLinkVOList) {
......
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