fix-[#676] Set notifyUserIds to null when empty the notify info of a job.

This commit is contained in:
archieself 2023-07-05 10:49:37 +08:00
parent 00228f3b3e
commit 8aaa602082

View File

@ -89,8 +89,12 @@ public class JobServiceImpl implements JobService {
fillDefaultValue(jobInfoDO); fillDefaultValue(jobInfoDO);
// 转化报警用户列表 // 转化报警用户列表
if (!CollectionUtils.isEmpty(request.getNotifyUserIds())) { if (request.getNotifyUserIds() != null) {
jobInfoDO.setNotifyUserIds(SJ.COMMA_JOINER.join(request.getNotifyUserIds())); if (request.getNotifyUserIds().size() == 0) {
jobInfoDO.setNotifyUserIds(null);
} else {
jobInfoDO.setNotifyUserIds(SJ.COMMA_JOINER.join(request.getNotifyUserIds()));
}
} }
LifeCycle lifecycle = Optional.ofNullable(request.getLifeCycle()).orElse(LifeCycle.EMPTY_LIFE_CYCLE); LifeCycle lifecycle = Optional.ofNullable(request.getLifeCycle()).orElse(LifeCycle.EMPTY_LIFE_CYCLE);
jobInfoDO.setLifecycle(JSON.toJSONString(lifecycle)); jobInfoDO.setLifecycle(JSON.toJSONString(lifecycle));