Commit 3bdfe6b7 authored by 周昊's avatar 周昊

1、修改获取固有风险列表问题

2、详情接口添加字段
parent 99caf090
......@@ -312,6 +312,18 @@ public class RiskPlanAppController extends BaseController {
return R.ok(riskPlanInherentListService.getInherentListByPlanId(null, buildingId, floorId, roomId));
}
/**
* 根据计划id、楼宇id、楼层id、房间id获取固有风险列表
*
* @param planId 计划id
* @real_return {@link R<List<RiskPlanAppInherentListDto>>}
*/
@GetMapping("/inherent/list/{planId}")
public R<List<RiskPlanAppInherentListDto>> getInherentListByPlanId(@PathVariable("planId") Long planId) {
RiskPlan riskPlan = riskPlanService.selectRiskPlanById(planId);
return R.ok(riskPlanInherentListService.getInherentListByPlanId(riskPlan.getProjectId(), null, null, null));
}
/**
* 添加固有风险
*
......
......@@ -43,6 +43,9 @@ public class RiskPlanAppDetailsDto {
/** 任务详情 */
private RiskPlanAppTaskDetailsDto detailsDto;
/** 风险清单 */
private List<RiskPlanAppInherentListDto> inherentListDtos;
/** 风险清单 */
private List<RiskPlanAppRiskBuildingListDto> riskBuildingListDtos;
......
......@@ -17,6 +17,9 @@ public class RiskPlanAppTaskDetailsDto {
/** id */
private Long id;
/** 任务名称 */
private String name;
/** 任务编号 */
private String no;
......@@ -42,10 +45,10 @@ public class RiskPlanAppTaskDetailsDto {
private String projectName;
/** 所属单位id */
private Long projectDeptId;
private Long deptId;
/** 所属单位 */
private String projectDeptName;
private String deptName;
/** 所在城市 */
private String city;
......
......@@ -64,7 +64,7 @@ public interface RiskPlanInherentListMapper
*/
public int deleteRiskPlanInherentListByIds(Long[] ids);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(@Param("planId") Long planId, @Param("buildingId") Long buildingId, @Param("floorId") Long floorId, @Param("roomId") Long roomId);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(@Param("projectId") Long projectId, @Param("buildingId") Long buildingId, @Param("floorId") Long floorId, @Param("roomId") Long roomId);
RiskPlanAppInherentListDetailsDto getRiskPlanAppInherentListDetailsDtoByInherentId(@Param("inherentId") Long inherentId);
......
......@@ -64,7 +64,7 @@ public interface IRiskPlanInherentListService
*/
public int deleteRiskPlanInherentListById(Long id);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long planId, Long buildingId, Long floorId, Long roomId);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long projectId, Long buildingId, Long floorId, Long roomId);
Integer saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto);
......
......@@ -241,8 +241,8 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
}
@Override
public List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long planId, Long buildingId, Long floorId, Long roomId) {
return riskPlanInherentListMapper.getInherentListByPlanId(planId, buildingId, floorId, roomId);
public List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long projectId, Long buildingId, Long floorId, Long roomId) {
return riskPlanInherentListMapper.getInherentListByPlanId(projectId, buildingId, floorId, roomId);
}
@Override
......
......@@ -13,10 +13,7 @@ import com.censoft.censoftrongtong.domain.dto.RiskPlanAppDetailsDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppListDto;
import com.censoft.censoftrongtong.enums.RiskPlanStatusType;
import com.censoft.censoftrongtong.mapper.RiskPlanMapper;
import com.censoft.censoftrongtong.service.ILedgerBuildingService;
import com.censoft.censoftrongtong.service.IRiskPlanService;
import com.censoft.censoftrongtong.service.IRiskPlanTaskService;
import com.censoft.censoftrongtong.service.IRiskPlanUserBuildingService;
import com.censoft.censoftrongtong.service.*;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -43,6 +40,9 @@ public class RiskPlanServiceImpl implements IRiskPlanService {
@Resource
private IRiskPlanUserBuildingService riskPlanUserBuildingService;
@Resource
private IRiskPlanInherentListService riskPlanInherentListService;
/**
* 查询风险计划
*
......@@ -187,6 +187,9 @@ public class RiskPlanServiceImpl implements IRiskPlanService {
dto.getDetailsDto().setBuildingNames(ledgerBuilding.getName());
}
//风险清单
dto.setInherentListDtos(riskPlanInherentListService.getInherentListByPlanId(null, buildingId, null, null));
//风险清单
dto.setRiskBuildingListDtos(riskPlanMapper.getRiskBuildingListDtoByPlanId(planId,buildingId));
......
......@@ -87,8 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ledger_room lr ON lr.id = rpil.room_id
LEFT JOIN ledger_floor lf ON lf.id = floor_id
LEFT JOIN sys_user su ON su.user_id = rpil.user_id
LEFT JOIN ledger_building lb ON lb.id = lf.building_id
<where>
<if test="planId != null"> AND rpil.plan_id = #{planId}</if>
<if test="projectId != null"> AND lb.project_id = #{projectId}</if>
<if test="buildingId != null"> AND lf.building_id = #{buildingId}</if>
<if test="floorId != null"> AND lf.id = #{floorId}</if>
<if test="roomId != null"> AND lr.id = #{roomId}</if>
......
......@@ -101,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
rp.id,
rp.`no`,
rp.`name`,
su1.user_id AS createUserId,
su1.nick_name AS createUserName,
sd1.dept_id AS createDeptId,
......@@ -108,8 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rp.create_time AS createTime,
lp.id AS projectId,
lp.`name` AS projectName,
sd2.dept_id AS projectDeptId,
sd2.dept_name AS projectDeptName,
sd2.dept_id AS deptId,
sd2.dept_name AS deptName,
lp.city,
rp.building_ids AS buildingIds,
( SELECT GROUP_CONCAT( `name` ) FROM ledger_building WHERE project_id = lp.id ) AS buildingNames,
......
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