Commit 0f7f22e7 authored by 陈晓晋's avatar 陈晓晋

固有风险按照楼栋筛选20230728

parent 7be76357
package com.censoft.censoftrongtong.controller; package com.censoft.censoftrongtong.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.censoft.censoftrongtong.domain.RiskPlan;
import com.censoft.censoftrongtong.service.IRiskPlanService;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -33,6 +42,8 @@ public class RiskPlanInherentListController extends BaseController ...@@ -33,6 +42,8 @@ public class RiskPlanInherentListController extends BaseController
{ {
@Autowired @Autowired
private IRiskPlanInherentListService riskPlanInherentListService; private IRiskPlanInherentListService riskPlanInherentListService;
@Autowired
private IRiskPlanService riskPlanService;
/** /**
* 查询固有风险信息列表 * 查询固有风险信息列表
...@@ -41,9 +52,39 @@ public class RiskPlanInherentListController extends BaseController ...@@ -41,9 +52,39 @@ public class RiskPlanInherentListController extends BaseController
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(RiskPlanInherentList riskPlanInherentList) public TableDataInfo list(RiskPlanInherentList riskPlanInherentList)
{ {
startPage();
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
List<String> listBuilds=new ArrayList<>();
List<RiskPlanInherentList> listRs=new ArrayList<>();
if(riskPlanInherentList.getPlanId()!=null){
RiskPlan riskPlan=riskPlanService.selectRiskPlanById(riskPlanInherentList.getPlanId());
listBuilds= Arrays.asList(riskPlan.getBuildingIds().split(","));
}
riskPlanInherentList.setPlanId(null);//查询所有
List<RiskPlanInherentList> list = riskPlanInherentListService.selectRiskPlanInherentListList(riskPlanInherentList); List<RiskPlanInherentList> list = riskPlanInherentListService.selectRiskPlanInherentListList(riskPlanInherentList);
return getDataTable(list); //筛选任务关联楼栋风险信息
if (listBuilds.size()>0) {
for (RiskPlanInherentList planInherentList : list) {
if (listBuilds.contains(planInherentList.getBuildingId())) {
listRs.add(planInherentList);
}
}
}
int num = listRs.size();
listRs = listRs.stream()
.skip((pageNum - 1) * pageSize)
.limit(pageSize)
.collect(Collectors.toList());
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setRows(listRs);
rspData.setTotal(num);
return rspData;
} }
......
...@@ -83,6 +83,12 @@ public class RiskPlan extends BaseEntityClean ...@@ -83,6 +83,12 @@ public class RiskPlan extends BaseEntityClean
/** 删除标志(0代表存在 1代表删除) */ /** 删除标志(0代表存在 1代表删除) */
private String delFlag; private String delFlag;
/**
* 项目名称
*/
@TableField(exist = false)
private String projectName;
......
...@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectRiskPlanVo"> <sql id="selectRiskPlanVo">
select id, name, no, project_id, building_ids, create_user_id, create_dept_id,dept_id, leader_user_id, work_user_ids,approve_user_id, start_time, end_time, status, del_flag, create_by, create_time, update_by, update_time from risk_plan select id, name, no, project_id,(SELECT lp.NAME from ledger_project lp where project_id=lp.id) 'project_name', building_ids, create_user_id, create_dept_id,dept_id, leader_user_id, work_user_ids,approve_user_id, start_time, end_time, status, del_flag, create_by, create_time, update_by, update_time from risk_plan
</sql> </sql>
<select id="selectRiskPlanList" parameterType="com.censoft.censoftrongtong.domain.RiskPlan" resultType="com.censoft.censoftrongtong.domain.dto.RiskPlanAppTaskDetailsDto" > <select id="selectRiskPlanList" parameterType="com.censoft.censoftrongtong.domain.RiskPlan" resultType="com.censoft.censoftrongtong.domain.dto.RiskPlanAppTaskDetailsDto" >
......
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