Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
efde34cb80
|
@ -13,6 +13,7 @@ import io.metersphere.notice.controller.request.MessageRequest;
|
||||||
import io.metersphere.notice.domain.MessageDetail;
|
import io.metersphere.notice.domain.MessageDetail;
|
||||||
import io.metersphere.notice.domain.MessageSettingDetail;
|
import io.metersphere.notice.domain.MessageSettingDetail;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@ -70,7 +71,11 @@ public class NoticeService {
|
||||||
|
|
||||||
private void checkUserIdExist(String userId, MessageDetail list,String orgId) {
|
private void checkUserIdExist(String userId, MessageDetail list,String orgId) {
|
||||||
MessageTaskExample example = new MessageTaskExample();
|
MessageTaskExample example = new MessageTaskExample();
|
||||||
|
if (StringUtils.isBlank(list.getTestId())) {
|
||||||
|
example.createCriteria().andUserIdEqualTo(userId).andEventEqualTo(list.getEvent()).andTypeEqualTo(list.getType()).andTaskTypeEqualTo(list.getTaskType()).andWebhookEqualTo(list.getWebhook()).andOrganizationIdEqualTo(orgId);
|
||||||
|
} else {
|
||||||
example.createCriteria().andUserIdEqualTo(userId).andEventEqualTo(list.getEvent()).andTypeEqualTo(list.getType()).andTaskTypeEqualTo(list.getTaskType()).andWebhookEqualTo(list.getWebhook()).andTestIdEqualTo(list.getTestId()).andOrganizationIdEqualTo(orgId);
|
example.createCriteria().andUserIdEqualTo(userId).andEventEqualTo(list.getEvent()).andTypeEqualTo(list.getType()).andTaskTypeEqualTo(list.getTaskType()).andWebhookEqualTo(list.getWebhook()).andTestIdEqualTo(list.getTestId()).andOrganizationIdEqualTo(orgId);
|
||||||
|
}
|
||||||
if (messageTaskMapper.countByExample(example) > 0) {
|
if (messageTaskMapper.countByExample(example) > 0) {
|
||||||
MSException.throwException(Translator.get("message_task_already_exists"));
|
MSException.throwException(Translator.get("message_task_already_exists"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue