Browse Source

fit: 完善灵敏感知/任务列表

main
wxc 1 year ago
parent
commit
7bc9d29216
  1. 9
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java
  2. 12
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java
  3. 6
      src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java
  4. 5
      src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java
  5. 33
      src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java
  6. 6
      src/main/java/com/biutag/supervision/service/ModelClueTaskService.java
  7. 19
      src/main/resources/mapper/ModelClueTaskMapper.xml

9
src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java

@ -2,14 +2,18 @@ package com.biutag.supervision.controller.sensitivePerception;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel;
import com.biutag.supervision.pojo.model.ModelClueTaskModel;
import com.biutag.supervision.pojo.param.ModelClueTaskQueryParam;
import com.biutag.supervision.service.ModelClueTaskService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author wxc
* @date 2024/10/16
@ -26,4 +30,9 @@ public class ModelClueTaskController {
return Result.success(modelClueTaskService.page(param));
}
@GetMapping("{taskId}/byDepart")
public Result<List<ModelClueTaskDepartModel>> listDepart(@PathVariable Integer taskId) {
return Result.success(modelClueTaskService.listDepart(taskId));
}
}

12
src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java

@ -0,0 +1,12 @@
package com.biutag.supervision.controller.sensitivePerception;
import org.springframework.web.bind.annotation.RestController;
/**
* 单位/个人画像
* @author wxc
* @date 2024/10/31
*/
@RestController("profile/depart")
public class ProfileDepartController {
}

6
src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java

@ -5,12 +5,18 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.entity.ModelClueTask;
import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel;
import com.biutag.supervision.pojo.model.ModelClueTaskModel;
import com.biutag.supervision.pojo.model.NegativeWorkModel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ModelClueTaskMapper extends BaseMapper<ModelClueTask> {
Page<ModelClueTaskModel> queryPage(@Param("page") Page<ModelClueTask> page, @Param(Constants.WRAPPER) QueryWrapper<ModelClueTask> queryWrapper);
List<ModelClueTaskDepartModel> selectGroupByDepart(@Param("taskId") Integer taskId);
}

5
src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java

@ -82,4 +82,9 @@ public class SupDictProblemType {
@TableField("upd_host")
private String updHost;
private Double score;
// 是否开启严重等级
private Boolean isActiveLevel;
}

33
src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java

@ -0,0 +1,33 @@
package com.biutag.supervision.pojo.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
/**
* @author wxc
* @date 2024/10/17
*/
@Setter
@Getter
public class ModelClueTaskDepartModel {
private String departId;
// 模型名称
private String departName;
// 条数
private Integer size;
private Integer completedSize;
private Double completedRate;
private Integer verifySize;
private Integer personalSize;
}

6
src/main/java/com/biutag/supervision/service/ModelClueTaskService.java

@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.mapper.ModelClueTaskMapper;
import com.biutag.supervision.pojo.entity.ModelClueTask;
import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel;
import com.biutag.supervision.pojo.model.ModelClueTaskModel;
import com.biutag.supervision.pojo.param.ModelClueTaskQueryParam;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@RequiredArgsConstructor
@ -32,4 +34,8 @@ public class ModelClueTaskService extends ServiceImpl<ModelClueTaskMapper, Model
return page;
}
public List<ModelClueTaskDepartModel> listDepart(Integer taskId) {
return baseMapper.selectGroupByDepart(taskId);
}
}

19
src/main/resources/mapper/ModelClueTaskMapper.xml

@ -25,5 +25,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${ew.getCustomSqlSegment}
</select>
<select id="selectGroupByDepart" resultType="com.biutag.supervision.pojo.model.ModelClueTaskDepartModel">
SELECT
n.involveDepartId,
n.involveDepartName depart_name,
count( n.id ) size,
sum( CASE WHEN n.processing_status = 'completed' THEN 1 ELSE 0 END ) completed_size,
sum( CASE WHEN n.processing_status = 'completed' THEN 1 ELSE 0 END ) / count( n.id ) * 100 completed_rate,
sum( CASE WHEN n.checkStatus IN ( '1', '2' ) THEN 1 ELSE 0 END ) verify_size,
count( DISTINCT nb.blameIdCode ) personal_size
FROM
model_clue mc
LEFT JOIN negative n ON mc.negative_id = n.id
LEFT JOIN negative_blame nb ON n.id = nb.negativeId
AND type = 'personal'
WHERE
mc.task_id = #{taskId}
GROUP BY
n.involveDepartId
</select>
</mapper>
Loading…
Cancel
Save