Commit aaff167f authored by neo's avatar neo

[bugfix] delete bpl template queyr

parent 07016aa9
......@@ -15,10 +15,22 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.TemplateDto;
import pwc.taxtech.atms.dto.UpateNameParam;
import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.CellTemplate;
import pwc.taxtech.atms.entity.CellTemplateExample;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.ProjectExample;
import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.entity.TemplateExample;
import pwc.taxtech.atms.entity.TemplateGroup;
import pwc.taxtech.atms.entity.TemplateGroupExample;
import pwc.taxtech.atms.service.TemplateService;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy;
......@@ -234,32 +246,32 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
@Override
public OperationResultDto<List<TemplateByGroupDto>> getByGroupId(Long templateGroupId, String projectId) {
OperationResultDto result = new OperationResultDto();
Long bspl = getVatTemplateGroup(projectId);
// Long bspl = getVatTemplateGroup(projectId);
TemplateExample example = new TemplateExample();
List<Long> ids = new ArrayList<>();
ids.add(templateGroupId);
if(!bspl.equals(null)) {
ids.add(bspl);
}
// if(!bspl.equals(null)) {
// ids.add(bspl);
// }
example.createCriteria().andTemplateGroupIdIn(ids);
example.setOrderByClause("order_index");
List<Template> templates = templateMapper.selectByExample(example);
List<TemplateByGroupDto> wrappList = new ArrayList<>();
if (bspl != null) {
TemplateByGroupDto bsplGroup = new TemplateByGroupDto();
bsplGroup.setId(bspl);
bsplGroup.setName(TemplateGroupType.FinancialReturn.name());
List<TemplateDto> templateDtos = new ArrayList<>();
templates.stream().filter(x -> x.getTemplateGroupId().equals(bspl)).collect(Collectors.toList()).forEach(a -> {
TemplateDto templateDto = new TemplateDto();
CommonUtils.copyProperties(a, templateDto);
templateDtos.add(templateDto);
});
bsplGroup.setChildren(templateDtos);
bsplGroup.setOrderIndex(1);
wrappList.add(bsplGroup);
}
// if (bspl != null) {
// TemplateByGroupDto bsplGroup = new TemplateByGroupDto();
// bsplGroup.setId(bspl);
// bsplGroup.setName(TemplateGroupType.FinancialReturn.name());
// List<TemplateDto> templateDtos = new ArrayList<>();
//
// templates.stream().filter(x -> x.getTemplateGroupId().equals(bspl)).collect(Collectors.toList()).forEach(a -> {
// TemplateDto templateDto = new TemplateDto();
// CommonUtils.copyProperties(a, templateDto);
// templateDtos.add(templateDto);
// });
// bsplGroup.setChildren(templateDtos);
// bsplGroup.setOrderIndex(1);
// wrappList.add(bsplGroup);
// }
if (templateGroupId != null) {
TemplateByGroupDto taxReturnGroup = new TemplateByGroupDto();
......@@ -276,7 +288,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
wrappList.add(taxReturnGroup);
}
if (bspl != null || templateGroupId != null) {
if (templateGroupId != null) {
result.setResult(true);
result.setData(wrappList);
} else {
......
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