Commit 384683d6 authored by 宋源硕's avatar 宋源硕

Merge branch 'songyuanshuo' into 'master'

2024/12/13接口修改

See merge request !28
parents 4277ef03 f2767c51
...@@ -234,8 +234,9 @@ public class ReviewSceneChangeTask { ...@@ -234,8 +234,9 @@ public class ReviewSceneChangeTask {
@ApiModelProperty("用例描述") @ApiModelProperty("用例描述")
private String usecaseDescribe; private String usecaseDescribe;
//要改成Long打包的时候显示String
@ApiModelProperty("评审用例id") @ApiModelProperty("评审用例id")
private String reviewUsecaseId; private Long reviewUsecaseId;
@TableField(exist = false) @TableField(exist = false)
private String name; private String name;
......
...@@ -13,11 +13,8 @@ import com.ruoyi.domain.ReviewSceneChangeTask; ...@@ -13,11 +13,8 @@ import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.domain.ReviewSceneChangeTaskUserRelation; import com.ruoyi.domain.ReviewSceneChangeTaskUserRelation;
import com.ruoyi.domain.Standard; import com.ruoyi.domain.Standard;
import com.ruoyi.framework.web.domain.server.Sys; import com.ruoyi.framework.web.domain.server.Sys;
import com.ruoyi.mapper.ReviewKeyPointMapper; import com.ruoyi.mapper.*;
import com.ruoyi.mapper.ReviewSceneChangeTaskUserRelationMapper;
import com.ruoyi.mapper.StandardMapper;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.mapper.ReviewSceneChangeTaskMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper; import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
...@@ -72,6 +69,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -72,6 +69,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired @Autowired
private StandardMapper standardMapper; private StandardMapper standardMapper;
@Autowired
private TestUseCaseMapper testUseCaseMapper;
@Autowired @Autowired
ReviewSceneChangeTaskUserRelationMapper reviewSceneChangeTaskUserRelationMapper; ReviewSceneChangeTaskUserRelationMapper reviewSceneChangeTaskUserRelationMapper;
@Override @Override
...@@ -89,12 +89,19 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -89,12 +89,19 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
String s = JSONUtil.toJsonStr(getSerialNumberRequest); String s = JSONUtil.toJsonStr(getSerialNumberRequest);
List<SerialNumberResponse> list = testUseCaseService.getSerialNumberList(s); /*List<SerialNumberResponse> list = testUseCaseService.getSerialNumberList(s);
for (SerialNumberResponse serialNumberResponse : list){ for (SerialNumberResponse serialNumberResponse : list){
if (Objects.equals(serialNumberResponse.getSerialNumber(), reviewSceneChangeTask.getUsecaseId())){ if (Objects.equals(serialNumberResponse.getSerialNumber(), reviewSceneChangeTask.getUsecaseId())){
throw new ServiceException("用例编号重复", HttpStatus.ERROR); throw new ServiceException("用例编号重复", HttpStatus.ERROR);
} }
}*/
//改成丛本地获取数据后
List<SerialNumberResponseNew> list = testUseCaseMapper.selectSerialNumberList();
for (SerialNumberResponseNew serialNumberResponseNew : list){
if (Objects.equals(serialNumberResponseNew.getSerialNumber(), reviewSceneChangeTask.getUsecaseId())){
throw new ServiceException("用例编号重复", HttpStatus.ERROR);
}
} }
} }
...@@ -110,15 +117,23 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -110,15 +117,23 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
String s = JSONUtil.toJsonStr(getSerialNumberRequest); String s = JSONUtil.toJsonStr(getSerialNumberRequest);
List<SerialNumberResponse> list = testUseCaseService.getSerialNumberList(s); //List<SerialNumberResponse> list = testUseCaseService.getSerialNumberList(s);
//先判断用例编号是否有 //先判断用例编号是否有
for (SerialNumberResponse serialNumberResponse : list){ /*for (SerialNumberResponse serialNumberResponse : list){
if (Objects.equals(serialNumberResponse.getSerialNumber(),reviewSceneChangeTask.getUsecaseId())){ if (Objects.equals(serialNumberResponse.getSerialNumber(),reviewSceneChangeTask.getUsecaseId())){
if (!Objects.equals(serialNumberResponse.getId(),reviewSceneChangeTask.getReviewUsecaseId())){ if (!Objects.equals(serialNumberResponse.getId(),reviewSceneChangeTask.getReviewUsecaseId())){
throw new ServiceException("当前用例编号对象已存在", HttpStatus.ERROR); throw new ServiceException("当前用例编号对象已存在", HttpStatus.ERROR);
} }
} }
}*/
List<SerialNumberResponseNew> list = testUseCaseMapper.selectSerialNumberList();
for (SerialNumberResponseNew serialNumberResponseNew : list){
if (Objects.equals(serialNumberResponseNew.getSerialNumber(),reviewSceneChangeTask.getUsecaseId())){
if (!Objects.equals(serialNumberResponseNew.getId(),reviewSceneChangeTask.getReviewUsecaseId())){
throw new ServiceException("当前用例编号对象已存在", HttpStatus.ERROR);
}
}
} }
} }
// 获取当前登陆人 // 获取当前登陆人
......
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewDetailsMapper; import com.ruoyi.mapper.*;
import com.ruoyi.mapper.ReviewKeyPointMapper;
import com.ruoyi.mapper.ReviewSceneMapper;
import com.ruoyi.mapper.ReviewUsecaseMapper;
import com.ruoyi.service.StrategyReviewSceneChange; import com.ruoyi.service.StrategyReviewSceneChange;
import com.ruoyi.service.ReviewSceneChangeTaskService; import com.ruoyi.service.ReviewSceneChangeTaskService;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -39,6 +36,9 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange, ...@@ -39,6 +36,9 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange,
@Autowired @Autowired
private ReviewUsecaseMapper reviewUsecaseMapper; private ReviewUsecaseMapper reviewUsecaseMapper;
@Autowired
private UsecaseDetailsMapper usecaseDetailsMapper;
/** /**
* 新增审查场景 * 新增审查场景
* @param reviewSceneChangeTask * @param reviewSceneChangeTask
...@@ -98,7 +98,19 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange, ...@@ -98,7 +98,19 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange,
reviewSceneChangeTaskService.updateById(reviewSceneChangeTask); reviewSceneChangeTaskService.updateById(reviewSceneChangeTask);
} }
// 保存新增的用例
if (Objects.equals(reviewSceneChangeTask.getOperationSort(),"ADD_USECASE")) {
//测试用例
UsecaseDetails usecaseDetails = new UsecaseDetails();
usecaseDetails.setCustomizedId(reviewSceneChangeTask.getUsecaseId());
usecaseDetails.setDescription(reviewSceneChangeTask.getUsecaseDescribe());
usecaseDetails.setTestScenarioId(reviewSceneChangeTask.getKeypointId());
usecaseDetailsMapper.insert(usecaseDetails);
reviewSceneChangeTask.setReviewUsecaseId(usecaseDetails.getId());
reviewSceneChangeTaskService.updateById(reviewSceneChangeTask);
}
} }
......
...@@ -45,6 +45,8 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang ...@@ -45,6 +45,8 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
@Autowired @Autowired
private ReviewUsecaseMapper reviewUsecaseMapper; private ReviewUsecaseMapper reviewUsecaseMapper;
@Autowired
private UsecaseDetailsMapper usecaseDetailsMapper;
@Autowired @Autowired
private ReviewDetailsResultMapper reviewDetailsResultMapper; private ReviewDetailsResultMapper reviewDetailsResultMapper;
...@@ -98,6 +100,11 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang ...@@ -98,6 +100,11 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
} }
} }
//删除用例
if(Objects.equals(reviewSceneChangeTask.getOperationSort(),"DELETE_USECASE")){
// 删除用例
usecaseDetailsMapper.deleteById(reviewSceneChangeTask.getReviewUsecaseId());
}
} }
@Override @Override
......
...@@ -3,7 +3,9 @@ package com.ruoyi.service.impl; ...@@ -3,7 +3,9 @@ package com.ruoyi.service.impl;
import com.ruoyi.domain.ReviewScene; import com.ruoyi.domain.ReviewScene;
import com.ruoyi.domain.ReviewSceneChangeTask; import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.domain.ReviewUsecase; import com.ruoyi.domain.ReviewUsecase;
import com.ruoyi.domain.UsecaseDetails;
import com.ruoyi.mapper.ReviewUsecaseMapper; import com.ruoyi.mapper.ReviewUsecaseMapper;
import com.ruoyi.mapper.UsecaseDetailsMapper;
import com.ruoyi.service.StrategyReviewSceneChange; import com.ruoyi.service.StrategyReviewSceneChange;
import com.ruoyi.service.ReviewSceneService; import com.ruoyi.service.ReviewSceneService;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -26,6 +28,9 @@ public class StrategyReviewSceneChangeUpdate implements StrategyReviewSceneChang ...@@ -26,6 +28,9 @@ public class StrategyReviewSceneChangeUpdate implements StrategyReviewSceneChang
@Autowired @Autowired
private ReviewUsecaseMapper reviewUsecaseMapper; private ReviewUsecaseMapper reviewUsecaseMapper;
@Autowired
private UsecaseDetailsMapper usecaseDetailsMapper;
@Autowired @Autowired
private ReviewSceneService reviewSceneService; private ReviewSceneService reviewSceneService;
@Override @Override
...@@ -37,6 +42,13 @@ public class StrategyReviewSceneChangeUpdate implements StrategyReviewSceneChang ...@@ -37,6 +42,13 @@ public class StrategyReviewSceneChangeUpdate implements StrategyReviewSceneChang
reviewSceneService.updateById(reviewScene); reviewSceneService.updateById(reviewScene);
} }
if (Objects.equals(reviewSceneChangeTask.getOperationSort(),"UPDATE_USECASE")){
UsecaseDetails usecaseDetails = usecaseDetailsMapper.selectById(reviewSceneChangeTask.getReviewUsecaseId());
usecaseDetails.setCustomizedId(reviewSceneChangeTask.getUsecaseId());
usecaseDetails.setDescription(reviewSceneChangeTask.getUsecaseDescribe());
usecaseDetailsMapper.updateById(usecaseDetails);
}
} }
@Override @Override
......
...@@ -109,8 +109,9 @@ public class ReviewSceneChangeTaskCreateRequest { ...@@ -109,8 +109,9 @@ public class ReviewSceneChangeTaskCreateRequest {
@ApiModelProperty("用例描述") @ApiModelProperty("用例描述")
private String usecaseDescribe; private String usecaseDescribe;
//要改成Long打包的时候显示String
@ApiModelProperty("评审用例id") @ApiModelProperty("评审用例id")
private String reviewUsecaseId; private Long reviewUsecaseId;
@ApiModelProperty @ApiModelProperty
private String name; private String name;
......
...@@ -165,4 +165,6 @@ public interface SysUserMapper ...@@ -165,4 +165,6 @@ public interface SysUserMapper
List<SysUserVO> getInspection(); List<SysUserVO> getInspection();
List<SysUser> selectUserListByIdsNew(@Param("ids") List<Long> ids); List<SysUser> selectUserListByIdsNew(@Param("ids") List<Long> ids);
List<SysUser> selectUserListNew(SysUser user);
} }
...@@ -80,6 +80,9 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -80,6 +80,9 @@ public class SysUserServiceImpl implements ISysUserService
@DataScope(deptAlias = "d", userAlias = "u") @DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectUserList(SysUser user) public List<SysUser> selectUserList(SysUser user)
{ {
if(user.getDeptId() == 100){
return userMapper.selectUserListNew(user);
}
return userMapper.selectUserList(user); return userMapper.selectUserList(user);
} }
......
...@@ -268,5 +268,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -268,5 +268,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where sr.role_id IN (106, 112) where sr.role_id IN (106, 112)
and u.del_flag = '0' and u.del_flag = '0'
</select> </select>
<select id="selectUserListNew" resultType="com.ruoyi.common.core.domain.entity.SysUser">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
</if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<!--<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
</if>-->
</select>
</mapper> </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