Commit 02909d6a authored by wdy's avatar wdy

查看任务详情人员状态回显

parent d25ab3f7
package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -19,6 +20,10 @@ import lombok.experimental.Accessors;
@Data
public class TaskUserRelation {
// 用户状态禁用
@TableField(exist = false)
public static final String USER_STATUS_PROHIBIT = "1";
/**
* 任务id
*/
......@@ -52,4 +57,8 @@ public class TaskUserRelation {
@ApiModelProperty("部门名称")
private String deptName;
@TableField(exist = false)
@ApiModelProperty("用户状态")
private String status;
}
......@@ -23,6 +23,9 @@ public interface TaskUserRelationMapper extends BaseMapper<TaskUserRelation> {
*/
List<TaskUserRelation> selectQTeamMembers(@Param("taskId") Long taskId);
// 根据小组成员id列表查询状态
List<TaskUserRelation> findByIdList(@Param("idList") List<TaskUserRelation> idList);
}
......
......@@ -104,6 +104,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
@Autowired
private ModelTestTaskMapper modelTestTaskMapper;
@Autowired
private TaskUserRelationMapper taskUserRelationMapper;
@Override
public List<Task> findList(TaskListRequest request) {
return taskMapper.findList(request);
......@@ -992,6 +995,21 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(id);
// 小组成员状态
List<TaskUserRelation> relationList = taskUserRelationMapper.findByIdList(relation);
for ( TaskUserRelation userRelation : relationList) {
for (TaskUserRelation taskUserRelation : relation) {
if (Objects.equals(userRelation.getUserId(), taskUserRelation.getUserId())) {
taskUserRelation.setStatus(userRelation.getStatus());
// 如果检验员状态为1,则显示已停用
if (Objects.equals(userRelation.getStatus(), TaskUserRelation.USER_STATUS_PROHIBIT)) {
taskUserRelation.setName(taskUserRelation.getName() + "(已停用)");
}
}
}
}
return relation;
}
......
......@@ -23,4 +23,13 @@
task_id = #{taskId}
</if>
</select>
<select id="findByIdList" resultType="com.ruoyi.domain.TaskUserRelation">
select user_id as userId,
status
from sys_user
WHERE sys_user.user_id IN
<foreach item="item" collection="idList" open="(" separator="," close=")">
#{item.userId}
</foreach>
</select>
</mapper>
\ No newline at end of file
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