refactor(项目管理): 消息通知优化
This commit is contained in:
parent
4e46afa5e9
commit
446f42062f
|
@ -1114,7 +1114,6 @@ public class FunctionalCaseMinderService {
|
|||
caseIds= caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList();
|
||||
functionalCaseService.handDeleteFunctionalCase(caseIds, false, userId, request.getProjectId());
|
||||
functionalCaseLogService.batchDeleteFunctionalCaseLogByIds(caseIds, "/functional/mind/case/edit");
|
||||
functionalCaseNoticeService.batchSendNotice(request.getProjectId(), caseIds, user, NoticeConstants.Event.DELETE);
|
||||
|
||||
}
|
||||
List<MinderOptionDTO> caseModuleOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.module"));
|
||||
|
@ -1123,7 +1122,10 @@ public class FunctionalCaseMinderService {
|
|||
List<FunctionalCase> functionalCases = functionalCaseModuleService.deleteModuleByIds(moduleIds, new ArrayList<>(), userId);
|
||||
functionalCaseModuleService.batchDelLog(functionalCases, request.getProjectId());
|
||||
List<String> finalCaseIds = caseIds;
|
||||
functionalCaseNoticeService.batchSendNotice(request.getProjectId(), functionalCases.stream().map(FunctionalCase::getId).filter(id ->!finalCaseIds.contains(id)).toList(), user, NoticeConstants.Event.DELETE);
|
||||
List<String> caseIdList = functionalCases.stream().map(FunctionalCase::getId).filter(id -> !finalCaseIds.contains(id)).toList();
|
||||
if (CollectionUtils.isNotEmpty(caseIdList)) {
|
||||
functionalCaseNoticeService.batchSendNotice(request.getProjectId(), caseIdList, user, NoticeConstants.Event.DELETE);
|
||||
}
|
||||
}
|
||||
List<MinderOptionDTO> additionalOptionDTOS = resourceMap.get(ModuleConstants.ROOT_NODE_PARENT_ID);
|
||||
if (CollectionUtils.isNotEmpty(additionalOptionDTOS)) {
|
||||
|
|
|
@ -8,11 +8,11 @@ import com.aliyun.tea.TeaException;
|
|||
import com.aliyun.teaopenapi.models.Config;
|
||||
import com.aliyun.teautil.Common;
|
||||
import com.aliyun.teautil.models.RuntimeOptions;
|
||||
import io.metersphere.sdk.util.LogUtils;
|
||||
import io.metersphere.system.notice.MessageDetail;
|
||||
import io.metersphere.system.notice.NoticeModel;
|
||||
import io.metersphere.system.notice.Receiver;
|
||||
import io.metersphere.system.notice.sender.AbstractNoticeSender;
|
||||
import io.metersphere.sdk.util.LogUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -94,11 +94,11 @@ public class DingEnterPriseNoticeSender extends AbstractNoticeSender {
|
|||
|
||||
@Override
|
||||
public void send(MessageDetail messageDetail, NoticeModel noticeModel) {
|
||||
String context = super.getContext(messageDetail, noticeModel);
|
||||
List<Receiver> receivers = super.getReceivers(noticeModel.getReceivers(), noticeModel.isExcludeSelf(), noticeModel.getOperator());
|
||||
if (CollectionUtils.isEmpty(receivers)) {
|
||||
return;
|
||||
}
|
||||
String context = super.getContext(messageDetail, noticeModel);
|
||||
try {
|
||||
sendDing(messageDetail, context);
|
||||
LogUtils.debug("发送钉钉内部机器人结束");
|
||||
|
|
|
@ -374,7 +374,7 @@ public class TestPlanCollectionMinderService {
|
|||
testPlanCollection.setId(testPlanCollectionMinderEditDTO.getId());
|
||||
testPlanCollection.setCreateUser(userId);
|
||||
testPlanCollection.setCreateTime(null);
|
||||
testPlanCollection.setPos(testPlanCollectionMinderEditDTO.getNum());
|
||||
testPlanCollection.setPos((testPlanCollectionMinderEditDTO.getNum()+1) * 4096);
|
||||
collectionMapper.updateByPrimaryKeySelective(testPlanCollection);
|
||||
return testPlanCollection;
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ public class TestPlanCollectionMinderService {
|
|||
testPlanCollection.setTestPlanId(request.getPlanId());
|
||||
testPlanCollection.setCreateUser(userId);
|
||||
testPlanCollection.setCreateTime(System.currentTimeMillis());
|
||||
testPlanCollection.setPos(testPlanCollectionMinderEditDTO.getNum());
|
||||
testPlanCollection.setPos((testPlanCollectionMinderEditDTO.getNum()+1) * 4096);
|
||||
collectionMapper.insert(testPlanCollection);
|
||||
return testPlanCollection;
|
||||
}
|
||||
|
|
|
@ -79,10 +79,7 @@ export function getWeComInfo() {
|
|||
}
|
||||
|
||||
export function getWeComCallback(code: string) {
|
||||
return MSR.get<LoginRes>(
|
||||
{ url: GetWeComCallbackUrl, params: { code } },
|
||||
{ ignoreCancelToken: true, errorMessageMode: 'modal' }
|
||||
);
|
||||
return MSR.get<LoginRes>({ url: GetWeComCallbackUrl, params: { code } });
|
||||
}
|
||||
|
||||
export function getDingInfo() {
|
||||
|
@ -90,10 +87,7 @@ export function getDingInfo() {
|
|||
}
|
||||
|
||||
export function getDingCallback(code: string) {
|
||||
return MSR.get<LoginRes>(
|
||||
{ url: GetDingCallbackUrl, params: { code } },
|
||||
{ ignoreCancelToken: true, errorMessageMode: 'modal' }
|
||||
);
|
||||
return MSR.get<LoginRes>({ url: GetDingCallbackUrl, params: { code } });
|
||||
}
|
||||
export function logout() {
|
||||
return MSR.get<LoginRes>({ url: LogoutUrl });
|
||||
|
|
Loading…
Reference in New Issue