ariesy 修复开票时间为空时报错

release
yefei 2 years ago
parent f5728f0d7b
commit 26ff8d3a6f
  1. 18
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java

@ -779,14 +779,18 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
InvoiceInfo invoice = new InvoiceInfo(); InvoiceInfo invoice = new InvoiceInfo();
invoice.setInvoiceTypeCode(snInvoice.getInvoiceType()); invoice.setInvoiceTypeCode(snInvoice.getInvoiceType());
Date date = new Date(); if(snInvoice.getBillingDate() != null) {
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd"); Date date = new Date();
try { SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
date = ft.parse(snInvoice.getBillingDate()); try {
} catch (ParseException e) { date = ft.parse(snInvoice.getBillingDate());
e.printStackTrace(); } catch (ParseException e) {
e.printStackTrace();
}
invoice.setInvoiceDate(date);
}else{
log.error("开票日期为空");
} }
invoice.setInvoiceDate(date);
invoice.setIdentityNumber(snInvoice.getIdcardNo()); invoice.setIdentityNumber(snInvoice.getIdcardNo());
invoice.setPassenger(snInvoice.getRiderName()); invoice.setPassenger(snInvoice.getRiderName());

Loading…
Cancel
Save