处理异常,避免异常影响主逻辑

release
wangrangrang 2 years ago
parent 056c08e83b
commit 9df4d38002
  1. 8
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java

@ -364,6 +364,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
}
public void successPush(Long pushInfoRecordId,String content,String result,PushInfo pushInfo,String pushType){
try {
PushInfoRecord pushInfoRecord = new PushInfoRecord();
pushInfoRecord.setId(Long.parseLong(DistributedKeyMaker.generateShotKey()));
pushInfoRecord.setRetryCount(0);
@ -386,9 +387,13 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
}else {
pushInfoRecordMapper.insert(pushInfoRecord);
}
} catch (Exception e) {
log.error("记录推送成功日志出错,"+e.getMessage());
}
}
public void failPush(Long pushInfoRecordId,String content,String result,String failReason,PushInfo pushInfo,String pushType){
try {
PushInfoRecord pushInfoRecord = new PushInfoRecord();
pushInfoRecord.setId(Long.parseLong(DistributedKeyMaker.generateShotKey()));
pushInfoRecord.setRetryCount(0);
@ -411,6 +416,9 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
}else {
pushInfoRecordMapper.insert(pushInfoRecord);
}
} catch (NumberFormatException e) {
log.error("记录推送失败日志出错,"+e.getMessage());
}
}
private R commonPush(CommonTsMqData fpTsMqData) {

Loading…
Cancel
Save