Browse Source

fix: 完善问题赋分

main
wxc 1 year ago
parent
commit
2d13ed97b9
  1. 1
      src/main/java/com/biutag/supervision/config/InterceptorConfig.java
  2. 5
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java
  3. 3
      src/main/java/com/biutag/supervision/pojo/entity/DepartScore.java
  4. 3
      src/main/java/com/biutag/supervision/pojo/entity/PoliceScore.java
  5. 11
      src/main/resources/mapper/ProfileDepartMapper.xml

1
src/main/java/com/biutag/supervision/config/InterceptorConfig.java

@ -34,6 +34,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
.excludePathPatterns("/login")
.excludePathPatterns("/auth/self")
.excludePathPatterns("/file/stream/**", "/templates/**")
.excludePathPatterns("/score/police", "/score/depart")
.excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**"));
registry.addInterceptor(new ApiInterceptor())

5
src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java

@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
@ -44,7 +45,7 @@ public class ScoreController {
List<Object> result = negativeScoreService.calculatePoliceScore(beginTime, endTime, item.getIdCode());
PoliceScore score = new PoliceScore();
score.setIdCode(item.getIdCode());
score.setScore((Double) result.get(0));
score.setScore((BigDecimal) result.get(0));
score.setExpression((String) result.get(1));
score.setBeginTime(beginTime);
score.setEndTime(endTime);
@ -64,7 +65,7 @@ public class ScoreController {
List<Object> result = negativeScoreService.calculateDepartScore(beginTime, endTime, item.getId());
DepartScore score = new DepartScore();
score.setDepartId(item.getId());
score.setScore((Double) result.get(0));
score.setScore((BigDecimal) result.get(0));
score.setExpression((String) result.get(1));
score.setBeginTime(beginTime);
score.setEndTime(endTime);

3
src/main/java/com/biutag/supervision/pojo/entity/DepartScore.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.Date;
@Setter
@ -17,7 +18,7 @@ public class DepartScore {
//
@TableField("score")
private Double score;
private BigDecimal score;
//
@TableField("expression")

3
src/main/java/com/biutag/supervision/pojo/entity/PoliceScore.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.Date;
@Setter
@ -17,7 +18,7 @@ public class PoliceScore {
//
@TableField("score")
private Double score;
private BigDecimal score;
//
@TableField("expression")

11
src/main/resources/mapper/ProfileDepartMapper.xml

@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryDepartNegative" resultType="com.biutag.supervision.pojo.model.DepartNegativeModel">
SELECT
d.*,
count( DISTINCT nb.blameIdCode ) verify_police_size,
count( DISTINCT n.id_code ) verify_police_size,
count( n.id ) verify_size,
dc.score
FROM
@ -17,7 +17,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d1.short_name parent_depart_name,
d.short_name depart_name,
p.police_size,
p.aux_size
FROM
sup_depart d
@ -27,13 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.LEVEL = 3
and d.statistics_group_id = #{departGroupId}
) d
LEFT JOIN negative n ON n.involveDepartId = d.depart_id
AND n.checkStatus IN ( '1', '2' )
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
LEFT JOIN negative_blame nb ON n.id = nb.negativeId
LEFT JOIN negative_score_depart n ON d.depart_id = n.depart_id
left join depart_score dc on d.depart_id = dc.depart_id
WHERE
1 = 1
n.depart_id is not null
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
<if test="departName != null and departName != ''">
AND d.short_name like concat('%', #{departName}, '%')
</if>

Loading…
Cancel
Save