开票成功更新OA状态

This commit is contained in:
xiangerlin 2025-07-16 08:55:13 +08:00
parent 3c0433b336
commit 0f780e07f8
1 changed files with 24 additions and 16 deletions

View File

@ -1236,16 +1236,19 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
String attrStr = jsonResultEntity.getAttribute().toString(); String attrStr = jsonResultEntity.getAttribute().toString();
JSONObject attrObj = JSONObject.parseObject(attrStr); JSONObject attrObj = JSONObject.parseObject(attrStr);
JSONObject attribute = attrObj.getJSONObject("attribute"); JSONObject attribute = attrObj.getJSONObject("attribute");
if (null != attribute && !"0".equals(attribute.getString("code"))){ if (null != attribute){
String message = attribute.getString("message");
if (StrUtil.isEmpty(message)){
message = "开票失败";
}
InvoiceEntity invoiceEntity = new InvoiceEntity(); InvoiceEntity invoiceEntity = new InvoiceEntity();
invoiceEntity.setId(data_id); invoiceEntity.setId(data_id);
invoiceEntity.setFailure_reason(message);
invoiceEntity.setDataSourceCode("HT-OA"); invoiceEntity.setDataSourceCode("HT-OA");
invoiceDao.updateInvoiceResult(invoiceEntity); if ("0".equals(attribute.getString("code"))){
invoiceEntity.setResult_status("申请单处理中");
}else {
String message = attribute.getString("message");
if (StrUtil.isEmpty(message)){
message = "申请单开具异常";
}
invoiceEntity.setFailure_reason(message);
invoiceEntity.setResult_status("申请单开具异常");
//查询待办退回流程用这里只处理退回的情况如果要处理提交要等开票成功后才能提交去定时查开票结果的定时任务里做 //查询待办退回流程用这里只处理退回的情况如果要处理提交要等开票成功后才能提交去定时查开票结果的定时任务里做
ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity();
applyInvoice.setId(data_id); applyInvoice.setId(data_id);
@ -1257,6 +1260,11 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
// applyInvoiceService.process(stepBack,"8000590006","ZZZH"); // applyInvoiceService.process(stepBack,"8000590006","ZZZH");
} }
} }
logger.info("开票申请下发到有度成功准备更新OA表单:{}",JSONObject.toJSONString(invoiceEntity));
if (StrUtil.isNotEmpty(invoiceEntity.getId()) && StrUtil.isNotEmpty(invoiceEntity.getResult_status())){
invoiceDao.updateInvoiceResult(invoiceEntity);
}
}
} }
}catch (Exception e){ }catch (Exception e){
logger.info("调用有度开票申请接口后更新OA表单开票结果出错:{}",e); logger.info("调用有度开票申请接口后更新OA表单开票结果出错:{}",e);