Commit 47bb5fb9 authored by zhangjianqian's avatar zhangjianqian

4.隐患排查库,风险点关联“安全风险分区动态展示”中的“风险信息管理”的各辨识部位相关联(多选)

parent 8d9b7f3d
......@@ -28,6 +28,8 @@ public class THiddenLibrary extends BaseEntity
@Excel(name = "风险点")
private String riskPoint;
private String riskPointName;
/** 检查项目 */
@Excel(name = "检查项目")
private String inspectTerm;
......@@ -44,6 +46,14 @@ public class THiddenLibrary extends BaseEntity
@Excel(name = "内容以及标准")
private String libraryContent;
public String getRiskPointName() {
return riskPointName;
}
public void setRiskPointName(String riskPointName) {
this.riskPointName = riskPointName;
}
public String getDeptName() {
return deptName;
}
......
......@@ -58,4 +58,6 @@ public interface TRiskManagerMapper
* @return 结果
*/
public int deleteTRiskManagerByIds(Long[] ids);
public String selectNamesByid(String[] ids);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.system.mapper.TRiskManagerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.THiddenLibraryMapper;
......@@ -18,6 +20,8 @@ public class THiddenLibraryServiceImpl implements ITHiddenLibraryService
{
@Autowired
private THiddenLibraryMapper tHiddenLibraryMapper;
@Autowired
private TRiskManagerMapper tRiskManagerMapper;
/**
* 查询隐患排查库
......@@ -40,7 +44,14 @@ public class THiddenLibraryServiceImpl implements ITHiddenLibraryService
@Override
public List<THiddenLibrary> selectTHiddenLibraryList(THiddenLibrary tHiddenLibrary)
{
return tHiddenLibraryMapper.selectTHiddenLibraryList(tHiddenLibrary);
List<THiddenLibrary> list = tHiddenLibraryMapper.selectTHiddenLibraryList(tHiddenLibrary);
for (THiddenLibrary t :list){
if(t.getRiskPoint()!=null&&!t.getRiskPoint().equals("")){
String name = tRiskManagerMapper.selectNamesByid(t.getRiskPoint().split(","));
t.setRiskPointName(name);
}
}
return list;
}
/**
......
......@@ -3,8 +3,10 @@ package com.zehong.system.service.impl;
import java.util.Date;
import java.util.List;
import com.zehong.system.domain.THiddenLibrary;
import com.zehong.system.domain.THiddenTroubleWork;
import com.zehong.system.mapper.THiddenTroubleWorkMapper;
import com.zehong.system.mapper.TRiskManagerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.THiddenTroubleAssessmentMapper;
......@@ -25,6 +27,8 @@ public class THiddenTroubleAssessmentServiceImpl implements ITHiddenTroubleAsses
private THiddenTroubleAssessmentMapper tHiddenTroubleAssessmentMapper;
@Autowired
private THiddenTroubleWorkMapper tHiddenTroubleWorkMapper;
@Autowired
private TRiskManagerMapper tRiskManagerMapper;
/**
* 查询排查评估
......@@ -52,7 +56,14 @@ public class THiddenTroubleAssessmentServiceImpl implements ITHiddenTroubleAsses
@Override
public List<THiddenTroubleAssessment> selectTHiddenTroubleAssessmentList(THiddenTroubleAssessment tHiddenTroubleAssessment)
{
return tHiddenTroubleAssessmentMapper.selectTHiddenTroubleAssessmentList(tHiddenTroubleAssessment);
List<THiddenTroubleAssessment> list = tHiddenTroubleAssessmentMapper.selectTHiddenTroubleAssessmentList(tHiddenTroubleAssessment);
for(THiddenTroubleAssessment at : list){
if(at.getRiskPoint()!=null&&!at.getRiskPoint().equals("")){
String name = tRiskManagerMapper.selectNamesByid(at.getRiskPoint().split(","));
at.setRiskPoint(name);
}
}
return list;
}
/**
......
......@@ -83,4 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectNamesByid" parameterType="string" resultType="string">
SELECT GROUP_CONCAT(risk_part) FROM t_risk_manager WHERE id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -58,7 +58,7 @@
<!--<el-table-column type="selection" width="55" align="center" />-->
<!--<el-table-column label="风险点" align="center" prop="libraryId" />-->
<el-table-column label="所属部门" align="center" prop="deptName" />
<el-table-column label="风险点" align="center" prop="riskPoint" />
<el-table-column label="风险点" align="center" prop="riskPointName" />
<el-table-column label="隐患名称" align="center" prop="inspectTerm" />
<el-table-column label="检查依据" align="center" prop="inspectBasis" />
<!--<el-table-column label="排查库标题" align="center" prop="libraryName" />-->
......@@ -110,7 +110,15 @@
<!--<el-input v-model="form.deptId" placeholder="请输入部门" />-->
<!--</el-form-item>-->
<el-form-item label="风险点" prop="riskPoint">
<el-input v-model="form.riskPoint" placeholder="请输入风险点" />
<!--<el-input v-model="form.riskPoint" placeholder="请输入风险点" />-->
<el-select v-model="form.riskPoint" multiple placeholder="请选择事故类型">
<el-option
v-for="dict in managerList"
:key="dict.id.toString()"
:label="dict.riskPart"
:value="dict.id.toString()"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="隐患名称" prop="inspectTerm">
<el-input v-model="form.inspectTerm" placeholder="请输入隐患名称" />
......@@ -139,6 +147,8 @@ import Editor from '@/components/Editor';
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listManager } from "@/api/system/manager";
export default {
name: "Library",
components: {
......@@ -169,6 +179,7 @@ export default {
open: false,
// 部门树选项
deptOptions: undefined,
managerList:[],
// 查询参数
queryParams: {
pageNum: 1,
......@@ -176,6 +187,10 @@ export default {
deptId: null,
riskPoint: null,
},
queryParams2:{
pageNum: 1,
pageSize: 1000,
},
// 表单参数
form: {},
// 表单校验
......@@ -201,6 +216,7 @@ export default {
created() {
this.getList();
this.getTreeselect();
this.getManageList();
},
methods: {
/** 查询隐患排查库列表 */
......@@ -212,6 +228,11 @@ export default {
this.loading = false;
});
},
getManageList() {
listManager(this.queryParams2).then(response => {
this.managerList = response.rows;
});
},
// 取消按钮
cancel() {
this.open = false;
......@@ -257,7 +278,9 @@ export default {
this.reset();
const libraryId = row.libraryId || this.ids
getLibrary(libraryId).then(response => {
this.form = response.data;
this.form.riskPoint = this.form.riskPoint.split(",");
this.open = true;
this.title = "修改隐患排查库";
});
......@@ -266,6 +289,7 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.riskPoint = (this.form.riskPoint).join(",");
if (this.form.libraryId != null) {
updateLibrary(this.form).then(response => {
this.msgSuccess("修改成功");
......@@ -328,7 +352,10 @@ export default {
</script>
<style lang="scss" scoped>
::v-deep .vue-treeselect{
width: 200px;
width: 230px;
}
::v-deep .el-select{
width: 100%;
}
::v-deep .el-form-item--medium .el-form-item__content{
line-height: 34px;
......
......@@ -246,7 +246,7 @@
<el-option
v-for="dict in libraryList"
:key="dict.libraryId"
:label="dict.riskPoint+'——'+dict.inspectTerm"
:label="dict.riskPointName+'——'+dict.inspectTerm"
:value="parseInt(dict.libraryId)"
></el-option>
</el-select>
......@@ -646,7 +646,7 @@ export default {
this.getDicts("assessment_level").then(response => {
this.assessmentLevelOptions = response.data;
});
listLibrary({pageNum:1,pageSize:100}).then(response => {
listLibrary({pageNum:1,pageSize:1000}).then(response => {
this.libraryList = response.rows;
});
},
......
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