Commit 4f34c3e1 authored by wei's avatar wei 🎱

递归查询项目群信息

parent e3b4ca4a
...@@ -13,6 +13,7 @@ import com.yonde.dex.basedata.data.search.SearchQueryCondition; ...@@ -13,6 +13,7 @@ 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.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.DxContextVO; import com.yonde.dex.context.common.vo.DxContextVO;
import com.yonde.dex.dao.service.DxDaoPluginExpander; import com.yonde.dex.dao.service.DxDaoPluginExpander;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -53,11 +54,12 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic ...@@ -53,11 +54,12 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
// 全宗号+项目号+项目代号+类别代号+盒号(三位流水号)+后缀“-(两位数字流水号)例如:2-20114272031-QH03-JS01-001-(01) // 全宗号+项目号+项目代号+类别代号+盒号(三位流水号)+后缀“-(两位数字流水号)例如:2-20114272031-QH03-JS01-001-(01)
String projectCodeAndNumber; String projectCodeAndNumber;
for (V v : target) { for (V v : target) {
DxContextVO dxContext = v.getDxContext(); DxContextProjectVO dxContextProjectVO = this.getProjectInfoById(v.getDxContextId());
if ("program".equals(dxContext.getProjectClass())) { // 项目群下的案卷直接拼接
projectCodeAndNumber = dxContext.getContractCode() + "-" + dxContext.getNumber(); if ("program".equals(dxContextProjectVO.getProjectClass())) {
projectCodeAndNumber = dxContextProjectVO.getContractCode() + "-" + dxContextProjectVO.getNumber();
} else { } else {
projectCodeAndNumber = this.getProjectCodeAndNumber(dxContext); projectCodeAndNumber = this.getProjectCodeAndNumber(dxContextProjectVO);
} }
String caseNumber = this.getCaseNumber(v.getCaseNumber()); String caseNumber = this.getCaseNumber(v.getCaseNumber());
String categoryNumber = v.getCategoryNumber(); String categoryNumber = v.getCategoryNumber();
...@@ -96,7 +98,7 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic ...@@ -96,7 +98,7 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
return (List<ExtFilesVO>) this.findRecursion(queryDoc).getContent(); return (List<ExtFilesVO>) this.findRecursion(queryDoc).getContent();
} }
private String getProjectCodeAndNumber(DxContextVO dxContext) { private String getProjectCodeAndNumber(DxContextProjectVO dxContextProjectVO) {
boolean projectClass = false; boolean projectClass = false;
// 项目群上的合同编号 // 项目群上的合同编号
String contractCode = ""; String contractCode = "";
...@@ -104,21 +106,27 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic ...@@ -104,21 +106,27 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
String number = ""; String number = "";
// 非项目群下的案卷,查顶级 // 非项目群下的案卷,查顶级
while (!projectClass) { while (!projectClass) {
dxContext = this.getProjectInfo(dxContext); dxContextProjectVO = this.getProjectInfo(dxContextProjectVO);
projectClass = "program".equals(dxContext.getProjectClass()); projectClass = "program".equals(dxContextProjectVO.getProjectClass());
if (projectClass) { if (projectClass) {
contractCode = dxContext.getContractCode(); contractCode = dxContextProjectVO.getContractCode();
number = dxContext.getNumber(); number = dxContextProjectVO.getNumber();
} }
} }
return contractCode + "-" + number; return contractCode + "-" + number;
} }
private DxContextVO getProjectInfo(DxContextVO dxContextVO) { private DxContextProjectVO getProjectInfo(DxContextVO dxContextVO) {
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, dxContextVO.getParentId()); SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, dxContextVO.getParentId());
DxPageImpl programDxPage = extDxContextProjectServiceFeign.findRecursion(searchProgram); DxPageImpl programDxPage = extDxContextProjectServiceFeign.findRecursion(searchProgram);
return (DxContextVO) programDxPage.getContent().get(0); return (DxContextProjectVO) programDxPage.getContent().get(0);
}
private DxContextProjectVO getProjectInfoById(Long id) {
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, id);
DxPageImpl programDxPage = extDxContextProjectServiceFeign.findRecursion(searchProgram);
return (DxContextProjectVO) programDxPage.getContent().get(0);
} }
private String getCaseNumber(String caseNumber) { private String getCaseNumber(String caseNumber) {
......
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