Commit 4e43b5d6 authored by neo's avatar neo

[bugfix] null point for voucher list item toString,if null set ''

parent a2f42d12
...@@ -9,13 +9,22 @@ import pwc.taxtech.atms.constant.enums.VoucherLevelEnum; ...@@ -9,13 +9,22 @@ import pwc.taxtech.atms.constant.enums.VoucherLevelEnum;
import pwc.taxtech.atms.constant.enums.VoucherSearchEnum; import pwc.taxtech.atms.constant.enums.VoucherSearchEnum;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.PagingDto; import pwc.taxtech.atms.dto.PagingDto;
import pwc.taxtech.atms.dto.vatdto.*; import pwc.taxtech.atms.dto.vatdto.QueryConditionDto;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccountExample; import pwc.taxtech.atms.dto.vatdto.QueryVoucherDto;
import pwc.taxtech.atms.dto.vatdto.QueryVoucherMainDto;
import pwc.taxtech.atms.dto.vatdto.VIDCountDto;
import pwc.taxtech.atms.dto.vatdto.VoucherDto;
import pwc.taxtech.atms.dto.vatdto.VoucherMainDto;
import pwc.taxtech.atms.dto.vatdto.VoucherTmplDto;
import pwc.taxtech.atms.vat.service.VoucherService; import pwc.taxtech.atms.vat.service.VoucherService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -266,22 +275,22 @@ public class VoucherServiceImpl extends VatAbstractService implements VoucherSer ...@@ -266,22 +275,22 @@ public class VoucherServiceImpl extends VatAbstractService implements VoucherSer
List<VoucherDto> voucherDtos = new ArrayList<>(); List<VoucherDto> voucherDtos = new ArrayList<>();
queryForList.forEach(a -> { queryForList.forEach(a -> {
VoucherDto dto = new VoucherDto(); VoucherDto dto = new VoucherDto();
dto.setVoucherID(a.get("VoucherID").toString()); dto.setVoucherID(a.get("VoucherID") == null ? "" : a.get("VoucherID").toString());
dto.setPeriod(Integer.parseInt(a.get("Period").toString())); dto.setPeriod(Integer.parseInt(a.get("Period") == null ? "" : a.get("Period").toString()));
dto.setDate(DateTime.parse(a.get("Date").toString()).toDate()); dto.setDate(DateTime.parse(a.get("Date") == null ? "" : a.get("Date").toString()).toDate());
dto.setGroup(a.get("Group").toString()); dto.setGroup(a.get("Group") == null ? "" : a.get("Group").toString());
dto.setvID(a.get("VID").toString()); dto.setvID(a.get("VID") == null ? "" : a.get("VID").toString());
dto.setSummary(a.get("Summary").toString()); dto.setSummary(a.get("Summary") == null ? "" : a.get("Summary").toString());
dto.setAcctCode(a.get("AcctCode").toString()); dto.setAcctCode(a.get("AcctCode") == null ? "" : a.get("AcctCode").toString());
dto.setDebit(BigDecimal.valueOf(Double.valueOf(a.get("Debit").toString()))); dto.setDebit(BigDecimal.valueOf(Double.valueOf(a.get("Debit") == null ? "" : a.get("Debit").toString())));
dto.setCredit(BigDecimal.valueOf(Double.valueOf(a.get("Credit").toString()))); dto.setCredit(BigDecimal.valueOf(Double.valueOf(a.get("Credit") == null ? "" : a.get("Credit").toString())));
dto.setGroupShow(a.get("Group").toString() + "-" + a.get("VID").toString()); dto.setGroupShow(a.get("Group") == null ? "" : a.get("Group").toString() + "-" + a.get("VID") == null ? "" : a.get("VID").toString());
dto.setAcctCodeAndNameShow(a.get("AcctCode").toString() + (StringUtils.isNotBlank(a.get("FullName").toString()) ? "/" + a.get("FullName") : null)); dto.setAcctCodeAndNameShow(a.get("AcctCode") == null ? "" : a.get("AcctCode").toString() + (StringUtils.isNotBlank(a.get("FullName") == null ? "" : a.get("FullName").toString()) ? "/" + a.get("FullName") : null));
dto.setCustomerCode(a.get("CustomerCode").toString()); dto.setCustomerCode(a.get("CustomerCode") == null ? "" : a.get("CustomerCode").toString());
dto.setCustomerName(a.get("CustomerName").toString()); dto.setCustomerName(a.get("CustomerName") == null ? "" : a.get("CustomerName").toString());
dto.setCustomerCodeAndNameShow(a.get("CustomerCode").toString() + (StringUtils.isNotBlank(a.get("CustomerName").toString()) ? "/" + a.get("CustomerName").toString() : null)); dto.setCustomerCodeAndNameShow(a.get("CustomerCode") == null ? "" : a.get("CustomerCode").toString() + (StringUtils.isNotBlank(a.get("CustomerName") == null ? "" : a.get("CustomerName").toString()) ? "/" + a.get("CustomerName") == null ? "" : a.get("CustomerName").toString() : null));
dto.setStdCodeAndNameShow(a.get("StdCode").toString() + (StringUtils.isNotBlank(a.get("StdName").toString()) ? "/" + a.get("StdName").toString() : null)); dto.setStdCodeAndNameShow(a.get("StdCode") == null ? "" : a.get("StdCode").toString() + (StringUtils.isNotBlank(a.get("StdName") == null ? "" : a.get("StdName").toString()) ? "/" + a.get("StdName") == null ? "" : a.get("StdName").toString() : null));
dto.setStdCode(a.get("VoucherStd").toString()); dto.setStdCode(a.get("VoucherStd") == null ? "" : a.get("VoucherStd").toString());
voucherDtos.add(dto); voucherDtos.add(dto);
}); });
...@@ -552,14 +561,14 @@ public class VoucherServiceImpl extends VatAbstractService implements VoucherSer ...@@ -552,14 +561,14 @@ public class VoucherServiceImpl extends VatAbstractService implements VoucherSer
queryResult.forEach(a -> { queryResult.forEach(a -> {
VoucherMainDto voucherMainDto = new VoucherMainDto(); VoucherMainDto voucherMainDto = new VoucherMainDto();
voucherMainDto.setPeriod(Integer.parseInt(a.get("Period").toString())); voucherMainDto.setPeriod(Integer.parseInt(a.get("Period") == null ? "" : a.get("Period").toString()));
voucherMainDto.setGroup(a.get("Group").toString()); voucherMainDto.setGroup(a.get("Group") == null ? "" : a.get("Group").toString());
voucherMainDto.setvID(a.get("VID").toString()); voucherMainDto.setvID(a.get("VID") == null ? "" : a.get("VID").toString());
voucherMainDto.setDate(DateTime.parse(a.get("Date").toString()).toDate()); voucherMainDto.setDate(DateTime.parse(a.get("Date") == null ? "" : a.get("Date").toString()).toDate());
voucherMainDto.setDebitSum(new BigDecimal(Double.valueOf(a.get("DebitSum").toString()))); voucherMainDto.setDebitSum(new BigDecimal(Double.valueOf(a.get("DebitSum") == null ? "" : a.get("DebitSum").toString())));
voucherMainDto.setCreditSum(new BigDecimal(Double.valueOf(a.get("CreditSum").toString()))); voucherMainDto.setCreditSum(new BigDecimal(Double.valueOf(a.get("CreditSum") == null ? "" : a.get("CreditSum").toString())));
voucherMainDto.setGroupShow(a.get("Group").toString() + "-" + a.get("VID").toString()); voucherMainDto.setGroupShow(a.get("Group") == null ? "" : a.get("Group").toString() + "-" + a.get("VID") == null ? "" : a.get("VID").toString());
voucherMainDto.setItemCount(Integer.valueOf(a.get("ItemCount").toString())); voucherMainDto.setItemCount(Integer.valueOf(a.get("ItemCount") == null ? "" : a.get("ItemCount").toString()));
voucherMainDtos.add(voucherMainDto); voucherMainDtos.add(voucherMainDto);
}); });
......
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