开票成功更新OA状态
This commit is contained in:
parent
3c0433b336
commit
0f780e07f8
|
@ -1236,25 +1236,33 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
|
|||
String attrStr = jsonResultEntity.getAttribute().toString();
|
||||
JSONObject attrObj = JSONObject.parseObject(attrStr);
|
||||
JSONObject attribute = attrObj.getJSONObject("attribute");
|
||||
if (null != attribute && !"0".equals(attribute.getString("code"))){
|
||||
String message = attribute.getString("message");
|
||||
if (StrUtil.isEmpty(message)){
|
||||
message = "开票失败";
|
||||
}
|
||||
if (null != attribute){
|
||||
InvoiceEntity invoiceEntity = new InvoiceEntity();
|
||||
invoiceEntity.setId(data_id);
|
||||
invoiceEntity.setFailure_reason(message);
|
||||
invoiceEntity.setDataSourceCode("HT-OA");
|
||||
invoiceDao.updateInvoiceResult(invoiceEntity);
|
||||
//查询待办,退回流程用,这里只处理退回的情况,如果要处理提交,要等开票成功后才能提交,去定时查开票结果的定时任务里做
|
||||
ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity();
|
||||
applyInvoice.setId(data_id);
|
||||
applyInvoice.setDataSourceCode("HT-OA");
|
||||
//暂时先不退回,还不稳定 等稳定了再说
|
||||
ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice);
|
||||
if (null != applyInvoiceEntity){
|
||||
// String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), message);
|
||||
// applyInvoiceService.process(stepBack,"8000590006","ZZZH");
|
||||
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();
|
||||
applyInvoice.setId(data_id);
|
||||
applyInvoice.setDataSourceCode("HT-OA");
|
||||
//暂时先不退回,还不稳定 等稳定了再说
|
||||
ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice);
|
||||
if (null != applyInvoiceEntity){
|
||||
// String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), message);
|
||||
// applyInvoiceService.process(stepBack,"8000590006","ZZZH");
|
||||
}
|
||||
}
|
||||
logger.info("开票申请下发到有度成功,准备更新OA表单:{}",JSONObject.toJSONString(invoiceEntity));
|
||||
if (StrUtil.isNotEmpty(invoiceEntity.getId()) && StrUtil.isNotEmpty(invoiceEntity.getResult_status())){
|
||||
invoiceDao.updateInvoiceResult(invoiceEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue