fix(测试跟踪): 平台插件同步自定义字段有误

This commit is contained in:
chenjianxing 2022-12-15 13:43:34 +08:00 committed by jianxing
parent a2559b26b5
commit 33fdb9da96
4 changed files with 6 additions and 45 deletions

View File

@ -283,14 +283,6 @@ public class ProjectService {
return project; return project;
} }
public boolean isThirdPartTemplate(Project project) {
if (project.getThirdPartTemplate() != null && project.getThirdPartTemplate() && project.getPlatform().equals(IssuesManagePlatform.Jira.name())) {
return true;
}
return false;
}
public List<Project> getByCaseTemplateId(String templateId) { public List<Project> getByCaseTemplateId(String templateId) {
ProjectExample example = new ProjectExample(); ProjectExample example = new ProjectExample();
example.createCriteria().andCaseTemplateIdEqualTo(templateId); example.createCriteria().andCaseTemplateIdEqualTo(templateId);

View File

@ -126,7 +126,7 @@ public class SystemProjectService {
if (quotaService != null) { if (quotaService != null) {
quotaService.projectUseDefaultQuota(pjId); quotaService.projectUseDefaultQuota(pjId);
} }
// 创建默认版本 // 创建默认版本
addProjectVersion(project); addProjectVersion(project);
// 初始化项目应用管理 // 初始化项目应用管理
@ -339,11 +339,6 @@ public class SystemProjectService {
return project; return project;
} }
public boolean isThirdPartTemplate(Project project) {
return project.getThirdPartTemplate() != null && project.getThirdPartTemplate() && project.getPlatform().equals(IssuesManagePlatform.Jira.name());
}
public List<Project> getByCaseTemplateId(String templateId) { public List<Project> getByCaseTemplateId(String templateId) {
ProjectExample example = new ProjectExample(); ProjectExample example = new ProjectExample();
example.createCriteria().andCaseTemplateIdEqualTo(templateId); example.createCriteria().andCaseTemplateIdEqualTo(templateId);

View File

@ -496,8 +496,6 @@ public class IssuesService {
public List<String> getPlatforms(Project project) { public List<String> getPlatforms(Project project) {
String workspaceId = project.getWorkspaceId(); String workspaceId = project.getWorkspaceId();
boolean tapd = isIntegratedPlatform(workspaceId, IssuesManagePlatform.Tapd.toString()); boolean tapd = isIntegratedPlatform(workspaceId, IssuesManagePlatform.Tapd.toString());
boolean jira = isIntegratedPlatform(workspaceId, IssuesManagePlatform.Jira.toString());
boolean zentao = isIntegratedPlatform(workspaceId, IssuesManagePlatform.Zentao.toString());
boolean azure = isIntegratedPlatform(workspaceId, IssuesManagePlatform.AzureDevops.toString()); boolean azure = isIntegratedPlatform(workspaceId, IssuesManagePlatform.AzureDevops.toString());
List<String> platforms = new ArrayList<>(); List<String> platforms = new ArrayList<>();
@ -510,20 +508,6 @@ public class IssuesService {
} }
if (jira) {
String jiraKey = project.getJiraKey();
if (StringUtils.isNotBlank(jiraKey) && PlatformPluginService.isPluginPlatform(project.getPlatform())) {
platforms.add(IssuesManagePlatform.Jira.name());
}
}
if (zentao) {
String zentaoId = project.getZentaoId();
if (StringUtils.isNotBlank(zentaoId) && StringUtils.equals(project.getPlatform(), IssuesManagePlatform.Zentao.toString())) {
platforms.add(IssuesManagePlatform.Zentao.name());
}
}
if (azure) { if (azure) {
String azureDevopsId = project.getAzureDevopsId(); String azureDevopsId = project.getAzureDevopsId();
if (StringUtils.isNotBlank(azureDevopsId) && StringUtils.equals(project.getPlatform(), IssuesManagePlatform.AzureDevops.toString())) { if (StringUtils.isNotBlank(azureDevopsId) && StringUtils.equals(project.getPlatform(), IssuesManagePlatform.AzureDevops.toString())) {
@ -945,10 +929,10 @@ public class IssuesService {
} }
private String getDefaultCustomField(Project project) { private String getDefaultCustomField(Project project) {
if (!trackProjectService.isThirdPartTemplate(project)) { if (isThirdPartTemplate(project)) {
return getDefaultCustomFields(project.getId()); return null;
} }
return null; return getDefaultCustomFields(project.getId());
} }
public void syncPluginThirdPartyIssues(List<IssuesDao> issues, Project project, String defaultCustomFields) { public void syncPluginThirdPartyIssues(List<IssuesDao> issues, Project project, String defaultCustomFields) {
@ -1057,10 +1041,6 @@ public class IssuesService {
} }
private void syncAllPluginIssueAttachment(Project project, IssueSyncRequest syncIssuesResult) { private void syncAllPluginIssueAttachment(Project project, IssueSyncRequest syncIssuesResult) {
// todo 所有平台改造完之后删除
if (!StringUtils.equals(project.getPlatform(), IssuesManagePlatform.Jira.name())) {
return;
}
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
try { try {
AttachmentModuleRelationMapper batchAttachmentModuleRelationMapper = sqlSession.getMapper(AttachmentModuleRelationMapper.class); AttachmentModuleRelationMapper batchAttachmentModuleRelationMapper = sqlSession.getMapper(AttachmentModuleRelationMapper.class);
@ -1510,7 +1490,8 @@ public class IssuesService {
public boolean isThirdPartTemplate(Project project) { public boolean isThirdPartTemplate(Project project) {
return project.getThirdPartTemplate() != null return project.getThirdPartTemplate() != null
&& project.getThirdPartTemplate() && project.getThirdPartTemplate()
&& PlatformPluginService.isPluginPlatform(project.getPlatform()); && PlatformPluginService.isPluginPlatform(project.getPlatform())
&& platformPluginService.isThirdPartTemplateSupport(project.getPlatform());
} }
public void checkThirdProjectExist(Project project) { public void checkThirdProjectExist(Project project) {

View File

@ -26,13 +26,6 @@ public class TrackProjectService {
@Resource @Resource
ProjectMapper projectMapper; ProjectMapper projectMapper;
public boolean isThirdPartTemplate(Project project) {
if (project.getThirdPartTemplate() != null && project.getThirdPartTemplate() && project.getPlatform().equals(IssuesManagePlatform.Jira.name())) {
return true;
}
return false;
}
public boolean useCustomNum(String projectId) { public boolean useCustomNum(String projectId) {
return useCustomNum(baseProjectService.getProjectById(projectId)); return useCustomNum(baseProjectService.getProjectById(projectId));
} }