Commit 02cbf7db authored by 周昊's avatar 周昊

1、开发接口获取风险评估列表

parent 7bdb2750
...@@ -102,6 +102,16 @@ public class RiskPlanAppController extends BaseController { ...@@ -102,6 +102,16 @@ public class RiskPlanAppController extends BaseController {
statusList = Arrays.asList(RiskPlanStatusType.WAIT_FINISH,RiskPlanStatusType.FINISH statusList = Arrays.asList(RiskPlanStatusType.WAIT_FINISH,RiskPlanStatusType.FINISH
,RiskPlanStatusType.WAIT_ADJUST,RiskPlanStatusType.REVOKE); ,RiskPlanStatusType.WAIT_ADJUST,RiskPlanStatusType.REVOKE);
} }
return R.ok(riskPlanService.getRiskPlanAppListDtoList(statusList,getUserId())); return R.ok(riskPlanService.getRiskPlanAppListDtoList(statusList,getUserId(),null));
}
/**
* 风险评估列表
*
* @real_return {@link R<List<RiskPlanAppListDto>>}
*/
@GetMapping("/task/list")
public R<List<RiskPlanAppListDto>> getRiskPlanAppListDtoListByLeaderUser(){
return R.ok(riskPlanService.getRiskPlanAppListDtoList(null,null,getUserId()));
} }
} }
...@@ -62,5 +62,6 @@ public interface RiskPlanMapper ...@@ -62,5 +62,6 @@ public interface RiskPlanMapper
*/ */
public int deleteRiskPlanByIds(Long[] ids); public int deleteRiskPlanByIds(Long[] ids);
List<RiskPlanAppListDto> getRiskPlanAppListDtoList(@Param("statusStringList") List<String> statusStringList, @Param("userId") Long userId); List<RiskPlanAppListDto> getRiskPlanAppListDtoList(@Param("statusStringList") List<String> statusStringList
, @Param("createUserId") Long createUserId, @Param("leaderUserId") Long leaderUserId);
} }
...@@ -64,5 +64,5 @@ public interface IRiskPlanService ...@@ -64,5 +64,5 @@ public interface IRiskPlanService
int saveRiskPlan(RiskPlan riskPlan); int saveRiskPlan(RiskPlan riskPlan);
List<RiskPlanAppListDto> getRiskPlanAppListDtoList(List<RiskPlanStatusType> statusList, Long userId); List<RiskPlanAppListDto> getRiskPlanAppListDtoList(List<RiskPlanStatusType> statusList, Long createUserId, Long leaderUserId);
} }
...@@ -131,14 +131,17 @@ public class RiskPlanServiceImpl implements IRiskPlanService { ...@@ -131,14 +131,17 @@ public class RiskPlanServiceImpl implements IRiskPlanService {
} }
@Override @Override
public List<RiskPlanAppListDto> getRiskPlanAppListDtoList(List<RiskPlanStatusType> statusList, Long userId) { public List<RiskPlanAppListDto> getRiskPlanAppListDtoList(List<RiskPlanStatusType> statusList, Long createUserId, Long leaderUserId) {
List<String> statusStringList = null;
//枚举类转化为数据库存的状态值 //枚举类转化为数据库存的状态值
List<String> statusStringList = statusList.stream() if (statusList != null) {
.map(RiskPlanStatusType::getStatus) statusStringList = statusList.stream()
.collect(Collectors.toList()); .map(RiskPlanStatusType::getStatus)
.collect(Collectors.toList());
}
//查询并把状态值转化为状态名称 //查询并把状态值转化为状态名称
return riskPlanMapper.getRiskPlanAppListDtoList(statusStringList, userId).stream().map(dto -> { return riskPlanMapper.getRiskPlanAppListDtoList(statusStringList, createUserId, leaderUserId).stream().map(dto -> {
String status = RiskPlanStatusType.getTitleByStatus(dto.getStatus()); String status = RiskPlanStatusType.getTitleByStatus(dto.getStatus());
dto.setStatus(status); dto.setStatus(status);
return dto; return dto;
......
...@@ -63,7 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -63,7 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
risk_plan rp risk_plan rp
LEFT JOIN sys_user su ON su.user_id = rp.leader_user_id LEFT JOIN sys_user su ON su.user_id = rp.leader_user_id
<where> <where>
<if test="userId != null"> and rp.create_user_id = #{userId}</if> <if test="createUserId != null"> and rp.create_user_id = #{createUserId}</if>
<if test="leaderUserId != null"> and rp.leader_user_id = #{leaderUserId}</if>
<if test="statusStringList != null and statusStringList.size >0"> <if test="statusStringList != null and statusStringList.size >0">
and rp.`status` in and rp.`status` in
<foreach collection="statusStringList" item="status" open="(" separator="," close=")"> <foreach collection="statusStringList" item="status" open="(" separator="," close=")">
......
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