Commit 79baf726 authored by neo's avatar neo

[dev] get output page

parent 00112873
...@@ -13,6 +13,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest; ...@@ -13,6 +13,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.constant.enums.EnumModule; import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.dpo.PagingResultDto; import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto; import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.OutputInvoice;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto; import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.service.IdentityService; import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.thirdparty.ExcelUtil; import pwc.taxtech.atms.thirdparty.ExcelUtil;
...@@ -48,7 +49,7 @@ public class OutputInvoiceController { ...@@ -48,7 +49,7 @@ public class OutputInvoiceController {
private FileUploadAdapter fileUploadAdapter; private FileUploadAdapter fileUploadAdapter;
@RequestMapping(value = "queryOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "queryOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public PagingResultDto<OutputVATInvoiceInfoDto> queryOutputInvoiceList(@RequestBody QueryOutputDto queryDto) { public PagingResultDto<OutputInvoice> queryOutputInvoiceList(@RequestBody QueryOutputDto queryDto) {
return outputInvoiceService.queryOutputInvoiceList(queryDto); return outputInvoiceService.queryOutputInvoiceList(queryDto);
} }
......
...@@ -15,12 +15,10 @@ import org.reflections.util.Utils; ...@@ -15,12 +15,10 @@ import org.reflections.util.Utils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.PagingList;
import pwc.taxtech.atms.constant.enums.EnumTbImportType; import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.dpo.PagingResultDto; import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto; import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoice;
import pwc.taxtech.atms.dto.vatdto.OutputInvoice; import pwc.taxtech.atms.dto.vatdto.OutputInvoice;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto; import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.vat.dao.ImportFileMapper; import pwc.taxtech.atms.vat.dao.ImportFileMapper;
...@@ -53,18 +51,8 @@ public class OutputInvoiceServiceImpl extends VatAbstractService { ...@@ -53,18 +51,8 @@ public class OutputInvoiceServiceImpl extends VatAbstractService {
@Autowired @Autowired
private SqlSessionTemplate dynamicSqlSessionTemplate; private SqlSessionTemplate dynamicSqlSessionTemplate;
public PagingResultDto<OutputVATInvoiceInfoDto> queryOutputInvoiceList(QueryOutputDto queryDto) { public PagingResultDto<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto) {
PagingResultDto<OutputVATInvoiceInfoDto> qResult = new PagingResultDto<>(); return get("", queryDto.getPeriodStart(), queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
qResult.setPageInfo(queryDto.getPageInfo());
qResult.setList(new ArrayList<>());
List<OutputVATInvoiceInfoDto> finalList = getQueryList(queryDto);
qResult.getPageInfo().setTotalCount(finalList.size());
if (finalList.size() > 0) {
PagingList pagingList = new PagingList(finalList, qResult.getPageInfo());
qResult.setList(pagingList.getPagingList());
}
return qResult;
} }
private PagingResultDto<OutputInvoice> get(String code, int period, int page, int size) { private PagingResultDto<OutputInvoice> get(String code, int period, int page, int size) {
...@@ -121,7 +109,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService { ...@@ -121,7 +109,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService {
OutputVatInvoiceExample example = new OutputVatInvoiceExample(); OutputVatInvoiceExample example = new OutputVatInvoiceExample();
example.createCriteria().andPeriodIdEqualTo(period.intValue()); example.createCriteria().andPeriodIdEqualTo(period.intValue());
dtoResult.setReturnCode(Long.valueOf(outputVATInvoiceMapper.countByExample(example)).intValue()); dtoResult.setReturnCode(Long.valueOf(outputVATInvoiceMapper.countByExample(example)).intValue());
}else { } else {
dtoResult.setReturnCode(0); dtoResult.setReturnCode(0);
} }
...@@ -294,7 +282,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService { ...@@ -294,7 +282,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService {
public List<OutputVatInvoiceItem> QueryOutputInvoiceItemList(String invoiceId) { public List<OutputVatInvoiceItem> QueryOutputInvoiceItemList(String invoiceId) {
OutputVatInvoiceItemExample example = new OutputVatInvoiceItemExample(); OutputVatInvoiceItemExample example = new OutputVatInvoiceItemExample();
example.createCriteria().andInvoiceIdEqualTo(invoiceId); example.createCriteria().andInvoiceIdEqualTo(invoiceId);
List<OutputVatInvoiceItem> result=outputVATInvoiceItemMapper.selectByExample(example); List<OutputVatInvoiceItem> result = outputVATInvoiceItemMapper.selectByExample(example);
result.stream().sorted(Comparator.comparing(OutputVatInvoiceItem::getSeqNo)); result.stream().sorted(Comparator.comparing(OutputVatInvoiceItem::getSeqNo));
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