Commit 5924e0f2 authored by wei's avatar wei 🎱

获取层层项目信息直到顶层

parent c7aceb43
package com.inet.dcs.document.common.vo.archivesOtherVO; package com.inet.dcs.document.common.vo.archivesOtherVO;
import lombok.Data;
/** /**
* @author weihongda * @author weihongda
* @Date 2024/11/4 14:46 * @Date 2024/11/4 14:46
* @Description: TODO * @Description: 移交单归档项目信息
*/ */
@Data
public class ExtTransferDocProjectVO { public class ExtTransferDocProjectVO {
/**
* 项目群代号
*/
private String projectCode;
/**
* 项目群名称
*/
private String projectGroupName;
/**
* 项目名称
*/
private String projectName;
/**
* 子项名称
*/
private String topicTitle;
} }
package com.inet.dcs.document.core.controller; 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.common.vo.archivesOtherVO.ExtTransferDocProjectVO;
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.entity.api.ApiResult; import com.yonde.dex.basedata.entity.api.ApiResult;
...@@ -43,8 +42,7 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex ...@@ -43,8 +42,7 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
@ApiOperation(value = "获取项目信息", notes = "获取项目信息", httpMethod = "POST") @ApiOperation(value = "获取项目信息", notes = "获取项目信息", httpMethod = "POST")
@GetMapping(value = "/getTransferDocProject") @GetMapping(value = "/getTransferDocProject")
public ApiResult getTransferDocProjectById(@RequestParam("id") Long id) { public ApiResult getTransferDocProjectById(@RequestParam("id") Long id) {
ExtTransferDocProjectVO extTransferDocProjectVO = extTransferDocumentService.getTransferDocProjectById(id); return ApiResult.ok(extTransferDocumentService.getTransferDocProjectById(id));
return ApiResult.ok(extTransferDocProjectVO);
} }
} }
......
...@@ -10,11 +10,15 @@ import com.inet.dcs.document.core.service.ExtFilesDocLinkService; ...@@ -10,11 +10,15 @@ 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.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;
import com.yonde.dex.basedata.data.search.SearchItems; import com.yonde.dex.basedata.data.search.SearchItems;
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.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign;
import com.yonde.dex.context.common.vo.DxContextProjectVO;
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;
...@@ -56,6 +60,9 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -56,6 +60,9 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Autowired @Autowired
private ExtFilesDocLinkService extFilesDocLinkService; private ExtFilesDocLinkService extFilesDocLinkService;
@Autowired
private ExtDxContextProjectServiceFeign extDxContextProjectServiceFeign;
@Override @Override
public ExtTransferDocumentVO startWorkflow(Long id) { public ExtTransferDocumentVO startWorkflow(Long id) {
ExtTransferDocumentVO extTransferDocumentVO = this.get(id); ExtTransferDocumentVO extTransferDocumentVO = this.get(id);
...@@ -104,7 +111,23 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -104,7 +111,23 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Override @Override
public ExtTransferDocProjectVO getTransferDocProjectById(Long id) { public ExtTransferDocProjectVO getTransferDocProjectById(Long id) {
return null; ExtTransferDocProjectVO extTransferDocProjectVO = new ExtTransferDocProjectVO();
while (true) {
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, id);
DxPageImpl programDxPage = extDxContextProjectServiceFeign.findRecursion(searchProgram);
DxContextProjectVO dxContextProjectVO = (DxContextProjectVO) programDxPage.getContent().get(0);
//project_class = 项目群:program 项目:project 子项:childProject
if ("program".equals(dxContextProjectVO.getProjectClass())) {
extTransferDocProjectVO.setProjectCode(dxContextProjectVO.getName());
extTransferDocProjectVO.setProjectGroupName(dxContextProjectVO.getName());
return extTransferDocProjectVO;
} else if ("project".equals(dxContextProjectVO.getProjectClass())) {
extTransferDocProjectVO.setTopicTitle(dxContextProjectVO.getName());
} else if ("childProject".equals(dxContextProjectVO.getProjectClass())) {
extTransferDocProjectVO.setProjectName(dxContextProjectVO.getName());
}
id = dxContextProjectVO.getParentId();
}
} }
private void saveFilesDocLink(List<ExtTransferDocLinkVO> transferDocLinkVOList) { private void saveFilesDocLink(List<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