Commit 3193f8aa authored by neo's avatar neo

[bugfix] fixed query output invoice detail impl

parent f2e14ab7
...@@ -29,6 +29,7 @@ import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto; ...@@ -29,6 +29,7 @@ import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.entity.Organization; import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample; import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.entity.Project; import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.invoice.OutputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper; import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.Message; import pwc.taxtech.atms.service.impl.Message;
import pwc.taxtech.atms.vat.dao.ImportFileMapper; import pwc.taxtech.atms.vat.dao.ImportFileMapper;
...@@ -66,6 +67,8 @@ public class OutputInvoiceServiceImpl { ...@@ -66,6 +67,8 @@ public class OutputInvoiceServiceImpl {
private ProjectMapper projectMapper; private ProjectMapper projectMapper;
@Autowired @Autowired
private OrganizationMapper organizationMapper; private OrganizationMapper organizationMapper;
@Autowired
private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) { public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
...@@ -73,8 +76,8 @@ public class OutputInvoiceServiceImpl { ...@@ -73,8 +76,8 @@ public class OutputInvoiceServiceImpl {
OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample(); OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample();
outputInvoiceExample.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber()).andKPZTEqualTo(OUTPUT_KPZT_YES). outputInvoiceExample.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber()).andKPZTEqualTo(OUTPUT_KPZT_YES).
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()), andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd())); DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()));
PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize()); PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample); List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
...@@ -290,11 +293,14 @@ public class OutputInvoiceServiceImpl { ...@@ -290,11 +293,14 @@ public class OutputInvoiceServiceImpl {
} }
} }
public List<OutputVatInvoiceItem> QueryOutputInvoiceItemList(String invoiceId) { public List<OutputInvoiceDetail> QueryOutputInvoiceItemList(String invoiceId) {
OutputVatInvoiceItemExample example = new OutputVatInvoiceItemExample(); OutputInvoiceExample example = new OutputInvoiceExample();
example.createCriteria().andInvoiceIdEqualTo(invoiceId); example.createCriteria().andIDEqualTo(invoiceId);
List<OutputVatInvoiceItem> result = outputVATInvoiceItemMapper.selectByExample(example); OutputInvoice outputInvoice = outputInvoiceMapper.selectByExample(example).get(0);
result.stream().sorted(Comparator.comparing(OutputVatInvoiceItem::getSeqNo));
OutputInvoiceDetailExample detailExample = new OutputInvoiceDetailExample();
detailExample.createCriteria().andFPQQLSHEqualTo(outputInvoice.getFPQQLSH());
List<OutputInvoiceDetail> result = outputInvoiceDetailMapper.selectByExample(detailExample);
return result; return result;
} }
} }
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