Commit 2e13c43f authored by 宋源硕's avatar 宋源硕

Merge branch 'songyuanshuo' into 'dev'

评审人员字段增加

See merge request !419
parents a40f69eb a8900a3c
......@@ -215,4 +215,8 @@ public class ReviewSceneChangeTask {
@ApiModelProperty(value = "审查场景id", notes = "1.若为修改、删除任务时,此id在创建任务时赋值; 2.若为新增任务时,此id在审批通过并保存新场景后赋值 ")
private Long reviewSceneId;
@ApiModelProperty("评审人员")
@TableField(exist = false)
private String reviewer;
}
......@@ -44,6 +44,10 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang
*/
List<ReviewSceneChangeTask> findCreateListByUserId(@Param("userId") Long userId, @Param("request") ReviewSceneChangeTaskFindCreateRequest request);
/*
* 根据id查询任务详细信息
* */
ReviewSceneChangeTask findSceneChangeTaskById(@Param("id") Long id);
}
......
......@@ -77,4 +77,5 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
*/
List<ReviewSceneChangeTask> findCreateListByUserId(Long userId, ReviewSceneChangeTaskFindCreateRequest request);
ReviewSceneChangeTask getBySceneChangeTaskId(Long id);
}
......@@ -97,7 +97,6 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
carReviewTaskService.save(task);
// 构建并保存该任务所关联的审核组信息
for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId());
......@@ -124,14 +123,12 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override
public void confirmReviewTask(CarReviewTaskConfirmRequest request) {
CarReviewTask carReviewTask = carReviewTaskService.getById(request.getTaskId());
strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doConfirmReview(carReviewTask);
}
@Override
public void submitReviewTask(CarReviewTaskSubmitRequest request) {
CarReviewTask carReviewTask = carReviewTaskService.getById(request.getTaskId());
strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doSubmitReview(carReviewTask,request.getImagesUrl(),request.getTestScenarioList());
}
......@@ -140,7 +137,6 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
public List<CarReviewTask> findListByStatus(String status) {
return carReviewTaskMapper.findListByTaskStatus(status);
}
}
......
......@@ -135,7 +135,6 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
ps.close();
bos.close();
reader.close();
// 把第一个模板填入数据后生成一个oss
String templateName = uploadMinio(bos, "整车信息安全检验临时模板");
// 创建一个空PDF, 融合两个PDF
......
......@@ -7,11 +7,13 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.domain.ReviewSceneChangeTaskUserRelation;
import com.ruoyi.framework.web.domain.server.Sys;
import com.ruoyi.service.ReviewSceneChangeTaskService;
import com.ruoyi.mapper.ReviewSceneChangeTaskMapper;
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.ISysUserService;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
......@@ -22,10 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
/**
* @author wangfei
......@@ -54,6 +53,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired
private ReviewSceneChangeTaskMapper reviewSceneChangeTaskMapper;
@Autowired
private SysUserRoleMapper sysUserRoleMapper;
@Override
public void create(ReviewSceneChangeTask reviewSceneChangeTask) {
......@@ -68,6 +70,10 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
.setTaskStatus(ReviewSceneChangeTask.STATUS_PENDING)
.setTaskBeginTime(new Date());
//获取operationSort设置operation
String[] operationSortPart = reviewSceneChangeTask.getOperationSort().split("_");
reviewSceneChangeTask.setOperation(operationSortPart[0]);
// 保存任务
save(reviewSceneChangeTask);
......@@ -80,7 +86,6 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
.setUserId(sysUser.getUserId())
.setName(sysUser.getNickName())
.setDept(sysUser.getDept().getDeptName());
relations.add(relation);
}
......@@ -216,6 +221,20 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Override
public List<ReviewSceneChangeTaskResponse> findPendingListByUserId(Long userId, ReviewSceneChangeTaskFindPendingRequest request) {
List<ReviewSceneChangeTaskResponse> reviewSceneChangeTask = reviewSceneChangeTaskMapper.findPendingListByUserId(userId,request);
//查询审核人员
List<Long> reviewerIdList = sysUserRoleMapper.selectReviewerIdByRoleId(103L);
List<SysUser> reviewerList = sysUserService.selectUserListByIds(reviewerIdList);
Set<String> reviewerNameSet = new HashSet<>();
for (SysUser reviewer : reviewerList){
reviewerNameSet.add(reviewer.getNickName());
}
//生成审核人员名字字符串
String reviewerNames = String.join("、", reviewerNameSet);
for (ReviewSceneChangeTaskResponse taskResponse : reviewSceneChangeTask){
taskResponse.setReviewer(reviewerNames);
}
return reviewSceneChangeTask;
}
......@@ -227,6 +246,19 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Override
public List<ReviewSceneChangeTaskResponse> findFinishListByUserId(Long userId, ReviewSceneChangeTaskFindFinishRequest request) {
List<ReviewSceneChangeTaskResponse> reviewSceneChangeTask = reviewSceneChangeTaskMapper.findFinishListByUserId(userId,request);
//查询审核人员
List<Long> reviewerIdList = sysUserRoleMapper.selectReviewerIdByRoleId(103L);
List<SysUser> reviewerList = sysUserService.selectUserListByIds(reviewerIdList);
Set<String> reviewerNameSet = new HashSet<>();
for (SysUser reviewer : reviewerList){
reviewerNameSet.add(reviewer.getNickName());
}
//生成审核人员名字字符串
String reviewerNames = String.join("、", reviewerNameSet);
for (ReviewSceneChangeTaskResponse taskResponse: reviewSceneChangeTask){
taskResponse.setReviewer(reviewerNames);
}
return reviewSceneChangeTask;
}
......@@ -238,6 +270,39 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Override
public List<ReviewSceneChangeTask> findCreateListByUserId(Long userId, ReviewSceneChangeTaskFindCreateRequest request) {
List<ReviewSceneChangeTask> reviewSceneChangeTask = reviewSceneChangeTaskMapper.findCreateListByUserId(userId,request);
//查询审核人员
List<Long> reviewerIdList = sysUserRoleMapper.selectReviewerIdByRoleId(103L);
List<SysUser> reviewerList = sysUserService.selectUserListByIds(reviewerIdList);
Set<String> reviewerNameSet = new HashSet<>();
for (SysUser reviewer : reviewerList) {
reviewerNameSet.add(reviewer.getNickName());
}
// 生成审核人员名字字符串
String reviewerNames = String.join("、", reviewerNameSet);
for(ReviewSceneChangeTask task : reviewSceneChangeTask){
task.setReviewer(reviewerNames);
}
return reviewSceneChangeTask;
}
@Override
public ReviewSceneChangeTask getBySceneChangeTaskId(Long id) {
ReviewSceneChangeTask reviewSceneChangeTask = reviewSceneChangeTaskMapper.findSceneChangeTaskById(id);
//查询审核人员
List<Long> reviewerIdList = sysUserRoleMapper.selectReviewerIdByRoleId(103L);
List<SysUser> reviewerList = sysUserService.selectUserListByIds(reviewerIdList);
Set<String> reviewerNameSet = new HashSet<>();
for (SysUser reviewer : reviewerList) {
reviewerNameSet.add(reviewer.getNickName());
}
// 生成审核人员名字字符串
String reviewerNames = String.join("、", reviewerNameSet);
reviewSceneChangeTask.setReviewer(reviewerNames);
return reviewSceneChangeTask;
}
......
......@@ -108,7 +108,7 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
@Override
public void start(Long id) {
SystemReviewTask systemReviewTask = systemReviewTaskService.getById(id);
strategySystemReviewTaskContext.getResource(systemReviewTask.getTaskStatus()).doStart(systemReviewTask);
strategySystemReviewTaskContext.getResource(systemReviewTask.getTaskStatus()).doStart(systemReviewTask);
}
@Override
......
......@@ -153,6 +153,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser();
//根据Id查询当前用户是否拥有暂存任务
TaskGetInfoResponse temporaryStorageTask = taskService.getByUserId(loginUser.getUserId());
if(temporaryStorageTask != null) {
taskMapper.deleteById(temporaryStorageTask.getId());
......@@ -408,7 +409,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
if (fileList != null && fileList.size() != 0) {
taskFileRelationService.removeBatchByIds(fileList);
}
taskMapper.deleteById(request.getId());
}
......@@ -458,7 +458,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
}
}
return responses;
}
......
......@@ -39,8 +39,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
ReviewSceneChangeTask reviewSceneChangeTask = new ReviewSceneChangeTask();
BeanUtils.copyBeanProp(reviewSceneChangeTask, request);
reviewSceneChangeTask.setOperationSort(request.getOperation()+"_"+request.getSort());
/*reviewSceneChangeTask.setOperationSort(request.getOperation()+"_"+request.getSort());*/
reviewSceneChangeTaskService.create(reviewSceneChangeTask);
return R.ok();
......@@ -52,7 +51,6 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Log(title = "审核任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/audit")
public R<String> audit(@Validated @RequestBody ReviewSceneChangeTaskPassRequest request) {
reviewSceneChangeTaskService.audit(request);
return R.ok();
}
......@@ -87,7 +85,8 @@ public class ReviewSceneChangeTaskController extends BaseController {
* 查询当前用户发布的任务
* @return
*/
@ApiOperation("查询当前用户发布的任务")
/*@ApiOperation("查询当前用户发布的任务")*/
@ApiOperation("用户-评审管理-我发起的评审")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findCreate")
......@@ -101,7 +100,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<ReviewSceneChangeTask> getInfo(@Validated @RequestBody ReviewSceneChangeTaskGetInfoRequest request) {
return R.ok(reviewSceneChangeTaskService.getById(request.getId()));
return R.ok(reviewSceneChangeTaskService.getBySceneChangeTaskId(request.getId()));
}
}
......@@ -102,7 +102,6 @@ public class SystemReviewTaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/exportPDF")
public R<SystemReviewTaskExportPDFResponse> exportPDF() {
return null;
}
}
......@@ -78,7 +78,6 @@ public class TaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getTemporaryStorage")
public R<TaskGetInfoResponse> getTemporaryStorage() {
TaskGetInfoResponse response = taskService.getByUserId(getUserId());
return R.ok(response);
}
......@@ -108,7 +107,6 @@ public class TaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findCreate")
public TableDataInfo<TaskFindResponse> findCreate(@Validated @RequestBody TaskFindRequest request) {
startPage(request);
return getDataTable(taskService.findCreate(request,getUserId()));
}
......@@ -186,7 +184,6 @@ public class TaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/dataStatistics")
public R<DataStatisticsResponse> dataStatistics(@Validated @RequestBody TaskGetInfoRequest request) {
DataStatisticsResponse response = taskService.dataStatistics(request);
return R.ok(response);
}
......
......@@ -65,11 +65,17 @@ public class ReviewSceneChangeTaskCreateRequest {
/**
* 操作(ADD DELETE UPDATE)
*/
@ApiModelProperty(value = "操作" , notes = "[ADD DELETE UPDATE]")
private String operation;
@ApiModelProperty(value = "分类" , notes = "[KEYPOINT DETAILS SCENE]")
private String sort;
// @ApiModelProperty(value = "操作" , notes = "[ADD DELETE UPDATE]")
// private String operation;
//
// @ApiModelProperty(value = "分类" , notes = "[KEYPOINT DETAILS SCENE]")
// private String sort;
/*
* 评审类型
* */
@ApiModelProperty("评审类型")
private String operationSort;
/**
* 当 operation 为 ADD 时该字段为空
......
package com.ruoyi.web.response;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -161,4 +162,8 @@ public class ReviewSceneChangeTaskResponse {
*/
@ApiModelProperty("本人审核意见(PASS、REJECT)")
private String decision;
@ApiModelProperty("评审人员")
@TableField(exist = false)
private String reviewer;
}
......@@ -111,5 +111,8 @@
and inspect_standard_id = #{request.inspectStandardId}
</if>
</select>
<select id="findSceneChangeTaskById" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
select * from t_review_scene_change_task where id = #{id}
</select>
</mapper>
......@@ -6,14 +6,14 @@ import com.ruoyi.system.domain.SysUserRole;
/**
* 用户与角色关联表 数据层
*
*
* @author ruoyi
*/
public interface SysUserRoleMapper
{
/**
* 通过用户ID删除用户和角色关联
*
*
* @param userId 用户ID
* @return 结果
*/
......@@ -21,7 +21,7 @@ public interface SysUserRoleMapper
/**
* 批量删除用户和角色关联
*
*
* @param ids 需要删除的数据ID
* @return 结果
*/
......@@ -29,7 +29,7 @@ public interface SysUserRoleMapper
/**
* 通过角色ID查询角色使用数量
*
*
* @param roleId 角色ID
* @return 结果
*/
......@@ -37,7 +37,7 @@ public interface SysUserRoleMapper
/**
* 批量新增用户角色信息
*
*
* @param userRoleList 用户角色列表
* @return 结果
*/
......@@ -45,7 +45,7 @@ public interface SysUserRoleMapper
/**
* 删除用户和角色关联信息
*
*
* @param userRole 用户和角色关联信息
* @return 结果
*/
......@@ -53,10 +53,15 @@ public interface SysUserRoleMapper
/**
* 批量取消授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要删除的用户数据ID
* @return 结果
*/
public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds);
/*
*根据roleId查询审核员Id
* */
List<Long> selectReviewerIdByRoleId(Long roleId);
}
......@@ -12,33 +12,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteUserRoleByUserId" parameterType="Long">
delete from sys_user_role where user_id=#{userId}
</delete>
<select id="countUserRoleByRoleId" resultType="Integer">
select count(1) from sys_user_role where role_id=#{roleId}
select count(1) from sys_user_role where role_id=#{roleId}
</select>
<select id="selectReviewerIdByRoleId" resultType="java.lang.Long">
select user_id from sys_user_role where role_id = #{roleId}
</select>
<delete id="deleteUserRole" parameterType="Long">
<delete id="deleteUserRole" parameterType="Long">
delete from sys_user_role where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</foreach>
</delete>
<insert id="batchUserRole">
insert into sys_user_role(user_id, role_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
</delete>
<delete id="deleteUserRoleInfos">
delete from sys_user_role where role_id=#{roleId} and user_id in
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</foreach>
</delete>
</mapper>
\ No newline at end of file
</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