diff --git a/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java b/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java index ad5cac5..4985fc5 100644 --- a/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java +++ b/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java @@ -129,7 +129,7 @@ public class QualityInspectController { */ @GetMapping("/problemAnalysis") @ResponseBody - public ResponseResult problemAnalysis(@RequestParam Integer ruleId) { + public ResponseResult problemAnalysis(@RequestParam Integer ruleId) { ProblemAnalysisDTO problemAnalysis = qualityInspectService.getProblemAnalysis(ruleId); return ResponseResult.success(problemAnalysis); } diff --git a/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java b/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java index 16955f3..2a59d75 100644 --- a/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java +++ b/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java @@ -20,6 +20,7 @@ import net.educoder.ecsonar.utils.IdUtils; import net.educoder.ecsonar.utils.SystemUtil; import net.educoder.ecsonar.utils.html.HtmlSourceDecorator; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -318,7 +319,13 @@ public class QualityInspectService { problemAnalysisDTO.setExample(example); problemAnalysisDTO.setLanguage(rule.getLanguage()); problemAnalysisDTO.setConstantIssue(rule.getDefRemediationBaseEffort()); - problemAnalysisDTO.setTags(Arrays.asList(rule.getTags().split(","))); + + if (StringUtils.isBlank(rule.getTags())) { + problemAnalysisDTO.setTags(new ArrayList<>()); + }else{ + problemAnalysisDTO.setTags(Arrays.asList(rule.getTags().split(","))); + } + problemAnalysisDTO.setCreateTime(DateUtil.formatDateTime(new Date(rule.getCreateTime()))); }else{ problemAnalysisDTO.setTitle(""); diff --git a/src/main/resources/mapper/IssuesMapper.xml b/src/main/resources/mapper/IssuesMapper.xml index 8150707..5ae3b15 100644 --- a/src/main/resources/mapper/IssuesMapper.xml +++ b/src/main/resources/mapper/IssuesMapper.xml @@ -11,6 +11,7 @@ inner join rules r on i.rule_id =r.id inner join projects p on p.uuid =i.component_uuid where i.project_uuid = #{projectUuid,jdbcType=VARCHAR} + and i.status='OPEN' and p.root_uuid =#{projectUuid,jdbcType=VARCHAR} and p.uuid !=#{projectUuid,jdbcType=VARCHAR} and p."scope" ='FIL' and i.issue_type=#{issueType,jdbcType=INTEGER} @@ -28,6 +29,7 @@ inner join rules r on i.rule_id =r.id inner join projects p on p.uuid =i.component_uuid where i.project_uuid = #{projectUuid,jdbcType=VARCHAR} + and i.status='OPEN' and p.root_uuid =#{projectUuid,jdbcType=VARCHAR} and p.uuid !=#{projectUuid,jdbcType=VARCHAR} and p."scope" ='FIL' and i.issue_type=#{issueType,jdbcType=INTEGER} @@ -40,11 +42,11 @@