|
|
@ -416,16 +416,17 @@ public class InvoiceBackTask { |
|
|
|
if (BeanUtil.isEmpty(billInfo)) { |
|
|
|
if (BeanUtil.isEmpty(billInfo)) { |
|
|
|
log.info("billInfo中不存咋,id为:{}", id); |
|
|
|
log.info("billInfo中不存咋,id为:{}", id); |
|
|
|
} |
|
|
|
} |
|
|
|
Invoice invoice1 = new Invoice(); |
|
|
|
invoice = new Invoice(); |
|
|
|
invoice1.setFpqqlsh(billInfo.getFpqqlsh()); |
|
|
|
invoice.setFpqqlsh(billInfo.getFpqqlsh()); |
|
|
|
invoice1.setSellerTaxnum(billInfo.getSellerTaxnum()); |
|
|
|
invoice.setSellerTaxnum(billInfo.getSellerTaxnum()); |
|
|
|
invoice1.setOutTradeOrderno(billInfo.getOutTradeOrderno()); |
|
|
|
invoice.setOutTradeOrderno(billInfo.getOutTradeOrderno()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Integer state = invoice.getState() != null ? invoice.getState() : 1; |
|
|
|
Integer state = invoice.getState() != null ? invoice.getState() : 1; |
|
|
|
log.info(ZQ_BACK_DXHY + "id={},state={}", id, state); |
|
|
|
log.info(ZQ_BACK_DXHY + "id={},state={}", id, state); |
|
|
|
log.info(ZQ_BACK_DXHY + "请求大象接口更新发票状态,id={},state={}", id, state); |
|
|
|
log.info(ZQ_BACK_DXHY + "请求大象接口更新发票状态,id={},state={}", id, state); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService("elephantV6_invoice"); |
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService("elephantV6_invoice"); |
|
|
|
Companyservice companyservice = new Companyservice(); |
|
|
|
Companyservice companyservice = new Companyservice(); |
|
|
|
companyservice.setCompanyid(Long.valueOf(invoiceBack.getIdentity())); |
|
|
|
companyservice.setCompanyid(Long.valueOf(invoiceBack.getIdentity())); |
|
|
@ -435,6 +436,9 @@ public class InvoiceBackTask { |
|
|
|
billInfo.setOutTradeOrderno(invoice.getOutTradeOrderno()); |
|
|
|
billInfo.setOutTradeOrderno(invoice.getOutTradeOrderno()); |
|
|
|
log.info("发票回调invoice.id={},getOutTradeOrderno()={},invoice.getFpqqlsh()={}", id, invoice.getOutTradeOrderno(), invoice.getFpqqlsh()); |
|
|
|
log.info("发票回调invoice.id={},getOutTradeOrderno()={},invoice.getFpqqlsh()={}", id, invoice.getOutTradeOrderno(), invoice.getFpqqlsh()); |
|
|
|
HXResponse resultDxhy = invoiceService.batchQueryInvoices(billInfo, "fpqqlsh", companyservice); |
|
|
|
HXResponse resultDxhy = invoiceService.batchQueryInvoices(billInfo, "fpqqlsh", companyservice); |
|
|
|
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
|
|
|
|
log.info("发票回调,拉取异常,拉取大象异常了,id={},异常原因={}", id,e.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info("发票回调id={}", id); |
|
|
|
log.info("发票回调id={}", id); |
|
|
@ -448,7 +452,7 @@ public class InvoiceBackTask { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
state = invoice.getState(); |
|
|
|
state = invoice.getState(); |
|
|
|
log.info(ZQ_BACK_DXHY + "拉去后查询状态为,id={},state={}", id, state); |
|
|
|
log.info(ZQ_BACK_DXHY + "拉取后查询状态为,id={},state={}", id, state); |
|
|
|
|
|
|
|
|
|
|
|
if (state == 20) { |
|
|
|
if (state == 20) { |
|
|
|
log.info(ZQ_BACK_DXHY + "20为开票中,不回调,id={},state={}", id, state); |
|
|
|
log.info(ZQ_BACK_DXHY + "20为开票中,不回调,id={},state={}", id, state); |
|
|
@ -477,7 +481,8 @@ public class InvoiceBackTask { |
|
|
|
if (message.length() > 200) { |
|
|
|
if (message.length() > 200) { |
|
|
|
message = message.substring(0, Math.min(message.length(), 200)); |
|
|
|
message = message.substring(0, Math.min(message.length(), 200)); |
|
|
|
} |
|
|
|
} |
|
|
|
invoiceBack.setBackMsg("zq:" + message); |
|
|
|
invoiceBack.setResultCode("zq:" + status); |
|
|
|
|
|
|
|
invoiceBack.setResultMsg("zq:" + message); |
|
|
|
|
|
|
|
|
|
|
|
if ("0000".equals(status)) { |
|
|
|
if ("0000".equals(status)) { |
|
|
|
invoiceBack.setStatus("1"); |
|
|
|
invoiceBack.setStatus("1"); |
|
|
@ -485,7 +490,7 @@ public class InvoiceBackTask { |
|
|
|
invoiceBack.setStatus("3"); |
|
|
|
invoiceBack.setStatus("3"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
invoiceBack.setStatus("3"); |
|
|
|
invoiceBack.setStatus("3"); |
|
|
|
invoiceBack.setResultMsg("k:客户系统回调异常,status=" + status); |
|
|
|
invoiceBack.setBackMsg("k:客户系统回调异常,status=" + status); |
|
|
|
} |
|
|
|
} |
|
|
|
invoiceBack.setUpdateTime(new Date()); |
|
|
|
invoiceBack.setUpdateTime(new Date()); |
|
|
|
invoiceBackMapper.updateInvoiceBack(invoiceBack); |
|
|
|
invoiceBackMapper.updateInvoiceBack(invoiceBack); |
|
|
@ -513,6 +518,7 @@ public class InvoiceBackTask { |
|
|
|
BillInfo billInfoQuery = new BillInfo(); |
|
|
|
BillInfo billInfoQuery = new BillInfo(); |
|
|
|
billInfoQuery.setFpqqlsh("[\"" + billInfo.getFpqqlsh() + "\"]"); |
|
|
|
billInfoQuery.setFpqqlsh("[\"" + billInfo.getFpqqlsh() + "\"]"); |
|
|
|
billInfoQuery.setOutTradeOrderno(billInfo.getOutTradeOrderno()); |
|
|
|
billInfoQuery.setOutTradeOrderno(billInfo.getOutTradeOrderno()); |
|
|
|
|
|
|
|
billInfoQuery.setSellerTaxnum(billInfo.getSellerTaxnum()); |
|
|
|
|
|
|
|
|
|
|
|
log.info("发票回调getOutTradeOrderno()={},invoice.getFpqqlsh()={}", billInfoQuery.getOutTradeOrderno(), billInfoQuery.getFpqqlsh()); |
|
|
|
log.info("发票回调getOutTradeOrderno()={},invoice.getFpqqlsh()={}", billInfoQuery.getOutTradeOrderno(), billInfoQuery.getFpqqlsh()); |
|
|
|
HXResponse resultDxhy = invoiceService.batchQueryInvoices(billInfoQuery, "fpqqlsh", companyservice); |
|
|
|
HXResponse resultDxhy = invoiceService.batchQueryInvoices(billInfoQuery, "fpqqlsh", companyservice); |
|
|
|