Commit 4de9ba8b authored by wdy's avatar wdy

查看表单填写人名称-71071

parent f63666b8
...@@ -3,6 +3,7 @@ package com.ruoyi.mapper; ...@@ -3,6 +3,7 @@ package com.ruoyi.mapper;
import com.ruoyi.domain.ReviewDetails; import com.ruoyi.domain.ReviewDetails;
import com.ruoyi.domain.ReviewDetailsResult; import com.ruoyi.domain.ReviewDetailsResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.web.response.UserNameResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -33,6 +34,8 @@ public interface ReviewDetailsResultMapper extends BaseMapper<ReviewDetailsResul ...@@ -33,6 +34,8 @@ public interface ReviewDetailsResultMapper extends BaseMapper<ReviewDetailsResul
// 根据细则id查询结果 // 根据细则id查询结果
List<ReviewDetailsResult> findByDetailsId(@Param("detailsId") Long detailsId); List<ReviewDetailsResult> findByDetailsId(@Param("detailsId") Long detailsId);
List<UserNameResponse> findByResultList(@Param("resultList") List<ReviewDetailsResult> resultList);
} }
......
...@@ -8,6 +8,7 @@ import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO; ...@@ -8,6 +8,7 @@ import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import com.ruoyi.mapper.*; import com.ruoyi.mapper.*;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.web.response.CarReviewTaskViewResponse; import com.ruoyi.web.response.CarReviewTaskViewResponse;
import com.ruoyi.web.response.UserNameResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
...@@ -164,6 +165,21 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -164,6 +165,21 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
private void setDetailsResult(List<ReviewStandard> standards, List<ReviewDetailsResult> results, CarReviewTask carReviewTask) { private void setDetailsResult(List<ReviewStandard> standards, List<ReviewDetailsResult> results, CarReviewTask carReviewTask) {
if (results != null && results.size() != 0) {
// 小组成员姓名、部门
List<UserNameResponse> userList = reviewDetailsResultMapper.findByResultList(results);
for (UserNameResponse response : userList) {
for (ReviewDetailsResult result : results) {
if (Objects.equals(result.getUserId(), response.getUserId())) {
result.setUserName(response.getName());
}
}
}
reviewDetailsResultService.updateBatchById(results);
}
Map<Long, ReviewDetailsResult> resultMap = results.stream().collect(Collectors.toMap(ReviewDetailsResult::getReviewDetailsId, Function.identity(), (v1, v2) -> v1)); Map<Long, ReviewDetailsResult> resultMap = results.stream().collect(Collectors.toMap(ReviewDetailsResult::getReviewDetailsId, Function.identity(), (v1, v2) -> v1));
for(ReviewStandard standard : standards) { for(ReviewStandard standard : standards) {
......
...@@ -8,6 +8,7 @@ import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO; ...@@ -8,6 +8,7 @@ import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import com.ruoyi.mapper.*; import com.ruoyi.mapper.*;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.web.response.SystemReviewTaskViewResponse; import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import com.ruoyi.web.response.UserNameResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
...@@ -160,6 +161,21 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -160,6 +161,21 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
private void setDetailsResult(List<ReviewStandard> standards, List<ReviewDetailsResult> results,SystemReviewTask systemReviewTask) { private void setDetailsResult(List<ReviewStandard> standards, List<ReviewDetailsResult> results,SystemReviewTask systemReviewTask) {
if (results != null && results.size() != 0) {
// 小组成员姓名、部门
List<UserNameResponse> userList = reviewDetailsResultMapper.findByResultList(results);
for (UserNameResponse response : userList) {
for (ReviewDetailsResult result : results) {
if (Objects.equals(result.getUserId(), response.getUserId())) {
result.setUserName(response.getName());
}
}
}
reviewDetailsResultService.updateBatchById(results);
}
Map<Long, ReviewDetailsResult> resultMap = results.stream().collect(Collectors.toMap(ReviewDetailsResult::getReviewDetailsId, Function.identity(), (v1, v2) -> v1)); Map<Long, ReviewDetailsResult> resultMap = results.stream().collect(Collectors.toMap(ReviewDetailsResult::getReviewDetailsId, Function.identity(), (v1, v2) -> v1));
for(ReviewStandard standard : standards) { for(ReviewStandard standard : standards) {
......
...@@ -54,5 +54,14 @@ ...@@ -54,5 +54,14 @@
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id, file_name SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id, file_name
FROM t_review_details_result WHERE review_details_id = #{detailsId} FROM t_review_details_result WHERE review_details_id = #{detailsId}
</select> </select>
<select id="findByResultList" resultType="com.ruoyi.web.response.UserNameResponse">
SELECT s.user_id userId, s.nick_name name, sd.dept_name deptName
FROM sys_user s
LEFT JOIN sys_dept sd ON s.dept_id = sd.dept_id
WHERE s.user_id IN
<foreach item="item" collection="resultList" open="(" separator="," close=")">
#{item.userId}
</foreach>
</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