优化短信日志相关逻辑

This commit is contained in:
zengzefeng
2021-02-24 14:59:28 +08:00
parent b4be8e987a
commit 2a4d9f43eb
6 changed files with 27 additions and 5 deletions

View File

@@ -22,8 +22,11 @@ public enum SmsSendStatusEnum {
//失败
FAIL(3),
//等待回执
WAITING(4),
//成功
SUCCESS(4);
SUCCESS(5);
private final int status;

View File

@@ -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()));