Commit f35d5b0b authored by neo's avatar neo

[bugfix] fix null point for empty list

parent d8dfcedd
......@@ -86,15 +86,20 @@ public class OutputInvoiceServiceImpl extends VatAbstractService {
}
public OperationResultDto<List<OutputVATInvoiceInfoDto>> getOutputInvoiceList(Integer period) {
List<OutputVATInvoiceInfoDto> result = outputVATInvoiceMapper.queryOutputDetailWithItem(period);
result.sort(Comparator.comparing(OutputVATInvoiceInfoDto::getInvoiceID));
List<OutputVATInvoiceInfoDto> result = new ArrayList<>();
OperationResultDto<List<OutputVATInvoiceInfoDto>> dtoResult = new OperationResultDto();
OutputVATInvoiceExample example = new OutputVATInvoiceExample();
example.createCriteria().andPeriodIDEqualTo(period.intValue());
result.addAll(outputVATInvoiceMapper.queryOutputDetailWithItem(period));
if (!result.isEmpty()) {
result.sort(Comparator.comparing(OutputVATInvoiceInfoDto::getInvoiceID));
OutputVATInvoiceExample example = new OutputVATInvoiceExample();
example.createCriteria().andPeriodIDEqualTo(period.intValue());
dtoResult.setReturnCode(Long.valueOf(outputVATInvoiceMapper.countByExample(example)).intValue());
}else {
dtoResult.setReturnCode(0);
}
dtoResult.setData(result);
dtoResult.setReturnCode(Long.valueOf(outputVATInvoiceMapper.countByExample(example)).intValue());
dtoResult.setResult(true);
return dtoResult;
}
......
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