feat:(1.3.0-beta1.1): 修复通知配置更新未清空数据

This commit is contained in:
opensnail 2025-01-12 11:11:05 +08:00
parent 5ba5467e4c
commit e936ace0b3
5 changed files with 5 additions and 7 deletions

View File

@ -3,9 +3,7 @@ package com.aizuda.snailjob.template.datasource.persistence.po;
import com.aizuda.snailjob.common.core.enums.ExecutorTypeEnum; import com.aizuda.snailjob.common.core.enums.ExecutorTypeEnum;
import com.aizuda.snailjob.common.core.enums.JobTaskTypeEnum; import com.aizuda.snailjob.common.core.enums.JobTaskTypeEnum;
import com.aizuda.snailjob.common.core.enums.StatusEnum; import com.aizuda.snailjob.common.core.enums.StatusEnum;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
/** /**
@ -150,6 +148,7 @@ public class Job extends CreateUpdateDt {
/** /**
* 负责人id * 负责人id
*/ */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Long ownerId; private Long ownerId;
} }

View File

@ -46,7 +46,7 @@ public interface JobConverter {
static String toNotifyIdsStr(Set<Long> notifyIds) { static String toNotifyIdsStr(Set<Long> notifyIds) {
if (CollUtil.isEmpty(notifyIds)) { if (CollUtil.isEmpty(notifyIds)) {
return null; return StrUtil.EMPTY;
} }
return JsonUtil.toJsonString(notifyIds); return JsonUtil.toJsonString(notifyIds);

View File

@ -45,7 +45,7 @@ public interface SceneConfigConverter {
static String toNotifyIdsStr(Set<Long> notifyIds) { static String toNotifyIdsStr(Set<Long> notifyIds) {
if (CollUtil.isEmpty(notifyIds)) { if (CollUtil.isEmpty(notifyIds)) {
return null; return StrUtil.EMPTY;
} }
return JsonUtil.toJsonString(notifyIds); return JsonUtil.toJsonString(notifyIds);

View File

@ -120,7 +120,7 @@ public interface WorkflowConverter {
static String toNotifyIdsStr(Set<Long> notifyIds) { static String toNotifyIdsStr(Set<Long> notifyIds) {
if (CollUtil.isEmpty(notifyIds)) { if (CollUtil.isEmpty(notifyIds)) {
return null; return StrUtil.EMPTY;
} }
return JsonUtil.toJsonString(notifyIds); return JsonUtil.toJsonString(notifyIds);

View File

@ -153,7 +153,6 @@ public class SceneConfigServiceImpl implements SceneConfigService {
retrySceneConfig.setTriggerInterval( retrySceneConfig.setTriggerInterval(
Optional.ofNullable(retrySceneConfig.getTriggerInterval()).orElse(StrUtil.EMPTY)); Optional.ofNullable(retrySceneConfig.getTriggerInterval()).orElse(StrUtil.EMPTY));
retrySceneConfig.setNotifyIds(JsonUtil.toJsonString(Optional.ofNullable(requestVO.getNotifyIds()).orElse(Sets.newHashSet())));
Assert.isTrue(1 == accessTemplate.getSceneConfigAccess().update(retrySceneConfig, Assert.isTrue(1 == accessTemplate.getSceneConfigAccess().update(retrySceneConfig,
new LambdaUpdateWrapper<RetrySceneConfig>() new LambdaUpdateWrapper<RetrySceneConfig>()
.eq(RetrySceneConfig::getNamespaceId, namespaceId) .eq(RetrySceneConfig::getNamespaceId, namespaceId)