Commit 07016aa9 authored by neo's avatar neo

[bugfix] fixed get vattemplate group id not bslp

parent b3d50785
......@@ -234,7 +234,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
@Override
public OperationResultDto<List<TemplateByGroupDto>> getByGroupId(Long templateGroupId, String projectId) {
OperationResultDto result = new OperationResultDto();
Long bspl = getBSPLTemplateGroup(projectId);
Long bspl = getVatTemplateGroup(projectId);
TemplateExample example = new TemplateExample();
List<Long> ids = new ArrayList<>();
ids.add(templateGroupId);
......@@ -242,7 +242,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
ids.add(bspl);
}
example.createCriteria().andTemplateGroupIdIn(ids);
example.setOrderByClause(" order_index");
example.setOrderByClause("order_index");
List<Template> templates = templateMapper.selectByExample(example);
List<TemplateByGroupDto> wrappList = new ArrayList<>();
if (bspl != null) {
......@@ -285,7 +285,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result;
}
private Long getBSPLTemplateGroup(String projectId) {
private Long getVatTemplateGroup(String projectId) {
ProjectExample example = new ProjectExample();
example.createCriteria().andIdEqualTo(projectId);
List<Project> projects = projectMapper.selectByExample(example);
......@@ -295,10 +295,12 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
}
List<TemplateGroup> allTemplateGroups = templateGroupMapper.selectByExample(new TemplateGroupExample());
Optional<TemplateGroup> bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().equals(industryId) && a.getGroupType().equals(TemplateGroupType.FinancialReturn.getCode())).findFirst();
Optional<TemplateGroup> bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().equals(industryId)
&& a.getGroupType().equals(TemplateGroupType.TaxReturn.getCode())).findFirst();
if (!bsplTemplateGroup.isPresent()) {
bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().contains(industryId.get()) && a.getGroupType().equals(TemplateGroupType.FinancialReturn.getCode())).findFirst();
bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().contains(industryId.get())
&& a.getGroupType().equals(TemplateGroupType.TaxReturn.getCode())).findFirst();
}
if (!bsplTemplateGroup.isPresent()) {
......
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