From e897ad5a83bff04c2551a899f00509d507006bed Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Tue, 3 Feb 2026 14:23:18 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8C=87=E6=A0=87=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cmvr-iot-admin/pom.xml | 10 +
.../evaluate/IndicatorController.java | 52 +++++
.../src/main/resources/application-dev.yml | 2 +-
cmvr-iot-evaluate/pom.xml | 29 +++
.../cmvr/evaluate/dto/IndicatorCreateDTO.java | 57 +++++
.../cmvr/evaluate/dto/IndicatorUpdateDTO.java | 57 +++++
.../cmvr/evaluate/entity/IndicatorEntity.java | 55 +++++
.../cmvr/evaluate/mapper/IndicatorMapper.java | 13 ++
.../evaluate/service/IndicatorService.java | 19 ++
.../service/impl/IndicatorServiceImpl.java | 196 ++++++++++++++++++
.../com/cmvr/evaluate/vo/IndicatorVO.java | 55 +++++
.../src/test/java/com/cmvr/AppTest.java | 38 ++++
cmvr-iot-vi/pom.xml | 9 +
pom.xml | 8 +-
14 files changed, 598 insertions(+), 2 deletions(-)
create mode 100644 cmvr-iot-admin/src/main/java/com/cmvr/web/controller/evaluate/IndicatorController.java
create mode 100644 cmvr-iot-evaluate/pom.xml
create mode 100644 cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorCreateDTO.java
create mode 100644 cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorUpdateDTO.java
create mode 100644 cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/entity/IndicatorEntity.java
create mode 100644 cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/mapper/IndicatorMapper.java
create mode 100644 cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/IndicatorService.java
create mode 100644 cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/impl/IndicatorServiceImpl.java
create mode 100644 cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/vo/IndicatorVO.java
create mode 100644 cmvr-iot-evaluate/src/test/java/com/cmvr/AppTest.java
diff --git a/cmvr-iot-admin/pom.xml b/cmvr-iot-admin/pom.xml
index 3fef277..30054a1 100644
--- a/cmvr-iot-admin/pom.xml
+++ b/cmvr-iot-admin/pom.xml
@@ -72,6 +72,16 @@
cmvr-iot-ti
+
+
+ com.cmvr
+ cmvr-iot-evaluate
+
+
+ org.springframework.boot
+ spring-boot
+
+
dev
diff --git a/cmvr-iot-admin/src/main/java/com/cmvr/web/controller/evaluate/IndicatorController.java b/cmvr-iot-admin/src/main/java/com/cmvr/web/controller/evaluate/IndicatorController.java
new file mode 100644
index 0000000..b385874
--- /dev/null
+++ b/cmvr-iot-admin/src/main/java/com/cmvr/web/controller/evaluate/IndicatorController.java
@@ -0,0 +1,52 @@
+package com.cmvr.web.controller.evaluate;
+
+import com.cmvr.common.core.controller.BaseController;
+import com.cmvr.common.core.domain.AjaxResult;
+import com.cmvr.evaluate.dto.IndicatorCreateDTO;
+import com.cmvr.evaluate.dto.IndicatorUpdateDTO;
+import com.cmvr.evaluate.service.IndicatorService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+@Api(tags = "评价管理--指标库")
+@RestController
+@RequestMapping("/evaluate/indicator")
+@RequiredArgsConstructor
+public class IndicatorController extends BaseController {
+
+ private final IndicatorService indicatorService;
+
+ @ApiOperation("根据父id查询指标")
+ @GetMapping("/getIndicatorByParentId")
+ public AjaxResult getIndicatorByParentId(@RequestParam Long parentId, @RequestParam Integer type) {
+ if (parentId == null || type == null) {
+ return AjaxResult.error("参数不能为空");
+ }
+ return success(indicatorService.selectIndicatorByParentId(parentId, type));
+ }
+
+ @ApiOperation("新增指标")
+ @PostMapping("/indicator/insert")
+ public AjaxResult insertIndicator(@Valid @RequestBody IndicatorCreateDTO createDTO) {
+ return success(indicatorService.saveIndicator(createDTO));
+ }
+
+ @ApiOperation("根据ID级联删除:删除当前指标及其所有后代指标(子/孙级)")
+ @DeleteMapping("/{id}")
+ public AjaxResult removeIndicator(@PathVariable Long id) {
+ if (id == null) {
+ return AjaxResult.error("id不能为空");
+ }
+ return toAjax(indicatorService.removeIndicator(id));
+ }
+
+ @ApiOperation("修改指标")
+ @PutMapping
+ public AjaxResult updateIndicator(@Valid @RequestBody IndicatorUpdateDTO updateDTO) {
+ return toAjax(indicatorService.updateIndicator(updateDTO));
+ }
+}
diff --git a/cmvr-iot-admin/src/main/resources/application-dev.yml b/cmvr-iot-admin/src/main/resources/application-dev.yml
index a76ca4b..77c645d 100644
--- a/cmvr-iot-admin/src/main/resources/application-dev.yml
+++ b/cmvr-iot-admin/src/main/resources/application-dev.yml
@@ -1,6 +1,6 @@
server:
# 服务器的HTTP端口,默认为8080
- port: 13080
+ port: 13081
# 数据源配置
spring:
datasource:
diff --git a/cmvr-iot-evaluate/pom.xml b/cmvr-iot-evaluate/pom.xml
new file mode 100644
index 0000000..8d68de9
--- /dev/null
+++ b/cmvr-iot-evaluate/pom.xml
@@ -0,0 +1,29 @@
+
+ 4.0.0
+
+ com.cmvr
+ cmvr-iot
+ 3.8.9
+
+
+ cmvr-iot-evaluate
+
+
+ 评价管理模块
+
+
+
+
+
+ com.cmvr
+ cmvr-iot-common
+
+
+
+
+ com.cmvr
+ cmvr-iot-test
+
+
+
diff --git a/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorCreateDTO.java b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorCreateDTO.java
new file mode 100644
index 0000000..acae2ee
--- /dev/null
+++ b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorCreateDTO.java
@@ -0,0 +1,57 @@
+package com.cmvr.evaluate.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+@Data
+@ApiModel("新增指标DTO")
+public class IndicatorCreateDTO {
+
+ @ApiModelProperty(value = "父级指标ID,一级指标为0", required = true)
+ @NotNull(message = "父级指标ID不能为空")
+ private Long parentId;
+
+ @ApiModelProperty(value = "指标层级 1-一级 2-二级 3-三级", required = true)
+ @NotNull(message = "指标层级不能为空")
+ private Integer level;
+
+ @ApiModelProperty(value = "指标名称", required = true)
+ @NotBlank(message = "指标名称不能为空")
+ private String name;
+
+ @ApiModelProperty("比较数值1")
+ @DecimalMin(value = "0.0", inclusive = true, message = "比较数值1不能小于0")
+ @Digits(integer = 10, fraction = 2, message = "比较数值1整数位最多10位,小数位最多2位")
+ private BigDecimal compareNum1;
+
+ @ApiModelProperty("比较符号(=、>、<、>=、<=等)")
+ private String symbol;
+
+ @ApiModelProperty("比较数值2")
+ @DecimalMin(value = "0.0", inclusive = true, message = "比较数值2不能小于0")
+ @Digits(integer = 10, fraction = 2, message = "比较数值2整数位最多10位,小数位最多2位")
+ private BigDecimal compareNum2;
+
+ @ApiModelProperty("指标分数/满分")
+ private BigDecimal score;
+
+ @ApiModelProperty("指标权重")
+ private BigDecimal weight;
+
+ @ApiModelProperty("备注")
+ private String remark;
+
+ @ApiModelProperty("同层级排序")
+ private Integer sort;
+
+ @ApiModelProperty(value = "类型 0-语音 1-触控", required = true)
+ @NotNull(message = "类型不能为空")
+ private Integer type;
+}
\ No newline at end of file
diff --git a/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorUpdateDTO.java b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorUpdateDTO.java
new file mode 100644
index 0000000..4e1bea7
--- /dev/null
+++ b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/dto/IndicatorUpdateDTO.java
@@ -0,0 +1,57 @@
+package com.cmvr.evaluate.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+@Data
+@ApiModel("修改指标DTO")
+public class IndicatorUpdateDTO {
+ @ApiModelProperty(value = "指标主键ID", required = true)
+ @NotNull(message = "指标ID不能为空")
+ private Long id;
+
+ @ApiModelProperty(value = "父级指标ID,一级指标为0", required = true)
+ private Long parentId;
+
+ @ApiModelProperty(value = "指标层级 1-一级 2-二级 3-三级", required = true)
+ private Integer level;
+
+ @ApiModelProperty(value = "指标名称", required = true)
+ @NotBlank(message = "指标名称不能为空")
+ private String name;
+
+ @ApiModelProperty("比较数值1")
+ @DecimalMin(value = "0.0", inclusive = true, message = "比较数值1不能小于0")
+ @Digits(integer = 10, fraction = 2, message = "比较数值1整数位最多10位,小数位最多2位")
+ private BigDecimal compareNum1;
+
+ @ApiModelProperty("比较符号(=、>、<、>=、<=等)")
+ private String symbol;
+
+ @ApiModelProperty("比较数值2")
+ @DecimalMin(value = "0.0", inclusive = true, message = "比较数值2不能小于0")
+ @Digits(integer = 10, fraction = 2, message = "比较数值2整数位最多10位,小数位最多2位")
+ private BigDecimal compareNum2;
+
+ @ApiModelProperty("指标分数/满分")
+ private BigDecimal score;
+
+ @ApiModelProperty("指标权重")
+ private BigDecimal weight;
+
+ @ApiModelProperty("备注")
+ private String remark;
+
+ @ApiModelProperty("同层级排序")
+ private Integer sort;
+
+ @ApiModelProperty(value = "类型 0-语音 1-触控", required = true)
+ private Integer type;
+}
diff --git a/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/entity/IndicatorEntity.java b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/entity/IndicatorEntity.java
new file mode 100644
index 0000000..9ab7fd5
--- /dev/null
+++ b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/entity/IndicatorEntity.java
@@ -0,0 +1,55 @@
+package com.cmvr.evaluate.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.cmvr.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("evaluate_indicator")
+@ApiModel("评价管理--指标库")
+public class IndicatorEntity extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty("指标主键ID")
+ @TableId(type = IdType.AUTO)
+ private Long id;
+
+ @ApiModelProperty("父级指标ID,一级指标为0")
+ private Long parentId;
+
+ @ApiModelProperty("指标层级 1-一级 2-二级 3-三级")
+ private Integer level;
+
+ @ApiModelProperty("指标名称")
+ private String name;
+
+ @ApiModelProperty("比较数值1")
+ private BigDecimal compareNum1;
+
+ @ApiModelProperty("比较符号(=、>、<、>=、<=等)")
+ private String symbol;
+
+ @ApiModelProperty("比较数值2")
+ private BigDecimal compareNum2;
+
+ @ApiModelProperty("指标分数")
+ private BigDecimal score;
+
+ @ApiModelProperty("指标权重")
+ private BigDecimal weight;
+
+ @ApiModelProperty("同层级排序")
+ private Integer sort;
+
+ @ApiModelProperty("类型 0-语音 1-触控")
+ private Integer type;
+}
diff --git a/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/mapper/IndicatorMapper.java b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/mapper/IndicatorMapper.java
new file mode 100644
index 0000000..fc335f0
--- /dev/null
+++ b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/mapper/IndicatorMapper.java
@@ -0,0 +1,13 @@
+package com.cmvr.evaluate.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cmvr.evaluate.entity.IndicatorEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface IndicatorMapper extends BaseMapper {
+
+}
diff --git a/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/IndicatorService.java b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/IndicatorService.java
new file mode 100644
index 0000000..564609b
--- /dev/null
+++ b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/IndicatorService.java
@@ -0,0 +1,19 @@
+package com.cmvr.evaluate.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cmvr.evaluate.dto.IndicatorCreateDTO;
+import com.cmvr.evaluate.dto.IndicatorUpdateDTO;
+import com.cmvr.evaluate.entity.IndicatorEntity;
+
+import java.util.List;
+
+public interface IndicatorService extends IService {
+
+ boolean saveIndicator(IndicatorCreateDTO dto);
+
+ List selectIndicatorByParentId(Long parentId, Integer type);
+
+ boolean removeIndicator(Long id);
+
+ boolean updateIndicator(IndicatorUpdateDTO dto);
+}
diff --git a/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/impl/IndicatorServiceImpl.java b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/impl/IndicatorServiceImpl.java
new file mode 100644
index 0000000..539b1d9
--- /dev/null
+++ b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/service/impl/IndicatorServiceImpl.java
@@ -0,0 +1,196 @@
+package com.cmvr.evaluate.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cmvr.evaluate.dto.IndicatorCreateDTO;
+import com.cmvr.evaluate.dto.IndicatorUpdateDTO;
+import com.cmvr.evaluate.entity.IndicatorEntity;
+import com.cmvr.evaluate.mapper.IndicatorMapper;
+import com.cmvr.evaluate.service.IndicatorService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.Assert;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Service
+public class IndicatorServiceImpl extends ServiceImpl implements IndicatorService {
+
+ @Override
+ public boolean saveIndicator(IndicatorCreateDTO createDTO) {
+ // 1. DTO 转 Entity
+ IndicatorEntity entity = CreateDTOConvertToEntity(createDTO);
+ // 3. 调用MyBatis-Plus父类方法完成新增,返回执行结果
+ boolean saveResult = this.save(entity);
+ // 4. 日志记录:新增结果(成功/失败)
+ if (saveResult) {
+ log.info("评价管理---指标库---新增指标成功,指标名称:{},层级:{}", entity.getName(), entity.getLevel());
+ } else {
+ log.error("评价管理---指标库---新增指标失败,指标名称:{},层级:{}", entity.getName(), entity.getLevel());
+ }
+ return saveResult;
+ }
+
+
+ @Override
+ public List selectIndicatorByParentId(Long parentId, Integer type) {
+ log.info("评价管理---指标库---开始按父id查询指标,查询父id:{}", parentId == null ? "所有数据" : parentId);
+
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(parentId != null, IndicatorEntity::getParentId, parentId)
+ .eq(type != null, IndicatorEntity::getType, type)
+ .orderByAsc(IndicatorEntity::getSort);
+ List list = this.list(queryWrapper);
+ // 3. 日志记录:查询结果
+ log.info("评价管理---指标库---按父id查询指标完成,查询id:{},返回数量:{}",
+ parentId == null ? "所有数据" : parentId, list.size());
+ return list;
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class) // 事务控制:所有异常都回滚,保证原子性
+ public boolean removeIndicator(Long id) {
+ // 1. 参数校验:ID不能为空
+ Assert.notNull(id, "级联删除指标失败:待删除指标ID不能为空");
+ log.info("开始级联删除指标,主指标ID:{}", id);
+ // 2. 递归查询所有后代指标ID(子/孙级,无论多少级)
+ List allDeleteIds = new ArrayList<>();
+ findAllChildrenIds(id, allDeleteIds); // 收集所有后代ID
+ // 3. 合并删除ID:添加当前指标ID(删自身+后代)
+ allDeleteIds.add(id);
+ log.info("级联删除准备完成,主指标ID:{},需删除后代数量:{},总删除数量:{}",
+ id, allDeleteIds.size() - 1, allDeleteIds.size());
+
+ // 4. 批量删除:一次执行,效率高(适配逻辑删除/物理删除,MP自动处理)
+ if (CollectionUtils.isEmpty(allDeleteIds)) {
+ log.warn("级联删除指标无数据可删,主指标ID:{}", id);
+ return false;
+ }
+ boolean deleteResult = this.removeByIds(allDeleteIds);
+
+ // 5. 日志记录删除结果
+ if (deleteResult) {
+ log.info("级联删除指标成功,主指标ID:{},成功删除数量:{}", id, allDeleteIds.size());
+ } else {
+ log.error("级联删除指标失败,主指标ID:{},待删除ID集合:{}", id, allDeleteIds);
+ }
+ return deleteResult;
+ }
+
+ @Override
+ public boolean updateIndicator(IndicatorUpdateDTO dto) {
+ // 1. 验证数据是否存在
+ IndicatorEntity existEntity = this.getById(dto.getId());
+ if (existEntity == null) {
+ log.error("评价管理---指标库---修改指标失败,指标ID {} 不存在", dto.getId());
+ return false;
+ }
+ IndicatorEntity entity = updateDTOConvertToEntity(dto);
+ System.out.println("entity = " + entity);
+ boolean saveResult = this.updateById(entity);
+ // 4. 日志记录:新增结果(成功/失败)
+ if (saveResult) {
+ log.info("评价管理---指标库---修改指标成功,指标名称:{}", entity.getName());
+ } else {
+ log.error("评价管理---指标库---修改指标失败,指标名称:{}", entity.getName());
+ }
+ return saveResult;
+ }
+
+ /**
+ * 私有工具方法:递归查询指定ID的所有后代指标ID(子→孙→重孙,无限级)
+ * @param parentId 父/祖指标ID
+ * @param childrenIds 用于收集所有后代ID的集合(引用传递)
+ */
+ private void findAllChildrenIds(Long parentId, List childrenIds) {
+ // ① 查询当前parentId的直接子指标ID
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper()
+ .select(IndicatorEntity::getId) // 仅查ID字段,减少数据传输
+ .eq(IndicatorEntity::getParentId, parentId);
+
+ // 核心修正:使用MP双参数listObjs,直接Object转Long,无多余参数
+ List directChildIds = this.listObjs(
+ queryWrapper,
+ // 转换器:将查询到的Object类型ID,直接强转为Long(数据库ID为数值型,安全转换)
+ obj -> Long.parseLong(obj.toString())
+ );
+
+ // ② 无直接子节点,递归终止
+ if (CollectionUtils.isEmpty(directChildIds)) {
+ return;
+ }
+
+ // ③ 将直接子ID加入集合,再递归查询每个子ID的后代ID
+ childrenIds.addAll(directChildIds);
+ for (Long childId : directChildIds) {
+ findAllChildrenIds(childId, childrenIds); // 递归:查子节点的子节点
+ }
+ }
+
+ private IndicatorEntity CreateDTOConvertToEntity(IndicatorCreateDTO dto) {
+ if (dto == null) {
+ return null;
+ }
+
+ IndicatorEntity entity = new IndicatorEntity();
+ entity.setParentId(dto.getParentId());
+ entity.setLevel(dto.getLevel());
+ entity.setName(dto.getName());
+ entity.setCompareNum1(dto.getCompareNum1());
+ entity.setSymbol(dto.getSymbol());
+ entity.setCompareNum2(dto.getCompareNum2());
+ entity.setScore(dto.getScore());
+ entity.setWeight(dto.getWeight());
+ entity.setRemark(dto.getRemark());
+ entity.setSort(dto.getSort());
+ entity.setType(dto.getType());
+
+ return entity;
+ }
+
+ private IndicatorEntity updateDTOConvertToEntity(IndicatorUpdateDTO dto) {
+ if (dto == null) {
+ return null;
+ }
+
+ IndicatorEntity entity = new IndicatorEntity();
+ entity.setId(dto.getId()); // 重要:必须设置ID
+ entity.setParentId(dto.getParentId());
+ entity.setName(dto.getName());
+
+ // 只更新必要的字段,不要清空其他字段
+ if (dto.getLevel() != null) {
+ entity.setLevel(dto.getLevel());
+ }
+ if (dto.getCompareNum1() != null) {
+ entity.setCompareNum1(dto.getCompareNum1());
+ }
+ if (dto.getSymbol() != null) {
+ entity.setSymbol(dto.getSymbol());
+ }
+ if (dto.getCompareNum2() != null) {
+ entity.setCompareNum2(dto.getCompareNum2());
+ }
+ if (dto.getScore() != null) {
+ entity.setScore(dto.getScore());
+ }
+ if (dto.getWeight() != null) {
+ entity.setWeight(dto.getWeight());
+ }
+ if (dto.getRemark() != null) {
+ entity.setRemark(dto.getRemark());
+ }
+ if (dto.getSort() != null) {
+ entity.setSort(dto.getSort());
+ }
+ if (dto.getType() != null) {
+ entity.setType(dto.getType());
+ }
+
+ return entity;
+ }
+}
diff --git a/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/vo/IndicatorVO.java b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/vo/IndicatorVO.java
new file mode 100644
index 0000000..170f27a
--- /dev/null
+++ b/cmvr-iot-evaluate/src/main/java/com/cmvr/evaluate/vo/IndicatorVO.java
@@ -0,0 +1,55 @@
+package com.cmvr.evaluate.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@ApiModel("指标库VO")
+public class IndicatorVO {
+
+ @ApiModelProperty("指标库-指标主键ID")
+ private Long id;
+
+ @ApiModelProperty("父级指标ID,一级指标为0")
+ private Long parentId;
+
+ @ApiModelProperty("指标层级 1-一级 2-二级 3-三级")
+ private Integer level;
+
+ @ApiModelProperty("指标名称")
+ private String name;
+
+ @ApiModelProperty("比较数值1")
+ private BigDecimal compareNum1;
+
+ @ApiModelProperty("比较符号(=、>、<、>=、<=等)")
+ private String symbol;
+
+ @ApiModelProperty("比较数值2")
+ private BigDecimal compareNum2;
+
+ @ApiModelProperty("指标分数/满分")
+ private BigDecimal score;
+
+ @ApiModelProperty("指标权重")
+ private BigDecimal weight;
+
+ @ApiModelProperty("备注")
+ private String remark;
+
+ @ApiModelProperty("同层级排序")
+ private Integer sort;
+
+ @ApiModelProperty("创建时间")
+ private Date createTime;
+
+ @ApiModelProperty("创建人")
+ private String createBy;
+
+ @ApiModelProperty("类型 0-语音 1-触控")
+ private Integer type;
+}
diff --git a/cmvr-iot-evaluate/src/test/java/com/cmvr/AppTest.java b/cmvr-iot-evaluate/src/test/java/com/cmvr/AppTest.java
new file mode 100644
index 0000000..4963177
--- /dev/null
+++ b/cmvr-iot-evaluate/src/test/java/com/cmvr/AppTest.java
@@ -0,0 +1,38 @@
+package com.cmvr;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/cmvr-iot-vi/pom.xml b/cmvr-iot-vi/pom.xml
index 7fe819c..413b7ee 100644
--- a/cmvr-iot-vi/pom.xml
+++ b/cmvr-iot-vi/pom.xml
@@ -28,6 +28,15 @@
com.cmvr
cmvr-iot-test
+
+ org.projectlombok
+ lombok
+ provided
+
+
+ com.cmvr
+ cmvr-iot-common
+
diff --git a/pom.xml b/pom.xml
index dc11d30..c818a8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -274,6 +274,13 @@
${cmvr-iot.version}
+
+
+ com.cmvr
+ cmvr-iot-evaluate
+ ${cmvr-iot.version}
+
+
com.cmvr
@@ -337,7 +344,6 @@
cmvr-iot-api
cmvr-iot-vi
cmvr-iot-ti
- cmvr-iot-evaluation
pom