Commit e9b4f431 authored by yuanshuo's avatar yuanshuo

2024/11/27新增和修改方法

获取用户暂存任务时 新增获取字段enterpriseId和enterpriseName
更改获取任务Leader相关逻辑代码,获取前端传过来的用户第一个isLeader属性是1的
给审查标准、要点、细则、场景加deleted字段
parent e0c90a67
...@@ -89,4 +89,7 @@ public class ReviewDetails { ...@@ -89,4 +89,7 @@ public class ReviewDetails {
@TableField(exist = false) @TableField(exist = false)
private String reviewKeypointText; private String reviewKeypointText;
@ApiModelProperty("逻辑删除")
private Integer deleted;
} }
...@@ -55,5 +55,8 @@ public class ReviewKeyPoint { ...@@ -55,5 +55,8 @@ public class ReviewKeyPoint {
@TableField(exist = false) @TableField(exist = false)
private List<ReviewDetails> reviewDetailsList; private List<ReviewDetails> reviewDetailsList;
@ApiModelProperty("逻辑删除")
private Integer deleted;
} }
...@@ -45,4 +45,7 @@ public class ReviewScene { ...@@ -45,4 +45,7 @@ public class ReviewScene {
@ApiModelProperty("审查细则id") @ApiModelProperty("审查细则id")
private Long reviewDetailsId; private Long reviewDetailsId;
@ApiModelProperty("逻辑删除")
private Integer deleted;
} }
...@@ -117,4 +117,7 @@ public class ReviewStandard { ...@@ -117,4 +117,7 @@ public class ReviewStandard {
@ApiModelProperty("不符合") @ApiModelProperty("不符合")
private String inconformity; private String inconformity;
@ApiModelProperty("逻辑删除")
private Integer deleted;
} }
...@@ -200,13 +200,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -200,13 +200,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
TaskUserRelation leader = null; TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors(); List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
List<Long> roleIdList = sysUserRoleMapper.selectRoleIdByUserId(auditor.getUserId()); if(auditor.getIsLeader() == 1){
for (Long roleId : roleIdList){ leader = auditor;
if (roleId.equals(112L)){
leader = auditor;
auditor.setIsLeader(1);
break;
}
} }
if (leader != null){ if (leader != null){
break; break;
...@@ -345,13 +340,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -345,13 +340,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
TaskUserRelation leader = null; TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors(); List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
List<Long> roleIdList = sysUserRoleMapper.selectRoleIdByUserId(auditor.getUserId()); if(auditor.getIsLeader() ==1){
for (Long roleId : roleIdList){ leader = auditor;
if (roleId.equals(112L)){
leader = auditor;
auditor.setIsLeader(1);
break;
}
} }
if (leader != null){ if (leader != null){
break; break;
...@@ -616,13 +606,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -616,13 +606,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
TaskUserRelation leader = null; TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors(); List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
List<Long> roleIdList = sysUserRoleMapper.selectRoleIdByUserId(auditor.getUserId()); if(auditor.getIsLeader() == 1){
for (Long roleId : roleIdList){ leader = auditor;
if (roleId.equals(112L)){
leader = auditor;
auditor.setIsLeader(1);
break;
}
} }
if (leader != null){ if (leader != null){
task.setLeaderId(leader.getUserId()); task.setLeaderId(leader.getUserId());
...@@ -698,13 +683,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -698,13 +683,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
TaskUserRelation leader = null; TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors(); List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
List<Long> roleIdList = sysUserRoleMapper.selectRoleIdByUserId(auditor.getUserId()); if(auditor.getIsLeader() == 1){
for (Long roleId : roleIdList){ leader = auditor;
if (roleId.equals(112L)){
leader = auditor;
auditor.setIsLeader(1);
break;
}
} }
if (leader != null){ if (leader != null){
task.setLeaderId(leader.getUserId()); task.setLeaderId(leader.getUserId());
...@@ -765,7 +745,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -765,7 +745,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// String taskList = response.getTaskList().substring(1); // String taskList = response.getTaskList().substring(1);
// response.setTaskList(taskList); // response.setTaskList(taskList);
// } // }
response.setEnterpriseName(task.getEnterpriseName());
response.setEnterpriseId(String.valueOf(task.getEnterpriseId()));
// 小组成员 // 小组成员
response.setAuditors(setAuditors(task.getId())); response.setAuditors(setAuditors(task.getId()));
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<foreach collection="reviewKeyPointList" item="keyPoint" open="(" separator="," close=")"> <foreach collection="reviewKeyPointList" item="keyPoint" open="(" separator="," close=")">
#{keyPoint.id} #{keyPoint.id}
</foreach> </foreach>
AND deleted != 1
</select> </select>
<select id="findNoResult" resultType="com.ruoyi.domain.ReviewDetails"> <select id="findNoResult" resultType="com.ruoyi.domain.ReviewDetails">
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<foreach collection="reviewStandardList" item="standard" open="(" separator="," close=")"> <foreach collection="reviewStandardList" item="standard" open="(" separator="," close=")">
#{standard.id} #{standard.id}
</foreach> </foreach>
AND deleted != 1
</select> </select>
<select id="findKeyPointList" resultType="com.ruoyi.domain.ReviewKeyPoint"> <select id="findKeyPointList" resultType="com.ruoyi.domain.ReviewKeyPoint">
SELECT id, text, review_standard_id FROM t_review_keypoint SELECT id, text, review_standard_id FROM t_review_keypoint
......
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
</select> </select>
<select id="findListByStandardIdAndType" resultType="com.ruoyi.domain.ReviewStandard"> <select id="findListByStandardIdAndType" resultType="com.ruoyi.domain.ReviewStandard">
SELECT id, type, chapter, text, standard_id, name, standard_no, file, conformity, inconformity FROM t_review_standard WHERE standard_id = #{standardId} AND type = #{type}; SELECT id, type, chapter, text, standard_id, name, standard_no, file, conformity, inconformity
FROM t_review_standard
WHERE standard_id = #{standardId} AND type = #{type} AND deleted != 1;
</select> </select>
<select id="selectReviewStandardList" parameterType="com.ruoyi.web.request.ReviewStandardListByPageRequest" resultType="com.ruoyi.web.response.ReviewStandardResponse"> <select id="selectReviewStandardList" parameterType="com.ruoyi.web.request.ReviewStandardListByPageRequest" resultType="com.ruoyi.web.response.ReviewStandardResponse">
......
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
task_initiator_id,task_initiator,task_initiator_dept, task_initiator_id,task_initiator,task_initiator_dept,
task_begin_time,task_end_time,create_time, task_begin_time,task_end_time,create_time,
leader_id,leader,standard_id,name, leader_id,leader,standard_id,name,
standard_no,file,task_list standard_no,file,task_list,enterprise_id,enterprise_name
FROM t_task FROM t_task
WHERE task_initiator_id = #{userId} and task_status = 'TEMPORARILY' WHERE task_initiator_id = #{userId} and task_status = 'TEMPORARILY'
</select> </select>
......
...@@ -634,10 +634,11 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -634,10 +634,11 @@ public class SysUserServiceImpl implements ISysUserService
sysUserVONew.setRoleId(roleId); sysUserVONew.setRoleId(roleId);
} }
// 使用Stream API进行去重,基于userId字段 // 使用Stream API进行去重,基于userId字段
/*List<SysUserVO> deduplicatedList = userList.stream() List<SysUserVONew> deduplicatedList = userList.stream()
.filter(distinctByKey(user -> user.getUserId())) .filter(distinctByKey(user -> user.getUserId()))
.collect(Collectors.toList());*/ .collect(Collectors.toList());
return userList; return deduplicatedList;
// return userList;
} }
// 辅助方法,用于去重 // 辅助方法,用于去重
......
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