Commit 0ec53b5d authored by wdy's avatar wdy

Merge branch 'dev' into 'master'

dev - master 47

See merge request !439
parents 553ab27f 95360a3d
......@@ -58,4 +58,9 @@ public class AutomobileEnterprise extends BaseEntity
@Excel(name = "联系电话")
@ApiModelProperty("联系电话")
private String contactNumber;
/** 联系电话 */
@Excel(name = "企业类型")
@ApiModelProperty("企业类型")
private String enterpriseType;
}
......@@ -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;
}
......@@ -7,6 +7,7 @@ import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.web.request.ReviewFindListRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewSceneListResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -23,7 +24,18 @@ public interface ReviewKeyPointMapper extends BaseMapper<ReviewKeyPoint> {
// 根据细则列表查询要点列表
List<ReviewKeyPoint> findByDetailsList(@Param("detailsList") List<ReviewDetails> detailsList);
/*
* 发起评审-获取要点列表
* */
List<ReviewKeyPointListResponse> getKeyPointList(@Param("standardId") Long standardId);
List<ReviewDetailsListResponse> getDetailsList(@Param("keyPointId") Long keyPointId);
/*
* 发起评审-获取细则列表
* */
List<ReviewDetailsListResponse> getDetailsList(@Param("keypointId") Long keypointId);
/*
* 发起评审-获取场景列表
* */
List<ReviewSceneListResponse> getSceneList(@Param("detailsId") Long detailsId);
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.response.ReviewOpinionResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import com.ruoyi.web.response.ReviewerListResponse;
import org.springframework.stereotype.Repository;
......@@ -63,6 +64,8 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang
List<ReviewSceneChangeTaskResponse> findFinishList(@Param("userId") Long userId, @Param("request") ReviewSceneChangeTaskFindFinishRequest request);
List<ReviewerListResponse> selectReviewerListByTaskId(@Param("id") Long id);
List<ReviewOpinionResponse> getReviewerOpinion(@Param("id") Long id);
}
......
......@@ -3,12 +3,8 @@ package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.ReviewKeyPoint;
import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.web.request.ReviewFindListRequest;
import com.ruoyi.web.request.ReviewStandardListByPageRequest;
import com.ruoyi.web.request.ReviewStandardListRequest;
import com.ruoyi.web.response.ReviewStandardListResponse;
import com.ruoyi.web.response.ReviewStandardResponse;
import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -39,4 +35,15 @@ public interface ReviewStandardMapper extends BaseMapper<ReviewStandard> {
// 根据要点列表查询标准列表
List<ReviewStandard> findByKeyPointList(@Param("keyPointList") List<ReviewKeyPoint> keyPointList, @Param("request") ReviewFindListRequest request);
/*
* 标准内容库新界面接口
* */
List<StandardTypeListResponse> findTypeByStandard(@Param("request") StandardListNewRequest request);
/*
* 标准内容库新界面接口
* */
List<ReviewStandardChapterListResponse> findChaptersByStandard(@Param("request") StandardListNewRequest request);
}
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;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import com.ruoyi.web.response.*;
import java.util.Date;
import java.util.List;
......@@ -113,6 +112,17 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
/*
* 发起评审-新增审查场景-获取细则列表
* */
List<ReviewDetailsListResponse> getDetailsList(Long keyPointId);
List<ReviewDetailsListResponse> getDetailsList(Long keypointId);
/*
* 发起评审-获取场景列表
* */
List<ReviewSceneListResponse> getSceneList(Long detailsId);
/*
* 获取评审人员
* */
List<SysUser> getReviewList();
List<ReviewOpinionResponse> getReviewerOpinion(Long id);
}
......@@ -2,10 +2,7 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.web.request.ReviewFindListRequest;
import com.ruoyi.web.request.ReviewStandardListByPageRequest;
import com.ruoyi.web.request.ReviewStandardListRequest;
import com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*;
import java.io.IOException;
......@@ -85,4 +82,10 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
* @return
*/
List<UseCaseListResponse> getUseCaseList(String request) throws IOException ;
/*
* 标准内容库新界面接口
* */
ReviewStandardListNewResponse getListNew(StandardListNewRequest request);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
......@@ -17,20 +18,19 @@ import com.ruoyi.service.ReviewSceneChangeTaskUserRelationService;
import com.ruoyi.service.ReviewSceneService;
import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import com.ruoyi.web.response.ReviewerListResponse;
import com.ruoyi.web.response.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author wangfei
......@@ -56,6 +56,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired
private ReviewTaskInboxService reviewTaskInboxService;
@Autowired
private ISysDeptService iSysDeptService;
@Autowired
private ReviewSceneChangeTaskMapper reviewSceneChangeTaskMapper;
......@@ -494,8 +497,39 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
* 发起评审-新增审查场景-获取细则列表
* */
@Override
public List<ReviewDetailsListResponse> getDetailsList(Long keyPointId) {
return reviewKeyPointMapper.getDetailsList(keyPointId);
public List<ReviewDetailsListResponse> getDetailsList(Long keypointId) {
return reviewKeyPointMapper.getDetailsList(keypointId);
}
/*
* 发起评审-获取场景列表
* */
@Override
public List<ReviewSceneListResponse> getSceneList(Long detailsId) {
return reviewKeyPointMapper.getSceneList(detailsId);
}
/*
* 获取评审人员
* */
@Override
public List<SysUser> getReviewList() {
// 获取用户ID列表
List<Long> reviewerIdList = sysUserRoleMapper.selectReviewerIdByRoleId(ReviewSceneChangeTask.REVIEW_ROLE_ID);
// 获取用户列表
List<SysUser> reviewerList = sysUserService.selectUserListByIds(reviewerIdList);
for (SysUser user : reviewerList){
user.setDept(iSysDeptService.selectDeptById(user.getDeptId()));
}
return reviewerList;
}
@Override
public List<ReviewOpinionResponse> getReviewerOpinion(Long id) {
List<ReviewOpinionResponse> list = reviewSceneChangeTaskMapper.getReviewerOpinion(id);
return list;
}
}
......
......@@ -17,10 +17,7 @@ import com.ruoyi.service.ReviewDetailsService;
import com.ruoyi.service.ReviewKeyPointService;
import com.ruoyi.service.ReviewSceneService;
import com.ruoyi.service.ReviewStandardService;
import com.ruoyi.web.request.ReviewFindListRequest;
import com.ruoyi.web.request.ReviewStandardListByPageRequest;
import com.ruoyi.web.request.ReviewStandardListRequest;
import com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*;
import okhttp3.*;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -28,9 +25,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@Transactional
......@@ -99,8 +94,10 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
ReviewStandard reviewStandard = ReviewStandard.builder().id(id).build();
List<ReviewStandard> reviewStandardList = new ArrayList<>();
reviewStandardList.add(reviewStandard);
// 查询审查要点
List<ReviewKeyPoint> reviewKeyPointList = reviewKeyPointService.findByStandardList(reviewStandardList);
// 查询审查细则
List<ReviewDetails> reivewDetailsList = reviewDetailsService.findByKeyPointsList(reviewKeyPointList);
// 查询审查场景
......@@ -464,4 +461,34 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
}
/*
* 标准内容库新界面接口
* */
@Override
public ReviewStandardListNewResponse getListNew(StandardListNewRequest request) {
// 获取标准类型列表
List<StandardTypeListResponse> typeListResponses = reviewStandardMapper.findTypeByStandard(request);
// 获取章节列表
List<ReviewStandardChapterListResponse> chapterList = reviewStandardMapper.findChaptersByStandard(request);
// 去重类型列表,并为每种类型分配章节列表
Set<String> uniqueTypes = new HashSet<>();
List<StandardTypeListResponse> uniqueTypeList = typeListResponses.stream()
.filter(type -> uniqueTypes.add(type.getType())) // 去重 type
.peek(type -> {
// 过滤并设置对应的章节列表
List<ReviewStandardChapterListResponse> filteredChapters = chapterList.stream()
.filter(chapter -> chapter.getType().equals(type.getType())) // 这里使用 getType 方法
.collect(Collectors.toList());
type.setReviewStandardChapterListResponses(filteredChapters);
})
.collect(Collectors.toList());
// 构建响应对象
ReviewStandardListNewResponse response = new ReviewStandardListNewResponse();
response.setTypeList(uniqueTypeList);
return response;
}
}
......@@ -42,6 +42,7 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
@Override
public CarReviewTaskViewResponse doView(CarReviewTask carReviewTask) {
// 获取最新问卷
// TODO 从新系统获取
List<ReviewStandard> standardTree = reviewStandardService.findTree(carReviewTask.getStandardId(), ReviewStandard.TYPE_CAR);
// 将问卷赋值到任务
......
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
......
......@@ -817,7 +817,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"query\":\"mutation quickCreateProjct($name:String$description:String$useCaseList:[ID!]!){project{quickCreateProject(input:{name:$name description:$description useCaseIDList:$useCaseList}){id name status description createTime}}}\",\"variables\":"+ request +"}");
RequestBody body = RequestBody.create(mediaType, "{\"query\":\"mutation quickCreateProjct($name:String$description:String$useCaseList:[ID!]$duplicatedUseCaseList:[UseCaseWithDuplicateDimension!]){project{quickCreateProject(input:{name:$name description:$description useCaseIDList:$useCaseList duplicatedUseCases:$duplicatedUseCaseList}){id name status description createTime}}}\",\"variables\":"+ request +"}");
Request requestKE = new Request.Builder()
.url("http://10.12.48.80:8089/api/query")
.method("POST", body)
......@@ -834,9 +835,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string);
System.out.println("jsonObject = " + jsonObject);
// 获取id
String testSchemeId = "";
if (jsonObject.getJSONObject("data").getJSONObject("project") != null) {
// System.out.println("jsonObject = " + jsonObject.getJSONObject("data").getJSONObject("project").getJSONObject("quickCreateProject"));
if (!jsonObject.getJSONObject("data").getJSONObject("project").isEmpty()) {
testSchemeId = (String) jsonObject.getJSONObject("data").getJSONObject("project").getJSONObject("quickCreateProject").get("id");
}
......
......@@ -3,6 +3,7 @@ package com.ruoyi.web;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.bean.BeanUtils;
......@@ -11,11 +12,8 @@ import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.service.ReviewSceneChangeTaskService;
import com.ruoyi.web.request.ReviewSceneChangeTaskCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import com.ruoyi.web.response.*;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.ReviewStandardListResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -167,29 +165,70 @@ public class ReviewSceneChangeTaskController extends BaseController {
}
/*
* 发起评审-新增审查场景-获取要点列表
* 发起评审-获取要点列表
* */
@ApiOperation("发起评审-新增审查场景-获取要点列表")
@ApiOperation("发起评审-获取要点列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "发起评审-新增审查场景-获取要点列表", businessType = BusinessType.UPDATE)
@Log(title = "发起评审-获取要点列表", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getKeyPointList")
public R<List<ReviewKeyPointListResponse>> getKeyPointList(@Validated @RequestBody ReviewKeyPointListRequest request){
List<ReviewKeyPointListResponse> list = reviewSceneChangeTaskService.getKeyPointList(request.getStandardId());
Long id = Long.parseLong(request.getStandardId());
List<ReviewKeyPointListResponse> list = reviewSceneChangeTaskService.getKeyPointList(id);
return R.ok(list);
}
/*
* 发起评审-新增审查场景-获取细则列表
* 发起评审-获取细则列表
* */
@ApiOperation("发起评审-新增审查场景-获取细则列表")
@ApiOperation("发起评审-获取细则列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "发起评审-新增审查场景-获取细则列表", businessType = BusinessType.UPDATE)
@Log(title = "发起评审-获取细则列表", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getDetailsList")
public R<List<ReviewDetailsListResponse>> getKeyPointList(@Validated @RequestBody ReviewDetailsListRequest request){
List<ReviewDetailsListResponse> list = reviewSceneChangeTaskService.getDetailsList(request.getKeyPointId());
Long id = Long.parseLong(request.getKeypointId());
List<ReviewDetailsListResponse> list = reviewSceneChangeTaskService.getDetailsList(id);
return R.ok(list);
}
/*
* 发起评审-获取场景列表
* */
@ApiOperation("发起评审-获取场景列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "发起评审-获取场景列表", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getSceneList")
public R<List<ReviewSceneListResponse>> getSceneList(@Validated @RequestBody ReviewSceneListRequest request){
Long id = Long.parseLong(request.getDetailsId());
List<ReviewSceneListResponse> list = reviewSceneChangeTaskService.getSceneList(id);
return R.ok(list);
}
/*
* 获取评审人员
* */
@ApiOperation("获取评审人员")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "获取评审人员", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getReviewerList")
public R<List<SysUser>> getReviewerList(){
List<SysUser> list = reviewSceneChangeTaskService.getReviewList();
return R.ok(list);
}
/*
* 查看评审人员评审意见
* */
@ApiOperation("查看评审人员评审意见")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "查看评审人员评审意见", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getReviewerOpinion")
public R<List<ReviewOpinionResponse>> getReviewerOpinion(@Validated @RequestBody ReviewSceneChangeTaskGetInfoRequest request){
Long id = Long.parseLong(request.getId());
return R.ok(reviewSceneChangeTaskService.getReviewerOpinion(id));
}
}
......@@ -40,7 +40,7 @@ public class ReviewStandardController extends BaseController {
@Anonymous
@ApiOperation("分页查询标准(检验内容库)")
@PostMapping("/list")
public TableDataInfo<ReviewStandardResponse> listByPage(@Validated @RequestBody ReviewStandardListByPageRequest request) {
public TableDataInfo<ReviewStandardResponse> listByPage(@RequestBody ReviewStandardListByPageRequest request) {
startPage(request);
List<ReviewStandardResponse> list = reviewStandardService.listByPage(request);
return getDataTable(list);
......@@ -152,4 +152,16 @@ public class ReviewStandardController extends BaseController {
return getDataTable(reviewStandardService.getUseCaseList(request));
}
/*
* 标准内容库新界面接口
* */
@ApiOperation("标准内容库新界面接口")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getReviewStandardList", produces="application/json;charset=UTF-8")
public R<ReviewStandardListNewResponse> getReviewStandardList(@RequestBody StandardListNewRequest request){
ReviewStandardListNewResponse response = reviewStandardService.getListNew(request);
return R.ok(response);
}
}
......@@ -17,18 +17,18 @@ import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
import java.util.*;
@Api(tags = "总任务")
@RestController
......@@ -188,6 +188,72 @@ public class TaskController extends BaseController {
return R.ok(response);
}
/*
* 开启车型实验任务时-上传文件
* */
@ApiOperation("开启车型实验任务时-上传文件")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PostMapping("/uploadExcel")
public R<Map<String, Object>> uploadExcel(@RequestParam("file") MultipartFile file) throws IOException {
// 确保文件类型是Excel
if (!file.getOriginalFilename().endsWith(".xlsx") && !file.getOriginalFilename().endsWith(".xls")) {
throw new IllegalArgumentException("Please upload an Excel file.");
}
// 解析Excel文件
Workbook workbook = WorkbookFactory.create(file.getInputStream());
Sheet sheet = workbook.getSheetAt(3); // 获取第4个工作表
Map<String, Object> result = new HashMap<>();
List<Map<String, String>> duplicatedUseCaseList = new ArrayList<>();
// 获取第一行并查找“用例编号”所在的列
Row headerRow = sheet.getRow(0);
int targetColumnIndex = -1;
if (headerRow != null) {
for (int i = 0; i < headerRow.getLastCellNum(); i++) {
Cell headerCell = headerRow.getCell(i);
if (headerCell != null && "用例编号".equals(headerCell.toString().trim())) {
targetColumnIndex = i; // 找到“用例编号”所在的列索引
break;
}
}
}
if (targetColumnIndex == -1) {
workbook.close();
return R.fail("没找到测试用例列");
}
// 设置 "name" 为 "用例编号"
result.put("name", "用例编号");
// 遍历行,提取“用例编号”列的数据并构造新格式
for (int i = 1; i <= sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i);
if (row != null) {
Cell cell = row.getCell(targetColumnIndex); // 获取“用例编号”列的单元格
if (cell != null && !cell.toString().trim().isEmpty()) {
Map<String, String> useCaseMap = new HashMap<>();
useCaseMap.put("useCaseDisplayOrCustomizedID", cell.toString().trim()); // 将用例编号作为新的Map的值
duplicatedUseCaseList.add(useCaseMap); // 添加到列表
}
}
}
if (duplicatedUseCaseList.isEmpty()) {
workbook.close();
return R.fail("测试用例id不能为空");
}
result.put("duplicatedUseCaseList", duplicatedUseCaseList); // 使用新的格式存储数据
workbook.close();
return R.ok(result);
}
/**
* 快速创建检测项目
* @param request
......@@ -195,6 +261,9 @@ public class TaskController extends BaseController {
* @throws IOException
*/
@ApiOperation("快速创建检测项目(科恩)")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "快速创建检测项目(科恩)", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/createProject", produces="application/json;charset=UTF-8")
public R<String> createProject(@Validated @RequestBody String request) throws IOException {
return R.ok(taskService.createProject(request));
......
......@@ -33,4 +33,8 @@ public class AutomobileEnterpriseListRequest extends PageDomain {
@ApiModelProperty("联系电话")
private String contactNumber;
/*厂商企业类型*/
@ApiModelProperty
private String enterpriseType;
}
......@@ -9,5 +9,5 @@ import lombok.Data;
public class ReviewDetailsListRequest {
@ApiModelProperty("标准要求id")
private Long keyPointId;
private String keypointId;
}
......@@ -9,5 +9,5 @@ import lombok.Data;
public class ReviewKeyPointListRequest {
@ApiModelProperty("标准要求id")
private Long standardId;
private String standardId;
}
......@@ -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;
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewSceneListRequest", description = "查询场景列表参数")
@Data
public class ReviewSceneListRequest {
@ApiModelProperty("标准细则id")
private String detailsId;
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@ApiModel(value = "StandardListNewRequest", description = "标准内容库新界面接口")
public class StandardListNewRequest {
@ApiModelProperty("标准id")
private String standardId;
@ApiModelProperty("标准编号")
private String standardNo;
public String getStandardId() {
return standardId;
}
public void setStandardId(String standardId) {
this.standardId = standardId;
}
public String getStandardNo() {
return standardNo;
}
public void setStandardNo(String standardNo) {
this.standardNo = standardNo;
}
public StandardListNewRequest() {
}
public StandardListNewRequest(String standardId, String standardNo) {
this.standardId = standardId;
this.standardNo = standardNo;
}
@Override
public String toString() {
return "StandardListNewRequest{" +
"standardId='" + standardId + '\'' +
", standardNo='" + standardNo + '\'' +
'}';
}
}
......@@ -4,12 +4,12 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewKeyPointListResponse", description = "查询细则列表返回结果")
@ApiModel(value = "ReviewDetailsListResponse", description = "查询细则列表返回结果")
@Data
public class ReviewDetailsListResponse {
@ApiModelProperty("主键-要点id")
private Long id;
private String id;
@ApiModelProperty("要点文本内容")
private String text;
......
......@@ -9,7 +9,7 @@ import lombok.Data;
public class ReviewKeyPointListResponse {
@ApiModelProperty("主键-要点id")
private Long id;
private String id;
@ApiModelProperty("要点文本内容")
private String text;
......
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel(value = "ReviewOpinionResponse", description = "评审动态")
@Data
public class ReviewOpinionResponse {
@ApiModelProperty("评审员名字")
private String name;
@ApiModelProperty("评审时间")
private Date decisionTime;
@ApiModelProperty("评审结果")
private String decision;
@ApiModelProperty("评审意见")
private String comment;
}
......@@ -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;
}
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewSceneListResponse", description = "查询场景列表返回结果")
@Data
public class ReviewSceneListResponse {
@ApiModelProperty("主键-要点id")
private String id;
@ApiModelProperty("要点文本内容")
private String text;
@ApiModelProperty("标准id")
private Long reviewDetailsId;
}
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "ReviewStandardChapterListResponse", description = "标准内容库新界面接口")
public class ReviewStandardChapterListResponse {
@ApiModelProperty("标准号id")
private String standardId;
@ApiModelProperty("章节")
private String chapter;
@ApiModelProperty("章节内容")
private String text;
@ApiModelProperty("标准分类")
private String type;
}
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "ReviewStandardListNewResponse", description = "标准内容库新界面接口")
public class ReviewStandardListNewResponse {
@ApiModelProperty("标准分类集合")
private List<StandardTypeListResponse> typeList;
}
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "StandardTypeList", description = "标准内容库新界面接口")
public class StandardTypeListResponse {
@ApiModelProperty("标准分类")
private String type;
@ApiModelProperty("章节集合")
private List<ReviewStandardChapterListResponse> reviewStandardChapterListResponses;
}
......@@ -29,7 +29,8 @@
create_time,
update_by,
update_time,
deleted
deleted,
enterprise_type
from t_automobile_enterprise
</sql>
......@@ -44,7 +45,8 @@
ae.create_time,
ae.update_by,
ae.update_time,
ae.deleted
ae.deleted,
ae.enterprise_type
from t_automobile_enterprise ae
left join sys_user su on ae.create_by = su.user_id
</sql>
......@@ -62,6 +64,9 @@
<if test="enterpriseContact != null and enterpriseContact != ''">
and ae.enterprise_contact like concat('%', #{enterpriseContact}, '%')
</if>
<if test="enterpriseType != null and enterpriseType != ''">
and ae.enterprise_type like concat('%', #{enterpriseType}, '%')
</if>
<if test="contactNumber != null and contactNumber != ''">and ae.contact_number like concat('%', #{contactNumber}, '%')</if>
</where>
</select>
......@@ -111,6 +116,7 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="enterpriseType != null">enterprise_Type = #{enterpriseType}</if>
</trim>
where id = #{id}
</update>
......
......@@ -32,7 +32,11 @@
</select>
<select id="getDetailsList" resultType="com.ruoyi.web.response.ReviewDetailsListResponse">
select id, text from t_review_details
where review_keypoint_id = #{keyPointId}
where review_keypoint_id = #{keypointId}
</select>
<select id="getSceneList" resultType="com.ruoyi.web.response.ReviewSceneListResponse">
select id,text from t_review_scene
where review_details_id = #{detailsId}
</select>
</mapper>
......@@ -75,6 +75,7 @@
<if test="request.inspectStandardId != null and request.inspectStandardId != ''">
and inspect_standard_id = #{request.inspectStandardId}
</if>
ORDER BY task_begin_time ASC
</select>
<select id="findFinishListByUserId" resultType="com.ruoyi.web.response.ReviewSceneChangeTaskResponse">
......@@ -94,6 +95,7 @@
<if test="request.inspectStandardId != null and request.inspectStandardId != ''">
and inspect_standard_id = #{request.inspectStandardId}
</if>
ORDER BY task_begin_time ASC
</select>
<select id="findCreateListByUserId" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
......@@ -114,6 +116,7 @@
<if test="request.inspectStandardId != null and request.inspectStandardId != ''">
and inspect_standard_id = #{request.inspectStandardId}
</if>
ORDER BY task_begin_time ASC
</select>
<select id="findSceneChangeTaskById" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
......@@ -160,5 +163,10 @@
from t_review_scene_change_task_user_relation
where task_id = #{id}
</select>
<select id="getReviewerOpinion" resultType="com.ruoyi.web.response.ReviewOpinionResponse">
select name,comment,decision,decision_time
from t_review_scene_change_task_user_relation
where task_id = #{id}
</select>
</mapper>
......@@ -97,6 +97,23 @@
and standard_id = #{request.standardId}
and type = #{request.type}
</select>
<select id="getListNew" resultType="com.ruoyi.web.response.ReviewStandardListNewResponse">
select type,chapter
from t_review_standard
where standard_no = #{request.standardNo} and standard_id = #{request.standardId}
</select>
<select id="findTypeByStandard" resultType="com.ruoyi.web.response.StandardTypeListResponse">
SELECT DISTINCT type
FROM t_review_standard
WHERE standard_no = #{request.standardNo}
AND standard_id = #{request.standardId}
</select>
<select id="findChaptersByStandard" resultType="com.ruoyi.web.response.ReviewStandardChapterListResponse">
SELECT chapter, text, type ,standard_id as standardId <!-- 添加 type 字段 -->
FROM t_review_standard
WHERE standard_no = #{request.standardNo}
AND standard_id = #{request.standardId}
</select>
......
<?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>
......@@ -29,6 +29,7 @@ public class TestUrl {
.url("http://10.12.48.80:8089/api/query")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjAsInRva2VuaWQiOjYxLCJ0eXBlIjoiYXBpIiwidXNlcm5hbWUiOiJhZG1pbiJ9.48Ggjx-FtOcecf73vAHn0XglwgLXZlfXxhXiLDHWWQE")
// .addHeader("Host", "10.12.48.80:8089")
// .addHeader("Origin", "http://10.12.48.80:8089")
// .addHeader("Referer", "http://10.12.48.80:8089/api/graphql/playground")
......@@ -44,5 +45,5 @@ public class TestUrl {
});
}
}
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