Explorar el Código

cid优化记录短信日志

zyy hace 2 semanas
padre
commit
4fe106ffd0

+ 6 - 4
fs-service/src/main/java/com/fs/company/service/impl/CompanyVoiceRoboticServiceImpl.java

@@ -433,18 +433,20 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
                                 wxAccount.getCompanyUserId(),
                                 temp.getTempId()
                         );
+                        addLog.setStatus(1);
                         try{
+                            int smsContentLen = getSmsContentLen(smsSendBatchParam);
+                            addLog.setContentLen(smsContentLen);
                             sendMsgBatch(temp,smsSendBatchParam);
-                            addLog.setStatus(1);
+                            addLog.setStatus(2);
                             addLog.setCallbackUuid(callbackUuid);
                         } catch(Exception ex){
                             addLog.setStatus(3);
                             addLog.setResult(ex.getMessage());
                             log.error("sendMsgOne异常:",ex);
+                        } finally {
+                            companyVoiceRoboticCallLogSendmsgService.asyncInsertCompanyVoiceRoboticCallLog(addLog);
                         }
-                        int smsContentLen = getSmsContentLen(smsSendBatchParam);
-                        addLog.setContentLen(smsContentLen);
-                        companyVoiceRoboticCallLogSendmsgService.asyncInsertCompanyVoiceRoboticCallLog(addLog);
                     }
                     else{
                         log.error("剩余短信数量不足,请充值:task:{},companyId:{}",roboticId,wxAccount.getCompanyId());