|
|
|
@ -42,7 +42,7 @@ public class QueryInvoiceTask extends TimerTask { |
|
|
|
|
private InvoiceBackMapper invoiceBackMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public QueryInvoiceTask(BillInfo billInfo, Companyservice companyservice, IInvoiceApiService invoiceApiService) { |
|
|
|
|
public QueryInvoiceTask(BillInfo billInfo, Companyservice companyservice, IInvoiceApiService invoiceApiService,InvoiceBackMapper invoiceBackMapper) { |
|
|
|
|
this.finalBillInfo = billInfo; |
|
|
|
|
this.companyservice = companyservice; |
|
|
|
|
this.invoiceApiService = invoiceApiService; |
|
|
|
@ -78,7 +78,7 @@ public class QueryInvoiceTask extends TimerTask { |
|
|
|
|
queryTimes += 1; |
|
|
|
|
redisCache.setCacheObject(keys, queryTimes); |
|
|
|
|
log.error("【定时任务】【发票查询】发票信息不存在或还在开票中,再次进入查询:{}", JSONObject.toJSONString(this.finalBillInfo)); |
|
|
|
|
AsyncManager.me().execute(new QueryInvoiceTask(this.finalBillInfo, companyservice, this.invoiceApiService)); |
|
|
|
|
AsyncManager.me().execute(new QueryInvoiceTask(this.finalBillInfo, companyservice, this.invoiceApiService,null)); |
|
|
|
|
} else if (invoice == null || StringUtils.equalsAny(Integer.toString(invoice.getState()), "2", "22")) { |
|
|
|
|
// 2开票成功 22开票失败
|
|
|
|
|
// 再次推送
|
|
|
|
@ -93,7 +93,7 @@ public class QueryInvoiceTask extends TimerTask { |
|
|
|
|
private void pushCoustomInvoiceInfo(Invoice invoice) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
log.info("【重汽批量开票】进入发票批量开具回调队列:InvoiceId={}",invoice.getId()); |
|
|
|
|
log.info("【重汽批量开票】进入发票批量开具回调队列:InvoiceId={},{}",invoice.getId(),invoiceBackMapper); |
|
|
|
|
String kpStatus = Integer.toString(invoice.getState()).equals("2") ? "0000":"9999"; |
|
|
|
|
String kpMsg = Integer.toString(invoice.getState()).equals("2") ? "开票成功":"开票失败"; |
|
|
|
|
|
|
|
|
@ -101,6 +101,7 @@ public class QueryInvoiceTask extends TimerTask { |
|
|
|
|
invoiceBackQueryWrapper.eq("system_orderno", invoice.getOutTradeOrderno()); |
|
|
|
|
InvoiceBack invoiceBackVali = invoiceBackMapper.selectOne(invoiceBackQueryWrapper); |
|
|
|
|
|
|
|
|
|
log.info("【重汽批量开票】查询回调表信息:{}",JSONUtil.toJsonStr(invoiceBackVali)); |
|
|
|
|
if (BeanUtil.isEmpty(invoiceBackVali)) { |
|
|
|
|
invoiceBackVali = new InvoiceBack(); |
|
|
|
|
invoiceBackVali.setSystemOrderno(invoice.getOutTradeOrderno()); |
|
|
|
|