Commit 34985e8b authored by yuanshuo's avatar yuanshuo

修改接口:新增评审任务时可以新增、修改、删除测试用例,评审任务时可以评审新增、修改、删除测试用例任务, 增加字段、和实体类用于实现以上功能

parent 4ddce880
......@@ -228,4 +228,12 @@ public class ReviewSceneChangeTask {
@ApiModelProperty("创新基地结果")
private String innovationBaseResult;
@ApiModelProperty("用例编号")
private String usecaseId;
@ApiModelProperty("用例描述")
private String usecaseDescribe;
@ApiModelProperty("评审用例id")
private Long reviewUsecaseId;
}
......@@ -47,7 +47,7 @@ public class ReviewStandard {
/**
* 检查类型[system(体系审查)、car(车型审查)]
*/
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)]")
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)、test(车型实验审查)]")
private String type;
/**
......
package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel
@TableName(value ="t_review_usecase")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ReviewUsecase {
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("用例编号")
private String usecaseId;
@ApiModelProperty("用例描述")
private String usecaseDescribe;
/**
* 审查标准id
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
@ApiModelProperty("审查标准id")
private Long reviewStandardId;
}
package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.ReviewUsecase;
import org.springframework.stereotype.Repository;
@Repository
public interface ReviewUsecaseMapper extends BaseMapper<ReviewUsecase> {
ReviewUsecase getById(Long reviewUsecaseId);
}
package com.ruoyi.service.impl;
import com.ruoyi.domain.ReviewDetails;
import com.ruoyi.domain.ReviewKeyPoint;
import com.ruoyi.domain.ReviewScene;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.ReviewKeyPointMapper;
import com.ruoyi.mapper.ReviewSceneMapper;
import com.ruoyi.mapper.ReviewUsecaseMapper;
import com.ruoyi.service.StrategyReviewSceneChange;
import com.ruoyi.service.ReviewSceneChangeTaskService;
import org.springframework.beans.factory.InitializingBean;
......@@ -38,6 +36,9 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange,
@Autowired
private ReviewDetailsMapper reviewDetailsMapper;
@Autowired
private ReviewUsecaseMapper reviewUsecaseMapper;
/**
* 新增审查场景
* @param reviewSceneChangeTask
......@@ -97,6 +98,19 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange,
reviewSceneChangeTaskService.updateById(reviewSceneChangeTask);
}
//新增测试用例评审
if(Objects.equals(reviewSceneChangeTask.getOperationSort(),"ADD_USECASE")){
//保存新增的测试用例
ReviewUsecase reviewUsecase = new ReviewUsecase();
reviewUsecase.setUsecaseDescribe(reviewSceneChangeTask.getUsecaseDescribe());
reviewUsecase.setUsecaseId(reviewSceneChangeTask.getUsecaseId());
reviewUsecase.setReviewStandardId(reviewSceneChangeTask.getStandardId());
reviewUsecaseMapper.insert(reviewUsecase);
//为用例变更任务的场景关联字段赋值
reviewSceneChangeTask.setReviewUsecaseId(reviewUsecase.getId());
reviewSceneChangeTaskService.updateById(reviewSceneChangeTask);
}
}
......
......@@ -4,10 +4,7 @@ import com.ruoyi.domain.ReviewDetails;
import com.ruoyi.domain.ReviewDetailsResult;
import com.ruoyi.domain.ReviewScene;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.ReviewDetailsResultMapper;
import com.ruoyi.mapper.ReviewKeyPointMapper;
import com.ruoyi.mapper.ReviewSceneMapper;
import com.ruoyi.mapper.*;
import com.ruoyi.service.ReviewDetailsService;
import com.ruoyi.service.ReviewKeyPointService;
import com.ruoyi.service.StrategyReviewSceneChange;
......@@ -48,6 +45,9 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
@Autowired
private ReviewDetailsResultMapper reviewDetailsResultMapper;
@Autowired
private ReviewUsecaseMapper reviewUsecaseMapper;
@Override
public void doChange(ReviewSceneChangeTask reviewSceneChangeTask) {
// 删除场景
......@@ -97,6 +97,11 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
reviewSceneService.removeBatchByIds(reviewScenesList);
}
}
//删除用例
if (Objects.equals(reviewSceneChangeTask.getOperationSort(),"DELETE_USECASE")){
reviewUsecaseMapper.deleteById(reviewSceneChangeTask.getReviewUsecaseId());
}
}
@Override
......
......@@ -2,6 +2,8 @@ package com.ruoyi.service.impl;
import com.ruoyi.domain.ReviewScene;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.domain.ReviewUsecase;
import com.ruoyi.mapper.ReviewUsecaseMapper;
import com.ruoyi.service.StrategyReviewSceneChange;
import com.ruoyi.service.ReviewSceneService;
import org.springframework.beans.factory.InitializingBean;
......@@ -10,6 +12,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Objects;
@Transactional
@Service
public class StrategyReviewSceneChangeUpdate implements StrategyReviewSceneChange, InitializingBean {
......@@ -19,16 +23,26 @@ public class StrategyReviewSceneChangeUpdate implements StrategyReviewSceneChang
@Autowired
private ApplicationContext applicationContext;
@Autowired
private ReviewUsecaseMapper reviewUsecaseMapper;
@Autowired
private ReviewSceneService reviewSceneService;
@Override
public void doChange(ReviewSceneChangeTask reviewSceneChangeTask) {
if (Objects.equals(reviewSceneChangeTask.getOperationSort(),"UPDATE_SCENE")){
ReviewScene reviewScene = reviewSceneService.getById(reviewSceneChangeTask.getReviewSceneId());
reviewScene.setText(reviewSceneChangeTask.getNewText());
reviewSceneService.updateById(reviewScene);
}
ReviewScene reviewScene = reviewSceneService.getById(reviewSceneChangeTask.getReviewSceneId());
reviewScene.setText(reviewSceneChangeTask.getNewText());
if (Objects.equals(reviewSceneChangeTask.getOperationSort(),"UPDATE_USECASE")){
ReviewUsecase reviewUsecase = reviewUsecaseMapper.getById(reviewSceneChangeTask.getReviewUsecaseId());
reviewUsecase.setUsecaseDescribe(reviewSceneChangeTask.getUsecaseDescribe());
reviewUsecase.setUsecaseId(reviewSceneChangeTask.getNewText());
reviewSceneService.updateById(reviewScene);
reviewUsecaseMapper.updateById(reviewUsecase);
}
}
@Override
......
......@@ -35,7 +35,7 @@ public class ReviewSceneChangeTaskCreateRequest {
/**
* 检查类型[system(体系审查)、car(车型审查)]
*/
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)]")
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)、test(车型检验)]")
private String type;
/**
......@@ -103,4 +103,13 @@ public class ReviewSceneChangeTaskCreateRequest {
@ApiModelProperty(value = "审查场景id", notes = "1.若为修改、删除任务时,此id在创建任务时赋值; 2.若为新增任务时,此id在审批通过并保存新场景后赋值 ")
private Long reviewSceneId;
@ApiModelProperty("用例编号")
private String usecaseId;
@ApiModelProperty("用例描述")
private String usecaseDescribe;
@ApiModelProperty("评审用例id")
private Long reviewUsecaseId;
}
......@@ -48,7 +48,7 @@ public class ReviewSceneChangeTaskResponse {
@ApiModelProperty("审查标准")
private String standard;
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)]")
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)、test(车型检验)]")
private String type;
/**
......@@ -81,7 +81,7 @@ public class ReviewSceneChangeTaskResponse {
@ApiModelProperty("操作(ADD DELETE UPDATE)")
private String operation;
@ApiModelProperty(value = "分类" , notes = "[KEYPOINT DETAILS SCENE]")
@ApiModelProperty(value = "分类" , notes = "[KEYPOINT DETAILS SCENE USECASE]")
private String sort;
@ApiModelProperty("评审类型")
......@@ -169,4 +169,13 @@ public class ReviewSceneChangeTaskResponse {
@ApiModelProperty("创新基地结果")
private String innovationBaseResult;
@ApiModelProperty("用例编号")
private String usecaseId;
@ApiModelProperty("用例描述")
private String usecaseDescribe;
@ApiModelProperty("评审用例id")
private Long reviewUsecaseId;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.ReviewUsecaseMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.ReviewUsecase">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="usecaseId" column="usecase_id" jdbcType="VARCHAR"/>
<result property="usecaseDescribe" column="usecase_describe" jdbcType="VARCHAR"/>
<result property="reviewStandardId" column="review_standard_id" jdbcType="BIGINT"/>
</resultMap>
<select id="getById" resultType="com.ruoyi.domain.ReviewUsecase">
select *
from t_review_usecase
where id = #{id}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment