开票成功更新OA状态
This commit is contained in:
parent
3c0433b336
commit
0f780e07f8
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue