优化短信日志相关逻辑
This commit is contained in:
@@ -22,8 +22,11 @@ public enum SmsSendStatusEnum {
|
||||
//失败
|
||||
FAIL(3),
|
||||
|
||||
//等待回执
|
||||
WAITING(4),
|
||||
|
||||
//成功
|
||||
SUCCESS(4);
|
||||
SUCCESS(5);
|
||||
|
||||
private final int status;
|
||||
|
||||
|
||||
@@ -59,6 +59,14 @@ public class SysSmsLogServiceImpl implements SysSmsLogService {
|
||||
smsLog.setId(logId);
|
||||
if (result.getSuccess()) {
|
||||
smsLog.setSendStatus(SmsSendStatusEnum.SUCCESS.getStatus());
|
||||
SysSmsLogDO smsLogDO = logMapper.selectById(logId);
|
||||
result.getResult().forEach(s -> {
|
||||
smsLogDO.setPhones(s.getPhone());
|
||||
smsLogDO.setSendStatus(s.getStatus());
|
||||
smsLogDO.setRemark(s.getMessage());
|
||||
smsLogDO.setCreateTime(s.getCreateTime());
|
||||
logMapper.insert(smsLogDO);
|
||||
});
|
||||
} else {
|
||||
smsLog.setSendStatus(SmsSendStatusEnum.FAIL.getStatus());
|
||||
smsLog.setRemark(result.getMessage() + JsonUtils.toJsonString(result.getResult()));
|
||||
|
||||
Reference in New Issue
Block a user