1. 指标列表根据原子指标进行过滤查询
parent
90baf9dcde
commit
c827dbdb53
@ -0,0 +1,24 @@
|
||||
package com.supervision.police.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelIndexAtomicRelationDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "指标id")
|
||||
private String modelIndexId;
|
||||
|
||||
@Schema(description = "指标名称")
|
||||
private String modelIndexName;
|
||||
|
||||
@Schema(description = "原子id")
|
||||
private String atomicIndexId;
|
||||
|
||||
@Schema(description = "原子关系名称")
|
||||
private String atomicIndexName;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.supervision.police.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ModelIndexReqVO {
|
||||
|
||||
@Schema(description = "指标名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "指标简称")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "原子指标名称")
|
||||
private String atomicIndexName;
|
||||
|
||||
@Schema(description = "指标类型")
|
||||
private String indexType;
|
||||
|
||||
@Schema(description = "案件类型")
|
||||
private String caseType;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime updateStartTime;
|
||||
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime updateEndTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.supervision.utils;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.supervision.police.dto.AtomicData;
|
||||
import com.supervision.police.dto.JudgeLogic;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class JudgeLogicUtil {
|
||||
|
||||
public static List<JudgeLogic> parse(String logic) {
|
||||
return JSONUtil.toList(logic, JudgeLogic.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从逻辑中获取原子指标id
|
||||
*
|
||||
* @param judgeLogic 判断逻辑json字符串
|
||||
* @return 原子指标id(不重复)
|
||||
*/
|
||||
public static List<String> pickAtomicIndexIds(String judgeLogic) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
List<JudgeLogic> logic = parse(judgeLogic);
|
||||
for (JudgeLogic judge : logic) {
|
||||
List<AtomicData> atomicData = judge.getAtomicData();
|
||||
for (AtomicData atomic : atomicData) {
|
||||
if (!ids.contains(atomic.getAtomicIndex())) {
|
||||
ids.add(atomic.getAtomicIndex());
|
||||
}
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue