feat(系统管理): 新增钉钉登陆以及修复脑图新增用例重复问题

This commit is contained in:
guoyuqi 2024-06-05 11:31:05 +08:00 committed by 刘瑞斌
parent 22ba5f9f90
commit 18c713238d
6 changed files with 38 additions and 15 deletions

View File

@ -14,7 +14,7 @@ public class FilterChainUtils {
filterChainDefinitionMap.put("/we_com/info", "anon");
filterChainDefinitionMap.put("/ding_talk/info", "anon");
filterChainDefinitionMap.put("/sso/callback/we_com", "anon");
filterChainDefinitionMap.put("/auth", "anon");
filterChainDefinitionMap.put("/sso/callback/ding_talk", "anon");
filterChainDefinitionMap.put("/setting/get/platform/param", "anon");
filterChainDefinitionMap.put("/signout", "anon");
filterChainDefinitionMap.put("/is-login", "anon");

View File

@ -301,15 +301,7 @@ public class FunctionalCaseMinderService {
Map<String, String> customFieldNameMap = getCustomFieldNameMap(request);
List<FunctionalCaseChangeRequest> addList = resourceMap.get(OperationLogType.ADD.toString());
List<FunctionalCase> updatePosList = new ArrayList<>();
CustomFieldExample customFieldExample = new CustomFieldExample();
customFieldExample.createCriteria().andNameEqualTo("functional_priority").andSceneEqualTo(TemplateScene.FUNCTIONAL.toString()).andInternalEqualTo(true);
List<CustomField> defaultCustomFields = customFieldMapper.selectByExample(customFieldExample);
CustomField customField = defaultCustomFields.get(0);
TemplateDTO defaultTemplateDTO = projectTemplateService.getDefaultTemplateDTO(request.getProjectId(), TemplateScene.FUNCTIONAL.toString());
List<TemplateCustomFieldDTO> customFields = defaultTemplateDTO.getCustomFields();
Map<String, Object> defaultValueMap = customFields.stream().filter(t -> t.getDefaultValue() != null).collect(Collectors.toMap(TemplateCustomFieldDTO::getFieldId, TemplateCustomFieldDTO::getDefaultValue));
defaultValueMap.putIfAbsent(customField.getId(), "P0");
Map<String, Object> defaultValueMap = getDefaultValueMap(request);
if (CollectionUtils.isNotEmpty(addList)) {
Map<String, List<FunctionalCase>> moduleCaseMap = getModuleCaseMap(addList);
for (FunctionalCaseChangeRequest functionalCaseChangeRequest : addList) {
@ -399,6 +391,24 @@ public class FunctionalCaseMinderService {
commonNoticeSendService.sendNotice(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK, NoticeConstants.Event.UPDATE, resources, user, request.getProjectId());
}
@NotNull
private Map<String, Object> getDefaultValueMap(FunctionalCaseMinderEditRequest request) {
TemplateDTO defaultTemplateDTO = projectTemplateService.getDefaultTemplateDTO(request.getProjectId(), TemplateScene.FUNCTIONAL.toString());
List<TemplateCustomFieldDTO> customFields = defaultTemplateDTO.getCustomFields();
Map<String, Object> defaultValueMap = new HashMap<>();
for (TemplateCustomFieldDTO field : customFields) {
if (StringUtils.equalsIgnoreCase(field.getFieldName(), "functional_priority")) {
if (field.getDefaultValue() == null) {
field.setDefaultValue("P0");
}
}
if (field.getDefaultValue() != null) {
defaultValueMap.put(field.getFieldId(), field.getDefaultValue());
}
}
return defaultValueMap;
}
private void dealAdditionalNode(FunctionalCaseMinderEditRequest request, String userId, MindAdditionalNodeMapper additionalNodeMapper, Map<String, String> newModuleMap) {
if (CollectionUtils.isNotEmpty(request.getAdditionalNodeList())) {
List<MindAdditionalNode> updatePosList = new ArrayList<>();

View File

@ -30,4 +30,4 @@ export const GetWeComInfoUrl = '/we_com/info'; // 获取企业微信登陆的配
export const GetWeComCallbackUrl = '/sso/callback/we_com'; // 获取企业微信登陆的回调信息
export const GetPlatformParamUrl = '/setting/get/platform/param';
export const GeDingInfoUrl = '/ding_talk/info'; // 获取企业微信登陆的配置信息
export const GetDingCallbackUrl = '/auth'; // 获取企业微信登陆的回调信息
export const GetDingCallbackUrl = '/sso/callback/ding_talk'; // 获取企业微信登陆的回调信息

View File

@ -23,7 +23,7 @@ export interface WecomInfo {
// 企业微信对接信息
export interface DingInfo {
agentId?: string;
appKey?: string;
state?: string;
callBack?: string;
}

View File

@ -37,7 +37,7 @@
},
{
redirect_uri: url,
client_id: data.agentId ? data.agentId : '',
client_id: data.appKey ? data.appKey : '',
scope: 'openid',
response_type: 'code',
state: 'fit2cloud-ding-qr',
@ -45,6 +45,8 @@
},
async (loginResult) => {
const { redirectUrl, authCode, state } = loginResult;
console.log('authCode');
console.log(authCode);
const dingCallback = getDingCallback(authCode);
userStore.qrCodeLogin(await dingCallback);
Message.success(t('login.form.login.success'));

View File

@ -1,7 +1,7 @@
<template>
<a-radio-group v-model:active-key="activeName" type="button" class="tabPlatform" @change="handleClick">
<a-radio value="wecom">{{ t('project.messageManagement.WE_COM') }}</a-radio>
<a-radio value="dingtalk">{{ t('project.messageManagement.DING_TALK') }}</a-radio>
<a-radio value="wecom" class="radioOneButton">{{ t('project.messageManagement.WE_COM') }}</a-radio>
<a-radio value="dingtalk" class="radioOneButton">{{ t('project.messageManagement.DING_TALK') }}</a-radio>
<!-- <a-tab-pane key="lark" :title="t('project.messageManagement.LARK')"></a-tab-pane>
<a-tab-pane key="larksuite" :title="t('project.messageManagement.LARK_SUITE')"></a-tab-pane>-->
</a-radio-group>
@ -59,6 +59,8 @@
function handleClick(val: string | number | boolean) {
if (typeof val === 'string') {
activeName.value = val;
} else {
activeName.value = 'wecom';
}
}
onMounted(() => {
@ -103,4 +105,13 @@
}
}
}
.radioOneButton {
width: 200px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
font-size: 16px;
justify-content: center;
}
</style>