feat: 处理代码冲突
This commit is contained in:
parent
e897ad5a83
commit
e3e5626e20
@ -71,17 +71,6 @@
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-ti</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 触控交互-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-evaluate</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<properties>
|
||||
<env>dev</env>
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
package com.cmvr.web.controller.evaluate;
|
||||
package com.cmvr.web.controller.evaluation;
|
||||
|
||||
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 com.cmvr.evaluation.model.domain.dto.AeIndicatorCreateDTO;
|
||||
import com.cmvr.evaluation.model.domain.dto.AeIndicatorUpdateDTO;
|
||||
import com.cmvr.evaluation.service.AeIndicatorService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -16,9 +17,9 @@ import javax.validation.Valid;
|
||||
@RestController
|
||||
@RequestMapping("/evaluate/indicator")
|
||||
@RequiredArgsConstructor
|
||||
public class IndicatorController extends BaseController {
|
||||
public class AeIndicatorController extends BaseController {
|
||||
|
||||
private final IndicatorService indicatorService;
|
||||
private final AeIndicatorService indicatorService;
|
||||
|
||||
@ApiOperation("根据父id查询指标")
|
||||
@GetMapping("/getIndicatorByParentId")
|
||||
@ -31,7 +32,7 @@ public class IndicatorController extends BaseController {
|
||||
|
||||
@ApiOperation("新增指标")
|
||||
@PostMapping("/indicator/insert")
|
||||
public AjaxResult insertIndicator(@Valid @RequestBody IndicatorCreateDTO createDTO) {
|
||||
public AjaxResult insertIndicator(@Valid @RequestBody AeIndicatorCreateDTO createDTO) {
|
||||
return success(indicatorService.saveIndicator(createDTO));
|
||||
}
|
||||
|
||||
@ -46,7 +47,7 @@ public class IndicatorController extends BaseController {
|
||||
|
||||
@ApiOperation("修改指标")
|
||||
@PutMapping
|
||||
public AjaxResult updateIndicator(@Valid @RequestBody IndicatorUpdateDTO updateDTO) {
|
||||
public AjaxResult updateIndicator(@Valid @RequestBody AeIndicatorUpdateDTO updateDTO) {
|
||||
return toAjax(indicatorService.updateIndicator(updateDTO));
|
||||
}
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot</artifactId>
|
||||
<version>3.8.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cmvr-iot-evaluate</artifactId>
|
||||
|
||||
<description>
|
||||
评价管理模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 测试流程-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-test</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@ -1,13 +0,0 @@
|
||||
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<IndicatorEntity> {
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
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<IndicatorEntity> {
|
||||
|
||||
boolean saveIndicator(IndicatorCreateDTO dto);
|
||||
|
||||
List<IndicatorEntity> selectIndicatorByParentId(Long parentId, Integer type);
|
||||
|
||||
boolean removeIndicator(Long id);
|
||||
|
||||
boolean updateIndicator(IndicatorUpdateDTO dto);
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
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 );
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.cmvr.evaluation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.evaluation.model.domain.AeIndicatorEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AeIndicatorMapper extends BaseMapper<AeIndicatorEntity> {
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.cmvr.evaluate.entity;
|
||||
package com.cmvr.evaluation.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -9,14 +9,13 @@ 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 {
|
||||
public class AeIndicatorEntity extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("指标主键ID")
|
||||
@ -1,4 +1,4 @@
|
||||
package com.cmvr.evaluate.dto;
|
||||
package com.cmvr.evaluation.model.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -12,7 +12,7 @@ import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel("新增指标DTO")
|
||||
public class IndicatorCreateDTO {
|
||||
public class AeIndicatorCreateDTO {
|
||||
|
||||
@ApiModelProperty(value = "父级指标ID,一级指标为0", required = true)
|
||||
@NotNull(message = "父级指标ID不能为空")
|
||||
@ -1,4 +1,4 @@
|
||||
package com.cmvr.evaluate.dto;
|
||||
package com.cmvr.evaluation.model.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -12,7 +12,7 @@ import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel("修改指标DTO")
|
||||
public class IndicatorUpdateDTO {
|
||||
public class AeIndicatorUpdateDTO {
|
||||
@ApiModelProperty(value = "指标主键ID", required = true)
|
||||
@NotNull(message = "指标ID不能为空")
|
||||
private Long id;
|
||||
@ -0,0 +1,20 @@
|
||||
package com.cmvr.evaluation.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.cmvr.evaluation.model.domain.AeIndicatorEntity;
|
||||
import com.cmvr.evaluation.model.domain.dto.AeIndicatorCreateDTO;
|
||||
import com.cmvr.evaluation.model.domain.dto.AeIndicatorUpdateDTO;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AeIndicatorService extends IService<AeIndicatorEntity> {
|
||||
|
||||
boolean saveIndicator(AeIndicatorCreateDTO dto);
|
||||
|
||||
List<AeIndicatorEntity> selectIndicatorByParentId(Long parentId, Integer type);
|
||||
|
||||
boolean removeIndicator(Long id);
|
||||
|
||||
boolean updateIndicator(AeIndicatorUpdateDTO dto);
|
||||
}
|
||||
@ -1,12 +1,13 @@
|
||||
package com.cmvr.evaluate.service.impl;
|
||||
package com.cmvr.evaluation.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 com.cmvr.evaluation.mapper.AeIndicatorMapper;
|
||||
import com.cmvr.evaluation.model.domain.AeIndicatorEntity;
|
||||
import com.cmvr.evaluation.model.domain.dto.AeIndicatorCreateDTO;
|
||||
import com.cmvr.evaluation.model.domain.dto.AeIndicatorUpdateDTO;
|
||||
import com.cmvr.evaluation.service.AeIndicatorService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -18,12 +19,12 @@ import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, IndicatorEntity> implements IndicatorService {
|
||||
public class AeIndicatorServiceImpl extends ServiceImpl<AeIndicatorMapper, AeIndicatorEntity> implements AeIndicatorService {
|
||||
|
||||
@Override
|
||||
public boolean saveIndicator(IndicatorCreateDTO createDTO) {
|
||||
public boolean saveIndicator(AeIndicatorCreateDTO createDTO) {
|
||||
// 1. DTO 转 Entity
|
||||
IndicatorEntity entity = CreateDTOConvertToEntity(createDTO);
|
||||
AeIndicatorEntity entity = CreateDTOConvertToEntity(createDTO);
|
||||
// 3. 调用MyBatis-Plus父类方法完成新增,返回执行结果
|
||||
boolean saveResult = this.save(entity);
|
||||
// 4. 日志记录:新增结果(成功/失败)
|
||||
@ -37,14 +38,14 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
|
||||
|
||||
|
||||
@Override
|
||||
public List<IndicatorEntity> selectIndicatorByParentId(Long parentId, Integer type) {
|
||||
public List<AeIndicatorEntity> selectIndicatorByParentId(Long parentId, Integer type) {
|
||||
log.info("评价管理---指标库---开始按父id查询指标,查询父id:{}", parentId == null ? "所有数据" : parentId);
|
||||
|
||||
LambdaQueryWrapper<IndicatorEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(parentId != null, IndicatorEntity::getParentId, parentId)
|
||||
.eq(type != null, IndicatorEntity::getType, type)
|
||||
.orderByAsc(IndicatorEntity::getSort);
|
||||
List<IndicatorEntity> list = this.list(queryWrapper);
|
||||
LambdaQueryWrapper<AeIndicatorEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(parentId != null, AeIndicatorEntity::getParentId, parentId)
|
||||
.eq(type != null, AeIndicatorEntity::getType, type)
|
||||
.orderByAsc(AeIndicatorEntity::getSort);
|
||||
List<AeIndicatorEntity> list = this.list(queryWrapper);
|
||||
// 3. 日志记录:查询结果
|
||||
log.info("评价管理---指标库---按父id查询指标完成,查询id:{},返回数量:{}",
|
||||
parentId == null ? "所有数据" : parentId, list.size());
|
||||
@ -82,14 +83,14 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateIndicator(IndicatorUpdateDTO dto) {
|
||||
public boolean updateIndicator(AeIndicatorUpdateDTO dto) {
|
||||
// 1. 验证数据是否存在
|
||||
IndicatorEntity existEntity = this.getById(dto.getId());
|
||||
AeIndicatorEntity existEntity = this.getById(dto.getId());
|
||||
if (existEntity == null) {
|
||||
log.error("评价管理---指标库---修改指标失败,指标ID {} 不存在", dto.getId());
|
||||
return false;
|
||||
}
|
||||
IndicatorEntity entity = updateDTOConvertToEntity(dto);
|
||||
AeIndicatorEntity entity = updateDTOConvertToEntity(dto);
|
||||
System.out.println("entity = " + entity);
|
||||
boolean saveResult = this.updateById(entity);
|
||||
// 4. 日志记录:新增结果(成功/失败)
|
||||
@ -108,9 +109,9 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
|
||||
*/
|
||||
private void findAllChildrenIds(Long parentId, List<Long> childrenIds) {
|
||||
// ① 查询当前parentId的直接子指标ID
|
||||
LambdaQueryWrapper<IndicatorEntity> queryWrapper = new LambdaQueryWrapper<IndicatorEntity>()
|
||||
.select(IndicatorEntity::getId) // 仅查ID字段,减少数据传输
|
||||
.eq(IndicatorEntity::getParentId, parentId);
|
||||
LambdaQueryWrapper<AeIndicatorEntity> queryWrapper = new LambdaQueryWrapper<AeIndicatorEntity>()
|
||||
.select(AeIndicatorEntity::getId) // 仅查ID字段,减少数据传输
|
||||
.eq(AeIndicatorEntity::getParentId, parentId);
|
||||
|
||||
// 核心修正:使用MP双参数listObjs,直接Object转Long,无多余参数
|
||||
List<Long> directChildIds = this.listObjs(
|
||||
@ -131,12 +132,12 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
|
||||
}
|
||||
}
|
||||
|
||||
private IndicatorEntity CreateDTOConvertToEntity(IndicatorCreateDTO dto) {
|
||||
private AeIndicatorEntity CreateDTOConvertToEntity(AeIndicatorCreateDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
IndicatorEntity entity = new IndicatorEntity();
|
||||
AeIndicatorEntity entity = new AeIndicatorEntity();
|
||||
entity.setParentId(dto.getParentId());
|
||||
entity.setLevel(dto.getLevel());
|
||||
entity.setName(dto.getName());
|
||||
@ -152,12 +153,12 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
|
||||
return entity;
|
||||
}
|
||||
|
||||
private IndicatorEntity updateDTOConvertToEntity(IndicatorUpdateDTO dto) {
|
||||
private AeIndicatorEntity updateDTOConvertToEntity(AeIndicatorUpdateDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
IndicatorEntity entity = new IndicatorEntity();
|
||||
AeIndicatorEntity entity = new AeIndicatorEntity();
|
||||
entity.setId(dto.getId()); // 重要:必须设置ID
|
||||
entity.setParentId(dto.getParentId());
|
||||
entity.setName(dto.getName());
|
||||
@ -28,15 +28,6 @@
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- AI评估-->
|
||||
<dependency>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user