Commit 4f34c3e1 authored by wei's avatar wei 🎱

递归查询项目群信息

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