Commit 50cafe26 authored by W_Y's avatar W_Y

任务&用户映射关系(审查组列表)添加部门名称&任务表删除bizinfo字段

parent 6ef54046
......@@ -106,12 +106,6 @@ public class CarReviewTask implements Serializable {
@TableField(value="standard", typeHandler = StandardJsonTypeHandler. class)
private List<ReviewStandard> standard;
/**
* 占位(开发人员根据具体业务自行增加业务字段)
*/
@ApiModelProperty("占位(开发人员根据具体业务自行增加业务字段)")
private String bizInfo;
/**
* 创建时间
*/
......
......@@ -91,12 +91,6 @@ public class SystemReviewTask {
@TableField(value="standard", typeHandler = StandardJsonTypeHandler. class)
private List<ReviewStandard> standard;
/**
* 占位(开发人员根据具体业务自行增加业务字段)
*/
@ApiModelProperty("占位(开发人员根据具体业务自行增加业务字段)")
private String bizInfo;
/**
* 审核组长id
*/
......
......@@ -14,10 +14,10 @@ import lombok.experimental.Accessors;
* @TableName t_review_task_user_relation
*/
@ApiModel
@TableName(value ="t_review_task_user_relation")
@TableName(value ="t_task_user_relation")
@Accessors(chain = true)
@Data
public class ReviewTaskUserRelation {
public class TaskUserRelation {
/**
* 任务id
......@@ -46,4 +46,10 @@ public class ReviewTaskUserRelation {
@ApiModelProperty("用户姓名")
private String name;
/**
* 部门名称
*/
@ApiModelProperty("部门名称")
private String deptName;
}
package com.ruoyi.mapper;
import com.ruoyi.domain.ReviewTaskUserRelation;
import com.ruoyi.domain.TaskUserRelation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -14,14 +14,14 @@ import java.util.List;
* @Entity com.ruoyi.domain.SystemReviewTaskUserRelation
*/
@Repository
public interface ReviewTaskUserRelationMapper extends BaseMapper<ReviewTaskUserRelation> {
public interface ReviewTaskUserRelationMapper extends BaseMapper<TaskUserRelation> {
/**
* 根据任务id查询小组成员
* @param taskId
* @return
*/
List<ReviewTaskUserRelation> selectQTeamMembers(@Param("taskId") Long taskId);
List<TaskUserRelation> selectQTeamMembers(@Param("taskId") Long taskId);
}
......
package com.ruoyi.service;
import com.ruoyi.domain.ReviewTaskUserRelation;
import com.ruoyi.domain.TaskUserRelation;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -11,13 +10,13 @@ import java.util.List;
* @description 针对表【t_system_review_task_user_relation(体系审查任务&用户映射关系)】的数据库操作Service
* @createDate 2023-12-15 10:41:16
*/
public interface ReviewTaskUserRelationService extends IService<ReviewTaskUserRelation> {
public interface ReviewTaskUserRelationService extends IService<TaskUserRelation> {
/**
* 根据任务id查询小组成员
* @param taskId
* @return
*/
List<ReviewTaskUserRelation> selectQTeamMembers(Long taskId);
List<TaskUserRelation> selectQTeamMembers(Long taskId);
}
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.domain.*;
......@@ -18,7 +16,6 @@ import com.ruoyi.web.request.CarReviewTaskCreateRequest;
import com.ruoyi.web.request.CarReviewTaskStartRequest;
import com.ruoyi.web.request.CarReviewTaskSubmitRequest;
import com.ruoyi.web.response.CarReviewTaskViewResponse;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -71,9 +68,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
Standard standard = standardService.findListById(request.getStandardId());
// 找到审查组长
ReviewTaskUserRelation leader = null;
List<ReviewTaskUserRelation> auditors = request.getAuditors();
for(ReviewTaskUserRelation auditor : auditors) {
TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) {
leader = auditor;
break;
......@@ -86,7 +83,6 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
.setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(CarReviewTask.TASK_STATUS_PENDING)
.setBizInfo(request.getBizInfo())
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
.setCreateTime(new Date())
......@@ -111,7 +107,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
// 构建并保存该任务所关联的审核组信息
for(ReviewTaskUserRelation auditor : auditors) {
for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId());
}
relationService.saveBatch(auditors);
......
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.ReviewTaskUserRelation;
import com.ruoyi.domain.TaskUserRelation;
import com.ruoyi.service.ReviewTaskUserRelationService;
import com.ruoyi.mapper.ReviewTaskUserRelationMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -16,7 +15,7 @@ import java.util.List;
* @createDate 2023-12-15 10:41:16
*/
@Service
public class ReviewTaskUserRelationServiceImpl extends ServiceImpl<ReviewTaskUserRelationMapper, ReviewTaskUserRelation>
public class ReviewTaskUserRelationServiceImpl extends ServiceImpl<ReviewTaskUserRelationMapper, TaskUserRelation>
implements ReviewTaskUserRelationService {
@Autowired
......@@ -28,7 +27,7 @@ public class ReviewTaskUserRelationServiceImpl extends ServiceImpl<ReviewTaskUse
* @return
*/
@Override
public List<ReviewTaskUserRelation> selectQTeamMembers(Long taskId){
public List<TaskUserRelation> selectQTeamMembers(Long taskId){
return reviewTaskUserRelationMapper.selectQTeamMembers(taskId);
}
......
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.domain.*;
......@@ -62,9 +60,9 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
Standard standard = standardService.findListById(request.getStandardId());
// 找到审查组长
ReviewTaskUserRelation leader = null;
List<ReviewTaskUserRelation> auditors = request.getAuditors();
for(ReviewTaskUserRelation auditor : auditors) {
TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) {
leader = auditor;
break;
......@@ -77,7 +75,6 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
.setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(SystemReviewTask.STATUS_NEW)
.setBizInfo(request.getBizInfo())
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
.setCreateTime(new Date())
......@@ -90,7 +87,7 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
// 构建并保存该任务所关联的审核组信息
for(ReviewTaskUserRelation auditor : auditors) {
for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId());
}
systemReviewTaskUserRelationService.saveBatch(auditors);
......
......@@ -3,7 +3,7 @@ package com.ruoyi.web;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.domain.ReviewTaskUserRelation;
import com.ruoyi.domain.TaskUserRelation;
import com.ruoyi.service.ReviewTaskUserRelationService;
import com.ruoyi.web.request.ReviewTaskUserRelationMembersRequest;
import io.swagger.annotations.Api;
......@@ -35,8 +35,8 @@ public class ReviewTaskUserRelationController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/members")
public R<List<ReviewTaskUserRelation>> selectQTeamMemberList(@Validated @RequestBody ReviewTaskUserRelationMembersRequest request){
List<ReviewTaskUserRelation> list = reviewTaskUserRelationService.selectQTeamMembers(request.getTaskId());
public R<List<TaskUserRelation>> selectQTeamMemberList(@Validated @RequestBody ReviewTaskUserRelationMembersRequest request){
List<TaskUserRelation> list = reviewTaskUserRelationService.selectQTeamMembers(request.getTaskId());
return R.ok(list);
}
......
package com.ruoyi.web.request;
import com.ruoyi.domain.ReviewTaskUserRelation;
import com.ruoyi.domain.TaskUserRelation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -11,11 +11,8 @@ import java.util.List;
@Data
public class CarReviewTaskCreateRequest {
@ApiModelProperty("占位")
private String bizInfo;
@ApiModelProperty("小组信息")
private List<ReviewTaskUserRelation> auditors;
private List<TaskUserRelation> auditors;
/**
* 是否创建车型问卷审查任务
......
package com.ruoyi.web.request;
import com.ruoyi.domain.ReviewTaskUserRelation;
import com.ruoyi.domain.TaskUserRelation;
import lombok.Data;
import java.util.List;
......@@ -8,9 +8,7 @@ import java.util.List;
@Data
public class SystemReviewTaskCreateRequest {
private String bizInfo;
private List<ReviewTaskUserRelation> auditors;
private List<TaskUserRelation> auditors;
/**
* 标准id
......
......@@ -14,7 +14,6 @@
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
<result property="standard" column="standard" typeHandler="com.ruoyi.common.StandardJsonTypeHandler"/>
<result property="bizInfo" column="biz_info" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="leaderId" column="leader_id" jdbcType="BIGINT"/>
<result property="leader" column="leader" jdbcType="VARCHAR"/>
......@@ -35,7 +34,7 @@
id,task_no,task_status,
task_initiator,task_initiator_dept,task_result,
task_begin_time,task_end_time,standard,
biz_info,create_time,leader_id,
create_time,leader_id,
leader,standard_id,name,
standard_no,file,review_status,
test_status,review_start_time,
......@@ -45,11 +44,11 @@
review_result
</sql>
<select id="findListByReviewStatus" resultType="com.ruoyi.domain.CarReviewTask">
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,biz_info,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result
FROM t_car_review_task WHERE review_status = #{reviewStatus} AND task_status = 'PENDING'
</select>
<select id="findListByTaskStatus" resultType="com.ruoyi.domain.CarReviewTask">
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,biz_info,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result
FROM t_car_review_task WHERE task_status = #{taskStatus}
</select>
</mapper>
......@@ -4,15 +4,16 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.ReviewTaskUserRelationMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.ReviewTaskUserRelation">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.TaskUserRelation">
<result property="taskId" column="task_id" jdbcType="BIGINT"/>
<result property="userId" column="user_id" jdbcType="BIGINT"/>
<result property="isLeader" column="is_leader" jdbcType="TINYINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
task_id,user_id,is_leader,name
task_id,user_id,is_leader,name,dept_name
</sql>
<select id="selectQTeamMembers" parameterType="Long" resultMap="BaseResultMap">
......
......@@ -14,7 +14,6 @@
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
<result property="standard" column="standard" typeHandler="com.ruoyi.common.StandardJsonTypeHandler"/>
<result property="bizInfo" column="biz_info" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="standardId" column="standard_id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
......@@ -25,13 +24,13 @@
</resultMap>
<select id="findListByStatus" resultMap="BaseResultMap">
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file, submit_by_id, submit_by_name
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, create_time, standard_id, name, standard_no, file, submit_by_id, submit_by_name
FROM t_system_review_task WHERE task_status = #{status}
ORDER BY create_time DESC
</select>
<select id="findListInProcess" resultMap="BaseResultMap">
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file, submit_by_id, submit_by_name
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, create_time, standard_id, name, standard_no, file, submit_by_id, submit_by_name
FROM t_system_review_task WHERE task_status IN ('NEW','PENDING')
ORDER BY create_time DESC
</select>
......
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